diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000000..63a1629cb17
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+src/*/bindings/* linguist-generated=true
+
diff --git a/.gitignore b/.gitignore
index 5165012ca44..1ac66b75573 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,3 +35,5 @@ TAGS
build-dir/
build/
+/.cproject
+/.project
diff --git a/.hgtags b/.hgtags
index a869504ba5a..8818007dce8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -74,3 +74,4 @@ fa4be182ef17746cea50e89af557c79a28b76533 ns-3.21
e8634b0101f7be773074f6e42587fa4a6d0563ba ns-3.24
3316e06767e7e6db79bb0bd537af8acb582c8e7d ns-3.25
0287b775fa6c203283a3809ba846992e37e469fb ns-3.26
+68978885b6fc333757fb013ddb0179d29fff9972 ns-3.27
diff --git a/AUTHORS b/AUTHORS
index 260b87efdf0..dd39169be94 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,7 +1,10 @@
John Abraham (john.abraham.in@gmail.com)
+Danilo Abrignani (dabrignani@gmail.com)
Alexander Afanasyev (alexander.afanasyev@ucla.edu)
Rohit Agarwal (mindprince@gmail.com)
Piyush Aggarwal (piyush8311@gmail.com)
+Zoraze Ali (zoraze.ali@cttc.es)
+Robert Ammon (ammo6818@vandals.uidaho.edu)
Kirill Andreev (andreev@iitp.ru)
Dean Armstrong (deanarm@gmail.com)
Stefano Avallone (stefano.avallone@unina.it)
@@ -27,6 +30,7 @@ Scott Carpenter (scarpen@ncsu.edu)
Tiago Cerqueira (tiago.miguel43@gmail.com)
Egemen K. Cetinkaya (ekc@iitc.ku.edu)
Angelos Chatzipapas (chatzipa@ceid.upatras.gr)
+Luciano Jerez Chaves (ljerezchaves@gmail.com)
Eugene Chemeritskiy (echemeritskiy@arccn.ru)
Yufei Cheng (yfcheng@ittc.ku.edu)
Andrey Churin (aachurin@gmail.com)
@@ -38,6 +42,7 @@ Matthieu Coudron (matthieu.coudron@lip6.fr)
Alexander D'souza (moijes12@gmail.com)
Ankit Deepak (adadeepak8@gmail.com)
Sébastien Deronne (sebastien.deronne@gmail.com)
+Christoph Döpmann (doepmanc@informatik.hu-berlin.de)
Craig Dowell (craigdo@ee.washington.edu)
Gilaras Drakeson (gilaras@gmail.com)
Christian Facchini (c.facchini@gmail.com)
@@ -53,12 +58,13 @@ Yida Gao (yidapb@gmail.com)
Thomas Geithner (thomas.geithner@dai-labor.de)
Ashim Ghosh (ashim.atiit@gmail.com)
Martin Giachino (martin.giachino@gmail.com,giachino@fing.edu.uy)
+Nichit Bodhak Goel (nichit93@gmail.com)
Tom Goff (tgoff@tgoff.net)
Mohit Goyal (mohit.bits@gmail.com)
Juan C. Granda (jcgranda@uniovi.es)
David Gross (gdavid.devel@gmail.com)
Maja Grubišić (maja.grubisic@live.com)
-Federico Guerra
+Federico Guerra (federico@guerra-tlc.com)
Charline Taibi Guguen (charline.guguen@gmail.com)
Daniel Halperin (daniel@halper.in)
Bruno Haick (bghaick@hotmail.com)
@@ -74,8 +80,10 @@ Blake Hurd (naimorai@gmail.com)
Pasquale Imputato (p.imputato@gmail.com)
ishan (ishan.chhabra@gmail.com)
Mohamed Amine Ismail (amine.ismail@inria.fr, iamine@udcast.com)
+Toshio Ito (debug.ito@gmail.com)
Jared Ivey (j.ivey@gatech.edu)
Atishay Jain (atishayjain25@gmail.com)
+Sourabh Jain (jainsourabh679@gmail.com)
Sascha Alexander Jopen (jopen@informatik.uni-bonn.de)
Sam Jansen (sam.jansen@gmail.com)
Liu Jian (liujatp@gmail.com)
@@ -84,6 +92,7 @@ Evgeny Kalishenko (ydginster@gmail.com)
Tanmay Kathpalia (tanmay.kathpalia@landisgyr.com)
Konstantinos Katsaros (dinos.katsaros@gmail.com)
Morteza Kheirkhah (m.kheirkhah@sussex.ac.uk)
+Shravya Ks (shravya.ks0@gmail.com)
Flavio Kubota (flaviokubota@gmail.com)
Joe Kopena (tjkopena@cs.drexel.edu)
Christopher Kosecki (christopher.l.kosecki.ctr@mail.mil)
@@ -99,6 +108,7 @@ Björn Lichtblau (lichtbla@informatik.hu-berlin.de)
Timo Lindhorst (tlnd@online.de)
Erwan Livolant (erwan.livolant@inria.fr)
Andrea Lupia (alupia@dimes.unical.it)
+Radu Lupu (rlupu@elcom.pub.ro)
Keith Ma (keith.nwsuaf@gmail.com)
Federico Maguolo (maguolof@dei.unipd.it)
Antti Makela (zarhan@cc.hut.fi)
@@ -108,6 +118,7 @@ Fabian Mauchle (f1mauchl@hsr.ch)
Andrey Mazo (mazo@iitp.ru)
Jonathan McCrohan (jmccroha@tcd.ie)
Andrew McGregor (andrewmcgr@gmail.com)
+Miralem Mehic (miralemmehic@gmail.com)
Vedran Miletić (rivanvx@gmail.com)
Saswat Mishra (clicksaswat@gmail.com)
Jens Mittag (jens.mittag@kit.edu)
@@ -130,6 +141,7 @@ Anh Nguyen (annguyen@ittc.ku.edu)
Duy Nguyen (duy@soe.ucsc.edu)
Luis Pacheco (luisbelem@gmail.com)
Lluís Parcerisa (parcerisa@gmail.com)
+Mingyu Park (darkpmg@naver.com)
Natale Patriciello (natale.patriciello@gmail.com)
Tommaso Pecorella (tommaso.pecorella@unifi.it)
Guangyu Pei (guangyu.pei@boeing.com)
@@ -140,17 +152,24 @@ Colin Perkins (csp@csperkins.org)
Giuseppe Piro (g.piro@poliba.it)
Randall Plate (rplate@spawar.navy.mil)
Yana Podkosova (yanapdk@rambler.ru)
+Michele Polese (michele.polese@gmail.com)
Ovidiu Poncea (ovidiu.poncea@cs.pub.ro)
Vikas Pushkar (vikaskupushkar@gmail.com)
+Manoj Kumar Rana (manoj24.rana@gmail.com)
Andrea Ranieri (andreran@uno.it)
Bruno Ranieri (Yrrsinn@googlemail.com)
+Deepti Rajagopal (deeptir96@gmail.com)
+Varun Reddy (varunamarreddy@gmail.com)
Ken Renard (kenneth.renard@arl.army.mil)
+Getachew Redieteab (redieteab.orange@gmail.com)
Manuel Requena (mrequena@cttc.es)
+Jakub Rewienski (jrewienski@gmail.com)
Matias Richart (mrichart@fing.edu.uy)
George F. Riley (riley@ece.gatech.edu)
Juergen Rinas (jrinas@gmx.de)
Sebastian Rohde (sebastian.rohde@tu-dortmund.de)
Karsten Roscher (sfx@rocktale.de)
+Ali Rostami (a.rostami@rutgers.edu)
Bill Roome (wdr@bell-labs.com)
David (david.rua@gmail.com)
Andrea Sacco (andrea.sacco85@gmail.com)
@@ -158,6 +177,7 @@ Lynne Salameh (l.salameh@cs.ucl.ac.uk)
Providence Salumu Munga (Providence.Salumu@gmail.com, Providence.Salumu_Munga@it-sudparis.eu)
Francisco Javier Sánchez-Roselly (fnavarro@ujaen.es)
Siddharth Santurkar (siddharth.santurkar@ieee.org)
+Gaurav Sathe (gaurav.sathe@tcs.com)
Robert R. Schmidt (rschmi@gmx.net)
Florian Schmidt (Florian.Schmidt@cs.rwth-aachen.de)
Guillaume Seguin (guillaume.seguin@inria.fr)
@@ -170,12 +190,16 @@ Phillip Sitbon (phillip.sitbon@gmail.com)
Pedro Silva (pmms@inesctec.pt)
Anirudh Sivaraman (sk.anirudh@gmail.com)
Steven Smith (smith84@llnl.gov)
+Izydor Sokoler (Izydor.sokoler@gmail.com)
+Lauri Sormunen (lauri.sormunen@magister.fi)
+Akin Soysal (akinsoysal@gmail.com)
Andrew Stanton (acstanton515@gmail.com)
Ewgenij Starostin (estar@cs.tu-berlin.de)
YunQiang Su (wzssyqa@gmail.com)
Brian Swenson (bswenson3@gatech.edu)
Lalith Suresh (suresh.lalith@gmail.com)
Mohit P. Tahiliani (tahiliani.nitk@gmail.com)
+Rohit P. Tahiliani (tahiliar@tcd.ie)
Dave Taht (dave.taht@bufferbloat.net)
Marcos Talau (talau@users.sourceforge.net)
Adrian S. W. Tam (adrian.sw.tam@gmail.com)
@@ -194,6 +218,5 @@ Mitch Watrous (watrous@u.washington.edu)
Florian Westphal (fw@strlen.de)
He Wu (mdzz@u.washington.edu)
Yoshihiko Yazawa (yoshiyaz@gmail.com)
+Menglei Zhang (menglei@nyu.edu)
Dizhi Zhou (dizhi.zhou@gmail.com)
-Gaurav Sathe (gaurav.sathe@tcs.com)
-Ali Rostami (a.rostami@rutgers.edu)
diff --git a/CHANGES.html b/CHANGES.html
index d2e74c9a85a..87ceae1cd1c 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -50,6 +50,34 @@
to this file based on your experience, please contribute a patch or drop
us a note on ns-developers mailing list.
+
+Changes from ns-3.27 to ns-3-dev
+New API:
+
+ - When deserializing Packet contents, Header::Deserialize (Buffer::Iterator start) and Trailer::Deserialize (Buffer::Iterator start) can not successfully deserialize variable-length headers and trailers. New variants of these methods that also include an 'end' parameter are now provided.
+ - Ipv[4,6]AddressGenerator can now check if an address is allocated (Ipv[4,6]AddressGenerator::IsAddressAllocated) or a network has some allocated address (Ipv[4,6]AddressGenerator::IsNetworkAllocated).
+ - LTE UEs can now use IPv6 to send and receive traffic.
+ - UAN module now supports IP stack.
+ - Class TcpSocketBase attribute CongestionWindowInflated shows the values with the in-recovery inflation and the post-recovery deflation.
+
- Added a FIFO queue disc (FifoQueueDisc) and the Token Bucket Filter (TbfQueueDisc).
+
+Changes to existing API:
+
+ - Class LrWpanMac now supports extended addressing mode. Both McpsDataRequest and PdDataIndication methods will now use extended addressing if McpsDataRequestParams::m_srcAddrMode or McpsDataRequestParams::m_dstAddrMode are set to EXT_ADDR.
+ - Class LteUeNetDevice MAC address is now a 64-bit address and it's set during construction.
+ - Class TcpSocketBase attribute CongestionWindow shows the values without the in-recovery inflation and the post-recovery deflation.
+
+Changes to build system:
+
+Changed behavior:
+
+ - The Mode, MaxPackets and MaxBytes attributes of the Queue class have been deprecated in favor of the
+ MaxSize attribute. Old attributes can still be used, but using them will be no longer possible in one of the next releases. The methods to get/set the old attributes will be removed as well.
+ - The attributes of the QueueDisc subclasses that separately determine the mode and the limit of the QueueDisc have been deprecated in favor of the single MaxSize attribute.
+ - The GetQueueSize method of some QueueDisc subclasses (e.g., Red) has been removed and replaced by the GetCurrentSize method of the QueueDisc base class.
+
+
Changes from ns-3.26 to ns-3.27
New API:
@@ -93,6 +121,42 @@ New API:
which returns a vector of pairs (dscp,count), each of which indicates how many packets with the
associated dscp value have been classified for a given flow.
+MqQueueDisc, a multi-queue aware queue disc modelled after the mq qdisc in Linux, has been introduced.
+
+Two new methods, QueueDisc::DropBeforeEnqueue() and QueueDisc::DropAfterDequeue() have
+ been introduced to replace QueueDisc::Drop(). These new methods require the caller to specify the
+ reason why a packet was dropped. Correspondingly, two new trace sources ("DropBeforeEnqueue" and
+ "DropAfterDequeue") have been added to the QueueDisc class, providing both the items that were dropped
+ and the reason why they were dropped.
+
+Added QueueDisc::GetStats() which returns detailed statistics about the operations of
+ a queue disc. Statistics can be accessed through the member variables of the returned object and
+ by calling the GetNDroppedPackets(), GetNDroppedBytes(), GetNMarkedPackets() and GetNMarkedBytes() methods on the returned object. Such methods return the number of packets/bytes
+ dropped/marked for the specified reason (passed as argument). Consequently:
+
+ - A number of methods of the QueueDisc class have been removed: GetTotalReceivedPackets(),
+ GetTotalReceivedBytes(), GetTotalDroppedPackets(), GetTotalDroppedBytes(),
+ GetTotalRequeuedPackets(), GetTotalRequeuedBytes().
+ - The Stats struct and the GetStats() method of RedQueueDisc and PieQueueDisc have been removed and replaced by those of the QueueDisc base class.
+ - The GetDropOverLimit and GetDropCount methods of CoDelQueueDisc have been removed.
+ The values they returned can be obtained by calling, respectively,
+ GetStats ().GetNDroppedPackets (CoDelQueueDisc::OVERLIMIT_DROP) and
+ GetStats ().GetNDroppedPackets (CoDelQueueDisc::TARGET_EXCEEDED_DROP). The "DropCount" trace of
+ CoDelQueueDisc has been removed as well. Packets dropped because the target is exceeded can
+ be obtained through the new "DropAfterDequeue" trace of the QueueDisc class.
+
+
+ The new QueueDisc::Mark() method has been introduced to allow subclasses to request to mark a packet.
+ The caller must specify the reason why the packet must be marked. Correspondingly, a new trace source ("Mark")
+ has been added to the QueueDisc class, providing both the items that were marked and the reason why they
+ were marked.
+
+A new trace source, SojournTime, is exported by the QueueDisc base class to provide the
+ sojourn time of every packet dequeued from a queue disc. This has been made possible by adding a
+ timestamp to QueueDiscItem objects, which can be set/get through the new GetTimeStamp() and
+ SetTimeStamp() methods of the QueueDiscItem class. The CoDel queue disc now makes use of such feature of the base class, hence its Sojourn trace source and the CoDelTimestampTag class
+ have been removed.
+
Changes to existing API:
@@ -117,9 +181,27 @@ Changes to existing API:
and WifiPhy::MaxSupportedRxSpatialStreams. A new attribute WifiPhy::Antennas
was added to allow users to define the number of physical antennas on the device.
+- Sockets do not receive anymore broadcast packets, unless they are bound to an "Any" address (0.0.0.0)
+ or to a subnet-directed broadcast packet (e.g., x.y.z.0 for a /24 noterok).
+ As in Linux, the following rules are now enforced:
+
+ - A socket bound to 0.0.0.0 will receive everything.
+ - A socket bound to x.y.z.0/24 will receive subnet-directed broadcast (x.y.z.255) and unicast packets.
+ - A socket bound to x.y.z.w will only receive unicast packets.
+
+ Previously, a socket bound to an unicast address received also subnet-directed broadcast packets.
+ This is not anymore possible.
+
+- You can now Bind as many socket as you want to an address/port, provided that they are bound to different NetDevices.
+ Moreover, BindToNetDevice does not anymore call Bind. In other terms, Bind and BindToNetDevice can be called
+ in any order.
+ However, it is suggested to use BindToNetDevice before Bind in order to avoid conflicts.
+
Changes to build system:
+- The API scanning process for Python bindings now relies on CastXML, and only 64-bit scans are presently supported (Linux 64-bit systems). Generation of 32-bit scans is documented in the Python chapter of the ns-3 manual.
+
- Modules can now be located in the 'contrib/' directory in addition to 'src/'
- Behavior for running Python programs was aligned with that of C++ programs; the list of modules built is no longer printed out.
@@ -139,6 +221,8 @@
Changed behavior:
- The default value of the TxGain and RxGain attributes in WifiPhy was changed from 1 dB to 0 dB.
+ - The reported SNR by WifiPhy::MonitorSnifferRx did not include the RxNoiseFigure, but now does; see bug 2783 for discussion.
+
- Queue has been redesigned as a template class object, where the type parameter
specifies the type of items to be stored in the queue. As a consequence:
@@ -155,6 +239,13 @@ Changed behavior:
- Queue discs that can operate both in packet mode and byte mode (Red, CoDel, Pie) define their own
enum QueueDiscMode instead of using QueueBase::QueueMode.
+- The CoDel, PIE and RED queue discs require that the size of the internal queue is the same as
+ the queue disc limit (previously, it was allowed to be greater than or equal).
+
+ - The default value of the EnableBeaconJitter attribute in ApWifiMac was changed from false to true.
+
+ - The NormalClose() callback of a TcpSocket object used to fire upon leaving TIME_WAIT state (2*MSL after FINs have been exchanged). It now fires upon entering TIME_WAIT state. Timing of the callback for the other path to state CLOSED (through LAST_ACK) has not been changed.
+
@@ -1433,6 +1524,8 @@ Changes to existing API:
Changed behavior:
+ - If the data inside the TCP buffer is less than the available window, TCP tries to ask for more data to the application, in the hope of filling the usable transmission window. In some cases, this change allows sending bigger packets than the previous versions, optimizing the transmission.
+ - In TCP, the ACK is now processed before invoking any routine that deals with the segment sending, except in case of retransmissions.
diff --git a/README b/README
index c1b8be10727..b139b327757 100644
--- a/README
+++ b/README
@@ -52,7 +52,7 @@ type the command
./waf configure --enable-examples
followed by
./waf
-in the the directory which contains
+in the directory which contains
this README file. The files built will be copied in the
build/ directory.
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index a3d1eae0691..b01c269e102 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -19,88 +19,240 @@ This release is not yet available.
Supported platforms
-------------------
This release is intended to work on systems with the following minimal
-requirements:
+requirements (Note: not all features available on all platforms):
+
+This release has been tested on the following platforms:
+
+New user-visible features
+-------------------------
+- (tcp) Added TCP-LP as congestion control module
+- (tcp) RFC 6675 third rule for generating next sequence to transmit is used only when SACK is enabled
+- (tcp) Added a CongestionWindowInflated trace which, in case of non-SACK connections, will show the congestion window values as they were on previous releases.
+- (lr-wpan) Extended addressing mode is now supported.
+- (tcp) Implemented the core functionality of TCP Pacing.
+- (internet) Ipv[4,6]AddressGenerator can now check if an address or a network is allocated.
+- (internet) Ipv6AddressHelper is now more pedantic but you can use more than one in a script.
+- (lte) UEs can now use IPv6 to send and receive traffic.
+- (uan) UAN module now supports IP stack
+
+Bugs fixed
+----------
+- Bug 1745 - There can be only one Ipv6AddressHelper in a script
+- Bug 1783 - tcp: Experiencing drops during fast recovery causes TCP's congestion window to blow up. Not anymore.
+- Bug 2107 - lte: Enable PCAP for S1 and X2 point-to-point links
+- Bug 2277 - lte: EpcTftClassifier::Classify blindly assumes that a packet has a L4 header
+- Bug 2505 - network: Avoid asserts in Header/Trailer deserialization
+- Bug 2656 - wifi: Minstrel and MinstrelHt provide different results for 802.11a/b/g
+- Bug 2653 - tcp: Avoid saving smaller TS in case of packet reordering
+- Bug 2754 - lte: Incorrect arguments passed to Asn1Header::SerializeInteger
+- Bug 2764 - wifi: WifiSpectrumModelId doesn't distinguish 11ax from legacy
+- Bug 2766 - core: Modify logging for int64x64 to avoid stack overflow
+- Bug 2768 - lte: LteUeNetDevice has a null MAC address
+- Bug 2774 - wifi: Wifi Transmitter Sends ADDBA Request Continuously Even After Transmitting Delba Frame
+- Bug 2791 - wifi: Interference Helper gives negative trace value for Interference Power
+- Bug 2807 - energy: GetTotalEnergyConsumption is not updated correctly
+- Bug 2809 - wifi: Wifi doesn't fully stop when energy is depleted
+- Bug 2813 - wifi: OFDM 10 MHz and 5 MHz PHYs do not have correct subcarrier frequency spacings
+- Bug 2820 - wifi: segmentation fault when Rrpaa wifi manager is used
+- Bug 2824 - ICMP opcode fr fragment timeout drop is wrong
+- Bug 2826 - wifi: Management frames should be sent using the lowest basic rate
+- Bug 2827 - wifi: Active scanning not working with 802.11n/ac/ax
+- Bug 2828 - OLSR simple P2P example produces wrong results
+- Bug 2831 - wifi: runtime channel width switch has no effect
+- Bug 2836 - wifi: Missing VHT information in radiotap header when A-MPDU is used
+- Bug 2838 - wifi: ht-wifi-network crashes with RTS/CTS enabled and frequency set to 2.4GHz
+- Bug 2840 - lte: Wrong configuration of eNBs and UEs
+- Bug 2843 - spectrum, wifi: Incorrect channel width and center frequency provided for non-HT PPDUs when building SpectralDensity
+- Bug 2848 - wifi: Association ID not correctly set upon association
+- Bug 2849 - lte: Received RLC and PDCP PDUs are missing in the stats files
+- Bug 2854 - wifi: he-wifi-network crashes when frequency is set at 2.4 GHz
+- Bug 2859 - tcp: calculation of BytesInFlight during partial recovery is fixed
+- Bug 2866 - tcp: Removed VS warnings on TcpSocketBase
+- Bug 2873 - tcp: Potential SIGFPE in TcpYeah
+- Bug 2874 - tcp: Corrected interpretation of RFC 6675 for IsLost check
+- Bug 2875 - tcp: Use Rule3 of RFC6675 only with SACK enabled
+- Bug 2876 - tcp: Do not shrink adv window after we send the FIN
+- Bug 2877 - wifi: Wrong data types for CWmin and CWmax
+- Bug 2885 - lte: Tests fail for CQA and PSS testsuites
+
+Known issues
+------------
+In general, known issues are tracked on the project tracker available
+at http://www.nsnam.org/bugzilla/
+
+Release 3.27
+============
+
+Availability
+------------
+This release is available from:
+https://www.nsnam.org/release/ns-allinone-3.27.tar.bz2
+
+Supported platforms
+-------------------
+This release is intended to work on systems with the following minimal
+requirements (Note: not all features available on all platforms):
- g++-4.9 or later (Note: this is an upgraded requirement from ns-3.26)
- Apple LLVM version 7.0.2 or later
- clang-3.3 or later
- Python 2.7 (Python 2 series) or Python 3.4 (Python 3 series) or later
+This release has been tested on the following platforms:
+- Ubuntu 17.04 (64 bit) with g++-6.3.0
+- Ubuntu 16.04 (64 bit) with g++-5.4.0
+- Ubuntu 14.04.5 (64 bit) with g++-4.9.4
+ - Note: the default g++ version (4.8) must be upgraded
+- Fedora Core 26 (64 bit) with g++-7.1.1
+- Fedora Core 22 (64 bit) with g++-5.3.1
+- CentOS/RHEL 7.4 (64-bit) with g++-6.3.1
+ - Note: the default g++ version (4.8) must be upgraded
+- CentOS/RHEL 6.8 (64-bit) with g++-4.9.2
+ - Note: the default g++ version (4.4) must be upgraded
+ - Note: the default Python version (2.6) must be upgraded
+- OS X Sierra 10.12.6 with Xcode 9.0 and Apple LLVM version 9.0.0
+- OS X El Capitan 10.11.6 with Xcode 8.2.1 and Apple LLVM version 8.0.0
+- OS X Yosemite 10.10.5 with Xcode 7.2.1 and Apple LLVM version 7.0.2
+- Windows 10 Linux Subsystem with g++-5.4.0
+
New user-visible features
-------------------------
-- (wifi) 802.11ax High Efficiency (HE) physical layer modes are now supported.
-- (tcp) The SACK option and the RFC 6675 loss recovery algorithm are now supported.
+- (build) Modules can also be located in contrib/ directory (as well as src/)
+- (core) Logging timestamp precision has been improved
- (lte) LTE carrier aggregation feature according to 3GPP Release 10 is now supported.
-- (network) CsmaNetDevice, SimpleNetDevice and WifiNetDevice support flow control.
+- (traffic-control) CsmaNetDevice, SimpleNetDevice and WifiNetDevice support flow control.
+- (traffic-control) Added support for queue discs to mark packets, and ECN support has been added to RED
+- (traffic-control) A multi-queue aware queue disc modelled after Linux mq
+- (traffic-control) Added support for detailed statistics output of queue discs
+- (traffic-control) Added support for tracing queue sojourn times
+- (tcp) The SACK option and the RFC 6675 loss recovery algorithm are now supported.
+- (tcp) A LEDBAT model has been added.
+- (wifi) 802.11ax High Efficiency (HE) physical layer modes are now supported.
+- (wifi) A new RRPAA rate control mechanism has been added.
+- (wifi) A new trace source for TXOP duration is now supported
+- (wifi) Frame capture effect can now be modelled
+- (uan) World Ocean System Simulation (WOSS) integration, and new PER models
Bugs fixed
----------
+- Bug 1034 - wifi: No trace source for packet dropping from WifiMacQueue
- Bug 2007 - uan: Remove deprecation on SetRxThresholdDb
+- Bug 2048 - lte: Fix scheduler resource allocation when CQI==0 (out of rante)
+- Bug 2133 - tcp: Avoid assert when receiving data in FIN_WAIT_1 or _2 states
- Bug 2214 - tcp: Use of ScheduleNow only in selected part of the code
- Bug 2221 - network: Remove constraint on size of ns3::Packet Tag objects
-- Bug 2248 - tcp: TCP SACK added after reviews
- Bug 2256 - tcp: bytes in flight now updated in TcpTxBuffer
-- Bug 2263 - Support processing of multiple TCP options
-- Bug 2367 - BlockAckManager does not remove iterators to freed items
-- Bug 2450 - LogDistancePropagationLossModel is not continuous
-- Bug 2463 - create trace source to trace the TXOP time that is actually used
-- Bug 2471 - unable to disable Block Ack agreement for 802.11n
-- Bug 2477 - DCF manager assert
-- Bug 2485 - Check for queue full should happen before checking RED thresholds
-- Bug 2491 - replace DcfManager::MY_DEBUG
+- Bug 2263 - tcp: Support processing of multiple TCP options
+- Bug 2285 - tcp: Loss of ack of SYN can cause improper connection setup
+- Bug 2367 - wifi: BlockAckManager does not remove iterators to freed items
+- Bug 2450 - propagation: LogDistancePropagationLossModel is not continuous
+- Bug 2456 - lte: MemberCschedSapProvider and Member CschedSapProvider templates
+- Bug 2464 - spectrum: Store spectrum conversion matrix in CSR format
+- Bug 2467 - spectrum: Do not schedule StartRx for receivers on other models
+- Bug 2471 - wifi: unable to disable Block Ack agreement for 802.11n
+- Bug 2477 - wifi: DCF manager assert
+- Bug 2485 - traffic-control: Check queue full before checking RED thresholds
+- Bug 2491 - wifi: replace DcfManager::MY_DEBUG
- Bug 2492 - uan: Make use of RxGain attribute in UanPhyGen class
-- Bug 2511 - HT Greenfield is not working
-- Bug 2512 - Byte mode not configured correctly in red-queue-disc-test-suite.cc
-- Bug 2513 - ParetoRandomVariable needs a "scale", not a "mean" attribute.
-- Bug 2518 - Suppress printing of list of modules for Python programs
-- Bug 2521 - Include ipv6-option.h in wscript
-- Bug 2527 - PrintRoutingTable extended to add an optional Time::Units parameter
-- Bug 2528 - 802.11n RIFS cannot be enabled
-- Bug 2529 - Missing trace when Block ACK timeout is triggered or when missing MPDUs are announced by a Block ACK response
-- Bug 2530 - Rename aodv::SetBalckListTimeout to aodv::SetBlackListTimeout
-- Bug 2532 - Inconsistencies between 802.11n MCS and NSS value reported in TXVECTOR
-- Bug 2533 - Provide a better 802.11n/ac PHY abstraction model for SIMO, MISO and MIMO
-- Bug 2535 - memory leak in bench-simulator.cc
-- Bug 2536 - fixed dead assignment and potential memory leak in wimax
-- Bug 2537 - Dead assigment on CoDel::DoDequeue
-- Bug 2538 - fixed dead assignment on tap-bridge
-- Bug 2540 - fixed dead assignment on mesh/ie-dot11s-perr
-- Bug 2541 - preamble not assigned correctly
-- Bug 2542 - dead assignment on wifi mac-low
-- Bug 2545 - Optimized build fails for flow-monitor
-- Bug 2547 - dead assignments on various tcp congestion controls
-- Bug 2551 - wifi preamble should be part of TXVECTOR
-- Bug 2552 - Remove code duplication between Yans and Spectrum
-- Bug 2559 - TCP advertised window still incorrect
-- Bug 2561 - TCP can not use Connect after a BindToNetDevice
-- Bug 2563 - Modify pybindgen version check to >= minimum version required
-- Bug 2564 - Simulation crashes when CtsTimeout is triggered for A-MPDU transmissions
-- Bug 2566 - BlockAckManager::GetNRetryNeededPackets missing some packets in the queue
-- Bug 2573 - Added TCP Ledbat
-- Bug 2577 - simulation crashes when A-MPDU and multiple TOS are used with RTS-CTS enabled
-- Bug 2578 - Assert "Internal collision but no packet in queue" unexpectedly triggered
-- Bug 2584 - MacLow triggers StartNext even if there is no TXOP
-- Bug 2587 - Avoid overflow in htcp.cc
-- Bug 2590 - Minor enhancements in red-queue-disc{.h, .cc}
-- Bug 2591 - 802.11e Block Ack mechanism cannot be enabled on HT/VHT stations
-- Bug 2594 - vht-wifi-network provides very low throughtput at MCS 6, 160 MHz, SGI
-- Bug 2601 - HT stations should use 40 MHz channel width if the configured channel width is set to 80 or 160 MHz
-- Bug 2604 - QosData frames with Block Ack policy should be separated by SIFS as long as they belong to the same TXOP
-- Bug 2605 - A HT/VHT station transmitting to a legacy access point results in a null throughput
-- Bug 2606 - Ideal rate manager does not work correctly when a HT/VHT station is transmitting to a legacy access point
-- Bug 2613 - MaxRxSequence () is sometimes too large
-- Bug 2607 - Minstrel HT manager results in an endless loop when a 802.11ac station is transmitting to a 802.11a access point
-- Bug 2614 - RIP header version should be set to 2
-- Bug 2615 - When the TXOP limit is nonzero, packets should be fragmented so that the TXOP limit is not exceeded
-- Bug 2627 - Ipv6RawSocket does not honor the bound interface when sending packets
-- Bug 2628 - Simulation crashes because of an out of range TID
-- Bug 2629 - Assert failure in MinstrelHtWifiManager::GetLowestIndex
-- Bug 2647 - ideal-wifi-manager-example crashes when NSS > 1
-- Bug 2654 - Rraa wifi manager cannot be used with 802.11b
-- Bug 2655 - A-MPDU simulation using TCP sometimes fails with message "Packet has no Traffic ID"
-- Bug 2660 - TrafficControlHelper::Default should not configure internal queue sizes
-- Bug 2665 - Ipv4RawSocket can not send packets to broadcast or multicast
-- Bug 2671 - ArpCache::Entry::SetMacAddress is misspelled
-- Bug 2717 - Fix mask generation for Ipv4RoutingTableEntry::CreateDefaultRoute
+- Bug 2511 - wifi: HT Greenfield is not working
+- Bug 2512 - traffic-control: Byte mode not configured correctly for RED test
+- Bug 2513 - core: ParetoRandomVariable needs a "scale", not a "mean" attribute
+- Bug 2518 - build: Suppress printing of list of modules for Python programs
+- Bug 2519 - lte: m_windowOffsetsMap.end () dereference
+- Bug 2520 - examples: TCP variant not configured in wifi-tcp.cc
+- Bug 2521 - internet: Include ipv6-option.h in wscript
+- Bug 2523 - lte: Generate the RLC PDU properly
+- Bug 2527 - internet: PrintRoutingTable adds an optional Time::Units parameter
+- Bug 2528 - wifi: 802.11n RIFS cannot be enabled
+- Bug 2529 - wifi: Missing trace for Block ACK timeout or missing MPDUs
+- Bug 2530 - aodv: Rename aodv::SetBalckListTimeout to aodv::SetBlackListTimeout
+- Bug 2531 - lte: Set HARQ feedback default value to avoid false retrasmissions
+- Bug 2532 - wifi: Inconsistencies between 802.11n MCS and NSS value in TXVECTOR
+- Bug 2533 - wifi: Provide better 802.11n/ac PHY abstraction for SIMO/MISO/MIMO
+- Bug 2534 - traffic-control: ARED and PIE examples should return 1 upon exit
+- Bug 2535 - utils: memory leak in bench-simulator.cc
+- Bug 2536 - wimax: fixed dead assignment and potential memory leak in wimax
+- Bug 2537 - traffic-control: Fix dead assigment on CoDel::DoDequeue
+- Bug 2538 - tap-bridge: fixed dead assignment on tap-bridge
+- Bug 2540 - mesh: fixed dead assignment on mesh/ie-dot11s-perr
+- Bug 2541 - wifi: preamble not assigned correctly
+- Bug 2542 - wifi: dead assignment on wifi mac-low
+- Bug 2543 - lte: Fix when EstimateUlSinr returns NO_SINR
+- Bug 2545 - flow-monitor: Optimized build fails for flow-monitor
+- Bug 2547 - tcp: dead assignments on various tcp congestion controls
+- Bug 2551 - wifi: wifi preamble should be part of TXVECTOR
+- Bug 2552 - wifi: Remove code duplication between Yans and Spectrum
+- Bug 2554 - wave: Fix static analysis warning
+- Bug 2556 - csma, point-to-point: Avoid modification of transmitted packets
+- Bug 2557 - point-to-point: Fix dead assignments in queue-discs-benchmark
+- Bug 2559 - tcp: TCP advertised window still incorrect
+- Bug 2561 - tcp: TCP can not use Connect after a BindToNetDevice
+- Bug 2563 - bindings: pybindgen version check to >= minimum version required
+- Bug 2564 - wifi: Simulation crashes when CtsTimeout triggered for A-MPDU
+- Bug 2565 - tcp: Do not wait for 2*MSL to notify socket close
+- Bug 2566 - wifi: BlockAckManager::GetNRetryNeededPackets missing some packets
+- Bug 2568 - examples: Avoid enumerating TCP variants
+- Bug 2577 - wifi: crashes when A-MPDU and multiple TOS used, upon CTS timeout
+- Bug 2578 - wifi: Unexpected assert "Internal collision but no packet in queue"
+- Bug 2584 - wifi: MacLow triggers StartNext even if there is no TXOP
+- Bug 2587 - tcp: Avoid overflow in htcp.cc
+- Bug 2590 - traffic-control: Minor enhancements in red-queue-disc{.h, .cc}
+- Bug 2591 - wifi: 802.11e Block Ack cannot be enabled on HT/VHT stations
+- Bug 2594 - wifi: vht-wifi-network very low throughtput at MCS 6, 160 MHz, SGI
+- Bug 2596 - network: EthernetTrailer::GetFcs() should be const
+- Bug 2601 - wifi: HT stations should use 40 MHz width if configured 80 or 160z
+- Bug 2604 - wifi: QosData frames separation with Block Ack enabled
+- Bug 2605 - wifi: HT/VHT station sending to legacy results in null throughput
+- Bug 2606 - wifi: Ideal rate manager for HT/VHT station to a legacy AP
+- Bug 2607 - wifi: Correct overflow in channel width loop in Minstrel HT
+- Bug 2613 - tcp: MaxRxSequence () is sometimes too large
+- Bug 2614 - internet: RIP header version should be set to 2
+- Bug 2615 - wifi: When the TXOP limit is nonzero, fragment in some cases
+- Bug 2617 - traffic-control: PfifoFastQueueDisc::Peek all bands
+- Bug 2621 - wifi: Fix mismatch between log message and action
+- Bug 2624 - lte: Inconsistent coding of type and naming
+- Bug 2627 - internet: Ipv6RawSocket does not honor the bound interface
+- Bug 2628 - wifi: Simulation crashes because of an out of range TID
+- Bug 2629 - wifi: Assert failure in MinstrelHtWifiManager::GetLowestIndex
+- Bug 2632 - lte: Build error due to uninitialized variable in rem helper
+- Bug 2646 - lte: lena-simple-eps-emu example will never work
+- Bug 2647 - wifi: ideal-wifi-manager-example crashes when NSS > 1
+- Bug 2649 - tcp: Disabling TCP SACK doesn't fall back to NewReno
+- Bug 2654 - wifi: Rraa wifi manager cannot be used with 802.11b
+- Bug 2655 - wifi: A-MPDU simulation using TCP sometimes fails
+- Bug 2658 - core: Avoid unexpected TracedValue type conversions
+- Bug 2660 - traffic-control: TrafficControlHelper::Default configuration
+- Bug 2661 - wave: Fix outdated class references in documentation
+- Bug 2665 - internet: Ipv4RawSocket can not send to broadcast or multicast
+- Bug 2666 - lte: Remove deprecated variables/config paths
+- Bug 2668 - various: Make template classes use NS_LOG_* macros
+- Bug 2671 - internet: ArpCache::Entry::SetMacAddress is misspelled
+- Bug 2673 - wifi: run-time channel switch does not update WiFi spectrum model
+- Bug 2675 - traffic-control: Use correct string value in PIE example
+- Bug 2716 - tcp: TCP socket ignoring FIN flag when in FIN_WAIT state
+- Bug 2717 - internet: Fix mask for Ipv4RoutingTableEntry::CreateDefaultRoute
+- Bug 2722 - wifi: 802.11g sends DSSS spectrum signals inappropriately
+- Bug 2731 - lte: Allow retranmission in RLC AM when PR expires, vtS overflows
+- Bug 2732 - applications: BulkSend Tx trace is fired too much
+- Bug 2733 - wifi: Ideal wifi manager cannot handle NSS higher than 1
+- Bug 2741 - internet: IPv4 fragmentation fails on last fragment fragmentation
+- Bug 2744 - wifi: 802.11n/ac with RTS/CTS crashes for a large number of nodes
+- Bug 2751 - traffic-control: QueueDisc::Enqueue() order of operations
+- Bug 2756 - internet: Ipv4AddressGenerator underestimates available addresses
+- Bug 2757 - wifi: 802.11n/ac/ax maximum TXOP is not properly enforced
+- Bug 2758 - internet: IPv4 sockets bound to unicast receiving subnet broadcast
+- Bug 2759 - internet: Packet conversion from broadcast to subnet-directed
+- Bug 2760 - internet: OLSR uses unicast-bound sockets to receive broadcasts
+- Bug 2761 - wifi: Packet has no Traffic ID for CTS frames when A-MPDU is used
+- Bug 2762 - internet: BindToNetDevice behaviour is not coherent with Linux
+- Bug 2763 - wifi: management packets in PCAPs are marked as wrong by Wireshark
+- Bug 2769 - tcp: Set ssthresh correctly upon RTO
+- Bug 2771 - wifi: IdealWifiManager problems under different number of antennas
+- Bug 2776 - wifi: Fix segmentation fault in MacLow
+- Bug 2777 - lte: Save bearer info in m_drbMap, needed for handover request
+- Bug 2781 - tcp: Do not go beyond limit in TcpTxBuffer
+- Bug 2783 - wifi: MonitorSnifferRx SNR is invariant to RxNoiseFigure
+- Bug 2786 - lte: Remove unimplemented declaration
+- Bug 2796 - tcp: NSC TCP transmission flow control not working
Known issues
------------
diff --git a/bindings/python/ns3modulegen_core_customizations.py b/bindings/python/ns3modulegen_core_customizations.py
index fa79960f25b..087aa361bd3 100644
--- a/bindings/python/ns3modulegen_core_customizations.py
+++ b/bindings/python/ns3modulegen_core_customizations.py
@@ -71,7 +71,7 @@ def create_type_handler(self, type_handler, *args, **kwargs):
args = tuple([correct_ctype] + list(args[1:]))
handler = type_handler(*args, **kwargs)
- handler.set_tranformation(self, orig_ctype)
+ handler.set_transformation(self, orig_ctype)
return handler
def untransform(self, type_handler, declarations, code_block, expression):
@@ -412,7 +412,7 @@ def add_std_ofstream(module):
class IosOpenmodeParam(Parameter):
DIRECTIONS = [Parameter.DIRECTION_IN]
- CTYPES = ['std::ios::openmode', 'std::_Ios_Openmode']
+ CTYPES = ['std::ios_base::openmode', 'std::_Ios_Openmode']
def convert_c_to_python(self, wrapper):
assert isinstance(wrapper, ReverseWrapperBase)
@@ -420,7 +420,7 @@ def convert_c_to_python(self, wrapper):
def convert_python_to_c(self, wrapper):
assert isinstance(wrapper, ForwardWrapperBase)
- name = wrapper.declarations.declare_variable("std::ios::openmode", self.name, self.default_value)
+ name = wrapper.declarations.declare_variable("std::ios_base::openmode", self.name, self.default_value)
wrapper.parse_params.add_parameter('i', ['&'+name], self.name, optional=bool(self.default_value))
wrapper.call_params.append(name)
diff --git a/bindings/python/ns3modulescan-modular.py b/bindings/python/ns3modulescan-modular.py
index ab1bb9cf76a..e3a904918e7 100644
--- a/bindings/python/ns3modulescan-modular.py
+++ b/bindings/python/ns3modulescan-modular.py
@@ -4,20 +4,21 @@
import os.path
import pybindgen.settings
-from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning, find_declaration_from_name
+from pybindgen.castxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning, find_declaration_from_name
from pybindgen.typehandlers.codesink import FileCodeSink
from pygccxml.declarations import templates
from pygccxml.declarations.enumeration import enumeration_t
from pygccxml.declarations.class_declaration import class_t
-from pygccxml.declarations.calldef import free_function_t, member_function_t, constructor_t, calldef_t
-
+from pygccxml.declarations.free_calldef import free_function_t
+from pygccxml.declarations.calldef_members import constructor_t, member_function_t
+from pygccxml.declarations.calldef import calldef_t
## we need the smart pointer type transformation to be active even
-## during gccxml scanning.
+## during castxml scanning.
import ns3modulegen_core_customizations
-## silence gccxmlparser errors; we only want error handling in the
+## silence castxmlparser errors; we only want error handling in the
## generated python script, not while scanning.
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, dummy_wrapper, dummy_exception, dummy_traceback_):
@@ -34,6 +35,8 @@ def handle_error(self, dummy_wrapper, dummy_exception, dummy_traceback_):
def get_ns3_relative_path(path):
l = []
head = path
+ if not path:
+ return
while head:
new_head, tail = os.path.split(head)
if new_head == head:
@@ -58,7 +61,8 @@ def __call__(self, module_parser,
ns3_header = get_ns3_relative_path(pygccxml_definition.location.file_name)
except ValueError: # the header is not from ns3
return # ignore the definition, it's not ns-3 def.
-
+ if not ns3_header:
+ return
definition_module = self.headers_map[ns3_header]
## Note: we don't include line numbers in the comments because
@@ -78,7 +82,7 @@ def __call__(self, module_parser,
if isinstance(pygccxml_definition, member_function_t) \
and pygccxml_definition.parent.name == 'Object' \
and pygccxml_definition.name == 'GetObject':
- template_args = templates.args(pygccxml_definition.demangled_name)
+ template_args = templates.args(str(pygccxml_definition))
if template_args == ['ns3::Object']:
global_annotations['template_instance_names'] = 'ns3::Object=>GetObject'
@@ -227,13 +231,13 @@ def ns3_module_scan(top_builddir, module_name, headers_map, output_file_name, cf
module_parser.add_pre_scan_hook(PreScanHook(headers_map, module_name))
#module_parser.add_post_scan_hook(post_scan_hook)
- gccxml_options = dict(
+ castxml_options = dict(
include_paths=[top_builddir],
define_symbols={
#'NS3_ASSERT_ENABLE': None,
#'NS3_LOG_ENABLE': None,
},
- cflags=('--gccxml-cxxflags "%s -DPYTHON_SCAN"' % cflags)
+ cflags=('-std=c++14 %s' % cflags)
)
try:
@@ -255,9 +259,8 @@ def ns3_module_scan(top_builddir, module_name, headers_map, output_file_name, cf
module_parser.parse_init([scan_header],
None, whitelist_paths=[top_builddir],
- #includes=['"ns3/everything.h"'],
pygen_sink=output_sink,
- gccxml_options=gccxml_options)
+ castxml_options=castxml_options)
module_parser.scan_types()
callback_classes_file = open(os.path.join(os.path.dirname(output_file_name), "callbacks_list.py"), "wt")
diff --git a/bindings/python/ns3modulescan.py b/bindings/python/ns3modulescan.py
index 36436d39911..31626773409 100644
--- a/bindings/python/ns3modulescan.py
+++ b/bindings/python/ns3modulescan.py
@@ -8,7 +8,9 @@
from pybindgen.typehandlers.codesink import FileCodeSink
from pygccxml.declarations import templates
from pygccxml.declarations.class_declaration import class_t
-from pygccxml.declarations.calldef import free_function_t, member_function_t, constructor_t, calldef_t
+from pygccxml.declarations.free_calldef import free_function_t
+from pygccxml.declarations.calldef_members import constructor_t, member_function_t
+from pygccxml.declarations.calldef import calldef_t
## we need the smart pointer type transformation to be active even
diff --git a/bindings/python/wscript b/bindings/python/wscript
index 39479fd2b6c..1dd4a5785eb 100644
--- a/bindings/python/wscript
+++ b/bindings/python/wscript
@@ -15,7 +15,8 @@ from waflib.Errors import WafError
# https://github.com/gjcarneiro/pybindgen
REQUIRED_PYBINDGEN_VERSION = '0.17.0.post58+ngcf00cc0'
-REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
+REQUIRED_PYGCCXML_VERSION = (1, 9, 0)
+REQUIRED_CASTXML_VERSION = '0.1'
RUN_ME=-3
@@ -51,7 +52,7 @@ def options(opt):
dest='python_disable')
opt.add_option('--apiscan',
help=("Rescan the API for the indicated module(s), for Python bindings. "
- "Needs working GCCXML / pygccxml environment. "
+ "Needs working CastXML / pygccxml environment. "
"The metamodule 'all' expands to all available ns-3 modules."),
default=None, dest='apiscan', metavar="MODULE[,MODULE...]")
opt.add_option('--with-pybindgen',
@@ -68,8 +69,14 @@ def options(opt):
def split_version(version):
- ver = re.split('[.+]', version)[:4]
- return (int(ver[0]), int(ver[1]), int(ver[2]), int(ver[3].split('post')[1]))
+ if (re.search ('post', version)):
+ # Version format such as '0.17.0.post58+ngcf00cc0'
+ ver = re.split('[.+]', version)[:4]
+ return (int(ver[0]), int(ver[1]), int(ver[2]), int(ver[3].split('post')[1]))
+ else:
+ # Version format such as '0.18.0'
+ ver = re.split('[.]', version)[:3]
+ return (int(ver[0]), int(ver[1]), int(ver[2]), 0)
def configure(conf):
@@ -262,7 +269,7 @@ int main ()
try:
conf.check_python_module('pygccxml')
except Errors.ConfigurationError:
- conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
+ conf.report_optional_feature("castxml", "Python API Scanning Support", False,
"Missing 'pygccxml' Python module")
return
@@ -279,40 +286,43 @@ int main ()
"automatic scanning of API definitions will not be possible" %
(pygccxml_version_str,
'.'.join([str(x) for x in REQUIRED_PYGCCXML_VERSION])))
- conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
- "pygccxml too old")
+ conf.report_optional_feature("castxml", "Python API Scanning Support", False,
+ "pygccxml Python module too old")
return
- ## Check gccxml version
+ ## Check castxml version
try:
- gccxml = conf.find_program('gccxml', var='GCCXML')
+ castxml = conf.find_program('castxml', var='CASTXML')
except WafError:
- gccxml = None
- if not gccxml:
- Logs.warn("gccxml missing; automatic scanning of API definitions will not be possible")
- conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
- "gccxml missing")
+ castxml = None
+ if not castxml:
+ Logs.warn("castxml missing; automatic scanning of API definitions will not be possible")
+ conf.report_optional_feature("castxml", "Python API Scanning Support", False,
+ "castxml missing")
return
- gccxml_version_line = os.popen(gccxml[0] + " --version").readline().strip()
- m = re.match( "^GCC-XML version (\d\.\d(\.\d)?)$", gccxml_version_line)
+ out = subprocess.Popen([castxml[0], '--version'],
+ stdout=subprocess.PIPE).communicate()[0]
+ castxml_version_line = maybe_decode(out).split('\n', 1)[0].strip()
+ ## Expecting version string such as 'castxml version 0.1-gfab9c47'
+ m = re.match( "^castxml version (\d\.\d)(-)?(\w+)?", castxml_version_line)
try:
- gccxml_version = m.group(1)
- gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9])
+ castxml_version = m.group(1)
+ castxml_version_ok = castxml_version >= REQUIRED_CASTXML_VERSION
except AttributeError:
- gccxml_version = gccxml_version_line
- gccxml_version_ok = False
- conf.msg('Checking for gccxml version', gccxml_version)
- if not gccxml_version_ok:
- Logs.warn("gccxml version unknown or too old, need version >= 0.9; automatic scanning of API definitions will not be possible")
- conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
- "gccxml too old")
+ castxml_version = castxml_version_line
+ castxml_version_ok = False
+ conf.msg('Checking for castxml version', castxml_version)
+ if not castxml_version_ok:
+ Logs.warn("castxml version unknown or too old, need version >= %s; automatic scanning of API definitions will not be possible" % REQUIRED_CASTXML_VERSION)
+ conf.report_optional_feature("castxml", "Python API Scanning Support", False,
+ "castxml too old")
return
## If we reached
conf.env['ENABLE_PYTHON_SCANNING'] = True
- conf.report_optional_feature("pygccxml", "Python API Scanning Support", True, None)
+ conf.report_optional_feature("castxml", "Python API Scanning Support", True, None)
# ---------------------
@@ -336,7 +346,7 @@ def get_module_path(bld, module):
return ns3headers.path.abspath()
class apiscan_task(Task.Task):
- """Uses gccxml to scan the file 'everything.h' and extract API definitions.
+ """Uses castxml to scan the file 'everything.h' and extract API definitions.
"""
after = 'gen_ns3_module_header ns3header'
before = 'cxx command'
diff --git a/contrib/wscript b/contrib/wscript
index 1ac1c517aea..6744e17681e 100644
--- a/contrib/wscript
+++ b/contrib/wscript
@@ -49,7 +49,8 @@ def options(opt):
opt.recurse(module, mandatory=False)
def configure(conf):
- conf.env['REQUIRED_BOOST_LIBS'] = []
+ if not conf.env['REQUIRED_BOOST_LIBS']:
+ conf.env['REQUIRED_BOOST_LIBS'] = []
for module in all_modules:
conf.recurse (module, name="required_boost_libs", mandatory=False)
diff --git a/doc/.gitignore b/doc/.gitignore
index 6d61d70ab36..2b4b76d193b 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -1,4 +1,5 @@
html/
+html-warn/
latex/
ns3-object.txt
introspected-doxygen.h
diff --git a/doc/build.txt b/doc/build.txt
index 430f5977abd..08785798076 100644
--- a/doc/build.txt
+++ b/doc/build.txt
@@ -48,7 +48,7 @@ Other waf usages include:
4. ./waf --run "program [args]"
Run a ns3 program, given its target name, with the given
- arguments. This takes care of automatically modifying the the
+ arguments. This takes care of automatically modifying the
path for finding the ns3 dynamic libraries in the environment
before running the program. Note: the "program [args]" string is
parsed using POSIX shell rules.
diff --git a/doc/doxygen.conf b/doc/doxygen.conf
index 20ecfba8ae9..b0c489db78f 100644
--- a/doc/doxygen.conf
+++ b/doc/doxygen.conf
@@ -861,42 +861,10 @@ EXCLUDE_SYMBOLS = main
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH = src/aodv/examples \
- src/bridge/examples \
- src/brite/examples \
- src/buildings/examples \
- src/click/examples \
- src/config-store/examples \
- src/core/examples \
- src/core/doc \
- src/csma/examples \
- src/csma-layout/examples \
- src/dsdv/examples \
- src/dsr/examples \
- src/energy/examples \
- src/fd-net-device/examples \
- src/flow-monitor/examples \
- src/internet/examples \
- src/lte/examples \
- src/mesh/examples \
- src/mobility/examples \
- src/mpi/examples \
- src/netanim/examples \
- src/network/examples \
- src/nix-vector-routing/examples \
- src/olsr/examples \
- src/openflow/examples \
- src/point-to-point/examples \
- src/propagation/examples \
- src/spectrum/examples \
- src/stats/examples \
- src/tap-bridge/examples \
- src/topology-read/examples \
- src/uan/examples \
- src/virtual-net-device/examples \
- src/visualizer/examples \
- src/wifi/examples \
- src/wimax/examples
+EXAMPLE_PATH = examples \
+ utils \
+ src \
+ contrib
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -2076,13 +2044,19 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = NS3_ASSERT_ENABLE \
NS3_LOG_ENABLE \
+ NS_ABORT_MSG_UNLESS()=1 \
NS_LOG_COMPONENT_DEFINE()=1 \
NS_LOG_COMPONENT_DEFINE_MASK()=1 \
NS_OBJECT_ENSURE_REGISTERED()=1 \
+ NS_OBJECT_TEMPLATE_CLASS_DEFINE()=1 \
NS3_BUILD_PROFILE_DEBUG \
NS3_BUILD_PROFILE_RELEASE \
- NS3_BUILD_PROFILE_OPTIMIZED
-
+ NS3_BUILD_PROFILE_OPTIMIZED \
+ INT64X64_USE_CAIRO \
+ INT64X64_USE_DOUBLE \
+ INT64X64_USE_CAIRO \
+
+
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
@@ -2206,7 +2180,7 @@ HIDE_UNDOC_RELATIONS = YES
# set to NO
# The default value is: NO.
-HAVE_DOT = yes
+HAVE_DOT = YES
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
diff --git a/doc/doxygen.warnings.report.sh b/doc/doxygen.warnings.report.sh
index 8c085a0e382..1901e4942ad 100755
--- a/doc/doxygen.warnings.report.sh
+++ b/doc/doxygen.warnings.report.sh
@@ -6,7 +6,7 @@
me=$(basename $0)
DIR="$(dirname $0)"
# Trick to get the absolute path, since doxygen prefixes errors that way
-ROOT=$(cd "$DIR/.."; pwd)
+ROOT=$(cd "$DIR/.."; pwd -P)
# Known log files
STANDARDLOGFILE=doxygen.log
@@ -25,7 +25,7 @@ function usage
{
cat <<-EOF
- Usage: $me [-eithv] [-s | -l | -w] [-m ] [-f ] [-F ]
+ Usage: $me [-beithv] [-s | -l | -w] [-m ] [-f ] [-F ]
Run doxygen to generate all errors; report error counts
by module and file.
@@ -35,14 +35,15 @@ function usage
-s Skip doxygen run; use existing .
-w Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
-l Skip doxygen run; use the normal doxygen log doc/$STANDARDLOGFILE
-
+
+ -b Omit the blacklist filter of files whose warnings we ignore
-e Filter out warnings from */examples/*
-t Filter out warnings from */test/*
-m Only include files matching src/
-f Only include files matching the
-F Exclude files matching the
- -v Show the doxygen run output
+ -v Show detailed output from each step. Multiple allowed.
-h Print this usage message
The default behavior is to modify doxygen.conf temporarily to
@@ -118,6 +119,7 @@ skip_doxy=0
skip_intro=0
# Filtering flags
+filter_blacklist=1
filter_examples=0
filter_test=0
filter_module=""
@@ -127,9 +129,10 @@ filter_out=""
echo
echo "$me:"
-while getopts :ef:F:hilm:s:tvw option ; do
+while getopts :bef:F:hilm:s:tvw option ; do
case $option in
+ (b) filter_blacklist=0 ;;
(e) filter_examples=1 ;;
@@ -196,9 +199,13 @@ else
verbose "" "Skipping ./waf build and print-introspected-doxygen."
else
# Run introspection, which may require a build
- verbose -n "Building and running print-introspected-doxygen..."
- (cd "$ROOT" && ./waf --run print-introspected-doxygen >doc/introspected-doxygen.h >&6 2>&6 )
+ verbose -n "Building..."
+ (cd "$ROOT" && ./waf build >&6 2>&6 )
status_report $? "./waf build"
+ verbose -n "Running print-introspected-doxygen..."
+ (cd "$ROOT" && ./waf --run print-introspected-doxygen >doc/introspected-doxygen.h >&6 2>&6 )
+ status_report $? "./waf --run print-introspected-doxygen"
+
fi
# Modify doxygen.conf to generate all the warnings
@@ -206,7 +213,7 @@ else
conf=$DIR/doxygen.conf
- sed -i.bak -E '/^EXTRACT_ALL |^HAVE_DOT |^WARNINGS /s/YES/no/' $conf
+ sed -i.bak -E '/^(EXTRACT_ALL|HAVE_DOT|CLASS_DIAGRAMS|WARNINGS|SOURCE_BROWSER) /s/(YES|yes)/no/;/^HTML_OUTPUT /s/html/html-warn/' $conf
verbose -n "Rebuilding doxygen (v$(doxygen --version)) docs with full errors..."
(cd "$ROOT" && ./waf --doxygen-no-build >&6 2>&6 )
@@ -224,35 +231,66 @@ fi
# Log filters --------------------------
#
+# Append a regular expression to a parameter
+# with '\|' alternation operator if the parameter wasn't empty to begin with.
+function REappend
+{
+ local param="$1"
+ local token="$2"
+
+ eval "${param}=\"${!param:-}${!param:+\\|}$token\""
+}
+
# Filter in regular expression for -m and -f
filter_inRE=""
if [ "$filter_module" != "" ] ; then
- filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}src/$filter_module"
+ REappend filter_inRE src/$filter_module
fi
if [ "$filter_in" != "" ] ; then
- filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_in"
+ REappend filter_inRE "$filter_in"
fi
-# Filter out regular expression for -e, -t and -F
+# Blacklist filter of files whose warnings we ignore
+filter_blacklistRE=""
+
+# External files: adding our own doxygen makes diffs with upstream very hard
+# cairo-wideint
+REappend filter_blacklistRE "cairo-wideint"
+
+# Functions with varying numbers of arguments
+# This is temporary until we move to C++-14
+REappend filter_blacklistRE "Schedule(Time"
+REappend filter_blacklistRE "ScheduleWithContext(uint32_t"
+REappend filter_blacklistRE "Schedule\\(Now\\|Destroy\\)(\\(MEM\\|void\\)"
+
+# ATTRIBUTE_HELPER_CPP( and _HEADER(
+REappend filter_blacklistRE "ATTRIBUTE_HELPER_\\(CPP\\|HEADER\\)("
+
filter_outRE=""
+if [ $filter_blacklist -eq 1 ]; then
+ echo "Filtering out blacklist: \"$filter_blacklistRE\""
+ REappend filter_outRE "$filter_blacklistRE"
+fi
+# Filter out regular expression for -e, -t and -F
if [ $filter_examples -eq 1 ]; then
- filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/examples/"
+ REappend filter_outRE "/examples/"
fi
if [ $filter_test -eq 1 ]; then
- filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/test/"
+ REappend filter_outRE "/test/"
fi
if [ "$filter_out" != "" ] ; then
- filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}$filter_out"
+ REappend filter_outRE "$filter_out"
fi
# Show the resulting filters
+echo
+echo "Net result of all filters:"
if [ "${filter_inRE:-}" != "" ] ; then
echo "Filtering in \"$filter_inRE\""
fi
if [ "${filter_outRE:-}" != "" ] ; then
echo "Filtering out \"$filter_outRE\""
fi
-echo
# Filter log file
function filter_log
@@ -279,6 +317,7 @@ function filter_log
# Analyze the log ----------------------
#
+verbose -n "Filtering the doxygen log..."
# List of module directories (e.g, "src/core/model")
undocmods=$( \
@@ -346,6 +385,8 @@ if [ "${filter_inRE:-}" != "" ] ; then
)
fi
+status_report 0 "Filter"
+echo
# Summarize the log --------------------
diff --git a/doc/main.h b/doc/main.h
index 92f13a53dfd..f6759955f81 100644
--- a/doc/main.h
+++ b/doc/main.h
@@ -1,3 +1,7 @@
+/**
+ * \file
+ * Main page of the Doxygen-generated documentation.
+ */
/**
* \mainpage ns-3 Documentation
*
@@ -71,10 +75,15 @@
* ns3 namespace.
*/
-// Macros defined by the build system.
-//
-// These have to be visible for doxygen to document them,
-// so we put them here in a file only seen by doxygen, not the compiler.
+
+/**
+ * \name Macros defined by the build system.
+ *
+ * These have to be visible for doxygen to document them,
+ * so we put them here in a file only seen by doxygen, not the compiler.
+ *
+ * @{
+ */
/**
* \ingroup assert
*
@@ -96,3 +105,5 @@
* This is normally set by `./waf configure --build-profile=debug`.
*/
#define NS3_LOG_ENABLE
+
+/**@}*/
diff --git a/doc/manual/source/documentation.rst b/doc/manual/source/documentation.rst
index ed7fda7bde4..fab053b1223 100644
--- a/doc/manual/source/documentation.rst
+++ b/doc/manual/source/documentation.rst
@@ -39,7 +39,7 @@ We use Sphinx_ to generate expository chapters describing
the design and usage of each module. Right now you are reading the
:doc:`Documentation ` Chapter.
If you are reading the html version, the
-`Show Source <_sources/documentation.rst>`_ link in the sidebar
+`Show Source <_sources/documentation.txt>`_ link in the sidebar
will show you the reStructuredText source for this chapter.
Adding New Chapters
@@ -259,22 +259,22 @@ Documenting with Doxygen
We use Doxygen_ to generate browsable_ API documentation. Doxygen
provides a number of useful features:
- * Summary table of all class members.
- * Graphs of inheritance and collaboration for all classes.
- * Links to the source code implementing each function.
- * Links to every place a member is used.
- * Links to every object used in implementing a function.
- * Grouping of related classes, such as all the classes related to
- a specific protocol.
+* Summary table of all class members.
+* Graphs of inheritance and collaboration for all classes.
+* Links to the source code implementing each function.
+* Links to every place a member is used.
+* Links to every object used in implementing a function.
+* Grouping of related classes, such as all the classes related to
+ a specific protocol.
In addition, we use the ``TypeId`` system to add to the documentation
for every class
- * The ``Config`` paths by which such objects can be reached.
- * Documentation for any ``Attributes``, including ``Attributes``
- defined in parent classes.
- * Documentation for any ``Trace`` sources defined by the class.
- * The memory footprint for each class.
+* The ``Config`` paths by which such objects can be reached.
+* Documentation for any ``Attributes``, including ``Attributes``
+ defined in parent classes.
+* Documentation for any ``Trace`` sources defined by the class.
+* The memory footprint for each class.
Doxygen operates by scaning the source code, looking for
specially marked comments. It also creates a cross reference,
@@ -333,9 +333,9 @@ that it refers to the *preceding* item.
Some items to note:
- * Use sentence case, including the initial capital.
- * Use punctuation, especially \`.'s at the end of sentences or phrases.
- * The ``\brief`` tag is not needed; the first sentence will be
+* Use sentence case, including the initial capital.
+* Use punctuation, especially \`.'s at the end of sentences or phrases.
+* The ``\brief`` tag is not needed; the first sentence will be
used as the brief description.
Every class, method, typedef, member variable, function argument
@@ -606,8 +606,9 @@ usage for |ns3|.
be done for function arguments.
* Use ``\tparam T \explicit`` because the type ``T`` can't be deduced;
- it must be given explicitly at the invocation site.
-
+ it must be given explicitly at the invocation site, as in
+ ``Create (...)``
+
* ``\internal`` should be used only to set off a discussion of implementation
details, not to mark ``private`` functions (they are already marked,
as ``private``!)
@@ -616,32 +617,31 @@ usage for |ns3|.
even in test suites. These cause all instances of the class name
literal \`A' to be rendered as links.
-
As noted above, static functions don't inherit the documentation
of the same functions in the parent class. |ns3| uses a few static
functions ubiquitously; the suggested documentation block for these
cases is:
- * Default constructor/destructor::
+* Default constructor/destructor::
- MyClass (); //!< Default constructor
- ~MyClass (); //!< Destructor
+ MyClass (); //!< Default constructor
+ ~MyClass (); //!< Destructor
- * Dummy destructor and DoDispose::
+* Dummy destructor and DoDispose::
- /** Dummy destructor, see DoDispose. */
- ~MyClass ();
+ /** Dummy destructor, see DoDispose. */
+ ~MyClass ();
- /** Destructor implementation */
- virtual void DoDispose ();
+ /** Destructor implementation */
+ virtual void DoDispose ();
- * GetTypeId::
+* GetTypeId::
- /**
- * Register this type.
- * \return The object TypeId.
- */
- static TypeId GetTypeId (void);
+ /**
+ * Register this type.
+ * \return The object TypeId.
+ */
+ static TypeId GetTypeId (void);
diff --git a/doc/manual/source/enable-modules.rst b/doc/manual/source/enable-modules.rst
index e395acb97f9..76ff9373a47 100644
--- a/doc/manual/source/enable-modules.rst
+++ b/doc/manual/source/enable-modules.rst
@@ -6,7 +6,7 @@ Enabling Subsets of |ns3| Modules
As with most software projects, |ns3| is ever growing larger in terms of number of modules, lines of code, and memory footprint. Users, however, may only use a few of those modules at a time. For this reason, users may want to explicitly enable only the subset of the possible |ns3| modules that they actually need for their research.
-This chapter discusses how to enable only the |ns3| modules that you are intersted in using.
+This chapter discusses how to enable only the |ns3| modules that you are interested in using.
How to enable a subset of |ns3|'s modules
*****************************************
diff --git a/doc/manual/source/events.rst b/doc/manual/source/events.rst
index 763713f821c..5baf3b5168e 100644
--- a/doc/manual/source/events.rst
+++ b/doc/manual/source/events.rst
@@ -168,7 +168,7 @@ network-level events.
Notes:
* Users need to be careful to propagate DoInitialize methods across objects
- by calling Initialize explicitely on their member objects
+ by calling Initialize explicitly on their member objects
* The context id associated with each ScheduleWithContext method has
other uses beyond logging: it is used by an experimental branch of ns-3
to perform parallel simulation on multicore systems using
diff --git a/doc/manual/source/helpers.rst b/doc/manual/source/helpers.rst
index ca6980eec65..fffcab7e59d 100644
--- a/doc/manual/source/helpers.rst
+++ b/doc/manual/source/helpers.rst
@@ -7,7 +7,7 @@ Helpers
The above chapters introduced you to various |ns3| programming concepts such as
smart pointers for reference-counted memory management, attributes, namespaces,
callbacks, etc. Users who work at this low-level API can interconnect |ns3|
-objects with fine granulariy. However, a simulation program written entirely
+objects with fine granularity. However, a simulation program written entirely
using the low-level API would be quite long and tedious to code. For this
reason, a separate so-called "helper API" has been overlaid on the core |ns3|
API. If you have read the |ns3| tutorial, you will already be familiar with the
diff --git a/doc/manual/source/logging.rst b/doc/manual/source/logging.rst
index 1d37e3e365f..3a5a1afe2eb 100644
--- a/doc/manual/source/logging.rst
+++ b/doc/manual/source/logging.rst
@@ -342,6 +342,60 @@ Adding logging to your code is very simple:
2. Add logging statements (macro calls) to your functions and function bodies.
+In case you want to add logging statements to the methods of your template class
+(which are defined in an header file):
+
+1. Invoke the ``NS_LOG_TEMPLATE_DECLARE;`` macro in the private section of
+ your class declaration. For instance:
+
+ ::
+
+ template
+ class Queue : public QueueBase
+ {
+ ...
+ private:
+ std::list > m_packets; //!< the items in the queue
+ NS_LOG_TEMPLATE_DECLARE; //!< the log component
+ };
+
+ This requires you to perform these steps for all the subclasses of your class.
+
+2. Invoke the ``NS_LOG_TEMPLATE_DEFINE (...);`` macro in the constructor of
+ your class by providing the name of a log component registered by calling
+ the ``NS_LOG_COMPONENT_DEFINE (...);`` macro in some module. For instance:
+
+ ::
+
+ template
+ Queue- ::Queue ()
+ : NS_LOG_TEMPLATE_DEFINE ("Queue")
+ {
+ }
+
+3. Add logging statements (macro calls) to the methods of your class.
+
+In case you want to add logging statements to a static member template
+(which is defined in an header file):
+
+1. Invoke the ``NS_LOG_STATIC_TEMPLATE_DEFINE (...);`` macro in your static
+ method by providing the name of a log component registered by calling
+ the ``NS_LOG_COMPONENT_DEFINE (...);`` macro in some module. For instance:
+
+ ::
+
+ template
+ void
+ NetDeviceQueue::PacketEnqueued (Ptr > queue,
+ Ptr ndqi,
+ uint8_t txq, Ptr item)
+ {
+
+ NS_LOG_STATIC_TEMPLATE_DEFINE ("NetDeviceQueueInterface");
+ ...
+
+2. Add logging statements (macro calls) to your static method.
+
Controlling timestamp precision
*******************************
diff --git a/doc/manual/source/python.rst b/doc/manual/source/python.rst
index 622f655aaa9..2a09e5312c0 100644
--- a/doc/manual/source/python.rst
+++ b/doc/manual/source/python.rst
@@ -1,6 +1,13 @@
.. include:: replace.txt
.. highlight:: python
+.. heading hierarchy:
+ ------------- Chapter
+ ************* Section (#.#)
+ ============= Subsection (#.#.#)
+ ############# Paragraph (no number)
+
+
Using Python to Run |ns3|
-------------------------
@@ -18,7 +25,22 @@ Python, to allow integration of |ns3| with other Python tools and workflows.
The intent is not to provide a different language choice to author new
|ns3| models implemented in Python.
-Python bindings for |ns3| use a tool called PyBindGen (https://github.com/gjcarneiro/pybindgen).
+Python bindings for |ns3| use a tool called PyBindGen (https://github.com/gjcarneiro/pybindgen) to create Python modules from the C++ libraries built by
+Waf. The Python bindings that PyBindGen uses are maintained in a
+``bindings`` directory in each module, and must be maintained to match the
+C++ API of that ns-3 module. If the C++ API changes, the Python bindings file
+must either be modified by hand accordingly, or the bindings must be
+regenerated by an automated scanning process.
+
+If a user is not interested in Python, he or she may disable the use of
+Python bindings at Waf configure time. In this case, changes to the C++
+API of a provided module will not cause the module to fail to compile.
+
+The process for automatically generating Python bindings relies on a toolchain
+involving a development installation of the Clang compiler, a program called
+CastXML (https://github.com/CastXML/CastXML), and a program called
+pygccxml (https://github.com/gccxml/pygccxml). The toolchain can be installed
+using the ns-3 ``bake`` build tool.
An Example Python Script that Runs |ns3|
****************************************
@@ -107,18 +129,18 @@ Caveats
Python bindings for |ns3| are a work in progress, and some limitations are known by developers. Some of these limitations (not all) are listed here.
Incomplete Coverage
-+++++++++++++++++++
+===================
First of all, keep in mind that not 100% of the API is supported in Python. Some of the reasons are:
#. some of the APIs involve pointers, which require knowledge of what kind of memory passing semantics (who owns what memory). Such knowledge is not part of the function signatures, and is either documented or sometimes not even documented. Annotations are needed to bind those functions;
#. Sometimes a unusual fundamental data type or C++ construct is used which is not yet supported by PyBindGen;
-#. GCC-XML does not report template based classes unless they are instantiated.
+#. GCC-XML does not report template based classes unless they are instantiated. (Note: Need to confirm this limitation still exists with CastXML)
Most of the missing APIs can be wrapped, given enough time, patience, and expertise, and will likely be wrapped if bug reports are submitted. However, don't file a bug report saying "bindings are incomplete", because we do not have manpower to complete 100% of the bindings.
Conversion Constructors
-+++++++++++++++++++++++
+=======================
`Conversion constructors `_ are not fully supported yet by PyBindGen, and they always act as explicit constructors when translating an API into Python. For example, in C++ you can do this:
@@ -137,7 +159,7 @@ In Python, for the time being you have to do:
ipAddrs.Assign(backboneDevices)
CommandLine
-+++++++++++
+===========
:cpp:func:`CommandLine::AddValue` works differently in Python than it does in |ns3|. In Python, the first parameter is a string that represents the command-line option name. When the option is set, an attribute with the same name as the option name is set on the :cpp:func:`CommandLine` object. Example:
@@ -160,13 +182,13 @@ CommandLine
num_nodes_side = int(cmd.NumNodesSide)
Tracing
-+++++++
+=======
Callback based tracing is not yet properly supported for Python, as new |ns3| API needs to be provided for this to be supported.
Pcap file writing is supported via the normal API.
-Ascii tracing is supported since |ns3|.4 via the normal C++ API translated to Python. However, ascii tracing requires the creation of an ostream object to pass into the ascii tracing methods. In Python, the C++ std::ofstream has been minimally wrapped to allow this. For example:
+ASCII tracing is supported since |ns3|.4 via the normal C++ API translated to Python. However, ASCII tracing requires the creation of an ostream object to pass into the ASCII tracing methods. In Python, the C++ std::ofstream has been minimally wrapped to allow this. For example:
::
@@ -178,33 +200,40 @@ Ascii tracing is supported since |ns3|.4 via the normal C++ API translated to Py
There is one caveat: you must not allow the file object to be garbage collected while |ns3| is still using it. That means that the 'ascii' variable above must not be allowed to go out of scope or else the program will crash.
-Cygwin limitation
-+++++++++++++++++
+Working with Python Bindings
+****************************
-Python bindings do not work on Cygwin. This is due to a gccxml bug.
+Python bindings are built on a module-by-module basis, and can be found in each module's ``bindings`` directory.
-You might get away with it by re-scanning API definitions from within the
-cygwin environment (./waf --apiscan=all). However the most likely solution
-will probably have to be that we disable python bindings in CygWin.
+Overview
+========
-If you really care about Python bindings on Windows, try building with mingw and native
-python instead. Or else, to build without python bindings, disable python bindings in the configuration stage:
+The python bindings are generated into an 'ns' namespace. Examples:
-.. sourcecode:: bash
+::
- $ ./waf configure --disable-python
+ from ns.network import Node
+ n1 = Node()
-Working with Python Bindings
-****************************
+or
-Python bindings are built on a module-by-module basis, and can be found in each module's ``bindings`` directory.
+::
+
+ import ns.network
+ n1 = ns.network.Node()
+
+The best way to explore the bindings is to look at the various example
+programs provided in |ns3|; some C++ examples have a corresponding Python
+example. There is no structured documentation for the Python bindings
+like there is Doxygen for the C++ API, but the Doxygen can be consulted
+to understand how the C++ API works.
Python Bindings Workflow
-++++++++++++++++++++++++
+========================
The process by which Python bindings are handled is the following:
-#. Periodically a developer uses a GCC-XML (http://www.gccxml.org) based API scanning script, which saves the scanned API definition as ``bindings/python/ns3_module_*.py`` files or as Python files in each modules' ``bindings`` directory. These files are kept under version control in the main |ns3| repository;
+#. Periodically a developer uses a CastXML (https://github.com/CastXML/CastXML) based API scanning script, which saves the scanned API definition as ``bindings/python/ns3_module_*.py`` files or as Python files in each modules' ``bindings`` directory. These files are kept under version control in the main |ns3| repository;
#. Other developers clone the repository and use the already scanned API definitions;
#. When configuring |ns3|, pybindgen will be automatically downloaded if not already installed. Released |ns3| tarballs will ship a copy of pybindgen.
@@ -212,48 +241,129 @@ If something goes wrong with compiling Python bindings and you just want to igno
.. sourcecode:: bash
- $ ./waf --disable-python
+ $ ./waf configure --disable-python ...
+
+To add support for modular bindings to an existing or new |ns3| module, simply add the following line to its wscript build() function:
-Instructions for Handling New Files or Changed API's
-****************************************************
+::
-So you have been changing existing |ns3| APIs and Python bindings no longer compile? Do not despair, you can rescan the bindings to create new bindings that reflect the changes to the |ns3| API.
+ bld.ns3_python_bindings()
-Overview
-++++++++
+One must also provide the bindings files (usually by running the scanning
+framework).
-The python bindings are generated into an 'ns' namespace. Examples:
+Regenerating the Python bindings
+================================
+
+|ns3| will fail to successfully compile the Python bindings if the C++
+headers are changed and no longer align with the stored Python bindings.
+In this case, the developer has two main choices: 1) disable Python
+as described above, or 2) update the bindings to align with the new C++
+API.
+
+Process Overview
+################
+
+|ns3| has an automated process to regenerate Python bindings from the C++
+header files. The automated process is only semi-automated at the moment
+(ns-3.27) because we are in the midst of transition to new tools. The
+current process is outlined below. In short, the process currently
+requires the following steps.
+
+1. Prepare the system for scanning by installing the prerequisites,
+ including a development version of ``clang``, the ``CastXML`` package,
+ and ``pygccxml``.
+2. Perform a 64-bit scan of the module or modules of interest
+3. Create the 32-bit bindings file from the 64-bit scan output
+
+Installing a clang development environment
+##########################################
+
+Make sure you have a development version of the clang compiler installed
+on your system. This can take a long time to build from source. Linux
+distributions provide binary library packages such as ``clang-dev`` or
+``clang-devel``. The version should not be too important; version 3.8 is
+known to work. Note that there is a problem with the Ubuntu
+package installation of ``clang-dev``; see the Installation wiki page for
+details on how to fix using some symlinks.
+
+Installing other prerequisites
+##############################
+
+``cxxfilt`` is a new requirement, typically installed using ``pip``; e.g.
::
- from ns.network import Node
- n1 = Node()
+ sudo pip install cxxfilt
-or
+See also the wiki for installation notes for your system.
+
+Set up a ``bake`` build environment
+###################################
+
+Try the following commands::
+ $ cd bake
+ $ export BAKE_HOME=`pwd`
+ $ export PATH=$PATH:$BAKE_HOME/build/bin
+ $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BAKE_HOME/build/lib
+ $ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME/build/lib
+ $ mkdir -p build/lib
+
+Configure
+#########
+
+Perform a configuration at the bake level::
+
+ $ ./bake.py configure -e ns-3-dev -e pygccxml-1.9.1
+
+The output of ``bake show`` should show something like this:
::
- import ns.network
- n1 = ns.network.Node()
+ $ ./bake.py show
-The best way to explore the bindings is to look at the various example
-programs provided in |ns3|; some C++ examples have a corresponding Python
-example. There is no structured documentation for the Python bindings
-like there is Doxygen for the C++ API, but the Doxygen can be consulted
-to understand how the C++ API works.
+Should say::
+
+ -- System Dependencies --
+ > clang-dev - OK
+ > g++ - OK
+ > libxml2-dev - OK
+ > pygoocanvas - OK
+ > pygraphviz - OK
+ > python-dev - OK
+ > qt - OK
+ > setuptools - OK
+
+
+Download
+########
-Scanning the Modular Python Bindings
-++++++++++++++++++++++++++++++++++++
+Try the following command::
-Scanning of the C++ API is only necessary if a user is using Python and
-is changing the C++ API to introduce new methods (that he or she wishes
-to be accessible from Python) or is changing the C++ API in a way that
-breaks the compilation of the existing Python bindings.
+ $ ./bake.py download
+ >> Searching for system dependency python-dev - OK
+ >> Searching for system dependency clang-dev - OK
+ >> Searching for system dependency g++ - OK
+ >> Searching for system dependency setuptools - OK
+ >> Searching for system dependency pygoocanvas - OK
+ >> Searching for system dependency pygraphviz - OK
+ >> Searching for system dependency qt - OK
+ >> Downloading castxml - OK
+ >> Downloading netanim - OK
+ >> Downloading pygccxml-1.9.1 - OK
+ >> Downloading pygccxml - OK
+ >> Downloading pybindgen - OK
+ >> Downloading ns-3-dev - OK
+
+Build
+#####
-There are two steps. First, the bindings toolchain must be enabled in
-the |ns3| build. This requires that the gccxml and pygccxml tools be
-installed on the system or using the bake build tool. Second, Waf
-can be used to update the bindings.
+Try the following commands::
+
+ $ mkdir -p build/lib
+ $ ./bake.py build
+
+It should fail on the |ns3| bindings complilation.
The output of './waf configure' can be inspected to see if Python API scanning
support is enabled:
@@ -268,50 +378,72 @@ It may say something like this, if the support is not active:
Python API Scanning Support : not enabled (Missing 'pygccxml' Python module)
-In this case, the user must take steps to install gccxml and pygccxml;
-gccxml binary must be in the shell's path, and pygccxml must be in the
+In this case, the user must take steps to install castxml and pygccxml;
+castxml binary must be in the shell's path, and pygccxml must be in the
Python path.
-An automated setup for this is provided by the `bake` build system, if the
-user selects the 'ns-allinone-3.nn' configuration target (where 'nn' is the
-release number. For example:
+Rescan 64-bit
+#############
-::
+It is important that you scan the failing module with '--no32bit-scan'; e.g.:
- ./bake.py configure -e ns-allinone-3.26
- ./bake.py download
- ./bake.py build
+::
-At present, this toolchain is only supported for gcc version 4; gcc-5
-and gcc-6 are not supported due to the gccxml project stopping maintenance
-a few years ago. clang compiler is also not supported. The |ns3| project
-plans to convert to the CastXML project to replace gccxml in the future,
-in which case newer versions of gcc as well as clang will be supported.
+ $ cd source/ns-3-dev
+ $ ./waf --apiscan=wifi --no32bit-scan
-Once API scanning support is enabled, to scan the modular Python bindings
-for the core module, for example, do the following:
+Generate 32-bit
+###############
-.. sourcecode:: bash
+Once the 64-bit bindings are fixed, if you are a maintainer and need to
+generate the 32-bit equivalent:
- $ ./waf --apiscan=core
+1. copy the newly scanned LP64.py file(s) to the ILP32.py filename
+2. on the ILP32.py file(s), perform global substitition of ``unsigned long`` with ``unsigned long long``
-To scan the modular Python bindings for all of the modules, do the following:
+Linux (64-bit, as most modern installations use) and MacOS use different
+data models, as explained here: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.cbcpx01/datatypesize64.htm
-.. sourcecode:: bash
+Linux uses the LP64 model, and MacOS (as well as 32-bit Linux) use the ILP32
+model. Users will note that there are two versions of bindings files in
+each ns-3 module directory; one with an ILP32.py suffix and one with
+an LP64.py suffix. Only one is used on any given platform. The main
+difference is in the representation of the 64 bit integer type as either
+a 'long' (LP64) or 'long long' (ILP32).
+
+As of ns-3.27, the CastXML framework can generate LP64 bindings by passing
+the ``--no32bit-scan`` flag. However, the framework does not automatically
+generate 32bit scans at the moment. Instead, users must manually generate
+the ILP32.py equivalents by taking all instances of 'unsigned long' in the
+bindings file and converting them to 'unsigned long long', such as:
- $ ./waf --apiscan=all
+::
-Adding Modular Bindings To A Existing or New Module
-+++++++++++++++++++++++++++++++++++++++++++++++++++
+ - cls.add_instance_attribute('nMarkedBytes', 'std::map< std::string, unsigned long >', is_const=False)
+ + cls.add_instance_attribute('nMarkedBytes', 'std::map< std::string, unsigned long long >', is_const=False)
-To add support for modular bindings to an existing or new |ns3| module, simply add the following line to its wscript build() function:
+In summary, to generate LP64 bindings for Linux 64-bit systems, it is
+sufficient to call (e.g. for the ``core`` module):
::
- bld.ns3_python_bindings()
+ $ ./waf --apiscan=core --no32bit-scan
+
+To generate ILP32 bindings, one first must generate the LP64.py file as above,
+and then copy the file to be named with an ILP32.py suffix, and then
+hand-edit that file, replacing all instances of 'unsigned long' with
+'unsigned long long'. |ns3| maintainers are working to better automate
+this process for future releases.
+
+Generating bindings on MacOS
+############################
+
+In principle, this should work (and should generate the 32-bit bindings).
+However, it is untested and we are not sure what instructions to offer.
+We would welcome suggestions on how to enable scanning for MacOS.
Organization of the Modular Python Bindings
-+++++++++++++++++++++++++++++++++++++++++++
+===========================================
The ``src//bindings`` directory may contain the following files, some of them optional:
diff --git a/doc/manual/source/random-variables.rst b/doc/manual/source/random-variables.rst
index 4b48b96c1ff..951d089ccaa 100644
--- a/doc/manual/source/random-variables.rst
+++ b/doc/manual/source/random-variables.rst
@@ -355,7 +355,7 @@ Publishing your results
When you publish simulation results, a key piece of configuration
information that you should always state is how you used the
-the random number generator.
+random number generator.
* what seeds you used,
* what RNG you used if not the default,
diff --git a/doc/manual/source/tracing.rst b/doc/manual/source/tracing.rst
index fbced172358..55ca8e5df78 100644
--- a/doc/manual/source/tracing.rst
+++ b/doc/manual/source/tracing.rst
@@ -521,32 +521,32 @@ tells the helper to interpret the ``prefix`` parameter as a complete filename.
Ascii Tracing Device Helpers
++++++++++++++++++++++++++++
-The behavior of the ascii trace helper ``mixin`` is substantially similar to
+The behavior of the ASCII trace helper ``mixin`` is substantially similar to
the pcap version. Take a look at ``src/network/helper/trace-helper.h`` if you want to
follow the discussion while looking at real code.
The class ``AsciiTraceHelperForDevice`` adds the high level functionality for
-using ascii tracing to a device helper class. As in the pcap case, every device
-must implement a single virtual method inherited from the ascii trace
+using ASCII tracing to a device helper class. As in the pcap case, every device
+must implement a single virtual method inherited from the ASCII trace
``mixin``.::
virtual void EnableAsciiInternal (Ptr stream, std::string prefix, Ptr nd) = 0;
The signature of this method reflects the device-centric view of the situation
at this level; and also the fact that the helper may be writing to a shared
-output stream. All of the public ascii-trace-related methods inherited from
+output stream. All of the public ASCII-trace-related methods inherited from
class ``AsciiTraceHelperForDevice`` reduce to calling this single device-
-dependent implementation method. For example, the lowest level ascii trace
+dependent implementation method. For example, the lowest level ASCII trace
methods,::
void EnableAscii (std::string prefix, Ptr nd);
void EnableAscii (Ptr stream, Ptr nd);
will call the device implementation of ``EnableAsciiInternal`` directly,
-providing either a valid prefix or stream. All other public ascii tracing
+providing either a valid prefix or stream. All other public ASCII tracing
methods will build on these low-level functions to provide additional user-level
functionality. What this means to the user is that all device helpers in the
-system will have all of the ascii trace methods available; and these methods
+system will have all of the ASCII trace methods available; and these methods
will all work in the same way across devices if the devices implement
``EnablAsciiInternal`` correctly.
@@ -576,7 +576,7 @@ Ascii Tracing Device Helper Methods
You are encouraged to peruse the Doxygen for class ``TraceHelperForDevice`` to
find the details of these methods; but to summarize ...
-There are twice as many methods available for ascii tracing as there were for
+There are twice as many methods available for ASCII tracing as there were for
pcap tracing. This is because, in addition to the pcap-style model where traces
from each unique node/device pair are written to a unique file, we support a
model in which trace information for many node/device pairs is written to a
@@ -584,7 +584,7 @@ common file. This means that the -- file name generation
mechanism is replaced by a mechanism to refer to a common file; and the number
of API methods is doubled to allow all combinations.
-Just as in pcap tracing, you can enable ascii tracing on a particular
+Just as in pcap tracing, you can enable ASCII tracing on a particular
node/net-device pair by providing a ``Ptr`` to an ``EnableAscii``
method. The ``Ptr`` is implicit since the net device must belong to
exactly one ``Node``. For example,::
@@ -593,12 +593,12 @@ exactly one ``Node``. For example,::
...
helper.EnableAscii ("prefix", nd);
-In this case, no trace contexts are written to the ascii trace file since they
+In this case, no trace contexts are written to the ASCII trace file since they
would be redundant. The system will pick the file name to be created using the
same rules as described in the pcap section, except that the file will have the
suffix ".tr" instead of ".pcap".
-If you want to enable ascii tracing on more than one net device and have all
+If you want to enable ASCII tracing on more than one net device and have all
traces sent to a single file, you can do that as well by using an object to
refer to a single file::
@@ -610,12 +610,12 @@ refer to a single file::
helper.EnableAscii (stream, nd1);
helper.EnableAscii (stream, nd2);
-In this case, trace contexts are written to the ascii trace file since they
+In this case, trace contexts are written to the ASCII trace file since they
are required to disambiguate traces from the two devices. Note that since the
user is completely specifying the file name, the string should include the ".tr"
for consistency.
-You can enable ascii tracing on a particular node/net-device pair by providing a
+You can enable ASCII tracing on a particular node/net-device pair by providing a
``std::string`` representing an object name service string to an
``EnablePcap`` method. The ``Ptr`` is looked up from the name
string. Again, the ```` is implicit since the named net device must
@@ -648,7 +648,7 @@ This would result in a single trace file called ``trace-file-name.tr`` that
contains all of the trace events for both devices. The events would be
disambiguated by trace context strings.
-You can enable ascii tracing on a collection of node/net-device pairs by
+You can enable ASCII tracing on a collection of node/net-device pairs by
providing a ``NetDeviceContainer``. For each ``NetDevice`` in the container the
type is checked. For each device of the proper type (the same type as is managed
by the device helper), tracing is enabled. Again, the ```` is implicit
@@ -658,7 +658,7 @@ since the found net device must belong to exactly one ``Node``. For example,::
...
helper.EnableAscii ("prefix", d);
-This would result in a number of ascii trace files being created, each of which
+This would result in a number of ASCII trace files being created, each of which
follows the --.tr convention. Combining all of the
traces into a single file is accomplished similarly to the examples above::
@@ -679,7 +679,7 @@ enabled.::
...
helper.EnableAscii ("prefix", n);
-This would result in a number of ascii trace files being created, each of which
+This would result in a number of ASCII trace files being created, each of which
follows the --.tr convention. Combining all of the
traces into a single file is accomplished similarly to the examples above:
@@ -696,7 +696,7 @@ same type as that managed by the device helper.::
helper.EnableAsciiAll ("prefix");
-This would result in a number of ascii trace files being created, one for
+This would result in a number of ASCII trace files being created, one for
every device in the system of the type managed by the helper. All of these
files will follow the --.tr convention. Combining
all of the traces into a single file is accomplished similarly to the examples
@@ -706,20 +706,20 @@ Ascii Tracing Device Helper Filename Selection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implicit in the prefix-style method descriptions above is the construction of
-the complete filenames by the implementation method. By convention, ascii traces
+the complete filenames by the implementation method. By convention, ASCII traces
in the |ns3| system are of the form ``--.tr``.
As previously mentioned, every node in the system will have a system-assigned
node id; and every device will have an interface index (also called a device id)
-relative to its node. By default, then, an ascii trace file created as a result
+relative to its node. By default, then, an ASCII trace file created as a result
of enabling tracing on the first device of node 21, using the prefix "prefix",
would be ``prefix-21-1.tr``.
You can always use the |ns3| object name service to make this more clear. For
example, if you use the object name service to assign the name "server" to node
-21, the resulting ascii trace file name will automatically become,
+21, the resulting ASCII trace file name will automatically become,
``prefix-server-1.tr`` and if you also assign the name "eth0" to the device,
-your ascii trace file name will automatically pick this up and be called
+your ASCII trace file name will automatically pick this up and be called
``prefix-server-eth0.tr``.
Pcap Tracing Protocol Helpers
@@ -864,7 +864,7 @@ automatically become, "prefix-nserverIpv4-i1.pcap".
Ascii Tracing Protocol Helpers
++++++++++++++++++++++++++++++
-The behavior of the ascii trace helpers is substantially similar to the pcap
+The behavior of the ASCII trace helpers is substantially similar to the pcap
case. Take a look at ``src/network/helper/trace-helper.h`` if you want to follow the
discussion while looking at real code.
@@ -874,7 +874,7 @@ appropriate type. For example, use a ``Ptr`` instead of a ``Ptr``
and call ``EnableAsciiIpv6`` instead of ``EnableAsciiIpv4``.
The class ``AsciiTraceHelperForIpv4`` adds the high level functionality for
-using ascii tracing to a protocol helper. Each protocol that enables these
+using ASCII tracing to a protocol helper. Each protocol that enables these
methods must implement a single virtual method inherited from this class.::
virtual void EnableAsciiIpv4Internal (Ptr stream, std::string prefix,
@@ -924,7 +924,7 @@ Ascii Tracing Device Helper Methods
You are encouraged to peruse the Doxygen for class ``PcapAndAsciiHelperForIpv4``
to find the details of these methods; but to summarize ...
-There are twice as many methods available for ascii tracing as there were for
+There are twice as many methods available for ASCII tracing as there were for
pcap tracing. This is because, in addition to the pcap-style model where traces
from each unique protocol/interface pair are written to a unique file, we
support a model in which trace information for many protocol/interface pairs is
@@ -932,7 +932,7 @@ written to a common file. This means that the -n-
file name generation mechanism is replaced by a mechanism to refer to a common
file; and the number of API methods is doubled to allow all combinations.
-Just as in pcap tracing, you can enable ascii tracing on a particular
+Just as in pcap tracing, you can enable ASCII tracing on a particular
protocol/interface pair by providing a ``Ptr`` and an ``interface`` to an
``EnableAscii`` method. For example,::
@@ -940,12 +940,12 @@ protocol/interface pair by providing a ``Ptr`` and an ``interface`` to an
...
helper.EnableAsciiIpv4 ("prefix", ipv4, 1);
-In this case, no trace contexts are written to the ascii trace file since they
+In this case, no trace contexts are written to the ASCII trace file since they
would be redundant. The system will pick the file name to be created using the
same rules as described in the pcap section, except that the file will have the
suffix ".tr" instead of ".pcap".
-If you want to enable ascii tracing on more than one interface and have all
+If you want to enable ASCII tracing on more than one interface and have all
traces sent to a single file, you can do that as well by using an object to
refer to a single file. We have already something similar to this in the "cwnd"
example above::
@@ -958,12 +958,12 @@ example above::
helper.EnableAsciiIpv4 (stream, protocol1, 1);
helper.EnableAsciiIpv4 (stream, protocol2, 1);
-In this case, trace contexts are written to the ascii trace file since they are
+In this case, trace contexts are written to the ASCII trace file since they are
required to disambiguate traces from the two interfaces. Note that since the
user is completely specifying the file name, the string should include the ".tr"
for consistency.
-You can enable ascii tracing on a particular protocol by providing a
+You can enable ASCII tracing on a particular protocol by providing a
``std::string`` representing an object name service string to an ``EnablePcap``
method. The ``Ptr`` is looked up from the name string. The ```` in
the resulting filenames is implicit since there is a one-to-one correspondence
@@ -992,7 +992,7 @@ This would result in a single trace file called "trace-file-name.tr" that
contains all of the trace events for both interfaces. The events would be
disambiguated by trace context strings.
-You can enable ascii tracing on a collection of protocol/interface pairs by
+You can enable ASCII tracing on a collection of protocol/interface pairs by
providing an ``Ipv4InterfaceContainer``. For each protocol of the proper type
(the same type as is managed by the device helper), tracing is enabled for the
corresponding interface. Again, the ```` is implicit since there is a
@@ -1009,7 +1009,7 @@ one-to-one correspondence between each protocol and its node. For example,::
...
helper.EnableAsciiIpv4 ("prefix", interfaces);
-This would result in a number of ascii trace files being created, each of which
+This would result in a number of ASCII trace files being created, each of which
follows the -n-i.tr convention. Combining all of the
traces into a single file is accomplished similarly to the examples above::
@@ -1025,7 +1025,7 @@ traces into a single file is accomplished similarly to the examples above::
...
helper.EnableAsciiIpv4 (stream, interfaces);
-You can enable ascii tracing on a collection of protocol/interface pairs by
+You can enable ASCII tracing on a collection of protocol/interface pairs by
providing a ``NodeContainer``. For each ``Node`` in the ``NodeContainer`` the
appropriate protocol is found. For each protocol, its interfaces are enumerated
and tracing is enabled on the resulting pairs. For example,::
@@ -1034,7 +1034,7 @@ and tracing is enabled on the resulting pairs. For example,::
...
helper.EnableAsciiIpv4 ("prefix", n);
-This would result in a number of ascii trace files being created, each of which
+This would result in a number of ASCII trace files being created, each of which
follows the --.tr convention. Combining all of the
traces into a single file is accomplished similarly to the examples above:
@@ -1047,12 +1047,12 @@ used to specify the resulting trace source.::
Of course, the traces can be combined into a single file as shown above.
-Finally, you can enable ascii tracing for all interfaces in the system, with
+Finally, you can enable ASCII tracing for all interfaces in the system, with
associated protocol being the same type as that managed by the device helper.::
helper.EnableAsciiIpv4All ("prefix");
-This would result in a number of ascii trace files being created, one for
+This would result in a number of ASCII trace files being created, one for
every interface in the system related to a protocol of the type managed by the
helper. All of these files will follow the -n-i--.tr."
As previously mentioned, every node in the system will have a system-assigned
node id. Since there is a one-to-one correspondence between protocols and nodes
we use to node-id to identify the protocol identity. Every interface on a given
protocol will have an interface index (also called simply an interface) relative
-to its protocol. By default, then, an ascii trace file created as a result of
+to its protocol. By default, then, an ASCII trace file created as a result of
enabling tracing on the first device of node 21, using the prefix "prefix",
would be "prefix-n21-i1.tr". Use the prefix to disambiguate multiple protocols
per node.
You can always use the |ns3| object name service to make this more clear.
For example, if you use the object name service to assign the name "serverIpv4"
-to the protocol on node 21, and also specify interface one, the resulting ascii
+to the protocol on node 21, and also specify interface one, the resulting ASCII
trace file name will automatically become, "prefix-nserverIpv4-1.tr".
Tracing implementation details
diff --git a/doc/models/Makefile b/doc/models/Makefile
index 405a08b828f..2258caaa45a 100644
--- a/doc/models/Makefile
+++ b/doc/models/Makefile
@@ -58,6 +58,7 @@ SOURCES = \
$(SRC)/network/doc/simple.rst \
$(SRC)/network/doc/queue.rst \
$(SRC)/network/doc/queue-limits.rst \
+ $(SRC)/nix-vector-routing/doc/nix-vector-routing.rst \
$(SRC)/internet/doc/internet-stack.rst \
$(SRC)/internet/doc/ipv4.rst \
$(SRC)/internet/doc/ipv6.rst \
@@ -83,15 +84,8 @@ SOURCES = \
$(SRC)/traffic-control/doc/codel.rst \
$(SRC)/traffic-control/doc/fq-codel.rst \
$(SRC)/traffic-control/doc/pie.rst \
+ $(SRC)/traffic-control/doc/mq.rst \
$(SRC)/spectrum/doc/spectrum.rst \
- $(SRC)/stats/doc/adaptor.rst \
- $(SRC)/stats/doc/aggregator.rst \
- $(SRC)/stats/doc/collector.rst \
- $(SRC)/stats/doc/data-collection-helpers.rst \
- $(SRC)/stats/doc/data-collection-overview.rst \
- $(SRC)/stats/doc/data-collection.rst \
- $(SRC)/stats/doc/probe.rst \
- $(SRC)/stats/doc/scope-and-limitations.rst \
$(SRC)/netanim/doc/animation.rst \
$(SRC)/flow-monitor/doc/flow-monitor.rst \
$(SRC)/wave/doc/wave.rst \
@@ -268,15 +262,6 @@ SOURCEFIGS = \
$(SRC)/lte/doc/source/figures/lte-legacy-handover-algorithm.pdf \
$(SRC)/lte/doc/source/figures/lte-legacy-handover-algorithm.png \
$(SRC)/uan/doc/auvmobility-classes.dia \
- $(SRC)/stats/doc/Stat-framework-arch.png \
- $(SRC)/stats/doc/Wifi-default.png \
- $(SRC)/stats/doc/dcf-overview.dia \
- $(SRC)/stats/doc/dcf-overview-with-aggregation.dia \
- $(SRC)/stats/doc/file-example.png \
- $(SRC)/stats/doc/gnuplot-aggregator.png \
- $(SRC)/stats/doc/gnuplot-example.png \
- $(SRC)/stats/doc/gnuplot-helper-example.png \
- $(SRC)/stats/doc/seventh-packet-byte-count.png \
$(SRC)/netanim/doc/figures/PacketStatistics.png \
$(SRC)/netanim/doc/figures/PacketStatistics.pdf \
$(SRC)/netanim/doc/figures/NetAnim_3_105.png \
@@ -323,8 +308,6 @@ IMAGES_EPS = \
$(FIGURES)/WifiArchitecture.eps \
$(FIGURES)/snir.eps \
$(FIGURES)/WimaxArchitecture.eps \
- $(FIGURES)/dcf-overview.eps \
- $(FIGURES)/dcf-overview-with-aggregation.eps \
$(FIGURES)/epc-ctrl-arch.eps \
$(FIGURES)/epc-data-flow-dl.eps \
$(FIGURES)/epc-data-flow-ul.eps \
diff --git a/doc/models/source/index.rst b/doc/models/source/index.rst
index 260308ddbd9..1100e74f31c 100644
--- a/doc/models/source/index.rst
+++ b/doc/models/source/index.rst
@@ -26,7 +26,6 @@ This document is written in `reStructuredText 10.1.2.4.9: UDP, length 1024
2.026758 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
-This is the echo packet going from left to right (from Wifi to CSMA) and back
+This is the echo packet going from left to right (from Wi-Fi to CSMA) and back
again across the point-to-point link.
Now, look at the pcap file of the right side of the point-to-point link,
@@ -1291,7 +1291,7 @@ Again, you should see some familiar looking contents:
2.011837 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
-This is also the echo packet going from left to right (from Wifi to CSMA) and
+This is also the echo packet going from left to right (from Wi-Fi to CSMA) and
back again across the point-to-point link with slightly different timings
as you might expect.
diff --git a/doc/tutorial/source/conceptual-overview.rst b/doc/tutorial/source/conceptual-overview.rst
index 3bb620c595f..0d49102bd0c 100644
--- a/doc/tutorial/source/conceptual-overview.rst
+++ b/doc/tutorial/source/conceptual-overview.rst
@@ -797,7 +797,7 @@ in the first example program will schedule an explicit stop at 11 seconds:
return 0;
}
-The above wil not actually change the behavior of this program, since
+The above will not actually change the behavior of this program, since
this particular simulation naturally ends after 10 seconds. But if you
were to change the stop time in the above statement from 11 seconds to 1
second, you would notice that the simulation stops before any output is
diff --git a/doc/tutorial/source/getting-started.rst b/doc/tutorial/source/getting-started.rst
index 2303b22bcae..7b4ab0e5219 100644
--- a/doc/tutorial/source/getting-started.rst
+++ b/doc/tutorial/source/getting-started.rst
@@ -96,17 +96,17 @@ get a copy of a release by typing the following into your Linux shell
$ cd
$ mkdir workspace
$ cd workspace
- $ wget http://www.nsnam.org/release/ns-allinone-3.26.tar.bz2
- $ tar xjf ns-allinone-3.26.tar.bz2
+ $ wget http://www.nsnam.org/release/ns-allinone-3.27.tar.bz2
+ $ tar xjf ns-allinone-3.27.tar.bz2
-If you change into the directory ``ns-allinone-3.26`` you should see a
+If you change into the directory ``ns-allinone-3.27`` you should see a
number of files and directories:
::
$ ls
- bake constants.py ns-3.26 README
- build.py netanim-3.107 pybindgen-0.17.0.post57+nga6376f2 util.py
+ bake constants.py ns-3.27 README
+ build.py netanim-3.108 pybindgen-0.17.0.post58+ngcf00cc0 util.py
You are now ready to build the base |ns3| distribution and may skip ahead
to the section on building |ns3|.
@@ -166,10 +166,10 @@ distribution of your choice.
There are a few configuration targets available:
-1. ``ns-3.26``: the module corresponding to the release; it will download
+1. ``ns-3.27``: the module corresponding to the release; it will download
components similar to the release tarball.
2. ``ns-3-dev``: a similar module but using the development code tree
-3. ``ns-allinone-3.26``: the module that includes other optional features
+3. ``ns-allinone-3.27``: the module that includes other optional features
such as click routing, openflow for |ns3|, and the Network Simulation
Cradle
4. ``ns-3-allinone``: similar to the released version of the allinone
@@ -187,7 +187,7 @@ code either by inspection of the repository list or by going to the
`"ns-3 Releases"
`_
web page and clicking on the latest release link. We'll proceed in
-this tutorial example with ``ns-3.26``.
+this tutorial example with ``ns-3.27``.
We are now going to use the bake tool to pull down the various pieces of
|ns3| you will be using. First, we'll say a word about running bake.
@@ -213,9 +213,9 @@ full builds of ns-3-allinone (with the optional packages) typically do.
Step into the workspace directory and type the following into your shell::
- $ ./bake.py configure -e ns-3.26
+ $ ./bake.py configure -e ns-3.27
-Next, we'l ask bake to check whether we have enough tools to download
+Next, we'll ask bake to check whether we have enough tools to download
various components. Type::
$ ./bake.py check
@@ -241,8 +241,7 @@ You should see something like the following,
> autoreconf tool - OK
> Path searched for tools: /usr/lib64/qt-3.3/bin /usr/lib64/ccache
- /usr/local/bin /bin /usr/bin /usr/local/sbin /usr/sbin /sbin
- /home/tomh/bin bin
+ /usr/local/bin /bin /usr/bin /usr/local/sbin /usr/sbin /sbin bin
In particular, download tools such as Mercurial, CVS, GIT, and Bazaar
are our principal concerns at this point, since they allow us to fetch
@@ -256,23 +255,32 @@ Next, try to download the software::
should yield something like::
- >> Downloading gccxml-ns3 (target directory:gccxml) - OK
- >> Searching for system dependency python-dev - OK
- >> Searching for system dependency pygraphviz - OK
- >> Searching for system dependency pygoocanvas - OK
>> Searching for system dependency setuptools - OK
- >> Searching for system dependency g++ - OK
+ >> Searching for system dependency pygoocanvas - OK
+ >> Searching for system dependency pygraphviz - OK
+ >> Searching for system dependency python-dev - OK
+ >> Searching for system dependency libxml2-dev - OK
+ >> Searching for system dependency clang-dev - OK
+ >> Downloading click-ns-3.25 - OK
+ >> Downloading BRITE - OK
>> Searching for system dependency qt4 - OK
+ >> Downloading nsc-0.5.3 - OK
+ >> Searching for system dependency g++ - OK
+ >> Downloading castxml - OK
+ >> Downloading openflow-ns-3.25 - OK
+ >> Downloading netanim-3.108 - OK
+ >> Downloading pygccxml-1.9.1 - OK
>> Downloading pygccxml - OK
- >> Downloading netanim-3.107 - OK
- >> Downloading pybindgen-0.17.0.post57+nga6376f2 (target directory:pybindgen) - OK
- >> Downloading ns-3.26 - OK
+ >> Downloading pybindgen-ns3.27-castxml (target directory:pybindgen) - OK
+ >> Downloading ns-3.27 - OK
-The above suggests that five sources have been downloaded. Check the
+The above suggests that seven sources have been downloaded. Check the
``source`` directory now and type ``ls``; one should see::
$ ls
- gccxml netanim-3.107 ns-3.26 pybindgen pygccxml pygccxml-1.0.0.zip
+ BRITE netanim-3.108 openflow-ns-3.25 pygccxml-1.9.1
+ castxml ns-3.27 pybindgen v1.9.1.tar.gz
+ click-ns-3.25 nsc-0.5.3 pygccxml
You are now ready to build the |ns3| distribution.
@@ -291,7 +299,7 @@ native |ns3| build system, Waf, to be introduced later in this tutorial.
If you downloaded
using a tarball you should have a directory called something like
-``ns-allinone-3.26`` under your ``~/workspace`` directory.
+``ns-allinone-3.27`` under your ``~/workspace`` directory.
Type the following::
$ ./build.py --enable-examples --enable-tests
@@ -307,7 +315,7 @@ You will see lots of typical compiler output messages displayed as the build
script builds the various pieces you downloaded. Eventually you should see the
following::
- Waf: Leaving directory `/path/to/workspace/ns-allinone-3.26/ns-3.26/build'
+ Waf: Leaving directory `/path/to/workspace/ns-allinone-3.27/ns-3.27/build'
'build' finished successfully (6m25.032s)
Modules built:
@@ -352,14 +360,30 @@ may continue to use it to build |ns3|. Type
and you should see something like::
- >> Building gccxml-ns3 - OK
- >> Building pygccxml - OK
- >> Building netanim-3.107 - OK
- >> Building pybindgen-0.17.0.post57+nga6376f2 - OK
- >> Building ns-3.26 - OK
+ >> Building BRITE - OK
+ >> Building nsc-0.5.3 - OK
+ >> Building click-ns-3.25 - OK
+ ...
+ >> Building ns-3.27 - OK
*Hint: you can also perform both steps, download and build, by calling ``bake.py deploy``.*
+There may be failures to build all components, but the build will proceed
+anyway if the component is optional. For example, a common issue at the
+moment is that castxml may not build via the bake build tool on all
+platforms; in this case, the line will show::
+
+ >> Building castxml - Problem
+ > Problem: Optional dependency, module "castxml" failed
+ This may reduce the functionality of the final build.
+ However, bake will continue since "castxml" is not an essential dependency.
+ For more information call bake with -v or -vvv, for full verbose mode.
+
+However, castxml is only needed if one wants to generate updated Python
+bindings, and most users do not need to do so (or to do so until they are
+more involved with ns-3 changes), so such warnings might be safely ignored
+for now.
+
If there happens to be a failure, please have a look at what the following
command tells you; it may give a hint as to a missing dependency::
@@ -507,7 +531,7 @@ A command exists for checking which profile is currently active
for an already configured project::
$ ./waf --check-profile
- Waf: Entering directory \`/path/to/ns-3-allinone/ns-3.26/build'
+ Waf: Entering directory \`/path/to/ns-3-allinone/ns-3.27/build'
Build profile: debug
The build.py script discussed above supports also the ``--enable-examples``
@@ -883,7 +907,7 @@ For example, to run your |ns3| program ``hello-simulator`` with the arguments
Notice that the |ns3| program name goes with the ``--run`` argument,
and the control utility (here ``gdb``) is the first token
-in the ``--commmand-template`` argument. The ``--args`` tells ``gdb``
+in the ``--command-template`` argument. The ``--args`` tells ``gdb``
that the remainder of the command line belongs to the "inferior" program.
(Some ``gdb``'s don't understand the ``--args`` feature. In this case,
omit the program arguments from the ``--command-template``,
diff --git a/doc/tutorial/source/introduction.rst b/doc/tutorial/source/introduction.rst
index ac716a0b8d0..cab42eea6f6 100644
--- a/doc/tutorial/source/introduction.rst
+++ b/doc/tutorial/source/introduction.rst
@@ -41,7 +41,7 @@ models of how packet data networks work and perform, and provides a
simulation engine for users to conduct simulation experiments. Some of the
reasons to use |ns3| include to perform studies that are more difficult
or not possible to perform with real systems, to study system behavior in
-a highly controllled, reproducible environment, and to learn about how
+a highly controlled, reproducible environment, and to learn about how
networks work. Users will note that the available model set in |ns3|
focuses on modeling how Internet protocols and networks work, but
|ns3| is not limited to Internet systems; several users are using
diff --git a/doc/tutorial/source/tracing.rst b/doc/tutorial/source/tracing.rst
index e3e5c7366bc..2389f371501 100644
--- a/doc/tutorial/source/tracing.rst
+++ b/doc/tutorial/source/tracing.rst
@@ -1106,7 +1106,7 @@ there is some English:
This class template implements the Functor Design Pattern. It is used to declare the type of a **Callback**:
* the first non-optional template argument represents the return type of the callback.
- * the reminaining (optional) template arguments represent the type of the subsequent arguments to the callback.
+ * the remaining (optional) template arguments represent the type of the subsequent arguments to the callback.
* up to nine arguments are supported.
We are trying to figure out what the
@@ -1272,7 +1272,7 @@ the list of TraceSources you will find
**TraceSources**
- * **CongestionWindow**: The TCP connnection's congestion window
+ * **CongestionWindow**: The TCP connection's congestion window
Callback signature: **ns3::TracedValueCallback::Uint32**
@@ -1369,7 +1369,7 @@ didn't exist yet during configuration time?). As a result, during the
configuration phase you can't connect a trace source to a trace sink
if one of them is created dynamically during the simulation.
-The two solutions to this connundrum are
+The two solutions to this conundrum are
#. Create a simulator event that is run after the dynamic object is
created and hook the trace when that event is executed; or
@@ -1456,7 +1456,7 @@ problem described above with ``Socket``.
// ===========================================================================
//
-This should also be self-explanatory.
+This should also be self-explanatory.
The next part is the declaration of the ``MyApp`` ``Application`` that
we put together to allow the ``Socket`` to be created at configuration
@@ -2216,7 +2216,7 @@ creates a PCAP file named "sixth.pcap" with file mode "w". This means
that the new file is truncated (contents deleted) if an existing file
with that name is found. The final parameter is the "data link type"
of the new PCAP file. These are the same as the PCAP library data
-link types defined in ``bpf.h`` if you are familar with PCAP. In this
+link types defined in ``bpf.h`` if you are familiar with PCAP. In this
case, ``DLT_PPP`` indicates that the PCAP file is going to contain
packets prefixed with point to point headers. This is true since the
packets are coming from our point-to-point device driver. Other
diff --git a/examples/energy/energy-model-example.cc b/examples/energy/energy-model-example.cc
index 07fd0bbd188..586176b36cb 100644
--- a/examples/energy/energy-model-example.cc
+++ b/examples/energy/energy-model-example.cc
@@ -119,6 +119,8 @@ main (int argc, char *argv[])
LogComponentEnable ("WifiRadioEnergyModel", LOG_LEVEL_DEBUG);
*/
+ LogComponentEnable ("EnergyExample", LogLevel (LOG_PREFIX_TIME | LOG_PREFIX_NODE | LOG_LEVEL_INFO));
+
std::string phyMode ("DsssRate1Mbps");
double Prss = -80; // dBm
uint32_t PpacketSize = 200; // bytes
@@ -266,6 +268,15 @@ main (int argc, char *argv[])
Simulator::Stop (Seconds (10.0));
Simulator::Run ();
+
+ for (DeviceEnergyModelContainer::Iterator iter = deviceModels.Begin (); iter != deviceModels.End (); iter ++)
+ {
+ double energyConsumed = (*iter)->GetTotalEnergyConsumption ();
+ NS_LOG_UNCOND ("End of simulation (" << Simulator::Now ().GetSeconds ()
+ << "s) Total energy consumed by radio = " << energyConsumed << "J");
+ NS_ASSERT (energyConsumed <= 0.1);
+ }
+
Simulator::Destroy ();
return 0;
diff --git a/examples/energy/energy-model-with-harvesting-example.cc b/examples/energy/energy-model-with-harvesting-example.cc
index c0b35223dfb..63a3d95acf7 100644
--- a/examples/energy/energy-model-with-harvesting-example.cc
+++ b/examples/energy/energy-model-with-harvesting-example.cc
@@ -26,7 +26,7 @@
*
* The example considers a simple communication link between a source and a
* destination node, where the source node sends a packet to the destination
- * every 1 second. Each node is powered by a BasiEnergySource, which is recharged
+ * every 1 second. Each node is powered by a BasicEnergySource, which is recharged
* by a BasicEnergyHarvester, and the WiFi radio consumes energy for the transmission/
* reception of the packets.
*
@@ -126,51 +126,42 @@ GenerateTraffic (Ptr socket, uint32_t pktSize, Ptr n,
void
RemainingEnergy (double oldValue, double remainingEnergy)
{
- std::cout << Simulator::Now ().GetSeconds ()
- << "s Current remaining energy = " << remainingEnergy << "J" << std::endl;
+ NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
+ << "s Current remaining energy = " << remainingEnergy << "J");
}
/// Trace function for total energy consumption at node.
void
TotalEnergy (double oldValue, double totalEnergy)
{
- std::cout << Simulator::Now ().GetSeconds ()
- << "s Total energy consumed by radio = " << totalEnergy << "J" << std::endl;
+ NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
+ << "s Total energy consumed by radio = " << totalEnergy << "J");
}
/// Trace function for the power harvested by the energy harvester.
void
HarvestedPower (double oldValue, double harvestedPower)
{
- std::cout << Simulator::Now ().GetSeconds ()
- << "s Current harvested power = " << harvestedPower << " W" << std::endl;
+ NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
+ << "s Current harvested power = " << harvestedPower << " W");
}
/// Trace function for the total energy harvested by the node.
void
TotalEnergyHarvested (double oldValue, double TotalEnergyHarvested)
{
- std::cout << Simulator::Now ().GetSeconds ()
- << "s Total energy harvested by harvester = "
- << TotalEnergyHarvested << " J" << std::endl;
+ NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
+ << "s Total energy harvested by harvester = "
+ << TotalEnergyHarvested << " J");
}
int
main (int argc, char *argv[])
{
- /*
- LogComponentEnable ("EnergySource", LOG_LEVEL_DEBUG);
- LogComponentEnable ("BasicEnergySource", LOG_LEVEL_DEBUG);
- LogComponentEnable ("DeviceEnergyModel", LOG_LEVEL_DEBUG);
- LogComponentEnable ("WifiRadioEnergyModel", LOG_LEVEL_DEBUG);
- LogComponentEnable ("EnergyHarvester", LOG_LEVEL_DEBUG);
- LogComponentEnable ("BasicEnergyHarvester", LOG_LEVEL_DEBUG);
- */
-
std::string phyMode ("DsssRate1Mbps");
double Prss = -80; // dBm
- uint32_t PpacketSize = 200; // bytes
+ uint32_t PacketSize = 200; // bytes
bool verbose = false;
// simulation parameters
@@ -190,7 +181,7 @@ main (int argc, char *argv[])
CommandLine cmd;
cmd.AddValue ("phyMode", "Wifi Phy mode", phyMode);
cmd.AddValue ("Prss", "Intended primary RSS (dBm)", Prss);
- cmd.AddValue ("PpacketSize", "size of application packet sent", PpacketSize);
+ cmd.AddValue ("PacketSize", "size of application packet sent", PacketSize);
cmd.AddValue ("numPackets", "Total number of packets to send", numPackets);
cmd.AddValue ("startTime", "Simulation start time", startTime);
cmd.AddValue ("distanceToRx", "X-Axis distance between nodes", distanceToRx);
@@ -326,11 +317,20 @@ main (int argc, char *argv[])
/** simulation setup **/
// start traffic
- Simulator::Schedule (Seconds (startTime), &GenerateTraffic, source, PpacketSize,
+ Simulator::Schedule (Seconds (startTime), &GenerateTraffic, source, PacketSize,
networkNodes.Get (0), numPackets, interPacketInterval);
Simulator::Stop (Seconds (10.0));
Simulator::Run ();
+
+ for (DeviceEnergyModelContainer::Iterator iter = deviceModels.Begin (); iter != deviceModels.End (); iter ++)
+ {
+ double energyConsumed = (*iter)->GetTotalEnergyConsumption ();
+ NS_LOG_UNCOND ("End of simulation (" << Simulator::Now ().GetSeconds ()
+ << "s) Total energy consumed by radio = " << energyConsumed << "J");
+ NS_ASSERT (energyConsumed <= 1.0);
+ }
+
Simulator::Destroy ();
return 0;
diff --git a/examples/energy/examples-to-run.py b/examples/energy/examples-to-run.py
index bc018245015..deb7fcc3d70 100644
--- a/examples/energy/examples-to-run.py
+++ b/examples/energy/examples-to-run.py
@@ -9,6 +9,7 @@
# See test.py for more information.
cpp_examples = [
("energy-model-example", "True", "True"),
+ ("energy-model-with-harvesting-example", "True", "True"),
]
# A list of Python examples to run in order to ensure that they remain
diff --git a/examples/ipv6/radvd-two-prefix.cc b/examples/ipv6/radvd-two-prefix.cc
index da88e79040a..3ee513ec0b9 100644
--- a/examples/ipv6/radvd-two-prefix.cc
+++ b/examples/ipv6/radvd-two-prefix.cc
@@ -135,7 +135,7 @@ int main (int argc, char** argv)
iic1.Add (iicr1);
/* add another IPv6 address for second prefix advertised on first subnet */
- ipv6.SetBase (Ipv6Address ("2001:ABCD::2"), Ipv6Prefix (64));
+ ipv6.SetBase (Ipv6Address ("2001:ABCD::"), Ipv6Prefix (64));
ipv6.Assign (tmp2);
/* second subnet R - n1 */
diff --git a/examples/tcp/tcp-pacing.cc b/examples/tcp/tcp-pacing.cc
new file mode 100644
index 00000000000..13090187d24
--- /dev/null
+++ b/examples/tcp/tcp-pacing.cc
@@ -0,0 +1,155 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+// Network topology
+//
+// n0 ----------- n1
+// 40 Gbps
+// 0.01 ms
+
+// This programs illustrates how TCP pacing can be used and how user can set
+// pacing rate. The program gives information about each flow like transmitted
+// and received bytes (packets) and throughput of that flow. Currently, it is
+// using TCP NewReno but in future after having congestion control algorithms
+// which can change pacing rate can be used.
+
+#include
+#include
+#include "ns3/core-module.h"
+#include "ns3/point-to-point-module.h"
+#include "ns3/internet-module.h"
+#include "ns3/applications-module.h"
+#include "ns3/network-module.h"
+#include "ns3/packet-sink.h"
+#include "ns3/flow-monitor-module.h"
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("TcpPacingExample");
+
+int
+main (int argc, char *argv[])
+{
+
+ bool tracing = false;
+ uint32_t maxBytes = 0;
+ uint32_t TCPFlows = 1;
+ bool isPacingEnabled = true;
+ std::string pacingRate = "4Gbps";
+ bool isSack = false;
+ uint32_t maxPackets = 0;
+
+ CommandLine cmd;
+ cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing);
+ cmd.AddValue ("maxBytes",
+ "Total number of bytes for application to send", maxBytes);
+ cmd.AddValue ("maxPackets",
+ "Total number of bytes for application to send", maxPackets);
+ cmd.AddValue ("TCPFlows", "Number of application flows between sender and receiver", TCPFlows);
+ cmd.AddValue ("Pacing", "Flag to enable/disable pacing in TCP", isPacingEnabled);
+ cmd.AddValue ("Sack", "Flag to enable/disable sack in TCP", isSack);
+ cmd.AddValue ("PacingRate", "Max Pacing Rate in bps", pacingRate);
+ cmd.Parse (argc, argv);
+
+ if (maxPackets != 0 )
+ {
+ maxBytes = 500 * maxPackets;
+ }
+
+ Config::SetDefault ("ns3::TcpSocketState::MaxPacingRate", StringValue (pacingRate));
+ Config::SetDefault ("ns3::TcpSocketState::EnablePacing", BooleanValue (isPacingEnabled));
+ Config::SetDefault ("ns3::TcpSocketBase::Sack", BooleanValue (isSack));
+
+ NS_LOG_INFO ("Create nodes.");
+ NodeContainer nodes;
+ nodes.Create (2);
+
+ NS_LOG_INFO ("Create channels.");
+ PointToPointHelper pointToPoint;
+ pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("40Gbps"));
+ pointToPoint.SetChannelAttribute ("Delay", StringValue ("0.01ms"));
+
+ NetDeviceContainer devices;
+ devices = pointToPoint.Install (nodes);
+
+ InternetStackHelper internet;
+ internet.Install (nodes);
+
+ NS_LOG_INFO ("Assign IP Addresses.");
+ Ipv4AddressHelper ipv4;
+ ipv4.SetBase ("10.1.1.0", "255.255.255.0");
+ Ipv4InterfaceContainer i = ipv4.Assign (devices);
+
+ NS_LOG_INFO ("Create Applications.");
+
+ ApplicationContainer sourceApps;
+ ApplicationContainer sinkApps;
+ for (uint32_t iterator = 0; iterator < TCPFlows; iterator++)
+ {
+ uint16_t port = 10000 + iterator;
+
+ BulkSendHelper source ("ns3::TcpSocketFactory",
+ InetSocketAddress (i.GetAddress (1), port));
+ // Set the amount of data to send in bytes. Zero is unlimited.
+ source.SetAttribute ("MaxBytes", UintegerValue (maxBytes));
+ sourceApps.Add (source.Install (nodes.Get (0)));
+
+ PacketSinkHelper sink ("ns3::TcpSocketFactory",
+ InetSocketAddress (Ipv4Address::GetAny (), port));
+ sinkApps.Add (sink.Install (nodes.Get (1)));
+ }
+
+ sinkApps.Start (Seconds (0.0));
+ sinkApps.Stop (Seconds (5));
+ sourceApps.Start (Seconds (1));
+ sourceApps.Stop (Seconds (5));
+
+ if (tracing)
+ {
+ AsciiTraceHelper ascii;
+ pointToPoint.EnableAsciiAll (ascii.CreateFileStream ("tcp-pacing.tr"));
+ pointToPoint.EnablePcapAll ("tcp-pacing", false);
+ }
+
+ FlowMonitorHelper flowmon;
+ Ptr monitor = flowmon.InstallAll ();
+
+ NS_LOG_INFO ("Run Simulation.");
+ Simulator::Stop (Seconds (5));
+ Simulator::Run ();
+
+ monitor->CheckForLostPackets ();
+ Ptr classifier = DynamicCast (flowmon.GetClassifier ());
+ FlowMonitor::FlowStatsContainer stats = monitor->GetFlowStats ();
+ for (std::map::const_iterator i = stats.begin (); i != stats.end (); ++i)
+ {
+ Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first);
+ if (t.sourceAddress == "10.1.1.2")
+ {
+ continue;
+ }
+ std::cout << "Flow " << i->first << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n";
+ std::cout << " Tx Packets: " << i->second.txPackets << "\n";
+ std::cout << " Tx Bytes: " << i->second.txBytes << "\n";
+ std::cout << " TxOffered: " << i->second.txBytes * 8.0 / 9.0 / 1000 / 1000 << " Mbps\n";
+ std::cout << " Rx Packets: " << i->second.rxPackets << "\n";
+ std::cout << " Rx Bytes: " << i->second.rxBytes << "\n";
+ std::cout << " Throughput: " << i->second.rxBytes * 8.0 / 9.0 / 1000 / 1000 << " Mbps\n";
+ }
+
+ Simulator::Destroy ();
+ NS_LOG_INFO ("Done.");
+}
diff --git a/examples/tcp/tcp-variants-comparison.cc b/examples/tcp/tcp-variants-comparison.cc
index a3ef07f15ad..05b8164d6eb 100644
--- a/examples/tcp/tcp-variants-comparison.cc
+++ b/examples/tcp/tcp-variants-comparison.cc
@@ -55,19 +55,19 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TcpVariantsComparison");
-bool firstCwnd = true;
-bool firstSshThr = true;
-bool firstRtt = true;
-bool firstRto = true;
-Ptr cWndStream;
-Ptr ssThreshStream;
-Ptr rttStream;
-Ptr rtoStream;
-Ptr nextTxStream;
-Ptr nextRxStream;
-Ptr inFlightStream;
-uint32_t cWndValue;
-uint32_t ssThreshValue;
+static bool firstCwnd = true;
+static bool firstSshThr = true;
+static bool firstRtt = true;
+static bool firstRto = true;
+static Ptr cWndStream;
+static Ptr ssThreshStream;
+static Ptr rttStream;
+static Ptr rtoStream;
+static Ptr nextTxStream;
+static Ptr nextRxStream;
+static Ptr inFlightStream;
+static uint32_t cWndValue;
+static uint32_t ssThreshValue;
static void
@@ -129,18 +129,21 @@ RtoTracer (Time oldval, Time newval)
static void
NextTxTracer (SequenceNumber32 old, SequenceNumber32 nextTx)
{
+ NS_UNUSED (old);
*nextTxStream->GetStream () << Simulator::Now ().GetSeconds () << " " << nextTx << std::endl;
}
static void
InFlightTracer (uint32_t old, uint32_t inFlight)
{
+ NS_UNUSED (old);
*inFlightStream->GetStream () << Simulator::Now ().GetSeconds () << " " << inFlight << std::endl;
}
static void
NextRxTracer (SequenceNumber32 old, SequenceNumber32 nextRx)
{
+ NS_UNUSED (old);
*nextRxStream->GetStream () << Simulator::Now ().GetSeconds () << " " << nextRx << std::endl;
}
@@ -211,10 +214,10 @@ int main (int argc, char *argv[])
std::string access_delay = "45ms";
bool tracing = false;
std::string prefix_file_name = "TcpVariantsComparison";
- double data_mbytes = 0;
+ uint64_t data_mbytes = 0;
uint32_t mtu_bytes = 400;
uint16_t num_flows = 1;
- float duration = 100;
+ double duration = 100.0;
uint32_t run = 0;
bool flow_monitor = false;
bool pcap = false;
@@ -225,7 +228,8 @@ int main (int argc, char *argv[])
CommandLine cmd;
cmd.AddValue ("transport_prot", "Transport protocol to use: TcpNewReno, "
"TcpHybla, TcpHighSpeed, TcpHtcp, TcpVegas, TcpScalable, TcpVeno, "
- "TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus, TcpLedbat ", transport_prot);
+ "TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus, TcpLedbat, "
+ "TcpLp", transport_prot);
cmd.AddValue ("error_p", "Packet error rate", error_p);
cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth);
cmd.AddValue ("delay", "Bottleneck delay", delay);
@@ -244,6 +248,8 @@ int main (int argc, char *argv[])
cmd.AddValue ("sack", "Enable or disable SACK option", sack);
cmd.Parse (argc, argv);
+ transport_prot = std::string ("ns3::") + transport_prot;
+
SeedManager::SetSeed (1);
SeedManager::SetRun (run);
@@ -265,8 +271,8 @@ int main (int argc, char *argv[])
NS_LOG_LOGIC ("TCP ADU size is: " << tcp_adu_size);
// Set the simulation start and stop time
- float start_time = 0.1;
- float stop_time = start_time + duration;
+ double start_time = 0.1;
+ double stop_time = start_time + duration;
// 4 MB of TCP buffer
Config::SetDefault ("ns3::TcpSocket::RcvBufSize", UintegerValue (1 << 21));
@@ -274,65 +280,18 @@ int main (int argc, char *argv[])
Config::SetDefault ("ns3::TcpSocketBase::Sack", BooleanValue (sack));
// Select TCP variant
- if (transport_prot.compare ("TcpNewReno") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpHybla") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHybla::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpHighSpeed") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHighSpeed::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpVegas") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVegas::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpScalable") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpScalable::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpHtcp") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHtcp::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpVeno") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVeno::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpBic") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpBic::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpYeah") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpYeah::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpIllinois") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpIllinois::GetTypeId ()));
- }
- else if (transport_prot.compare ("TcpWestwood") == 0)
- { // the default protocol type in ns3::TcpWestwood is WESTWOOD
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
- Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
- }
- else if (transport_prot.compare ("TcpWestwoodPlus") == 0)
- {
+ if (transport_prot.compare ("ns3::TcpWestwoodPlus") == 0)
+ {
+ // TcpWestwoodPlus is not an actual TypeId name; we need TcpWestwood here
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
+ // the default protocol type in ns3::TcpWestwood is WESTWOOD
Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS));
- Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
- }
- else if (transport_prot.compare ("TcpLedbat") == 0)
- {
- Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpLedbat::GetTypeId ()));
}
else
{
- NS_LOG_DEBUG ("Invalid TCP version");
- exit (1);
+ TypeId tcpTid;
+ NS_ABORT_MSG_UNLESS (TypeId::LookupByNameFailSafe (transport_prot, &tcpTid), "TypeId " << transport_prot << " not found");
+ Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TypeId::LookupByName (transport_prot)));
}
// Create gateways, sources, and sinks
@@ -385,13 +344,13 @@ int main (int argc, char *argv[])
Config::SetDefault ("ns3::CoDelQueueDisc::Mode", EnumValue (CoDelQueueDisc::QUEUE_DISC_MODE_BYTES));
- uint32_t size = (std::min (access_b, bottle_b).GetBitRate () / 8) *
- ((access_d + bottle_d) * 2).GetSeconds ();
+ uint32_t size = static_cast((std::min (access_b, bottle_b).GetBitRate () / 8) *
+ ((access_d + bottle_d) * 2).GetSeconds ());
Config::SetDefault ("ns3::PfifoFastQueueDisc::Limit", UintegerValue (size / mtu_bytes));
Config::SetDefault ("ns3::CoDelQueueDisc::MaxBytes", UintegerValue (size));
- for (int i = 0; i < num_flows; i++)
+ for (uint32_t i = 0; i < num_flows; i++)
{
NetDeviceContainer devices;
devices = LocalLink.Install (sources.Get (i), gateways.Get (0));
@@ -427,41 +386,20 @@ int main (int argc, char *argv[])
for (uint16_t i = 0; i < sources.GetN (); i++)
{
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port));
-
- if (transport_prot.compare ("TcpNewReno") == 0
- || transport_prot.compare ("TcpWestwood") == 0
- || transport_prot.compare ("TcpWestwoodPlus") == 0
- || transport_prot.compare ("TcpHybla") == 0
- || transport_prot.compare ("TcpHighSpeed") == 0
- || transport_prot.compare ("TcpHtcp") == 0
- || transport_prot.compare ("TcpVegas") == 0
- || transport_prot.compare ("TcpVeno") == 0
- || transport_prot.compare ("TcpBic") == 0
- || transport_prot.compare ("TcpScalable") == 0
- || transport_prot.compare ("TcpYeah") == 0
- || transport_prot.compare ("TcpIllinois") == 0
- || transport_prot.compare ("TcpLedbat") == 0)
- {
- Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size));
- BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ());
- ftp.SetAttribute ("Remote", remoteAddress);
- ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size));
- ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000)));
-
- ApplicationContainer sourceApp = ftp.Install (sources.Get (i));
- sourceApp.Start (Seconds (start_time * i));
- sourceApp.Stop (Seconds (stop_time - 3));
-
- sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
- ApplicationContainer sinkApp = sinkHelper.Install (sinks);
- sinkApp.Start (Seconds (start_time * i));
- sinkApp.Stop (Seconds (stop_time));
- }
- else
- {
- NS_LOG_DEBUG ("Invalid transport protocol " << transport_prot << " specified");
- exit (1);
- }
+ Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size));
+ BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ());
+ ftp.SetAttribute ("Remote", remoteAddress);
+ ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size));
+ ftp.SetAttribute ("MaxBytes", UintegerValue (data_mbytes * 1000000));
+
+ ApplicationContainer sourceApp = ftp.Install (sources.Get (i));
+ sourceApp.Start (Seconds (start_time * i));
+ sourceApp.Stop (Seconds (stop_time - 3));
+
+ sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
+ ApplicationContainer sinkApp = sinkHelper.Install (sinks.Get (i));
+ sinkApp.Start (Seconds (start_time * i));
+ sinkApp.Stop (Seconds (stop_time));
}
// Set up tracing if enabled
diff --git a/examples/tcp/wscript b/examples/tcp/wscript
index 4ecfbd1f080..cec810b229c 100644
--- a/examples/tcp/wscript
+++ b/examples/tcp/wscript
@@ -33,9 +33,13 @@ def build(bld):
['point-to-point', 'internet', 'applications', 'flow-monitor'])
obj.source = 'tcp-nsc-comparison.cc'
-
+
obj = bld.create_ns3_program('tcp-variants-comparison',
['point-to-point', 'internet', 'applications', 'flow-monitor'])
obj.source = 'tcp-variants-comparison.cc'
-
+
+ obj = bld.create_ns3_program('tcp-pacing',
+ ['point-to-point', 'internet', 'applications', 'flow-monitor'])
+
+ obj.source = 'tcp-pacing.cc'
diff --git a/examples/traffic-control/queue-discs-benchmark.cc b/examples/traffic-control/queue-discs-benchmark.cc
index da4d2602a64..328581ab9be 100644
--- a/examples/traffic-control/queue-discs-benchmark.cc
+++ b/examples/traffic-control/queue-discs-benchmark.cc
@@ -145,40 +145,42 @@ int main (int argc, char *argv[])
// Access link traffic control configuration
TrafficControlHelper tchPfifoFastAccess;
- tchPfifoFastAccess.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "Limit", UintegerValue (1000));
+ tchPfifoFastAccess.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "MaxSize", StringValue ("1000p"));
// Bottleneck link traffic control configuration
TrafficControlHelper tchBottleneck;
if (queueDiscType.compare ("PfifoFast") == 0)
{
- tchBottleneck.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "Limit", UintegerValue (queueDiscSize));
+ tchBottleneck.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "MaxSize",
+ QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
}
else if (queueDiscType.compare ("ARED") == 0)
{
tchBottleneck.SetRootQueueDisc ("ns3::RedQueueDisc");
Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true));
- Config::SetDefault ("ns3::RedQueueDisc::Mode", EnumValue (RedQueueDisc::QUEUE_DISC_MODE_PACKETS));
- Config::SetDefault ("ns3::RedQueueDisc::QueueLimit", UintegerValue (queueDiscSize));
+ Config::SetDefault ("ns3::RedQueueDisc::MaxSize",
+ QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
}
else if (queueDiscType.compare ("CoDel") == 0)
{
tchBottleneck.SetRootQueueDisc ("ns3::CoDelQueueDisc");
- Config::SetDefault ("ns3::CoDelQueueDisc::Mode", EnumValue (CoDelQueueDisc::QUEUE_DISC_MODE_PACKETS));
- Config::SetDefault ("ns3::CoDelQueueDisc::MaxPackets", UintegerValue (queueDiscSize));
+ Config::SetDefault ("ns3::CoDelQueueDisc::MaxSize",
+ QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
}
else if (queueDiscType.compare ("FqCoDel") == 0)
{
uint32_t handle = tchBottleneck.SetRootQueueDisc ("ns3::FqCoDelQueueDisc");
- Config::SetDefault ("ns3::FqCoDelQueueDisc::PacketLimit", UintegerValue (queueDiscSize));
+ Config::SetDefault ("ns3::FqCoDelQueueDisc::MaxSize",
+ QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
tchBottleneck.AddPacketFilter (handle, "ns3::FqCoDelIpv4PacketFilter");
tchBottleneck.AddPacketFilter (handle, "ns3::FqCoDelIpv6PacketFilter");
}
else if (queueDiscType.compare ("PIE") == 0)
{
tchBottleneck.SetRootQueueDisc ("ns3::PieQueueDisc");
- Config::SetDefault ("ns3::PieQueueDisc::Mode", EnumValue (PieQueueDisc::QUEUE_DISC_MODE_PACKETS));
- Config::SetDefault ("ns3::PieQueueDisc::QueueLimit", UintegerValue (queueDiscSize));
+ Config::SetDefault ("ns3::PieQueueDisc::MaxSize",
+ QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize)));
}
else
{
@@ -190,8 +192,7 @@ int main (int argc, char *argv[])
tchBottleneck.SetQueueLimits ("ns3::DynamicQueueLimits");
}
- Config::SetDefault ("ns3::QueueBase::Mode", StringValue ("QUEUE_MODE_PACKETS"));
- Config::SetDefault ("ns3::QueueBase::MaxPackets", UintegerValue (100));
+ Config::SetDefault ("ns3::QueueBase::MaxSize", StringValue ("100p"));
NetDeviceContainer devicesAccessLink = accessLink.Install (n1.Get (0), n2.Get (0));
tchPfifoFastAccess.Install (devicesAccessLink);
@@ -200,7 +201,7 @@ int main (int argc, char *argv[])
address.NewNetwork ();
Ipv4InterfaceContainer interfacesAccess = address.Assign (devicesAccessLink);
- Config::SetDefault ("ns3::QueueBase::MaxPackets", UintegerValue (netdevicesQueueSize));
+ Config::SetDefault ("ns3::QueueBase::MaxSize", StringValue (std::to_string (netdevicesQueueSize) + "p"));
NetDeviceContainer devicesBottleneckLink = bottleneckLink.Install (n2.Get (0), n3.Get (0));
QueueDiscContainer qdiscs;
diff --git a/examples/traffic-control/red-vs-fengadaptive.cc b/examples/traffic-control/red-vs-fengadaptive.cc
new file mode 100644
index 00000000000..90f790f55dd
--- /dev/null
+++ b/examples/traffic-control/red-vs-fengadaptive.cc
@@ -0,0 +1,188 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2016 NITK Surathkal
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Sourabh Jain
+ * Mohit P. Tahiliani
+ */
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/internet-module.h"
+#include "ns3/point-to-point-module.h"
+#include "ns3/applications-module.h"
+#include "ns3/point-to-point-layout-module.h"
+#include "ns3/traffic-control-module.h"
+
+#include
+#include
+#include