Compare commits

...
934 Commits
Author SHA1 Message Date
Klaus a3e26a68f4 Edit Makefile to include examples. 2016-12-04 12:47:55 -07:00
Klaus 937c3c388c Added new version of Codel Queue that uses congestion marks. 2016-12-03 18:20:21 -07:00
Klaus a64d062b49 Changed Makefile for optimiized compilation. 2016-12-01 12:48:02 -07:00
Alexander Afanasyev 2c66f4c020 core: Additional code for ability to generate subset of documentation by utils/print-introspected-doxygen 2015-08-25 11:08:20 -07:00
Alexander Afanasyev 4da74c6430 build: Fix waf-tools/boost.py
The defined logic sets STLIBPATH_BOOST variable even if static boost
libraries have not been requested.  Having this variable set,
potentially prefers linking to pre-installed libns3-dev... libraries,
instead of the compiled libraries.
2015-08-21 00:51:12 -07:00
Alexander Afanasyev cb9702a556 build: Removing 'subst' feature that is defined in waf (waflib/TaskGen.py) 2015-08-20 20:19:46 -07:00
Alexander Afanasyev d2e78ccb33 bindings: Automatically try to generate pybindgen version if it is not available 2015-08-20 17:06:04 -07:00
Alexander Afanasyev 1cdf54260b build: Add compiler flag checking 2015-08-20 17:05:56 -07:00
Alexander Afanasyev a22fb1ba66 core: Give ability to generate subset of documentation by utils/print-introspected-doxygen 2015-08-20 17:05:56 -07:00
Alexander Afanasyev 5e112ceba3 bindings: Version update and ndnSIM-related updates
- Now requiring a customized version of pybindgen (necessary for ndnSIM
  bindings)
- Fixed ndnSIM FIB/CS/PIT visualizer plugins to work with ndnSIM-v2 codebase
2015-08-20 17:05:55 -07:00
Alexander Afanasyev 55025b4713 build: Extend .pc file generation to include export_includes option 2015-08-20 17:05:55 -07:00
Alexander Afanasyev 8200d73066 build: Build script improvements 2015-08-20 17:05:55 -07:00
Spyridon Mastorakis 7ce4e68e5e build: Force to compile using C++11
Starting this commit, NS-3/ndnSIM requires gcc >= 4.7 or clang >= 3.5
2015-08-20 17:05:55 -07:00
Alexander Afanasyev f4014037e8 build: Disable -Werror flags 2015-08-20 17:05:55 -07:00
Alexander Afanasyev 4b404bb9bb topology-read: Rescan bindings 2015-08-20 17:05:55 -07:00
Alexander Afanasyev 0ac1381146 topology-read: Making default constructor for TopologyReader::Link public.
This is necessary for some STL containers operations.
2015-08-20 17:05:55 -07:00
Alexander Afanasyev dd25de7e36 topology-read: TopologyReader and derivatives are no longer Objects
To allow smart pointers, TopologyReader is just inherited from
SimpleRefCount<TopologyReader> class
2015-08-20 17:05:55 -07:00
Alexander Afanasyev 2d976ae200 topology-read: Several extensions of TopologyReader 2015-08-20 17:05:55 -07:00
Alexander Afanasyev cb4770b9d2 bindings+network: Packet API extension, allowing creating of packet from string (for python bindings) 2015-08-20 17:05:55 -07:00
Alexander Afanasyev 8ab3d4ecc4 bindings+network: Adding STL-like iterator wrappers (begin(), end(), size()) for NodeContainer class 2015-08-20 17:05:55 -07:00
Alexander Afanasyev e1fd51ee82 visualizer+ndnSIM: Adding ability to visualize items of the content store in real time 2015-08-20 17:05:54 -07:00
Alexander Afanasyev 86e477e13b visualizer+ndnSIM: Adding plugin to display ndnSIM PIT status 2015-08-20 17:05:54 -07:00
Alexander Afanasyev a0c8acfa66 visualizer+ndnSIM: Adding plugin to display a ndnSIM FIB state 2015-08-20 17:05:54 -07:00
Alexander Afanasyev 15c018ff25 visualizer: Modifying the way visualizer is installed
Using ant_glob instead of explicitly listing the installed files
2015-08-20 17:05:54 -07:00
Alexander Afanasyev 4193a68e34 visualizer: Adding ability to assign position to mobility model is env{NS_VIS_ASSIGN} is set to any value 2015-08-20 17:05:54 -07:00
Alexander Afanasyev f0773a150e visualizer: output node ID 2015-08-20 17:05:54 -07:00
Alexander Afanasyev 0c20bbf621 visualizer: Making a periodic topology rescan 2015-08-20 17:05:54 -07:00
Alexander Afanasyev 117d21b1dd visualizer+mobility+bindings: A specialized version of GetObject (GetMobilityModel) in MobilityModel
This method is now used by the visualizer to obtain mobility interface.

This trick is necessary on some platforms in order to use mobility models that
are not explicitly exported (or is impossible to export) to python.
2015-08-20 16:48:39 -07:00
Alexander Afanasyev ef9e955e6c fd-net-device: Add missing include for strerror 2015-08-20 14:40:42 -07:00
Alexander Afanasyev 174704abba point-to-point: Extending helper interface to support setting individual queue parameters 2015-08-20 14:40:42 -07:00
Alexander Afanasyev efabb7dcaa point-to-point-layout: Respect absolute values of specified boundaries
Before the change, the values specified in SetBoundaryBox were used only
to calculate relative positions of grid nodes.
2015-08-20 14:40:41 -07:00
Ilya Moiseenko dec52190b7 point-to-point: Add support of NDN protocol
- Add support of PPP->Ethernet and Ethernet->PPP frame type conversion
  for NDN protocol
- Adding support for NDN payload in PppHeader::Print method
2015-08-20 14:40:41 -07:00
Alexander Afanasyev 718d156554 Adding .gitignore and disclaimer note in README 2015-08-20 14:40:41 -07:00
Peter D. Barnes, Jr. ebd742ba2d Refactor test name character restrictions 2015-08-18 16:17:36 -07:00
Peter D. Barnes, Jr. be83597fd4 Flush pcap files in debug builds. 2015-08-18 15:19:32 -07:00
Peter D. Barnes, Jr. 111035d3fa Fix response vector file path construction. 2015-08-18 15:15:04 -07:00
Tom Henderson bfb95b39dd fix maybe-uninitialized warning 2015-08-17 15:31:27 -07:00
Tom Henderson 1c7a870d29 update RELEASE_NOTES 2015-08-17 14:52:57 -07:00
Tom Henderson 5ebab00295 rescan mesh bindings 2015-08-17 14:43:08 -07:00
Tom Henderson 65b2e8d837 bug 1482: avoid newlines in mesh header Print() methods; implement additional Print() methods; additional cleanup of header-related code 2015-08-17 14:31:07 -07:00
Tom Henderson 7e6ca121d6 bug 1482: split PeerLinkFrameStart header into different header types, avoiding the need to set the header type before deserializing 2015-08-17 14:29:51 -07:00
Tom Henderson 134aadf85e move definition of Wifi information element IDs from mesh to wifi module; implement more fully the WifiInformationElementVector header class 2015-08-17 14:29:32 -07:00
Tom Henderson 34b3521638 update test vectors for mesh header changes from bug 1901 patches 2015-08-17 14:02:17 -07:00
Tom Henderson a9196fc0c6 bug 1901: set MeshControlPresent flag in the QoS Control field 2015-08-17 13:45:08 -07:00
Tom Henderson a7cb5fb195 bug 1901: set mesh frames to type QOSDATA 2015-08-17 13:44:25 -07:00
Sébastien Deronne fee54949b1 update RELEASE_NOTES 2015-08-15 19:30:10 +02:00
Vedran Miletić 3a690bd071 Detect gccxml using CastXML wrapper in waf configure 2015-08-15 17:14:51 +02:00
Sébastien Deronne 56dbc49aa3 Add utest for Bug 730 2015-08-15 13:15:03 +02:00
Sébastien Deronne bc4d797dbf Bug 730 [wifi] - Enabling fragmentation at run-time breaks simulation (patch from Christian Facchini) 2015-08-15 13:14:14 +02:00
Tom Henderson 95ffc4d89b rescan bindings 2015-08-14 08:00:38 -07:00
Tom Henderson c67535dc7a fix typo 2015-08-13 19:53:56 -07:00
Peter D. Barnes, Jr. de61c2f689 GetDevice() should be const. 2015-08-13 12:10:01 -07:00
Peter D. Barnes, Jr. d81c292aba Remove obsolete struct, never invoked. 2015-07-29 12:44:41 -07:00
Tom Henderson 6db467ef95 update test documentation 2015-08-13 11:08:56 -07:00
Tom Henderson 2704990f20 fix mesh doxygen 2015-08-13 10:24:42 -07:00
Tom Henderson 04a0f64427 fix typo 2015-08-13 09:20:55 -07:00
Tom Henderson 686844f601 add missing author 2015-08-13 09:19:58 -07:00
Sébastien Deronne 1723645d4e rescan bindings 2015-08-09 21:17:18 +02:00
Sébastien Deronne c66070b52c cleanup 2015-08-09 20:50:54 +02:00
Sébastien Deronne 3f1a93b68b [network] Rebuild python bindings 2015-08-09 20:29:17 +02:00
Alexander Krotov 292979e742 Removed GetCurrentStartOffset and GetCurrentEndOffset 2015-07-26 19:44:31 +03:00
Alexander Krotov 7fb26bfe59 Make ByteTagList offsets relative to packet start 2015-07-26 19:44:32 +03:00
Alexander Krotov 19488ad7aa Factor ByteTagList::Adjust out of ByteTagList::AddAt{Start,End} 2015-08-08 23:33:55 +03:00
Alexander Krotov 0afb4dcc80 Optimize ByteTagList adjustment 2015-08-08 23:13:40 +03:00
Alexander Krotov a32da6615b Byte tags benchmark 2015-08-08 18:21:45 +03:00
Alexander Krotov 57fa7f7b9b Use CommandLine to parse arguments in Packet benchmark 2015-08-08 21:45:16 +03:00
Mathieu Lacage 2e0d44a130 make minimum number of iterations 1 to avoid changing command-line behavior 2015-08-07 02:50:14 -04:00
Alexander Krotov 35f4c249d4 Optimize ByteTagList by tracking byte tags boundaries
This patch restores performance to the level nearly equal to that before
recent bugfixing, as was checked by running utils/bench-packets.
2015-07-26 19:44:33 +03:00
Mathieu Lacage a623762bd9 merge 2015-08-07 02:47:25 -04:00
Tom Henderson 8509f28877 rescan network bindings 2015-08-06 11:15:42 -07:00
Mathieu Lacage 6c4f5c7c79 run the benchmark over multiple iterations to minimize variance 2015-08-06 05:15:51 -04:00
Alexander Krotov ded303057a When data is written with WriteU64, it should be tested with ReadU64,
not ReadLsbtohU64.
2015-08-02 20:44:01 +03:00
Alexander Krotov b62cf68711 Make Buffer::CreateFullCopy private 2015-08-02 19:26:37 +03:00
Alexander Krotov 01983101a6 Fragmentation and concatenation benchmark 2015-08-02 19:26:35 +03:00
Alexander Krotov 6250c61bcf Optimize Buffer::Iterator::CheckNoZero 2015-07-26 19:44:29 +03:00
Mathieu Lacage fd74ac7616 remove un-needed return value 2015-08-05 15:20:10 -04:00
Mathieu Lacage 3ae948f663 ByteTagList::AddAtEnd/AddAtStart must be called unconditionally to ensure that newly-added bytes are not tagged when 1. Packet::AddByteTag, 2. Packet::RemoveHeader, 3. Packet.AddHEader 2015-08-05 15:11:19 -04:00
Alexander Krotov b0577a2eac Add "unfixable" ByteTagList test case
This test case creates empty packet, removes last 50 bytes and
adds them back.

As packet is empty initially, no bytes are marked dirty.  Therefore,
Buffer::AddAtEnd returns false, indicating that added bytes were not used
before.  However, it does not know if they were tagged with byte tags.

This bug is not so easy to fix as Buffer does not have enough information
to return true in Buffer::AddAtEnd when it should.
2015-07-26 19:44:31 +03:00
Alexander Krotov 8f515dcc03 Add failing PaddingAtEnd test case 2015-07-26 19:44:30 +03:00
Alexander Krotov def03785bf Add ByteTagList tests, 3 out of 4 failing 2015-07-26 19:44:29 +03:00
Alina Quereilhac 47d54736d4 bug 2119: Fixing memory leaks in FdNetDevice test with DefaultSimulatorImpl due to non-executed events when simulation ends 2015-08-04 22:45:54 +02:00
Sébastien Deronne 8c21bdae76 add missing mac-tx-middle.h in wifi wscript 2015-08-01 19:48:14 +02:00
Tom Henderson dabdc5f45b remove debugging statement introduced in changeset 11540:29d2c2f5c2cf 2015-07-31 12:58:40 -07:00
Peter D. Barnes, Jr. f7311ec17a Build profile macros 2015-07-28 16:33:35 -07:00
Sébastien Deronne 62eb723a6b fix incorrect NAV duration (reported by Xiaowen Wang) 2015-07-28 19:55:54 +02:00
Alexander Krotov e5697f0c2c Remove ByteTagList::IsDirty{Start,End}
These functions are only used once and do not save time.  Both functions
iterate over the whole list just to prevent iterating over the whole list
if they return false. As traversing the list is required in any case,
these functions can be removed.
2015-07-26 19:44:06 +03:00
Tommaso Pecorella 9b2f73e9ae Bug 2148 - Ipv6Interface::SetUp doesn't re-create the Link-Local addresses 2015-07-24 08:59:57 +02:00
Gustavo Carneiro 1ad026d2bd Update to get pybindgen from github, with new version scheme 2015-07-26 14:01:43 +01:00
Tommaso Pecorella 871b92f377 [Doxygen] update sixlowpan in/out params 2015-07-25 23:55:40 +02:00
Tommaso Pecorella fd1bda1bb9 [Doxygen] update topology-read in/out params 2015-07-25 20:17:45 +02:00
Peter D. Barnes, Jr. e1a48462bc [Doxygen] Label arguments as in,out. Sentence capitalization. 2015-07-24 12:45:22 -07:00
Peter D. Barnes, Jr. 91a1e78dca Revert df256d84a7fa. 2015-07-24 11:49:59 -07:00
Peter D. Barnes, Jr. 0e5781ee97 [Sphinx] Fix mesh manual bugs. 2015-07-24 11:49:29 -07:00
Sébastien Deronne 885bb7e1cd Bug 2156 [wifi] - Duplicate packets when using two level aggregation 2015-07-23 21:55:17 +02:00
Peter D. Barnes, Jr. 62f72a7048 [Doxygen] Fix dirty repo detection. 2015-07-22 17:10:15 -07:00
Peter D. Barnes, Jr. 9e71fc449f [Doxygen] Template parameter deduction. 2015-07-22 17:09:55 -07:00
Peter D. Barnes, Jr. aa14800121 Add NonCopyable, refactor Singleton. 2015-07-21 16:21:49 -07:00
Peter D. Barnes, Jr. d5be610a4d [Doxygen] Remaining in core 2015-07-21 16:20:17 -07:00
Peter D. Barnes, Jr. 4d180f672c Clarify that Time arguments to Schedule are all delays wrt Now. 2015-07-21 12:20:12 -07:00
Peter D. Barnes, Jr. 69dd251a0f [Doxygen] Better documentation for NS_DEPRECATED 2015-07-10 18:13:14 -07:00
Peter D. Barnes, Jr. 39c2b005a4 Remove file-local uncalled and unimplemented functions. 2015-07-08 17:36:16 -07:00
Peter D. Barnes, Jr. 715841d0b3 Fix spelling 2015-07-06 14:43:38 -07:00
Sébastien Deronne cce40e5148 update RELEASE_NOTES 2015-07-22 23:19:22 +02:00
Matias Richart c971b0de7d Bug 2154 [wifi] - Incorrect power calculation in wifi power adaptation examples 2015-07-22 23:16:53 +02:00
Matias Richart cb8b2a5ad1 Bug 2153 [wifi] - Incorrect power limits in wifi power control algorithms 2015-07-22 23:14:47 +02:00
Christopher Hepner 773bee35ac improve mesh model library documentation (based on original documentation text from Kirill Andreev) 2015-07-22 08:53:01 -07:00
Tom Henderson 31211f8dc2 add more documentation structure for mesh module 2015-07-22 08:47:43 -07:00
Tom Henderson bc89ea5288 fix task name in wscript 2015-07-22 08:42:18 -07:00
Matthieu Coudron 368aa197c4 Simplify ns3tcp test code used for pcap writing 2015-07-22 01:13:59 +02:00
Matthieu Coudron 2f63edb779 Add SinkWithHeader to PcapHelper 2015-07-22 01:13:06 +02:00
Alina Quereilhac 559d337432 revert changeset 4be177372dc4 (Bug 2119) due to test 'dummy-network' now crashing for OS X 2015-07-20 10:27:31 +02:00
Alina Quereilhac 1b432fecac Bug 2119 - valgrind leaks intermittently reported for fd-net-device dummy-network - Required SimulatorImplementationType to be set to ns3::RealtimeSimulatorImpl 2015-07-15 16:52:16 +02:00
Tom Henderson c75d2fb8f5 update CHANGES.html and RELEASE_NOTES 2015-07-13 20:32:31 -07:00
Tom Henderson 34cde13d3f rescan internet bindings 2015-07-13 19:18:49 -07:00
Natale Patriciello 66f58aab5a Documented TCP states, moved enum inside TcpSocket 2015-07-13 17:58:06 -07:00
Natale Patriciello 7f8dc7e404 Window() is now managed inside TcpSocketBase 2015-07-13 17:57:09 -07:00
Natale Patriciello f228c5c17b Initialize cWnd and ssTh in TcpSocketBase 2015-07-13 17:56:15 -07:00
Natale Patriciello 43051b28c0 Moved cWnd and ssThresh inside TcpSocketBase
These two trace sources are now managed in TcpSocketBase.
2015-07-13 10:02:55 -07:00
Natale Patriciello 5c99689061 TCP flags are now printed using string instead of numbers
This patch improves readability when TCP flags are involved.
2015-07-13 08:26:43 -07:00
Natale Patriciello 8f11338195 TcpHeader can be printed in NS_LOG messages
Implemented the operator << to an output stream.
2015-07-13 08:23:40 -07:00
Natale Patriciello c489647301 DoForwardUp behavior unified for IPv4 and IPv6
The commit unifies the behavior of DoForwardUp for both IPv4 and IPv6
(previously tagged as duplicated code) by changing the input parameters: from an
{IPv4,IPv6}Header to a couple of address (sender and receiver). Thanks to the
Send() method of TcpL4Protocol which takes in input two Addresses, the behavior
of the method could be unified as in the commit title.
2015-07-13 08:06:38 -07:00
Natale Patriciello d3f916a917 Addressed comment in CodeReview
SendPacket made private except the one which takes general Address. Some minor
correction on doxygen comments.
2015-07-13 08:05:07 -07:00
Natale Patriciello 3dc863a005 Checked style on TcpL4Protocol 2015-07-13 08:03:44 -07:00
Natale Patriciello b97b0de553 Const correctness enforced 2015-07-13 08:02:58 -07:00
Natale Patriciello fdcf89dd53 Duplicated code removed from Receive in TcpL4Protocol
When TcpL4Protocol receive a packet, the methods which handle the management
of the packet itself (for both IPv4 and IPv6) shares a lot of code. Differencies
are only in the endpoint searching; the other operations have been merged in two
protected methods, which are called by the Receive methods.
2015-07-13 07:53:58 -07:00
Natale Patriciello ec3ff0953b Bug 2132: If no endpoints are found for the incoming packet, the TcpL4Protocol sends an RST packet. However it was not well-formatted (missing right source, destination and ports). 2015-07-13 07:50:47 -07:00
Natale Patriciello b4e765c5b6 Documentation improvements on TcpL4Protocol 2015-07-13 07:48:39 -07:00
Natale Patriciello 5c66f6fa1f Unused header removed to enable a faster compile process. 2015-07-08 06:58:31 -07:00
Natale Patriciello dcdbc179fb Thanks to previous commits, now TcpSocketBases uses only public methods on TcpL4Protocol and the friend relation could be removed. 2015-07-08 06:50:00 -07:00
Natale Patriciello f612ebca1c Instead of directly manage the m_socketList member from TcpSocketBase, interact with it through public methods of TcpL4Protocol. 2015-07-08 06:48:40 -07:00
Natale Patriciello 93ce0ad194 Interface API change. This removes the (unused) Send function, and makes SendPacket (used by TcpSocketBase) a public method of the class TcpL4Protocol. 2015-07-08 06:46:54 -07:00
Tom Henderson 1606c90844 fix noeol in wscript 2015-07-12 07:45:13 -07:00
Sébastien Deronne 173514d457 fix, improve and extend HT capabilities information element 2015-07-11 19:02:02 +02:00
Sébastien Deronne 4ad1a2c90e [wave] Rebuild python bindings 2015-07-11 12:24:01 +02:00
Sébastien Deronne ac797fccec [mesh] Rebuild python bindings 2015-07-11 12:17:55 +02:00
Sébastien Deronne 198428de10 rebuild bindings 2015-07-11 11:38:29 +02:00
Sébastien Deronne 425490bc54 rename snrDb to signalNoiseDbm 2015-07-11 11:14:24 +02:00
Sébastien Deronne ce9e786d23 improve readibility of snr values 2015-07-11 00:59:27 +02:00
Peter D. Barnes, Jr. 0ec7a3b9d4 Remove extraneous blank lines from build chatter. 2015-07-09 15:13:34 -07:00
Peter D. Barnes, Jr. e43b4acbde Restore section label required for cross-linking. 2015-07-09 11:35:37 -07:00
Sébastien Deronne 051d5b1aa1 fix Supported MCS Set field in HT capabilities 2015-07-10 11:50:54 +02:00
Tommaso Pecorella 3d53962700 Bug 1941 - [energy] Remove unnecessary dependency involving energy module 2015-07-03 18:11:05 +02:00
Tommaso Pecorella b332bce32f Bug 1941 - [wave] Remove unnecessary dependency on Application module 2015-07-08 10:03:53 +02:00
Tommaso Pecorella 270691c72d Bug 1941 - [mesh] Remove unnecessary dependency on Application module 2015-07-09 23:52:12 +02:00
Tommaso Pecorella 435859a64b Bug 1941 - [aodv] Remove unnecessary dependency on Application module 2015-07-03 18:12:25 +02:00
Tommaso Pecorella 3c4d250b4b Bug 1941 - [olsr] Remove unnecessary dependency on Application module 2015-07-03 18:11:59 +02:00
Tommaso Pecorella 1ffa01e505 [wifi] Rebuild python bindings 2015-07-09 22:46:36 +02:00
Sébastien Deronne b7e891ccfa rename snrDbm to snrDb 2015-07-09 18:20:34 +02:00
Sébastien Deronne a096ecca2f update RELEASE_NOTES 2015-07-08 23:52:26 +02:00
Sébastien Deronne 0d5fc14442 add support for HT MCS and A-MPDU in radiotap headers 2015-07-08 23:44:17 +02:00
Tommaso Pecorella 84452d7d9e Waf - setup optimization and debug info for clang 2015-07-08 00:09:46 +02:00
Vedran Miletić f1a1922cc0 Silence Clang 3.6+ -Wno-potentially-evaluated-expression warning
Clang 3.6+ warns about "expression with side effects will be evaluated
despite being used as an operand to 'typeid'" if Ptr<> is used as an
argument to typeid(). This changes the code to use raw pointers
instead of Ptr<>.
2015-07-07 22:06:08 +02:00
Vedran Miletić a944617f27 Use proper environment when checking for supported compiler flags 2015-07-07 22:01:23 +02:00
Vedran Miletić 6cb06ce560 Handle the case where scratch or examples directory is missing 2015-07-07 13:37:52 +02:00
Vedran Miletić 46297abcda Remove unused EXAMPLE_DIRECTORIES environment variable 2015-07-07 13:32:26 +02:00
Vedran Miletić 9f10edb665 Update waf to 1.8.12 2015-07-07 12:18:59 +02:00
Sébastien Deronne 7567960935 fix HT capabilities printing in PCAP files 2015-07-02 21:11:24 +02:00
Tom Henderson 412cf215b9 bump pybindgen version 2015-07-02 12:29:48 -07:00
Tommaso Pecorella d8c14885b2 Bug 2124 - UdpSocketImpl::ShutdownRecv doesn't stop the Ipv[4,6]EndPointDemux 2015-07-02 18:21:44 +02:00
Sébastien Deronne 9e70317df6 remove file execution bit on wifi source files 2015-06-14 22:30:44 +02:00
Nicola Baldo cf45881bcc fixed Bug 2143 - maybe-uninitialized warning 2015-06-30 18:31:43 +02:00
Peter D. Barnes, Jr. 30c95658e9 Fix doxygen command after update to waf 1.8 in r11458, 126b15bc1efc 2015-06-28 20:24:41 -07:00
Peter D. Barnes, Jr. dfd965e6f8 Revert unintentional change of third.cc trace file names, and remove execute bits.
These were introduced in 11418:4d6051f4166f.

Reported by Tom Henderson
2015-06-26 11:43:48 -07:00
Tom Henderson 0e03b5828f enable wifi module documentation to be built standalone 2015-06-24 21:48:29 -07:00
Tom Henderson 5a76830b73 bug 2127: Scheduler benchmark utility works correctly in first run only (patch due to Philipp Andelfinger) 2015-06-24 21:39:59 -07:00
Tom Henderson dc3667a937 bug 2125: subclasses must chain up to their base class NotifyNewAggregate() method (patch due to nlmills) 2015-06-24 21:36:15 -07:00
Mohit P. Tahiliani d8ee7fffa4 add second.py and third.py Python examples 2015-06-24 19:40:03 -07:00
Mohit P. Tahiliani 6433205b6c fix command-line argument handling in mixed-wireless.py example 2015-06-24 18:46:01 -07:00
Sébastien Deronne 340437104d fix issue with the delay parameter in test-interference-helper 2015-06-24 18:54:29 +02:00
Vedran Miletić 4146d77eaf Fix printing of gccxml version (Waf 1.8 API change) 2015-06-23 14:40:12 +02:00
Vedran Miletić 2006e41baa Fix Python bindings wscript and waf-tools for Waf 1.8 2015-06-23 14:34:53 +02:00
Matthieu Coudron 5506d60922 Update Waf to 1.8.11
Changes:
* run_c_code() is replaced by check()
* nice_path() got removed, and is replaced by bldpath()
* check_compilation_flag() is updated to work with 1.8 API
2015-06-23 14:32:41 +02:00
Sébastien Deronne 8cfb0bf43f rescan bindings 2015-06-14 20:53:47 +02:00
Sébastien Deronne 246166d593 add test script for InterferenceHelper 2015-06-22 19:00:34 +02:00
Sébastien Deronne 46b7c2ac8a fix some more issues in wifi-phy-test 2015-06-22 19:00:03 +02:00
Sébastien Deronne 660756646a rebuild pcap traces 2015-06-22 18:45:52 +02:00
Sébastien Deronne cd0f4ad075 Bug 2108 [wifi] - Erroneous implementation in InterferenceHelper 2015-06-22 18:45:49 +02:00
Tom Henderson 9ca914b2b3 Bug 1249 [wifi] - doxygen comments on device-level SetMobility () 2015-06-22 18:28:40 +02:00
Sébastien Deronne 34ca3a8c0b cleanup wifi module 2015-06-21 00:23:45 +02:00
Tom Henderson 2c13d2dbe8 fix dead link 2015-06-16 13:13:06 -07:00
Sébastien Deronne 65f248403a cleanup wifi-remote-station-manager 2015-06-15 20:05:15 +02:00
Nicola Baldo 560af5e3d8 fixed function logs in radio-berarer-stats-connector 2015-06-15 18:06:54 +02:00
Sébastien Deronne e6d5b2752d cleanup yans-wifi-channel, yans-error-rate-model and nist-error-rate-model 2015-06-14 23:05:49 +02:00
Sébastien Deronne b19606dc73 rescan bindings 2015-06-14 20:29:08 +02:00
Sébastien Deronne 9080f150a6 cleanup yans-wifi-phy 2015-06-14 20:15:37 +02:00
Sébastien Deronne 40d10240cf rescan bindings 2015-06-14 18:21:46 +02:00
Sébastien Deronne ecbd57326b cleanup wifi-phy 2015-06-14 17:33:42 +02:00
Sébastien Deronne 569f1c2dce cleanup wifi-mac-header 2015-06-14 10:53:08 +02:00
Sébastien Deronne 3109031c35 cleanup mac-low.cc 2015-06-12 20:58:01 +02:00
Sébastien Deronne 90806e1f2a fix issues with wifi-phy-test 2015-06-12 20:14:31 +02:00
Tommaso Pecorella d74e9fdf30 Enh. 2130 - Allow SimpleChannel to simulate hidden terminals. 2015-06-11 19:07:25 +02:00
Tommaso Pecorella c5f127c193 Bug 1929 - TcpL4Protocol::Send must indicate the source address to routing (if known) 2015-06-11 17:30:07 +02:00
Tommaso Pecorella cbe83c6f5a Bug 2138 - SimpleNetDevice could send overlapped packets. 2015-06-11 11:40:53 +02:00
Tom Henderson 8df0d04bbb add missing copyrights 2015-06-10 07:52:23 -07:00
Tommaso Pecorella ba17f6168e Bug 1929 - TcpL4Protocol::Send must indicate the source address to routing (if known) 2015-06-09 23:36:57 +02:00
Tommaso Pecorella f47b9bce81 Bug 2135 - TCP doesn't honor the socket's output interface 2015-06-09 23:41:06 +02:00
Peter D. Barnes, Jr. d67ced0392 Fix parents, group names, and missing constructors in GetTypeId definitions. 2015-06-09 12:59:59 -07:00
Peter D. Barnes, Jr. 1420606fc6 Convert to unix line endings. 2015-06-08 16:38:30 -07:00
Peter D. Barnes, Jr. a2e0ed145a Missing mode lines. 2015-06-08 16:37:40 -07:00
Peter D. Barnes, Jr. d85ad22554 Condition examples/realtime/realtime-udp-echo.cc on ENABLE_REAL_TIME 2015-06-08 12:24:46 -07:00
Tom Henderson ab88e121ca fix attribute accessor for DropTailQueue Mode attribute (reported by Chip Webb) 2015-06-08 13:46:18 -07:00
Sébastien Deronne 0ac6727a82 update RELEASE_NOTES 2015-06-07 16:43:55 +02:00
Junling Bu c16fb42027 Bug 2136 [wifi] - The usage of tid in wifi and wave module shall be if (tid > 7) rather than if (tid >= 7) 2015-06-07 16:42:28 +02:00
Sébastien Deronne 8bd7f62305 rescan bindings 2015-06-06 18:21:26 +02:00
Sébastien Deronne ef49c036ec 802.11n short guard interval indication in radiotap header 2015-06-06 18:02:37 +02:00
Sébastien Deronne af65a032f1 update RELEASE_NOTES 2015-06-05 23:53:18 +02:00
Junling Bu 823d1b1642 Bug 1736 [wifi] - default dot11EDCATableMSDULifetime 2015-06-05 23:49:09 +02:00
Tommaso Pecorella 5a7a4fff83 Bug 2126 - LrWpanNetDevice silently accepts no mobility on the node 2015-05-28 10:22:59 +02:00
Sébastien Deronne 5dcc405843 postfix for commit 11384:935dc1cc08a4 2015-05-27 21:55:56 +02:00
Sébastien Deronne cc2d4e4c12 trigger fatal error when adding a HT rate in BSSBasicRateSet 2015-05-27 13:07:48 +02:00
Peter D. Barnes, Jr. e9c14c2b54 Bring tutorial third.cc and mpi third-distributed.cc into alignment. 2015-05-18 21:14:10 -07:00
Peter D. Barnes, Jr. 9ad27ed6ec Clarify test messages. 2015-03-06 16:44:54 -08:00
Peter D. Barnes, Jr. c16d0b97ac Correct misspelled class names: TimeIntputOutputTestCase, TimesWithSignsTestCase 2015-02-20 14:23:09 -08:00
Peter D. Barnes, Jr. 69e4cc6139 Attribute test vectors assume ns Time resolution.
Since these are tests of Attributes per se, not Time, forcing the
resolution should not hide other issues with Attributes.
2015-02-20 14:20:35 -08:00
Peter D. Barnes, Jr. 5545a7f224 Remove extraneous ' ' around :: 2015-02-04 13:40:57 -08:00
Peter D. Barnes, Jr. 9f88bd50f0 On mismatch PcapFile::Diff reports packet number. 2015-02-04 12:35:17 -08:00
Peter D. Barnes, Jr. eb4138894f test.py list formatting 2015-02-04 12:34:24 -08:00
Tommaso Pecorella 9c250b48c9 [Doxygen] Internet module fixes (again) 2015-05-24 15:45:54 +02:00
Tommaso Pecorella 13deae792b [Doxygen] tap-bridge module fixes 2015-05-24 15:37:37 +02:00
Tommaso Pecorella dabc95ee4d [Doxygen] bridge module fixes 2015-05-24 14:02:16 +02:00
Tommaso Pecorella e1b0f8c2f1 [Doxygen] point-to-point-layout model fixes 2015-05-24 10:35:53 +02:00
Tommaso Pecorella f5147ff55e [Doxygen] fd-net-device module fixes 2015-05-24 09:58:19 +02:00
Tommaso Pecorella 06835eb89d [Doxygen] csma module 2015-05-24 09:06:42 +02:00
Tommaso Pecorella 7033e74a3f [Doxygen] Internet module fixes 2015-05-24 00:06:35 +02:00
Tommaso Pecorella 0ddd5c62b7 [Doxygen] csma-layout module fixes 2015-05-24 00:58:38 +02:00
Tommaso Pecorella 23f15b7afc [Doxygen] stats module fixes 2015-05-24 00:29:15 +02:00
Tommaso Pecorella 3436e5f599 [Doxygen] mobility model fixes 2015-05-24 00:26:42 +02:00
Tommaso Pecorella 8628634ffa [Doxygen] Application module fixes 2015-05-24 00:12:27 +02:00
Tommaso Pecorella 59b9e08aa2 [RipNg] clarify the socket binding addresses 2015-05-22 17:07:46 +02:00
Nicola Baldo d9b4528ca1 removed duplicate costly instruction in lte-spectrum-phy.cc 2015-05-22 13:06:06 +02:00
Sébastien Deronne 72e8f65b8a remove tracing information about aggregate queue flushing when aggregate queue is empty 2015-05-17 12:50:59 +02:00
Tom Henderson 98bf5861f3 update RELEASE_NOTES and CHANGES.html for next release 2015-05-13 12:02:14 -07:00
Tom Henderson cc0ac11580 update tutorial package version numbers 2015-05-13 11:12:28 -07:00
Tom Henderson d216402e96 Added tag ns-3.23 for changeset 8ea92bc090cd 2015-05-13 10:48:19 -07:00
Tom Henderson 097bbd8859 update RELEASE_NOTES for release 2015-05-13 10:48:03 -07:00
Tom Henderson c2e3f10058 update AUTHORS 2015-05-07 10:09:27 -07:00
Tom Henderson 64c6e1e1ad add more wifi model clarifications 2015-05-07 10:02:48 -07:00
Tom Henderson 557c77fd8f update CHANGES.html 2015-05-07 10:00:15 -07:00
Tom Henderson 6a91f578fa update RELEASE_NOTES 2015-05-06 22:01:20 -07:00
Tom Henderson 3bbda53949 rescan bindings 2015-05-06 17:33:08 -07:00
Tom Henderson 5b0071da70 clear valgrind warnings for aggregation test 2015-05-06 14:23:50 -07:00
Sébastien Deronne b38935c93f Bug 2004 [wifi] - Wrong timeout calculation for 802.11n in WifiMac 2015-05-06 23:14:06 +02:00
Sébastien Deronne e04641af04 update RELEASE_NOTES 2015-05-06 22:07:40 +02:00
Sébastien Deronne 6976fb3247 rescan bindings 2015-05-06 22:06:26 +02:00
Sébastien Deronne a195154331 Bug 2097 [wifi] - ACKs should be sent using legacy rates and preambles in 802.11n 2015-05-06 21:59:49 +02:00
Sébastien Deronne 5a7d7b1684 fix warning about decimal constant 2015-05-06 15:12:29 +02:00
Tom Henderson 92d33e8c9e rescan bindings 2015-05-05 21:29:58 -07:00
Tom Henderson 295d85e52f fix Doxygen copy/paste error (reported by whimsyduke) 2015-05-05 19:55:13 -07:00
Tom Henderson 1d91a535e0 SetGroupName for uan module 2015-05-05 19:48:25 -07:00
Tom Henderson da6dbe6141 SetGroupName for tap-bridge module 2015-05-05 19:36:20 -07:00
Tom Henderson 94d1b71324 SetGroupName for stats module 2015-05-05 19:35:31 -07:00
Tom Henderson c292a5853c SetGroupName for openflow module 2015-05-05 19:15:46 -07:00
Tom Henderson b1a22bb343 SetGroupName for olsr module 2015-05-05 19:14:17 -07:00
Tom Henderson 0970b68bc9 SetGroupName for mpi module 2015-05-05 19:10:44 -07:00
Tom Henderson 00676af822 SetGroupName for nix-vector-routing module 2015-05-05 19:10:27 -07:00
Tom Henderson d9af1797dc SetGroupName for mesh module 2015-05-05 19:07:17 -07:00
Tom Henderson 3720eeeef9 SetGroupName for dsr module 2015-05-05 18:42:46 -07:00
Tom Henderson 27d57e4107 SetGroupName for fd-net-device module 2015-05-05 18:42:31 -07:00
Tom Henderson 35f4f02b9d SetGroupName for dsdv module 2015-05-05 15:41:55 -07:00
Tommaso Pecorella d06cf0a82e Bug 2110 - vanet-routing-compare with no routing still sending RREQ 2015-05-05 10:24:48 +02:00
Tom Henderson f2a7e5c36c add documentation link 2015-05-05 15:20:57 -07:00
Tom Henderson 3b2d0fa8ec update traces 2015-05-05 15:19:03 -07:00
Christopher Hepner e31acccefc make 802.11s model more compliant to the IEEE802.11s-2012 standard 2015-05-05 15:10:55 -07:00
Tom Henderson 964748e197 rescan internet bindings 2015-05-05 13:58:03 -07:00
Tom Henderson 8f0c89ea5f postfix commit 11358:9a04bd20a224 and add test case (was raising error: default initialization of an object of const type on some systems) 2015-05-05 13:27:01 -07:00
Tom Henderson 46584b732f rescan bindings 2015-05-04 23:25:28 -07:00
Tom Henderson 2e4b36c82e bug 2058: TCP window update can shrink the Left Edge of the window which is a bug (patch based on earlier contribution from Evgeny Evstropov) 2015-05-04 22:39:00 -07:00
Tom Henderson db17672017 restore declarations to fix the build 2015-05-04 22:31:24 -07:00
Tom Henderson bfacdf5413 fix warning about signed/unsigned comparison 2015-05-04 22:30:02 -07:00
Tommaso Pecorella 90784f5eef Bug 2067 - TCP performances drop when Advertised Window is larger than Sender Buffer size 2015-05-04 12:32:47 -07:00
Matthieu Coudron 02d5a5ef6b Adds a function to convert TCP flags into a string 2015-05-04 12:31:32 -07:00
Peter D. Barnes, Jr. b34e8c4a0c Doxygen config, deprecated, realtime, unused 2015-05-04 17:57:59 -07:00
Peter D. Barnes, Jr. 0f2f1a7055 Doxygen files. 2015-05-04 17:55:16 -07:00
Sébastien Deronne 5ce6f9786a add example to reproduce a hidden nodes scenario in 802.11n networks with A-MPDU enabled 2015-05-05 00:42:26 +02:00
Sébastien Deronne 4d899db6d2 Update wifi documentation for two-level aggregation 2015-05-05 00:32:07 +02:00
Sébastien Deronne d0ec938b42 Bug 2075 [wifi] - A-MPDU using RTS/CTS behaves wrongly when MaxSsrc is reached 2015-05-05 00:29:40 +02:00
Sébastien Deronne 60b507ccdf add two-level aggregation 2015-05-04 23:55:32 +02:00
Sébastien Deronne 21bdddfaf0 update traces for bug 2066 fix 2015-05-03 17:34:44 +02:00
Sébastien Deronne 6359554d59 Update RELEASE_NOTES 2015-05-03 16:20:01 +02:00
Sébastien Deronne 2cdc197553 rescan bindings 2015-05-03 16:16:03 +02:00
Sébastien Deronne 9656e972a2 Bug 2066 [wifi] - A-MPDU reception should check for successful preamble 2015-05-03 16:06:01 +02:00
Tommaso Pecorella 3da098f018 Update RELEASE_NOTES 2015-05-02 22:21:58 +02:00
Tommaso Pecorella 4e5366f09f Bug 2008 - [lr-wpan] crash if ending rx while status change is in progress 2015-05-02 22:17:35 +02:00
Tommaso Pecorella ed20015f6d Bug 2034 - [lr-wpan] CSMA-CA BackoffPeriod is too short 2015-05-02 22:00:28 +02:00
Esteban Municio 656edfa6d0 Bug 2095 - [wimax] Wrong values in default-traces.h for 16 QAM 3/4 2015-05-02 21:51:06 +02:00
Tommaso Pecorella 6a865108ab [sphinx] Propagation module improvements 2015-05-02 20:55:49 +02:00
Tommaso Pecorella 44ecc463dc update testing section in manual 2015-05-01 06:49:12 -07:00
Cristiano Tapparello c044954bb4 Added the LiIonEnergySource helper and RV Battery model bug fixes (Bug 1216) 2015-04-30 18:02:42 -04:00
Nicola Baldo bf5ba0c085 get rid of LteTestSinrChunkProcessor 2015-04-27 13:27:02 +02:00
Nicola Baldo 3349e79085 fix compiler error on gcc-4.4 2015-04-24 16:53:51 +02:00
Nicola Baldo 65d00d330b fixed node id logging in LTE 2015-04-23 13:33:58 +02:00
Tommaso Pecorella e0165db56c Bug 2103 - Ipv[4,6]RoutingHelper::PrintRoutingTableAll[At,Every] hangs if a node doesn't have IP 2015-04-19 21:39:32 +02:00
John Abraham dda924a53a NetAnim: move AnimRxInfo into AnimPacketInfo, obsolete lbRx for broadcast 2015-04-18 09:20:09 -07:00
Tom Henderson ba148aad49 bug 2100: avoid use of uint type 2015-04-18 08:29:05 -07:00
Tom Henderson f195c26440 avoid compiler warning of assuming signed overflow does not occur when reducing constant in comparison 2015-04-18 08:15:59 -07:00
Sébastien Deronne db4eb7bbf2 rescan bindings 2015-04-17 19:59:28 +02:00
Ghada Badawy f0395aeec0 remove unused payloadMode argument in WifiPhy::GetPlcpHtSigHeaderDuration 2015-04-17 19:58:53 +02:00
Tom Henderson c28ea66957 SetGroupName for virtual-net-device module 2015-04-16 21:30:18 -07:00
Tom Henderson 16a35c6e49 SetGroupName for wave module 2015-04-16 21:29:05 -07:00
Tom Henderson e10195a6ec SetGroupName for TvSpectrumTransmitter 2015-04-16 21:10:21 -07:00
Tom Henderson 7e773082ae SetGroupName for config-store module 2015-04-16 21:02:03 -07:00
Tom Henderson 15b8c704a9 SetGroupName for click module 2015-04-16 20:58:18 -07:00
Tom Henderson 240f1f7891 SetGroupName for buildings module 2015-04-16 10:05:09 -07:00
Nicola Baldo 0cccb3d7ac updated RELEASE_NOTES 2015-04-16 18:07:23 +02:00
Nicola Baldo 2c1627a2f1 kill dead code 2015-04-16 18:06:31 +02:00
Nicola Baldo 95eb0e7adf merge 2015-04-16 17:49:29 +02:00
Nicola Baldo e3e8613a07 merge 2015-04-16 12:54:24 +02:00
Nicola Baldo 9fcf2037b0 fixed some RLC tests that were crashing 2015-04-14 16:02:03 +02:00
Nicola Baldo 1df9c273b8 specialized lte-rlc-am-e2e test cases into bulk and continuous SDU arrival 2015-04-14 12:05:09 +02:00
Benjamin Cizdziel a4b5738b44 remove ChannelNumber attribute from TvSpectrumTransmitter 2015-04-13 14:21:27 -07:00
Benjamin Cizdziel 5b023387a4 add missing figures 2015-04-13 13:19:33 -07:00
Tom Henderson 3cadd60395 fix documentation formatting errors 2015-04-13 13:19:01 -07:00
Nicola Baldo a352d731a2 fixed SequenceNumber10 modulo operations for operator++ 2015-04-13 14:40:23 +02:00
Nicola Baldo 1714d7a450 revised lte-rlc-am-e2e test 2015-04-13 14:39:12 +02:00
Nicola Baldo e1931bbd3a fixed logging context in LteTest entities 2015-04-13 14:38:23 +02:00
Nicola Baldo 0e06d19022 LteRlcAm: fixed VT(s) handling, added attributes for timers 2015-04-13 14:37:25 +02:00
Tom Henderson 089ae3ba9e bug 2094: adjust floating point comparison epsilon based on inputs 2015-04-12 21:44:41 -07:00
Nicola Baldo ed8b9eedfa workaround for bug 2091 (modified version of Luciano's patch) 2015-04-10 12:53:52 +02:00
Tommaso Pecorella 36f51b8607 Bug 2093 - MultiModelSpectrumChannel::GetDevice only works for 0-th index 2015-04-09 22:01:13 +02:00
Tom Henderson 0596d0d97b fix an enum declaration 2015-04-09 08:16:05 -07:00
Tom Henderson c1b59f5fbc silence unused variable warning 2015-04-09 07:25:24 -07:00
Tom Henderson d861f430ad update RELEASE_NOTES, CHANGES.html, and AUTHORS 2015-04-08 21:34:49 -07:00
Tom Henderson c9f32caa50 update bindings 2015-04-08 20:16:57 -07:00
Benjamin Cizdziel 7e795e2891 TvSpectrumTransmitter classes to create television transmitter(s) that transmit PSD spectrums customized by attributes such as modulation type, power, antenna type, channel frequency, etc. 2015-04-08 19:45:39 -07:00
Benjamin Cizdziel 6c8d39f935 GeographicPositions class for coordinate conversion 2015-04-08 19:42:20 -07:00
Tommaso Pecorella 034b9777cd (rip-ng) Don't route a packet from/to a LinkLocal address 2015-04-08 18:18:49 +02:00
Tommaso Pecorella 6b3f645a55 Bug 2090 - (rip-ng) Routes may be added twice on interface activation 2015-04-08 18:14:28 +02:00
Tommaso Pecorella 79e72f03fa [aodv] Clean empty sections from manual 2015-04-06 12:12:29 +02:00
Tom Henderson 4ae98b0b1e Fix use of WafError in exceptions in waf-tools/boost.py 2015-04-05 14:35:43 +02:00
Mohit Goyal 278855b4c1 SetGroupName for wimax module 2015-04-04 08:22:44 -07:00
Rubén Martínez 2c53e2289a bug 2082: Empirical RV fails if the value provided in the CDF member function is negative 2015-04-03 16:36:13 -07:00
Tom Henderson 8613522840 bug 2087: Waf fails to build ns-3 if the path contains accented characters 2015-04-03 15:13:32 -07:00
Vedran Miletić d4e9a7968e Print correct output directory 2015-04-03 22:19:21 +02:00
Vedran Miletić 203a80dd73 Handle broken versions of Clang better
Clang packages in Debian are sometimes broken. In that case, compiler fails
with "fatal error: 'bits/c++config.h' file not found". We should detect that
better. This patch updates boost.py to latest waf version which works, and also
handles empty apsican variable.
2015-04-03 22:18:44 +02:00
Mohit Goyal 5b1e6bd728 SetGroupName for lte module 2015-04-03 13:01:08 -07:00
Tom Henderson 9cb3e2b28c rescan bindings 2015-04-03 12:28:40 -07:00
Nicola Baldo 651ef94645 refactoring of the LteSpectrumPhy state machine 2015-04-01 19:10:20 +02:00
Nicola Baldo 76c94fb285 kill some dead code 2015-04-01 16:50:16 +02:00
Nicola Baldo 3ea8979c01 removed LteSpectrumPhy's LtePhyRxDataEndErrorCallback 2015-04-01 15:47:34 +02:00
Nicola Baldo f2705e06cf split LteSpectrumPhy::EndTx event into Data, DlCtrl, UlSrs 2015-04-01 15:38:12 +02:00
Tommaso Pecorella 15e79488cd SetGroupName for propagation module 2015-03-29 16:53:11 +02:00
Tommaso Pecorella d6975fd00e SetGroupName for netanim module 2015-03-29 16:48:39 +02:00
Tommaso Pecorella adb81dc26d SetGroupName for visualizer module 2015-03-29 16:46:05 +02:00
Tommaso Pecorella 4096553768 SetGroupName for lr-wpan module 2015-03-29 16:43:22 +02:00
Tommaso Pecorella b2b25df074 SetGroupName for spectrum module 2015-03-29 16:22:52 +02:00
Tommaso Pecorella c00c55f933 SetGroupName for mobility module 2015-03-29 16:23:12 +02:00
Tommaso Pecorella c4765573f9 SetGroupName for energy module 2015-03-29 16:12:50 +02:00
Tommaso Pecorella 9377247c1f SetGroupName for csma module 2015-03-29 16:08:40 +02:00
Tommaso Pecorella d503c92234 SetGroupName for flow-monitor module 2015-03-29 11:30:06 +02:00
Tommaso Pecorella cce8378466 SetGroupName for internet module 2015-03-29 11:14:34 +02:00
Tommaso Pecorella 5a78f132f2 SetGroupName for sixlowpan module 2015-03-27 22:24:25 +01:00
Tommaso Pecorella 7890ab6c2f SetGroupName for topology-read module 2015-03-27 22:13:56 +01:00
Tom Henderson a1b74e3271 update traces for bug 1982 fix 2015-03-27 13:24:29 -07:00
Tom Henderson 9984e96d5a update RELEASE_NOTES 2015-03-27 12:45:33 -07:00
Tom Henderson aed74121a3 fix some additional random variable stream values for an AODV test 2015-03-26 10:26:14 -07:00
Tom Henderson d99dc82675 defer random variable usage until test run time 2015-03-19 20:13:06 -07:00
Tom Henderson f58bbe717c avoid creating test random variable until run time 2015-03-19 20:11:26 -07:00
Tom Henderson 8b5ec4b5ec bug 1982: mesh uses random variables before seeds can be set 2015-03-19 20:04:25 -07:00
Tom Henderson 47fe0d4747 bug 1982: AODV uses random variables before seeds can be set 2015-03-19 20:03:57 -07:00
Tom Henderson 368e8fcbf6 update manual for SetGroupName 2015-03-27 11:58:58 -07:00
Tom Henderson 44d377e425 additional coverage of group name usage in the tutorial 2015-03-27 11:52:48 -07:00
Tom Henderson 1d86e7edca SetGroupName for point-to-point module 2015-03-27 11:52:25 -07:00
Tom Henderson 6641331242 SetGroupName for core module 2015-03-27 11:40:08 -07:00
Tom Henderson 3eebe47911 SetGroupName for wifi module 2015-03-27 11:28:59 -07:00
Tom Henderson 447e418d6c update tutorial documentation for SetGroupName 2015-03-27 10:03:43 -07:00
Mohit Goyal 4772204a59 SetGroupName for antenna module 2015-03-27 09:14:34 -07:00
Mohit Goyal 7639d04f17 SetGroupName for bridge module 2015-03-27 09:12:25 -07:00
Mohit Goyal b7142a8384 SetGroupName for aodv module 2015-03-27 08:19:31 -07:00
Mohit Goyal c68cfb15ed SetGroupName for applications module 2015-03-27 07:17:37 -07:00
Tom Henderson d8494dfb97 add missing namespace qualifier 2015-03-27 07:12:37 -07:00
Mohit Goyal 811962d3e0 SetGroupName for network module 2015-03-27 07:03:58 -07:00
Tommaso Pecorella a25dbffd6f Bug 2083 - BridgeNetDevice may send corrupted packets 2015-03-25 16:55:18 +01:00
Sébastien Deronne 61c6d8227f Update RELEASE-NOTES 2015-03-19 21:13:16 +01:00
Sébastien Deronne 08e3414452 Bug 2079: mcs variable in ht-wifi-network example is confusing 2015-03-19 21:07:13 +01:00
Alina Quereilhac 70af4a402c remove redundant GetObject from tap-fd-net-device-helper.cc 2015-03-19 15:20:46 +01:00
Alina Quereilhac 47fdaa9927 add example fd2fd-onoff.cc from the fd-net-device module to unit tests using UDP as default mode 2015-03-19 15:13:07 +01:00
Tommaso Pecorella 78758da486 Bug 2025 - (lr-wpan) Changing the channel doesn't affect the Tx params 2015-03-15 09:14:50 +01:00
Tommaso Pecorella d2b290924d Bug 2076 - TCP MinRTO Attribute is not actually used 2015-03-15 08:41:59 +01:00
Tommaso Pecorella b04062ce08 Bug 2077 - Icmpv6L4Protocol::HandleDestinationUnreachable must check the packet size, not its serialized size 2015-03-14 18:45:02 +01:00
Vedran Miletić 7967235960 Fix building with clang 3.5 (abs->std::abs, unused vars) 2015-03-11 16:50:35 +01:00
Vedran Miletić 3edd12c191 Fix building with GCC 5 and subsequently clean up sgi-hashmap.h 2015-03-05 15:50:18 +01:00
Natale Patriciello b27422fb2f Bug 2070 - Wrong report of Packets and Bytes stored in CoDeL 2015-03-01 12:08:36 +01:00
Tommaso Pecorella 0630f6dee9 Bug 1974 - CalculateTxTime should return a Time, not a double 2015-02-28 18:20:46 +01:00
Tommaso Pecorella 17e5e203b3 Bug 2073 - NDisc cache entries update timer might be stuck in a loop 2015-02-28 15:16:47 +01:00
John Abraham ac61b6229a [Bug 2065] New: Segfault on probable user error 2015-02-27 07:48:34 -08:00
Tom Henderson 2eb6010bb0 clean up wimax module test program includes and wscript 2015-02-25 06:47:21 -08:00
Tom Henderson 2aa44ad287 enable logging in a TCP test suite 2015-02-24 14:04:15 -08:00
Tom Henderson 55a43bb5bc fix tutorial typos (found by Renan) 2015-02-23 12:31:31 -08:00
Tom Henderson 0e1d8c6f17 add comments and logging around changeset c97ef876d98c 2015-02-23 12:25:34 -08:00
Alina Quereilhac 03154fb21f bug 2063: FdNetDevice::SendFrom() Assert does not take into account the size of the headers. (fix due Rubén Martínez and Tom Henderson) 2015-02-17 03:38:14 +01:00
John Abraham 107b274009 Restore link properties for Ipv4 address and mac address 2015-02-06 18:14:38 -08:00
Tom Henderson f1336f4f21 fix typos (found by Keith Briggs) 2015-02-06 06:50:48 -08:00
Tom Henderson ea8ccecfde update RELEASE_NOTES and CHANGES.html for post-ns-3.22 2015-02-05 16:39:39 -08:00
Tom Henderson 845511f9ae Added tag ns-3.22 for changeset 103f62fc7d58 2015-02-05 15:04:55 -08:00
Tom Henderson 77423c2a20 small edits on previous commit 2015-02-05 13:02:44 -08:00
Tom Henderson 2b005b32ca tutorial updates for ns-3.22 2015-02-05 11:54:48 -08:00
Tom Henderson 0be6196946 update RELEASE_NOTES and CHANGES.html 2015-02-03 16:27:01 -08:00
Peter D. Barnes, Jr. a7af33f1fb Add nix-vector lazy flush to RELEASE_NOTES and CHANGES.html 2015-02-03 14:36:43 -08:00
Peter D. Barnes, Jr. a3a68eeb55 Additions to RELEASE_NOTES 2015-02-03 13:48:07 -08:00
Tom Henderson d6e9171e07 updates to RELEASE_NOTES and CHANGES.html 2015-02-02 21:06:56 -08:00
Tom Henderson c0fc91bce1 update AUTHORS 2015-02-02 16:18:19 -08:00
Tom Henderson 9bddf4b972 rescan bindings 2015-02-01 22:21:11 -08:00
Tom Henderson e75db59186 rescan lr-wpan bindings 2015-02-01 21:39:21 -08:00
Tommaso Pecorella a90b921903 bug 1774: compute signal power around channel, not across whole band 2015-02-01 21:08:32 -08:00
Tommaso Pecorella a25be3e3d5 bug 1774: fix LrWpanHelper to enable MultiModelSpectrumChannel and add a default PropagationDelayModel 2015-02-01 21:01:25 -08:00
Tom Henderson 47789200d4 specify unsigned integer literal (fix compiler warning) 2015-02-01 08:17:09 -08:00
Tommaso Pecorella bce2be09a8 bug 1734: TcpSocketBase produces spurious delayed ACKs (fix due to Lawrence Stewart) 2015-02-01 07:13:56 -08:00
Sébastien Deronne 20fa8f04a3 fix Doxygen typos 2015-02-01 07:10:20 -08:00
Matias Richart c4d93c7490 hook PARF and APARF wifi examples to test.py 2015-02-01 07:09:35 -08:00
Sébastien Deronne fc96da1266 wifi example to demonstrate how to set non-standard timing attributes 2015-01-31 17:42:11 -08:00
Sébastien Deronne 7cf8a0b73a split wifi example simple-wifi-frame-aggregation.cc into two examples, one for MSDU aggregation and one for MPDU aggregation 2015-01-31 17:41:12 -08:00
Sébastien Deronne cc86ee0dac improve ht-wifi-network example 2015-01-31 17:36:14 -08:00
Sébastien Deronne ad6c64aec9 correct a minor bug when A-MPDU is used at legacy rates; code cleanup 2015-01-31 17:30:30 -08:00
Tommaso Pecorella 68c826b445 Bug 2055 - TxBuffer and RxBuffer traces don't work 2015-01-31 15:45:36 -08:00
Tommaso Pecorella f91739ec9a fix Doxygen typo 2015-01-31 15:42:19 -08:00
Steve Zabele 4ea974bb7f Bug 2053 - In tcp-socket-base.cc, NotifyDataSent incorrectly called with retransmits 2015-01-31 13:20:37 +01:00
Tom Henderson ffa4909b25 bug 2044: Buffer::Iterator::ReadNtohU16() and ReadNtohU32() not implemented correctly 2015-01-30 16:27:50 -08:00
Tom Henderson 2be7d2e686 Doxygen corrections for class Buffer 2015-01-30 16:06:55 -08:00
Tommaso Pecorella 2ab35569ae Bug 1405 - RttEstimator improvements 2015-01-30 22:29:30 +01:00
Sébastien Deronne 7b3b202b10 bug 2046: set Block Ack timeout when SetStandard is called 2015-01-30 11:52:16 -08:00
Tom Henderson e42b3baae0 fix possibly uninitialized variable warning 2015-01-30 11:34:38 -08:00
Steve Smith 26fda68e9c Null performance enhancement 2015-01-30 15:04:08 -05:00
Tommaso Pecorella 5cd540a9f8 Update RELEASE-NOTES 2015-01-30 08:12:06 +01:00
Peter D. Barnes, Jr. 576769caf1 bug 2043: print-introspected-doxygen crashes when some modules are disabled 2015-01-29 19:03:22 -08:00
Sébastien Deronne 641362c6b5 bug 1801: Setting Wi-Fi timing parameters through WifiMac attributes (documentation fix) 2015-01-29 19:01:38 -08:00
Peter D. Barnes, Jr. 60e7012077 bug 2002: Hardcoded include paths cause breakage 2015-01-29 19:00:01 -08:00
Tom Henderson 73f5b282c8 fix memcmp return type; print offending test case upon failure 2015-01-29 17:18:51 -08:00
Tom Henderson abda6e30dd fix small typo 2015-01-29 17:05:48 -08:00
Peter D. Barnes, Jr. 80c0d68e5d include the core module declared in doc/modules 2015-01-29 15:07:07 -08:00
Nicola Baldo 0ff09f4b1f updated RELEASE_NOTES 2015-01-29 16:37:08 +01:00
Nicola Baldo 1306851023 fixed Bug 2049 - CQI feedback should always use the same calculation method 2015-01-29 16:35:33 +01:00
Nicola Baldo 6e96735487 fixed Bug 2042 - src/lte/model/a3-rsrp-handover-algorithm.cc:137:79: error: overflow in implicit constant conversion 2015-01-29 11:36:56 +01:00
Tommaso Pecorella 99e1e3a121 [Clang] Remove unused variable 2015-01-28 22:57:30 +01:00
Tom Henderson eb0275013f rescan wifi bindings 2015-01-28 10:29:28 -08:00
Ghada Badawy 3eaf58a12b add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis) 2015-01-28 10:11:32 -08:00
Tom Henderson aa848ad33a rescan lte bindings 2015-01-28 06:34:11 -08:00
Nicola Baldo 1a4da81c69 merge 2015-01-28 12:18:20 +01:00
Tom Henderson b4707275ab fix -Werror=strict-overflow issue in example program 2015-01-27 21:52:50 -08:00
Tom Henderson ced1f9d8f9 convert ChannelCoordinationListener to a reference counted object to fix memory issues 2015-01-27 21:47:30 -08:00
Tommaso Pecorella 7a1e463097 Bug 2047 - Ipv6EndPointDemux::Lookup may crash 2015-01-27 21:53:05 +01:00
Tom Henderson 13b111e4b2 add missing module dependencies 2015-01-26 22:53:31 -08:00
Tom Henderson e6ca702ea6 rescan bindings 2015-01-26 17:14:36 -08:00
Tom Henderson e9f8133bc9 minor changes to enable Python bindings 2015-01-26 17:14:25 -08:00
Junling Bu f566c68220 IEEE 1609.4 MAC extension 2015-01-26 15:21:14 -08:00
Scott Carpenter 3e74003142 add BSM application and vanet-routing-compare example 2015-01-26 15:20:09 -08:00
Junling Bu a31a3245f2 patch to support IEEE 1609.4 MAC extension in wave module 2015-01-26 15:17:35 -08:00
Tommaso Pecorella d2379471c7 Bug 2037 - HT capabilities may print bogus chars 2015-01-26 23:21:27 +01:00
Tommaso Pecorella 176f9722ea Clarify radvd log output 2015-01-25 06:58:42 +01:00
Tommaso Pecorella 733c4ece17 TCP comparison example enhancements 2015-01-26 09:14:26 +01:00
Matias Richart 024fa2e09f add rate adaptation example to demonstrate Minstrel operation 2015-01-25 12:02:18 -08:00
Matias Richart d4d29990c8 bug 1726: avoid segmentation fault when logging; code cleanup 2015-01-25 12:01:21 -08:00
Matias Richart 7e4542f5c0 add PARF and APARF WiFi rate controls 2015-01-25 11:21:46 -08:00
Tommaso Pecorella f651927bc8 Simplify Radvd examples - remove unnecessary calls 2015-01-24 23:16:24 +01:00
Tommaso Pecorella 2099979b4e Bug 2045 - Missing NS_OBJECT_ENSURE_REGISTERED in TcpTxBuffer and TcpRxBuffer 2015-01-24 11:55:59 +01:00
Peter D. Barnes, Jr. ec924126b2 [Doxygen] Remove extraneous 'n' introduced by doxygen update in r11143 fd2cfa7dd551 2015-01-23 22:33:30 -08:00
Tom Henderson 6b1895ba57 enablePcap argument was disabled 2015-01-23 14:38:05 -08:00
Tom Henderson 7aaed33421 add timestamps and window scale options 2015-01-23 14:37:17 -08:00
Tom Henderson 3d3123d490 error check program input 2015-01-23 11:31:51 -08:00
Tom Henderson 7ab8bbe5db rng seed should be uint32_t 2015-01-23 11:26:16 -08:00
Tommaso Pecorella 3e8ccda80e Cleanup aodv test dependency on mesh module 2015-01-23 08:09:53 +01:00
Tom Henderson 3a4b604ea3 aodv test depends on mesh module 2015-01-22 07:06:29 -08:00
Peter D. Barnes, Jr. 6dac3ff450 [Doxygen] Update doxygen.conf to doxygen-1.8.9.1 2015-01-20 15:14:03 -08:00
Peter D. Barnes, Jr. a62f4ca624 [Doxygen] Protect ns-3 comments in doxygen.conf 2015-01-20 13:50:26 -08:00
Peter D. Barnes, Jr. 40eb448c95 [Doxygen] Remove extraneous docs for derivatives of AttributeValue. 2015-01-16 12:12:46 -08:00
Peter D. Barnes, Jr. 2e45a2ffd9 [Doxygen] Various in src/core 2015-01-16 11:55:23 -08:00
Luis Pacheco 32827de86a Bug 2038 - Stop method does not stop next wave in WaveformGenerator 2015-01-17 09:01:26 +01:00
Peter D. Barnes, Jr. 5a5407f654 Restore virtual function declarations. 2015-01-16 11:45:44 -08:00
Peter D. Barnes, Jr. 94ce1f5cd9 [Doxygen] Hash functions 2015-01-08 18:35:52 -08:00
Peter D. Barnes, Jr. 90cf5b60a2 [Doxygen] Files implementing attributes. 2015-01-07 15:43:53 -08:00
Peter D. Barnes, Jr. 26fde12a8c [Doxygen] Fatal and abort 2015-01-07 15:41:00 -08:00
gauravsathe 067e28d8bc addressed code review comments 2014-12-23 16:17:53 +05:30
Peter D. Barnes, Jr. f1f6465277 [Doxygen] Logging 2014-12-19 14:20:27 -08:00
Peter D. Barnes, Jr. 41c2e48906 [Doxygen] Singleton and SimulationSingleton 2014-12-19 13:28:03 -08:00
Peter D. Barnes, Jr. 2d51379aa9 [Doxygen] Callbacks 2014-12-19 13:07:07 -08:00
Peter D. Barnes, Jr. 7e2079057b [Doxygen] Various in src/core 2014-12-18 15:12:35 -08:00
Peter D. Barnes, Jr. 708bb9de05 doxygen.warnings.report.sh: add -i option to skip build, print-introspected-doxygen
Also

- Reorganize the usage message, since the options list has gotten
quite long.

- Standardize internal variables with underscores between words (very
un-ns-3 like, but really this whole thing should be in python in wscript).
2014-12-17 12:17:11 -08:00
Peter D. Barnes, Jr. c69d60dba5 [Doxygen] Tracing. 2014-12-10 16:30:51 -08:00
Tom Henderson f3c11d2676 do not delete ns-2 trace files when test data is retained 2015-01-15 10:04:13 -08:00
Tom Henderson 05ae5cd63b update RELEASE_NOTES 2015-01-14 14:20:43 -08:00
Tom Henderson 63c9018c81 bug 1770: mesh test and example crash for 32-bit optimized builds 2015-01-14 14:19:57 -08:00
Tom Henderson 4f10ff3ee6 fix tap-bridge module dependency 2015-01-08 18:16:55 -08:00
Tom Henderson f1a32c6a7c remove integer to double conversion leading to scheduling differences in optimized builds; remove dead code 2015-01-08 18:13:27 -08:00
Tommaso Pecorella 58af432dab [Tutorial] clarify that there is no mytest, and output an error if no test is to be run. 2015-01-06 16:51:29 +01:00
Tommaso Pecorella 911cb8512a [Tutorial] fix missing "s" from argument template 2015-01-05 19:43:49 +01:00
Tom Henderson 9ec51410d2 update RELEASE_NOTES 2015-01-04 10:17:20 -08:00
Tom Henderson 6e064c60de rescan wifi bindings 2015-01-04 10:13:44 -08:00
Sébastien Deronne c0090f77b3 remove unnecessary Time to double conversions in wifi models 2015-01-04 10:13:34 -08:00
Sébastien Deronne 03bb3c4a82 remove unused payload mode argument 2015-01-04 09:43:20 -08:00
Peter D. Barnes, Jr. 8de4b6ed1e [Doxygen] Clean up references to non-POD TracedValueCallbacks 2014-12-12 14:48:13 -08:00
Tom Henderson 8198c25bf0 fix URL 2014-12-20 20:34:36 -08:00
Tom Henderson 7ea01038c3 bug 2030: provide default values for WifiTxVector 2014-12-19 18:28:40 -08:00
Tom Henderson e1108928f1 rescan bindings 2014-12-19 16:22:49 -08:00
Nicola Baldo 6d8611cb32 updated RELEASE_NOTES 2014-12-19 17:10:25 +01:00
Nicola Baldo 6609007746 fixed Bug 1996 - RSRQ calculation: misleading variable names 2014-12-19 16:49:23 +01:00
Piotr Gawlowicz 95eae84b3f Bug 2029 - new CQI generation approach fix 2014-12-19 16:18:35 +01:00
Piotr Gawlowicz 433d2b3a70 Bug 1986 FIX 2014-12-19 16:16:27 +01:00
Nicola Baldo c3509f31ee LTE radio-link failure documentation fix 2014-12-19 11:41:18 +01:00
Vedran Miletić e5024de5b3 Fix compilation with GCC 4.2.1 on FreeBSD 9
Thanks to Domagoj Stolfa <shrinkd@gmail.com> for his aid in debugging this.
2014-12-18 18:44:14 +01:00
Vedran Miletić dba84a150e Fix building with Clang 3.5 2014-12-17 16:21:13 +01:00
Tom Henderson 2549938ad7 fix script problem with symbolic links 2014-12-16 12:45:04 -08:00
Piotr Gawlowicz a9e442320b figures redrawn 2014-12-16 12:43:23 -08:00
Tom Henderson 60e8768b83 Doxygen warnings for mobility/helper and mobility/model directories 2014-12-15 21:47:59 -08:00
Piotr Gawlowicz 16460c0a7b Doxygen warnings for lte/helper directory 2014-12-15 21:41:21 -08:00
Sébastien Deronne 9fef12b955 bug 1969: Support short guard interval durations in 802.11n 2014-12-12 11:58:51 -08:00
Sébastien Deronne ac56317859 bug 2027: Calculation of HT training symbol duration does not accurately follow 802.11n standard 2014-12-12 11:38:39 -08:00
Sébastien Deronne 18f8464a00 bug 2026: 802.11n Ness parameter badly set for data frames 2014-12-12 11:17:34 -08:00
Tom Henderson d74ec5df40 LTE documentation fix for disabling error models 2014-12-12 08:58:30 -08:00
Peter D. Barnes, Jr. f71a5e0b5c [Doxygen] Timer, TimerImpl and Watchdog. 2014-12-09 14:37:02 -08:00
Peter D. Barnes, Jr. 345c8a94ac [Doxygen] OS functions: filesystem, threading, wall clock. 2014-12-09 13:17:49 -08:00
Peter D. Barnes, Jr. 846fd6a6d9 [Doxygen] Objects 2014-12-07 22:08:04 -08:00
Peter D. Barnes, Jr. 2b7fafe698 [Doxygen] Events. 2014-12-07 20:53:37 -08:00
Peter D. Barnes, Jr. 63040fc74e [Doxygen] Smart pointers 2014-12-07 18:30:55 -08:00
Peter D. Barnes, Jr. a5c748e8ab [Doxygen] CommandLine 2014-12-07 18:27:56 -08:00
Nicola Baldo ec697908bb merge 2014-11-28 17:10:09 +01:00
Nicola Baldo ef6bffdb7c merge 2014-11-28 16:56:26 +01:00
Gaurav Sathe 07a422bf86 added release bearer functionality 2014-11-27 16:01:05 +01:00
Tom Henderson 9878843ed3 update tutorial section on bake environment variables 2014-11-26 16:03:44 -08:00
Ben Newton 3f609f8e31 correct a Doxygen returns comment 2014-11-26 15:15:34 -08:00
Sébastien Deronne 6930a5263f remove unused parameter from Doxygen 2014-11-26 15:11:52 -08:00
Ben Newton 3395e180e1 Bug 2013: pygccxml versions > 1.0.0 prepend a 'v' to version number 2014-11-26 14:59:32 -08:00
Tom Henderson f140db6a63 update Doxygen version required 2014-11-26 14:56:17 -08:00
Peter D. Barnes, Jr. a790246c4b [Doxygen] specialized data types 2014-11-17 15:51:36 -08:00
Peter D. Barnes, Jr. c1b266efad Standardize EventId arguments as id.
This facilitates reuse of doxygen docs.
2014-11-17 15:49:59 -08:00
Natale Patriciello 37ed3b545b ToString method to Packet 2014-11-14 15:27:37 -08:00
Tom Henderson d4f2adc449 add wscript support for wifi-sleep.cc example 2014-11-24 06:29:58 -08:00
Tom Henderson d6edb8dcbd record Doxygen aggregation info for additional classes 2014-11-20 13:42:09 -08:00
Tom Henderson 9489036c50 fix typo 2014-11-20 13:41:38 -08:00
Tom Henderson 3ca7f202b4 register energy container classes 2014-11-20 13:39:32 -08:00
Tom Henderson 8855ecbf5b bug 1583: fix ./waf configure --enable-gcov 2014-11-20 10:50:30 -08:00
Tom Henderson c961293eed WifiRemoteStation needs virtual destructor for subclassing 2014-11-20 09:39:23 -08:00
Sébastien Deronne 497cb5cd28 fix misspelled attribute and doxygen in YansWifiPhy 2014-11-19 14:05:36 -08:00
Tom Henderson 5601229646 add logging to WifiRemoteStationManager 2014-11-19 13:22:52 -08:00
Nuno Cardoso 92fc236e1c Bug 2021: Missing const qualifier in TopologyReader::Link::Attributes{Begin,End}() 2014-11-19 00:38:17 +01:00
Tommaso Pecorella 8434fca41f Bug 2016 - Radvd do not consider the SendAdvert option and don't reply to RS 2014-11-19 00:13:58 +01:00
Tommaso Pecorella 891e8de991 Remove spurious cout logs from Icmpv6L4Protocol 2014-11-13 23:34:10 +01:00
Peter D. Barnes, Jr. cd94f509c3 [Sphinx] Minor corrections, fix errors in energy.rst 2014-11-12 12:08:53 -08:00
Peter D. Barnes, Jr. 8de030d7fb New TracedCallback function signatures. 2014-12-04 22:33:11 -08:00
Peter D. Barnes, Jr. d32f30ed8a [Sphinx] Update the Tracing chapter in the Tutorial. 2014-12-04 10:03:07 -08:00
Peter D. Barnes, Jr. dc2307c5ae Deprecate AddTraceSource without callback signature. 2014-12-04 10:02:36 -08:00
Peter D. Barnes, Jr. 692bf472e6 TracedCallback function signatures, the rest. 2014-12-04 10:02:01 -08:00
Tom Henderson 2babf9f21e rescan wifi bindings 2014-11-12 10:40:02 -08:00
Daniel Lertpratchya 7f08ea7bb0 bug 1726: minstrel rate manager doesn't save state (patch contributions also due to Jonathan Ling and Matías Richart) 2014-11-12 10:28:29 -08:00
Tom Henderson c0ab716d67 fix brite wscript, which broke due to waf-1.7.16 upgrade 2014-11-10 12:27:57 -08:00
Ben Newton 28da60a47c bug 1995: avoid multiple definitions of PI 2014-11-07 15:00:14 -08:00
Tom Henderson 9f00ef58da remove unnecessary include 2014-11-07 11:52:19 -08:00
Tom Henderson 8baac9e338 add comment about history of ns3/math.h 2014-11-07 11:51:49 -08:00
Sébastien Deronne fea8fe1b78 bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices 2014-11-07 09:24:11 -08:00
Tom Henderson 48b150cbf3 some additional TcpNewReno logging details 2014-11-04 16:29:22 -08:00
Tom Henderson 42879179bd update tutorial sixth.cc program output 2014-11-04 16:26:52 -08:00
Tom Henderson 048d77d474 update tutorial fifth.cc program output 2014-11-04 16:22:42 -08:00
Tom Henderson 6e5e36c1c2 update tutorial third.cc program output 2014-11-04 11:46:16 -08:00
Tom Henderson e4d8f11e55 update tutorial second.cc program output 2014-11-04 11:36:43 -08:00
Tom Henderson f2f1683a60 add coverage of ./waf install to tutorial 2014-11-04 10:54:48 -08:00
Tom Henderson 2491fc7833 bug 1326: document the -- operator to build.py 2014-11-04 09:30:54 -08:00
Peter D. Barnes, Jr. 1e1a1edbdc [Doxygen] various in src/core 2014-11-03 12:40:24 -08:00
Peter D. Barnes, Jr. ee641c723b [Doxygen] Remove inappropriate uses of @internal 2014-11-03 12:33:13 -08:00
Pedro Silva c9cdd11ceb bug 1791: improve TCP endpoint deallocation code 2014-10-31 13:36:46 -07:00
Tom Henderson c568af328f update CHANGES.html and RELEASE_NOTES 2014-10-29 18:16:16 -07:00
Tom Henderson 96be4f282b rescan wifi bindings 2014-10-29 17:21:55 -07:00
Sébastien Deronne e013980b83 bug 1971: 802.11n at 2.4 GHz should include a signal extension duration 2014-10-29 13:46:45 -07:00
Pedro Silva 8fa5f0e741 bug 1791: TCP Endpoint never deallocates when closing 2014-10-29 10:12:53 -07:00
Tom Henderson 57bba404ab regenerate selected pcap traces due to change in default propagation speed in ConstantSpeedPropagationDelayModel (bug 2011) 2014-10-29 07:30:29 -07:00
Nicola Baldo fe56ee1741 fixed Bug 2011 - speed of light constant 2014-10-28 11:48:13 +01:00
Tom Henderson 033973ca72 upgrade waf to waf-1.7.16 2014-10-22 10:04:58 -07:00
Peter D. Barnes, Jr. cccfc167dd [Doxygen] Attribute implementations. 2014-10-21 16:14:35 -07:00
Peter D. Barnes, Jr. 9d326c107d [Doxygen] Attribute implementation. 2014-10-21 12:21:13 -07:00
Peter D. Barnes, Jr. 8903ab265e Streamline progress and error reporting, show full log on errors. 2014-10-17 12:50:15 -07:00
Sébastien Deronne cf5b6ec37f bug 1970: Missing NotifyAckTimeoutStartNow in MacLow::StartDataTxTimers 2014-10-16 13:26:10 -07:00
Sébastien Deronne e4848b2055 bug 1968: missing supported 802.11n HT rates in the WifiPhy contructor 2014-10-16 12:29:17 -07:00
Peter D. Barnes, Jr. 81f6d0c1c9 Sort and pretty-print result lists of SKIPped, FAILed, CRASHed and VALGR tests from ./test.py 2014-10-15 11:29:30 -07:00
Tom Henderson 3ad3ffaa2d fix some pylint complaints about first.py 2014-10-15 07:38:06 -07:00
Tom Henderson c3c3d4e98f rescan stats bindings 2014-10-15 07:34:36 -07:00
Tom Henderson 203c408a67 add TimeProbe class to data collection framework 2014-10-15 07:06:11 -07:00
Tom Henderson 5b64122a3e bug 1997: fix PlotProbe() documentation and usage for GnuplotHelper and FileHelper 2014-10-15 07:00:24 -07:00
Tom Henderson 98b82e35a7 update CHANGES.html 2014-10-14 13:29:05 -07:00
Tom Henderson 0674674ad0 remove execute permissions on source files 2014-10-14 12:56:57 -07:00
Tom Henderson 31d2a3aad7 rescan bindings 2014-10-14 11:36:00 -07:00
Tom Henderson be2a37427c replace deprecated API 2014-10-14 11:21:47 -07:00
Tom Henderson 5d2310d3d8 removed unused includes 2014-10-14 10:02:08 -07:00
Tom Henderson 37bab66bfe remove deprecated Packet::PeekData() 2014-10-14 09:36:10 -07:00
Tom Henderson cd7311b76c remove deprecated code in internet module 2014-10-14 08:15:46 -07:00
Tom Henderson a532ec20b1 remove deprecated test methods 2014-10-14 07:37:10 -07:00
Tom Henderson c41ba4e79a rescan bindings 2014-10-13 21:25:21 -07:00
Tom Henderson 411020b4c9 update regression packet traces to account for random variable stream assignment changes 2014-10-13 16:12:13 -07:00
Tom Henderson 41b83c9851 remove deprecated RandomVariable class 2014-10-13 16:09:59 -07:00
Tom Henderson 52ba1be9f9 fix some additional sources of randomness in mesh tests 2014-10-13 15:45:32 -07:00
Tom Henderson 9f3b3bf4d2 improve some mesh module logging 2014-10-13 15:18:49 -07:00
Tom Henderson 244f1cc32d fix log component name 2014-10-13 13:36:11 -07:00
Tommaso Pecorella cee4e4ac5e Print RT/NC should be static functions 2014-10-12 16:03:16 +02:00
Tommaso Pecorella da653eed57 Bug 1957 - UdpSocketImpl is stuck after a Close() 2014-10-12 15:51:05 +02:00
Nicola Baldo f0a030b94b fixed typo in changeset 95cf4d40ee01 2014-10-09 17:39:14 +02:00
Nicola Baldo 455db9e086 fixed units in description of RandomWalk2dMobilityModel::Direction 2014-10-09 15:41:34 +02:00
Tommaso Pecorella 013d328e7d [PyBindings] rescan core module 2014-10-09 12:40:54 +02:00
Tommaso Pecorella b703ac7f27 Fix missing header 2014-10-09 12:40:49 +02:00
Peter D. Barnes, Jr. d767aaddd2 [Doxygen] Fix configuration errors; suppress mains. 2014-10-08 21:05:10 -07:00
Peter D. Barnes, Jr. dd7996b57d Set default TypeId size. 2014-10-08 21:04:32 -07:00
Peter D. Barnes, Jr. 3f92b8e1c5 [Doxygen] Remove more trivial and/or misused groupings 2014-10-08 20:59:31 -07:00
Peter D. Barnes, Jr. 6254c4b242 [Doxygen] Remove trivial and/or misused groupings 2014-10-08 20:58:33 -07:00
Peter D. Barnes, Jr. 2aebf37542 Sphinx] Reduce build chatter 2014-10-08 17:48:38 -07:00
Peter D. Barnes, Jr. 9e5633feff [Sphinx] fix error 2014-10-08 17:47:34 -07:00
Peter D. Barnes, Jr. 792c339edc [Doxygen] Include the size of registered types in the long description for the class. 2014-10-08 13:52:14 -07:00
Peter D. Barnes, Jr. 06777c4102 Missing NS_OBJECT_ENSURE_REGISTERED 2014-10-08 13:51:06 -07:00
Peter D. Barnes, Jr. bdad6336fe [Doxygen] Remove emu/examples 2014-10-08 12:02:05 -07:00
Tommaso Pecorella fcda743c44 [Doxygen] network module 2014-10-07 21:37:00 +02:00
Peter D. Barnes, Jr. 9346f805f2 Generate doxygen list of all LogComponents 2014-10-06 17:24:00 -07:00
Peter D. Barnes, Jr. b2dc58dcb9 Use StringValue instead of PointerValue (CreateObject... in AddAttribute calls 2014-10-06 17:22:59 -07:00
Peter D. Barnes, Jr. 6313928fbc [doxygen] print-introspected-doxygen.cc 2014-10-05 20:42:52 -07:00
Peter D. Barnes, Jr. a4d68196e7 Refactor print-introspected-doxygen.cc 2014-10-05 17:58:48 -07:00
Peter D. Barnes, Jr. 132655443b Patches to doxygen.warnings.report.sh:
Don't assume we're in a repo.
Only count unique warnings.
2014-10-03 16:01:49 -07:00
Peter D. Barnes, Jr. c10b5622a0 [Doxygen] Minor fix-ups 2014-10-08 11:59:31 -07:00
Tom Henderson d471d382ac rescan bindings 2014-10-07 12:19:52 -07:00
Tommaso Pecorella 899626019f [Doxygen] minor fixes 2014-10-03 23:51:58 +02:00
Tommaso Pecorella bd3ba18da4 [Doxygen] LTE Asn1Header 2014-10-06 22:36:50 -07:00
Tommaso Pecorella a49957015e [Doxygen] propagation module fixes 2014-10-03 22:41:44 +02:00
Tommaso Pecorella 4943ed3c70 [Doxygen] internet module fixes 2014-10-03 17:10:26 +02:00
Natale Patriciello d9b1ff4d71 Point-to-point documentation patch 2014-10-06 16:48:51 -07:00
Tom Henderson 1ba5df7bc3 add doxygen 2014-10-06 16:32:44 -07:00
Budiarto Herman 6603ec2fb3 LTE doxygen additions 2014-10-06 16:05:46 -07:00
Tiago Cerqueira cedd6d624b Doxygen for mobility module 2014-10-06 16:00:06 -07:00
Tom Henderson 0bb6e095b3 bug 1343 (documentation): emu-udp-echo-client/server.cc missing, but referenced in HOWTOs 2014-10-06 14:52:08 -07:00
Tom Henderson 94cd3d8542 remove deprecated emu module 2014-10-06 14:50:49 -07:00
Tom Henderson d00ccf814c add missing GPLs 2014-10-06 10:24:56 -07:00
Peter D. Barnes, Jr. 4cb9c7b916 TracedCallback function signatures, the simple ones.
These are TracedCallback function signatures for traces sources
using a single argument.
2014-10-03 02:24:42 -07:00
Tom Henderson 4cd32401ec clarify how to properly create random variable objects 2014-12-04 12:14:46 -08:00
Sébastien Deronne 0976e2d58a fix typos in wifi module 2014-12-03 14:47:28 -08:00
Nicola Baldo a47df0d6a3 clarified PRACH Config Index assumption in LTE docs 2014-12-04 12:49:50 +01:00
Nicola Baldo 4e9c93545f added LTE troubleshooting and debugging tips 2014-12-04 12:24:38 +01:00
Peter D. Barnes, Jr. 5b9e3507b7 [Bug 2022] Spurious characters in config paths
On Nov 24, 2014, at 12:48 PM, Tom Henderson <tomh@tomh.org> wrote:
> On 11/24/2014 12:39 PM, Peter Barnes wrote:
>> I see the '%' being use in two places, beginning at line 1156 in
>> StaticInformation::DoGather ()
>>
>> Mitch used the % to escape the class names so doxygen wouldn't
>> create links.  I'm not sure why the links are bad.  Is the config
>> path token with '::' sometimes not the same as a class name?
>> Then doxygen would be looking for a non-existent class and
>> complaining, so suppressing might be good.
>>
>> Looks like I might have added the surrounding '"' in r10977.
>> Could this be the problem?
>
> Not sure.  Let me know if you don't get to this before you
> disappear for a while, and I'll pick it up if so.

Removing the quotes fixes the problem.

Removing the '%' (and leaving the quotes) fixes the problem.
This is my preferred solution, since it's a reminder that
the config path is just a string.

So my recommendation is to remove the temporaryCharacter
formatting string completely.
2014-12-03 15:27:46 -08:00
Sébastien Deronne 8bdfaee6e9 bug 1758: Missing Yans and Nist error rate models for 5/6 code rate of 802.11n HT 2014-11-29 10:13:25 -08:00
Sébastien Deronne 81b4f79c43 bug 2020: Erroneous MCS field in 802.11n PCAP files 2014-11-29 09:57:24 -08:00
Peter D. Barnes, Jr. cc56e83767 TracedValue callback function signatures. 2014-10-02 21:17:48 -07:00
Peter D. Barnes, Jr. 24144c56f9 Implementation for documenting TracedValue and TracedCallback signatures. 2014-10-02 21:05:15 -07:00
Peter D. Barnes, Jr. 179361f956 Reflow tutorial page 2014-09-25 14:11:46 -07:00
Peter D. Barnes, Jr. fd0426c762 Replace erroneous "using namespace ns3" with namespace ns3. 2014-10-02 21:07:20 -07:00
Tom Henderson c9f4bc4e68 bug 1551 postfix: enable logging for functions outside namespace ns3 2014-10-01 20:50:46 -07:00
Gustavo Carneiro 504c41fa1b Pull new pybindgen version to fix the build, again. 2014-09-29 22:07:14 +01:00
Gustavo Carneiro 853105d4bd Use pybindgen revno 885 to pull container ref bug fix 2014-09-28 17:21:26 +01:00
Gustavo Carneiro 285124fa83 I meant to bump pybindgen version up, not down. Use latest PBG version. 2014-09-28 16:56:37 +01:00
Gustavo Carneiro a8b9cb97c2 Python: rescan bindings 2014-09-28 12:41:46 +01:00
Gustavo Carneiro d880a29e2d Python bindings: fix generation of callback wrappers with the newest pybindgen 2014-09-28 12:39:26 +01:00
Peter D. Barnes, Jr. bfdb6ef10a [Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace? 2014-09-26 15:51:00 -07:00
Peter D. Barnes, Jr. 3611bd11a5 [Bug 1551] NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace? 2014-09-26 12:44:13 -07:00
Peter D. Barnes, Jr. b489a74147 Verbose option to doxygen.warnings.report.sh: includes doxygen build chatter. 2014-09-26 12:25:13 -07:00
Tommaso Pecorella 5d52c03318 Bug 652 - no public API for IPv4 neighbor table - Print functions 2014-09-20 23:53:22 +02:00
Tommaso Pecorella 78985e5d68 Avoid forward declaration if not needed - silence Eclipse warning 2014-09-19 22:08:58 +02:00
Tommaso Pecorella 4231c89fee Example ht-wifi-network contains old random variable syntax 2014-09-19 22:07:09 +02:00
Tommaso Pecorella e6a48c0188 Bug 1983 - FlowMonitor returns containers copies instead of references 2014-09-19 21:25:48 +02:00
Tommaso Pecorella 234e84dc35 Bug 1991 - PcapFileWrapper::CaptureSize attribute (snaplen) has no effect. 2014-09-19 21:23:55 +02:00
Tom Henderson c0168538ae revert accidental commit of debugging code in changeset 55f1b7dc037e 2014-09-19 12:07:15 -07:00
Tom Henderson 29c216b93f update CHANGES.html for new release version 2014-09-19 12:01:58 -07:00
Tom Henderson aa9be76b3f update RELEASE_NOTES for new release version 2014-09-19 11:47:30 -07:00
Tom Henderson add76409e0 Added tag ns-3.21 for changeset fa4be182ef17 2014-09-17 18:52:01 -07:00
Tom Henderson c994aa10d8 rescan remaining bindings 2014-09-15 20:51:08 -07:00
Tom Henderson 47e3b01c82 silence uninitialized variable warning for unused member 2014-09-15 20:50:43 -07:00
Tom Henderson 55501d239e conditional include of fd-net-device for lte module 2014-09-15 20:49:38 -07:00
Peter D. Barnes, Jr. fdfece661a Bug 1972: documentation to clarify the behavior with repeated argument 2014-09-15 14:35:11 -07:00
Tom Henderson 9f77006419 remove outdated reference to statistics chapter 2014-09-15 13:01:31 -07:00
Tom Henderson 52567ff22b fix formatting for CoDel chapter 2014-09-15 13:00:23 -07:00
Tommaso Pecorella d01fcfd9ab update tutorial to describe Simulator::Stop 2014-09-15 11:29:15 -07:00
Tommaso Pecorella 9b1f7c5b4b Bug 1911 - AODV can not work on nodes with more than one NetDevice 2014-09-13 19:23:39 +02:00
Tom Henderson 4ea5aa6f01 update AUTHORS 2014-09-13 09:00:41 -07:00
Tom Henderson 8e781d4d16 update CHANGES.html 2014-09-13 08:50:02 -07:00
Tom Henderson 1bfd17915d update RELEASE_NOTES 2014-09-13 08:47:05 -07:00
Sébastien Deronne a39ea72650 update WiFi documentation 2014-09-12 20:48:46 -07:00
Tom Henderson 1d0b7ff106 temporarily disable two tests failing for OS X 2014-09-12 20:27:47 -07:00
Tom Henderson 9cfe687e4a prevent TcpHeader::Deserialize() from asserting; fix a few small bugs in option code 2014-09-12 18:29:47 -07:00
Tom Henderson 45b1b3daa1 silence compiler warning 2014-09-12 18:19:47 -07:00
Tom Henderson 4394d1d4ba clarify Header::Deserialize documentation 2014-09-12 17:49:06 -07:00
Alexander Afanasyev 5b1096a52a Bug 1673: Config::Set/Connect does not search for attributes in parent classes 2014-09-12 17:34:43 -07:00
Tom Henderson 161c703a1f test case for config path attribute search on parent classes (bug 1673) 2014-09-12 17:42:12 -07:00
Tom Henderson 6674f95bc1 equation formatting for latex 2014-09-12 14:07:32 -07:00
Tommaso Pecorella 066e14f83f Bug 1824 - aodv fixes 2014-09-12 22:51:20 +02:00
Tom Henderson 3d1daf7c5a chapter included multiple times in manual 2014-09-12 13:36:01 -07:00
Peter D. Barnes, Jr. 070e2da241 Bug 1964: GetInteger overflow 2014-09-12 13:03:06 -07:00
Tom Henderson 3048ebcced regression test for bug 1964 2014-09-12 12:55:00 -07:00
Tommaso Pecorella 077579b060 Bug 1824 - L4 protocol sockets should support BindToNetDevice over IPv6 2014-09-12 20:47:17 +02:00
Tom Henderson 2cafbd6dbd repair wscript 2014-09-12 10:18:55 -07:00
Tom Henderson e2f347c513 make openflow-switch peek transport headers based on IPv4 protocol number information 2014-09-11 21:51:29 -07:00
Tom Henderson 884ad61823 adjust ns3tcp-cwnd-test-suite response vector 2014-09-11 20:08:17 -07:00
Tom Henderson 3a872a1d8c update test vector for test ns3-tcp-interoperability 2014-09-11 17:43:37 -07:00
Tom Henderson cc9e4d787b improve printing of window scale option 2014-09-11 17:29:21 -07:00
Tom Henderson 80c9d1e629 update test vectors for test ns3-tcp-loss 2014-09-11 17:22:58 -07:00
Tom Henderson fb59f7982a update test vectors for test ns3-tcp-state 2014-09-11 15:29:42 -07:00
Tom Henderson bc68d4f0e0 new test vectors for devices-mesh-flame-regression 2014-09-11 14:56:06 -07:00
Tom Henderson 9133c72c96 update mesh flame tests to account for wifi random variables 2014-09-11 14:55:42 -07:00
Tom Henderson cbc91604dd new test vectors for devices-mesh-dot11s-regression 2014-09-11 14:20:28 -07:00
Tom Henderson fafad95f72 update mesh tests to account for wifi random variables 2014-09-11 14:06:19 -07:00
Tom Henderson f17bd8c546 Mesh Wifi uses also RegularWifiMac 2014-09-11 13:45:38 -07:00
Tommaso Pecorella 274fcc293a Update RELEASE_NOTES 2014-09-11 22:47:53 +02:00
Kristian A. Hiorth 8d4db65927 Bug 1981 - PyViz shell not compatible with ipython >= 0.11 2014-09-11 20:08:05 +01:00
Tom Henderson f627ad5df2 update regression traces for OLSR 2014-09-11 11:32:09 -07:00
Tom Henderson 9db13b8df4 fix the stream assignment of some additional random variables in OLSR test suite 2014-09-11 11:23:03 -07:00
Tom Henderson 87c3097be5 update AODV regression traces 2014-09-11 10:28:37 -07:00
Tom Henderson bb457316d4 rescan internet bindings 2014-09-10 21:07:04 -07:00
Tom Henderson d4901ad3b0 move unknown TCP option handling with the base class 2014-09-10 17:31:46 -07:00
Tom Henderson bf9893dbf3 add processing for unknown TCP options 2014-09-10 16:58:31 -07:00
Tom Henderson 15333eaf9a calculate send scale factor when sending the SYN-ACK instead of when reading the SYN options 2014-09-10 15:08:30 -07:00
Tom Henderson a80337baab add some logging 2014-09-10 15:06:10 -07:00
Tom Henderson 8443885e88 restore TCP option padding approach that avoids NOPs 2014-09-10 15:05:57 -07:00
Tom Henderson d559ff6c4c remove unsupported option types from enum 2014-09-09 16:15:49 -07:00
Nicola Baldo b38e12c90c cosmetic changes to lte-rlc-am-e2e test suite 2014-09-09 14:53:10 +02:00
Nicola Baldo dd89970f66 fixed RNG stream assignment in lte-rlc-am-e2e test suite 2014-09-09 13:55:35 +02:00
Nicola Baldo ddf4cc5bb2 removed unused member variables in LteRlcAm 2014-09-09 13:06:32 +02:00
Nicola Baldo 6681ddceb8 m_rxonBuffer[seqNumber.GetValue ()] => it->second 2014-09-09 12:12:34 +02:00
Tommaso Pecorella 0950f7f943 TcpOptions Deserialize should return zero if a deserialization error happens 2014-09-09 09:44:37 +02:00
Natale Patriciello b6d33fd296 TCP Options - Valgrind fixes 2014-09-10 19:09:06 +02:00
Daniel Lertpratchya 1857322c43 Bug 1858 - wireless examples not correctly recording packet reception - reported by Scott Carpenter <scarpen_at_ncsu.edu> 2014-09-10 08:27:26 +02:00
Tommaso Pecorella 208fdf2681 Update RELEASE_NOTE 2014-09-10 06:15:01 +02:00
Tommaso Pecorella 65d1ba667b rescan network bindings 2014-09-10 06:09:55 +02:00
Tommaso Pecorella ae9fbb2eaa rescan applications bindings 2014-09-10 05:58:38 +02:00
Tommaso Pecorella b489a41127 Bug 1811 - Basic traffic generator for network module 2014-09-10 06:09:45 +02:00
Tom Henderson 9d2770100d last TCP option should be END, not NOP 2014-09-06 09:40:18 -07:00
Tommaso Pecorella 287bda5b7e Move some tests from src/test to appropriate places 2014-09-06 07:09:08 +02:00
Tommaso Pecorella 98945439e1 Enhancements to SimpleNetDevice and SimpleChannel 2014-09-06 07:08:49 +02:00
Tommaso Pecorella 3ae1348425 Fix clang "errors" about uninitialized variables. 2014-09-06 06:57:27 +02:00
Tom Henderson a0fefe1074 rescan wifi bindings 2014-09-05 18:50:40 -07:00
Tom Henderson 5072f3a3c6 rescan energy bindings 2014-09-05 18:46:15 -07:00
Tom Henderson 68a33cd7ba rescan lte bindings 2014-09-05 18:19:30 -07:00
Tom Henderson f6fc901227 rescan internet bindings 2014-09-05 18:00:05 -07:00
Piotr Gawlowicz 74f0cf7073 GSoC 2014 FFR algorithms - figures 2014-09-05 01:46:10 +02:00
Piotr Gawlowicz a9ef49d196 GSoC 2014 FFR algorithms 2014-09-05 01:12:55 +02:00
Anh Nguyen a64d69ce19 documentation for CoDel queue 2014-09-04 12:33:50 -07:00
Anh Nguyen 07357e4048 examples for CoDel queue 2014-09-04 12:29:36 -07:00
Anh Nguyen 4c20e1b099 test suite for CoDel queue 2014-09-04 12:27:00 -07:00
Anh Nguyen 153479dac9 changes suggested in original code review, and aditional improvements made during 2014 GSoC project 2014-09-04 12:24:07 -07:00
Tom Henderson 16e4f9b004 move CoDel queue model to internet module 2014-09-04 12:18:19 -07:00
Alina Quereilhac e6fc8c2ad2 update fd-tap-ping.cc instructions 2014-06-15 08:54:48 -07:00
Tom Henderson 14ee3219ae update RELEASE_NOTES 2014-06-12 12:36:44 -07:00
Sascha Jopen 5a00199a04 bug 1924 - sensing radius and CCA 2014-06-12 12:35:32 -07:00
Tom Henderson eac8c0a104 update RELEASE_NOTES 2014-06-11 20:27:12 -07:00
Unknown b9b6bacc5f bug 1923: Patch for disabling active probe requests 2014-06-11 20:26:02 -07:00
Tom Henderson ba584e1ac1 update CHANGES.html 2014-06-06 12:43:03 -07:00
Tom Henderson 2a1014565d update release notes 2014-06-06 12:32:41 -07:00
Tom Henderson 620d770f3c add author 2014-06-06 12:01:56 -07:00
Tom Henderson 15a9d1bb55 rescan wifi bindings 2014-06-06 12:00:58 -07:00
Scott Carpenter 131381a91a bug 1922- GetSsid() should not be fatal 2014-06-06 10:49:03 -07:00
Tom Henderson 50cb988c49 bug 1920 - remove DSR attribute that was conflicting with config store 2014-06-06 10:47:21 -07:00
Scott Carpenter f80a00ba88 bug 1919 - Strip trailing semicolons from mobility trace files 2014-06-06 10:18:10 -07:00
Sébastien Deronne b5f51f5366 Bug 1907- Add IsMcsSupported() 2014-06-06 10:15:54 -07:00
Tom Henderson 243e8a0645 bug 1868: restrict the compiler version for Wstrict-overflow=5 until gcc-4.9 issues are addressed 2014-06-06 10:11:35 -07:00
Tom Henderson b6a990f767 describe bug 1770 issue and workaround 2014-06-06 10:10:51 -07:00
Tom Henderson 0c9e87a440 update CHANGES.html for release 2014-05-30 21:39:15 -07:00
Tom Henderson c9051e4101 update AUTHORS list 2014-05-30 21:38:48 -07:00
Tom Henderson c9c31cce11 update RELEASE_NOTES 2014-05-30 17:38:31 -07:00
Tom Henderson 70f3450c5e update bindings 2014-05-30 10:07:22 -07:00
Unknown b9c2b3087c bug 1913: avoid crash in BlockAckManager::GetNextPacket 2014-05-29 23:00:30 -07:00
Tom Henderson 0cc9e25227 update traces for bug 1912 fix 2014-05-29 22:52:23 -07:00
Unknown 17ef04d50b bug 1912: avoid multiple MacTxMiddle instances 2014-05-29 22:51:05 -07:00
Tommaso Pecorella d1171adee8 Clarify doxygen for [Tcp,Udp]Socket ForwardUp functions 2014-05-29 21:37:33 +02:00
Tom Henderson fe5b9e2242 bug 1868: enable -Wstrict-overflow only for newer gcc versions 2014-05-28 23:03:23 -07:00
Tom Henderson f5b4f0961e remove extra newline 2014-05-28 13:10:59 -07:00
Tom Henderson f32803f7b9 bug 1900: adjust an AODV test to provide consistent traces and avoid floating point differences 2014-05-28 13:00:15 -07:00
Dave Taht 6b05c585d1 Add Codel alogithm support
---
 src/network/utils/codel-queue.cc |  482 ++++++++++++++++++++++++++++++++++++++
 src/network/utils/codel-queue.h  |  130 ++++++++++
 2 files changed, 612 insertions(+), 0 deletions(-)
 create mode 100644 src/network/utils/codel-queue.cc
 create mode 100644 src/network/utils/codel-queue.h
2014-05-22 14:42:47 -05:00
Natale Patriciello 07364f0e31 Support for basic TCP options, window scale, and timestamps, based on original code proposal by Adrian S.-W. Tam 2014-09-05 16:57:11 -07:00
Natale Patriciello b4a48d02b2 GT_OR_EQ and LT_OR_EQ macros for testing 2014-09-04 15:17:22 -07:00
Stefano Avallone bd8c6c8a32 add support for a Wifi sleep mode 2014-09-05 16:33:57 -07:00
Cristiano Tapparello d3ff87aeb2 Energy harvester model 2014-09-05 15:38:55 -07:00
Tom Henderson 47d531fb41 support disabling of NSC by command-line argument 2014-09-05 15:25:10 -07:00
Budiarto Herman 81820dd14f Updated fix for Bug 1762 - UE stuck in IDLE_CONNECTING because RRC CONN REQ is not transmitted 2014-09-04 23:13:41 +03:00
Nicola Baldo c69d0bfe09 fixed Bug 1893 - issue in DoSchedUlTriggerReq with harq 2014-09-03 13:42:12 +02:00
Tommaso Pecorella 07040f354c Improve IPv6 LL multicast interface selection 2014-08-30 18:20:10 +02:00
Tommaso Pecorella 51aa7c22a4 Improve ICMPv6 NS printing 2014-08-30 18:19:25 +02:00
Tommaso Pecorella dda7b43d44 Bug 1967 - LL Multicast is not compressed in the right way in IPHC 2014-08-30 18:25:22 +02:00
Tommaso Pecorella 6d42b5f6c1 lr-wpan: remove dead code and add Doxygen 2014-08-25 19:15:36 +02:00
Tommaso Pecorella 8225948ffd [Doxygen] NetDevice small fix 2014-08-25 09:34:17 +02:00
Tommaso Pecorella be8cd47fc8 [PyBindGen] rescan internet module 2014-08-24 17:29:26 +02:00
Tommaso Pecorella 6ac283a20b [Doxygen] internet module fixes 2014-08-24 17:16:17 +02:00
Tommaso Pecorella 35f32fe073 Bug 1963 - AODV can tag the same packet twice (and raise an assert). 2014-08-23 17:37:24 +02:00
Tommaso Pecorella 62eaf4f7cb [manual] Packet::EnableMetadata doesn't exist anymore 2014-08-23 17:34:17 +02:00
Tom Henderson af37384cff Suppress binding for EmuEpcHelper if EmuFdNetDevice is not enabled 2014-08-19 14:29:52 -07:00
Peter D. Barnes, Jr. 16af384434 [Sphinx] Attributes manual chapter 2014-08-18 17:43:37 -07:00
Peter D. Barnes, Jr. e34b13367b Show default attribute value in command line example - cleanup 2014-08-18 16:00:42 -07:00
Tommaso Pecorella fb985d0860 Show default attibute value in command line example - fix 2014-08-18 23:45:04 +02:00
Peter D. Barnes, Jr. 97f06df836 Show initial values of arguments; show attribute value. 2014-08-18 12:36:07 -07:00
Peter D. Barnes, Jr. 06fe039cd9 Fix misspelled argument name; refactor to use LookupAttributeByName 2014-08-18 12:35:33 -07:00
Vedran Miletić e22f7b5958 Make ordering of member variables in NSC TCP socket implementation header/source consistent 2014-08-18 11:56:15 +02:00
Tommaso Pecorella 27e7935c6c [PyBindGen] Rescan core module 2014-08-15 14:27:15 +02:00
Peter D. Barnes, Jr. b8b676a8d7 CommandLine Attribute shorthand 2014-08-14 12:46:11 -07:00
Peter D. Barnes, Jr. fa19c3d5e3 [doxygen] CommandLine formatting 2014-08-14 12:41:38 -07:00
Peter D. Barnes, Jr. 60505541ec Sort output of the CommandLine::Print functions 2014-08-14 11:31:12 -07:00
Tommaso Pecorella 894e118a3b [PyBindGen] Rescan internet module 2014-08-14 06:34:47 +02:00
Peter D. Barnes, Jr. 49bf6a544f [Doxygen] Fix errors; fix organization of Callback; organize Time. 2014-08-13 17:17:26 -07:00
Tommaso Pecorella 2d79be2427 Improvements to tcp-variants-comparison example 2014-08-13 22:43:18 +02:00
Tommaso Pecorella fbad78fbb4 Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource 2014-08-13 23:46:16 +02:00
Alina Quereilhac 10269d0a5b Fix for Bug 1961 - planetlab-tap-creator "variable set but not used" 2014-08-06 11:00:06 +02:00
Tommaso Pecorella fe90df6c23 Bug 1960 - Wrong information on index range, about Node::GetDevice 2014-08-03 15:09:19 +02:00
Tom Henderson 9a8bbca8df rescan LTE bindings 2014-08-03 09:55:53 -07:00
Nicola Baldo d762f84977 refined fix for Bug 1762 2014-08-01 14:30:42 +02:00
Budiarto Herman c53882872b fix Bug 1762 - UE stuck in IDLE_CONNECTING because RRC CONN REQ is not transmitted 2014-07-31 14:00:06 +02:00
Tommaso Pecorella 6af34ad829 Bug 1941 - [cont.] Remove unnecessary dependency on Application module in other modules 2014-07-27 23:02:38 +02:00
Tommaso Pecorella e3729362c9 Avoid checking all Link-Local Multicast cases in IPv6 routing 2014-07-26 13:08:33 +02:00
Lynne Salameh 691b9f892f Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple 2014-07-20 11:29:28 +02:00
Roman Naumann f0d6341ddf Bug 1951 - AODV does not update nexthop for 1-hop nodes 2014-07-20 10:13:02 +02:00
Peter D. Barnes, Jr. f8bb25d058 Enable explicit setting of the maximum look ahead in distributed simulation. 2014-07-17 15:38:07 -07:00
Peter D. Barnes, Jr. e4f944939c NS_LOG_CONDITION to control logging based on file-local state. 2014-07-17 15:34:57 -07:00
Dmitrii Shakshin 005ea81ecf NetAnim: Support for system id associated with nodes 2014-07-10 08:19:06 -07:00
Sascha Alexander Jopen 9fd85ad079 Add const double& operator[] to SpectrumValue 2014-07-08 08:27:21 +02:00
Tom Henderson b3a080b633 enable emu-related files based on waf configuration check results 2014-07-05 09:51:04 -07:00
Sascha Alexander Jopen 4078d90539 Bug 1943 - Waveform generator signal duration calc error 2014-07-04 20:22:47 +02:00
Nicola Baldo 19653b4a77 updated LTE user docs and RELEASE_NOTES for EmuEpcHelper 2014-07-03 16:43:58 +02:00
Nicola Baldo 057f56133b merge 2014-07-03 15:39:00 +02:00
Nicola Baldo fe5ee0c29b merge 2014-07-03 10:48:41 +02:00
Tom Henderson 4af772ceaa print error message when test.py list printing fails 2014-06-30 11:09:35 -07:00
John Abraham 7ec65a1816 NetAnim: Valgrind fixes 2014-06-29 20:19:00 -07:00
John Abraham b397d2775e NetAnim: Cleanup and support for more built-in counters 2014-06-28 09:59:03 -07:00
Tommaso Pecorella 31f05a6594 Bug 1941 - [cont.] Remove unnecessary dependency on Application module in other modules 2014-06-28 12:35:08 +02:00
Tommaso Pecorella d7731afca3 Bug 1941 - [partial] Remove unnecessary dependency on Application module in other modules 2014-06-28 08:31:24 +02:00
Tommaso Pecorella 16671aa50d Bug 1937 - FlowMonitor fails to track multiplexed packets 2014-06-27 22:28:07 +02:00
Tom Henderson aa3a17d3e5 improve point-to-point-net-device.cc logging 2014-06-26 13:15:49 -07:00
mmiozzo 7716182610 Bug-fix: Bug 1935 - Bug in all Uplink Schedulers regarding HARQ retx handling 2014-06-26 13:44:03 +02:00
Tom Henderson a0be1da4b5 update pybindgen version 2014-06-23 09:52:33 -07:00
Tommaso Pecorella 6bde2bde12 Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet 2014-06-18 19:03:10 +02:00
Tommaso Pecorella b7a3cff456 Bug 1932 - NdiscCache entry is not failsafe on double neighbor probing 2014-06-17 23:31:52 +02:00
Roman Naumann 69d284bc83 Credit for Bug 1930 finding and patch. 2014-06-17 22:44:08 +02:00
Tommaso Pecorella 5a3b3d38e3 Bug 1930 - Use of invalid reference in OLSR RemoveLinkTuple 2014-06-17 22:40:32 +02:00
Tom Henderson 71d0c0f554 start RELEASE_NOTES and CHANGES.html for next version 2014-06-17 10:59:19 -07:00
Tom Henderson 060d270a04 Added tag ns-3.20 for changeset da0eb48df23f 2014-06-16 21:58:35 -07:00
Tommaso Pecorella e77f033498 Update RELEASE_NOTES 2014-05-21 21:03:33 +02:00
Tommaso Pecorella e74cb7f6cd Bug 1916 - RandomWalk2dMobilityMode default "Bounds" attribute is not a rectangle 2014-05-21 21:01:41 +02:00
Chris Hood 23a3e5f751 Bug 1915 - BRITE channel delay is rounded to an integer 2014-05-19 21:34:20 +02:00
Peter D. Barnes, Jr. 1164685c68 [doxygen] Fix generation of Time docs 2014-05-15 16:09:51 -07:00
Tommaso Pecorella cd8eaad8cb lr-wpan - Add Enqueue and Dequeue ASCII trace 2014-05-08 22:25:56 +02:00
Tom Henderson 23a41e0e22 add netanim capability to mixed-wireless.cc 2014-05-04 18:46:44 -07:00
Tom Henderson 7867d64876 make mobility and visualization more reasonable for example 2014-05-04 18:37:17 -07:00
Tom Henderson ddd060a1cc re-align mixed-wireless C++ and Python example 2014-05-04 17:59:01 -07:00
Alexander Afanasyev 894699eccf bug 1857: detect location of installed boost libraries 2014-05-03 15:56:25 -07:00
Tom Henderson 2661df4606 make waf smarter about finding BRITE automatically 2014-05-03 10:12:46 -07:00
Tommaso Pecorella 6fcc641c25 Update RELEASE_NOTE 2014-05-02 23:52:36 +02:00
Biljana Bojovic c4269df612 Bug 1894 - CqaFfMacScheduler needs an update 2014-05-02 17:06:37 +02:00
Nicola Baldo c612a2b43a added missing bugs in RELEASE_NOTES 2014-05-02 16:48:50 +02:00
Yufei Cheng ea04312f27 Bug 1872 and 1895 - DSR model improvements (credits also to Tomasz Seweryn <tomasz.seweryn7@gmail.com>) 2014-05-02 16:38:06 +02:00
Tommaso Pecorella d9e06f64fa fix RELEASE_NOTES 2014-05-02 08:58:51 +02:00
Tommaso Pecorella 8604dad16c lr-wpan ascii trace fix 2014-05-02 08:47:44 +02:00
Brian Swenson 7dbc7f63e4 Bug1791 patch reverted 2014-05-01 16:49:11 -04:00
Tommaso Pecorella d746b4a9d9 Add sixlowpan example using lr-wpan 2014-05-01 15:18:41 +02:00
Peter D. Barnes, Jr. a43d770825 [Bug 1868] Optimized builds are sensitive to -fstrict-overflow 2014-04-30 21:32:57 -07:00
Peter D. Barnes, Jr. 84d277bfa3 Disambiguate std::pow 2014-04-30 20:54:05 -07:00
Tom Henderson 08a075ef1d fix lr-wpan documentation build 2014-04-30 13:40:07 -07:00
Tom Henderson ff1f9f9c5f append list of skipped/failed/crashed/valgrined tests to end of test.py output 2014-04-30 13:06:17 -07:00
Tom Henderson 2c89f96f00 add lr-wpan bindings 2014-04-30 13:05:31 -07:00
Tom Henderson e0bb22b2f2 disable another copy constructor 2014-04-30 13:01:22 -07:00
Tom Henderson 20e713630a some fixes to enable Python bindings scanning 2014-04-30 12:19:33 -07:00
Sascha Jopen 022360d1f3 Reverted lr-wpan-error-model "fix", the differences were due to randomness problems. 2014-04-27 10:48:18 +02:00
Tom Henderson 2d87ec3973 update AUTHORS 2014-04-26 23:29:46 -07:00
Tom Henderson 57889369b1 Apply utils/check-style.py script on lr-wpan source code again 2014-04-26 23:27:34 -07:00
Tom Henderson 2d90b21794 more verbose test name for lr-wpan-energy-detection 2014-04-26 23:11:44 -07:00
Sascha Jopen fa763e41c5 Added firing of missing MAC TX trace sources.
Fixed error model test case after changes to the interference handling.
More code cleanup and documentation.
2014-04-26 22:23:25 +02:00
Sascha Jopen 1e7427bab1 More documentation for the PHY. 2014-04-26 09:06:00 +02:00
Margherita Filippetti 74081e597a Add number of CSMA retries to sent packet trace 2014-04-25 23:46:03 +02:00
Tom Henderson 45884e4786 assign fixed random variable streams to lr-wpan tests 2014-04-26 22:21:13 -07:00
Tom Henderson 95b22341a9 enable assignment of lr-wpan random variable stream indices 2014-04-26 22:21:03 -07:00
Tom Henderson 7059e4d396 add TestCase type specifier 2014-04-26 14:09:57 -07:00
Tom Henderson d53f68be0c multiple inclusion of lr-wpan-collision-test.cc 2014-04-26 05:44:11 -07:00
Tom Henderson ce1c08f9a7 restore Start/DoStart change to Initialize/DoInitialize to LrWpanNetDevice 2014-04-26 05:33:42 -07:00
Sascha Jopen cc1ff6ac3b First Doxygen documentation batch and code cleanups.
Moved to new random variable streams.
Use Time class where times are calculated.
Use std::min/max provided by standard library instead of own macros.
Always return a 0 FCS value for MAC trailers without FCS calculation.
2014-04-25 19:02:57 +02:00
Sascha Jopen 2eda1ac2e6 Removed sixlowpan example from scratch folder. This should go to the respective module. 2014-04-25 18:58:47 +02:00
Sascha Jopen 6ded61e205 Bug fixes and test for energy detection code. 2014-04-25 12:51:56 +02:00
Sascha Jopen bdbf0fd6e7 Changed default receiver sensitivity value. 2014-04-24 12:47:09 +02:00
Sascha Jopen 42ccc4e1dc Added log components. 2014-04-24 12:46:33 +02:00
Tom Henderson b5f0ebcab2 add lr-wpan documentation links to model library Makefile 2014-04-25 14:50:39 -07:00
Sascha Jopen e49d50c75a Updated documentation. Added debugging code. 2014-04-24 12:45:49 +02:00
Tommaso Pecorella 9c76f9ff43 Add Trace to measure the number of packet retires (for Etx metric) 2014-04-18 23:32:55 +02:00
Sascha Jopen a6316eb5a3 Make ED and CCA interference aware.
Fix a bug in interference handling.
2014-04-16 15:32:59 +02:00
Sascha Jopen c6f406fe8a Added test for ACK ordering. 2014-04-15 15:41:12 +02:00
Sascha Jopen f9fedcc59e Added LQI calculation as the PER of the complete packet scaled to 255.
Removed debugging outputs.
2014-04-15 15:40:39 +02:00
Nicola Baldo 91621686b4 added comment 2014-04-14 17:21:29 +02:00
Tommaso Pecorella c65a263dbd Collision tests, the bug was a shadow 2014-04-08 21:37:23 +02:00
Tommaso Pecorella f6ad02364e Add back debugging code, seems we have a bug in interference handling. 2014-04-08 15:57:59 +02:00
Tommaso Pecorella 1e75a2cb6b Remove logging cout 2014-04-08 15:06:52 +02:00
Tommaso Pecorella 92b2936c5d Tweaks to the collision tests 2014-04-08 14:58:28 +02:00
Tommaso Pecorella d486f26151 Preliminary Collision tests 2014-04-06 23:01:10 +02:00
Sascha Jopen 6c6dcbaf31 Fixed compile errors in examples. 2014-04-06 16:35:15 +02:00
Tommaso Pecorella e0d8349d71 Possible bug fix and sequence number as SequenceNumber8 2014-04-06 12:36:51 +02:00
Tommaso Pecorella 7b51212b96 Bug in receiving a packet. Assert to highlight the problem. 2014-04-06 10:00:58 +02:00
Tommaso Pecorella 65d236b00a Add example script in scratch 2014-04-04 09:50:08 +02:00
Tommaso Pecorella 29e97984bd Tweaks to Rx values 2014-03-27 23:02:43 +01:00
Sascha Jopen 4507193d46 Removed debug output. 2014-03-27 17:25:12 +01:00
Sascha Jopen 62afc9063e First version with interference handling. 2014-03-27 16:56:15 +01:00
Tommaso Pecorella 29f5bd43f3 Align error model test to actual results after bug fixing 2014-03-25 23:21:02 +01:00
Sascha Jopen a32593c948 Relicense lr-wpan-lqi-tag.{cc,h} to GPLv2. 2014-03-25 14:55:27 +01:00
Erwan Livolant 4737871613 Fixed missing FCS calculation for ACKs. 2014-03-20 14:44:10 +01:00
Tommaso Pecorella 74d8c0d6c7 Helper: associate nodes to a PAN 2014-03-16 22:33:50 +01:00
Tommaso Pecorella ff799f5cbd Fix Hel'er's install and add ping6/6LoWPAN example 2014-03-16 20:46:00 +01:00
Tommaso Pecorella 90dc67f344 Set rx sensitivity to -110 dBm (temporary) 2014-03-16 20:45:13 +01:00
Sascha Jopen f4b5e5e4e2 - Fixed error in MAC state machine when sending an ACK and enqueuing a data packet at the same time.
- Fixed error when switching the PHY transceiver while a switch is already in progress.
2014-02-24 12:51:06 +01:00
Tommaso Pecorella 131f31f56a ACK (Sascha Jopen), NetDevice (Tommaso Pecorella and Margherita Filippetti), FCS changes (Erwan Livolant), and clang compliance 2014-02-23 16:24:11 +01:00
Tom Henderson b5d3e81f81 fix LrWpanNetDevice::GetAddress() 2014-04-26 22:42:10 -07:00
Tom Henderson ba22dba981 update lr-wpan wscript format 2014-04-26 22:41:19 -07:00
Nicola Baldo 5084f6a5af minor fix in LTE RRC logging format 2014-01-21 19:57:53 +01:00
Nicola Baldo c162fcb75b other minor fix in LTE user docs 2014-01-21 19:38:34 +01:00
Nicola Baldo b5735684f1 minor fix in LTE user docs 2014-01-21 19:36:55 +01:00
Nicola Baldo b1c73cc5d5 updated LTE standalone docs generation 2014-01-21 15:46:37 +01:00
Nicola Baldo 39afbfc8c8 discard duplicate AMD PDU segments 2013-12-11 13:12:52 +01:00
Nicola Baldo eb3a9225fe LteRlcAm: add RBS timer, fix polling for retransmissions 2013-12-10 20:16:50 +01:00
Nicola Baldo 8173067467 new retransmission policy for LteRlcAm 2013-12-10 19:34:38 +01:00
Brett Levasseur dff5e13d77 TS36.322 5.2.2.3 consider the AMD PDU with SN=VT(S) - 1 for retransmission 2013-12-10 18:11:08 +01:00
Nicola Baldo dbffc3a3ee lte-rlc-am-e2e test now using LteTestMac with AUTOMATIC_MODE 2013-12-10 17:42:30 +01:00
Nicola Baldo 3d75fe5639 LteRlcAm: trigger a STATUS report when T_reordering expires 2013-11-22 20:33:30 +01:00
Nicola Baldo 5a1d345b0e merge 2013-11-20 19:31:46 +01:00
Nicola Baldo 11f6f2330f improvements in lena-simple-epc-emu 2013-11-15 13:04:27 +01:00
Nicola Baldo 2b751f4a2e fixed eNB IP addresses in EmuEpcHelper 2013-11-15 13:04:01 +01:00
Nicola Baldo fb295e22c9 added EmuEpcHelper 2013-11-14 17:41:18 +01:00
Nicola Baldo b6565284f7 LteRlcAm: fixed ACK SN setting, added more moduls base updates, restored sending of data from transmitted buffer 2013-11-03 21:00:32 +01:00
Brett Levasseur 8c0ee18262 patch posted at https://groups.google.com/d/msg/ns-3-users/CEfmMX3IRBw/7NcFOd_NJdAJ 2013-11-03 18:29:11 +01:00
Nicola Baldo eda0bbade0 revised RLC AM NACK code after https://groups.google.com/d/msg/ns-3-users/CEfmMX3IRBw/rrmJiBwBGrYJ 2013-10-23 15:21:13 +02:00
Brett bae86f8e78 fixed update of m_vtA in LteRlcAm::DoReceivePdu https://groups.google.com/d/msg/ns-3-users/CEfmMX3IRBw/lJ0d15gOxW4J 2013-10-22 13:32:39 +02:00
Nicola Baldo 6fbfd3ffd5 LteRlcHeaderTest: added more test case instances and fixed one of the previous 2013-10-21 14:27:50 +02:00
Nicola Baldo b6569d7991 LteRlcHeaderTest: fixed setup, added more test cases 2013-10-21 14:04:43 +02:00
Brett 010b2ac109 fixed LteRlcAmHeader::PushNack, see https://groups.google.com/d/msg/ns-3-users/CEfmMX3IRBw/slGrmtVii7YJ 2013-10-21 13:10:21 +02:00
Nicola Baldo 5f90f383ce added test lte-rlc-header 2013-10-11 18:23:16 +02:00
Brett 2608c9f98a tentative RLC AM NACK implementation https://groups.google.com/d/msg/ns-3-users/CEfmMX3IRBw/tX1X1yY_tgoJ 2013-10-11 11:35:18 +02:00
Tom Henderson a4ac0f8915 update figure reference 2013-03-22 16:16:53 -07:00
Tom Henderson 8d895fc3c3 enable pcap on a lr-wpan example 2012-07-04 21:34:18 -07:00
Tom Henderson e9dc5fbd4c remove comparison that is always true due to limited range of data type 2012-07-04 21:29:55 -07:00
Tom Henderson 8f70c1a43f align with SpectrumPhy antenna model changes for ns-3.14 2012-07-04 21:26:40 -07:00
Gary Pei f74b34aac2 align lr-wpan with ns-3.13 spectrum API changes 2012-03-29 19:31:11 -07:00
Tom Henderson 1acbf3eb64 roll-up of many updates to models, tests, examples 2011-11-16 22:01:06 -08:00
Tom Henderson 9a66307754 Initial lr-wpan checkin 2011-05-29 14:38:53 -07:00
Mitch Watrous d7bd267c7e Bug 1717 - Detect unsettable attributes 2014-04-29 22:38:13 +02:00
Christopher Kosecki a15640d10e Bug 1876 - enable OLSR HNA table access 2014-04-29 20:35:34 +02:00
Tommaso Pecorella b314b544e5 [Python bindings] refresh OLSR module 2014-04-29 10:54:16 +02:00
Tommaso Pecorella 1c8972af9d Bug 1817 - IPv4 Identification field should consider protocol as well. 2014-04-29 10:07:25 +02:00
Tommaso Pecorella ae5d2c7131 Bug 1276 - optimize NistErrorRateModel 2014-04-29 10:01:47 +02:00
Konstantinos Katsaros 058c71d944 Bug 1903 - Namespace usage in olsr-state.cc/h 2014-04-29 09:50:21 +02:00
Tommaso Pecorella c75d24d0d3 RIPng - avoid spaces in ConfigStore names 2014-04-28 22:14:15 +02:00
Tom Henderson f30b671683 clarify some points about the ConfigStore 2014-04-28 10:50:25 -07:00
Tom Henderson 3588837aa6 fix typo 2014-04-28 10:38:37 -07:00
Tomasz Seweryn f7e18f35b4 Bug 1873 - Energy source checked to be aggregated to the node 2014-04-26 23:01:09 +02:00
Tom Henderson af31d858d2 add missing include 2014-04-24 17:38:36 -07:00
John Abraham 16187bdb69 NetAnim: Remove obsolete functionalities 2014-04-23 08:30:00 -07:00
Tommaso Pecorella f7769e0ea0 Update RELEASE_NOTES 2014-04-22 21:42:28 +02:00
Tommaso Pecorella 2834944fc2 Bug1829 2014-04-22 14:43:02 -04:00
Brian Swenson 2f07ece0bb Bug 1850 update tests 2014-04-22 14:16:48 -04:00
Unknown 9d815d019d Bug 1850 2014-04-22 13:58:22 -04:00
1944 changed files with 165436 additions and 71408 deletions

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
*.pyc
.waf*
src/NDNabstraction
build/
doc/html/
doc/latex/
\.rej$
\.orig$
\.o$
~$
^build-dir
^build
^testpy-output
^doc/html
^doc/latex
.lock-wscript
doc/ns3-object.txt
doc/introspected-doxygen.h
.lock-waf_darwin_build
.lock-waf_linux2_build
.lock-waf_cygwin_build
.lock-waf_freebsd7_build
.lock-waf_freebsd8_build
.lock-waf_freebsd9_build
.waf
^doc/introspected-doxygen\.h$
.*\.py[co]$
\.pcap$
\.mob$
\.routes$
^doc/manual/build
^doc/tutorial/build
^doc/testing/build
^doc/models/build
^doc/models/source-temp
^doc/manual/figures/.*eps
^doc/manual/figures/.*pdf
^doc/manual/figures/.*png
^bindings/python/pybindgen/
ms_print.*
massif.*
\.patch$
\.diff$
\.tr$
\#[^\#/]+\#$
.lock-wscript
.lock-wafbuild
src/ndnSIM
configure
toggle
.ns3rc
.cproject
.project
.settings/
+4
View File
@@ -67,3 +67,7 @@ ae540de68a2534213342c5e0b12afb47d7518a90 ns-3.14
b4a70b99171ade6e9628a87780994238950a1df1 ns-3.17
cfbc9491d7e7c9d346cc042fd35b8afb8836e81f ns-3.18
322102df792e2be6c74df74f776b3470fb1db795 ns-3.19
da0eb48df23f96335f32a37f047a6bc27e197c8d ns-3.20
fa4be182ef17746cea50e89af557c79a28b76533 ns-3.21
103f62fc7d586cf6d4d6fd9f5e488d2f7f8fe436 ns-3.22
8ea92bc090cdc01e683a2116d7668ce745ae92e2 ns-3.23
+67 -31
View File
@@ -2,6 +2,7 @@ Alexander Afanasyev (alexander.afanasyev@ucla.edu)
Rohit Agarwal (mindprince@gmail.com)
Kirill Andreev (andreev@iitp.ru)
Dean Armstrong (deanarm@gmail.com)
Stefano Avallone (stefano.avallone@unina.it)
Ghada Badawy (gbadawy@gmail.com)
Nicola Baldo (nbaldo@cttc.es)
Mirko Banchi (mk.banchi@gmail.com)
@@ -11,36 +12,47 @@ Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu)
Raj Bhattacharjea (raj.b@gatech.edu)
Timo Bingmann (timo.bingmann@student.kit.edu)
Julien Boite (juboite@gmail.com)
Biljana Bojovic <bbojovic@cttc.es>
Biljana Bojovic (bbojovic@cttc.es)
Elena Borovkova (borokovaes@iitp.ru)
Pavel Boyko (boyko@iitp.ru)
Dan Broyles (muxman@sbcglobal.net)
Jonathan Brugge (j.d.brugge@student.utwente.nl)
Junling Bu <linlinjavaer@gmail.com>
Junling Bu (linlinjavaer@gmail.com)
Elena Buchatskaia (borovkovaes@iitp.ru)
Nuno Cardoso (nunopcardoso@gmail.com)
Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com)
Scott Carpenter (scarpen@ncsu.edu)
Tiago Cerqueira (tiago.miguel43@gmail.com)
Egemen K. Cetinkaya (ekc@iitc.ku.edu)
Angelos Chatzipapas (chatzipa@ceid.upatras.gr)
Eugene Chemeritskiy (echemeritskiy@arccn.ru)
Yufei Cheng (yfcheng@ittc.ku.edu)
Andrey Churin (aachurin@gmail.com)
Benjamin Cizdziel (ben.cizdziel@gmail.com)
Salva Climent (jocliba@gmail.com)
Luis Cortes (cortes@gatech.edu)
Luca Costantino (luca.costantino@gmail.com)
Matthieu Coudron (matthieu.coudron@lip6.fr)
Alexander D'souza (moijes12@gmail.com)
Sébastien Deronne (sebastien.deronne@gmail.com)
Craig Dowell (craigdo@ee.washington.edu)
Gilaras Drakeson <gilaras@gmail.com>
Christian Facchini <c.facchini@gmail.com>
Gilaras Drakeson (gilaras@gmail.com)
Christian Facchini (c.facchini@gmail.com)
Denis Fakhriev (fakhriev@iitp.ru)
Jahanzeb Farooq (Jahanzeb.Farooq@inria.fr, Jahanzeb.Farooq@gmail.com)
Luca Favatella <slackydeb@gmail.com>
Luca Favatella (slackydeb@gmail.com)
Margherita Filippetti (morag87@gmail.com)
Pedro Fortuna (pedro.fortuna@inescporto.pt)
Juliana Freitag Borin (juliana.freitag@gmail.com)
Piotr Gawlowicz (gawlowicz.p@gmail.com)
Eric Gamess (egamess@gmail.com)
Yida Gao <yidapb@gmail.com>
Yida Gao (yidapb@gmail.com)
Thomas Geithner (thomas.geithner@dai-labor.de)
Ashim Ghosh <ashim.atiit@gmail.com>
Ashim Ghosh (ashim.atiit@gmail.com)
Martin Giachino (martin.giachino@gmail.com,giachino@fing.edu.uy)
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)
Charline Taibi Guguen (charline.guguen@gmail.com)
@@ -48,9 +60,12 @@ Daniel Halperin (daniel@halper.in)
Bruno Haick (bghaick@hotmail.com)
Frank Helbert (frank@ime.usp.br)
Tom Henderson (tomhend@u.washington.edu)
Budiarto Herman <budiarto.herman@magister.fi>
Tom Hewer <tomhewer@mac.com>
Kim Højgaard-Hansen <kimrhh@gmail.com>
Christopher Hepner (hepner@hs-ulm.de)
Budiarto Herman (budiarto.herman@magister.fi)
Tom Hewer (tomhewer@mac.com)
Kristian A. Hiorth (kristahi@ifi.uio.no)
Kim Højgaard-Hansen (kimrhh@gmail.com)
Chris Hood (chood8@gatech.edu)
Blake Hurd (naimorai@gmail.com)
ishan (ishan.chhabra@gmail.com)
Mohamed Amine Ismail (amine.ismail@inria.fr, iamine@udcast.com)
@@ -61,74 +76,94 @@ Sam Jansen (sam.jansen@gmail.com)
Liu Jian (liujatp@gmail.com)
Piotr Jurkiewicz (piotr.jerzy.jurkiewicz@gmail.com)
Evgeny Kalishenko (ydginster@gmail.com)
Konstantinos Katsaros <dinos.katsaros@gmail.com>
Joe Kopena (tjkopena@cs.drexel.edu)
Konstantinos Katsaros (dinos.katsaros@gmail.com)
Morteza Kheirkhah (m.kheirkhah@sussex.ac.uk)
Flavio Kobuta (flaviokubota@gmail.com)
Joe Kopena (tjkopena@cs.drexel.edu)
Christopher Kosecki (christopher.l.kosecki.ctr@mail.mil)
Aleksey Kovalenko (kovalenko@iitp.ru)
Mathieu Lacage (mathieu.lacage@inria.fr)
Emmanuelle Laprise (emmmanuelle.laprise@bluekazoo.ca)
Kristijan Lenković <k.lenkovic@me.com>
Kristijan Lenković (k.lenkovic@me.com)
Daniel Lertpratchya (nikkipui@gmail.com)
Brett Levasseur (brettl20@gmail.com)
Björn Lichtblau (lichtbla@informatik.hu-berlin.de)
Timo Lindhorst <tlnd@online.de>
Timo Lindhorst (tlnd@online.de)
Erwan Livolant (erwan.livolant@inria.fr)
Keith Ma (keith.nwsuaf@gmail.com)
Federico Maguolo (maguolof@dei.unipd.it)
Antti Makela (zarhan@cc.hut.fi)
Francesco Malandrino (francesco.malandrino@gmail.com)
Rubén Martínez (rmartinez@deic.uab.cat)
Fabian Mauchle (f1mauchl@hsr.ch)
Andrey Mazo (mazo@iitp.ru)
Jonathan McCrohan (jmccroha@tcd.ie)
Andrew McGregor (andrewmcgr@gmail.com)
Vedran Miletić (rivanvx@gmail.com)
Jens Mittag <jens.mittag@kit.edu>
Jens Mittag (jens.mittag@kit.edu)
Marco Miozzo (mmiozzo@cttc.es)
Faker Moatamri (faker.moatamri@inria.fr)
Edvin Močibob <edvin.mocibob@gmail.com>
Edvin Močibob (edvin.mocibob@gmail.com)
Mike Moreton (mjvm_ns@hotmail.com)
Michele Muccio <michelemuccio@virgilio.it>
Michele Muccio (michelemuccio@virgilio.it)
Esteban Municio (esteban.municio@urjc.es)
Sidharth Nabar (snabar@uw.edu)
Hemanth Narra (hemanth@ittc.ku.edu)
Andreas Nilsson <andrnils@gmail.com>
Roman Naumann (naumann@informatik.hu-berlin.de)
Ben Newton (bn@cs.unc.edu)
Cecchi Niccolò (insa@igeek.it)
Andreas Nilsson (andrnils@gmail.com)
Jaume Nin (jnin@cttc.es)
Michael Nowatkowski (nowatkom@gmail.com)
Anh Nguyen <annguyen@ittc.ku.edu>
Anh Nguyen (annguyen@ittc.ku.edu)
Duy Nguyen (duy@soe.ucsc.edu)
Lluís Parcerisa <parcerisa@gmail.com>
Luis Pacheco (luisbelem@gmail.com)
Lluís Parcerisa (parcerisa@gmail.com)
Natale Patriciello (natale.patriciello@gmail.com)
Tommaso Pecorella (tommaso.pecorella@unifi.it)
Vikas Pushkar (vikaskupushkar@gmail.com)
Guangyu Pei (guangyu.pei@boeing.com)
Josh Pelkey (jpelkey@gatech.edu)
Per <per_e_lists@rocketmail.com>
Fernando Pereira <ferdonfeup@gmail.com>
Per (per_e_lists@rocketmail.com)
Fernando Pereira (ferdonfeup@gmail.com)
Colin Perkins (csp@csperkins.org)
Giuseppe Piro (g.piro@poliba.it)
Yana Podkosova (yanapdk@rambler.ru)
Guangyu Pei (guangyu.pei@boeing.com)
Vikas Pushkar (vikaskupushkar@gmail.com)
Andrea Ranieri (andreran@uno.it)
Bruno Ranieri (Yrrsinn@googlemail.com)
Ken Renard (kenneth.renard@arl.army.mil)
Manuel Requena (mrequena@cttc.es)
Matias Richart (mrichart@fing.edu.uy)
George F. Riley (riley@ece.gatech.edu)
Juergen Rinas <jrinas@gmx.de>
Juergen Rinas (jrinas@gmx.de)
Sebastian Rohde (sebastian.rohde@tu-dortmund.de)
Karsten Roscher <sfx@rocktale.de>
Karsten Roscher (sfx@rocktale.de)
Bill Roome (wdr@bell-labs.com)
David <david.rua@gmail.com>
David (david.rua@gmail.com)
Andrea Sacco (andrea.sacco85@gmail.com)
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>
Francisco Javier Sánchez-Roselly (fnavarro@ujaen.es)
Florian Schmidt (Florian.Schmidt@cs.rwth-aachen.de)
Guillaume Seguin (guillaume.seguin@inria.fr)
Ioannis Selinis (selinis.g@gmail.com)
Tomasz Seweryn (tomasz.seweryn7@gmail.com)
Dmitrii Shakshin (d.shakshin@gmail.com)
Kulin Shah (m.kulin@gmail.com)
Guowang Shi <shiguowang2007@gmail.com>
Guowang Shi (shiguowang2007@gmail.com)
Phillip Sitbon (phillip.sitbon@gmail.com)
Pedro Silva (pmms@inesctec.pt)
Anirudh Sivaraman (sk.anirudh@gmail.com)
Steven Smith <smith84@llnl.gov>
Andrew Stanton <acstanton515@gmail.com>
Steven Smith (smith84@llnl.gov)
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)
Dave Taht (dave.taht@bufferbloat.net)
Marcos Talau (talau@users.sourceforge.net)
Adrian S. W. Tam (adrian.sw.tam@gmail.com)
Cristiano Tapparello (cristiano.tapparello@rochester.edu)
Hajime Tazaki (tazaki@sfc.wide.ad.jp)
Wilson Thong (wilsonwk@ee.cityu.edu.hk)
Mauro Tortonesi (mauro.tortonesi@unife.it)
@@ -144,3 +179,4 @@ Florian Westphal (fw@strlen.de)
He Wu (mdzz@u.washington.edu)
Yoshihiko Yazawa (yoshiyaz@gmail.com)
Dizhi Zhou (dizhi.zhou@gmail.com)
Gaurav Sathe (gaurav.sathe@tcs.com)
+270
View File
@@ -50,6 +50,272 @@ the cracks, unfortunately. If you, as a user, can suggest improvements
to this file based on your experience, please contribute a patch or drop
us a note on ns-developers mailing list.</p>
<hr>
<h1>Changes from ns-3.23 to ns-3.24</h1>
<h2>New API:</h2>
<ul>
</ul>
<h2>Changes to existing API:</h2>
<ul>
<li> The signatures on several TcpHeader methods were changed to take const arguments.</li>
<li> class TcpL4Protocol replaces Send() methods with SendPacket(), and adds new methods to AddSocket() and RemoveSocket() from a node. Also, a new PacketReceived() method was introduced to get the TCP header of an incoming packet and check its checksum.</li>
<li> The CongestionWindow and SlowStartThreshold trace sources have been moved from the TCP subclasses such as NewReno, Reno, Tahoe, and Westwood to the TcpSocketBase class.</li>
</ul>
<h2>Changes to build system:</h2>
<ul>
</ul>
<h2>Changed behavior:</h2>
This section is for behavioral changes to the models that were not due to a bug fix.
<ul>
</ul>
<hr>
<h1>Changes from ns-3.22 to ns-3.23</h1>
<h2>New API:</h2>
<ul>
<li> The mobility module includes a GeographicPositions class used to
convert geographic to cartesian coordinates, and to generate randomly
distributed geographic coordinates.
</li>
<li> The spectrum module includes new TvSpectrumTransmitter classes and helpers to create television transmitter(s) that transmit PSD spectrums customized by attributes such as modulation type, power, antenna type, channel frequency, etc.
</li>
</ul>
<h2>Changes to existing API:</h2>
<ul>
<li> In LteSpectrumPhy, LtePhyTxEndCallback and the corresponding methods have been removed, since they were unused.
</li>
<li> In the DataRate class in the network module, CalculateTxTime has been declared deprecated. CalculateBytesTxTime and CalculateBitsTxTime are to be used instead. The return value is a Time, instead of a double.
</li>
<li> In the Wi-Fi InterferenceHelper, the interference event now takes the WifiTxVector as an input parameter, instead of the WifiMode. A similar change was made to the WifiPhy::RxOkCallback signature.
</li>
</ul>
<h2>Changes to build system:</h2>
<ul>
<li> None </li>
</ul>
<h2>Changed behavior:</h2>
This section is for behavioral changes to the models that were not due to a bug fix.
<ul>
<li> In Wi-Fi, HT stations (802.11n) now support two-level aggregation. The InterferenceHelper now distinguishes between the PLCP and regular payload reception, for higher fidelity modeling. ACKs are now sent using legacy rates and preambles. Acces points now establish BSSBasicRateSet for control frame transmissions. PLCP header and PLCP payload reception have been decoupled to improve PHY layer modeling accuracy. RTS/CTS with A-MPDU is now fully supported.
</li>
<li> The mesh module was made more compliant to the IEEE 802.11s-2012 standard and packet traces are now parseable by Wireshark.
</li>
</ul>
<hr>
<h1>Changes from ns-3.21 to ns-3.22</h1>
<h2>New API:</h2>
<ul>
<li> New classes were added for the PARF and APARF WiFi power and rate control mechanisms.
</li>
<li> Support for WiFi 802.11n MPDU aggregation has been added.
</li>
<li> Additional support for modeling of vehicular WiFi networks has been added, including the channel-access coordination feature of IEEE 1609.4. In addition, a Basic Safety Message (BSM) packet generator and related statistics-gathering classes have been added to the wave module.
</li>
<li> A complete LTE release bearer procedure is now implemented which can be invoked by calling the new helper method LteHelper::DeActivateDedicatedEpsBearer ().
</li>
<li> It is now possible to print the Neighbor Cache (ARP and NDISC) by using
the RoutingProtocolHelper
</li>
<li> A TimeProbe class has been added to the data collection framework in
the stats module, enabling TracedValues emitting values of type
ns3::Time to be handled by the framework.
</li>
<li> A new attribute 'ClockGranularity' was added to the TcpSocketBase class,
to control modeling of RTO calculation.
</li>
</ul>
<h2>Changes to existing API:</h2>
<ul>
<li> Several deprecated classes and class methods were removed, including EmuNetDevice, RandomVariable and derived classes, Packet::PeekData(), Ipv6AddressHelper::NewNetwork(Ipv6Address, Ipv6Prefix), Ipv6InterfaceContainer::SetRouter(), Ipv4Route::GetOutputTtl(), TestCase::AddTestCase(TestCase*), and TestCase::GetErrorStatus().
</li>
<li> Print methods involving routing tables and neighbor caches, in classes Ipv4RoutingHelper and Ipv6RoutingHelper, were converted to static methods.
</li>
<li>PointerValue attribute types in class UanChannel (NoiseModel), UanPhyGen (PerModel and SinrModel), UanPhyDual (PerModelPhy1, PerModelPhy2, SinrModelPhy1, and SinrModelPhy2), and SimpleNetDevice (TxQueue), were changed from PointerValue type to StringValue type, making them configurable via the Config subsystem.
</li>
<li> WifiPhy::CalculateTxDuration() and WifiPhy::GetPayloadDurationMicroSeconds () now take an additional frequency parameter.
</li>
<li> The attribute 'Recievers' in class YansWifiPhy was misspelled, so
this has been corrected to 'Receivers'.
</li>
<li> We have now documented the callback function signatures
for all TracedSources, using an extra (fourth) argument to
TypeId::AddTraceSource to pass the fully-qualified name
of the signature typedef. To ensure that future TraceSources
are similarly documented, the three argument version of
AddTraceSource has been deprecated.
</li>
<li> The "MinRTO" attribute of the RttEstimator class was moved to the TcpSocketBase class. The "Gain" attribute of the RttMeanDeviation class was replaced
by new "Alpha" and "Beta" attributes.
</li>
<li> Attributes of the TcpTxBuffer and TcpRxBuffer class are now accessible through the TcpSocketBase class.
</li>
<li> The LrWpanHelper class has a new constructor allowing users to configure a MultiModelSpectrumChannel as an option, and also provides Set/Get API to allow users to access the underlying channel object.
</li>
</ul>
<h2>Changes to build system:</h2>
<ul>
<li> waf was upgraded to version 1.7.16
</li>
</ul>
<h2>Changed behavior:</h2>
This section is for behavioral changes to the models that were not due to a bug fix.
<ul>
<li> The default value of the `Speed` attribute of ConstantSpeedPropagationDelayModel was changed from 300,000,000 m/s to 299,792,458 m/s (speed of light in a vacuum), causing propagation delays using this model to vary slightly.
</li>
<li> The LrWpanHelper object was previously instantiating only a LogDistancePropagationLossModel on a SingleModelSpectrumChannel, but no PropagationDelayModel. The constructor now adds by default a ConstantSpeedPropagationDelayModel.
</li>
<li> The Nix-vector routing implementation now uses a lazy flush mechanism,
which dramatically speeds up the creation of large topologies.
</li>
</ul>
<hr>
<h1>Changes from ns-3.20 to ns-3.21</h1>
<h2>New API:</h2>
<ul>
<li> New "const double& SpectrumValue:: operator[] (size_t index) const".
</li>
<li> A new TraceSource has been added to TCP sockets: SlowStartThreshold.
</li>
<li> New method CommmandLine::AddValue (name, attibutePath) to provide a
shorthand argument "name" for the Attribute "path". This also has
the effect of including the help string for the Attribute in the
Usage message.
</li>
<li> The GSoC 2014 project in the LTE module has brought some additional APIs:
<ul>
<li>a new abstract class LteFfrAlgorithm, which every future
implementation of frequency reuse algorithm should inherit from</li>
<li>a new SAPs: one between MAC Scheduler and FrAlgorithm, one between
RRC and FrAlgorithm</li>
<li>new attribute to enable Uplink Power Control in LteUePhy</li>
<li>new LteUePowerControl class, an implementation of Uplink Power Control, which is
configurable by attributes. ReferenceSignalPower is sent by eNB in SIB2.
Uplink Power Control in Closed Loop Accumulative Mode is enabled by default</li>
<li>seven different Frequency Reuse Algorithms (each has its own attributes): </li>
<ul>
<li>LteFrNoOpAlgorithm</li>
<li>LteFrHardAlgorithm</li>
<li>LteFrStrictAlgorithm</li>
<li>LteFrSoftAlgorithm</li>
<li>LteFfrSoftAlgorithm</li>
<li>LteFfrEnhancedAlgorithm</li>
<li>LteFfrDistributedAlgorithm</li>
</ul>
<li>attribute in LteFfrAlgorithm to set FrCellTypeId which is used in automatic
Frequency Reuse algorithm configuration</li>
<li>LteHelper has been updated with new methods related to frequency reuse algorithm:
SetFfrAlgorithmType and SetFfrAlgorithmAttribute</li>
</ul>
</li>
<li> A new SimpleNetDeviceHelper can now be used to install SimpleNetDevices.
</li>
<li> New PacketSocketServer and PacketSocketClient apps, meant to be used in tests.
</li>
<li> Tcp Timestamps and Window Scale options have been added and are enabled by default (controllable by attribute).
</li>
<li> A new CoDel queue model has been added to the 'internet' module.
</li>
<li> New test macros NS_TEST_ASSERT_MSG_GT_OR_EQ() and NS_TEST_EXPECT_MSG_GT_OR_EQ() have been added.
</li>
</ul>
<h2>Changes to existing API:</h2>
<ul>
<li> "Icmpv6L4Protocol::ForgeEchoRequest" is now returning a packet with the proper IPv6 header.
</li>
<li> The TCP socket Attribute "SlowStartThreshold" has been renamed "InitialSlowStartThreshold" to
clarify that the effect is only on the initial value.
</li>
<li> all schedulers were updated to interact with FR entity via FFR-SAP. Only PF, PSS, CQA,
FD-TBFQ, TD-TBFQ schedulers supports Frequency Reuse functionality. In the beginning
of scheduling process, schedulers ask FR entity for avaiable RBGs and then ask if UE
can be scheduled on RB</li>
<li> eNB RRC interacts with FFR entity via RRC-FFR SAP</li>
<li> new DL-CQI generation approach was implemented. Now DL-CQI is computed from control channel as signal
and data channel (if received) as interference. New attribute in LteHelper was added to specify
DL-CQI generation approach. New approach is default one in LteHelper </li>
<li> RadioEnvironmentMap can be generated for Data or Control channel and for specified RbId;
Data or Control channel and RbId can be configured by new attributes in RadioEnvironmentMapHelper </li>
<li> lte-sinr-chunk-processor refactored to lte-chunk-processor. Removed all lte-xxx-chunk-processor
implementations</li>
<li> BindToNetDevice affects also sockets using IPv6.</li>
<li> BindToNetDevice now calls implicitly Bind (). To bind a socket to a NetDevice and to a specific address,
the correct sequence is Bind (address) - BindToNetDevice (device). The opposite will raise an error.</li>
</ul>
<h2>Changes to build system:</h2>
<ul>
<li> None for this release. </li>
</ul>
<h2>Changed behavior:</h2>
<ul>
<li> Behavior will be changed due to the list of bugs fixed (listed in RELEASE_NOTES); users are requested to review that list as well.
</ul>
<hr>
<h1>Changes from ns-3.19 to ns-3.20</h1>
<h2>New API:</h2>
<ul>
<li> Models have been added for low-rate, wireless personal area networks
(LR-WPAN) as specified by IEEE standard 802.15.4 (2006). The current
emphasis is on the unslotted mode of 802.15.4 operation for use in Zigbee,
and the scope is limited to enabling a single mode (CSMA/CA) with basic
data transfer capabilities. Association with PAN coordinators is not yet
supported, nor the use of extended addressing. Interference is modeled as
AWGN but this is currently not thoroughly tested. The NetDevice Tx queue
is not limited, i.e., packets are never dropped due to queue becoming full.
They may be dropped due to excessive transmission retries or channel access
failure. </li>
<li> A new IPv6 routing protocol has been added: RIPng. This protocol is
an Interior Gateway Protocol and it is available in the Internet module. </li>
<li> A new LTE MAC downlink scheduling algorithm named Channel and QoS
Aware (CQA) Scheduler is provided by the new "ns3::CqaFfMacScheduler" object.
</li>
<li> Units may be attached to Time objects, to facilitate specific output
formats (see Time::As()) </li>
<li> FlowMonitor "SerializeToXml" functions are now directly available
from the helper. </li>
<li> Access to OLSR's HNA table has been enabled </li>
</ul>
<h2>Changes to existing API:</h2>
<ul>
<li> The SixLowPan model can now use uncompressed IPv6 headers. An option to
define the minimum compressed packet size has been added. </li>
<li> MinDistance wsa replaced by MinLoss in FriisPropagationLossModel, to
better handle conditions outside of the assumed far field region. </li>
<li> In the DSR model, the attribute DsrOptionRerrHeader::ErrorType" has
been removed. </li>
</ul>
<h2>Changes to build system:</h2>
<ul>
<li> Python 3.3 is now supported for Python bindings for ns-3. Python 3.3
support for API scanning is not supported. Python 3.2 is not supported.</li>
<li> Enable selection of high precision int64x64_t implementation
at configure time, for debugging purposes.</li>
<li> Optimized builds are now enabling signed overflow optimization
(-fstrict-overflow) and for gcc 4.8.2 and greater, also warning for cases
where an optimizization may occur due to compiler assumption that
overflow will not occur. </li>
</ul>
<h2>Changed behavior:</h2>
<ul>
<li> The Internet FlowMonitor can now track IPv6 packets. </li>
<li> Ipv6Extension::m_dropTrace has been removed. Ipv6L3Protocol::m_dropTrace
is now fired when appropriate. </li>
<li> IPv4 identification field value is now dependent on the protocol
field. </li>
<li> Point-to-point trace sources now contain PPP headers </li>
</ul>
<hr>
<h1>Changes from ns-3.18.1 to ns-3.19</h1>
@@ -146,6 +412,10 @@ us a note on ns-developers mailing list.</p>
value class that represents simulation time; the largest unit prior to
this addition was Second.
</li>
<li> SimpleNetDevice and SimpleChannel are not so simple anymore. SimpleNetDevice can be now a
Broadcast or PointToPoint NetDevice, it can have a limited bandwidth and it uses an output
queue.
</li>
</ul>
<h2>Changes to build system:</h2>
+2 -1
View File
@@ -5,7 +5,8 @@ all:
# free free to change this part to suit your requirements
configure:
./waf configure --enable-examples --enable-tests
#./waf configure --enable-examples --enable-tests
./waf configure -d optimized --enable-examples --disable-python --disable-tests
build:
./waf build
+6
View File
@@ -1,3 +1,9 @@
Note:
This is a custom and unsupported fork of NS-3 simulator (http://www.nsnam.org/).
**The code in this repository is frequently rebased on top of the latest ns-3-dev branch**
The Network Simulator, Version 3
--------------------------------
+377 -21
View File
@@ -10,7 +10,7 @@ Consult the file CHANGES.html for more detailed information about changed
API and behavior across ns-3 releases.
Release 3-dev
=============
============
Availability
------------
@@ -21,37 +21,365 @@ Supported platforms
New user-visible features
-------------------------
- Simplify output of Times in a specific unit; see Time::As ()
- Enable selection of high precision int64x64_t implementation
at configure time, for debugging purposes.
- A new LTE MAC downlink scheduling algorithm named Channel and QoS
Aware (CQA) Scheduler is provided by the new
``ns3::CqaFfMacScheduler`` object.
- SixLowPan model can now use uncompressed IPv6 headers. An option to
define the minimum compressed packet size has been added.
- FlowMonitor "SerializeToXml" functions are now directly available
from the Helper.
- Ipv6Extension::m_dropTrace has been removed. Ipv6L3Protocol::m_dropTrace
is now fired when appropriate.
- FlowMonitor does not track anymore multicast/broadcast packets, reflecting
its original design.
- A new IPv6 routing protocol has been added: RIPng. This protocol is
an Interior Gateway Protocol and it is available in the Internet module.
- FlowMonitor can now track IPv6 packets.
- (network) SimpleChannel allows per-NetDevice blacklists, in order to do hidden terminal testcases.
Bugs fixed
----------
- Bug 730 - Enabling fragmentation at run-time breaks simulation
- Bug 1249 - doxygen comments on device-level SetMobility ()
- Bug 1482 - mesh module was producing fatal error with ASCII and netanim traces
- Bug 1736 - default dot11EDCATableMSDULifetime
- Bug 1901 - mesh module producing malformed pcaps
- Bug 1929 - TcpL4Protocol::Send must indicate the source address to routing (if known)
- Bug 1982 - AODV and mesh modules use random variables before seeds can be set
- Bug 2058 - TCP window update can shrink left edge of window
- Bug 2063 - FdNetDevice::SendFrom assert does not account for headers correctly
- Bug 2082: Empirical RV fails if value provided in CDF function is negative
- Bug 2093 - MultiModelSpectrumChannel::GetDevice only works for 0-th index
- Bug 2096 - Wrong pcap information when MPDU aggregation is used
- Bug 2108 - Erroneous implementation in InterferenceHelper
- Bug 2119 - Fix memory leaks in FdNetDevice test due to non-executed events
- Bug 2124 - UdpSocketImpl::ShutdownRecv doesn't stop the Ipv[4,6]EndPointDemux
- Bug 2125 - subclasses must chain up to base class NotifyNewAggregate
- Bug 2126 - LrWpanNetDevice silently accepts no mobility on the node
- Bug 2127 - Scheduler benchmark utility works in first run only
- Bug 2130 - Allow SimpleChannel to simulate hidden terminals.
- Bug 2135 - TCP doesn't honor the socket's output interface
- Bug 2136 - The usage of tid in wifi and wave module shall be "if (tid > 7)" rather than "if (tid >= 7)"
- Bug 2132 - TCP RST packets were incorrectly formatted if no endpoints matched
- Bug 2138 - SimpleNetDevice could send overlapped packets
- Bug 2148 - Ipv6Interface::SetUp doesn't re-create the Link-Local addresses
- Bug 2153 - Incorrect power limits in wifi power control algorithms
- Bug 2154 - Incorrect power calculation in wifi power adaptation examples
- Bug 2156 - Duplicate packets when using two level aggregation
Known issues
------------
In general, known issues are tracked on the project tracker available
at http://www.nsnam.org/bugzilla/
Release 3.23
============
Availability
------------
This release is available from:
http://www.nsnam.org/release/ns-allinone-3.23.tar.bz2
Supported platforms
-------------------
This release has been tested on the following platforms:
- Ubuntu 15.04 (64 bit) with g++-4.9.2
- Fedora Core 21 (64 bit) with g++-4.9.2
- Ubuntu 14.04 (64 bit) with g++-4.8.2
- Ubuntu 12.04.4 (32/64 bit) with g++-4.6.3
- CentOS/RHEL 6.6 (64-bit) with g++-4.4.7
- OS X Yosemite 10.10.3 with Xcode 6.3.1 and Apple LLVM version 6.1.0
- FreeBSD 10.1-RELEASE (64 bit) with clang-3.4.1
New user-visible features
-------------------------
- (network) CalculateTxTime has been declared obsolete.
CalculateBytesTxTime and CalculateBitsTxTime are to be used instead.
The return value is a Time, instead of a double.
- (mobility) Classes added for converting geographic to cartesian coordinates.
- (spectrum) TvSpectrumTransmitter models added to create television
transmitter(s) that transmit PSD spectrums customized by attributes such
as modulation type, power, antenna type, channel frequency, etc.
- (wifi) Several model improvements have been made. Access points now
establish BSSBasicRateSet for control frame transmissions. PLCP header
and payload reception have been decoupled for improved PHY modeling
accuracy. RTS/CTS with A-MPDU is now fully supported, and 802.11n
stations now support two-level aggregation.
Bugs fixed
----------
- Bug 1757 - RLC AM not using NACK_SN
- Bug 1974 - CalculateTxTime should return a Time, not a double
- Bug 1982 - AODV and mesh use random variables before seed can be set
- Bug 2004 - Wrong timeout calculation for 802.11n in WifiMac
- Bug 2008 - (lr-wpan) Crash if ending rx while status change is in progress
- Bug 2025 - (lr-wpan) Changing the channel doesn't affect the Tx params
- Bug 2034 - (lr-wpan) CSMA-CA BackoffPeriod is too short
- Bug 2054 - TCP window update can shrink the Left Edge of the window
- Bug 2066 - A-MPDU reception should check for successful preamble
- Bug 2067 - TCP performance when advertised window exceeds sender buffer size
- Bug 2070 - Wrong report of Packets and Bytes stored in CoDeL
- Bug 2073 - NDisc cache entries update timer might be stuck in a loop
- Bug 2075 - A-MPDU using RTS/CTS behaves wrongly when MaxSsrc is reached
- Bug 2076 - TCP MinRTO Attribute is not actually used
- Bug 2077 - Icmpv6L4Protocol::HandleDestinationUnreachable must check the packet size, not its serialized size
- Bug 2079 - mcs variable in ht-wifi-network example is confusing
- Bug 2082 - Empirical RV fails if the value provided in the CDF member function is negative
- Bug 2083 - BridgeNetDevice may send corrupted packets
- Bug 2087 - Waf fails to build ns-3 if the path contains accented characters
- Bug 2090 - (rip-ng) Routes may be added twice on interface activation
- Bug 2093 - MultiModelSpectrumChannel::GetDevice only works for 0-th index
- Bug 2095 - (wimax) Wrong values in default-traces.h for 16 QAM 3/4
- Bug 2097 - ACKs should be sent using legacy rates and preambles in 802.11n
- Bug 2103 - Ipv[4,6]RoutingHelper::PrintRoutingTableAll[At,Every] hangs if a node doesn't have IP
Known issues
------------
In general, known issues are tracked on the project tracker available
at http://www.nsnam.org/bugzilla/
Release 3.22
============
Availability
------------
This release is available from:
http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
Supported platforms
-------------------
This release has been tested on the following platforms:
- Fedora Core 21 (64 bit) with g++-4.9.2
- Ubuntu 14.10 (32 bit) with g++-4.9.1
- Ubuntu 14.04 (64 bit) with g++-4.8.2
- Ubuntu 12.04.4 (32/64 bit) with g++-4.6.3
- CentOS/RHEL 6.6 (64-bit) with g++-4.4.7
- OS X Yosemite 10.10 with Xcode 6.1.1 and clang-600.0.56
- FreeBSD 10.1-RELEASE (64 bit) with clang-3.4.1
New user-visible features
-------------------------
- (wifi) Support for MPDU aggregation has been added to the wifi model,
as well as a number of related example programs.
- (wifi) Added two combined power and rate control mechanisms to the
wifi module. The new mechanisms, PARF and APARF, are the first in the
wifi module to jointly control transmission power and data rate. Two use
case examples (PowerAdaptationDistance and PowerAdaptationInterference)
and a test case have also been added.
- (lte) In previous releases of the LTE module, the bearer release
functionality was only partially supported. As an enhancement, a
complete release bearer procedure is now implemented, which can be
invoked by calling the new helper method
LteHelper::DeActivateDedicatedEpsBearer(). The related output can be
seen through the stats collected at different layers like PDCP, RLC,
MAC, PHY. To support this implementation, an example and test suite is
added within the LTE module examples and tests folder.
- (wave) Additional support has been added for WiFi-based vehicular networks,
including the channel-access coordination features of IEEE 1609.4 and a
comprehensive VANET routing example that includes a Basic Safety
Message (BSM) packet generator application and associated statistics
counters. Together, these allow users to evaluate the performance effects
in a VANET of varying transmission and channel properties (e.g., packet
rate, message size, transmit power, propagation loss model, impact of
routing protocol traffic, etc.).
- (internet) It is now possible to print the Neighbor Cache (ARP and NDISC)
by using the RoutingProtocolHelper
- (stats) A new TimeProbe class has been added to hook the data collection
framework to traced values emitting Time objects
- (documentation) the callback function signatures for all TraceSources
is documented in Doxygen
- (utils) print-introspected-doxygen.cc has had several enhancements;
use -h to read the usage message for details.
- (core) TracedValue and TracedCallback function signatures are now documented,
which required changing the TypeId::AddTraceSource API.
Bugs fixed
----------
- Bug 1405 - RttEstimator improvements
- Bug 1551 - NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
- Bug 1726 - WiFi Minstrel rate control algorithm doesn't save state
- Bug 1734 - TcpSocketBase produces spurious delayed ACKs
- Bug 1758 - Yans and Nist error rate models for 5/6 code rate 802.11n HT
- Bug 1770 - mesh test and example crash for 32-bit optimized builds
- Bug 1774 - compute signal power around channel, not across whole band, and fix LrWpanHelper to add a default PropagationDelayModel
- Bug 1791 - TCP Endpoint never deallocates when closing
- Bug 1801 - Setting Wi-Fi timing parameters through WifiMac attributes (documentation fix)
- Bug 1906 - 802.11n PHY configuration for 2.4GHz and 5GHz devices
- Bug 1957 - UdpSocketImpl is stuck after a Close()
- Bug 1968 - Missing supported 802.11n HT rates in the WifiPhy constructor
- Bug 1969 - Support short guard interval durations in 802.11n
- Bug 1970 - Missing NotifyAckTimeoutStartNow in MacLow::StartDataTxTimers
- Bug 1971 - 802.11n at 2.4 GHz should include a signal extension duration
- Bug 1972 - CommandLine duplicate argument handling: documentation updated.
- Bug 1983 - FlowMonitor returns containers copies instead of references.
- Bug 1986 - test result divergence for lte-frequency-reuse test
- Bug 1991 - PcapFileWrapper::CaptureSize attribute (snaplen) has no effect.
- Bug 1995 - avoid multiple definitions of PI
- Bug 1996 - RSRQ calculation: misleading variable names
- Bug 1997 - Fix PlotProbe() documentation and usage for GnuplotHelper and FileHelper
- Bug 2002 - Hardcoded include paths cause breakage
- Bug 2011 - Default Speed attribute in ConstantSpeedPropagationDelayModel
- Bug 2016 - Radvd do not consider the SendAdvert option and don't reply to RS
- Bug 2020 - Erroneous MCS field in 802.11n PCAP files
- Bug 2021 - Missing const qualifier in TopologyReader::Link::Attributes{Begin,End}()
- Bug 2026 - 802.11n Ness parameter badly set for data frames
- Bug 2027 - Calculation of HT training symbol duration does not accurately follow 802.11n standard
- Bug 2028 - remove unnecessary Time to double conversions in Wifi models
- Bug 2029 - new CQI generation approach fix
- Bug 2030 - provide default values for WifiTxVector
- Bug 2037 - HT capabilities may print bogus chars
- Bug 2038 - Stop method does not stop next wave in WaveformGenerator
- Bug 2042 - LTE a3-rsrp-handover-algorithm.cc: error: overflow in implicit constant conversion
- Bug 2043 - print-introspected-doxygen crashes when some modules are disabled
- Bug 2044 - Buffer::Iterator::ReadNtohU16() and ReadNtohU32() not implemented correctly
- Bug 2045 - Missing NS_OBJECT_ENSURE_REGISTERED in TcpTxBuffer and TcpRxBuffer
- Bug 2046 - set Block Ack timeout when SetStandard is called
- Bug 2047 - Ipv6EndPointDemux::Lookup may crash
- Bug 2049 - CQI feedback should always use the same calculation method
- Bug 2053 - In tcp-socket-base.cc, NotifyDataSent incorrectly called with retransmits
- Bug 2055 - TCP TxBuffer and RxBuffer traces don't work
- Nix-vector routing implementation now uses a lazy flush mechanism,
which dramatically speeds up the creation of large topologies.
Known issues
------------
In general, known issues are tracked on the project tracker available
at http://www.nsnam.org/bugzilla/
Release 3.21
============
Availability
------------
This release is available from:
http://www.nsnam.org/release/ns-allinone-3.21.tar.bz2
Supported platforms
-------------------
- Fedora Core 20 (32/64 bit) with g++-4.8.2
- Ubuntu 14.04 (32/64 bit) with g++-4.8.2
- Ubuntu 12.04.4 (64 bit) with g++-4.6.3
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
- CentOS/RHEL 6.5 (64-bit) with g++-4.4.7
- OS X Mavericks 10.9 with Xcode 5.1.1 and clang-503.0.40
- FreeBSD 9.2-RELEASE (64 bit) with clang-3.3
New user-visible features
-------------------------
- The LTE module now supports the transport of the S1-U, X2-U and X2-C
interfaces over emulated links via the new helper class EmuEpcHelper.
- CommandLine can now provide a shorthand argument name for any
Attribute.
- Implemented support for Frequency Reuse algorithms in LTE module, as the
outcome of GSoC 2014 project.
The project also includes several sub-features, such as:
- implementation of Downlink Power Control
- implementation of Uplink Power Control
- new DL-CQI generation approach, which increases throughput if FR algorithms
are used
- seven options of Frequency Reuse algorithms: LteFrNoOpAlgorithm,
LteFrHardAlgorithm, LteFrStrictAlgorithm, LteFrSoftAlgorithm,
LteFfrSoftAlgorithm, LteFfrEnhancedAlgorithm, LteFfrDistributedAlgorithm
- updated RadioEnvironmentMapHelper. Now RadioEnvironmentMap can be generated
for Data or Control channel and for specified RbId, what is helpful when
using FR algorithms
- Added a CoDel queue model. CoDel queues measure and control the queue
traversal delay. The ns-3 implementation is a port of the Linux
implementation.
- Added support for TCP timestamp and window scale options, and added
ability to trace the TCP slow start threshold value.
- SimpleNetDevice and SimpleChannel (used for adding basic link effects
for testing of higher-layer protocols) have been extended to support
the option of broadcast or PointToPoint link semantics. The bandwidth
and link delay can be constrained, and it uses an output queue.
- SimpleNetDevice and SimpleChannel can be installed in a node through
a new helper: SimpleNetDeviceHelper.
- Implemented new PacketSocketServer and PacketSocketClient applications.
The primary use is in tests, to avoid using the ones from the
application module that also bring in a dependency on the internet module.
Bugs fixed
----------
- Bug 1673 - Config::Set/Connect does not search for attributes in parent class
- Bug 1762 - UE stuck in IDLE_CONNECTING because RRC CONN REQ is not transmitted
- Bug 1811 - basic traffic generator for network module
- Bug 1824 - L4 protocol sockets should support BindToNetDevice over IPv6
- Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
- Bug 1851 - WifiRadioEnergyModel energy consumption values are taken from a 802.15.4 chip
- Bug 1854 - std::out_of_range Problem
- Bug 1858 - wireless examples not correctly recording packet reception
- Bug 1860 - TCP needs the Window Scale option
- Bug 1893 - issue in DoSchedUlTriggerReq with harq
- Bug 1911 - AODV cannot work on nodes with more than one netdevice
- Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet
- Bug 1930 - Use of invalid reference in OLSR RemoveLinkTuple
- Bug 1932 - NdiscCache entry is not failsafe on double neighbor probing.
- Bug 1937 - FlowMonitor fails to track multiplexed packets
- Bug 1942 - refactoring of lte-sinr-chunk-processor -> lte-chunk-processor
- Bug 1943 - Waveform generator signal duration calc error
- Bug 1951 - AODV does not update nexthop for 1-hop nodes
- Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple
- Bug 1960 - Wrong information on index range, about Node::GetDevice
- Bug 1961 - planetlab-tap-creator "variable set but not used"
- Bug 1963 - AODV can tag the same packet twice (and raise an assert)
- Bug 1964 - Integer overflow on UniformRandomVariable::GetInteger()
- Bug 1967 - LL Multicast is not compressed in the right way in IPHC
- Bug 1981 - PyViz shell not compatible with ipython >= 0.11
Known issues
------------
- Bug 1770 - The mesh module will crash if used for g++ version >= 4.8.1
in optimized mode, on a 32-bit Linux machine. Lowering the optimization
level to -O1 in this case can be used as a workaround.
Release 3.20
=============
Availability
------------
This release is available from:
http://www.nsnam.org/release/ns-allinone-3.20.tar.bz2
Supported platforms
-------------------
- Fedora Core 20 (32/64 bit) with g++-4.8.2
- Ubuntu 14.04 (32/64 bit) with g++-4.8.2
- Ubuntu 12.04.4 (64 bit) with g++-4.6.3
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
- CentOS/RHEL 6.5 (64-bit) with g++-4.4.7
- OS X Mavericks 10.9 with Xcode 5.1.1 and clang-503.0.40
- FreeBSD 9.2-RELEASE (64 bit) with clang-3.3
New user-visible features
-------------------------
- A new LrWpan model, providing initial support for IEEE 802.15.4 networks
- A new IPv6 routing protocol has been added: RIPng. This protocol is
an Interior Gateway Protocol and it is available in the Internet module.
- A new LTE MAC downlink scheduling algorithm named Channel and QoS Aware (CQA)
Scheduler is provided by the new ``ns3::CqaFfMacScheduler`` object.
- The Internet FlowMonitor can now track IPv6 packets.
- FlowMonitor no longer tracks multicast/broadcast packets, reflecting
its original design.
- FlowMonitor "SerializeToXml" functions are now directly available
from the helper.
- The SixLowPan model can now use uncompressed IPv6 headers. An option to
define the minimum compressed packet size has been added.
- Simplify output of Times in a specific unit; see Time::As ()
- Ipv6Extension::m_dropTrace has been removed. Ipv6L3Protocol::m_dropTrace
is now fired when appropriate.
- IPv4 identification field value is now dependent on the protocol field.
- Fixes to support Python >= 3.3 in ns3 Python bindings
- Enable selection of high precision int64x64_t implementation
at configure time, for debugging purposes.
Bugs fixed
----------
- Bug 1276 - optimize NistErrorRateModel
- Bug 1294 - New PeekU8 () and Read (Buffer::Iterator start, uint32_t size) methods in Buffer::Iterator
- Bug 1443 - MinDistance replaced by MinLoss in FriisPropagationLossModel, to
better handle conditions outside of the assumed far field region.
- Bug 1653 - Extension of CommandLine interface: restored operator << (CommandLine)
- Bug 1717 - Detect unsettable attributes
- Bug 1730 - no model library documentation for spectrum module
- Bug 1739 - The endpoint is not deallocated for UDP sockets
- Bug 1786 - os << int64x64_t prints un-normalized fractional values
- Bug 1787 - Runtime error when using AnimationInterface::EnablePacketMetadata() to fetch metadata of CSMA packet
- Bug 1792 - Parameter logger constructor
- Bug 1808 - FlowMon relies on IPv4's Identification field to trace packets
- Bug 1817 - IPv4 Identification field should consider protocol as well.
- Bug 1818 - FlowMonitor needs IPv6 support
- Bug 1820 - models library doc: make should not rm -rf figures
- Bug 1821 - Setting an interface to Down state will cause various asserts in IPv6
- Bug 1829 - Multiple TCP socket entries
- Bug 1837 - AODV crashes when using multiple interfaces
- Bug 1838 - FlowMonitorHelper must not be copied.
- Bug 1841 - FlowMonitor fails to install if IPv4 is not installed in the node
@@ -59,19 +387,47 @@ Bugs fixed
- Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
- Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
- Bug 1846 - IPv6 should send Destination Unreachable if no route is available
- Bug 1850 - TCP NewReno loss behavior
- Bug 1852 - cairo-wideint-private.h error cannot find definitions for fixed-width integral types
- Bug 1853 - NS_LOG_FUNCTION broken on OSX 10.9
- Bug 1855 - SixLowPanNetDevice is not correctly indexed
- Bug 1857 - Detect location of installed boost libraries
- Bug 1862 - NS_LOG="Time=*|prefix_time" causes stack overflow
- Bug 1868 - Optimized builds are sensitive to -fstrict-overflow
- Bug 1870 - Remove unnecessary AsInt functions
- Bug 1872 - Inside RREQ processing, in case of IP duplication, packet dropped instead of being forwarded
- Bug 1873 - Energy source checked to be aggregated to the node
- Bug 1874 - Ipv4L3Protocol::ProcessFragment: addressCombination and idProto identifiers not properly computed
- Bug 1876 - enable OLSR HNA table access
- Bug 1877 - constructors missing for PropagationLossModels
- Bug 1882 - int64x64 tests trigger valgrind bug
- Bug 1883 - IPv6 don't consider the prefix and network when choosing output address
- Bug 1885 - WifiSpectrumValue5MhzFactory::CreateRfFilter does not align with the used 5Mhz SpectrumModel
- Bug 1887 - Point-to-point traces should contain PPP headers
- Bug 1888 - COST231 propagation loss model: corrections
- Bug 1889 - PointToPointNetDevive: In some cases MacTxDrop trace is not called
- Bug 1889 - PointToPointNetDevice: In some cases MacTxDrop trace is not called
- Bug 1890 - UdpClientTrace: MPEG frame size is squeezed into (insufficient) 16 bit integer
- Bug 1891 - UdpSocketImpl::GetSockName doesn't return the IPv6 address
- Bug 1894 - CqaFfMacScheduler needs an update
- Bug 1895 - IP header Source Address changed while forwarding RREQ
- Bug 1900 - Avoid floating point differences across platforms in test outputs
- Bug 1903 - Namespace usage in olsr-state.cc/h
- Bug 1907 - Add IsSupportedMcs method in YansWifiPhy
- Bug 1912 - Avoid multiple Wifi MacTxMiddle instances
- Bug 1913 - Avoid crash in Wifi BlockAckManager::GetNextPacket()
- Bug 1915 - BRITE channel delay is rounded to an integer
- Bug 1916 - RandomWalk2dMobilityMode default "Bounds" attribute is not a rectangle
- Bug 1919 - Strip trailing semi-colons from mobility trace files
- Bug 1920 - Remove DSR attributes so file can be re-loaded by config-store
- Bug 1922 - WAVE GetSsid should not be fatal
- Bug 1923 - Setting Active Probing to false in Wifi Sta has no effect
- Bug 1924 - sensing radius and CCA
Known issues
------------
- Bug 1770 - The mesh module will crash if used for g++ version >= 4.8.1
in optimized mode, on a 32-bit Linux machine. Lowering the optimization
level to -O1 in this case can be used as a workaround.
Release 3.19
=============
+4 -6
View File
@@ -103,7 +103,7 @@ def main(argv):
module_customization.post_register_types(root_module)
# register Callback<...> type handlers
ns3modulegen_core_customizations.generate_callback_classes(root_module.after_forward_declarations,
ns3modulegen_core_customizations.register_callback_classes(root_module.after_forward_declarations,
callback_classes)
# -----------
@@ -114,20 +114,18 @@ def main(argv):
ns3modulegen_core_customizations.Object_customizations(root_module)
ns3modulegen_core_customizations.Attribute_customizations(root_module)
ns3modulegen_core_customizations.generate_callback_classes(root_module,
callback_classes)
# -----------
module_apidefs.register_functions(root_module)
if hasattr(module_customization, 'post_register_functions'):
module_customization.post_register_functions(root_module)
# -----------
root_module.generate(out)
if __name__ == '__main__':
import sys
main(sys.argv)
@@ -112,7 +112,73 @@ class CallbackImplProxyMethod(typehandlers.ReverseWrapperBase):
def generate_callback_classes(out, callbacks):
def register_callback_classes(out, callbacks):
for callback_impl_num, template_parameters in enumerate(callbacks):
cls_name = "ns3::Callback< %s >" % ', '.join(template_parameters)
#print >> sys.stderr, "***** trying to register callback: %r" % cls_name
class_name = "PythonCallbackImpl%i" % callback_impl_num
class PythonCallbackParameter(Parameter):
"Class handlers"
CTYPES = [cls_name]
print("***** registering callback handler: %r (%r)" % (ctypeparser.normalize_type_string(cls_name), cls_name), file=sys.stderr)
DIRECTIONS = [Parameter.DIRECTION_IN]
PYTHON_CALLBACK_IMPL_NAME = class_name
TEMPLATE_ARGS = template_parameters
DISABLED = False
def convert_python_to_c(self, wrapper):
"parses python args to get C++ value"
assert isinstance(wrapper, typehandlers.ForwardWrapperBase)
if self.DISABLED:
raise CodeGenerationError("wrapper could not be generated")
if self.default_value is None:
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name)
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name)
wrapper.before_call.write_error_check(
'!PyCallable_Check(%s)' % py_callback,
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
callback_impl = wrapper.declarations.declare_variable(
'ns3::Ptr<%s>' % self.PYTHON_CALLBACK_IMPL_NAME,
'%s_cb_impl' % self.name)
wrapper.before_call.write_code("%s = ns3::Create<%s> (%s);"
% (callback_impl, self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
wrapper.call_params.append(
'ns3::Callback<%s> (%s)' % (', '.join(self.TEMPLATE_ARGS), callback_impl))
else:
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name, 'NULL')
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name, optional=True)
value = wrapper.declarations.declare_variable(
'ns3::Callback<%s>' % ', '.join(self.TEMPLATE_ARGS),
self.name+'_value',
self.default_value)
wrapper.before_call.write_code("if (%s) {" % (py_callback,))
wrapper.before_call.indent()
wrapper.before_call.write_error_check(
'!PyCallable_Check(%s)' % py_callback,
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
wrapper.before_call.write_code("%s = ns3::Callback<%s> (ns3::Create<%s> (%s));"
% (value, ', '.join(self.TEMPLATE_ARGS),
self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
wrapper.before_call.unindent()
wrapper.before_call.write_code("}") # closes: if (py_callback) {
wrapper.call_params.append(value)
def convert_c_to_python(self, wrapper):
raise typehandlers.NotSupportedError("Reverse wrappers for ns3::Callback<...> types "
"(python using callbacks defined in C++) not implemented.")
def generate_callback_classes(module, callbacks):
out = module.after_forward_declarations
for callback_impl_num, template_parameters in enumerate(callbacks):
sink = MemoryCodeSink()
cls_name = "ns3::Callback< %s >" % ', '.join(template_parameters)
@@ -181,68 +247,23 @@ public:
Warning)
ok = False
if not ok:
try:
typehandlers.return_type_matcher.lookup(cls_name)[0].DISABLED = True
except typehandlers.TypeLookupError:
pass
try:
typehandlers.param_type_matcher.lookup(cls_name)[0].DISABLED = True
except typehandlers.TypeLookupError:
pass
continue
wrapper = CallbackImplProxyMethod(return_type, arguments)
wrapper.generate(sink, 'operator()', decl_modifiers=[])
sink.unindent()
sink.writeln('};\n')
print("Flushing to ", out, file=sys.stderr)
sink.flush_to(out)
class PythonCallbackParameter(Parameter):
"Class handlers"
CTYPES = [cls_name]
print("***** registering callback handler: %r" % ctypeparser.normalize_type_string(cls_name), file=sys.stderr)
DIRECTIONS = [Parameter.DIRECTION_IN]
PYTHON_CALLBACK_IMPL_NAME = class_name
TEMPLATE_ARGS = template_parameters
def convert_python_to_c(self, wrapper):
"parses python args to get C++ value"
assert isinstance(wrapper, typehandlers.ForwardWrapperBase)
if self.default_value is None:
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name)
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name)
wrapper.before_call.write_error_check(
'!PyCallable_Check(%s)' % py_callback,
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
callback_impl = wrapper.declarations.declare_variable(
'ns3::Ptr<%s>' % self.PYTHON_CALLBACK_IMPL_NAME,
'%s_cb_impl' % self.name)
wrapper.before_call.write_code("%s = ns3::Create<%s> (%s);"
% (callback_impl, self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
wrapper.call_params.append(
'ns3::Callback<%s> (%s)' % (', '.join(self.TEMPLATE_ARGS), callback_impl))
else:
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name, 'NULL')
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name, optional=True)
value = wrapper.declarations.declare_variable(
'ns3::Callback<%s>' % ', '.join(self.TEMPLATE_ARGS),
self.name+'_value',
self.default_value)
wrapper.before_call.write_code("if (%s) {" % (py_callback,))
wrapper.before_call.indent()
wrapper.before_call.write_error_check(
'!PyCallable_Check(%s)' % py_callback,
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
wrapper.before_call.write_code("%s = ns3::Callback<%s> (ns3::Create<%s> (%s));"
% (value, ', '.join(self.TEMPLATE_ARGS),
self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
wrapper.before_call.unindent()
wrapper.before_call.write_code("}") # closes: if (py_callback) {
wrapper.call_params.append(value)
def convert_c_to_python(self, wrapper):
raise typehandlers.NotSupportedError("Reverse wrappers for ns3::Callback<...> types "
"(python using callbacks defined in C++) not implemented.")
# def write_preamble(out):
@@ -374,7 +395,7 @@ def add_std_ofstream(module):
ofstream.add_constructor([Parameter.new("const char *", 'filename'),
Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")])
ofstream.add_method('close', None, [])
add_std_ios_openmode(module)
+36 -23
View File
@@ -12,8 +12,8 @@ from waflib.Errors import WafError
# feature = TaskGen.feature
# after = TaskGen.after
## https://launchpad.net/pybindgen/
REQUIRED_PYBINDGEN_VERSION = (0, 17, 0, 868)
# https://github.com/named-data-ndnSIM/pybindgen
REQUIRED_PYBINDGEN_VERSION = '0.17.0.post45+ng4806e4f'
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
RUN_ME=-3
@@ -163,17 +163,26 @@ def configure(conf):
"PyBindGen missing")
return
else:
out = subprocess.Popen([conf.env['PYTHON'][0], "-c",
"import pybindgen.version; "
"print('.'.join([str(x) for x in pybindgen.version.__version__]))"],
stdout=subprocess.PIPE).communicate()[0]
pybindgen_version_str = out.strip()
pybindgen_version = tuple([int(x) for x in pybindgen_version_str.split('.')])
conf.msg('Checking for pybindgen version', pybindgen_version_str)
def getVersion():
out = subprocess.Popen([conf.env['PYTHON'][0], "-c",
"try:\n"
" import pybindgen.version\n"
" print(pybindgen.__version__)\n"
"except:\n"
" pass"],
stdout=subprocess.PIPE).communicate()[0]
return out.strip()
pybindgen_version = getVersion()
if pybindgen_version == '': # version is not generated yet (e.g., cloned from git repo directly)
subprocess.Popen([conf.env['PYTHON'][0], "setup.py", "--version"],
cwd=conf.env['WITH_PYBINDGEN'],
stdout=subprocess.PIPE).communicate()[0]
pybindgen_version = getVersion()
conf.msg('Checking for pybindgen version', pybindgen_version)
if not (pybindgen_version == REQUIRED_PYBINDGEN_VERSION):
Logs.warn("pybindgen (found %s), (need %s)" %
(pybindgen_version_str,
'.'.join([str(x) for x in REQUIRED_PYBINDGEN_VERSION])))
Logs.warn("pybindgen (found %r), (need %r)" %
(pybindgen_version, REQUIRED_PYBINDGEN_VERSION))
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen version not correct and newer version could not be retrieved")
return
@@ -192,13 +201,11 @@ int main ()
''' % dict(type1=t1, type2=t2)
try:
ret = conf.run_c_code(code=test_program,
env=conf.env.derive(), compile_filename='test.cc',
features='cxx cprogram', execute=False)
ret = conf.check(compiler='cxx', fragment=test_program, features='cxx')
except Errors.ConfigurationError:
ret = 1
ret = False
conf.msg('Checking for types %s and %s equivalence' % (t1, t2), (ret and 'no' or 'yes'))
return not ret
return ret
uint64_is_long = test("uint64_t", "unsigned long")
uint64_is_long_long = test("uint64_t", "unsigned long long")
@@ -255,6 +262,8 @@ int main ()
"import pygccxml; print pygccxml.__version__"],
stdout=subprocess.PIPE).communicate()[0]
pygccxml_version_str = out.strip()
# Bug 2013: pygccxml versions > 1.0.0 prepend a 'v' to version number
pygccxml_version_str = pygccxml_version_str.lstrip('v')
pygccxml_version = tuple([int(x) for x in pygccxml_version_str.split('.')])
conf.msg('Checking for pygccxml version', pygccxml_version_str)
if not (pygccxml_version >= REQUIRED_PYGCCXML_VERSION):
@@ -265,7 +274,7 @@ int main ()
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
"pygccxml too old")
return
## Check gccxml version
try:
@@ -278,13 +287,17 @@ int main ()
"gccxml missing")
return
gccxml_version_line = os.popen(gccxml + " --version").readline().strip()
gccxml_version_line = os.popen(gccxml[0] + " --version").readline().strip()
m = re.match( "^GCC-XML version (\d\.\d(\.\d)?)$", gccxml_version_line)
gccxml_version = m.group(1)
gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9])
try:
gccxml_version = m.group(1)
gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9])
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 too old, need version >= 0.9; automatic scanning of API definitions will not be possible")
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")
return
@@ -409,7 +422,7 @@ class gen_ns3_compat_pymod_task(Task.Task):
"""Generates a 'ns3.py' compatibility module."""
before = 'cxx'
color = 'BLUE'
def run(self):
assert len(self.outputs) == 1
outfile = file(self.outputs[0].abspath(), "w")
+1497 -985
View File
File diff suppressed because it is too large. Load diff
+115 -49
View File
@@ -5,7 +5,8 @@
me=$(basename $0)
DIR="$(dirname $0)"
ROOT="$(hg root)"
# Trick to get the absolute path, since doxygen prefixes errors that way
ROOT=$(cd "$DIR/.."; pwd)
# Known log files
STANDARDLOGFILE=doxygen.log
@@ -13,6 +14,9 @@ WARNINGSLOGFILE=doxygen.warnings.log
# Default choice: generate it
LOG="$DIR/$WARNINGSLOGFILE"
# Verbose log
VERBLOG="$DIR/doxygen.verbose.log"
# Options ------------------------------
#
@@ -21,51 +25,96 @@ function usage
{
cat <<-EOF
Usage: $me [-eth] [-f <log-file> | -l | -s] [-m <module> | -F <regex>]
Usage: $me [-eithv] [-f <log-file> | -l | -s] [-m <module> | -F <regex>]
Run doxygen to generate all errors; report error counts
by module and file.
The default behavior is to modify doxygen.conf temporarily to
report all undocumented elements, and to reduce the run time.
The output of this special run is kept in doc/$WARNINGSLOGFILE.
The -e and -t options exclude examples and test directories
from the counts. The -m option only includes a specific module.
The -F option only includes files (or warnings) matching the <regex>.
The -m and -F options append the relevant warnings after the
numerical report. These can be used in any combination.
-i Skip build and print-introspected-doxygen.
-f Skip doxygen run; use existing <log-file>.
-s Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
-l Skip doxygen run; use the normal doxygen log doc/$STANDARDLOGFILE
-e Filter out warnings from */examples/*
-t Filter out warnings from */test/*
-m Only include files matching src/<module>
-F Only include files matching the <regex>
-v Show the doxygen run output
-h Print this usage message
The default behavior is to modify doxygen.conf temporarily to
report all undocumented elements, and to reduce the run time.
The output of this special run is kept in doc/$WARNINGSLOGFILE.
To further reduce the run time, the -i option also skips
print-introspected-doxygen, so waf doesn\'t have to compile
any modified files at all.
The -f, -l, and -s options skip the doxygen run altogether.
The first two use a specified or the standard log file;
the -s option uses the warnings log from a prior run.
Only the first of -f <log-file>, -s, or -l will have effect.
-f Skip doxygen run; use existing <log-file>.
-s Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
-l Skip doxygen run; use the normal doxygen log doc/$STANDARDLOGFILE
-h Print this usage message
The -e and -t options exclude examples and test directories
from the counts. The -m option only includes a specific module.
The -F option only includes files (or warnings) matching the <regex>.
The -m and -F options append the relevant warnings after the
numerical report. These can be used in any combination.
EOF
exit 1
}
# Messaging ----------------------------
#
# Arg -v Verbosity level
verbosity=0
function verbose
{
if [ "$1" == "-n" ]; then
echo -n "$2"
elif [ $verbosity -eq 1 ]; then
echo "$1 $2"
else
echo "$2"
fi
}
# Use file handle 6 for verbose output
rm -f $VERBLOG
exec 6>$VERBLOG
function status_report
{
local status="$1"
local long_msg="$2"
if [ $status -eq 0 ]; then
verbose "$long_msg " "done."
rm -f $VERBLOG
else
verbose "$long_msg " "FAILED. Details:"
cat $VERBLOG
rm -f $VERBLOG
exit 1
fi
}
# Argument processing ------------------
#
# -f argument
usefilearg=0
logfilearg=
use_filearg=0
logfile_arg=
# -l
usestandard=0
use_standard=0
# skip doxygen run; using existing log file
SKIPDOXY=0
skip_doxy=0
# skip print-introspected-doxygen, avoiding a build
skip_intro=0
# Filtering flags
filter_examples=0
@@ -73,11 +122,16 @@ filter_test=0
filter_module=""
filter_regex=""
while getopts :etm:F:lF:sh option ; do
echo
echo "$me:"
while getopts :eitm:F:lF:svh option ; do
case $option in
(e) filter_examples=1 ;;
(i) skip_intro=1 ;;
(t) filter_test=1 ;;
@@ -85,26 +139,33 @@ while getopts :etm:F:lF:sh option ; do
(F) filter_regex="$OPTARG" ;;
(l) usestandard=1 ;;
(l) use_standard=1 ;;
(f) usefilearg=1
logfilearg="$OPTARG"
(f) use_filearg=1
logfile_arg="$OPTARG"
;;
(s) usefilearg=1
logfilearg="$DIR/$WARNINGSLOGFILE"
(s) use_filearg=1
logfile_arg="$DIR/$WARNINGSLOGFILE"
;;
(v) verbosity=1
exec 6>&1
;;
(h) usage ;;
(:) echo "$me: Missing argument to -$OPTARG" ; usage ;;
(\?) echo "$me: Invalid option: -$OPTARG" ; usage ;;
esac
done
function checklogfile
{
if [ -e "$1" ] ; then
SKIPDOXY=1
skip_doxy=1
LOG="$1"
else
echo "$me: log file $1 does not exist."
@@ -113,22 +174,28 @@ function checklogfile
}
# Which log file
if [[ $usefilearg -eq 1 && "${logfilearg:-}" != "" ]] ; then
checklogfile "$logfilearg"
elif [ $usestandard -eq 1 ]; then
if [[ $use_filearg -eq 1 && "${logfile_arg:-}" != "" ]] ; then
checklogfile "$logfile_arg"
elif [ $use_standard -eq 1 ]; then
checklogfile "$DIR/$STANDARDLOGFILE"
fi
# Run doxygen -------------------------
#
if [ $SKIPDOXY -eq 1 ]; then
if [ $skip_doxy -eq 1 ]; then
echo
echo "Skipping doxygen run, using existing log file $LOG"
else
# Run introspection, which may require a build
(cd "$ROOT" && ./waf --run print-introspected-doxygen >doc/introspected-doxygen.h)
if [ $skip_intro -eq 1 ]; then
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 )
status_report $? "./waf build"
fi
# Modify doxygen.conf to generate all the warnings
# (We also suppress dot graphs, so shorten the run time.)
@@ -137,20 +204,14 @@ else
sed -i.bak -E '/^EXTRACT_ALL |^HAVE_DOT |^WARNINGS /s/YES/no/' $conf
echo
echo -n "Rebuilding doxygen docs with full errors..."
(cd "$ROOT" && ./waf --doxygen >/dev/null 2>&1)
verbose -n "Rebuilding doxygen (v$(doxygen --version)) docs with full errors..."
(cd "$ROOT" && ./waf --doxygen-no-build >&6 2>&6 )
status=$?
rm -f $conf
mv -f $conf.bak $conf
if [ $status -eq 0 ]; then
echo "Done."
else
echo "FAILED."
exit 1
fi
status_report $status "Doxygen run"
cp -f "$DIR/$STANDARDLOGFILE" "$DIR/$WARNINGSLOGFILE"
@@ -162,7 +223,7 @@ fi
# Filter regular expression for -m and -F
filter_inRE=""
if [ "$filter_module" != "" ] ; then
filter_inRE="src/$filter_module"
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}src/$filter_module"
fi
if [ "$filter_regex" != "" ] ; then
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_regex"
@@ -171,7 +232,7 @@ fi
# Filter regular expression for -e and -t
filter_outRE=""
if [ $filter_examples -eq 1 ]; then
filter_outRE="/examples/"
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/examples/"
fi
if [ $filter_test -eq 1 ]; then
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/test/"
@@ -199,9 +260,14 @@ function filter_log
flog=$( echo "$flog" | grep -v "$filter_outRE" )
fi
flog=$( \
echo "$flog" | \
sort -t ':' -k1,1 -k2,2n | \
uniq \
)
echo "$flog"
}
# Analyze the log ----------------------
#
@@ -266,9 +332,9 @@ filecount=$( \
# Filtered in warnings
filterin=
if [ "${filter_inRE:-}" != "" ] ; then
filterin=$( \
filter_log | \
sed "s|$ROOT/||g" \
filterin=$( \
filter_log | \
sed "s|$ROOT/||g" \
)
fi
+1 -2
View File
@@ -13,8 +13,7 @@
*
* \section install-sec Building the Documentation
*
* ns-3 requires Doxygen version 1.5.4 or greater to fully build all items,
* although earlier versions of Doxygen will mostly work.
* ns-3 requires Doxygen version 1.8.3.1 or greater.
*
* Type "./waf --doxygen" or "./waf --doxygen-no-build" to build the
* documentation. The doc/ directory contains
+16 -7
View File
@@ -90,13 +90,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
RESCALE = ../../utils/rescale-pdf.sh
%.eps : %.dia; $(DIA) -t eps $< -e $@
%.png : %.dia; $(DIA) -t png $< -e $@
%.png : %.eps; $(CONVERT) $< $@
%.pdf : %.eps;
$(EPSTOPDF) $< -o=$@
if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
%.eps : %.dia
@echo dia $(notdir $<)
@$(DIA) -t eps $< -e $@ >/dev/null
%.png : %.dia
@echo dia $(notdir $<)
@$(DIA) -t png $< -e $@ >/dev/null
%.png : %.eps
@echo convert $(notdir $<)
@$(CONVERT) $< $@ >/dev/null
%.pdf : %.eps
@echo epstopdf $(notdir $<)
@$(EPSTOPDF) $< -o=$@ >/dev/null
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
# You can set these variables from the command line.
SPHINXOPTS =
@@ -135,7 +144,7 @@ help:
copy-sources: $(SOURCES)
@rm -rf $(SOURCETEMP)
@mkdir -p $(SOURCETEMP)
@mkdir -p $(FIGURES)
@mkdir -p $(FIGURES)
@cp -r $(SOURCES) $(SOURCETEMP)
@cp -r $(SOURCEFIGS) $(FIGURES)
File diff suppressed because it is too large. Load diff
+151 -73
View File
@@ -38,7 +38,8 @@ Documenting with Sphinx
We use Sphinx_ to generate expository chapters describing
the design and usage of each module. Right now you are reading the
:doc:`Documentation <documentation>` Chapter.
The `Show Source <_sources/documentation.txt>`_ link in the sidebar
If you are reading the html version, the
`Show Source <_sources/documentation.txt>`_ link in the sidebar
will show you the reStructuredText source for this chapter.
Adding New Chapters
@@ -59,7 +60,7 @@ top-level document for the module. The ``src/create-module.py`` script
will create this file for you.
Some models require several ``.rst`` files, and figures; these should
all go in the ``src/foo/doc/`` directory. The docs are actually build
all go in the ``src/foo/doc/`` directory. The docs are actually built
by a Sphinx Makefile. For especially involved
documentation, it may be helpful to have a local ``Makefile``
in the ``src/foo/doc/`` directory to
@@ -137,7 +138,7 @@ To build just the Models documentation:
.. sourcecode:: bash
$ make -C doc/models
$ make -C doc/models html
To see the generated documentation point your browser at
``doc/models/build/html``.
@@ -260,7 +261,7 @@ 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 imlementing each function.
* 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
@@ -273,6 +274,7 @@ for every class
* 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,
@@ -300,8 +302,11 @@ The preferred style for Doxygen comments is the JavaDoc style::
* \note Note any limitations or gotchas.
*
* (For functions with arguments or return valued:)
* \param foo Brief noun phrase describing this argument.
* \param bar Note Sentence case, and terminating period.
* \param [in] foo Brief noun phrase describing this argument. Note
* that we indicate if the argument is input,
* output, or both.
* \param [in,out] bar Note Sentence case, and terminating period.
* \param [in] baz Indicate boolean values with \c true or \c false.
* \return Brief noun phrase describing the value.
*
* \internal
@@ -310,7 +315,7 @@ The preferred style for Doxygen comments is the JavaDoc style::
* Understanding this material shouldn't be necessary to using
* the class or method.
*/
class Example
void ExampleFunction (const int foo, double & bar, const bool baz);
In this style the Doxygen comment block begins with two \`*' characters:
``/**``, and precedes the item being documented.
@@ -368,91 +373,100 @@ Building the Doxygen documentation is pretty simple:
$ ./waf doxygen
This builds using the default configuration, which generates documentation
sections for *all* items, even if they do not have explicit comment
documentation blocks. This has the effect of suppressing warnings for
undocumented items, but makes sure everything appears in the generated
output.
This builds using the default configuration, which generates
documentation sections for *all* items, even if they do not have
explicit comment documentation blocks. This has the effect of
suppressing warnings for undocumented items, but makes sure everything
appears in the generated output, which is usually what you want for
general use. Note that we generate documentation even for modules
which are disabled, to make it easier to see all the features
available in |ns3|.
When writing documentation, it's often more useful to see which items
are generating warnings, typically about missing documentation.
To see the full warnings list, use the ``doc/doxygen.warnings.report.sh``
are generating warnings, typically about missing documentation. To
see the full warnings list, use the ``doc/doxygen.warnings.report.sh``
script:
.. sourcecode:: bash
$ doc/doxygen.warnings.report.sh
Waf: Entering directory `build'
...
Waf: Leaving directory `build'
'build' finished successfully (3m24.094s)
Rebuilding doxygen docs with full errors...Done.
$ doc/doxygen.warnings.report.sh
doxygen.warnings.report.sh:
Building and running print-introspected-doxygen...done.
Rebuilding doxygen (v1.8.10) docs with full errors...done.
Report of Doxygen warnings
----------------------------------------
Report of Doxygen warnings
----------------------------------------
(All counts are lower bounds.)
(All counts are lower bounds.)
Warnings by module/directory:
Warnings by module/directory:
Count Directory
----- ----------------------------------
3844 src/lte/model
1718 src/wimax/model
1423 src/core/model
....
138 additional undocumented parameters.
----------------------------------------
15765 total warnings
126 directories with warnings
Count Directory
----- ----------------------------------
3414 src/lte/model
1532 src/wimax/model
825 src/lte/test
....
1 src/applications/test
97 additional undocumented parameters.
----------------------------------------
12460 total warnings
100 directories with warnings
Warnings by file (alphabetical)
Warnings by file (alphabetical)
Count File
----- ----------------------------------
17 doc/introspected-doxygen.h
15 examples/routing/manet-routing-compare.cc
26 examples/stats/wifi-example-apps.h
....
----------------------------------------
967 files with warnings
Count File
----- ----------------------------------
15 examples/routing/manet-routing-compare.cc
26 examples/stats/wifi-example-apps.h
12 examples/tutorial/fifth.cc
....
17 utils/python-unit-tests.py
----------------------------------------
771 files with warnings
Warnings by file (numerical)
Warnings by file (numerical)
Count File
----- ----------------------------------
374 src/lte/model/lte-asn1-header.h
280 src/lte/model/lte-rrc-sap.h
262 src/lte/model/lte-rrc-header.h
....
----------------------------------------
967 files with warnings
Count File
----- ----------------------------------
273 src/lte/model/lte-rrc-sap.h
272 src/core/model/simulator.h
221 src/netanim/model/animation-interface.h
....
1 src/wimax/model/ul-job.cc
----------------------------------------
771 files with warnings
Doxygen Warnings Summary
----------------------------------------
126 directories
967 files
15765 warnings
Doxygen Warnings Summary
----------------------------------------
100 directories
771 files
12460 warnings
The script modifies the configuration to show all warnings, and
to shorten the run time. As you can see, at this writing we have
*a lot* of undocumented items. The report summarizes warnings
by module ``src/*/*``, and by file, in alphabetically and numerical
order.
(This snippet has *a lot* of lines suppressed!)
The script has a few options to pare things down and make this more
The script modifies the configuration to show all warnings, and to
shorten the run time. (It shortens the run time primarily by
disabling creation of diagrams, such as call trees, and doesn't
generate documentation for undocumented items, in order to trigger the
warnings.) As you can see, at this writing we have *a lot* of
undocumented items. The report summarizes warnings by module
``src/*/*``, and by file, in alphabetically and numerical order.
The script has a few options to pare things down and make the output more
manageable. For help, use the ``-h`` option. Having run it once
to do the Doxygen build and generate the full warnings log,
you can reprocess the log file with various "filters,"
without having to do the full Doxygen build by,
again using the ``-s`` option. You can exclude warnings
without having to do the full Doxygen build again by
using the ``-s`` option. You can exclude warnings
from ``*/examples/*`` files (``-e`` option), and/or ``*/test/*`` files
(``-t``).
(``-t``). Just to be clear, all of the filter options do the complete
fast doxygen build; they just filter doxygen log and warnings output.
Perhaps the most useful option when writing documentation comments
is ``-m <module>``, which will limit the report to just files matching
@@ -476,7 +490,7 @@ urgent in a single module:
src/mesh/helper/dot11s/dot11s-installer.h:72: warning: Member m_root (variable) of class ns3::Dot11sStack is not documented.
src/mesh/helper/dot11s/dot11s-installer.h:35: warning: return type of member ns3::Dot11sStack::GetTypeId is not documented
src/mesh/helper/dot11s/dot11s-installer.h:56: warning: return type of member ns3::Dot11sStack::InstallStack is not documented
src/mesh/helper/flame/flame-installer.h:40: warning: Member GetTypeId() (function) of class ns3::FlameStack is not documented.
src/mesh/helper/flame/lfame-installer.h:40: warning: Member GetTypeId() (function) of class ns3::FlameStack is not documented.
src/mesh/helper/flame/flame-installer.h:60: warning: return type of member ns3::FlameStack::InstallStack is not documented
src/mesh/helper/mesh-helper.h:213: warning: Member m_nInterfaces (variable) of class ns3::MeshHelper is not documented.
src/mesh/helper/mesh-helper.h:214: warning: Member m_spreadChannelPolicy (variable) of class ns3::MeshHelper is not documented.
@@ -486,6 +500,13 @@ urgent in a single module:
src/mesh/helper/mesh-helper.h:119: warning: parameters of member ns3::MeshHelper::SetStandard are not (all) documented
Finally, note that undocumented items (classes, methods, functions,
typedefs, *etc.* won't produce documentation when you build with
``doxygen.warnings.report.sh``, and only the outermost item
will produce a warning. As a result, if you don't see documentation
for a class method in the generated documentation, the class itself
probably needs documentation.
Now it's just a matter of understanding the code, and writing some
docs!
@@ -508,28 +529,85 @@ usage for |ns3|.
/**
* \defgroup foo Foo protocol.
* Implemenation of the Foo protocol.
*/
Mark each associated class as belonging to the group::
The symbol ``foo`` is how other items can add themselves to this group.
The string following that will be the title for the group. Any futher
text will be the detailed description for the group page.
* Document each file, assigning it to the relevant group. In a header file::
/**
* \file
* \ingroup foo
* Class Foo declaration.
*/
or in the corresponding ``.cc`` file::
/**
* \file
* \ingroup foo
* Class FooBar implementation.
*/
* Mark each associated class as belonging to the group::
/**
* \ingroup foo
*
* Foo packet type.
* FooBar packet type.
*/
class Foo
class FooBar
* Did you know ``typedefs`` can have formal arguments? This enables
documentation of function pointer signatures::
/**
* Bar callback function signature.
*
* \param ale The size of a pint of ale, in Imperial ounces.
*/
typedef void (* BarCallback)(const int ale);
* Copy the ``Attribute`` help strings from the ``GetTypeId`` method to use
as the brief descriptions of associated members.
* ``\bugid{298}`` will create a link to bug 298 in our Bugzilla.
* ``\pname{foo}`` in a description will format ``foo``
as a ``\param foo`` parameter, making it clear that you
* ``\p foo`` in a description will format ``foo``
the same as the ``\param foo`` parameter, making it clear that you
are referring to an actual argument.
* ``\RFC{301}`` will create a link to RFC 301.
* Document the direction of function arguments with ``\param [in]``, *etc*.
The allowed values of the direction token are ``[in]``, ``[out]``, and
``[in,out]`` (note the explicit square brackets), as discussed in the
Doxygen docs for ``\param``.
* Document template arguments with ``\tparam``, just as you use ``\param``
for function arguments.
* For template arguments, indicate if they will be deduced or must be given
explicitly::
/**
* A templated function.
* \tparam T \explicit The return type.
* \tparam U \deduced The argument type.
* \param [in] a The argument.
*/
template <typename T, typename U> T Function (U a);
* Use ``\tparam U \deduced`` because the type ``U`` can be deduced at
the site where the template is invoked. Basically deduction can only
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.
* ``\internal`` should be used only to set off a discussion of implementation
details, not to mark ``private`` functions (they are already marked,
as ``private``!)
+9 -2
View File
@@ -10,8 +10,8 @@ available in five forms:
* Tutorial, Manual *(this document)*, and Model Library for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
* `ns-3 wiki <http://www.nsnam.org/wiki/Main_Page>`_
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
``doc/manual`` directory of ns-3's source code.
Contents
--------
.. toctree::
:maxdepth: 2
@@ -34,3 +34,10 @@ This document is written in `reStructuredText <http://docutils.sourceforge.net/r
python
tests
support
Source
------
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
``doc/manual`` directory of ns-3's source code.
+3 -3
View File
@@ -320,7 +320,7 @@ How to add logging to your code
Adding logging to your code is very simple:
1. Invoke the ``NS_LOG_COMPONENT_DEFINE (...);`` macro
outside of ``namespace ns3``.
inside of ``namespace ns3``.
Create a unique string identifier (usually based on the name of the file
and/or class defined within the file) and register it with a macro call
@@ -328,9 +328,9 @@ Adding logging to your code is very simple:
::
NS_LOG_COMPONENT_DEFINE ("Ipv4L3Protocol");
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("Ipv4L3Protocol");
...
This registers ``Ipv4L3Protocol`` as a log component.
+3
View File
@@ -341,6 +341,7 @@ file.::
{
static TypeId tid = TypeId ("ns3::ErrorModel")
.SetParent<Object> ()
.SetGroupName ("Network")
;
return tid;
}
@@ -359,6 +360,7 @@ file.::
{
static TypeId tid = TypeId ("ns3::RateErrorModel")
.SetParent<ErrorModel> ()
.SetGroupName ("Network")
.AddConstructor<RateErrorModel> ()
;
return tid;
@@ -556,6 +558,7 @@ and setting the Parent to ErrorModel::
{
static TypeId tid = TypeId ("ns3::RateErrorModel")
.SetParent<ErrorModel> ()
.SetGroupName ("Network")
.AddConstructor<RateErrorModel> ()
...
+204 -178
View File
@@ -11,14 +11,15 @@ used with existing |ns3| modules and by other researchers.
This chapter walks you through the steps necessary to add a new module
to |ns3|.
Step 1 - Familiarize yourself with the module layout
****************************************************
.. _Step-0:
Step 0 - Module Layout
**********************
All modules can be found in the ``src`` directory. Each module can be
found in a directory that has the same name as the module. For
example, the spectrum module can be found here: ::
src/spectrum
example, the ``spectrum`` module can be found here: ``src/spectrum``.
We'll be quoting from the ``spectrum`` module for illustration.
A prototypical module has the following directory structure and
required files:
@@ -26,129 +27,164 @@ required files:
.. sourcecode:: text
src/
module-name/
bindings/
doc/
examples/
wscript
helper/
model/
test/
examples-to-run.py
wscript
module-name/
bindings/
doc/
examples/
wscript
helper/
model/
test/
examples-to-run.py
wscript
Not all directories will be present in each module.
Step 2 - Create your new module based on the template module
************************************************************
Step 1 - Create a Module Skeleton
*********************************
A python program is provided in the source directory that will create a skeleton for a new module
.. sourcecode:: bash
$ src/create-module.py
For the purposes of this discussion we will assume that your new module is called "new-module". From the ``src`` directory, do the following to create the new module:
A python program is provided in the source directory that
will create a skeleton for a new module. For the purposes
of this discussion we will assume that your new module
is called ``new-module``. From the ``src`` directory, do the following
to create the new module:
.. sourcecode:: bash
$ ./create-module.py new-module
Next, cd into ``new-module``; you will find this directory layout:
Next, ``cd`` into ``new-module``; you will find this directory layout:
.. sourcecode:: text
$ examples helper model test wscript
$ cd new-module
$ ls
doc examples helper model test wscript
We next walk through how to customize this module. All |ns3| modules
depend on the 'core' module and usually on other modules. This
dependency is specified in the wscript file.
Let's assume that 'new-module' depends on the internet,
mobility, and aodv modules. Then the call to the function that will
create this module should look like this before editing:
In more detail, the ``create-module.py`` script will create the
directories as well as initial skeleton ``wscript``, ``.h``, ``.cc``
and ``.rst`` files. The complete module with skeleton files looks like this:
.. sourcecode:: text
src/
new-module/
doc/
new-module.rst
examples/
new-module-example.cc
wscript
helper/
new-module-helper.cc
new-module-helper.h
model/
new-module.cc
new-module.h
test/
new-module-test-suite.cc
wscript
(If required the ``bindings/`` directory listed in
:ref:`Step-0 <Step-0>` will be created automatically during
the build.)
We next walk through how to customize this module. Informing ``waf``
about the files which make up your module is done by editing the two
``wscript`` files. We will walk through the main steps in this chapter.
All |ns3| modules depend on the ``core`` module and usually on
other modules. This dependency is specified in the ``wscript`` file
(at the top level of the module, not the separate ``wscript`` file
in the ``examples`` directory!). In the skeleton ``wscript``
the call that will declare your new module to ``waf`` will look
like this (before editing):
.. sourcecode:: python
def build(bld):
module = bld.create_ns3_module('new-module', ['core'])
and after editing:
Let's assume that ``new-module`` depends on the ``internet``,
``mobility``, and ``aodv`` modules. After editing it the ``wscript`` file
should look like:
.. sourcecode:: python
def build(bld):
module = bld.create_ns3_module('new-module', ['internet', 'mobility', 'aodv'])
Your module will most likely have model source files. Initial skeletons (which will compile successfully) are created in ``model/new-module.cc`` and ``model/new-module.h``.
Note that only first level module dependencies should be listed, which
is why we removed ``core``; the ``internet`` module in turn depends on
``core``.
If your module will have helper source files, then they will go into the helper/ directory; again, initial skeletons are created in that directory.
Your module will most likely have model source files. Initial skeletons
(which will compile successfully) are created in ``model/new-module.cc``
and ``model/new-module.h``.
Finally, it is good practice to write tests. A skeleton test suite and test case is created in the test/ directory. The below constructor specifies that it will be a unit test named 'new-module': ::
If your module will have helper source files, then they will go into
the ``helper/`` directory; again, initial skeletons are created
in that directory.
New-moduleTestSuite::New-moduleTestSuite ()
Finally, it is good practice to write tests and examples. These will
almost certainly be required for new modules to be accepted into
the official |ns3| source tree. A skeleton
test suite and test case is created in the ``test/`` directory.
The skeleton test suite will contain the below constructor,
which declares a new unit test named ``new-module``,
with a single test case consisting of the class ``NewModuleTestCase1``::
NewModuleTestSuite::NewModuleTestSuite ()
: TestSuite ("new-module", UNIT)
{
AddTestCase (new New-moduleTestCase1);
AddTestCase (new NewModuleTestCase1);
}
Step 3 - Adding to your module's source files
*********************************************
Step 3 - Declare Source Files
*****************************
If your new module has model and/or helper source files, then they
must be specified in your
The public header and source code files for your new module
should be specified in the ``wscript`` file by modifying it with
your text editor.
.. sourcecode:: text
src/new-module/wscript
file by modifying it with your text editor.
As an example, the source files for the spectrum module are specified
in
.. sourcecode:: text
src/spectrum/wscript
with the following list of source files:
As an example, after declaring the ``spectrum`` module,
the ``src/spectrum/wscript`` specifies the source code files
with the following list:
.. sourcecode:: python
module.source = [
'model/spectrum-model.cc',
'model/spectrum-value.cc',
def build(bld):
module = bld.create_ns3_module('spectrum', ['internet', 'propagation', 'antenna', 'applications'])
module.source = [
'model/spectrum-model.cc',
'model/spectrum-value.cc',
.
.
.
'model/microwave-oven-spectrum-value-helper.cc',
'helper/spectrum-helper.cc',
'helper/adhoc-aloha-noack-ideal-phy-helper.cc',
'helper/waveform-generator-helper.cc',
'helper/spectrum-analyzer-helper.cc',
]
'model/microwave-oven-spectrum-value-helper.cc',
'helper/spectrum-helper.cc',
'helper/adhoc-aloha-noack-ideal-phy-helper.cc',
'helper/waveform-generator-helper.cc',
'helper/spectrum-analyzer-helper.cc',
]
Step 4 - Specify your module's header files
*******************************************
The objects resulting from compiling these sources will be assembled
into a link library, which will be linked to any programs relying on this
module.
If your new module has model and/or helper header files, then they
must be specified in your
But how do such programs learn the public API of our new module? Read on!
.. sourcecode:: text
Step 4 - Declare Public Header Files
************************************
src/new-module/wscript
The header files defining the public API of your model and helpers
also should be specified in the ``wscript`` file.
file by modifying it with your text editor.
As an example, the header files for the spectrum module are specified
in
.. sourcecode:: text
src/spectrum/wscript
with the following function call, module name, and list of header
files. Note that the argument for the function new_task_gen() tells
waf to install this module's headers with the other |ns3| headers:
Continuing with the ``spectrum`` model illustration,
the public header files are specified with the following stanza.
(Note that the argument to the ``bld`` function tells
``waf`` to install this module's headers with the other |ns3| headers):
.. sourcecode:: python
@@ -169,24 +205,29 @@ waf to install this module's headers with the other |ns3| headers:
'helper/spectrum-analyzer-helper.h',
]
Step 5 - Specify your module's tests
************************************
Headers made public in this way will be accessible to users of your model
with include statements like
.. sourcecode:: cpp
#include "ns3/spectrum-model.h"
Headers used strictly internally in your implementation should not
be included here. They are still accessible to your implemenation by
include statements like
.. sourcecode:: cpp
#include "my-module-implementation.h"
Step 5 - Declare Tests
**********************
If your new module has tests, then they must be specified in your
``wscript`` file by modifying it with your text editor.
.. sourcecode:: text
src/new-module/wscript
file by modifying it with your text editor.
As an example, the tests for the spectrum module are specified in
.. sourcecode:: text
src/spectrum/wscript
with the following function call and list of test suites:
The ``spectrum`` model tests are specified with the following stanza:
.. sourcecode:: python
@@ -197,62 +238,62 @@ with the following function call and list of test suites:
'test/spectrum-value-test.cc',
]
See :doc:`Tests <tests>` for more information on how to write test cases.
Step 6 - Specify your module's examples
***************************************
Step 6 - Declare Examples
*************************
If your new module has examples, then they must be specified in your
``examples/wscript`` file. (The skeleton top-level ``wscript`` will
recursively include ``examples/wscript`` only if the examples were
enabled at configure time.)
.. sourcecode:: text
src/new-module/examples/wscript
file by modifying it with your text editor.
As an example, the examples for the core module are specified in
.. sourcecode:: text
src/core/examples/wscript
The core module's C++ examples are specified using the following
function calls and source file names. Note that the second argument
for the function ``create_ns3_program()`` is the list of modules that the
program being created depends on:
The ``spectrum`` model defines it's first example in
``src/spectrum/examples/wscript`` with
.. sourcecode:: python
obj = bld.create_ns3_program('main-callback', ['core'])
obj.source = 'main-callback.cc'
def build(bld):
obj = bld.create_ns3_program('adhoc-aloha-ideal-phy',
['spectrum', 'mobility'])
obj.source = 'adhoc-aloha-ideal-phy.cc'
obj = bld.create_ns3_program('sample-simulator', ['core'])
obj.source = 'sample-simulator.cc'
Note that the second argument to the function ``create_ns3_program()``
is the list of modules that the program being created depends on; again,
don't forget to include ``new-module`` in the list. It's best practice
to list only the direct module dependencies, and let ``waf`` deduce
the full dependency tree.
The core module's Python examples are specified using the following
Occasionally, for clarity, you may want to split the implementation
for your example among several source files. In this case, just
include those files as additional explicit sources of the example:
.. sourcecode:: python
obj = bld.create_ns3_program('new-module-example', [new-module])
obj.source = ['new-module-example.cc', 'new-module-example-part.cc']
Python examples are specified using the following
function call. Note that the second argument for the function
register_ns3_script() is the list of modules that the Python example
``register_ns3_script()`` is the list of modules that the Python example
depends on:
.. sourcecode:: python
bld.register_ns3_script('sample-simulator.py', ['core'])
bld.register_ns3_script('new-module-example.py', ['new-module'])
Step 7 - Specify which of your module's examples should be run as tests
***********************************************************************
Step 7 - Examples Run as Tests
******************************
The test framework can also be instrumented to run example programs to
In addition to running explicit test code, the test framework
can also be instrumented to run full example programs to
try to catch regressions in the examples. However, not all examples
are suitable for regression tests. A file called ``examples-to-run.py``
that exists in each module's test directory can control the invocation
of the examples when the test framework runs.
are suitable for regression tests. The file ``test/examples-to-run.py``
controls the invocation of the examples when the test framework runs.
As an example, the examples that are run by ``test.py`` for the core module are specified in
.. sourcecode:: text
src/core/test/examples-to-run.py
using the following two lists of C++ and Python examples:
The ``spectrum`` model examples run by ``test.py`` are specified in
``src/spectrum/test/examples-to-run.py`` using the following
two lists of C++ and Python examples:
.. sourcecode:: python
@@ -263,12 +304,9 @@ using the following two lists of C++ and Python examples:
#
# See test.py for more information.
cpp_examples = [
("main-attribute-value", "True", "True"),
("main-callback", "True", "True"),
("sample-simulator", "True", "True"),
("main-ptr", "True", "True"),
("main-random-variable", "True", "True"),
("sample-random-variable", "True", "True"),
("adhoc-aloha-ideal-phy", "True", "True"),
("adhoc-aloha-ideal-phy-with-microwave-oven", "True", "True"),
("adhoc-aloha-ideal-phy-matrix-propagation-loss-model", "True", "True"),
]
# A list of Python examples to run in order to ensure that they remain
@@ -281,57 +319,43 @@ using the following two lists of C++ and Python examples:
("sample-simulator.py", "True"),
]
Each tuple in the C++ list of examples to run contains
As indicated in the comment, each entry in the C++ list of examples to run
contains the tuple ``(example_name, do_run, do_valgrind_run)``, where
.. sourcecode:: python
(example_name, do_run, do_valgrind_run)
where example_name is the executable to be run, do_run is a
condition under which to run the example, and do_valgrind_run is
a condition under which to run the example under valgrind. This
is needed because NSC causes illegal instruction crashes with
some tests when they are run under valgrind.
* ``example_name`` is the executable to be run,
* ``do_run`` is a condition under which to run the example, and
* ``do_valgrind_run`` is a condition under which to run the example
under valgrind. (This is needed because NSC causes illegal instruction
crashes with some tests when they are run under valgrind.)
Note that the two conditions are Python statements that
can depend on waf configuration variables. For example,
can depend on ``waf`` configuration variables. For example,
.. sourcecode:: python
("tcp-nsc-lfn", "NSC_ENABLED == True", "NSC_ENABLED == False"),
Each tuple in the Python list of examples to run contains
Each entry in the Python list of examples to run contains the tuple
``(example_name, do_run)``, where, as for the C++ examples,
.. sourcecode:: python
* ``example_name`` is the Python script to be run, and
* ``do_run`` is a condition under which to run the example.
(example_name, do_run)
where example_name is the Python script to be run and
do_run is a condition under which to run the example.
Note that the condition is a Python statement that can
depend on waf configuration variables. For example,
Again, the condition is a Python statement that can
depend on ``waf`` configuration variables. For example,
.. sourcecode:: python
("realtime-udp-echo.py", "ENABLE_REAL_TIME == False"),
If your new module has examples, then you must specify which of them
should be run in your
.. sourcecode:: text
Step 8 - Configure and Build
****************************
src/new-module/test/examples-to-run.py
file by modifying it with your text editor. These examples are run by
test.py.
Step 8 - Build and test your new module
***************************************
You can now build and test your module as normal. You must reconfigure
the project as a first step or else your new module will not be included
in the build.
You can now configure, build and test your module as normal.
You must reconfigure the project as a first step so that ``waf``
caches the new information in your ``wscript`` files,
or else your new module will not be included in the build.
.. sourcecode:: bash
@@ -339,9 +363,11 @@ in the build.
$ ./waf build
$ ./test.py
and look for your new module's test suite (and example programs, if enabled) in the test output.
Look for your new module's test suite (and example programs,
if your module has any enabled) in the test output.
Step 9 - Python bindings
Step 9 - Python Bindings
************************
Adding Python bindings to your module is optional, and the step is
+1 -1
View File
@@ -176,7 +176,7 @@ problems. This design is based on elements of the `Component Object Model
binary-level compatibility of replaceable components is not supported and we
have tried to simplify the syntax and impact on model developers.
Exmaples
Examples
********
Aggregation example
+36
View File
@@ -105,6 +105,41 @@ use a single RNG and streams and substreams from it.
.. _seeding-and-independent-replications:
Creating random variables
*************************
|ns3| supports a number of random variable objects from the base class
:cpp:class:`RandomVariableStream`. These objects derive from
:cpp:class:`ns3::Object` and are handled by smart pointers.
The correct way to create these objects is to use the templated
`CreateObject<>` method, such as:
::
Ptr<UniformRandomVariable> x = CreateObject<UniformRandomVariable> ();
then you can access values by calling methods on the object such as:
::
myRandomNo = x->GetInteger ();
If you try to instead do something like this:
::
myRandomNo = UniformRandomVariable().GetInteger ();
your program will encounter a segmentation fault, because the implementation
relies on some attribute construction that occurs only when `CreateObject`
is called.
Much of the rest of this chapter now discusses the properties of the
stream of pseudo-random numbers generated from such objects, and how to
control the seeding of such objects.
Seeding and independent replications
************************************
@@ -242,6 +277,7 @@ An example is in the propagation models for WifiNetDevice::
{
static TypeId tid = TypeId ("ns3::RandomPropagationDelayModel")
.SetParent<PropagationDelayModel> ()
.SetGroupName ("Propagation")
.AddConstructor<RandomPropagationDelayModel> ()
.AddAttribute ("Variable",
"The random variable which generates random delays (s).",
+169 -168
View File
@@ -4,58 +4,51 @@
Testing framework
-----------------
ns-3 consists of a simulation core engine, a set of models, example programs,
|ns3| consists of a simulation core engine, a set of models, example programs,
and tests. Over time, new contributors contribute models, tests, and
examples. A Python test program ``test.py`` serves as the test
execution manager; ``test.py`` can run test code and examples to
look for regressions, can output the results into a number of forms, and
can manage code coverage analysis tools. On top of this, we layer
*Buildbots* that are automated build robots that perform
*buildslaves* that are automated build robots that perform
robustness testing by running the test framework on different systems
and with different configuration options.
BuildBots
*********
Buildslaves
***********
At the highest level of ns-3 testing are the buildbots (build robots).
At the highest level of |ns3| testing are the buildslaves (build robots).
If you are unfamiliar with
this system look at `<http://djmitche.github.com/buildbot/docs/0.7.11/>`_.
this system look at `<https://ns-buildmaster.ee.washington.edu:8010/>`_.
This is an open-source automated system that allows |ns3| to be rebuilt
and tested each time something has changed. By running the buildbots on a number
and tested daily. By running the buildbots on a number
of different systems we can ensure that |ns3| builds and executes
properly on all of its supported systems.
Users (and developers) typically will not interact with the buildbot system other
Users (and developers) typically will not interact with the buildslave system other
than to read its messages regarding test results. If a failure is detected in
one of the automated build and test jobs, the buildbot will send an email to the
*ns-developers* mailing list. This email will look something like
*ns-commits* mailing list. This email will look something like
.. sourcecode: text
The Buildbot has detected a new failure of osx-ppc-g++-4.2 on NsNam.
Full details are available at:
http://ns-regression.ee.washington.edu:8010/builders/osx-ppc-g%2B%2B-4.2/builds/0
Buildbot URL: http://ns-regression.ee.washington.edu:8010/
Buildslave for this Build: darwin-ppc
Build Reason: The web-page 'force build' button was pressed by 'ww': ww
Build Source Stamp: HEAD
Blamelist:
BUILD FAILED: failed shell_5 shell_6 shell_7 shell_8 shell_9 shell_10 shell_11 shell_12
sincerely,
-The Buildbot
[Ns-commits] Build failed in Jenkins: daily-ubuntu-without-valgrind » Ubuntu-64-15.04 #926
In the full details URL shown in the email, one can search for the keyword
``failed`` and select the ``stdio`` link for the corresponding step to see
the reason for the failure.
...
281 of 285 tests passed (281 passed, 3 skipped, 1 failed, 0 crashed, 0 valgrind errors)
List of SKIPped tests:
ns3-tcp-cwnd
ns3-tcp-interoperability
nsc-tcp-loss
List of FAILed tests:
random-variable-stream-generators
+ exit 1
Build step 'Execute shell' marked build as failure
The buildbot will do its job quietly if there are no errors, and the system will
undergo build and test cycles every day to verify that all is well.
In the full details URL shown in the email, one can find links to the detailed test output.
The buildslave system will do its job quietly if there are no errors, and the
system will undergo build and test cycles every day to verify that all is well.
Test.py
*******
@@ -73,7 +66,7 @@ have been built by doing the following
::
$ ./waf configure --enable-examples --enable-tests
$ ./waf
$ ./waf build
By default, ``test.py`` will run all available tests and report status
back in a very concise form. Running the command
@@ -90,7 +83,7 @@ indications followed by the kind of test that was run and its display name.
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
'build' finished successfully (0.939s)
FAIL: TestSuite ns3-wifi-propagation-loss-models
FAIL: TestSuite propagation-loss-model
PASS: TestSuite object-name-service
PASS: TestSuite pcap-file-object
PASS: TestSuite ns3-tcp-cwnd
@@ -120,6 +113,17 @@ if you run ``test.py --help`` you should see a command summary like:
-e EXAMPLE, --example=EXAMPLE
specify a single example to run (no relative path is
needed)
-d, --duration print the duration of each test suite and example
-e EXAMPLE, --example=EXAMPLE
specify a single example to run (no relative path is
needed)
-u, --update-data If examples use reference data files, get them to re-
generate them
-f FULLNESS, --fullness=FULLNESS
choose the duration of tests to run: QUICK, EXTENSIVE,
or TAKES_FOREVER, where EXTENSIVE includes QUICK and
TAKES_FOREVER includes QUICK and EXTENSIVE (only QUICK
tests are run by default)
-g, --grind run the test suites and examples using valgrind
-k, --kinds print the kinds of tests available
-l, --list print the list of known tests
@@ -167,25 +171,25 @@ to be specified. Running the command
::
$ ./test.py --suite=ns3-wifi-propagation-loss-models
$ ./test.py --suite=propagation-loss-model
or equivalently
::
$ ./test.py -s ns3-wifi-propagation-loss-models
$ ./test.py -s propagation-loss-model
results in that single test suite being run.
.. sourcecode:: text
FAIL: TestSuite ns3-wifi-propagation-loss-models
FAIL: TestSuite propagation-loss-model
To find detailed information regarding the failure, one must specify the kind
of output desired. For example, most people will probably be interested in
a text file::
$ ./test.py --suite=ns3-wifi-propagation-loss-models --text=results.txt
$ ./test.py --suite=propagation-loss-model --text=results.txt
This will result in that single test suite being run with the test status written to
the file ''results.txt''.
@@ -194,7 +198,7 @@ You should find something similar to the following in that file
.. sourcecode:: text
FAIL: Test Suite ''ns3-wifi-propagation-loss-models'' (real 0.02 user 0.01 system 0.00)
FAIL: Test Suite ''propagation-loss-model'' (real 0.02 user 0.01 system 0.00)
PASS: Test Case "Check ... Friis ... model ..." (real 0.01 user 0.00 system 0.00)
FAIL: Test Case "Check ... Log Distance ... model" (real 0.01 user 0.01 system 0.00)
Details:
@@ -271,31 +275,39 @@ will result in a list of the test suite being displayed, similar to
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
'build' finished successfully (0.939s)
histogram
ns3-wifi-interference
ns3-tcp-cwnd
ns3-tcp-interoperability
sample
devices-mesh-flame
devices-mesh-dot11s
devices-mesh
Test Type Test Name
--------- ---------
performance many-uniform-random-variables-one-get-value-call
performance one-uniform-random-variable-many-get-value-calls
performance type-id-perf
system buildings-pathloss-test
system buildings-shadowing-test
system devices-mesh-dot11s-regression
system devices-mesh-flame-regression
system epc-gtpu
...
unit wimax-phy-layer
unit wimax-service-flow
unit wimax-ss-mac-layer
unit wimax-tlv
example adhoc-aloha-ideal-phy
example adhoc-aloha-ideal-phy-matrix-propagation-loss-model
example adhoc-aloha-ideal-phy-with-microwave-oven
example aodv
...
object-name-service
callback
attributes
config
global-value
command-line
basic-random-number
object
Any of these listed suites can be selected to be run by itself using the
``--suite`` option as shown above.
``--suite`` option as shown above. Examples are handled differently.
Similarly to test suites, one can run a single C++ example program
using the ``--example`` option. Note that the relative path for the
example does not need to be included and that the executables built
for C++ examples do not have extensions. Entering
for C++ examples do not have extensions. Furthermore, the example
must be registered as an example to the test framework; it is not
sufficient to create an example and run it through test.py; it must
be added to the relevant ``examples-to-run.py`` file, explained below.
Entering
::
@@ -307,7 +319,7 @@ results in that single example being run.
PASS: Example examples/udp/udp-echo
You can specify the directory where ns-3 was built using the
You can specify the directory where |ns3| was built using the
``--buildpath`` option as follows.
::
@@ -329,7 +341,7 @@ results in that single example being run.
PASS: Example examples/tutorial/first.py
Because Python examples are not built, you do not need to specify the
directory where ns-3 was built to run them.
directory where |ns3| was built to run them.
Normally when example programs are executed, they write a large amount of trace
file data. This is normally saved to the base directory of the distribution
@@ -358,12 +370,12 @@ will result in a list of the currently built test suites being displayed, simila
.. sourcecode:: text
ns3-wifi-propagation-loss-models
propagation-loss-model
ns3-tcp-cwnd
ns3-tcp-interoperability
pcap-file-object
pcap-file
object-name-service
random-number-generators
random-variable-stream-generators
Note the absence of the ``Waf`` build messages.
@@ -399,7 +411,7 @@ and examples. Select verbose in the following way::
$ ./test.py --verbose
All of these options can be mixed and matched. For example, to run all of the
ns-3 core test suites under valgrind, in verbose mode, while generating an HTML
|ns3| core test suites under valgrind, in verbose mode, while generating an HTML
output file, one would do::
$ ./test.py --verbose --grind --constrain=core --html=results.html
@@ -417,14 +429,32 @@ kinds of testing that need to be done.
* Examples
* Performance Tests
Moreover, each test is further classified according to the expected time needed to
run it. Tests are classified as:
* QUICK
* EXTENSIVE
* TAKES_FOREVER
Note that specifying EXTENSIVE fullness will also run tests in QUICK category.
Specifying TAKES_FOREVER will run tests in EXTENSIVE and QUICK categories.
By default, only QUICK tests are ran.
As a rule of thumb, tests that must be run to ensure |ns3| coherence should be
QUICK (i.e., take a few seconds). Tests that could be skipped, but are nice to do
can be EXTENSIVE; these are tests that typically need minutes. TAKES_FOREVER is
left for tests that take a really long time, in the order of several minutes.
The main classification goal is to be able to run the buildbots in a reasonable
time, and still be able to perform more extensive tests when needed.
BuildVerificationTests
++++++++++++++++++++++
These are relatively simple tests that are built along with the distribution
and are used to make sure that the build is pretty much working. Our
current unit tests live in the source files of the code they test and are
built into the ns-3 modules; and so fit the description of BVTs. BVTs live
in the same source code that is built into the ns-3 code. Our current tests
built into the |ns3| modules; and so fit the description of BVTs. BVTs live
in the same source code that is built into the |ns3| code. Our current tests
are examples of this kind of test.
Unit Tests
@@ -432,10 +462,10 @@ Unit Tests
Unit tests are more involved tests that go into detail to make sure that a
piece of code works as advertised in isolation. There is really no reason
for this kind of test to be built into an ns-3 module. It turns out, for
for this kind of test to be built into an |ns3| module. It turns out, for
example, that the unit tests for the object name service are about the same
size as the object name service code itself. Unit tests are tests that
check a single bit of functionality that are not built into the ns-3 code,
check a single bit of functionality that are not built into the |ns3| code,
but live in the same directory as the code it tests. It is possible that
these tests check integration of multiple implementation files in a module
as well. The file src/core/test/names-test-suite.cc is an example of this kind
@@ -451,11 +481,11 @@ have lots of this kind of test running in our current regression framework,
but they are typically overloaded examples. We provide a new place
for this kind of test in the directory ``src/test``. The file
src/test/ns3tcp/ns3-interop-test-suite.cc is an example of this kind of
test. It uses NSC TCP to test the ns-3 TCP implementation. Often there
test. It uses NSC TCP to test the |ns3| TCP implementation. Often there
will be test vectors required for this kind of test, and they are stored in
the directory where the test lives. For example,
ns3tcp-interop-response-vectors.pcap is a file consisting of a number of TCP
headers that are used as the expected responses of the ns-3 TCP under test
headers that are used as the expected responses of the |ns3| TCP under test
to a stimulus generated by the NSC TCP which is used as a ''known good''
implementation.
@@ -492,7 +522,7 @@ stage, and also (optionally) examples if examples are to be checked:
$ ./waf --configure --enable-examples --enable-tests
Then, build ns-3, and after it is built, just run ``test.py``. ``test.py -h``
Then, build |ns3|, and after it is built, just run ``test.py``. ``test.py -h``
will show a number of configuration options that modify the behavior
of test.py.
@@ -503,12 +533,19 @@ below, this ``test-runner`` can be a helpful way to debug tests.
Debugging Tests
***************
The debugging of the test programs is best performed running the low-level test-runner program. The test-runner is the bridge from generic Python code to |ns3| code. It is written in C++ and uses the automatic test discovery process in the
|ns3| code to find and allow execution of all of the various tests.
The debugging of the test programs is best performed running the low-level
test-runner program. The test-runner is the bridge from generic Python
code to |ns3| code. It is written in C++ and uses the automatic test
discovery process in the |ns3| code to find and allow execution of all
of the various tests.
The main reason why ``test.py`` is not suitable for debugging is that it is not allowed for logging to be turned on using the ``NS_LOG`` environmental variable when test.py runs. This limitation does not apply to the test-runner executable. Hence, if you want to see logging output from your tests, you have to run them using the test-runner directly.
The main reason why ``test.py`` is not suitable for debugging is that it is
not allowed for logging to be turned on using the ``NS_LOG`` environmental
variable when test.py runs. This limitation does not apply to the test-runner
executable. Hence, if you want to see logging output from your tests, you
have to run them using the test-runner directly.
In order to execute the test-runner, you run it like any other ns-3 executable
In order to execute the test-runner, you run it like any other |ns3| executable
-- using ``waf``. To get a list of available options, you can type::
$ ./waf --run "test-runner --help"
@@ -517,19 +554,35 @@ You should see something like the following
.. sourcecode:: text
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
'build' finished successfully (0.353s)
--assert: Tell tests to segfault (like assert) if an error is detected
--basedir=dir: Set the base directory (where to find src) to ''dir''
--tempdir=dir: Set the temporary directory (where to find data files) to ''dir''
--constrain=test-type: Constrain checks to test suites of type ''test-type''
--help: Print this message
--kinds: List all of the available kinds of tests
--list: List all of the test suites (optionally constrained by test-type)
--out=file-name: Set the test status output file to ''file-name''
--suite=suite-name: Run the test suite named ''suite-name''
--verbose: Turn on messages in the run test suites
Usage: /home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build/utils/ns3-dev-test-runner-debug [OPTIONS]
Options:
--help : print these options
--print-test-name-list : print the list of names of tests available
--list : an alias for --print-test-name-list
--print-test-types : print the type of tests along with their names
--print-test-type-list : print the list of types of tests available
--print-temp-dir : print name of temporary directory before running
the tests
--test-type=TYPE : process only tests of type TYPE
--test-name=NAME : process only test whose name matches NAME
--suite=NAME : an alias (here for compatibility reasons only)
for --test-name=NAME
--assert-on-failure : when a test fails, crash immediately (useful
when running under a debugger
--stop-on-failure : when a test fails, stop immediately
--fullness=FULLNESS : choose the duration of tests to run: QUICK,
EXTENSIVE, or TAKES_FOREVER, where EXTENSIVE
includes QUICK and TAKES_FOREVER includes
QUICK and EXTENSIVE (only QUICK tests are
run by default)
--verbose : print details of test execution
--xml : format test run output as xml
--tempdir=DIR : set temp dir for tests to store output files
--datadir=DIR : set data dir for tests to read reference files
--out=FILE : send test result to FILE instead of standard output
--append=FILE : append test result to FILE instead of standard output
There are a number of things available to you which will be familiar to you if
you have looked at ``test.py``. This should be expected since the test-
@@ -539,7 +592,7 @@ the examples are really not |ns3| tests. ``test.py`` runs them
as if they were to present a unified testing environment, but they are really
completely different and not to be found here.
The first new option that appears here, but not in test.py is the ``--assert``
The first new option that appears here, but not in test.py is the ``--assert-on-failure``
option. This option is useful when debugging a test case when running under a
debugger like ``gdb``. When selected, this option tells the underlying
test case to cause a segmentation violation if an error is detected. This has
@@ -550,36 +603,23 @@ option something like,
::
$ ./waf shell
$ cd build/debug/utils
$ gdb test-runner
$ run --suite=global-value --assert
$ cd build/utils
$ gdb ns3-dev-test-runner-debug
$ run --suite=global-value --assert-on-failure
If an error is then found in the global-value test suite, a segfault would be
generated and the (source level) debugger would stop at the ``NS_TEST_ASSERT_MSG``
that detected the error.
Another new option that appears here is the ``--basedir`` option. It turns out
that some tests may need to reference the source directory of the |ns3|
distribution to find local data, so a base directory is always required to run
a test.
To run one of the tests directly from the test-runner
using ``waf``, you will need to specify the test suite to run.
So you could use the shell and do::
If you run a test from test.py, the Python program will provide the basedir
option for you. To run one of the tests directly from the test-runner
using ``waf``, you will need to specify the test suite to run along with
the base directory. So you could use the shell and do::
$ ./waf --run "test-runner --suite=pcap-file"
$ ./waf --run "test-runner --basedir=`pwd` --suite=pcap-file-object"
|ns3| logging is available when you run it this way, such as:
Note the ''backward'' quotation marks on the ``pwd`` command.
If you are running the test suite out of a debugger, it can be quite painful
to remember and constantly type the absolute path of the distribution base
directory.
Because of this, if you omit the basedir, the test-runner will try to figure one
out for you. It begins in the current working directory and walks up the
directory tree looking for a directory file with files named ``VERSION`` and
``LICENSE.`` If it finds one, it assumes that must be the basedir and provides
it for you.
$ NS_LOG="Packet" ./waf --run "test-runner --suite=pcap-file"
Test output
+++++++++++
@@ -588,7 +628,7 @@ Many test suites need to write temporary files (such as pcap files)
in the process of running the tests. The tests then need a temporary directory
to write to. The Python test utility (test.py) will provide a temporary file
automatically, but if run stand-alone this temporary directory must be provided.
Just as in the basedir case, it can be annoying to continually have to provide
It can be annoying to continually have to provide
a ``--tempdir``, so the test runner will figure one out for you if you don't
provide one. It first looks for environment variables named ``TMP`` and
``TEMP`` and uses those. If neither ``TMP`` nor ``TEMP`` are defined
@@ -620,63 +660,15 @@ and test output can be found in the ``testpy-output/`` directory.
Reporting of test failures
++++++++++++++++++++++++++
When you run a test suite using the test-runner it will run the test quietly
by default. The only indication that you will get that the test passed is
the *absence* of a message from ``waf`` saying that the program
returned something other than a zero exit code. To get some output from the
test, you need to specify an output file to which the tests will write their
XML status using the ``--out`` option. You need to be careful interpreting
the results because the test suites will *append* results onto this file.
When you run a test suite using the test-runner it will run the test
and report PASS or FAIL.
To run more quietly, you need to specify an output file to which the tests will write their status using the ``--out`` option.
Try,
::
$ ./waf --run "test-runner --basedir=`pwd` --suite=pcap-file-object --out=myfile.xml"
$ ./waf --run "test-runner --suite=pcap-file --out=myfile.txt"
If you look at the file ``myfile.xml`` you should see something like,
.. sourcecode:: xml
<TestSuite>
<SuiteName>pcap-file-object</SuiteName>
<TestCase>
<CaseName>Check to see that PcapFile::Open with mode ''w'' works</CaseName>
<CaseResult>PASS</CaseResult>
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
</TestCase>
<TestCase>
<CaseName>Check to see that PcapFile::Open with mode ''r'' works</CaseName>
<CaseResult>PASS</CaseResult>
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
</TestCase>
<TestCase>
<CaseName>Check to see that PcapFile::Open with mode ''a'' works</CaseName>
<CaseResult>PASS</CaseResult>
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
</TestCase>
<TestCase>
<CaseName>Check to see that PcapFileHeader is managed correctly</CaseName>
<CaseResult>PASS</CaseResult>
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
</TestCase>
<TestCase>
<CaseName>Check to see that PcapRecordHeader is managed correctly</CaseName>
<CaseResult>PASS</CaseResult>
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
</TestCase>
<TestCase>
<CaseName>Check to see that PcapFile can read out a known good pcap file</CaseName>
<CaseResult>PASS</CaseResult>
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
</TestCase>
<SuiteResult>PASS</SuiteResult>
<SuiteTime>real 0.00 user 0.00 system 0.00</SuiteTime>
</TestSuite>
If you are familiar with XML this should be fairly self-explanatory. It is
also not a complete XML file since test suites are designed to have their
output appended to a master XML status file as described in the ``test.py``
section.
Debugging test suite failures
+++++++++++++++++++++++++++++
@@ -702,8 +694,8 @@ arguments as needed, but basedir is the minimum needed)::
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) r --basedir=`pwd`
Starting program: <..>/build/debug/utils/test-runner --basedir=`pwd`
(gdb) r --suite=
Starting program: <..>/build/utils/ns3-dev-test-runner-debug --suite=ns3-wifi-interference
[Thread debugging using libthread_db enabled]
assert failed. file=../src/core/model/type-id.cc, line=138, cond="uid <= m_information.size () && uid != 0"
...
@@ -713,7 +705,7 @@ such as::
VALGR: TestSuite devices-mesh-dot11s-regression
$ ./waf --command-template="valgrind %s --basedir=`pwd` --suite=devices-mesh-dot11s-regression" --run test-runner
$ ./waf --command-template="valgrind %s --suite=devices-mesh-dot11s-regression" --run test-runner
Class TestRunner
****************
@@ -761,14 +753,21 @@ as a ''unit'' test with the display name, ``my-test-suite-name``.
MyTestSuite::MyTestSuite ()
: TestSuite ("my-test-suite-name", UNIT)
{
AddTestCase (new MyTestCase);
AddTestCase (new MyTestCase, TestCase::QUICK);
}
MyTestSuite myTestSuite;
static MyTestSuite myTestSuite;
The base class takes care of all of the registration and reporting required to
be a good citizen in the test framework.
Avoid putting initialization logic into the test suite or test case
constructors. This is
because an instance of the test suite is created at run time
(due to the static variable above) regardless of whether the test is being
run or not. Instead, the TestCase provides a virtual ``DoSetup`` method
that can be specialized to perform setup before ``DoRun`` is called.
Test Case
*********
@@ -778,13 +777,15 @@ Mixtures of these models may be used.
In order to create a new test case in the system, all one has to do is to inherit
from the ``TestCase`` base class, override the constructor to give the test
case a name and override the ``DoRun`` method to run the test.
case a name and override the ``DoRun`` method to run the test. Optionally,
override also the ``DoSetup`` method.
.. sourcecode:: cpp
class MyTestCase : public TestCase
{
MyTestCase ();
virtual void DoSetup (void);
virtual void DoRun (void);
};
+5 -10
View File
@@ -3,16 +3,11 @@
Overview
--------
This document is concerned with the testing and validation of |ns3| software.
This chapter is concerned with the testing and validation of |ns3| software.
This document provides
This chapter provides
* background about terminology and software testing (Chapter 2);
* a description of the ns-3 testing framework (Chapter 3);
* a guide to model developers or new model contributors for how to write tests (Chapter 4);
* background about terminology and software testing
* a description of the ns-3 testing framework
* a guide to model developers or new model contributors for how to write tests
In brief, the first three chapters should be read by ns developers and
contributors who need to understand how to contribute test code and
validated programs, and
the remainder of the document provides space for people to report on what
aspects of selected models have been validated.
+93 -18
View File
@@ -34,12 +34,11 @@ SOURCES = \
$(SRC)/csma/doc/csma.rst \
$(SRC)/dsdv/doc/dsdv.rst \
$(SRC)/dsr/doc/dsr.rst \
$(SRC)/emu/doc/emu.rst \
$(SRC)/mpi/doc/distributed.rst \
$(SRC)/energy/doc/energy.rst \
$(SRC)/fd-net-device/doc/fd-net-device.rst \
$(SRC)/tap-bridge/doc/tap.rst \
$(SRC)/mesh/doc/mesh.rst \
$(SRC)/mesh/doc/source/mesh.rst \
$(SRC)/lte/doc/source/lte.rst \
$(SRC)/lte/doc/source/lte-user.rst \
$(SRC)/lte/doc/source/lte-design.rst \
@@ -58,11 +57,16 @@ SOURCES = \
$(SRC)/internet/doc/ipv6.rst \
$(SRC)/internet/doc/routing-overview.rst \
$(SRC)/internet/doc/tcp.rst \
$(SRC)/internet/doc/codel.rst \
$(SRC)/mobility/doc/mobility.rst \
$(SRC)/olsr/doc/olsr.rst \
$(SRC)/openflow/doc/openflow-switch.rst \
$(SRC)/point-to-point/doc/point-to-point.rst \
$(SRC)/wifi/doc/wifi.rst \
$(SRC)/wifi/doc/source/wifi.rst \
$(SRC)/wifi/doc/source/wifi-design.rst \
$(SRC)/wifi/doc/source/wifi-user.rst \
$(SRC)/wifi/doc/source/wifi-testing.rst \
$(SRC)/wifi/doc/source/wifi-references.rst \
$(SRC)/wimax/doc/wimax.rst \
$(SRC)/uan/doc/uan.rst \
$(SRC)/topology-read/doc/topology.rst \
@@ -75,11 +79,11 @@ SOURCES = \
$(SRC)/stats/doc/data-collection.rst \
$(SRC)/stats/doc/probe.rst \
$(SRC)/stats/doc/scope-and-limitations.rst \
$(SRC)/stats/doc/statistics.rst \
$(SRC)/netanim/doc/animation.rst \
$(SRC)/flow-monitor/doc/flow-monitor.rst \
$(SRC)/wave/doc/wave.rst \
$(SRC)/sixlowpan/doc/sixlowpan.rst \
$(SRC)/lr-wpan/doc/lr-wpan.rst \
# list all model library figure files that need to be copied to
# $SOURCETEMP/figures. For each figure to be included in all
@@ -99,8 +103,8 @@ SOURCEFIGS = \
$(SRC)/internet/doc/internet-node-recv.dia \
$(SRC)/internet/doc/routing.dia \
$(SRC)/internet/doc/routing-specialization.dia \
$(SRC)/wifi/doc/WifiArchitecture.dia \
$(SRC)/wifi/doc/snir.dia \
$(SRC)/wifi/doc/source/figures/WifiArchitecture.dia \
$(SRC)/wifi/doc/source/figures/snir.dia \
$(SRC)/wimax/doc/WimaxArchitecture.dia \
$(SRC)/lte/doc/source/figures/epc-ctrl-arch.dia \
$(SRC)/lte/doc/source/figures/epc-data-flow-dl.dia \
@@ -142,12 +146,12 @@ SOURCEFIGS = \
$(SRC)/lte/doc/source/figures/epcSimulationTime.eps \
$(SRC)/lte/doc/source/figures/epcEutranRunningTime.eps \
$(SRC)/lte/doc/source/figures/profiling-memory.eps \
$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.eps \
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.eps \
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.eps \
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.eps \
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.eps \
$(SRC)/lte/doc/source/figures/lte-epc-x2-entity-saps.eps \
$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.dia \
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.dia \
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.dia \
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.dia \
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.dia \
$(SRC)/lte/doc/source/figures/lte-epc-x2-entity-saps.dia \
$(SRC)/lte/doc/source/figures/lte-strongest-cell-handover-algorithm.eps \
$(SRC)/lte/doc/source/figures/lte-phy-interference.pdf \
$(SRC)/lte/doc/source/figures/lte-phy-interference.png \
@@ -175,6 +179,24 @@ SOURCEFIGS = \
$(SRC)/lte/doc/source/figures/fading_vehicular.png \
$(SRC)/lte/doc/source/figures/fading_urban_3kmph.pdf \
$(SRC)/lte/doc/source/figures/fading_urban_3kmph.png \
$(SRC)/lte/doc/source/figures/fr-enhanced-fractional-frequency-reuse-scheme.dia \
$(SRC)/lte/doc/source/figures/fr-full-frequency-reuse-scheme.dia \
$(SRC)/lte/doc/source/figures/fr-hard-frequency-reuse-scheme.dia \
$(SRC)/lte/doc/source/figures/fr-soft-fractional-frequency-reuse-scheme.dia \
$(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v1.dia \
$(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v2.dia \
$(SRC)/lte/doc/source/figures/fr-strict-frequency-reuse-scheme.dia \
$(SRC)/lte/doc/source/figures/ffr-distributed-scheme.dia \
$(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.png \
$(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.pdf \
$(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.png \
$(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.pdf \
$(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.png \
$(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.pdf \
$(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.png \
$(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.pdf \
$(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.png \
$(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.pdf \
$(SRC)/lte/doc/source/figures/MCS_1_4.pdf \
$(SRC)/lte/doc/source/figures/MCS_1_4.png \
$(SRC)/lte/doc/source/figures/MCS_5_8.pdf \
@@ -199,6 +221,8 @@ SOURCEFIGS = \
$(SRC)/lte/doc/source/figures/MCS_16_test.pdf \
$(SRC)/lte/doc/source/figures/miesm_scheme.pdf \
$(SRC)/lte/doc/source/figures/miesm_scheme.png \
$(SRC)/lte/doc/source/figures/lte-dl-power-control.dia \
$(SRC)/lte/doc/source/figures/lte-ffr-scheduling.dia \
$(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.pdf \
$(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.png \
$(SRC)/lte/doc/source/figures/lte-legacy-handover-algorithm.pdf \
@@ -229,7 +253,16 @@ SOURCEFIGS = \
$(SRC)/netanim/doc/figures/PacketTimeline.pdf \
$(SRC)/spectrum/doc/spectrum-channel-phy-interface.png \
$(SRC)/spectrum/doc/spectrum-channel-phy-interface.pdf \
$(SRC)/spectrum/doc/spectrum-analyzer-example.eps
$(SRC)/spectrum/doc/spectrum-analyzer-example.eps \
$(SRC)/spectrum/doc/spectrum-tv-rand-geo-points.eps \
$(SRC)/spectrum/doc/spectrum-tv-8vsb.png \
$(SRC)/spectrum/doc/spectrum-tv-cofdm.png \
$(SRC)/lr-wpan/doc/lr-wpan-arch.dia \
$(SRC)/lr-wpan/doc/lr-wpan-data-example.dia \
$(SRC)/lr-wpan/doc/lr-wpan-primitives.dia \
$(SRC)/lr-wpan/doc/802-15-4-ber.eps \
$(SRC)/lr-wpan/doc/802-15-4-per-sens.eps \
$(SRC)/lr-wpan/doc/802-15-4-psr-distance.eps
# specify figures from which .png and .pdf figures need to be
# generated (all dia and eps figures)
@@ -259,6 +292,16 @@ IMAGES_EPS = \
$(FIGURES)/eutran-profiling-scenario.eps \
$(FIGURES)/ff-example.eps \
$(FIGURES)/ff-mac-saps.eps \
$(FIGURES)/lte-dl-power-control.eps \
$(FIGURES)/lte-ffr-scheduling.eps \
$(FIGURES)/fr-enhanced-fractional-frequency-reuse-scheme.eps \
$(FIGURES)/fr-full-frequency-reuse-scheme.eps \
$(FIGURES)/fr-hard-frequency-reuse-scheme.eps \
$(FIGURES)/fr-soft-fractional-frequency-reuse-scheme.eps \
$(FIGURES)/fr-soft-frequency-reuse-scheme-v1.eps \
$(FIGURES)/fr-soft-frequency-reuse-scheme-v2.eps \
$(FIGURES)/fr-strict-frequency-reuse-scheme.eps \
$(FIGURES)/ffr-distributed-scheme.eps \
$(FIGURES)/lte-arch-enb-data.eps \
$(FIGURES)/lte-arch-enb-ctrl.eps \
$(FIGURES)/lte-arch-ue-data.eps \
@@ -298,7 +341,14 @@ IMAGES_EPS = \
$(FIGURES)/lte-epc-x2-entity-saps.eps \
$(FIGURES)/lte-strongest-cell-handover-algorithm.eps \
$(FIGURES)/auvmobility-classes.eps \
$(FIGURES)/spectrum-analyzer-example.eps
$(FIGURES)/spectrum-analyzer-example.eps \
$(FIGURES)/spectrum-tv-rand-geo-points.eps \
$(FIGURES)/lr-wpan-primitives.eps \
$(FIGURES)/lr-wpan-data-example.eps \
$(FIGURES)/lr-wpan-arch.eps \
$(FIGURES)/802-15-4-ber.eps \
$(FIGURES)/802-15-4-per-sens.eps \
$(FIGURES)/802-15-4-psr-distance.eps
# rescale pdf figures as necessary
$(FIGURES)/testbed.pdf_width = 5in
@@ -321,6 +371,16 @@ $(FIGURES)/lte-arch-data-rrc-pdcp-rlc.pdf_width = 3in
$(FIGURES)/lte-epc-e2e-data-protocol-stack.pdf_width = 15cm
$(FIGURES)/ff-mac-saps.pdf_width = 5in
$(FIGURES)/ff-example.pdf_width = 5in
$(FIGURES)/lte-dl-power-control.pdf_width = 8cm
$(FIGURES)/lte-ffr-scheduling.pdf_width = 8cm
$(FIGURES)/fr-enhanced-fractional-frequency-reuse-scheme.pdf_width = 8cm
$(FIGURES)/fr-full-frequency-reuse-scheme.pdf_width = 8cm
$(FIGURES)/fr-hard-frequency-reuse-scheme.pdf_width = 8cm
$(FIGURES)/fr-soft-fractional-frequency-reuse-scheme.pdf_width = 8cm
$(FIGURES)/fr-soft-frequency-reuse-scheme-v1.pdf_width = 8cm
$(FIGURES)/fr-soft-frequency-reuse-scheme-v2.pdf_width = 8cm
$(FIGURES)/fr-strict-frequency-reuse-scheme.pdf_width = 8cm
$(FIGURES)/ffr-distributed-scheme.pdf_width = 8cm
$(FIGURES)/lte-arch-enb-data.pdf_width = 6cm
$(FIGURES)/lte-arch-enb-ctrl.pdf_width = 10cm
$(FIGURES)/lte-arch-ue-data.pdf_width = 6cm
@@ -328,7 +388,9 @@ $(FIGURES)/lte-arch-ue-ctrl.pdf_width = 10cm
$(FIGURES)/lte-rlc-implementation-model.pdf_width = 20in
$(FIGURES)/lte-rlc-data-txon-dl.pdf_width = 10cm
$(FIGURES)/lte-rlc-data-txon-ul.pdf_width = 10cm
$(FIGURES)/lte-rlc-data-retx-dl.pdf_width = 10cm
$(FIGURES)/lte-rlc-data-retx-ul.pdf_width = 10cm
$(FIGURES)/lte-epc-x2-entity-saps.pdf_width = 12cm
$(FIGURES)/lte-phy-interference.pdf_width = 12cm
$(FIGURES)/lte-subframe-structure.pdf_width = 2in
$(FIGURES)/mac-random-access-contention.pdf_width = 10cm
@@ -336,6 +398,9 @@ $(FIGURES)/mac-random-access-noncontention.pdf_width = 15cm
$(FIGURES)/helpers.pdf_width = 8cm
$(FIGURES)/auvmobility-classes.pdf_width = 10cm
$(FIGURES)/spectrum-analyzer-example.pdf_width = 15cm
$(FIGURES)/spectrum-tv-rand-geo-points.pdf_width = 8cm
$(FIGURES)/lr-wpan-primitives.pdf_width = 3in
$(FIGURES)/lr-wpan-arch.pdf_width = 2in
IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf}
@@ -344,11 +409,21 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
RESCALE = ../../utils/rescale-pdf.sh
%.eps : %.dia; $(DIA) -t eps $< -e $@
%.png : %.dia; $(DIA) -t png $< -e $@
%.png : %.eps; $(CONVERT) $< $@
%.eps : %.dia
@echo dia $(notdir $<)
@$(DIA) -t eps $< -e $@ >/dev/null
%.png : %.dia
@echo dia $(notdir $<)
@$(DIA) -t png $< -e $@ >/dev/null
%.png : %.eps
@echo convert $(notdir $<)
@$(CONVERT) $< $@ >/dev/null
%.pdf : %.eps
$(EPSTOPDF) $< -o=$@
@echo epstopdf $(notdir $<)
@$(EPSTOPDF) $< -o=$@ >/dev/null
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
# You can set these variables from the command line.
+1 -3
View File
@@ -18,8 +18,7 @@ any combination of simulated or emulated devices.
**Note:** Prior to ns-3.17, the emulation capability was provided by a
special device called an ``Emu`` NetDevice; the ``Emu`` NetDevice has
been superseded by the ``FdNetDevice``, and will be deprecated and removed
in future revisions of |ns3|.
been replaced by the ``FdNetDevice``.
One of the use-cases we want to support is that of a testbed. A concrete example
of an environment of this kind is the ORBIT testbed. ORBIT is a laboratory
@@ -83,6 +82,5 @@ simulated |ns3| networks.
.. toctree::
emu
fd-net-device
tap
+1
View File
@@ -33,6 +33,7 @@ This document is written in `reStructuredText <http://docutils.sourceforge.net/r
energy
flow-monitor
internet-models
lr-wpan
lte
mesh
distributed
+1
View File
@@ -8,3 +8,4 @@ Internet Models
ipv6
routing-overview
tcp
codel
+1 -1
View File
@@ -152,7 +152,7 @@ elif [ $tag -eq 1 ]; then
else
version=`hg log -r tip --template '{node|short}'`
# Check for uncommitted changes
hg summary | grep -q 'commit: (clean)'
hg summary | grep 'commit:' | grep -q '(clean)'
if [ ! $? ] ; then
say "beyond latest tag, last commit: $version, dirty"
dirty="(+)"
+16 -3
View File
@@ -27,9 +27,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
.NOTPARALLEL:
%.eps : %.dia; $(DIA) -t eps $< -e $@
%.png : %.dia; $(DIA) -t png $< -e $@
%.pdf : %.eps; $(EPSTOPDF) $< -o=$@
%.eps : %.dia
@echo dia $(notdir $<)
@$(DIA) -t eps $< -e $@ >/dev/null
%.png : %.dia
@echo dia $(notdir $<)
@$(DIA) -t png $< -e $@ >/dev/null
%.png : %.eps
@echo convert $(notdir $<)
@$(CONVERT) $< $@ >/dev/null
%.pdf : %.eps
@echo epstopdf $(notdir $<)
@$(EPSTOPDF) $< -o=$@ >/dev/null
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
help:
@echo "Please use \`make <target>' where <target> is one of"
+16 -3
View File
@@ -27,9 +27,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
.NOTPARALLEL:
%.eps : %.dia; $(DIA) -t eps $< -e $@
%.png : %.dia; $(DIA) -t png $< -e $@
%.pdf : %.eps; $(EPSTOPDF) $< -o=$@
%.eps : %.dia
@echo dia $(notdir $<)
@$(DIA) -t eps $< -e $@ >/dev/null
%.png : %.dia
@echo dia $(notdir $<)
@$(DIA) -t png $< -e $@ >/dev/null
%.png : %.eps
@echo convert $(notdir $<)
@$(CONVERT) $< $@ >/dev/null
%.pdf : %.eps
@echo epstopdf $(notdir $<)
@$(EPSTOPDF) $< -o=$@ >/dev/null
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
help:
@echo "Please use \`make <target>' where <target> is one of"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

+100 -94
View File
@@ -1,6 +1,8 @@
.. include:: replace.txt
.. highlight:: cpp
.. _BuildingTopologies:
Building Topologies
-------------------
@@ -22,7 +24,7 @@ point-to-point topologies, we will see equivalent CSMA topology helpers in
this section. The appearance and operation of these helpers should look
quite familiar to you.
We provide an example script in our examples/tutorial} directory. This script
We provide an example script in our ``examples/tutorial`` directory. This script
builds on the ``first.cc`` script and adds a CSMA network to the
point-to-point simulation we've already considered. Go ahead and open
``examples/tutorial/second.cc`` in your favorite editor. You will have already seen
@@ -413,7 +415,7 @@ You should see the contents of the pcap file displayed:
reading from file second-0-0.pcap, link-type PPP (PPP)
2.000000 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
2.007602 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
2.017607 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
The first line of the dump indicates that the link type is PPP (point-to-point)
which we expect. You then see the echo packet leaving node zero via the
@@ -433,7 +435,7 @@ link:
reading from file second-1-0.pcap, link-type PPP (PPP)
2.003686 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
Here we see that the link type is also PPP as we would expect. You see the
packet from IP address 10.1.1.1 (that was sent at 2.000000 seconds) headed
@@ -453,12 +455,12 @@ You should now see the promiscuous dump of node two, device zero:
.. sourcecode:: text
reading from file second-2-0.pcap, link-type EN10MB (Ethernet)
2.003696 arp who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
2.003707 arp reply 10.1.2.4 is-at 00:00:00:00:00:06
2.003801 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4
2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
2.007698 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
2.007710 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
2.007803 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
2.013815 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
2.013828 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
As you can see, the link type is now "Ethernet". Something new has appeared,
though. The bus network needs ``ARP``, the Address Resolution Protocol.
@@ -473,15 +475,15 @@ This exchange is seen in the following lines,
.. sourcecode:: text
2.003696 arp who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
2.003707 arp reply 10.1.2.4 is-at 00:00:00:00:00:06
2.007698 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
2.007710 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
Then node one, device one goes ahead and sends the echo packet to the UDP echo
server at IP address 10.1.2.4.
.. sourcecode:: text
2.003801 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
2.007803 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
The server receives the echo request and turns the packet around trying to send
it back to the source. The server knows that this address is on another network
@@ -492,14 +494,14 @@ just like the first CSMA node had to do.
.. sourcecode:: text
2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4
2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
2.013815 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
2.013828 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
The server then sends the echo back to the forwarding node.
.. sourcecode:: text
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
Looking back at the rightmost node of the point-to-point link,
@@ -514,7 +516,7 @@ the last line of the trace dump.
reading from file second-1-0.pcap, link-type PPP (PPP)
2.003686 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
Lastly, you can look back at the node that originated the echo
@@ -522,13 +524,13 @@ Lastly, you can look back at the node that originated the echo
$ tcpdump -nn -tt -r second-0-0.pcap
and see that the echoed packet arrives back at the source at 2.007602 seconds,
and see that the echoed packet arrives back at the source at 2.017607 seconds,
.. sourcecode:: text
reading from file second-0-0.pcap, link-type PPP (PPP)
2.000000 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
2.007602 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
2.017607 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
Finally, recall that we added the ability to control the number of CSMA devices
in the simulation by command line argument. You can change this argument in
@@ -547,9 +549,10 @@ You should now see,
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
'build' finished successfully (0.405s)
Sent 1024 bytes to 10.1.2.5
Received 1024 bytes from 10.1.1.1
Received 1024 bytes from 10.1.2.5
At time 2s client sent 1024 bytes to 10.1.2.5 port 9
At time 2.0118s server received 1024 bytes from 10.1.1.1 port 49153
At time 2.0118s server sent 1024 bytes to 10.1.1.1 port 49153
At time 2.02461s client received 1024 bytes from 10.1.2.5 port 9
Notice that the echo server has now been relocated to the last of the CSMA
nodes, which is 10.1.2.5 instead of the default case, 10.1.2.4.
@@ -621,9 +624,10 @@ you will see the following output:
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
'build' finished successfully (0.407s)
Sent 1024 bytes to 10.1.2.101
Received 1024 bytes from 10.1.1.1
Received 1024 bytes from 10.1.2.101
At time 2s client sent 1024 bytes to 10.1.2.101 port 9
At time 2.0068s server received 1024 bytes from 10.1.1.1 port 49153
At time 2.0068s server sent 1024 bytes to 10.1.1.1 port 49153
At time 2.01761s client received 1024 bytes from 10.1.2.101 port 9
Note that the echo server is now located at 10.1.2.101 which corresponds to
having 100 "extra" CSMA nodes with the echo server on the last one. If you
@@ -655,8 +659,8 @@ entire CSMA network.
.. sourcecode:: text
reading from file second-100-0.pcap, link-type EN10MB (Ethernet)
2.003696 arp who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101
2.006698 ARP, Request who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
2.013815 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101, length 50
Now take a look at the ``tcpdump`` for ``second-101-0.pcap``.
@@ -669,12 +673,12 @@ You can now see that node 101 is really the participant in the echo exchange.
.. sourcecode:: text
reading from file second-101-0.pcap, link-type EN10MB (Ethernet)
2.003696 arp who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
2.003696 arp reply 10.1.2.101 is-at 00:00:00:00:00:67
2.003801 IP 10.1.1.1.49153 > 10.1.2.101.9: UDP, length 1024
2.003801 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101
2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
2.003822 IP 10.1.2.101.9 > 10.1.1.1.49153: UDP, length 1024
2.006698 ARP, Request who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
2.006698 ARP, Reply 10.1.2.101 is-at 00:00:00:00:00:67, length 50
2.006803 IP 10.1.1.1.49153 > 10.1.2.101.9: UDP, length 1024
2.013803 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101, length 50
2.013828 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
2.013828 IP 10.1.2.101.9 > 10.1.1.1.49153: UDP, length 1024
Models, Attributes and Reality
******************************
@@ -880,7 +884,7 @@ that we will connect via the point-to-point link.
Next, we see an old friend. We instantiate a ``PointToPointHelper`` and
set the associated default ``Attributes`` so that we create a five megabit
per second transmitter on devices created using the helper and a two millisecond
delay on channels created by the helper. We then ``Intall`` the devices
delay on channels created by the helper. We then ``Install`` the devices
on the nodes and the channel between them.
::
@@ -1183,7 +1187,7 @@ repository you would type,
.. sourcecode:: bash
$ cp examples/third.cc scratch/mythird.cc
$ cp examples/tutorial/third.cc scratch/mythird.cc
$ ./waf
$ ./waf --run scratch/mythird
@@ -1195,9 +1199,10 @@ Again, since we have set up the UDP echo applications just as we did in the
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
'build' finished successfully (0.407s)
Sent 1024 bytes to 10.1.2.4
Received 1024 bytes from 10.1.3.3
Received 1024 bytes from 10.1.2.4
At time 2s client sent 1024 bytes to 10.1.2.4 port 9
At time 2.01796s server received 1024 bytes from 10.1.3.3 port 49153
At time 2.01796s server sent 1024 bytes to 10.1.3.3 port 49153
At time 2.03364s client received 1024 bytes from 10.1.2.4 port 9
Recall that the first message, ``Sent 1024 bytes to 10.1.2.4``," is the
UDP echo client sending a packet to the server. In this case, the client
@@ -1235,19 +1240,18 @@ You should see some wifi-looking contents you haven't seen here before:
reading from file third-0-1.pcap, link-type IEEE802_11 (802.11)
0.000025 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
0.000263 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.000279 Acknowledgment RA:00:00:00:00:00:09
0.000552 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.000568 Acknowledgment RA:00:00:00:00:00:07
0.000664 Assoc Response AID(0) :: Succesful
0.001001 Assoc Response AID(0) :: Succesful
0.001145 Acknowledgment RA:00:00:00:00:00:0a
0.001233 Assoc Response AID(0) :: Succesful
0.001377 Acknowledgment RA:00:00:00:00:00:0a
0.001597 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.001613 Acknowledgment RA:00:00:00:00:00:08
0.001691 Assoc Response AID(0) :: Succesful
0.001835 Acknowledgment RA:00:00:00:00:00:0a
0.000308 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.000324 Acknowledgment RA:00:00:00:00:00:08
0.000402 Assoc Response AID(0) :: Successful
0.000546 Acknowledgment RA:00:00:00:00:00:0a
0.000721 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.000737 Acknowledgment RA:00:00:00:00:00:07
0.000824 Assoc Response AID(0) :: Successful
0.000968 Acknowledgment RA:00:00:00:00:00:0a
0.001134 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.001150 Acknowledgment RA:00:00:00:00:00:09
0.001273 Assoc Response AID(0) :: Successful
0.001417 Acknowledgment RA:00:00:00:00:00:0a
0.102400 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
0.204800 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
0.307200 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
@@ -1257,7 +1261,7 @@ probably understand what is going on and find the IP echo request and response
packets in this trace. We leave it as an exercise to completely parse the
trace dump.
Now, look at the pcap file of the right side of the point-to-point link,
Now, look at the pcap file of the left side of the point-to-point link,
.. sourcecode:: bash
@@ -1268,8 +1272,8 @@ Again, you should see some familiar looking contents:
.. sourcecode:: text
reading from file third-0-0.pcap, link-type PPP (PPP)
2.002160 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
2.009767 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
2.008151 IP 10.1.3.3.49153 > 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
again across the point-to-point link.
@@ -1285,8 +1289,8 @@ Again, you should see some familiar looking contents:
.. sourcecode:: text
reading from file third-1-0.pcap, link-type PPP (PPP)
2.005846 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
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
back again across the point-to-point link with slightly different timings
@@ -1304,12 +1308,12 @@ You should see some familiar looking contents:
.. sourcecode:: text
reading from file third-1-1.pcap, link-type EN10MB (Ethernet)
2.005846 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
2.005870 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
2.005870 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
2.005975 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
2.005975 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
2.017837 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
2.017861 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
2.017861 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
2.022966 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
2.022966 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
This should be easily understood. If you've forgotten, go back and look at
the discussion in ``second.cc``. This is the same sequence.
@@ -1385,37 +1389,39 @@ they happen.
.. sourcecode:: text
Build finished successfully (00:00:01)
'build' finished successfully (5.989s)
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10, y = 0
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.41539, y = -0.811313
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.46199, y = -1.11303
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.52738, y = -1.46869
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.67099, y = -1.98503
/NodeList/7/$ns3::MobilityModel/CourseChange x = 5.6835, y = -2.14268
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.70932, y = -1.91689
Sent 1024 bytes to 10.1.2.4
Received 1024 bytes from 10.1.3.3
Received 1024 bytes from 10.1.2.4
/NodeList/7/$ns3::MobilityModel/CourseChange x = 5.53175, y = -2.48576
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.58021, y = -2.17821
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.18915, y = -1.25785
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.7572, y = -0.434856
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.62404, y = 0.556238
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.74127, y = 1.54934
/NodeList/7/$ns3::MobilityModel/CourseChange x = 5.73934, y = 1.48729
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.18521, y = 0.59219
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.58121, y = 1.51044
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.27897, y = 2.22677
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.42888, y = 1.70014
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.40519, y = 1.91654
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.51981, y = 1.45166
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.34588, y = 2.01523
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.81046, y = 2.90077
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.89186, y = 3.29596
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.46617, y = 2.47732
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.05492, y = 1.56579
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.00393, y = 1.25054
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.00968, y = 1.35768
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.33503, y = 2.30328
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.18682, y = 3.29223
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.96865, y = 2.66873
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.3841, y = 0.923277
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.2049, y = 1.90708
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.8136, y = 1.11368
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.8452, y = 2.11318
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.9797, y = 3.10409
At time 2s client sent 1024 bytes to 10.1.2.4 port 9
At time 2.01796s server received 1024 bytes from 10.1.3.3 port 49153
At time 2.01796s server sent 1024 bytes to 10.1.3.3 port 49153
At time 2.03364s client received 1024 bytes from 10.1.2.4 port 9
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.3273, y = 4.04175
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.013, y = 4.76955
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.4317, y = 5.67771
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.4607, y = 5.91681
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.0155, y = 6.74878
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.0076, y = 6.62336
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.6285, y = 5.698
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.32, y = 4.97559
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.1134, y = 3.99715
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.8359, y = 4.68851
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.5953, y = 3.71789
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.7595, y = 4.26688
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.7629, y = 4.34913
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.2292, y = 5.19485
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.2344, y = 5.09394
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.3601, y = 4.60846
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.40025, y = 4.32795
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.14292, y = 4.99761
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.08299, y = 5.99581
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.26068, y = 5.42677
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.35917, y = 6.42191
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.66805, y = 7.14466
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.71414, y = 6.84456
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.42489, y = 7.80181
+64 -1
View File
@@ -92,7 +92,7 @@ access* communication medium. This gives us Ethernet-like functionality.
Net Device
++++++++++
It used to be the case that if you wanted to connect a computers to a network,
It used to be the case that if you wanted to connect a computer to a network,
you had to buy a specific kind of network cable and a hardware device called
(in PC terminology) a *peripheral card* that needed to be installed in
your computer. If the peripheral card implemented some networking function,
@@ -743,6 +743,69 @@ took care of the hard part for you. The remaining lines of our first
return 0;
}
When the simulator will stop?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|ns3| is a Discrete Event (DE) simulator. In such a simulator, each event is
associated with its execution time, and the simulation proceeds by executing
events in the temporal order of simulation time. Events may cause future
events to be scheduled (for example, a timer may reschedule itself to
expire at the next interval).
The initial events are usually triggered by each object, e.g., IPv6 will
schedule Router Advertisements, Neighbor Solicitations, etc.,
an Application schedule the first packet sending event, etc.
When an event is processed, it may generate zero, one or more events.
As a simulation executes, events are consumed, but more events may (or may
not) be generated.
The simulation will stop automatically when no further events are in the
event queue, or when a special Stop event is found. The Stop event is
created through the
``Simulator::Stop (stopTime);`` function.
There is a typical case where ``Simulator::Stop`` is absolutely necessary
to stop the simulation: when there is a self-sustaining event.
Self-sustaining (or recurring) events are events that always reschedule
themselves. As a consequence, they always keep the event queue non-empty.
There are many protocols and modules containing recurring events, e.g.:
* FlowMonitor - periodic check for lost packets
* RIPng - periodic broadcast of routing tables update
* etc.
In these cases, ``Simulator::Stop`` is necessary to gracefully stop the
simulation. In addition, when |ns3| is in emulation mode, the
``RealtimeSimulator`` is used to keep the simulation clock aligned with
the machine clock, and ``Simulator::Stop`` is necessary to stop the
process.
Many of the simulation programs in the tutorial do not explicitly call
``Simulator::Stop``, since the event queue will automatically run out
of events. However, these programs will also accept a call to
``Simulator::Stop``. For example, the following additional statement
in the first example program will schedule an explicit stop at 11 seconds:
::
+ Simulator::Stop (Seconds (11.0));
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
The above wil 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
printed to the screen (since the output occurs around time 2 seconds of
simulation time).
It is important to call ``Simulator::Stop`` *before* calling
``Simulator::Run``; otherwise, ``Simulator::Run`` may never return control
to the main program to execute the stop!
Building Your Script
++++++++++++++++++++
We have made it trivial to build your simple scripts. All you have to do is
+30 -25
View File
@@ -103,19 +103,19 @@ some of the new lines of this diff:
::
+ std::string probeName;
+ std::string probeTrace;
+ std::string probeType;
+ std::string tracePath;
+ if (useV6 == false)
+ {
...
+ probeName = "ns3::Ipv4PacketProbe";
+ probeTrace = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
+ probeType = "ns3::Ipv4PacketProbe";
+ tracePath = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
+ }
+ else
+ {
...
+ probeName = "ns3::Ipv6PacketProbe";
+ probeTrace = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
+ probeType = "ns3::Ipv6PacketProbe";
+ tracePath = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
+ }
...
+ // Use GnuplotHelper to plot the packet byte count over time
@@ -129,12 +129,12 @@ some of the new lines of this diff:
+ "Time (Seconds)",
+ "Packet Byte Count");
+
+ // Specify the probe type, probe path (in configuration namespace), and
+ // Specify the probe type, trace source path (in configuration namespace), and
+ // probe output trace source ("OutputBytes") to plot. The fourth argument
+ // specifies the name of the data series label on the plot. The last
+ // argument formats the plot by specifying where the key should be placed.
+ plotHelper.PlotProbe (probeName,
+ probeTrace,
+ plotHelper.PlotProbe (probeType,
+ tracePath,
+ "OutputBytes",
+ "Packet Byte Count",
+ GnuplotAggregator::KEY_BELOW);
@@ -151,8 +151,8 @@ some of the new lines of this diff:
+
+ // Specify the probe type, probe path (in configuration namespace), and
+ // probe output trace source ("OutputBytes") to write.
+ fileHelper.WriteProbe (probeName,
+ probeTrace,
+ fileHelper.WriteProbe (probeType,
+ tracePath,
+ "OutputBytes");
+
Simulator::Stop (Seconds (20));
@@ -161,7 +161,7 @@ some of the new lines of this diff:
The careful reader will have noticed, when testing the IPv6 command
line attribute, that ``seventh.cc`` had created a number of new output files:
line attribute above, that ``seventh.cc`` had created a number of new output files:
::
@@ -178,6 +178,8 @@ by hooking the data collection components to |ns3| trace sources, and
marshaling the data into a formatted ``gnuplot`` and into a formatted
text file. In the next sections, we'll review each of these.
.. _GnuPlotHelper:
GnuplotHelper
*************
@@ -257,26 +259,26 @@ variables for later use:
::
+ std::string probeName;
+ std::string probeTrace;
+ probeName = "ns3::Ipv6PacketProbe";
+ probeTrace = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
+ std::string probeType;
+ std::string tracePath;
+ probeType = "ns3::Ipv6PacketProbe";
+ tracePath = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
We use them here:
::
+ // Specify the probe type, probe path (in configuration namespace), and
+ // Specify the probe type, trace source path (in configuration namespace), and
+ // probe output trace source ("OutputBytes") to plot. The fourth argument
+ // specifies the name of the data series label on the plot. The last
+ // argument formats the plot by specifying where the key should be placed.
+ plotHelper.PlotProbe (probeName,
+ probeTrace,
+ plotHelper.PlotProbe (probeType,
+ tracePath,
+ "OutputBytes",
+ "Packet Byte Count",
+ GnuplotAggregator::KEY_BELOW);
The first two arguments are the name of the probe type and the probe trace.
The first two arguments are the name of the probe type and the trace source path.
These two are probably the hardest to determine when you try to use
this framework to plot other traces. The probe trace here is the ``Tx``
trace source of class ``Ipv6L3Protocol``. When we examine this class
@@ -319,6 +321,7 @@ the data out of the probed Packet object:
{
static TypeId tid = TypeId ("ns3::Ipv6PacketProbe")
.SetParent<Probe> ()
.SetGroupName ("Stats")
.AddConstructor<Ipv6PacketProbe> ()
.AddTraceSource ( "Output",
"The packet plus its IPv6 object and interface that serve as the output for this probe",
@@ -359,6 +362,8 @@ The following traced values are supported with Probes as of this writing:
+------------------+-------------------+------------------------------------+
| bool | BooleanProbe | stats/model/uinteger-16-probe.h |
+------------------+-------------------+------------------------------------+
| ns3::Time | TimeProbe | stats/model/time-probe.h |
+------------------+-------------------+------------------------------------+
The following TraceSource types are supported by Probes as of this writing:
@@ -417,17 +422,17 @@ FORMATTED is specified) with a format string such as follows:
+ // Set the labels for this formatted output file.
+ fileHelper.Set2dFormat ("Time (Seconds) = %.3e\tPacket Byte Count = %.0f");
Finally, the probe of interest must be hooked. Again, the probeName and
probeTrace variables in this example are used, and the probe's output
Finally, the trace source of interest must be hooked. Again, the probeType and
tracePath variables in this example are used, and the probe's output
trace source "OutputBytes" is hooked:
::
+
+ // Specify the probe type, probe path (in configuration namespace), and
+ // Specify the probe type, trace source path (in configuration namespace), and
+ // probe output trace source ("OutputBytes") to write.
+ fileHelper.WriteProbe (probeName,
+ probeTrace,
+ fileHelper.WriteProbe (probeType,
+ tracePath,
+ "OutputBytes");
+
+177 -59
View File
@@ -62,7 +62,7 @@ and running on the target system.
The |ns3| code is available in Mercurial repositories on the server
http://code.nsnam.org. You can also download a tarball release at
http://www.nsnam.org/releases/, or you can work with repositories
http://www.nsnam.org/release/, or you can work with repositories
using Mercurial. We recommend using Mercurial unless there's a good reason
not to. See the end of this section for instructions on how to get a tarball
release.
@@ -72,6 +72,12 @@ The simplest way to get started using Mercurial repositories is to use the
downloading and building of various subsystems of |ns3| for you. We
recommend that you begin your |ns3| work in this environment.
One practice is to create a directory called ``workspace`` in one's home
directory under which one can keep local Mercurial repositories.
Any directory name will do, but we'll assume that ``workspace`` is used
herein (note: ``repos`` may also be used in some documentation as
an example directory name).
Downloading |ns3| Using a Tarball
+++++++++++++++++++++++++++++++++
@@ -90,32 +96,37 @@ get a copy of a release by typing the following into your Linux shell
$ cd
$ mkdir workspace
$ cd workspace
$ wget http://www.nsnam.org/releases/ns-allinone-3.20.tar.bz2
$ tar xjf ns-allinone-3.20.tar.bz2
$ wget http://www.nsnam.org/release/ns-allinone-3.23.tar.bz2
$ tar xjf ns-allinone-3.23.tar.bz2
If you change into the directory ``ns-allinone-3.20`` you should see a
If you change into the directory ``ns-allinone-3.23`` you should see a
number of files::
$ ls
bake constants.py ns-3.20 README
build.py netanim-3.103 pybindgen-0.16.0.825 util.py
bake constants.py ns-3.23 README
build.py netanim-3.106 pybindgen-0.17.0.886 util.py
You are now ready to build the |ns3| distribution.
You are now ready to build the base |ns3| distribution.
Downloading |ns3| Using Bake
++++++++++++++++++++++++++++
Bake is a tool for distributed integration and building,
developed for the |ns3| project.  First of all, Bake is
developed in Python, and should be fetched from the project's
master code repositories using a tool called Mercurial, so to
run Bake one must have Python and mercurial on one's machine.
developed for the |ns3| project.  Bake can be used to fetch development
versions of the |ns3| software, and to download and build extensions to the
base |ns3| distribution, such as the Direct Code Execution environment,
Network Simulation Cradle, ability to create new Python bindings, and
others.
One practice is to create a directory called ``workspace`` in one's home
directory under which one can keep local Mercurial repositories.
Any directory name will do, but we'll assume that ``workspace`` is used
herein (note: ``repos`` may also be used in some documentation as
an example directory name). You can get a copy of ``bake`` by typing the
In recent |ns3| releases, Bake has been included in the release
tarball. The configuration file included in the released version
will allow one to download any software that was current at the
time of the release. That is, for example, the version of Bake that
is distributed with the ``ns-3.21`` release can be used to fetch components
for that |ns3| release or earlier, but can't be used to fetch components
for later releases (unless the ``bakeconf.xml`` file is updated).
You can also get the most recent copy of ``bake`` by typing the
following into your Linux shell (assuming you have installed Mercurial)::
$ cd
@@ -134,7 +145,7 @@ following displayed,
adding changesets
adding manifests
adding file changes
added 252 changesets with 661 changes to 62 files
added 339 changesets with 796 changes to 63 files
updating to branch default
45 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -152,10 +163,10 @@ distribution of your choice.
There are a few configuration targets available:
1. ``ns-3.20``: the module corresponding to the release; it will download
1. ``ns-3.23``: 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.20``: the module that includes other optional features
3. ``ns-allinone-3.23``: 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
@@ -173,7 +184,7 @@ code either by inspection of the repository list or by going to the
`"ns-3 Releases"
<http://www.nsnam.org/releases>`_
web page and clicking on the latest release link. We'll proceed in
this tutorial example with ``ns-3.20``.
this tutorial example with ``ns-3.23``.
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.
@@ -182,19 +193,24 @@ bake works by downloading source packages into a source directory,
and installing libraries into a build directory. bake can be run
by referencing the binary, but if one chooses to run bake from
outside of the directory it was downloaded into, it is advisable
to put bake into your path, such as follows (Linux bash shell example)::
to put bake into your path, such as follows (Linux bash shell example).
First, change into the 'bake' directory, and then set the following
environment variables
$ export BAKE_HOME=`pwd`/bake
$ export PATH=$PATH:$BAKE_HOME
$ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
::
However, setting environment variables is not strictly necessary to
complete this tutorial, so we'll call bake directly by specifying the path
to it in our shell commands.
$ export BAKE_HOME=`pwd`
$ export PATH=$PATH:$BAKE_HOME:$BAKE_HOME/build/bin
$ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME:$BAKE_HOME/build/lib
This will put the bake.py program into the shell's path, and will allow
other programs to find executables and libraries created by bake. Although
several bake use cases do not require setting PATH and PYTHONPATH as above,
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.20
$ ./bake.py configure -e ns-3.23
Next, we'l ask bake to check whether we have enough tools to download
various components. Type::
@@ -227,7 +243,9 @@ You should see something like the following,
In particular, download tools such as Mercurial, CVS, GIT, and Bazaar
are our principal concerns at this point, since they allow us to fetch
the code. Please install missing tools at this stage if you are able to.
the code. Please install missing tools at this stage, in the usual
way for your system (if you are able to), or contact your system
administrator as needed to install these tools.
Next, try to download the software::
@@ -238,17 +256,17 @@ should yield something like::
>> Searching for system dependency pygoocanvas - OK
>> Searching for system dependency python-dev - OK
>> Searching for system dependency pygraphviz - OK
>> Downloading pybindgen-0.16.0.825 - OK
>> Downloading pybindgen-0.17.0.886 - OK
>> Searching for system dependency g++ - OK
>> Searching for system dependency qt4 - OK
>> Downloading netanim-3.103 - OK
>> Downloading ns-3.20 - OK
>> Downloading netanim-3.106 - OK
>> Downloading ns-3.23 - OK
The above suggests that three sources have been downloaded. Check the
``source`` directory now and type ``ls``; one should see::
$ ls
netanim-3.103 ns-3.20 pybindgen-0.16.0.825
netanim-3.106 ns-3.23 pybindgen-0.17.0.886
You are now ready to build the |ns3| distribution.
@@ -267,7 +285,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.20`` under your ``~/workspace`` directory.
``ns-allinone-3.23`` under your ``~/workspace`` directory.
Type the following::
$ ./build.py --enable-examples --enable-tests
@@ -281,31 +299,31 @@ are not necessary for your work, if you wish.
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 magic words::
following::
Waf: Leaving directory `/path/to/workspace/ns-allinone-3.20/ns-3.20/build'
Waf: Leaving directory `/path/to/workspace/ns-allinone-3.23/ns-3.23/build'
'build' finished successfully (6m25.032s)
Modules built:
antenna aodv applications
bridge buildings config-store
core csma csma-layout
dsdv dsr emu
energy fd-net-device flow-monitor
internet lte mesh
dsdv dsr energy
fd-net-device flow-monitor internet
lr-wpan lte mesh
mobility mpi netanim (no Python)
network nix-vector-routing olsr
point-to-point point-to-point-layout propagation
spectrum stats tap-bridge
test (no Python) tools topology-read
uan virtual-net-device wifi
wimax
sixlowpan spectrum stats
tap-bridge test (no Python) topology-read
uan virtual-net-device wave
wifi wimax
Modules not built (see ns-3 tutorial for explanation):
brite click openflow
visualizer
Leaving directory `./ns-3.20'
Leaving directory `./ns-3.23'
Regarding the portion about modules not built::
@@ -331,9 +349,9 @@ may continue to use it to build |ns3|. Type
and you should see something like::
>> Building pybindgen-0.16.0.825 - OK
>> Building netanim-3.103 - OK
>> Building ns-3.20 - OK
>> Building pybindgen-0.17.0.886 - OK
>> Building netanim-3.106 - OK
>> Building ns-3.23 - OK
*Hint: you can also perform both steps, download and build by calling 'bake.py deploy'.*
@@ -478,6 +496,29 @@ the |ns3| programs by simply typing
Okay, sorry, I made you build the |ns3| part of the system twice,
but now you know how to change the configuration and build optimized code.
The build.py script discussed above supports also the ``--enable-examples``
and ``enable-tests`` arguments, but in general, does not directly support
other waf options; for example, this will not work:
::
$ ./build.py --disable-python
will result in
::
build.py: error: no such option: --disable-python
However, the special operator ``--`` can be used to pass additional
options through to waf, so instead of the above, the following will work:
::
$ ./build.py -- --disable-python
as it generates the underlying command ``./waf configure --disable-python``.
Here are a few more introductory tips about Waf.
Configure vs. Build
@@ -513,6 +554,38 @@ We already saw how you can configure Waf for ``debug`` or ``optimized`` builds::
There is also an intermediate build profile, ``release``. ``-d`` is a
synonym for ``--build-profile``.
The build profile controls the use of logging, assertions, and compiler optimization:
+--------------------+---------------------------------+-----------------------------------------------------------------+
| Feature | Build Profile |
+ +---------------------------------+-------------------------------+---------------------------------+
| | ``debug`` | ``release`` | ``optimized`` |
+====================+=================================+===============================+=================================+
| Enabled Features | | ``NS3_BUILD_PROFILE_DEBUG`` | ``NS3_BUILD_PROFILE_RELEASE`` | ``NS3_BUILD_PROFILE_OPTIMIZED`` |
| | | ``NS_LOG...`` | | |
| | | ``NS_ASSERT...`` | | |
+--------------------+---------------------------------+-------------------------------+---------------------------------+
| Code Wrapper Macro | ``NS_BUILD_DEBUG(code)`` | ``NS_BUILD_RELEASE(code)`` | ``NS_BUILD_OPTIMIZED(code)`` |
+--------------------+---------------------------------+-------------------------------+---------------------------------+
| Compiler Flags | ``-O0 -ggdb -g3`` | ``-O3 -g0`` | ``-O3 -g`` |
| | | ``-fomit-frame-pointer`` | ``-fstrict-overflow`` |
| | | | ``-march=native`` |
+--------------------+---------------------------------+-------------------------------+---------------------------------+
As you can see, logging and assertions are only available in debug builds.
Recommended practice is to develop your scenario in debug mode, then
conduct repetitive runs (for statistics or changing parameters) in
optimized build profile.
If you have code that should only run in specific build profiles,
use the indicated Code Wrapper macro:
.. sourcecode:: cpp
NS_BUILD_DEBUG (std::cout << "Part of an output line..." << std::flush; timer.Start ());
DoLongInvolvedComputation ();
NS_BUILD_DEBUG (timer.Stop (); std::cout << "Done: " << timer << std::endl;)
By default Waf puts the build artifacts in the ``build`` directory.
You can specify a different output directory with the ``--out``
option, e.g.
@@ -549,8 +622,8 @@ to define some environment variables to help you avoid mistakes::
$ ./waf configure $NS3CONFIG $NS3OPT
$ ./waf build
Compilers
=========
Compilers and Flags
===================
In the examples above, Waf uses the GCC C++ compiler, ``g++``, for
building |ns3|. However, it's possible to change the C++ compiler used by Waf
@@ -573,6 +646,49 @@ More info on ``distcc`` and distributed compilation can be found on it's
<http://code.google.com/p/distcc/>`_
under Documentation section.
To add compiler flags, use the ``CXXFLAGS_EXTRA`` environment variable when
you configure |ns3|.
Install
=======
Waf may be used to install libraries in various places on the system.
The default location where libraries and executables are built is
in the ``build`` directory, and because Waf knows the location of these
libraries and executables, it is not necessary to install the libraries
elsewhere.
If users choose to install things outside of the build directory, users
may issue the ``./waf install`` command. By default, the prefix for
installation is ``/usr/local``, so ``./waf install`` will install programs
into ``/usr/local/bin``, libraries into ``/usr/local/lib``, and headers
into ``/usr/local/include``. Superuser privileges are typically needed
to install to the default prefix, so the typical command would be
``sudo ./waf install``. When running programs with Waf, Waf will
first prefer to use shared libraries in the build directory, then
will look for libraries in the library path configured in the local
environment. So when installing libraries to the system, it is good
practice to check that the intended libraries are being used.
Users may choose to install to a different prefix by passing the ``--prefix``
option at configure time, such as:
::
./waf configure --prefix=/opt/local
If later after the build the user issues the ``./waf install`` command, the
prefix ``/opt/local`` will be used.
The ``./waf clean`` command should be used prior to reconfiguring
the project if Waf will be used to install things at a different prefix.
In summary, it is not necessary to call ``./waf install`` to use |ns3|.
Most users will not need this command since Waf will pick up the
current libraries from the ``build`` directory, but some users may find
it useful if their use case involves working with programs outside
of the |ns3| directory.
One Waf
=======
@@ -583,7 +699,7 @@ remember where you are, and invoke Waf like this::
$ ../../../waf ...
but that get's tedious, and error prone, and there are better solutions.
but that gets tedious, and error prone, and there are better solutions.
If you have the full |ns3| repository this little gem is a start::
@@ -725,17 +841,19 @@ using the provided command line template,
inserting the program name for the ``%s`` placeholder.
(I admit this is a bit awkward, but that's the way it is. Patches welcome!)
Another particularly useful example is to run the ``mytest`` test suite
by itself. Above, we used the ``./test.py`` script to run a whole slew of
Another particularly useful example is to run a test suite by itself.
Let's assume that a ``mytest`` test suite exists (it doesn't).
Above, we used the ``./test.py`` script to run a whole slew of
tests in parallel, by repeatedly invoking the real testing program,
``test-runner``. To invoke ``test-runner`` directly for a single test::
$ ./waf --run test-runner --command-template="% --suite=mytest --verbose"
$ ./waf --run test-runner --command-template="%s --suite=mytest --verbose"
This passes the arguments to the ``test-runner`` program. To print the
available ``test-runner`` options::
This passes the arguments to the ``test-runner`` program.
Since ``mytest`` does not exist, an error message will be generated.
To print the available ``test-runner`` options::
$ ./waf --run test-runner --command-template="% --help"
$ ./waf --run test-runner --command-template="%s --help"
Debugging
+++++++++
@@ -744,7 +862,7 @@ To run |ns3| programs under the control of another utility, such as
a debugger (*e.g.* ``gdb``) or memory checker (*e.g.* ``valgrind``),
you use a similar ``--command-template="..."`` form.
For example, to run your |ns3| program ``mysim`` with the arguments
For example, to run your |ns3| program ``hello-simulator`` with the arguments
``<args>`` under the ``gdb`` debugger::
$ ./waf --run=hello-simulator --command-template="gdb %s --args <args>"
@@ -765,7 +883,7 @@ debugger::
Working Directory
+++++++++++++++++
Waf needs to run from it's location at the top of the |ns3| tree.
Waf needs to run from its location at the top of the |ns3| tree.
This becomes the working directory where output files will be written.
But what if you want to keep those ouf to the |ns3| source tree? Use
the ``--cwd`` argument::
File diff suppressed because it is too large. Load diff
+46
View File
@@ -5,6 +5,8 @@
Tweaking
--------
.. _UsingLogging:
Using the Logging Module
************************
@@ -412,6 +414,8 @@ message,
Using Command Line Arguments
****************************
.. _Attribute:
Overriding Default Attributes
+++++++++++++++++++++++++++++
Another way you can change how |ns3| scripts behave without editing
@@ -628,6 +632,46 @@ end up looking something like,
--ns3::PointToPointChannel::Delay=2ms
--ns3::UdpEchoClient::MaxPackets=2"
A natural question to arise at this point is how to learn about the existence
of all of these attributes. Again, the command line help facility has
a feature for this. If we ask for command line help we should see:
.. sourcecode:: bash
$ ./waf --run "scratch/myfirst --PrintHelp"
myfirst [Program Arguments] [General Arguments]
General Arguments:
--PrintGlobals: Print the list of globals.
--PrintGroups: Print the list of groups.
--PrintGroup=[group]: Print all TypeIds of group.
--PrintTypeIds: Print all TypeIds.
--PrintAttributes=[typeid]: Print all attributes of typeid.
--PrintHelp: Print this help message.
If you select the "PrintGroups" argument, you should see a list of all
registered TypeId groups. The group names are aligned with the module names
in the source directory (although with a leading capital letter). Printing
out all of the information at once would be too much, so a further filter
is available to print information on a per-group basis. So, focusing
again on the point-to-point module:
.. sourcecode:: bash
./waf --run "scratch/myfirst --PrintGroup=PointToPoint"
TypeIds in group PointToPoint:
ns3::PointToPointChannel
ns3::PointToPointNetDevice
ns3::PointToPointRemoteChannel
ns3::PppHeader
and from here, one can find the possible TypeId names to search for
attributes, such as in the ``--PrintAttributes=ns3::PointToPointChannel``
example shown above.
Another way to find out about attributes is through the ns-3 Doxygen; there
is a page that lists out all of the registered attributes in the simulator.
Hooking Your Own Values
+++++++++++++++++++++++
You can also add your own hooks to the command line system. This is done
@@ -722,6 +766,8 @@ they will automatically be available for setting by your users through the
command line system. If you are a script author, you can add new variables to
your scripts and hook them into the command line system quite painlessly.
.. _UsingTracingSystem:
Using the Tracing System
************************
+2 -2
View File
@@ -31,10 +31,10 @@
#include <vector>
#include <string>
NS_LOG_COMPONENT_DEFINE ("EnergyExample");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("EnergyExample");
static inline std::string
PrintReceivedPacket (Address& from)
{
@@ -0,0 +1,337 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014 Wireless Communications and Networking Group (WCNG),
* University of Rochester, Rochester, NY, USA.
*
* 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: Cristiano Tapparello <cristiano.tapparello@rochester.edu>
*/
/**
*
* This example extends the energy model example by connecting a basic energy
* harvester to the nodes.
*
* 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
* by a BasicEnergyHarvester, and the WiFi radio consumes energy for the transmission/
* reception of the packets.
*
* For the receiver node, the example prints the energy consumption of the WiFi radio,
* the power harvested by the energy harvester and the residual energy in the
* energy source.
*
* The nodes initial energy is set to 1.0 J, the transmission and reception entail a
* current consumption of 0.0174 A and 0.0197 A, respectively (default values in
* WifiRadioEnergyModel). The energy harvester provides an amount of power that varies
* according to a random variable uniformly distributed in [0 0.1] W, and is updated
* every 1 s. The energy source voltage is 3 V (default value in BasicEnergySource) and
* the residual energy level is updated every 1 second (default value).
*
* The simulation start at time 0 and it is hard stopped at time 10 seconds. Given the
* packet size and the distance between the nodes, each transmission lasts 0.0023s.
* As a result, the destination node receives 10 messages.
*
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store-module.h"
#include "ns3/wifi-module.h"
#include "ns3/energy-module.h"
#include "ns3/internet-module.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("EnergyWithHarvestingExample");
static inline std::string
PrintReceivedPacket (Address& from)
{
InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (from);
std::ostringstream oss;
oss << "--\nReceived one packet! Socket: " << iaddr.GetIpv4 ()
<< " port: " << iaddr.GetPort ()
<< " at time = " << Simulator::Now ().GetSeconds ()
<< "\n--";
return oss.str ();
}
/**
* \param socket Pointer to socket.
*
* Packet receiving sink.
*/
void
ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
Address from;
while ((packet = socket->RecvFrom (from)))
{
if (packet->GetSize () > 0)
{
NS_LOG_UNCOND (PrintReceivedPacket (from));
}
}
}
/**
* \param socket Pointer to socket.
* \param pktSize Packet size.
* \param n Pointer to node.
* \param pktCount Number of packets to generate.
* \param pktInterval Packet sending interval.
*
* Traffic generator.
*/
static void
GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, Ptr<Node> n,
uint32_t pktCount, Time pktInterval)
{
if (pktCount > 0)
{
socket->Send (Create<Packet> (pktSize));
Simulator::Schedule (pktInterval, &GenerateTraffic, socket, pktSize, n,
pktCount - 1, pktInterval);
}
else
{
socket->Close ();
}
}
/// Trace function for remaining energy at node.
void
RemainingEnergy (double oldValue, double remainingEnergy)
{
std::cout << Simulator::Now ().GetSeconds ()
<< "s Current remaining energy = " << remainingEnergy << "J" << std::endl;
}
/// 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;
}
/// 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;
}
/// 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;
}
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
bool verbose = false;
// simulation parameters
uint32_t numPackets = 10000; // number of packets to send
double interval = 1; // seconds
double startTime = 0.0; // seconds
double distanceToRx = 100.0; // meters
/*
* This is a magic number used to set the transmit power, based on other
* configuration.
*/
double offset = 81;
// Energy Harvester variables
double harvestingUpdateInterval = 1; // seconds
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 ("numPackets", "Total number of packets to send", numPackets);
cmd.AddValue ("startTime", "Simulation start time", startTime);
cmd.AddValue ("distanceToRx", "X-Axis distance between nodes", distanceToRx);
cmd.AddValue ("verbose", "Turn on all device log components", verbose);
cmd.Parse (argc, argv);
// Convert to time object
Time interPacketInterval = Seconds (interval);
// disable fragmentation for frames below 2200 bytes
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold",
StringValue ("2200"));
// turn off RTS/CTS for frames below 2200 bytes
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold",
StringValue ("2200"));
// Fix non-unicast data rate to be the same as that of unicast
Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",
StringValue (phyMode));
NodeContainer c;
c.Create (2); // create 2 nodes
NodeContainer networkNodes;
networkNodes.Add (c.Get (0));
networkNodes.Add (c.Get (1));
// The below set of helpers will help us to put together the wifi NICs we want
WifiHelper wifi;
if (verbose)
{
wifi.EnableLogComponents ();
}
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
/** Wifi PHY **/
/***************************************************************************/
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
wifiPhy.Set ("RxGain", DoubleValue (-10));
wifiPhy.Set ("TxGain", DoubleValue (offset + Prss));
wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0));
/***************************************************************************/
/** wifi channel **/
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
// create wifi channel
Ptr<YansWifiChannel> wifiChannelPtr = wifiChannel.Create ();
wifiPhy.SetChannel (wifiChannelPtr);
/** MAC layer **/
// Add a non-QoS upper MAC, and disable rate control
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",
StringValue (phyMode), "ControlMode",
StringValue (phyMode));
// Set it to ad-hoc mode
wifiMac.SetType ("ns3::AdhocWifiMac");
/** install PHY + MAC **/
NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, networkNodes);
/** mobility **/
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (2 * distanceToRx, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (c);
/** Energy Model **/
/***************************************************************************/
/* energy source */
BasicEnergySourceHelper basicSourceHelper;
// configure energy source
basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (1.0));
// install source
EnergySourceContainer sources = basicSourceHelper.Install (c);
/* device energy model */
WifiRadioEnergyModelHelper radioEnergyHelper;
// configure radio energy model
radioEnergyHelper.Set ("TxCurrentA", DoubleValue (0.0174));
radioEnergyHelper.Set ("RxCurrentA", DoubleValue (0.0197));
// install device model
DeviceEnergyModelContainer deviceModels = radioEnergyHelper.Install (devices, sources);
/* energy harvester */
BasicEnergyHarvesterHelper basicHarvesterHelper;
// configure energy harvester
basicHarvesterHelper.Set ("PeriodicHarvestedPowerUpdateInterval", TimeValue (Seconds (harvestingUpdateInterval)));
basicHarvesterHelper.Set ("HarvestablePower", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=0.1]"));
// install harvester on all energy sources
EnergyHarvesterContainer harvesters = basicHarvesterHelper.Install (sources);
/***************************************************************************/
/** Internet stack **/
InternetStackHelper internet;
internet.Install (networkNodes);
Ipv4AddressHelper ipv4;
NS_LOG_INFO ("Assign IP Addresses.");
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = ipv4.Assign (devices);
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
Ptr<Socket> recvSink = Socket::CreateSocket (networkNodes.Get (1), tid); // node 1, Destination
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
recvSink->Bind (local);
recvSink->SetRecvCallback (MakeCallback (&ReceivePacket));
Ptr<Socket> source = Socket::CreateSocket (networkNodes.Get (0), tid); // node 0, Source
InetSocketAddress remote = InetSocketAddress (Ipv4Address::GetBroadcast (), 80);
source->SetAllowBroadcast (true);
source->Connect (remote);
/** connect trace sources **/
/***************************************************************************/
// all traces are connected to node 1 (Destination)
// energy source
Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource> (sources.Get (1));
basicSourcePtr->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy));
// device energy model
Ptr<DeviceEnergyModel> basicRadioModelPtr =
basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
NS_ASSERT (basicRadioModelPtr != 0);
basicRadioModelPtr->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy));
// energy harvester
Ptr<BasicEnergyHarvester> basicHarvesterPtr = DynamicCast<BasicEnergyHarvester> (harvesters.Get (1));
basicHarvesterPtr->TraceConnectWithoutContext ("HarvestedPower", MakeCallback (&HarvestedPower));
basicHarvesterPtr->TraceConnectWithoutContext ("TotalEnergyHarvested", MakeCallback (&TotalEnergyHarvested));
/***************************************************************************/
/** simulation setup **/
// start traffic
Simulator::Schedule (Seconds (startTime), &GenerateTraffic, source, PpacketSize,
networkNodes.Get (0), numPackets, interPacketInterval);
Simulator::Stop (Seconds (10.0));
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
+2
View File
@@ -3,3 +3,5 @@
def build(bld):
obj = bld.create_ns3_program('energy-model-example', ['core', 'mobility', 'wifi', 'energy', 'internet'])
obj.source = 'energy-model-example.cc'
obj = bld.create_ns3_program('energy-model-with-harvesting-example', ['core', 'mobility', 'wifi', 'energy', 'internet'])
obj.source = 'energy-model-with-harvesting-example.cc'
-1
View File
@@ -41,7 +41,6 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("FragmentationIpv6Example");
int main (int argc, char** argv)
{
bool verbose = false;
+1
View File
@@ -44,6 +44,7 @@
#include "ns3/csma-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv6-header.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("LooseRoutingIpv6Example");
-2
View File
@@ -132,7 +132,6 @@ int main (int argc, char** argv)
tmp2.Add (d1.Get (1)); /* R */
Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
iicr1.SetForwarding (0, true);
iicr1.SetDefaultRouteInAllNodes (0);
iic1.Add (iicr1);
/* add another IPv6 address for second prefix advertised on first subnet */
@@ -145,7 +144,6 @@ int main (int argc, char** argv)
tmp3.Add (d2.Get (0)); /* R */
Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
iicr2.SetForwarding (0, true);
iicr2.SetDefaultRouteInAllNodes (0);
NetDeviceContainer tmp4;
tmp4.Add (d2.Get (1)); /* n1 */
+6 -3
View File
@@ -97,7 +97,6 @@ int main (int argc, char** argv)
tmp2.Add (d1.Get (1)); /* R */
Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
iicr1.SetForwarding (0, true);
iicr1.SetDefaultRouteInAllNodes (0);
iic1.Add (iicr1);
/* second subnet R - n1 */
@@ -106,7 +105,6 @@ int main (int argc, char** argv)
tmp3.Add (d2.Get (0)); /* R */
Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
iicr2.SetForwarding (0, true);
iicr2.SetDefaultRouteInAllNodes (0);
NetDeviceContainer tmp4;
tmp4.Add (d2.Get (1)); /* n1 */
@@ -115,10 +113,15 @@ int main (int argc, char** argv)
/* radvd configuration */
RadvdHelper radvdHelper;
/* R interface (n0 - R) */
radvdHelper.AddAnnouncedPrefix(iic1.GetInterfaceIndex (1), Ipv6Address("2001:1::0"), 64);
/* n0 will receive unsolicited (periodic) RA */
radvdHelper.AddAnnouncedPrefix (iic1.GetInterfaceIndex (1), Ipv6Address("2001:1::0"), 64);
/* R interface (R - n1) */
/* n1 will have to use RS, as RA are not sent automatically */
radvdHelper.AddAnnouncedPrefix(iic2.GetInterfaceIndex (1), Ipv6Address("2001:2::0"), 64);
radvdHelper.GetRadvdInterface (iic2.GetInterfaceIndex (1))->SetSendAdvert (false);
ApplicationContainer radvdApps = radvdHelper.Install (r);
radvdApps.Start (Seconds (1.0));
+2 -2
View File
@@ -24,10 +24,10 @@
#include "ns3/node.h"
#include "ns3/mac48-address.h"
NS_LOG_COMPONENT_DEFINE ("TestIpv6");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TestIpv6");
int
main (int argc, char *argv[])
{
+9 -6
View File
@@ -1,13 +1,13 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('icmpv6-redirect', ['csma', 'internet'])
obj = bld.create_ns3_program('icmpv6-redirect', ['csma', 'internet', 'applications'])
obj.source = 'icmpv6-redirect.cc'
obj = bld.create_ns3_program('ping6', ['csma', 'internet'])
obj = bld.create_ns3_program('ping6', ['csma', 'internet', 'applications'])
obj.source = 'ping6.cc'
obj = bld.create_ns3_program('radvd', ['csma', 'internet'])
obj = bld.create_ns3_program('radvd', ['csma', 'internet', 'applications'])
obj.source = 'radvd.cc'
obj = bld.create_ns3_program('radvd-two-prefix', ['csma', 'internet', 'applications'])
@@ -16,12 +16,15 @@ def build(bld):
obj = bld.create_ns3_program('test-ipv6', ['point-to-point', 'internet'])
obj.source = 'test-ipv6.cc'
obj = bld.create_ns3_program('fragmentation-ipv6', ['csma', 'internet'])
obj = bld.create_ns3_program('fragmentation-ipv6', ['csma', 'internet', 'applications'])
obj.source = 'fragmentation-ipv6.cc'
obj = bld.create_ns3_program('fragmentation-ipv6-two-MTU', ['csma', 'internet'])
obj = bld.create_ns3_program('fragmentation-ipv6-two-MTU', ['csma', 'internet', 'applications'])
obj.source = 'fragmentation-ipv6-two-MTU.cc'
obj = bld.create_ns3_program('loose-routing-ipv6', ['csma', 'internet'])
obj = bld.create_ns3_program('loose-routing-ipv6', ['csma', 'internet', 'applications'])
obj.source = 'loose-routing-ipv6.cc'
obj = bld.create_ns3_program('wsn-ping6', ['lr-wpan', 'internet', 'sixlowpan', 'mobility', 'applications'])
obj.source = 'wsn-ping6.cc'
+141
View File
@@ -0,0 +1,141 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014 Universita' di Firenze
*
* 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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
*/
// Network topology
//
// n0 n1
// | |
// =================
// WSN (802.15.4)
//
// - ICMPv6 echo request flows from n0 to n1 and back with ICMPv6 echo reply
// - DropTail queues
// - Tracing of queues and packet receptions to file "wsn-ping6.tr"
//
// This example is based on the "ping6.cc" example.
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/internet-module.h"
#include "ns3/sixlowpan-module.h"
#include "ns3/lr-wpan-module.h"
#include "ns3/applications-module.h"
#include "ns3/mobility-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("Ping6WsnExample");
int main (int argc, char **argv)
{
bool verbose = false;
CommandLine cmd;
cmd.AddValue ("verbose", "turn on log components", verbose);
cmd.Parse (argc, argv);
if (verbose)
{
LogComponentEnable ("Ping6WsnExample", LOG_LEVEL_INFO);
LogComponentEnable ("Ipv6EndPointDemux", LOG_LEVEL_ALL);
LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL);
LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL);
LogComponentEnable ("Ipv6ListRouting", LOG_LEVEL_ALL);
LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL);
LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL);
LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL);
LogComponentEnable ("NdiscCache", LOG_LEVEL_ALL);
LogComponentEnable ("SixLowPanNetDevice", LOG_LEVEL_ALL);
}
NS_LOG_INFO ("Create nodes.");
NodeContainer nodes;
nodes.Create (2);
// Set seed for random numbers
SeedManager::SetSeed (167);
// Install mobility
MobilityHelper mobility;
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
Ptr<ListPositionAllocator> nodesPositionAlloc = CreateObject<ListPositionAllocator> ();
nodesPositionAlloc->Add (Vector (0.0, 0.0, 0.0));
nodesPositionAlloc->Add (Vector (50.0, 0.0, 0.0));
mobility.SetPositionAllocator (nodesPositionAlloc);
mobility.Install (nodes);
NS_LOG_INFO ("Create channels.");
LrWpanHelper lrWpanHelper;
// Add and install the LrWpanNetDevice for each node
// lrWpanHelper.EnableLogComponents();
NetDeviceContainer devContainer = lrWpanHelper.Install(nodes);
lrWpanHelper.AssociateToPan (devContainer, 10);
std::cout << "Created " << devContainer.GetN() << " devices" << std::endl;
std::cout << "There are " << nodes.GetN() << " nodes" << std::endl;
/* Install IPv4/IPv6 stack */
NS_LOG_INFO ("Install Internet stack.");
InternetStackHelper internetv6;
internetv6.SetIpv4StackInstall (false);
internetv6.Install (nodes);
// Install 6LowPan layer
NS_LOG_INFO ("Install 6LoWPAN.");
SixLowPanHelper sixlowpan;
NetDeviceContainer six1 = sixlowpan.Install (devContainer);
NS_LOG_INFO ("Assign addresses.");
Ipv6AddressHelper ipv6;
ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
Ipv6InterfaceContainer i = ipv6.Assign (six1);
NS_LOG_INFO ("Create Applications.");
/* Create a Ping6 application to send ICMPv6 echo request from node zero to
* all-nodes (ff02::1).
*/
uint32_t packetSize = 10;
uint32_t maxPacketCount = 5;
Time interPacketInterval = Seconds (1.);
Ping6Helper ping6;
ping6.SetLocal (i.GetAddress (0, 1));
ping6.SetRemote (i.GetAddress (1, 1));
// ping6.SetRemote (Ipv6Address::GetAllNodesMulticast ());
ping6.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
ping6.SetAttribute ("Interval", TimeValue (interPacketInterval));
ping6.SetAttribute ("PacketSize", UintegerValue (packetSize));
ApplicationContainer apps = ping6.Install (nodes.Get (0));
apps.Start (Seconds (2.0));
apps.Stop (Seconds (10.0));
AsciiTraceHelper ascii;
lrWpanHelper.EnableAsciiAll (ascii.CreateFileStream ("ping6wsn.tr"));
lrWpanHelper.EnablePcapAll (std::string ("ping6wsn"), true);
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+1 -1
View File
@@ -1,5 +1,5 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('object-names', ['core', 'csma', 'internet'])
obj = bld.create_ns3_program('object-names', ['core', 'csma', 'internet', 'applications'])
obj.source = 'object-names.cc'
+4 -3
View File
@@ -1,7 +1,8 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet'])
obj.source = 'realtime-udp-echo.cc'
if bld.env["ENABLE_REAL_TIME"]:
obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet', 'applications'])
obj.source = 'realtime-udp-echo.cc'
bld.register_ns3_script('realtime-udp-echo.py', ['csma', 'internet', 'applications'])
bld.register_ns3_script('realtime-udp-echo.py', ['csma', 'internet', 'applications'])
+1 -1
View File
@@ -343,7 +343,7 @@ RoutingExperiment::Run (int nSinks, double txp, std::string CSVfileName)
onoff1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
onoff1.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
for (int i = 0; i <= nSinks - 1; i++)
for (int i = 0; i < nSinks; i++)
{
Ptr<Socket> sink = SetupPacketReceive (adhocInterfaces.GetAddress (i), adhocNodes.Get (i));
+6 -4
View File
@@ -70,12 +70,14 @@ def main(argv):
# Create networks and assign IPv6 Addresses
print "Addressing"
ipv6 = ns.internet.Ipv6AddressHelper();
ipv6.NewNetwork(ns.network.Ipv6Address("2001:1::"), ns.network.Ipv6Prefix(64));
ipv6.SetBase(ns.network.Ipv6Address("2001:1::"), ns.network.Ipv6Prefix(64));
i1 = ipv6.Assign(d1);
i1.SetRouter(1, True);
ipv6.NewNetwork(ns.network.Ipv6Address("2001:2::"), ns.network.Ipv6Prefix(64));
i1.SetForwarding(1, True);
i1.SetDefaultRouteInAllNodes(1);
ipv6.SetBase(ns.network.Ipv6Address("2001:2::"), ns.network.Ipv6Prefix(64));
i2 = ipv6.Assign(d2);
i2.SetRouter(0, True);
i2.SetForwarding(0, True);
i2.SetDefaultRouteInAllNodes(0);
# Create a Ping6 application to send ICMPv6 echo request from n0 to n1 via r
print "Application"
+7 -7
View File
@@ -2,19 +2,19 @@
def build(bld):
obj = bld.create_ns3_program('dynamic-global-routing',
['point-to-point', 'csma', 'internet'])
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'dynamic-global-routing.cc'
obj = bld.create_ns3_program('static-routing-slash32',
['point-to-point', 'csma', 'internet'])
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'static-routing-slash32.cc'
obj = bld.create_ns3_program('global-routing-slash32',
['point-to-point', 'csma', 'internet'])
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'global-routing-slash32.cc'
obj = bld.create_ns3_program('global-injection-slash32',
['point-to-point', 'csma', 'internet'])
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'global-injection-slash32.cc'
obj = bld.create_ns3_program('simple-global-routing',
@@ -25,12 +25,12 @@ def build(bld):
['point-to-point', 'internet', 'applications'])
obj.source = 'simple-alternate-routing.cc'
obj = bld.create_ns3_program( 'mixed-global-routing',
['point-to-point', 'internet', 'csma'])
obj = bld.create_ns3_program('mixed-global-routing',
['point-to-point', 'internet', 'csma', 'applications'])
obj.source = 'mixed-global-routing.cc'
obj = bld.create_ns3_program('simple-routing-ping6',
['csma', 'internet'])
['csma', 'internet', 'applications'])
obj.source = 'simple-routing-ping6.cc'
obj = bld.create_ns3_program('manet-routing-compare',
+1 -1
View File
@@ -4,7 +4,7 @@ def build(bld):
obj = bld.create_ns3_program('socket-bound-static-routing', ['network', 'csma', 'point-to-point', 'internet'])
obj.source = 'socket-bound-static-routing.cc'
obj = bld.create_ns3_program('socket-bound-tcp-static-routing', ['network', 'csma', 'point-to-point', 'internet'])
obj = bld.create_ns3_program('socket-bound-tcp-static-routing', ['network', 'csma', 'point-to-point', 'internet', 'applications'])
obj.source = 'socket-bound-tcp-static-routing.cc'
obj = bld.create_ns3_program('socket-options-ipv4', ['network', 'csma', 'point-to-point', 'internet'])
+2 -1
View File
@@ -66,7 +66,8 @@ Sender::GetTypeId (void)
MakePointerAccessor (&Sender::m_interval),
MakePointerChecker <RandomVariableStream>())
.AddTraceSource ("Tx", "A new packet is created and is sent",
MakeTraceSourceAccessor (&Sender::m_txTrace))
MakeTraceSourceAccessor (&Sender::m_txTrace),
"ns3::Packet::TracedCallback")
;
return tid;
}
-3
View File
@@ -49,9 +49,6 @@ using namespace std;
NS_LOG_COMPONENT_DEFINE ("WiFiDistanceExperiment");
void TxCallback (Ptr<CounterCalculator<uint32_t> > datac,
std::string path, Ptr<const Packet> packet) {
NS_LOG_INFO ("Sent frame counted in " <<
-1
View File
@@ -44,7 +44,6 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TcpLargeTransfer");
// The number of bytes to send in this simulation.
static const uint32_t totalTxBytes = 2000000;
static uint32_t currentTxBytes = 0;
+37 -6
View File
@@ -21,6 +21,10 @@
* "DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism"
* by Hajime Tazaki, Frederic Urbani and Thierry Turlett presented at WNS3 2013
*
* By default, TCP timestamps, window scale, and SACK are disabled because
* they were not supported in ns-3 at the time of this paper. TCP timestamp
* and window scale can be enabled by command line arguments.
*
*/
#include "ns3/log.h"
@@ -37,11 +41,13 @@ NS_LOG_COMPONENT_DEFINE ("TcpNscComparison");
std::string m_stack = "nsc-linux";
std::string sock_factory;
int m_seed = 1;
uint32_t m_seed = 1;
double startTime = 4.0;
double stopTime = 20.0;
uint32_t m_nNodes = 2;
bool enablePcap = false;
bool enableTimestamps = false;
bool enableWindowScale = false;
int
main (int argc, char *argv[])
@@ -54,13 +60,20 @@ main (int argc, char *argv[])
CommandLine cmd;
cmd.AddValue ("stack", "choose network stack", m_stack);
cmd.AddValue ("seed", "randomize seed", m_seed);
cmd.AddValue ("nNodes", "the number of nodes in left side", m_nNodes);
cmd.AddValue ("nNodes", "the number of source and sink nodes", m_nNodes);
cmd.AddValue ("stopTime", "duration", stopTime);
cmd.AddValue ("enablePcap", "pcap", enablePcap);
cmd.AddValue ("enableTimestamps", "use TCP Timestamps option", enableTimestamps);
cmd.AddValue ("enableWindowScale", "use TCP Window Scale option", enableWindowScale);
cmd.Parse (argc, argv);
SeedManager::SetSeed (m_seed);
if (m_stack != "nsc-linux" && m_stack != "ns3")
{
NS_FATAL_ERROR ("Error, stack named " << m_stack << " is not supported");
}
NodeContainer lefts, routers, rights, nodes;
lefts.Create (m_nNodes);
routers.Create (2);
@@ -73,6 +86,14 @@ main (int argc, char *argv[])
if (m_stack == "ns3")
{
sock_factory = "ns3::TcpSocketFactory";
if (enableTimestamps == false)
{
Config::SetDefault ("ns3::TcpSocketBase::WindowScaling", BooleanValue (false));
}
if (enableWindowScale == false)
{
Config::SetDefault ("ns3::TcpSocketBase::Timestamp", BooleanValue (false));
}
internetStack.Install (nodes);
}
else if (m_stack == "nsc-linux")
@@ -84,10 +105,17 @@ main (int argc, char *argv[])
internetStack.Install (lefts);
internetStack.Install (rights);
//these are not implemented in ns3 tcp so disable for comparison
// at the time this program was written, these were not implemented
// in ns3 tcp, so disable for comparison
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", StringValue ("0"));
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
if (enableTimestamps == false)
{
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
}
if (enableWindowScale == false)
{
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
}
}
PointToPointHelper pointToPoint;
@@ -160,7 +188,10 @@ main (int argc, char *argv[])
apps = sink.Install (rights);
apps.Start (Seconds (3.9999));
pointToPoint.EnablePcapAll ("nsc.pcap");
if (enablePcap)
{
pointToPoint.EnablePcapAll ("nsc.pcap");
}
Simulator::Stop (Seconds (stopTime));
Simulator::Run ();
+178 -143
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013 ResiliNets, ITTC, University of Kansas
* Copyright (c) 2013 ResiliNets, ITTC, University of Kansas
*
* 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
@@ -54,92 +54,105 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TcpVariantsComparison");
double old_time = 0.0;
EventId output;
Time current = Time::FromInteger(3, Time::S); //Only record cwnd and ssthresh values every 3 seconds
bool first = true;
bool firstCwnd = true;
bool firstSshThr = true;
bool firstRtt = true;
bool firstRto = true;
Ptr<OutputStreamWrapper> cWndStream;
Ptr<OutputStreamWrapper> ssThreshStream;
Ptr<OutputStreamWrapper> rttStream;
Ptr<OutputStreamWrapper> rtoStream;
uint32_t cWndValue;
uint32_t ssThreshValue;
static void
OutputTrace ()
CwndTracer (uint32_t oldval, uint32_t newval)
{
// *stream->GetStream() << newtime << " " << newval << std::endl;
// old_time = newval;
}
static void
CwndTracer (Ptr<OutputStreamWrapper>stream, uint32_t oldval, uint32_t newval)
{
double new_time = Simulator::Now().GetSeconds();
if (old_time == 0 && first)
{
double mycurrent = current.GetSeconds();
*stream->GetStream() << new_time << " " << mycurrent << " " << newval << std::endl;
first = false;
output = Simulator::Schedule(current,&OutputTrace);
}
else
{
if (output.IsExpired())
if (firstCwnd)
{
*stream->GetStream() << new_time << " " << newval << std::endl;
output.Cancel();
output = Simulator::Schedule(current,&OutputTrace);
*cWndStream->GetStream () << "0.0 " << oldval << std::endl;
firstCwnd = false;
}
*cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
cWndValue = newval;
if (!firstSshThr)
{
*ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << ssThreshValue << std::endl;
}
}
}
static void
SsThreshTracer (Ptr<OutputStreamWrapper>stream, uint32_t oldval, uint32_t newval)
SsThreshTracer (uint32_t oldval, uint32_t newval)
{
double new_time = Simulator::Now().GetSeconds();
if (old_time == 0 && first)
{
double mycurrent = current.GetSeconds();
*stream->GetStream() << new_time << " " << mycurrent << " " << newval << std::endl;
first = false;
output = Simulator::Schedule(current,&OutputTrace);
}
else
{
if (output.IsExpired())
if (firstSshThr)
{
*stream->GetStream() << new_time << " " << newval << std::endl;
output.Cancel();
output = Simulator::Schedule(current,&OutputTrace);
*ssThreshStream->GetStream () << "0.0 " << oldval << std::endl;
firstSshThr = false;
}
*ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
ssThreshValue = newval;
if (!firstCwnd)
{
*cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << cWndValue << std::endl;
}
}
}
static void
RttTracer (Time oldval, Time newval)
{
if (firstRtt)
{
*rttStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
firstRtt = false;
}
*rttStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
}
static void
RtoTracer (Time oldval, Time newval)
{
if (firstRto)
{
*rtoStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
firstRto = false;
}
*rtoStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
}
static void
TraceCwnd (std::string cwnd_tr_file_name)
{
AsciiTraceHelper ascii;
if (cwnd_tr_file_name.compare("") == 0)
{
NS_LOG_DEBUG ("No trace file for cwnd provided");
return;
}
else
{
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream(cwnd_tr_file_name.c_str());
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",MakeBoundCallback (&CwndTracer, stream));
}
cWndStream = ascii.CreateFileStream (cwnd_tr_file_name.c_str ());
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", MakeCallback (&CwndTracer));
}
static void
TraceSsThresh(std::string ssthresh_tr_file_name)
TraceSsThresh (std::string ssthresh_tr_file_name)
{
AsciiTraceHelper ascii;
if (ssthresh_tr_file_name.compare("") == 0)
{
NS_LOG_DEBUG ("No trace file for ssthresh provided");
return;
}
else
{
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream(ssthresh_tr_file_name.c_str());
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold",MakeBoundCallback (&SsThreshTracer, stream));
}
ssThreshStream = ascii.CreateFileStream (ssthresh_tr_file_name.c_str ());
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold", MakeCallback (&SsThreshTracer));
}
static void
TraceRtt (std::string rtt_tr_file_name)
{
AsciiTraceHelper ascii;
rttStream = ascii.CreateFileStream (rtt_tr_file_name.c_str ());
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTT", MakeCallback (&RttTracer));
}
static void
TraceRto (std::string rto_tr_file_name)
{
AsciiTraceHelper ascii;
rtoStream = ascii.CreateFileStream (rto_tr_file_name.c_str ());
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTO", MakeCallback (&RtoTracer));
}
int main (int argc, char *argv[])
@@ -153,6 +166,8 @@ int main (int argc, char *argv[])
std::string tr_file_name = "";
std::string cwnd_tr_file_name = "";
std::string ssthresh_tr_file_name = "";
std::string rtt_tr_file_name = "";
std::string rto_tr_file_name = "";
double data_mbytes = 0;
uint32_t mtu_bytes = 400;
uint16_t num_flows = 1;
@@ -162,25 +177,27 @@ int main (int argc, char *argv[])
CommandLine cmd;
cmd.AddValue("transport_prot", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot);
cmd.AddValue("error_p", "Packet error rate", error_p);
cmd.AddValue("bandwidth", "Bottleneck bandwidth", bandwidth);
cmd.AddValue("access_bandwidth", "Access link bandwidth", access_bandwidth);
cmd.AddValue("delay", "Access link delay", access_delay);
cmd.AddValue("tracing", "Flag to enable/disable tracing", tracing);
cmd.AddValue("tr_name", "Name of output trace file", tr_file_name);
cmd.AddValue("cwnd_tr_name", "Name of output trace file", cwnd_tr_file_name);
cmd.AddValue("ssthresh_tr_name", "Name of output trace file", ssthresh_tr_file_name);
cmd.AddValue("data", "Number of Megabytes of data to transmit", data_mbytes);
cmd.AddValue("mtu", "Size of IP packets to send in bytes", mtu_bytes);
cmd.AddValue("num_flows", "Number of flows", num_flows);
cmd.AddValue("duration", "Time to allow flows to run in seconds", duration);
cmd.AddValue("run", "Run index (for setting repeatable seeds)", run);
cmd.AddValue("flow_monitor", "Enable flow monitor", flow_monitor);
cmd.AddValue ("transport_prot", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot);
cmd.AddValue ("error_p", "Packet error rate", error_p);
cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth);
cmd.AddValue ("access_bandwidth", "Access link bandwidth", access_bandwidth);
cmd.AddValue ("delay", "Access link delay", access_delay);
cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing);
cmd.AddValue ("tr_name", "Name of output trace file", tr_file_name);
cmd.AddValue ("cwnd_tr_name", "Name of output trace file", cwnd_tr_file_name);
cmd.AddValue ("ssthresh_tr_name", "Name of output trace file", ssthresh_tr_file_name);
cmd.AddValue ("rtt_tr_name", "Name of output trace file", rtt_tr_file_name);
cmd.AddValue ("rto_tr_name", "Name of output trace file", rto_tr_file_name);
cmd.AddValue ("data", "Number of Megabytes of data to transmit", data_mbytes);
cmd.AddValue ("mtu", "Size of IP packets to send in bytes", mtu_bytes);
cmd.AddValue ("num_flows", "Number of flows", num_flows);
cmd.AddValue ("duration", "Time to allow flows to run in seconds", duration);
cmd.AddValue ("run", "Run index (for setting repeatable seeds)", run);
cmd.AddValue ("flow_monitor", "Enable flow monitor", flow_monitor);
cmd.Parse (argc, argv);
SeedManager::SetSeed(1);
SeedManager::SetRun(run);
SeedManager::SetSeed (1);
SeedManager::SetRun (run);
// User may find it convenient to enable logging
//LogComponentEnable("TcpVariantsComparison", LOG_LEVEL_ALL);
@@ -188,12 +205,12 @@ int main (int argc, char *argv[])
//LogComponentEnable("DropTailQueue", LOG_LEVEL_ALL);
// Calculate the ADU size
Header* temp_header = new Ipv4Header();
uint32_t ip_header = temp_header->GetSerializedSize();
Header* temp_header = new Ipv4Header ();
uint32_t ip_header = temp_header->GetSerializedSize ();
NS_LOG_LOGIC ("IP Header size is: " << ip_header);
delete temp_header;
temp_header = new TcpHeader();
uint32_t tcp_header = temp_header->GetSerializedSize();
temp_header = new TcpHeader ();
uint32_t tcp_header = temp_header->GetSerializedSize ();
NS_LOG_LOGIC ("TCP Header size is: " << tcp_header);
delete temp_header;
uint32_t tcp_adu_size = mtu_bytes - (ip_header + tcp_header);
@@ -204,22 +221,28 @@ int main (int argc, char *argv[])
float stop_time = start_time + duration;
// Select TCP variant
if (transport_prot.compare("TcpTahoe") == 0)
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpTahoe::GetTypeId()));
else if (transport_prot.compare("TcpReno") == 0)
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpReno::GetTypeId()));
else if (transport_prot.compare("TcpNewReno") == 0)
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::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 ("TcpTahoe") == 0)
{
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId()));
Config::SetDefault("ns3::TcpWestwood::ProtocolType", EnumValue(TcpWestwood::WESTWOODPLUS));
Config::SetDefault("ns3::TcpWestwood::FilterType", EnumValue(TcpWestwood::TUSTIN));
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpTahoe::GetTypeId ()));
}
else if (transport_prot.compare ("TcpReno") == 0)
{
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpReno::GetTypeId ()));
}
else if (transport_prot.compare ("TcpNewReno") == 0)
{
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::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)
{
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS));
Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
}
else
{
@@ -231,18 +254,18 @@ int main (int argc, char *argv[])
NodeContainer gateways;
gateways.Create (1);
NodeContainer sources;
sources.Create(num_flows);
sources.Create (num_flows);
NodeContainer sinks;
sinks.Create(num_flows);
sinks.Create (num_flows);
// Configure the error model
// Here we use RateErrorModel with packet error rate
Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable>();
Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> ();
uv->SetStream (50);
RateErrorModel error_model;
error_model.SetRandomVariable(uv);
error_model.SetUnit(RateErrorModel::ERROR_UNIT_PACKET);
error_model.SetRate(error_p);
error_model.SetRandomVariable (uv);
error_model.SetUnit (RateErrorModel::ERROR_UNIT_PACKET);
error_model.SetRate (error_p);
PointToPointHelper UnReLink;
UnReLink.SetDeviceAttribute ("DataRate", StringValue (bandwidth));
@@ -262,16 +285,16 @@ int main (int argc, char *argv[])
LocalLink.SetDeviceAttribute ("DataRate", StringValue (access_bandwidth));
LocalLink.SetChannelAttribute ("Delay", StringValue (access_delay));
Ipv4InterfaceContainer sink_interfaces;
for (int i=0; i<num_flows; i++)
for (int i = 0; i < num_flows; i++)
{
NetDeviceContainer devices;
devices = LocalLink.Install(sources.Get(i), gateways.Get(0));
address.NewNetwork();
devices = LocalLink.Install (sources.Get (i), gateways.Get (0));
address.NewNetwork ();
Ipv4InterfaceContainer interfaces = address.Assign (devices);
devices = UnReLink.Install(gateways.Get(0), sinks.Get(i));
address.NewNetwork();
devices = UnReLink.Install (gateways.Get (0), sinks.Get (i));
address.NewNetwork ();
interfaces = address.Assign (devices);
sink_interfaces.Add(interfaces.Get(1));
sink_interfaces.Add (interfaces.Get (1));
}
NS_LOG_INFO ("Initialize Global Routing.");
@@ -281,29 +304,29 @@ int main (int argc, char *argv[])
Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
for(uint16_t i=0; i<sources.GetN(); i++)
for (uint16_t i = 0; i < sources.GetN (); i++)
{
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress(i, 0), port));
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port));
if (transport_prot.compare("TcpTahoe") == 0
|| transport_prot.compare("TcpReno") == 0
|| transport_prot.compare("TcpNewReno") == 0
|| transport_prot.compare("TcpWestwood") == 0
|| transport_prot.compare("TcpWestwoodPlus") == 0)
if (transport_prot.compare ("TcpTahoe") == 0
|| transport_prot.compare ("TcpReno") == 0
|| transport_prot.compare ("TcpNewReno") == 0
|| transport_prot.compare ("TcpWestwood") == 0
|| transport_prot.compare ("TcpWestwoodPlus") == 0)
{
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size));
BulkSendHelper ftp("ns3::TcpSocketFactory", Address());
BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ());
ftp.SetAttribute ("Remote", remoteAddress);
ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size));
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes*1000000)));
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000)));
ApplicationContainer sourceApp = ftp.Install (sources.Get(i));
sourceApp.Start (Seconds (start_time*i));
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.Start (Seconds (start_time * i));
sinkApp.Stop (Seconds (stop_time));
}
else
@@ -316,41 +339,53 @@ int main (int argc, char *argv[])
// Set up tracing if enabled
if (tracing)
{
std::ofstream ascii;
Ptr<OutputStreamWrapper> ascii_wrap;
if (tr_file_name.compare("") == 0)
if (tr_file_name.compare ("") != 0)
{
NS_LOG_DEBUG ("No trace file provided");
exit (1);
}
else
{
ascii.open (tr_file_name.c_str());
ascii_wrap = new OutputStreamWrapper(tr_file_name.c_str(), std::ios::out);
std::ofstream ascii;
Ptr<OutputStreamWrapper> ascii_wrap;
ascii.open (tr_file_name.c_str ());
ascii_wrap = new OutputStreamWrapper (tr_file_name.c_str (), std::ios::out);
stack.EnableAsciiIpv4All (ascii_wrap);
}
stack.EnableAsciiIpv4All (ascii_wrap);
if (cwnd_tr_file_name.compare ("") != 0)
{
Simulator::Schedule (Seconds (0.00001), &TraceCwnd, cwnd_tr_file_name);
}
if (ssthresh_tr_file_name.compare ("") != 0)
{
Simulator::Schedule (Seconds (0.00001), &TraceSsThresh, ssthresh_tr_file_name);
}
if (rtt_tr_file_name.compare ("") != 0)
{
Simulator::Schedule (Seconds (0.00001), &TraceRtt, rtt_tr_file_name);
}
if (rto_tr_file_name.compare ("") != 0)
{
Simulator::Schedule (Seconds (0.00001), &TraceRto, rto_tr_file_name);
}
Simulator::Schedule(Seconds(0.00001), &TraceCwnd, cwnd_tr_file_name);
Simulator::Schedule(Seconds(0.00001), &TraceSsThresh, ssthresh_tr_file_name);
}
UnReLink.EnablePcapAll("TcpVariantsComparison", true);
LocalLink.EnablePcapAll("TcpVariantsComparison", true);
UnReLink.EnablePcapAll ("TcpVariantsComparison", true);
LocalLink.EnablePcapAll ("TcpVariantsComparison", true);
// Flow monitor
FlowMonitorHelper flowHelper;
if (flow_monitor)
{
flowHelper.InstallAll();
flowHelper.InstallAll ();
}
Simulator::Stop (Seconds(stop_time));
Simulator::Stop (Seconds (stop_time));
Simulator::Run ();
if (flow_monitor)
{
flowHelper.SerializeToXmlFile("TcpVariantsComparison.flowmonitor", true, true);
flowHelper.SerializeToXmlFile ("TcpVariantsComparison.flowmonitor", true, true);
}
Simulator::Destroy ();
+4 -3
View File
@@ -35,9 +35,10 @@ stack = ns.internet.InternetStackHelper()
stack.Install(nodes)
address = ns.internet.Ipv4AddressHelper()
address.SetBase(ns.network.Ipv4Address("10.1.1.0"), ns.network.Ipv4Mask("255.255.255.0"))
address.SetBase(ns.network.Ipv4Address("10.1.1.0"),
ns.network.Ipv4Mask("255.255.255.0"))
interfaces = address.Assign (devices);
interfaces = address.Assign(devices)
echoServer = ns.applications.UdpEchoServerHelper(9)
@@ -47,7 +48,7 @@ serverApps.Stop(ns.core.Seconds(10.0))
echoClient = ns.applications.UdpEchoClientHelper(interfaces.GetAddress(1), 9)
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds (1.0)))
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds(1.0)))
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
clientApps = echoClient.Install(nodes.Get(0))
+8 -2
View File
@@ -26,14 +26,20 @@ using namespace ns3;
class MyObject : public Object
{
public:
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void)
{
static TypeId tid = TypeId ("MyObject")
.SetParent (Object::GetTypeId ())
.SetParent<Object> ()
.SetGroupName ("Tutorial")
.AddConstructor<MyObject> ()
.AddTraceSource ("MyInteger",
"An integer value to trace.",
MakeTraceSourceAccessor (&MyObject::m_myInt))
MakeTraceSourceAccessor (&MyObject::m_myInt),
"ns3::TracedValue::Int32Callback")
;
return tid;
}
+2 -2
View File
@@ -16,10 +16,10 @@
#include "ns3/core-module.h"
NS_LOG_COMPONENT_DEFINE ("HelloSimulator");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("HelloSimulator");
int
main (int argc, char *argv[])
{
+102
View File
@@ -0,0 +1,102 @@
# -*- Mode: Python; -*-
# /*
# * 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
# *
# * Ported to Python by Mohit P. Tahiliani
# */
import ns.core
import ns.network
import ns.csma
import ns.internet
import ns.point_to_point
import ns.applications
import sys
# // Default Network Topology
# //
# // 10.1.1.0
# // n0 -------------- n1 n2 n3 n4
# // point-to-point | | | |
# // ================
# // LAN 10.1.2.0
cmd = ns.core.CommandLine()
cmd.nCsma = 3
cmd.verbose = "True"
cmd.AddValue("nCsma", "Number of \"extra\" CSMA nodes/devices")
cmd.AddValue("verbose", "Tell echo applications to log if true")
cmd.Parse(sys.argv)
nCsma = int(cmd.nCsma)
verbose = cmd.verbose
if verbose == "True":
ns.core.LogComponentEnable("UdpEchoClientApplication", ns.core.LOG_LEVEL_INFO)
ns.core.LogComponentEnable("UdpEchoServerApplication", ns.core.LOG_LEVEL_INFO)
nCsma = 1 if int(nCsma) == 0 else int(nCsma)
p2pNodes = ns.network.NodeContainer()
p2pNodes.Create(2)
csmaNodes = ns.network.NodeContainer()
csmaNodes.Add(p2pNodes.Get(1))
csmaNodes.Create(nCsma)
pointToPoint = ns.point_to_point.PointToPointHelper()
pointToPoint.SetDeviceAttribute("DataRate", ns.core.StringValue("5Mbps"))
pointToPoint.SetChannelAttribute("Delay", ns.core.StringValue("2ms"))
p2pDevices = pointToPoint.Install(p2pNodes)
csma = ns.csma.CsmaHelper()
csma.SetChannelAttribute("DataRate", ns.core.StringValue("100Mbps"))
csma.SetChannelAttribute("Delay", ns.core.TimeValue(ns.core.NanoSeconds(6560)))
csmaDevices = csma.Install(csmaNodes)
stack = ns.internet.InternetStackHelper()
stack.Install(p2pNodes.Get(0))
stack.Install(csmaNodes)
address = ns.internet.Ipv4AddressHelper()
address.SetBase(ns.network.Ipv4Address("10.1.1.0"), ns.network.Ipv4Mask("255.255.255.0"))
p2pInterfaces = address.Assign(p2pDevices)
address.SetBase(ns.network.Ipv4Address("10.1.2.0"), ns.network.Ipv4Mask("255.255.255.0"))
csmaInterfaces = address.Assign(csmaDevices)
echoServer = ns.applications.UdpEchoServerHelper(9)
serverApps = echoServer.Install(csmaNodes.Get(nCsma))
serverApps.Start(ns.core.Seconds(1.0))
serverApps.Stop(ns.core.Seconds(10.0))
echoClient = ns.applications.UdpEchoClientHelper(csmaInterfaces.GetAddress(nCsma), 9)
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds (1.0)))
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
clientApps = echoClient.Install(p2pNodes.Get(0))
clientApps.Start(ns.core.Seconds(2.0))
clientApps.Stop(ns.core.Seconds(10.0))
ns.internet.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
pointToPoint.EnablePcapAll("second")
csma.EnablePcap ("second", csmaDevices.Get (1), True)
ns.core.Simulator.Run()
ns.core.Simulator.Destroy()
+28 -12
View File
@@ -66,6 +66,11 @@ public:
MyApp ();
virtual ~MyApp ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate);
private:
@@ -102,6 +107,17 @@ MyApp::~MyApp ()
m_socket = 0;
}
/* static */
TypeId MyApp::GetTypeId (void)
{
static TypeId tid = TypeId ("MyApp")
.SetParent<Application> ()
.SetGroupName ("Tutorial")
.AddConstructor<MyApp> ()
;
return tid;
}
void
MyApp::Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
{
@@ -210,8 +226,8 @@ main (int argc, char *argv[])
uint16_t sinkPort = 8080;
Address sinkAddress;
Address anyAddress;
std::string probeName;
std::string probeTrace;
std::string probeType;
std::string tracePath;
if (useV6 == false)
{
Ipv4AddressHelper address;
@@ -219,8 +235,8 @@ main (int argc, char *argv[])
Ipv4InterfaceContainer interfaces = address.Assign (devices);
sinkAddress = InetSocketAddress (interfaces.GetAddress (1), sinkPort);
anyAddress = InetSocketAddress (Ipv4Address::GetAny (), sinkPort);
probeName = "ns3::Ipv4PacketProbe";
probeTrace = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
probeType = "ns3::Ipv4PacketProbe";
tracePath = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
}
else
{
@@ -229,8 +245,8 @@ main (int argc, char *argv[])
Ipv6InterfaceContainer interfaces = address.Assign (devices);
sinkAddress = Inet6SocketAddress (interfaces.GetAddress (1,1), sinkPort);
anyAddress = Inet6SocketAddress (Ipv6Address::GetAny (), sinkPort);
probeName = "ns3::Ipv6PacketProbe";
probeTrace = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
probeType = "ns3::Ipv6PacketProbe";
tracePath = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
}
PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", anyAddress);
@@ -265,12 +281,12 @@ main (int argc, char *argv[])
"Time (Seconds)",
"Packet Byte Count");
// Specify the probe type, probe path (in configuration namespace), and
// Specify the probe type, trace source path (in configuration namespace), and
// probe output trace source ("OutputBytes") to plot. The fourth argument
// specifies the name of the data series label on the plot. The last
// argument formats the plot by specifying where the key should be placed.
plotHelper.PlotProbe (probeName,
probeTrace,
plotHelper.PlotProbe (probeType,
tracePath,
"OutputBytes",
"Packet Byte Count",
GnuplotAggregator::KEY_BELOW);
@@ -285,10 +301,10 @@ main (int argc, char *argv[])
// Set the labels for this formatted output file.
fileHelper.Set2dFormat ("Time (Seconds) = %.3e\tPacket Byte Count = %.0f");
// Specify the probe type, probe path (in configuration namespace), and
// Specify the probe type, trace source path (in configuration namespace), and
// probe output trace source ("OutputBytes") to write.
fileHelper.WriteProbe (probeName,
probeTrace,
fileHelper.WriteProbe (probeType,
tracePath,
"OutputBytes");
Simulator::Stop (Seconds (20));
+16
View File
@@ -65,6 +65,11 @@ public:
MyApp ();
virtual ~MyApp ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate);
private:
@@ -101,6 +106,17 @@ MyApp::~MyApp ()
m_socket = 0;
}
/* static */
TypeId MyApp::GetTypeId (void)
{
static TypeId tid = TypeId ("MyApp")
.SetParent<Application> ()
.SetGroupName ("Tutorial")
.AddConstructor<MyApp> ()
;
return tid;
}
void
MyApp::Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
{
+18 -7
View File
@@ -25,6 +25,10 @@
// Default Network Topology
//
// Number of wifi or csma nodes can be increased up to 250
// |
// Rank 0 | Rank 1
// -------------------------|----------------------------
// Wifi 10.1.3.0
// AP
// * * * *
@@ -44,19 +48,23 @@ main (int argc, char *argv[])
bool verbose = true;
uint32_t nCsma = 3;
uint32_t nWifi = 3;
bool tracing = false;
CommandLine cmd;
cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
cmd.AddValue ("tracing", "Enable pcap tracing", tracing);
cmd.Parse (argc,argv);
if (nWifi > 18)
// Check for valid number of csma or wifi nodes
// 250 should be enough, otherwise IP addresses
// soon become an issue
if (nWifi > 250 || nCsma > 250)
{
std::cout << "Number of wifi nodes " << nWifi <<
" specified exceeds the mobility bounding box" << std::endl;
exit (1);
std::cout << "Too many wifi or csma nodes, no more than 250 each." << std::endl;
return 1;
}
if (verbose)
@@ -169,9 +177,12 @@ main (int argc, char *argv[])
Simulator::Stop (Seconds (10.0));
pointToPoint.EnablePcapAll ("third");
phy.EnablePcap ("third", apDevices.Get (0));
csma.EnablePcap ("third", csmaDevices.Get (0), true);
if (tracing == true)
{
pointToPoint.EnablePcapAll ("third");
phy.EnablePcap ("third", apDevices.Get (0));
csma.EnablePcap ("third", csmaDevices.Get (0), true);
}
Simulator::Run ();
Simulator::Destroy ();
+153
View File
@@ -0,0 +1,153 @@
# -*- Mode: Python; -*-
# /*
# * 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
# *
# * Ported to Python by Mohit P. Tahiliani
# */
import ns.core
import ns.network
import ns.point_to_point
import ns.applications
import ns.wifi
import ns.mobility
import ns.csma
import ns.internet
import sys
# // Default Network Topology
# //
# // Wifi 10.1.3.0
# // AP
# // * * * *
# // | | | | 10.1.1.0
# // n5 n6 n7 n0 -------------- n1 n2 n3 n4
# // point-to-point | | | |
# // ================
# // LAN 10.1.2.0
cmd = ns.core.CommandLine()
cmd.nCsma = 3
cmd.verbose = "True"
cmd.nWifi = 3
cmd.AddValue("nCsma", "Number of \"extra\" CSMA nodes/devices")
cmd.AddValue("nWifi", "Number of wifi STA devices")
cmd.AddValue("verbose", "Tell echo applications to log if true")
cmd.Parse(sys.argv)
nCsma = int(cmd.nCsma)
verbose = cmd.verbose
nWifi = int(cmd.nWifi)
if nWifi > 18:
print "Number of wifi nodes "+ str(nWifi)+ " specified exceeds the mobility bounding box"
sys.exit(1)
if verbose == "True":
ns.core.LogComponentEnable("UdpEchoClientApplication", ns.core.LOG_LEVEL_INFO)
ns.core.LogComponentEnable("UdpEchoServerApplication", ns.core.LOG_LEVEL_INFO)
p2pNodes = ns.network.NodeContainer()
p2pNodes.Create(2)
pointToPoint = ns.point_to_point.PointToPointHelper()
pointToPoint.SetDeviceAttribute("DataRate", ns.core.StringValue("5Mbps"))
pointToPoint.SetChannelAttribute("Delay", ns.core.StringValue("2ms"))
p2pDevices = pointToPoint.Install(p2pNodes)
csmaNodes = ns.network.NodeContainer()
csmaNodes.Add(p2pNodes.Get(1))
csmaNodes.Create(nCsma)
csma = ns.csma.CsmaHelper()
csma.SetChannelAttribute("DataRate", ns.core.StringValue("100Mbps"))
csma.SetChannelAttribute("Delay", ns.core.TimeValue(ns.core.NanoSeconds(6560)))
csmaDevices = csma.Install(csmaNodes)
wifiStaNodes = ns.network.NodeContainer()
wifiStaNodes.Create(nWifi)
wifiApNode = p2pNodes.Get(0)
channel = ns.wifi.YansWifiChannelHelper.Default()
phy = ns.wifi.YansWifiPhyHelper.Default()
phy.SetChannel(channel.Create())
wifi = ns.wifi.WifiHelper.Default()
wifi.SetRemoteStationManager("ns3::AarfWifiManager")
mac = ns.wifi.NqosWifiMacHelper.Default()
ssid = ns.wifi.Ssid ("ns-3-ssid")
mac.SetType ("ns3::StaWifiMac", "Ssid", ns.wifi.SsidValue(ssid), "ActiveProbing", ns.core.BooleanValue(False))
staDevices = wifi.Install(phy, mac, wifiStaNodes)
mac.SetType("ns3::ApWifiMac","Ssid", ns.wifi.SsidValue (ssid))
apDevices = wifi.Install(phy, mac, wifiApNode)
mobility = ns.mobility.MobilityHelper()
mobility.SetPositionAllocator ("ns3::GridPositionAllocator", "MinX", ns.core.DoubleValue(0.0),
"MinY", ns.core.DoubleValue (0.0), "DeltaX", ns.core.DoubleValue(5.0), "DeltaY", ns.core.DoubleValue(10.0),
"GridWidth", ns.core.UintegerValue(3), "LayoutType", ns.core.StringValue("RowFirst"))
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", "Bounds", ns.mobility.RectangleValue(ns.mobility.Rectangle (-50, 50, -50, 50)))
mobility.Install(wifiStaNodes)
mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel")
mobility.Install(wifiApNode)
stack = ns.internet.InternetStackHelper()
stack.Install(csmaNodes)
stack.Install(wifiApNode)
stack.Install(wifiStaNodes)
address = ns.internet.Ipv4AddressHelper()
address.SetBase(ns.network.Ipv4Address("10.1.1.0"), ns.network.Ipv4Mask("255.255.255.0"))
p2pInterfaces = address.Assign(p2pDevices)
address.SetBase(ns.network.Ipv4Address("10.1.2.0"), ns.network.Ipv4Mask("255.255.255.0"))
csmaInterfaces = address.Assign(csmaDevices)
address.SetBase(ns.network.Ipv4Address("10.1.3.0"), ns.network.Ipv4Mask("255.255.255.0"))
address.Assign(staDevices)
address.Assign(apDevices)
echoServer = ns.applications.UdpEchoServerHelper(9)
serverApps = echoServer.Install(csmaNodes.Get(nCsma))
serverApps.Start(ns.core.Seconds(1.0))
serverApps.Stop(ns.core.Seconds(10.0))
echoClient = ns.applications.UdpEchoClientHelper(csmaInterfaces.GetAddress(nCsma), 9)
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds (1.0)))
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
clientApps = echoClient.Install(wifiStaNodes.Get (nWifi - 1))
clientApps.Start(ns.core.Seconds(2.0))
clientApps.Stop(ns.core.Seconds(10.0))
ns.internet.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
ns.core.Simulator.Stop(ns.core.Seconds(10.0))
pointToPoint.EnablePcapAll ("third")
phy.EnablePcap ("third", apDevices.Get (0))
csma.EnablePcap ("third", csmaDevices.Get (0), True)
ns.core.Simulator.Run()
ns.core.Simulator.Destroy()
+5 -1
View File
@@ -12,9 +12,13 @@ def build(bld):
obj = bld.create_ns3_program('second', ['core', 'point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'second.cc'
obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet'])
bld.register_ns3_script('second.py', ['core', 'point-to-point', 'csma', 'internet', 'applications'])
obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications'])
obj.source = 'third.cc'
bld.register_ns3_script('third.py', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications'])
obj = bld.create_ns3_program('fourth', ['core'])
obj.source = 'fourth.cc'
+1 -1
View File
@@ -1,7 +1,7 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet'])
obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet', 'applications'])
obj.source = 'udp-client-server.cc'
obj = bld.create_ns3_program('udp-trace-client-server', ['csma', 'internet', 'applications'])
+1 -1
View File
@@ -1,5 +1,5 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('udp-echo', ['csma', 'internet'])
obj = bld.create_ns3_program('udp-echo', ['csma', 'internet', 'applications'])
obj.source = 'udp-echo.cc'
+2
View File
@@ -25,6 +25,8 @@ cpp_examples = [
("wifi-simple-infra", "True", "True"),
("wifi-simple-interference", "True", "True"),
("wifi-wired-bridging", "True", "True"),
("power-adaptation-distance --manager=ns3::ParfWifiManager --outputFileName=parf --steps=5 --stepsSize=10", "True", "True"),
("power-adaptation-distance --manager=ns3::AparfWifiManager --outputFileName=aparf --steps=5 --stepsSize=10", "True", "True"),
]
# A list of Python examples to run in order to ensure that they remain
+319 -186
View File
@@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Mirko Banchi <mk.banchi@gmail.com>
* Authors: Mirko Banchi <mk.banchi@gmail.com>
* Sebastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
@@ -25,220 +26,352 @@
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
//This is a simple example in order to show how 802.11n frame aggregation feature (A-MSDU) works.
//This is a simple example of an IEEE 802.11n Wi-Fi network.
//
//Network topology:
//
//
// Wifi 192.168.1.0
//
// AP
// * * *
// | | |
// n1 n2 n3
//
// AP
// * *
// | |
// n1 n2
//
//Packets in this simulation aren't marked with a QosTag so they are considered
//belonging to BestEffort Access Class (AC_BE).
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("DataRates");
double rxBytessum=0;
double throughput=0;
//===========================================================================
//Set position of the nodes
//===========================================================================
static void
SetPosition (Ptr<Node> node, Vector position)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
mobility->SetPosition (position);
}
//==========================================================================
//==========================================================================
NS_LOG_COMPONENT_DEFINE ("ht-wifi-network");
int main (int argc, char *argv[])
{
std::cout << "DataRate" <<" " << "Throughput" << '\n';
bool udp = true;
int i=2;
for (;i <= 2; i++)
{
uint32_t nWifi = 1;
CommandLine cmd;
cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
cmd.Parse (argc,argv);
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
// disable rts cts all the time.
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("99000"));
NodeContainer wifiNodes;
wifiNodes.Create (1);
NodeContainer wifiApNode;
wifiApNode.Create (1);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetChannel (channel.Create ());
if (i ==3 || i == 4)
phy.Set ("ShortGuardEnabled",BooleanValue(true));
//phy.Set ("GreenfieldEnabled",BooleanValue(true));
double simulationTime = 10; //seconds
CommandLine cmd;
cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
cmd.AddValue ("udp", "UDP if set to 1, TCP otherwise", udp);
cmd.Parse (argc,argv);
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_2_4GHZ);
HtWifiMacHelper mac = HtWifiMacHelper::Default ();
std::cout << "DataRate" << "\t" << "Throughput" << '\n';
for (int i = 0; i <= 31; i++)
{
uint32_t payloadSize; //1500 byte IP packet
if (udp)
{
payloadSize = 1472; //bytes
}
else
{
payloadSize = 1448; //bytes
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (payloadSize));
}
Ssid ssid = Ssid ("ns380211n");
double datarate = 0;
StringValue DataRate;
if (i==0)
{
DataRate = StringValue("OfdmRate6_5MbpsBW20MHz");
datarate = 6.5;
}
else if (i==1)
{
DataRate = StringValue("OfdmRate58_5MbpsBW20MHz");
datarate = 58.5;
}
else if (i == 2)
{
DataRate = StringValue("OfdmRate65MbpsBW20MHz");
datarate = 65;
}
else if (i == 3)
{
DataRate = StringValue("OfdmRate57_8MbpsBW20MHz");
datarate = 57.8;
}
else if (i == 4)
{
DataRate = StringValue("OfdmRate72_2MbpsBW20MHz");
datarate = 72.2;
}
NodeContainer wifiStaNode;
wifiStaNode.Create (1);
NodeContainer wifiApNode;
wifiApNode.Create (1);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager","DataMode", DataRate,
"ControlMode", DataRate);
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
NetDeviceContainer staDevices;
staDevices = wifi.Install (phy, mac, wifiNodes);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetChannel (channel.Create ());
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
/* Ptr<WifiRemoteStationManager> apStationManager =
DynamicCast<WifiNetDevice>(apDevice.Get (0))->GetRemoteStationManager ();
apStationManager->AddBasicMode (WifiMode ("OfdmRate13MbpsBW20MHz"));
apStationManager->AddBasicMode (WifiMode ("OfdmRate19_5MbpsBW20MHz"));
apStationManager->AddBasicMode (WifiMode ("OfdmRate26MbpsBW20MHz"));
apStationManager->AddBasicMode (WifiMode ("OfdmRate39MbpsBW20MHz"));
Ptr<WifiRemoteStationManager> staStationManager =
DynamicCast<WifiNetDevice> (staDevices.Get (0))->GetRemoteStationManager ();
staStationManager->AddBasicMode (WifiMode ("OfdmRate13MbpsBW20MHz"));
staStationManager->AddBasicMode (WifiMode ("OfdmRate19_5MbpsBW20MHz"));
staStationManager->AddBasicMode (WifiMode ("OfdmRate26MbpsBW20MHz"));
staStationManager->AddBasicMode (WifiMode ("OfdmRate39MbpsBW20MHz"));*/
// mobility.
MobilityHelper mobility;
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiNodes);
mobility.Install (wifiApNode);
SetPosition (wifiNodes.Get(0), Vector (1.0,0.0,0.0));
SetPosition (wifiApNode.Get(0), Vector (0.0,0.0,0.0));
if (i <= 7)
{
phy.Set ("ShortGuardEnabled", BooleanValue (false));
phy.Set ("ChannelBonding", BooleanValue (false));
}
else if (i > 7 && i <= 15)
{
phy.Set ("ShortGuardEnabled", BooleanValue (true));
phy.Set ("ChannelBonding", BooleanValue (false));
}
else if (i > 15 && i <= 23)
{
phy.Set ("ShortGuardEnabled", BooleanValue (false));
phy.Set ("ChannelBonding", BooleanValue (true));
}
else
{
phy.Set ("ShortGuardEnabled", BooleanValue (true));
phy.Set ("ChannelBonding", BooleanValue (true));
}
/* Internet stack*/
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiNodes);
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
HtWifiMacHelper mac = HtWifiMacHelper::Default ();
Ipv4AddressHelper address;
Ssid ssid = Ssid ("ns380211n");
address.SetBase ("10.1.3.0", "255.255.255.0");
Ipv4InterfaceContainer wifiNodesInterfaces;
Ipv4InterfaceContainer apNodeInterface;
double datarate = 0;
StringValue DataRate;
if (i == 0)
{
DataRate = StringValue ("OfdmRate6_5MbpsBW20MHz");
datarate = 6.5;
}
else if (i == 1)
{
DataRate = StringValue ("OfdmRate13MbpsBW20MHz");
datarate = 13;
}
else if (i == 2)
{
DataRate = StringValue ("OfdmRate19_5MbpsBW20MHz");
datarate = 19.5;
}
else if (i == 3)
{
DataRate = StringValue ("OfdmRate26MbpsBW20MHz");
datarate = 26;
}
else if (i == 4)
{
DataRate = StringValue ("OfdmRate39MbpsBW20MHz");
datarate = 39;
}
else if (i == 5)
{
DataRate = StringValue ("OfdmRate52MbpsBW20MHz");
datarate = 52;
}
else if (i == 6)
{
DataRate = StringValue ("OfdmRate58_5MbpsBW20MHz");
datarate = 58.5;
}
else if (i == 7)
{
DataRate = StringValue ("OfdmRate65MbpsBW20MHz");
datarate = 65;
}
else if (i == 8)
{
DataRate = StringValue ("OfdmRate7_2MbpsBW20MHz");
datarate = 7.2;
}
else if (i == 9)
{
DataRate = StringValue ("OfdmRate14_4MbpsBW20MHz");
datarate = 14.4;
}
else if (i == 10)
{
DataRate = StringValue ("OfdmRate21_7MbpsBW20MHz");
datarate = 21.7;
}
else if (i == 11)
{
DataRate = StringValue ("OfdmRate28_9MbpsBW20MHz");
datarate = 28.9;
}
else if (i == 12)
{
DataRate = StringValue ("OfdmRate43_3MbpsBW20MHz");
datarate = 43.3;
}
else if (i == 13)
{
DataRate = StringValue ("OfdmRate57_8MbpsBW20MHz");
datarate = 57.8;
}
else if (i == 14)
{
DataRate = StringValue ("OfdmRate65MbpsBW20MHzShGi");
datarate = 65;
}
else if (i == 15)
{
DataRate = StringValue ("OfdmRate72_2MbpsBW20MHz");
datarate = 72.2;
}
else if (i == 16)
{
DataRate = StringValue ("OfdmRate13_5MbpsBW40MHz");
datarate = 13.5;
}
else if (i == 17)
{
DataRate = StringValue ("OfdmRate27MbpsBW40MHz");
datarate = 27;
}
else if (i == 18)
{
DataRate = StringValue ("OfdmRate40_5MbpsBW40MHz");
datarate = 40.5;
}
else if (i == 19)
{
DataRate = StringValue ("OfdmRate54MbpsBW40MHz");
datarate = 54;
}
else if (i == 20)
{
DataRate = StringValue ("OfdmRate81MbpsBW40MHz");
datarate = 81;
}
else if (i == 21)
{
DataRate = StringValue ("OfdmRate108MbpsBW40MHz");
datarate = 108;
}
else if (i == 22)
{
DataRate = StringValue ("OfdmRate121_5MbpsBW40MHz");
datarate = 121.5;
}
else if (i == 23)
{
DataRate = StringValue ("OfdmRate135MbpsBW40MHz");
datarate = 135;
}
else if (i == 24)
{
DataRate = StringValue ("OfdmRate15MbpsBW40MHz");
datarate = 15;
}
else if (i == 25)
{
DataRate = StringValue ("OfdmRate30MbpsBW40MHz");
datarate = 30;
}
else if (i == 26)
{
DataRate = StringValue ("OfdmRate45MbpsBW40MHz");
datarate = 45;
}
else if (i == 27)
{
DataRate = StringValue ("OfdmRate60MbpsBW40MHz");
datarate = 60;
}
else if (i == 28)
{
DataRate = StringValue ("OfdmRate90MbpsBW40MHz");
datarate = 90;
}
else if (i == 29)
{
DataRate = StringValue ("OfdmRate120MbpsBW40MHz");
datarate = 120;
}
else if (i == 30)
{
DataRate = StringValue ("OfdmRate135MbpsBW40MHzShGi");
datarate = 135;
}
else
{
DataRate = StringValue ("OfdmRate150MbpsBW40MHz");
datarate = 150;
}
wifiNodesInterfaces = address.Assign (staDevices);
apNodeInterface = address.Assign (apDevice);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager","DataMode", DataRate,
"ControlMode", DataRate);
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
ApplicationContainer serverApps,sink1App;
NetDeviceContainer staDevice;
staDevice = wifi.Install (phy, mac, wifiStaNode);
double t=10;
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
/* Setting applications */
if (udp)
{
UdpServerHelper myServer (9);
serverApps = myServer.Install (wifiNodes.Get (0));
serverApps.Start (Seconds (0.0));
serverApps.Stop (Seconds (t));
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
UdpClientHelper myClient (wifiNodesInterfaces.GetAddress (0), 9);
myClient.SetAttribute ("MaxPackets", UintegerValue (64707202));
myClient.SetAttribute ("Interval", TimeValue (Time ("0.00002")));
myClient.SetAttribute ("PacketSize", UintegerValue (1500));
ApplicationContainer clientApps = myClient.Install (wifiApNode.Get (0));
clientApps.Start (Seconds (0.0));
clientApps.Stop (Seconds (t));
}
else
{
// mobility.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
//TCP flow
uint16_t port = 50000;
Address apLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", apLocalAddress);
sink1App = packetSinkHelper.Install (wifiNodes.Get (0));
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (1.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
sink1App.Start (Seconds (0.0));
sink1App.Stop (Seconds (t));
OnOffHelper onoff ("ns3::TcpSocketFactory",Ipv4Address::GetAny ());
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable(30)));//in seconds
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable(0)));
onoff.SetAttribute ("PacketSize", UintegerValue (1500-30));//1024
onoff.SetAttribute ("DataRate", DataRateValue (100000000));//51200
ApplicationContainer apps;
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
AddressValue remoteAddress (InetSocketAddress (wifiNodesInterfaces.GetAddress(0), port));
onoff.SetAttribute ("Remote", remoteAddress);
apps.Add (onoff.Install (wifiApNode.Get (0)));
apps.Start (Seconds (0.0));
apps.Stop (Seconds (t));
}
mobility.Install (wifiApNode);
mobility.Install (wifiStaNode);
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
/* Internet stack*/
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiStaNode);
Simulator::Stop (Seconds (t));
Simulator::Run ();
Simulator::Destroy ();
Ipv4AddressHelper address;
//UDP
if (udp)
{
uint32_t totalPacketsThrough = DynamicCast<UdpServer>(serverApps.Get (0))->GetReceived ();
throughput=totalPacketsThrough*1500*8/(t*1000000.0);
}
else
{
//TCP
uint32_t totalPacketsThrough = DynamicCast<PacketSink>(sink1App.Get (0))->GetTotalRx ();
throughput=totalPacketsThrough*8/((t-3)*1000000.0);
}
std::cout << datarate <<" " << throughput << '\n';
}
address.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer staNodeInterface;
Ipv4InterfaceContainer apNodeInterface;
staNodeInterface = address.Assign (staDevice);
apNodeInterface = address.Assign (apDevice);
/* Setting applications */
ApplicationContainer serverApp, sinkApp;
if (udp)
{
//UDP flow
UdpServerHelper myServer (9);
serverApp = myServer.Install (wifiStaNode.Get (0));
serverApp.Start (Seconds (0.0));
serverApp.Stop (Seconds (simulationTime+1));
UdpClientHelper myClient (staNodeInterface.GetAddress (0), 9);
myClient.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
myClient.SetAttribute ("Interval", TimeValue (Time ("0.00002"))); //packets/s
myClient.SetAttribute ("PacketSize", UintegerValue (payloadSize));
ApplicationContainer clientApp = myClient.Install (wifiApNode.Get (0));
clientApp.Start (Seconds (1.0));
clientApp.Stop (Seconds (simulationTime+1));
}
else
{
//TCP flow
uint16_t port = 50000;
Address apLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", apLocalAddress);
sinkApp = packetSinkHelper.Install (wifiStaNode.Get (0));
sinkApp.Start (Seconds (0.0));
sinkApp.Stop (Seconds (simulationTime+1));
OnOffHelper onoff ("ns3::TcpSocketFactory",Ipv4Address::GetAny ());
onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
onoff.SetAttribute ("PacketSize", UintegerValue (payloadSize));
onoff.SetAttribute ("DataRate", DataRateValue (1000000000)); //bit/s
ApplicationContainer apps;
AddressValue remoteAddress (InetSocketAddress (staNodeInterface.GetAddress (0), port));
onoff.SetAttribute ("Remote", remoteAddress);
apps.Add (onoff.Install (wifiApNode.Get (0)));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (simulationTime+1));
}
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
Simulator::Stop (Seconds (simulationTime+1));
Simulator::Run ();
Simulator::Destroy ();
double throughput = 0;
if (udp)
{
//UDP
uint32_t totalPacketsThrough = DynamicCast<UdpServer> (serverApp.Get (0))->GetReceived ();
throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); //Mbit/s
}
else
{
//TCP
uint32_t totalPacketsThrough = DynamicCast<PacketSink> (sinkApp.Get (0))->GetTotalRx ();
throughput = totalPacketsThrough * 8 / (simulationTime * 1000000.0); //Mbit/s
}
std::cout << datarate << "\t\t" << throughput << " Mbit/s" << std::endl;
}
return 0;
}
}
+58 -59
View File
@@ -69,6 +69,7 @@
#include "ns3/csma-module.h"
#include "ns3/olsr-helper.h"
#include "ns3/internet-module.h"
#include "ns3/netanim-module.h"
using namespace ns3;
@@ -96,18 +97,17 @@ main (int argc, char *argv[])
// simulation parameters.
//
uint32_t backboneNodes = 10;
uint32_t infraNodes = 5;
uint32_t lanNodes = 5;
uint32_t stopTime = 10;
uint32_t infraNodes = 2;
uint32_t lanNodes = 2;
uint32_t stopTime = 20;
bool useCourseChangeCallback = false;
bool enableTracing = false;
//
// Simulation defaults are typically set next, before command line
// arguments are parsed.
//
Config::SetDefault ("ns3::OnOffApplication::PacketSize", StringValue ("210"));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("10kb/s"));
Config::SetDefault ("ns3::OnOffApplication::PacketSize", StringValue ("1472"));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("100kb/s"));
//
// For convenience, we add the local variables to the command line argument
@@ -120,7 +120,6 @@ main (int argc, char *argv[])
cmd.AddValue ("lanNodes", "number of LAN nodes", lanNodes);
cmd.AddValue ("stopTime", "simulation stop time (seconds)", stopTime);
cmd.AddValue ("useCourseChangeCallback", "whether to enable course change tracing", useCourseChangeCallback);
cmd.AddValue ("enableTracing", "enable tracing", enableTracing);
//
// The system global variables and the local values added to the argument
@@ -128,6 +127,11 @@ main (int argc, char *argv[])
//
cmd.Parse (argc, argv);
if (stopTime < 10)
{
std::cout << "Use a simulation stop time >= 10 seconds" << std::endl;
exit (1);
}
///////////////////////////////////////////////////////////////////////////
// //
// Construct the backbone //
@@ -165,9 +169,6 @@ main (int argc, char *argv[])
internet.SetRoutingHelper (olsr); // has effect on the next Install ()
internet.Install (backbone);
// re-initialize for non-olsr routing.
internet.Reset ();
//
// Assign IPv4 addresses to the device drivers (actually to the associated
// IPv4 interfaces) we just created.
@@ -181,17 +182,15 @@ main (int argc, char *argv[])
// each of the nodes we just finished building.
//
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc =
CreateObject<ListPositionAllocator> ();
double x = 0.0;
for (uint32_t i = 0; i < backboneNodes; ++i)
{
positionAlloc->Add (Vector (x, 0.0, 0.0));
x += 5.0;
}
mobility.SetPositionAllocator (positionAlloc);
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (20.0),
"MinY", DoubleValue (20.0),
"DeltaX", DoubleValue (20.0),
"DeltaY", DoubleValue (20.0),
"GridWidth", UintegerValue (5),
"LayoutType", StringValue ("RowFirst"));
mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel",
"Bounds", RectangleValue (Rectangle (0, 20, 0, 20)),
"Bounds", RectangleValue (Rectangle (-500, 500, -500, 500)),
"Speed", StringValue ("ns3::ConstantRandomVariable[Constant=2]"),
"Pause", StringValue ("ns3::ConstantRandomVariable[Constant=0.2]"));
mobility.Install (backbone);
@@ -242,6 +241,21 @@ main (int argc, char *argv[])
// network mask initialized above
//
ipAddrs.NewNetwork ();
//
// The new LAN nodes need a mobility model so we aggregate one
// to each of the nodes we just finished building.
//
MobilityHelper mobilityLan;
Ptr<ListPositionAllocator> subnetAlloc =
CreateObject<ListPositionAllocator> ();
for (uint32_t j = 0; j < newLanNodes.GetN (); ++j)
{
subnetAlloc->Add (Vector (0.0, j*10 + 10, 0.0));
}
mobilityLan.PushReferenceMobilityModel (backbone.Get (i));
mobilityLan.SetPositionAllocator (subnetAlloc);
mobilityLan.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobilityLan.Install (newLanNodes);
}
///////////////////////////////////////////////////////////////////////////
@@ -286,7 +300,9 @@ main (int argc, char *argv[])
NetDeviceContainer staDevices = wifiInfra.Install (wifiPhy, macInfra, stas);
// setup ap.
macInfra.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
"Ssid", SsidValue (ssid),
"BeaconGeneration", BooleanValue (true),
"BeaconInterval", TimeValue(Seconds(2.5)));
NetDeviceContainer apDevices = wifiInfra.Install (wifiPhy, macInfra, backbone.Get (i));
// Collect all of these new devices
NetDeviceContainer infraDevices (apDevices, staDevices);
@@ -320,19 +336,8 @@ main (int argc, char *argv[])
"Bounds", RectangleValue (Rectangle (-10, 10, -10, 10)),
"Speed", StringValue ("ns3::ConstantRandomVariable[Constant=3]"),
"Pause", StringValue ("ns3::ConstantRandomVariable[Constant=0.4]"));
mobility.Install (infra);
mobility.Install (stas);
}
///////////////////////////////////////////////////////////////////////////
// //
// Routing configuration //
// //
///////////////////////////////////////////////////////////////////////////
// The below global routing does not take into account wireless effects.
// However, it is useful for setting default routes for all of the nodes
// such as the LAN nodes.
NS_LOG_INFO ("Enabling global routing on all nodes");
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
///////////////////////////////////////////////////////////////////////////
// //
@@ -363,17 +368,16 @@ main (int argc, char *argv[])
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (remoteAddr, port)));
onoff.SetConstantRate (DataRate ("10kb/s"));
ApplicationContainer apps = onoff.Install (appSource);
apps.Start (Seconds (3.0));
apps.Stop (Seconds (20.0));
apps.Start (Seconds (3));
apps.Stop (Seconds (stopTime - 1));
// Create a packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), port));
apps = sink.Install (appSink);
apps.Start (Seconds (3.0));
apps.Start (Seconds (3));
///////////////////////////////////////////////////////////////////////////
// //
@@ -382,36 +386,31 @@ main (int argc, char *argv[])
///////////////////////////////////////////////////////////////////////////
NS_LOG_INFO ("Configure Tracing.");
if (enableTracing == true)
{
CsmaHelper csma;
CsmaHelper csma;
//
// Let's set up some ns-2-like ascii traces, using another helper class
//
AsciiTraceHelper ascii;
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream ("mixed-wireless.tr");
wifiPhy.EnableAsciiAll (stream);
csma.EnableAsciiAll (stream);
internet.EnableAsciiIpv4All (stream);
//
// Let's set up some ns-2-like ascii traces, using another helper class
//
AsciiTraceHelper ascii;
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream ("mixed-wireless.tr");
wifiPhy.EnableAsciiAll (stream);
csma.EnableAsciiAll (stream);
internet.EnableAsciiIpv4All (stream);
// Let's do a pcap trace on the application source and sink, ifIndex 0
// Csma captures in non-promiscuous mode
#if 0
csma.EnablePcap ("mixed-wireless", appSource->GetId (), 0, false);
#else
csma.EnablePcapAll ("mixed-wireless", false);
#endif
wifiPhy.EnablePcap ("mixed-wireless", appSink->GetId (), 0);
wifiPhy.EnablePcap ("mixed-wireless", 9, 2);
wifiPhy.EnablePcap ("mixed-wireless", 9, 0);
}
// Csma captures in non-promiscuous mode
csma.EnablePcapAll ("mixed-wireless", false);
// pcap captures on the backbone wifi devices
wifiPhy.EnablePcap ("mixed-wireless", backboneDevices, false);
// pcap trace on the application data sink
wifiPhy.EnablePcap ("mixed-wireless", appSink->GetId (), 0);
if (useCourseChangeCallback == true)
{
Config::Connect ("/NodeList/*/$ns3::MobilityModel/CourseChange", MakeCallback (&CourseChangeCallback));
}
AnimationInterface anim ("mixed-wireless.xml");
///////////////////////////////////////////////////////////////////////////
// //
// Run simulation //
+67 -48
View File
@@ -72,38 +72,48 @@ import ns.wifi
def main(argv):
#
# First, we declare and initialize a few local variables that control some
# First, we initialize a few local variables that control some
# simulation parameters.
#
backboneNodes = 10
infraNodes = 5
lanNodes = 5
stopTime = 10
#
cmd = ns.core.CommandLine()
cmd.backboneNodes = 10
cmd.infraNodes = 2
cmd.lanNodes = 2
cmd.stopTime = 20
#
# Simulation defaults are typically set next, before command line
# arguments are parsed.
#
ns.core.Config.SetDefault("ns3::OnOffApplication::PacketSize", ns.core.StringValue("210"))
ns.core.Config.SetDefault("ns3::OnOffApplication::DataRate", ns.core.StringValue("448kb/s"))
ns.core.Config.SetDefault("ns3::OnOffApplication::PacketSize", ns.core.StringValue("1472"))
ns.core.Config.SetDefault("ns3::OnOffApplication::DataRate", ns.core.StringValue("100kb/s"))
#
# For convenience, we add the local variables to the command line argument
# system so that they can be overridden with flags such as
# "--backboneNodes=20"
#
cmd = ns.core.CommandLine()
#cmd.AddValue("backboneNodes", "number of backbone nodes", backboneNodes)
#cmd.AddValue("infraNodes", "number of leaf nodes", infraNodes)
#cmd.AddValue("lanNodes", "number of LAN nodes", lanNodes)
#cmd.AddValue("stopTime", "simulation stop time(seconds)", stopTime)
cmd.AddValue("backboneNodes", "number of backbone nodes")
cmd.AddValue("infraNodes", "number of leaf nodes")
cmd.AddValue("lanNodes", "number of LAN nodes")
cmd.AddValue("stopTime", "simulation stop time(seconds)")
#
# The system global variables and the local values added to the argument
# system can be overridden by command line arguments by using this call.
#
cmd.Parse(argv)
backboneNodes = int(cmd.backboneNodes)
infraNodes = int(cmd.infraNodes)
lanNodes = int(cmd.lanNodes)
stopTime = int(cmd.stopTime)
if (stopTime < 10):
print "Use a simulation stop time >= 10 seconds"
exit(1)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # /
# #
# Construct the backbone #
@@ -138,7 +148,7 @@ def main(argv):
internet.SetRoutingHelper(olsr); # has effect on the next Install ()
internet.Install(backbone);
# re-initialize for non-olsr routing.
internet.Reset()
# internet.Reset()
#
# Assign IPv4 addresses to the device drivers(actually to the associated
# IPv4 interfaces) we just created.
@@ -152,15 +162,16 @@ def main(argv):
# each of the nodes we just finished building.
#
mobility = ns.mobility.MobilityHelper()
positionAlloc = ns.mobility.ListPositionAllocator()
x = 0.0
for i in range(backboneNodes):
positionAlloc.Add(ns.core.Vector(x, 0.0, 0.0))
x += 5.0
mobility.SetPositionAllocator(positionAlloc)
mobility.SetPositionAllocator("ns3::GridPositionAllocator",
"MinX", ns.core.DoubleValue(20.0),
"MinY", ns.core.DoubleValue(20.0),
"DeltaX", ns.core.DoubleValue(20.0),
"DeltaY", ns.core.DoubleValue(20.0),
"GridWidth", ns.core.UintegerValue(5),
"LayoutType", ns.core.StringValue("RowFirst"))
mobility.SetMobilityModel("ns3::RandomDirection2dMobilityModel",
"Bounds", ns.mobility.RectangleValue(ns.mobility.Rectangle(0, 1000, 0, 1000)),
"Speed", ns.core.StringValue ("ns3::ConstantRandomVariable[Constant=2000]"),
"Bounds", ns.mobility.RectangleValue(ns.mobility.Rectangle(-500, 500, -500, 500)),
"Speed", ns.core.StringValue ("ns3::ConstantRandomVariable[Constant=2]"),
"Pause", ns.core.StringValue ("ns3::ConstantRandomVariable[Constant=0.2]"))
mobility.Install(backbone)
@@ -207,6 +218,19 @@ def main(argv):
# network mask initialized above
#
ipAddrs.NewNetwork()
#
# The new LAN nodes need a mobility model so we aggregate one
# to each of the nodes we just finished building.
#
mobilityLan = ns.mobility.MobilityHelper()
positionAlloc = ns.mobility.ListPositionAllocator()
for j in range(newLanNodes.GetN()):
positionAlloc.Add(ns.core.Vector(0.0, (j*10 + 10), 0.0))
mobilityLan.SetPositionAllocator(positionAlloc)
mobilityLan.PushReferenceMobilityModel(backbone.Get(i))
mobilityLan.SetMobilityModel("ns3::ConstantPositionMobilityModel")
mobilityLan.Install(newLanNodes);
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # /
# #
@@ -276,10 +300,10 @@ def main(argv):
mobility.PushReferenceMobilityModel(backbone.Get(i))
mobility.SetPositionAllocator(subnetAlloc)
mobility.SetMobilityModel("ns3::RandomDirection2dMobilityModel",
"Bounds", ns.mobility.RectangleValue(ns.mobility.Rectangle(-25, 25, -25, 25)),
"Speed", ns.core.StringValue ("ns3::ConstantRandomVariable[Constant=30]"),
"Bounds", ns.mobility.RectangleValue(ns.mobility.Rectangle(-10, 10, -10, 10)),
"Speed", ns.core.StringValue ("ns3::ConstantRandomVariable[Constant=3]"),
"Pause", ns.core.StringValue ("ns3::ConstantRandomVariable[Constant=0.4]"))
mobility.Install(infra)
mobility.Install(stas)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # /
# #
@@ -292,25 +316,23 @@ def main(argv):
print "Create Applications."
port = 9 # Discard port(RFC 863)
# Let's make sure that the user does not define too few LAN nodes
# to make this example work. We need lanNodes >= 5
assert(lanNodes >= 5)
appSource = ns.network.NodeList.GetNode(11)
appSink = ns.network.NodeList.GetNode(13)
remoteAddr = ns.network.Ipv4Address("172.16.0.5")
appSource = ns.network.NodeList.GetNode(backboneNodes)
lastNodeIndex = backboneNodes + backboneNodes*(lanNodes - 1) + backboneNodes*(infraNodes - 1) - 1
appSink = ns.network.NodeList.GetNode(lastNodeIndex)
# Let's fetch the IP address of the last node, which is on Ipv4Interface 1
remoteAddr = appSink.GetObject(ns.internet.Ipv4.GetTypeId()).GetAddress(1,0).GetLocal()
onoff = ns.applications.OnOffHelper("ns3::UdpSocketFactory",
ns.network.Address(ns.network.InetSocketAddress(remoteAddr, port)))
onoff.SetConstantRate (ns.network.DataRate ("10kb/s"))
apps = onoff.Install(ns.network.NodeContainer(appSource))
apps.Start(ns.core.Seconds(3.0))
apps.Stop(ns.core.Seconds(20.0))
apps.Start(ns.core.Seconds(3))
apps.Stop(ns.core.Seconds(stopTime - 1))
# Create a packet sink to receive these packets
sink = ns.applications.PacketSinkHelper("ns3::UdpSocketFactory",
ns.network.InetSocketAddress(ns.network.Ipv4Address.GetAny(), port))
apps = sink.Install(ns.network.NodeContainer(appSink))
apps.Start(ns.core.Seconds(3.0))
apps.Start(ns.core.Seconds(3))
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # /
# #
@@ -319,24 +341,21 @@ def main(argv):
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # /
print "Configure Tracing."
csma = ns.csma.CsmaHelper()
#
# Let's set up some ns-2-like ascii traces, using another helper class
#
#std.ofstream ascii
#ascii = ns.core.AsciiTraceHelper();
#stream = ascii.CreateFileStream("mixed-wireless.tr");
#wifiPhy.EnableAsciiAll(stream);
#csma.EnableAsciiAll(stream);
print "(tracing not done for Python)"
# Look at nodes 11, 13 only
# WifiHelper.EnableAscii(ascii, 11, 0);
# WifiHelper.EnableAscii(ascii, 13, 0);
ascii = ns.network.AsciiTraceHelper();
stream = ascii.CreateFileStream("mixed-wireless.tr");
wifiPhy.EnableAsciiAll(stream);
csma.EnableAsciiAll(stream);
internet.EnableAsciiIpv4All(stream);
# Csma captures in non-promiscuous mode
csma.EnablePcapAll("mixed-wireless", False)
# Let's do a pcap trace on the backbone devices
wifiPhy.EnablePcap("mixed-wireless", backboneDevices)
# Let's additionally trace the application Sink, ifIndex 0
csma = ns.csma.CsmaHelper()
csma.EnablePcapAll("mixed-wireless", False)
wifiPhy.EnablePcap("mixed-wireless", appSink.GetId(), 0)
# #ifdef ENABLE_FOR_TRACING_EXAMPLE
# Config.Connect("/NodeList/*/$MobilityModel/CourseChange",
+2 -2
View File
@@ -64,10 +64,10 @@
#include <iostream>
#include <fstream>
NS_LOG_COMPONENT_DEFINE ("multirate");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("multirate");
class Experiment
{
public:
+106
View File
@@ -0,0 +1,106 @@
/* -*- 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
*
* Authors: Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/yans-error-rate-model.h"
#include "ns3/nist-error-rate-model.h"
#include "ns3/gnuplot.h"
#include <fstream>
#include <vector>
#include <cmath>
using namespace ns3;
int main (int argc, char *argv[])
{
uint32_t FrameSize = 2000;
std::ofstream yansfile ("yans-frame-success-rate-n.plt");
std::ofstream nistfile ("nist-frame-success-rate-n.plt");
std::vector <std::string> modes;
modes.push_back ("OfdmRate6_5MbpsBW20MHz");
modes.push_back ("OfdmRate13MbpsBW20MHz");
modes.push_back ("OfdmRate19_5MbpsBW20MHz");
modes.push_back ("OfdmRate26MbpsBW20MHz");
modes.push_back ("OfdmRate39MbpsBW20MHz");
modes.push_back ("OfdmRate52MbpsBW20MHz");
modes.push_back ("OfdmRate58_5MbpsBW20MHz");
modes.push_back ("OfdmRate65MbpsBW20MHz");
CommandLine cmd;
cmd.AddValue ("FrameSize", "The frame size", FrameSize);
cmd.Parse (argc, argv);
Gnuplot yansplot = Gnuplot ("yans-frame-success-rate-n.eps");
Gnuplot nistplot = Gnuplot ("nist-frame-success-rate-n.eps");
Ptr <YansErrorRateModel> yans = CreateObject<YansErrorRateModel> ();
Ptr <NistErrorRateModel> nist = CreateObject<NistErrorRateModel> ();
for (uint32_t i = 0; i < modes.size (); i++)
{
std::cout << modes[i] << std::endl;
Gnuplot2dDataset yansdataset (modes[i]);
Gnuplot2dDataset nistdataset (modes[i]);
for (double snr = -5.0; snr <= 30.0; snr += 0.1)
{
double ps = yans->GetChunkSuccessRate (WifiMode (modes[i]), std::pow (10.0,snr / 10.0), FrameSize * 8);
yansdataset.Add (snr, ps);
ps = nist->GetChunkSuccessRate (WifiMode (modes[i]), std::pow (10.0,snr / 10.0), FrameSize * 8);
nistdataset.Add (snr, ps);
}
yansplot.AddDataset (yansdataset);
nistplot.AddDataset (nistdataset);
}
yansplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\"");
yansplot.SetLegend ("SNR(dB)", "Frame Success Rate");
yansplot.SetExtra ("set xrange [-5:30]\n\
set yrange [0:1.2]\n\
set style line 1 linewidth 5\n\
set style line 2 linewidth 5\n\
set style line 3 linewidth 5\n\
set style line 4 linewidth 5\n\
set style line 5 linewidth 5\n\
set style line 6 linewidth 5\n\
set style line 7 linewidth 5\n\
set style line 8 linewidth 5\n\
set style increment user" );
yansplot.GenerateOutput (yansfile);
yansfile.close ();
nistplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\"");
nistplot.SetLegend ("SNR(dB)", "Frame Success Rate");
nistplot.SetExtra ("set xrange [-5:30]\n\
set yrange [0:1.2]\n\
set style line 1 linewidth 5\n\
set style line 2 linewidth 5\n\
set style line 3 linewidth 5\n\
set style line 4 linewidth 5\n\
set style line 5 linewidth 5\n\
set style line 6 linewidth 5\n\
set style line 7 linewidth 5\n\
set style line 8 linewidth 5\n\
set style increment user" );
nistplot.GenerateOutput (nistfile);
nistfile.close ();
}
@@ -0,0 +1,474 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014 Universidad de la República - Uruguay
*
* 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: Matias Richart <mrichart@fing.edu.uy>
*/
/**
* This example program is designed to illustrate the behavior of two
* power/rate-adaptive WiFi rate controls; namely, ns3::ParfWifiManager
* and ns3::AparfWifiManager.
*
* The output of this is typically two plot files, named throughput-parf.plt
* (or throughput-aparf.plt, if Aparf is used) and power-parf.plt If
* Gnuplot program is available, one can use it to convert the plt file
* into an eps file, by running:
* \code{.sh}
* gnuplot throughput-parf.plt
* \endcode
* Also, to enable logging of rate and power changes to the terminal, set this
* environment variable:
* \code{.sh}
* export NS_LOG=PowerAdaptationDistance=level_info
* \endcode
*
* This simulation consist of 2 nodes, one AP and one STA.
* The AP generates UDP traffic with a CBR of 54 Mbps to the STA.
* The AP can use any power and rate control mechanism and the STA uses
* only Minstrel rate control.
* The STA can be configured to move away from (or towards to) the AP.
* By default, the AP is at coordinate (0,0,0) and the STA starts at
* coordinate (5,0,0) (meters) and moves away on the x axis by 1 meter every
* second.
*
* The output consists of:
* - A plot of average throughput vs. distance.
* - A plot of average transmit power vs. distance.
* - (if logging is enabled) the changes of power and rate to standard output.
*
* The Average Transmit Power is defined as an average of the power
* consumed per measurement interval, expressed in milliwatts. The
* power level for each frame transmission is reported by the simulator,
* and the energy consumed is obtained by multiplying the power by the
* frame duration. At every 'stepTime' (defaulting to 1 second), the
* total energy for the collection period is divided by the step time
* and converted from dbm to milliwatt units, and this average is
* plotted against time.
*
* When neither Parf nor Aparf is selected as the rate control, the
* generation of the plot of average transmit power vs distance is suppressed
* since the other Wifi rate controls do not support the necessary callbacks
* for computing the average power.
*
* To display all the possible arguments and their defaults:
* \code{.sh}
* ./waf --run "power-adaptation-distance --help"
* \endcode
*
* Example usage (selecting Aparf rather than Parf):
* \code{.sh}
* ./waf --run "power-adaptation-distance --manager=ns3::AparfWifiManager --outputFileName=aparf"
* \endcode
*
* Another example (moving towards the AP):
* \code{.sh}
* ./waf --run "power-adaptation-distance --manager=ns3::AparfWifiManager --outputFileName=aparf --stepsSize=-1 --STA1_x=200"
* \endcode
*
* To enable the log of rate and power changes:
* \code{.sh}
* export NS_LOG=PowerAdaptationDistance=level_info
* \endcode
*/
#include <sstream>
#include <fstream>
#include <math.h>
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/mobility-module.h"
#include "ns3/wifi-module.h"
#include "ns3/applications-module.h"
#include "ns3/stats-module.h"
#include "ns3/flow-monitor-module.h"
using namespace ns3;
using namespace std;
NS_LOG_COMPONENT_DEFINE ("PowerAdaptationDistance");
// packet size generated at the AP
static const uint32_t packetSize = 1420;
class NodeStatistics
{
public:
NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas);
void CheckStatistics (double time);
void PhyCallback (std::string path, Ptr<const Packet> packet);
void RxCallback (std::string path, Ptr<const Packet> packet, const Address &from);
void PowerCallback (std::string path, uint8_t power, Mac48Address dest);
void RateCallback (std::string path, uint32_t rate, Mac48Address dest);
void SetPosition (Ptr<Node> node, Vector position);
void AdvancePosition (Ptr<Node> node, int stepsSize, int stepsTime);
Vector GetPosition (Ptr<Node> node);
Gnuplot2dDataset GetDatafile ();
Gnuplot2dDataset GetPowerDatafile ();
private:
typedef std::vector<std::pair<Time,WifiMode> > TxTime;
void SetupPhy (Ptr<WifiPhy> phy);
Time GetCalcTxTime (WifiMode mode);
std::map<Mac48Address, uint32_t> actualPower;
std::map<Mac48Address, WifiMode> actualMode;
uint32_t m_bytesTotal;
double totalEnergy;
double totalTime;
Ptr<WifiPhy> myPhy;
TxTime timeTable;
Gnuplot2dDataset m_output;
Gnuplot2dDataset m_output_power;
};
NodeStatistics::NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas)
{
Ptr<NetDevice> device = aps.Get (0);
Ptr<WifiNetDevice> wifiDevice = DynamicCast<WifiNetDevice> (device);
Ptr<WifiPhy> phy = wifiDevice->GetPhy ();
myPhy = phy;
SetupPhy (phy);
for (uint32_t j = 0; j < stas.GetN (); j++)
{
Ptr<NetDevice> staDevice = stas.Get (j);
Ptr<WifiNetDevice> wifiStaDevice = DynamicCast<WifiNetDevice> (staDevice);
Mac48Address addr = wifiStaDevice->GetMac ()->GetAddress ();
actualPower[addr] = 17;
actualMode[addr] = phy->GetMode (0);
}
actualMode[Mac48Address ("ff:ff:ff:ff:ff:ff")] = phy->GetMode (0);
totalEnergy = 0;
totalTime = 0;
m_bytesTotal = 0;
m_output.SetTitle ("Throughput Mbits/s");
m_output_power.SetTitle ("Average Transmit Power");
}
void
NodeStatistics::SetupPhy (Ptr<WifiPhy> phy)
{
uint32_t nModes = phy->GetNModes ();
for (uint32_t i = 0; i < nModes; i++)
{
WifiMode mode = phy->GetMode (i);
WifiTxVector txVector;
txVector.SetMode (mode);
timeTable.push_back (std::make_pair (phy->CalculateTxDuration (packetSize, txVector, WIFI_PREAMBLE_LONG, phy->GetFrequency (), 0, 0), mode));
}
}
Time
NodeStatistics::GetCalcTxTime (WifiMode mode)
{
for (TxTime::const_iterator i = timeTable.begin (); i != timeTable.end (); i++)
{
if (mode == i->second)
{
return i->first;
}
}
NS_ASSERT (false);
return Seconds (0);
}
void
NodeStatistics::PhyCallback (std::string path, Ptr<const Packet> packet)
{
WifiMacHeader head;
packet->PeekHeader (head);
Mac48Address dest = head.GetAddr1 ();
if (head.GetType() == WIFI_MAC_DATA)
{
totalEnergy += pow (10, actualPower[dest] / 10) * GetCalcTxTime (actualMode[dest]).GetSeconds ();
totalTime += GetCalcTxTime (actualMode[dest]).GetSeconds ();
}
}
void
NodeStatistics::PowerCallback (std::string path, uint8_t power, Mac48Address dest)
{
double txPowerBaseDbm = myPhy->GetTxPowerStart ();
double txPowerEndDbm = myPhy->GetTxPowerEnd ();
uint32_t nTxPower = myPhy->GetNTxPower ();
double dbm;
if (nTxPower > 1)
{
dbm = txPowerBaseDbm + power * (txPowerEndDbm - txPowerBaseDbm) / (nTxPower - 1);
}
else
{
NS_ASSERT_MSG (txPowerBaseDbm == txPowerEndDbm, "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1");
dbm = txPowerBaseDbm;
}
actualPower[dest] = dbm;
}
void
NodeStatistics::RateCallback (std::string path, uint32_t rate, Mac48Address dest)
{
actualMode[dest] = myPhy->GetMode (rate);
}
void
NodeStatistics::RxCallback (std::string path, Ptr<const Packet> packet, const Address &from)
{
m_bytesTotal += packet->GetSize ();
}
void
NodeStatistics::CheckStatistics (double time)
{
}
void
NodeStatistics::SetPosition (Ptr<Node> node, Vector position)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
mobility->SetPosition (position);
}
Vector
NodeStatistics::GetPosition (Ptr<Node> node)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
return mobility->GetPosition ();
}
void
NodeStatistics::AdvancePosition (Ptr<Node> node, int stepsSize, int stepsTime)
{
Vector pos = GetPosition (node);
double mbs = ((m_bytesTotal * 8.0) / (1000000 * stepsTime));
m_bytesTotal = 0;
double atp = totalEnergy / stepsTime;
totalEnergy = 0;
totalTime = 0;
m_output_power.Add (pos.x, atp);
m_output.Add (pos.x, mbs);
pos.x += stepsSize;
SetPosition (node, pos);
NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << " sec; setting new position to " << pos);
Simulator::Schedule (Seconds (stepsTime), &NodeStatistics::AdvancePosition, this, node, stepsSize, stepsTime);
}
Gnuplot2dDataset
NodeStatistics::GetDatafile ()
{
return m_output;
}
Gnuplot2dDataset
NodeStatistics::GetPowerDatafile ()
{
return m_output_power;
}
void PowerCallback (std::string path, uint8_t power, Mac48Address dest)
{
NS_LOG_INFO ((Simulator::Now ()).GetSeconds () << " " << dest << " Power " << (int)power);
}
void RateCallback (std::string path, uint32_t rate, Mac48Address dest)
{
NS_LOG_INFO ((Simulator::Now ()).GetSeconds () << " " << dest << " Rate " << rate);
}
int main (int argc, char *argv[])
{
double maxPower = 17;
double minPower = 0;
uint32_t powerLevels = 18;
uint32_t rtsThreshold = 2346;
std::string manager = "ns3::ParfWifiManager";
std::string outputFileName = "parf";
int ap1_x = 0;
int ap1_y = 0;
int sta1_x = 5;
int sta1_y = 0;
uint32_t steps = 200;
uint32_t stepsSize = 1;
uint32_t stepsTime = 1;
CommandLine cmd;
cmd.AddValue ("manager", "PRC Manager", manager);
cmd.AddValue ("rtsThreshold", "RTS threshold", rtsThreshold);
cmd.AddValue ("outputFileName", "Output filename", outputFileName);
cmd.AddValue ("steps", "How many different distances to try", steps);
cmd.AddValue ("stepsTime", "Time on each step", stepsTime);
cmd.AddValue ("stepsSize", "Distance between steps", stepsSize);
cmd.AddValue ("maxPower", "Maximum available transmission level (dbm).", maxPower);
cmd.AddValue ("minPower", "Minimum available transmission level (dbm).", minPower);
cmd.AddValue ("powerLevels", "Number of transmission power levels available between "
"TxPowerStart and TxPowerEnd included.", powerLevels);
cmd.AddValue ("AP1_x", "Position of AP1 in x coordinate", ap1_x);
cmd.AddValue ("AP1_y", "Position of AP1 in y coordinate", ap1_y);
cmd.AddValue ("STA1_x", "Position of STA1 in x coordinate", sta1_x);
cmd.AddValue ("STA1_y", "Position of STA1 in y coordinate", sta1_y);
cmd.Parse (argc, argv);
if (steps == 0)
{
std::cout << "Exiting without running simulation; steps value of 0" << std::endl;
}
uint32_t simuTime = (steps + 1) * stepsTime;
// Define the APs
NodeContainer wifiApNodes;
wifiApNodes.Create (1);
//Define the STAs
NodeContainer wifiStaNodes;
wifiStaNodes.Create (1);
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211a);
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
NetDeviceContainer wifiApDevices;
NetDeviceContainer wifiStaDevices;
NetDeviceContainer wifiDevices;
//Configure the STA node
wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager", "RtsCtsThreshold", UintegerValue (rtsThreshold));
wifiPhy.Set ("TxPowerStart", DoubleValue (maxPower));
wifiPhy.Set ("TxPowerEnd", DoubleValue (maxPower));
Ssid ssid = Ssid ("AP");
wifiMac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
wifiStaDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiStaNodes.Get (0)));
//Configure the AP node
wifi.SetRemoteStationManager (manager, "DefaultTxPowerLevel", UintegerValue (maxPower), "RtsCtsThreshold", UintegerValue (rtsThreshold));
wifiPhy.Set ("TxPowerStart", DoubleValue (minPower));
wifiPhy.Set ("TxPowerEnd", DoubleValue (maxPower));
wifiPhy.Set ("TxPowerLevels", UintegerValue (powerLevels));
ssid = Ssid ("AP");
wifiMac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
wifiApDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiApNodes.Get (0)));
wifiDevices.Add (wifiStaDevices);
wifiDevices.Add (wifiApDevices);
// Configure the mobility.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
//Initial position of AP and STA
positionAlloc->Add (Vector (ap1_x, ap1_y, 0.0));
NS_LOG_INFO ("Setting initial AP position to " << Vector (ap1_x, ap1_y, 0.0));
positionAlloc->Add (Vector (sta1_x, sta1_y, 0.0));
NS_LOG_INFO ("Setting initial STA position to " << Vector (sta1_x, sta1_y, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNodes.Get (0));
mobility.Install (wifiStaNodes.Get (0));
//Statistics counter
NodeStatistics statistics = NodeStatistics (wifiApDevices, wifiStaDevices);
//Move the STA by stepsSize meters every stepsTime seconds
Simulator::Schedule (Seconds (0.5 + stepsTime), &NodeStatistics::AdvancePosition, &statistics, wifiStaNodes.Get (0), stepsSize, stepsTime);
//Configure the IP stack
InternetStackHelper stack;
stack.Install (wifiApNodes);
stack.Install (wifiStaNodes);
Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = address.Assign (wifiDevices);
Ipv4Address sinkAddress = i.GetAddress (0);
uint16_t port = 9;
//Configure the CBR generator
PacketSinkHelper sink ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
ApplicationContainer apps_sink = sink.Install (wifiStaNodes.Get (0));
OnOffHelper onoff ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
onoff.SetConstantRate (DataRate ("54Mb/s"), packetSize);
onoff.SetAttribute ("StartTime", TimeValue (Seconds (0.5)));
onoff.SetAttribute ("StopTime", TimeValue (Seconds (simuTime)));
ApplicationContainer apps_source = onoff.Install (wifiApNodes.Get (0));
apps_sink.Start (Seconds (0.5));
apps_sink.Stop (Seconds (simuTime));
//------------------------------------------------------------
//-- Setup stats and data collection
//--------------------------------------------
//Register packet receptions to calculate throughput
Config::Connect ("/NodeList/1/ApplicationList/*/$ns3::PacketSink/Rx",
MakeCallback (&NodeStatistics::RxCallback, &statistics));
//Register power and rate changes to calculate the Average Transmit Power
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/PowerChange",
MakeCallback (&NodeStatistics::PowerCallback, &statistics));
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
MakeCallback (&NodeStatistics::RateCallback, &statistics));
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin",
MakeCallback (&NodeStatistics::PhyCallback, &statistics));
//Callbacks to print every change of power and rate
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/PowerChange",
MakeCallback (PowerCallback));
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
MakeCallback (RateCallback));
Simulator::Stop (Seconds (simuTime));
Simulator::Run ();
std::ofstream outfile (("throughput-" + outputFileName + ".plt").c_str ());
Gnuplot gnuplot = Gnuplot (("throughput-" + outputFileName + ".eps").c_str (), "Throughput");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Throughput (Mb/s)");
gnuplot.SetTitle ("Throughput (AP to STA) vs time");
gnuplot.AddDataset (statistics.GetDatafile ());
gnuplot.GenerateOutput (outfile);
if (manager.compare ("ns3::ParfWifiManager") == 0 ||
manager.compare ("ns3::AparfWifiManager") == 0)
{
std::ofstream outfile2 (("power-" + outputFileName + ".plt").c_str ());
gnuplot = Gnuplot (("power-" + outputFileName + ".eps").c_str (), "Average Transmit Power");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Power (mW)");
gnuplot.SetTitle ("Average transmit power (AP to STA) vs time");
gnuplot.AddDataset (statistics.GetPowerDatafile ());
gnuplot.GenerateOutput (outfile2);
}
Simulator::Destroy ();
return 0;
}
@@ -0,0 +1,673 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014 Universidad de la República - Uruguay
*
* 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: Matias Richart <mrichart@fing.edu.uy>
*/
/**
* This example program is designed to illustrate the behavior of two
* power/rate-adaptive WiFi rate controls; namely, ns3::ParfWifiManager
* and ns3::AparfWifiManager.
*
* This simulation consist of 4 nodes, two APs and two STAs.
* The APs generates UDP traffic with a CBR of 54 Mbps to the STAs.
* The APa use any power and rate control mechanism, and the STAs use only
* Minstrel rate control.
* The STAs can be configured to be at any distance from the APs.
*
* The objective is to test power and rate control in the links with
* interference from the other link.
*
* The output consists of:
* - A plot of average throughput vs. time.
* - A plot of average transmit power vs. time.
* - Plots for the percentage of time the APs are in each MAC state (IDLE, TX, RX, BUSY)
* - If enabled, the changes of power and rate to standard output.
* - If enabled, the average throughput, delay, jitter and tx opportunity for the total simulation time.
*
* Example usage:
* \code{.sh}
* ./waf --run "power-adaptation-interference --manager=ns3::AparfWifiManager --outputFileName=aparf"
* \endcode
*
* Another example (changing STAs position):
* \code{.sh}
* ./waf --run "power-adaptation-interference --manager=ns3::AparfWifiManager --outputFileName=aparf --STA1_x=5 --STA2_x=205"
* \endcode
*
* To enable the log of rate and power changes:
* \code{.sh}
* export NS_LOG=PowerAdaptationInterference=level_info
* \endcode
*/
#include <sstream>
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/mobility-module.h"
#include "ns3/wifi-module.h"
#include "ns3/applications-module.h"
#include "ns3/stats-module.h"
#include "ns3/flow-monitor-module.h"
using namespace ns3;
using namespace std;
NS_LOG_COMPONENT_DEFINE ("PowerAdaptationInterference");
// packet size generated at the AP
static const uint32_t packetSize = 1420;
class NodeStatistics
{
public:
NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas);
void CheckStatistics (double time);
void PhyCallback (std::string path, Ptr<const Packet> packet);
void RxCallback (std::string path, Ptr<const Packet> packet, const Address &from);
void PowerCallback (std::string path, uint8_t power, Mac48Address dest);
void RateCallback (std::string path, uint32_t rate, Mac48Address dest);
void StateCallback (std::string path, Time init, Time duration, enum WifiPhy::State state);
Gnuplot2dDataset GetDatafile ();
Gnuplot2dDataset GetPowerDatafile ();
Gnuplot2dDataset GetIdleDatafile ();
Gnuplot2dDataset GetBusyDatafile ();
Gnuplot2dDataset GetTxDatafile ();
Gnuplot2dDataset GetRxDatafile ();
double GetBusyTime ();
private:
typedef std::vector<std::pair<Time,WifiMode> > TxTime;
void SetupPhy (Ptr<WifiPhy> phy);
Time GetCalcTxTime (WifiMode mode);
std::map<Mac48Address, uint32_t> actualPower;
std::map<Mac48Address, WifiMode> actualMode;
uint32_t m_bytesTotal;
double totalEnergy;
double totalTime;
double busyTime;
double idleTime;
double txTime;
double rxTime;
double totalBusyTime;
double totalIdleTime;
double totalTxTime;
double totalRxTime;
Ptr<WifiPhy> myPhy;
TxTime timeTable;
Gnuplot2dDataset m_output;
Gnuplot2dDataset m_output_power;
Gnuplot2dDataset m_output_idle;
Gnuplot2dDataset m_output_busy;
Gnuplot2dDataset m_output_rx;
Gnuplot2dDataset m_output_tx;
};
NodeStatistics::NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas)
{
Ptr<NetDevice> device = aps.Get (0);
Ptr<WifiNetDevice> wifiDevice = DynamicCast<WifiNetDevice> (device);
Ptr<WifiPhy> phy = wifiDevice->GetPhy ();
myPhy = phy;
SetupPhy (phy);
for (uint32_t j = 0; j < stas.GetN (); j++)
{
Ptr<NetDevice> staDevice = stas.Get (j);
Ptr<WifiNetDevice> wifiStaDevice = DynamicCast<WifiNetDevice> (staDevice);
Mac48Address addr = wifiStaDevice->GetMac ()->GetAddress ();
actualPower[addr] = 17;
actualMode[addr] = phy->GetMode (0);
}
actualMode[Mac48Address ("ff:ff:ff:ff:ff:ff")] = phy->GetMode (0);
totalEnergy = 0;
totalTime = 0;
busyTime = 0;
idleTime = 0;
txTime = 0;
rxTime = 0;
totalBusyTime = 0;
totalIdleTime = 0;
totalTxTime = 0;
totalRxTime = 0;
m_bytesTotal = 0;
m_output.SetTitle ("Throughput Mbits/s");
m_output_idle.SetTitle ("Idle Time");
m_output_busy.SetTitle ("Busy Time");
m_output_rx.SetTitle ("RX Time");
m_output_tx.SetTitle ("TX Time");
}
void
NodeStatistics::SetupPhy (Ptr<WifiPhy> phy)
{
uint32_t nModes = phy->GetNModes ();
for (uint32_t i = 0; i < nModes; i++)
{
WifiMode mode = phy->GetMode (i);
WifiTxVector txVector;
txVector.SetMode (mode);
timeTable.push_back (std::make_pair (phy->CalculateTxDuration (packetSize, txVector, WIFI_PREAMBLE_LONG, phy->GetFrequency (), 0, 0), mode));
}
}
Time
NodeStatistics::GetCalcTxTime (WifiMode mode)
{
for (TxTime::const_iterator i = timeTable.begin (); i != timeTable.end (); i++)
{
if (mode == i->second)
{
return i->first;
}
}
NS_ASSERT (false);
return Seconds (0);
}
void
NodeStatistics::PhyCallback (std::string path, Ptr<const Packet> packet)
{
WifiMacHeader head;
packet->PeekHeader (head);
Mac48Address dest = head.GetAddr1 ();
if (head.GetType() == WIFI_MAC_DATA)
{
totalEnergy += pow(10, actualPower[dest] / 10) * GetCalcTxTime (actualMode[dest]).GetSeconds ();
totalTime += GetCalcTxTime (actualMode[dest]).GetSeconds ();
}
}
void
NodeStatistics::PowerCallback (std::string path, uint8_t power, Mac48Address dest)
{
double txPowerBaseDbm = myPhy->GetTxPowerStart ();
double txPowerEndDbm = myPhy->GetTxPowerEnd ();
uint32_t nTxPower = myPhy->GetNTxPower ();
double dbm;
if (nTxPower > 1)
{
dbm = txPowerBaseDbm + power * (txPowerEndDbm - txPowerBaseDbm) / (nTxPower - 1);
}
else
{
NS_ASSERT_MSG (txPowerBaseDbm == txPowerEndDbm, "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1");
dbm = txPowerBaseDbm;
}
actualPower[dest] = dbm;
}
void
NodeStatistics::RateCallback (std::string path, uint32_t rate, Mac48Address dest)
{
actualMode[dest] = myPhy->GetMode (rate);
}
void
NodeStatistics::StateCallback (std::string path, Time init, Time duration, enum WifiPhy::State state)
{
if (state == WifiPhy::CCA_BUSY)
{
busyTime += duration.GetSeconds ();
totalBusyTime += duration.GetSeconds ();
}
else if (state == WifiPhy::IDLE)
{
idleTime += duration.GetSeconds ();
totalIdleTime += duration.GetSeconds ();
}
else if (state == WifiPhy::TX)
{
txTime += duration.GetSeconds ();
totalTxTime += duration.GetSeconds ();
}
else if (state == WifiPhy::RX)
{
rxTime += duration.GetSeconds ();
totalRxTime += duration.GetSeconds ();
}
}
void
NodeStatistics::RxCallback (std::string path, Ptr<const Packet> packet, const Address &from)
{
m_bytesTotal += packet->GetSize ();
}
void
NodeStatistics::CheckStatistics (double time)
{
double mbs = ((m_bytesTotal * 8.0) / (1000000 * time));
m_bytesTotal = 0;
double atp = totalEnergy / time;
totalEnergy = 0;
totalTime = 0;
m_output_power.Add ((Simulator::Now ()).GetSeconds (), atp);
m_output.Add ((Simulator::Now ()).GetSeconds (), mbs);
m_output_idle.Add ((Simulator::Now ()).GetSeconds (), idleTime * 100);
m_output_busy.Add ((Simulator::Now ()).GetSeconds (), busyTime * 100);
m_output_tx.Add ((Simulator::Now ()).GetSeconds (), txTime * 100);
m_output_rx.Add ((Simulator::Now ()).GetSeconds (), rxTime * 100);
busyTime = 0;
idleTime = 0;
txTime = 0;
rxTime = 0;
Simulator::Schedule (Seconds (time), &NodeStatistics::CheckStatistics, this, time);
}
Gnuplot2dDataset
NodeStatistics::GetDatafile ()
{
return m_output;
}
Gnuplot2dDataset
NodeStatistics::GetPowerDatafile ()
{
return m_output_power;
}
Gnuplot2dDataset
NodeStatistics::GetIdleDatafile ()
{
return m_output_idle;
}
Gnuplot2dDataset
NodeStatistics::GetBusyDatafile ()
{
return m_output_busy;
}
Gnuplot2dDataset
NodeStatistics::GetRxDatafile ()
{
return m_output_rx;
}
Gnuplot2dDataset
NodeStatistics::GetTxDatafile ()
{
return m_output_tx;
}
double
NodeStatistics::GetBusyTime ()
{
return totalBusyTime + totalRxTime;
}
void PowerCallback (std::string path, uint8_t power, Mac48Address dest)
{
NS_LOG_INFO ((Simulator::Now ()).GetSeconds () << " " << dest << " Power " << (int)power);
// end PowerCallback
}
void RateCallback (std::string path, uint32_t rate, Mac48Address dest)
{
NS_LOG_INFO ((Simulator::Now ()).GetSeconds () << " " << dest << " Rate " << rate);
// end PowerCallback
}
int main (int argc, char *argv[])
{
//LogComponentEnable("ConstantRateWifiManager", LOG_LEVEL_FUNCTION);
double maxPower = 17;
double minPower = 0;
uint32_t powerLevels = 18;
uint32_t rtsThreshold = 2346;
std::string manager = "ns3::ParfWifiManager";
std::string outputFileName = "parf";
int ap1_x = 0;
int ap1_y = 0;
int sta1_x = 10;
int sta1_y = 0;
int ap2_x = 200;
int ap2_y = 0;
int sta2_x = 180;
int sta2_y = 0;
uint32_t simuTime = 100;
CommandLine cmd;
cmd.AddValue ("manager", "PRC Manager", manager);
cmd.AddValue ("rtsThreshold", "RTS threshold", rtsThreshold);
cmd.AddValue ("outputFileName", "Output filename", outputFileName);
cmd.AddValue ("simuTime", "Total simulation time (sec)", simuTime);
cmd.AddValue ("maxPower", "Maximum available transmission level (dbm).", maxPower);
cmd.AddValue ("minPower", "Minimum available transmission level (dbm).", minPower);
cmd.AddValue ("powerLevels", "Number of transmission power levels available between "
"TxPowerStart and TxPowerEnd included.", powerLevels);
cmd.AddValue ("AP1_x", "Position of AP1 in x coordinate", ap1_x);
cmd.AddValue ("AP1_y", "Position of AP1 in y coordinate", ap1_y);
cmd.AddValue ("STA1_x", "Position of STA1 in x coordinate", sta1_x);
cmd.AddValue ("STA1_y", "Position of STA1 in y coordinate", sta1_y);
cmd.AddValue ("AP2_x", "Position of AP2 in x coordinate", ap2_x);
cmd.AddValue ("AP2_y", "Position of AP2 in y coordinate", ap2_y);
cmd.AddValue ("STA2_x", "Position of STA2 in x coordinate", sta2_x);
cmd.AddValue ("STA2_y", "Position of STA2 in y coordinate", sta2_y);
cmd.Parse (argc, argv);
// Define the APs
NodeContainer wifiApNodes;
wifiApNodes.Create (2);
//Define the STAs
NodeContainer wifiStaNodes;
wifiStaNodes.Create (2);
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211a);
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
NetDeviceContainer wifiApDevices;
NetDeviceContainer wifiStaDevices;
NetDeviceContainer wifiDevices;
//Configure the STA nodes
wifi.SetRemoteStationManager ("ns3::AarfWifiManager", "RtsCtsThreshold", UintegerValue (rtsThreshold));
//wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",StringValue ("ErpOfdmRate6Mbps"),"ControlMode",StringValue ("ErpOfdmRate6Mbps"));
wifiPhy.Set ("TxPowerStart", DoubleValue (maxPower));
wifiPhy.Set ("TxPowerEnd", DoubleValue (maxPower));
Ssid ssid = Ssid ("AP0");
wifiMac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false),
"MaxMissedBeacons", UintegerValue (1000));
wifiStaDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiStaNodes.Get (0)));
ssid = Ssid ("AP1");
wifiMac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
wifiStaDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiStaNodes.Get (1)));
//Configure the AP nodes
wifi.SetRemoteStationManager (manager, "DefaultTxPowerLevel", UintegerValue (maxPower), "RtsCtsThreshold", UintegerValue (rtsThreshold));
wifiPhy.Set ("TxPowerStart", DoubleValue (minPower));
wifiPhy.Set ("TxPowerEnd", DoubleValue (maxPower));
wifiPhy.Set ("TxPowerLevels", UintegerValue (powerLevels));
ssid = Ssid ("AP0");
wifiMac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
wifiApDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiApNodes.Get (0)));
ssid = Ssid ("AP1");
wifiMac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
"BeaconInterval", TimeValue (MicroSeconds (103424))); //for avoiding collisions);
wifiApDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiApNodes.Get (1)));
wifiDevices.Add (wifiStaDevices);
wifiDevices.Add (wifiApDevices);
// Configure the mobility.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (ap1_x, ap1_y, 0.0));
positionAlloc->Add (Vector (sta1_x, sta1_y, 0.0));
positionAlloc->Add (Vector (ap2_x, ap2_y, 0.0));
positionAlloc->Add (Vector (sta2_x, sta2_y, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNodes.Get (0));
mobility.Install (wifiStaNodes.Get (0));
mobility.Install (wifiApNodes.Get (1));
mobility.Install (wifiStaNodes.Get (1));
//Configure the IP stack
InternetStackHelper stack;
stack.Install (wifiApNodes);
stack.Install (wifiStaNodes);
Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = address.Assign (wifiDevices);
Ipv4Address sinkAddress = i.GetAddress (0);
Ipv4Address sinkAddress1 = i.GetAddress (1);
uint16_t port = 9;
//Configure the CBR generator
PacketSinkHelper sink ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
ApplicationContainer apps_sink = sink.Install (wifiStaNodes.Get (0));
OnOffHelper onoff ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
onoff.SetConstantRate (DataRate ("54Mb/s"), packetSize);
onoff.SetAttribute ("StartTime", TimeValue (Seconds (0.0)));
onoff.SetAttribute ("StopTime", TimeValue (Seconds (100.0)));
ApplicationContainer apps_source = onoff.Install (wifiApNodes.Get (0));
PacketSinkHelper sink1 ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress1, port));
apps_sink.Add (sink1.Install (wifiStaNodes.Get (1)));
OnOffHelper onoff1 ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress1, port));
onoff1.SetConstantRate (DataRate ("54Mb/s"), packetSize);
onoff1.SetAttribute ("StartTime", TimeValue (Seconds (0.0)));
onoff1.SetAttribute ("StopTime", TimeValue (Seconds (100.0)));
apps_source.Add (onoff1.Install (wifiApNodes.Get (1)));
apps_sink.Start (Seconds (0.5));
apps_sink.Stop (Seconds (simuTime));
//------------------------------------------------------------
//-- Setup stats and data collection
//--------------------------------------------
//Statistics counters
NodeStatistics statisticsAp0 = NodeStatistics (wifiApDevices, wifiStaDevices);
NodeStatistics statisticsAp1 = NodeStatistics (wifiApDevices, wifiStaDevices);
//Register packet receptions to calculate throughput
Config::Connect ("/NodeList/2/ApplicationList/*/$ns3::PacketSink/Rx",
MakeCallback (&NodeStatistics::RxCallback, &statisticsAp0));
Config::Connect ("/NodeList/3/ApplicationList/*/$ns3::PacketSink/Rx",
MakeCallback (&NodeStatistics::RxCallback, &statisticsAp1));
//Register power and rate changes to calculate the Average Transmit Power
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/PowerChange",
MakeCallback (&NodeStatistics::PowerCallback, &statisticsAp0));
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
MakeCallback (&NodeStatistics::RateCallback, &statisticsAp0));
Config::Connect ("/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/PowerChange",
MakeCallback (&NodeStatistics::PowerCallback, &statisticsAp1));
Config::Connect ("/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
MakeCallback (&NodeStatistics::RateCallback, &statisticsAp1));
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin",
MakeCallback (&NodeStatistics::PhyCallback, &statisticsAp0));
Config::Connect ("/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin",
MakeCallback (&NodeStatistics::PhyCallback, &statisticsAp1));
//Register States
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/State/State",
MakeCallback (&NodeStatistics::StateCallback, &statisticsAp0));
Config::Connect ("/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/State/State",
MakeCallback (&NodeStatistics::StateCallback, &statisticsAp1));
statisticsAp0.CheckStatistics (1);
statisticsAp1.CheckStatistics (1);
//Callbacks to print every change of power and rate
Config::Connect ("/NodeList/[0-1]/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/PowerChange",
MakeCallback (PowerCallback));
Config::Connect ("/NodeList/[0-1]/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
MakeCallback (RateCallback));
// Calculate Throughput using Flowmonitor
//
FlowMonitorHelper flowmon;
Ptr<FlowMonitor> monitor = flowmon.InstallAll ();
Simulator::Stop (Seconds (simuTime));
Simulator::Run ();
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin (); i != stats.end (); ++i)
{
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first);
if ((t.sourceAddress == "10.1.1.3" && t.destinationAddress == "10.1.1.1"))
{
NS_LOG_INFO ("Flow " << i->first << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n");
NS_LOG_INFO (" Tx Bytes: " << i->second.txBytes << "\n");
NS_LOG_INFO (" Rx Bytes: " << i->second.rxBytes << "\n");
NS_LOG_UNCOND (" Throughput to 10.1.1.1: " << i->second.rxBytes * 8.0 / (i->second.timeLastRxPacket.GetSeconds () - i->second.timeFirstTxPacket.GetSeconds ()) / 1024 / 1024 << " Mbps\n");
NS_LOG_INFO (" Mean delay: " << i->second.delaySum.GetSeconds () / i->second.rxPackets << "\n");
NS_LOG_INFO (" Mean jitter: " << i->second.jitterSum.GetSeconds () / (i->second.rxPackets - 1) << "\n");
NS_LOG_INFO (" Tx Opp: " << 1 - (statisticsAp0.GetBusyTime () / simuTime));
}
if ((t.sourceAddress == "10.1.1.4" && t.destinationAddress == "10.1.1.2"))
{
NS_LOG_INFO ("Flow " << i->first << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n");
NS_LOG_INFO (" Tx Bytes: " << i->second.txBytes << "\n");
NS_LOG_INFO (" Rx Bytes: " << i->second.rxBytes << "\n");
NS_LOG_UNCOND (" Throughput to 10.1.1.2: " << i->second.rxBytes * 8.0 / (i->second.timeLastRxPacket.GetSeconds () - i->second.timeFirstTxPacket.GetSeconds ()) / 1024 / 1024 << " Mbps\n");
NS_LOG_INFO (" Mean delay: " << i->second.delaySum.GetSeconds () / i->second.rxPackets << "\n");
NS_LOG_INFO (" Mean jitter: " << i->second.jitterSum.GetSeconds () / (i->second.rxPackets - 1) << "\n");
NS_LOG_INFO (" Tx Opp: " << 1 - (statisticsAp1.GetBusyTime () / simuTime));
}
}
//Plots for AP0
std::ofstream outfileTh0 (("throughput-" + outputFileName + "-0.plt").c_str ());
Gnuplot gnuplot = Gnuplot (("throughput-" + outputFileName + "-0.eps").c_str (), "Throughput");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Throughput (Mb/s)");
gnuplot.SetTitle ("Throughput (AP0 to STA) vs time");
gnuplot.AddDataset (statisticsAp0.GetDatafile ());
gnuplot.GenerateOutput (outfileTh0);
if (manager.compare ("ns3::ParfWifiManager") == 0 ||
manager.compare ("ns3::AparfWifiManager") == 0)
{
std::ofstream outfilePower0 (("power-" + outputFileName + "-0.plt").c_str ());
gnuplot = Gnuplot (("power-" + outputFileName + "-0.eps").c_str (), "Average Transmit Power");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Power (mW)");
gnuplot.SetTitle ("Average transmit power (AP0 to STA) vs time");
gnuplot.AddDataset (statisticsAp0.GetPowerDatafile ());
gnuplot.GenerateOutput (outfilePower0);
}
std::ofstream outfileTx0 (("tx-" + outputFileName + "-0.plt").c_str ());
gnuplot = Gnuplot (("tx-" + outputFileName + "-0.eps").c_str (), "Time in TX State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP0 in TX state vs time");
gnuplot.AddDataset (statisticsAp0.GetTxDatafile ());
gnuplot.GenerateOutput (outfileTx0);
std::ofstream outfileRx0 (("rx-" + outputFileName + "-0.plt").c_str ());
gnuplot = Gnuplot (("rx-" + outputFileName + "-0.eps").c_str (), "Time in RX State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP0 in RX state vs time");
gnuplot.AddDataset (statisticsAp0.GetRxDatafile ());
gnuplot.GenerateOutput (outfileRx0);
std::ofstream outfileBusy0 (("busy-" + outputFileName + "-0.plt").c_str ());
gnuplot = Gnuplot (("busy-" + outputFileName + "-0.eps").c_str (), "Time in Busy State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP0 in Busy state vs time");
gnuplot.AddDataset (statisticsAp0.GetBusyDatafile ());
gnuplot.GenerateOutput (outfileBusy0);
std::ofstream outfileIdle0 (("idle-" + outputFileName + "-0.plt").c_str ());
gnuplot = Gnuplot (("idle-" + outputFileName + "-0.eps").c_str (), "Time in Idle State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP0 in Idle state vs time");
gnuplot.AddDataset (statisticsAp0.GetIdleDatafile ());
gnuplot.GenerateOutput (outfileIdle0);
//Plots for AP1
std::ofstream outfileTh1 (("throughput-" + outputFileName + "-1.plt").c_str ());
gnuplot = Gnuplot (("throughput-" + outputFileName + "-1.eps").c_str (), "Throughput");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Throughput (Mb/s)");
gnuplot.SetTitle ("Throughput (AP1 to STA) vs time");
gnuplot.AddDataset (statisticsAp1.GetDatafile ());
gnuplot.GenerateOutput (outfileTh1);
if (manager.compare ("ns3::ParfWifiManager") == 0 ||
manager.compare ("ns3::AparfWifiManager") == 0)
{
std::ofstream outfilePower1 (("power-" + outputFileName + "-1.plt").c_str ());
gnuplot = Gnuplot (("power-" + outputFileName + "-1.eps").c_str (), "Average Transmit Power");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Power (mW)");
gnuplot.SetTitle ("Average transmit power (AP1 to STA) vs time");
gnuplot.AddDataset (statisticsAp1.GetPowerDatafile ());
gnuplot.GenerateOutput (outfilePower1);
}
std::ofstream outfileTx1 (("tx-" + outputFileName + "-1.plt").c_str ());
gnuplot = Gnuplot (("tx-" + outputFileName + "-1.eps").c_str (), "Time in TX State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP1 in TX state vs time");
gnuplot.AddDataset (statisticsAp1.GetTxDatafile ());
gnuplot.GenerateOutput (outfileTx1);
std::ofstream outfileRx1 (("rx-" + outputFileName + "-1.plt").c_str ());
gnuplot = Gnuplot (("rx-" + outputFileName + "-1.eps").c_str (), "Time in RX State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP1 in RX state vs time");
gnuplot.AddDataset (statisticsAp1.GetRxDatafile ());
gnuplot.GenerateOutput (outfileRx1);
std::ofstream outfileBusy1 (("busy-" + outputFileName + "-1.plt").c_str ());
gnuplot = Gnuplot (("busy-" + outputFileName + "-1.eps").c_str (), "Time in Busy State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP1 in Busy state vs time");
gnuplot.AddDataset (statisticsAp1.GetBusyDatafile ());
gnuplot.GenerateOutput (outfileBusy1);
std::ofstream outfileIdle1 (("idle-" + outputFileName + "-1.plt").c_str ());
gnuplot = Gnuplot (("idle-" + outputFileName + "-1.eps").c_str (), "Time in Idle State");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Percent");
gnuplot.SetTitle ("Percentage time AP1 in Idle state vs time");
gnuplot.AddDataset (statisticsAp1.GetIdleDatafile ());
gnuplot.GenerateOutput (outfileIdle1);
Simulator::Destroy ();
return 0;
}
@@ -0,0 +1,276 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014 Universidad de la República - Uruguay
*
* 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: Matías Richart <mrichart@fing.edu.uy>
*/
/**
* This example program is designed to illustrate the behavior of
* rate-adaptive WiFi rate controls such as Minstrel. Power-adaptive
* rate controls can be illustrated also, but separate examples exist for
* highlighting the power adaptation.
*
* This simulation consist of 2 nodes, one AP and one STA.
* The AP generates UDP traffic with a CBR of 54 Mbps to the STA.
* The AP can use any power and rate control mechanism and the STA uses
* only Minstrel rate control.
* The STA can be configured to move away from (or towards to) the AP.
* By default, the AP is at coordinate (0,0,0) and the STA starts at
* coordinate (5,0,0) (meters) and moves away on the x axis by 1 meter every
* second.
*
* The output consists of:
* - A plot of average throughput vs. distance.
* - (if logging is enabled) the changes of rate to standard output.
*
* Example usage:
* ./waf --run "rate-adaptation-distance --manager=ns3::MinstrelWifiManager --outputFileName=minstrel"
*
* Another example (moving towards the AP):
* ./waf --run "rate-adaptation-distance --manager=ns3::MinstrelWifiManager --outputFileName=minstrel --stepsSize=1 --STA1_x=-200"
*
* To enable the log of rate changes:
* export NS_LOG=RateAdaptationDistance=level_info
*/
#include <sstream>
#include <fstream>
#include <math.h>
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/mobility-module.h"
#include "ns3/wifi-module.h"
#include "ns3/applications-module.h"
#include "ns3/stats-module.h"
#include "ns3/flow-monitor-module.h"
using namespace ns3;
using namespace std;
NS_LOG_COMPONENT_DEFINE ("RateAdaptationDistance");
class NodeStatistics
{
public:
NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas);
void CheckStatistics (double time);
void RxCallback (std::string path, Ptr<const Packet> packet, const Address &from);
void SetPosition (Ptr<Node> node, Vector position);
void AdvancePosition (Ptr<Node> node, int stepsSize, int stepsTime);
Vector GetPosition (Ptr<Node> node);
Gnuplot2dDataset GetDatafile ();
private:
uint32_t m_bytesTotal;
Gnuplot2dDataset m_output;
};
NodeStatistics::NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas)
{
m_bytesTotal = 0;
}
void
NodeStatistics::RxCallback (std::string path, Ptr<const Packet> packet, const Address &from)
{
m_bytesTotal += packet->GetSize ();
}
void
NodeStatistics::CheckStatistics (double time)
{
}
void
NodeStatistics::SetPosition (Ptr<Node> node, Vector position)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
mobility->SetPosition (position);
}
Vector
NodeStatistics::GetPosition (Ptr<Node> node)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
return mobility->GetPosition ();
}
void
NodeStatistics::AdvancePosition (Ptr<Node> node, int stepsSize, int stepsTime)
{
Vector pos = GetPosition (node);
double mbs = ((m_bytesTotal * 8.0) / (1000000 * stepsTime));
m_bytesTotal = 0;
m_output.Add (pos.x, mbs);
pos.x += stepsSize;
SetPosition (node, pos);
Simulator::Schedule (Seconds (stepsTime), &NodeStatistics::AdvancePosition, this, node, stepsSize, stepsTime);
}
Gnuplot2dDataset
NodeStatistics::GetDatafile ()
{
return m_output;
}
void RateCallback (std::string path, uint32_t rate, Mac48Address dest)
{
NS_LOG_INFO ((Simulator::Now ()).GetSeconds () << " " << dest << " Rate " << rate);
}
int main (int argc, char *argv[])
{
uint32_t rtsThreshold = 2346;
std::string manager = "ns3::MinstrelWifiManager";
std::string outputFileName = "minstrel";
int ap1_x = 0;
int ap1_y = 0;
int sta1_x = 5;
int sta1_y = 0;
int steps = 200;
int stepsSize = 1;
int stepsTime = 1;
CommandLine cmd;
cmd.AddValue ("manager", "PRC Manager", manager);
cmd.AddValue ("rtsThreshold", "RTS threshold", rtsThreshold);
cmd.AddValue ("outputFileName", "Output filename", outputFileName);
cmd.AddValue ("steps", "How many different distances to try", steps);
cmd.AddValue ("stepsTime", "Time on each step", stepsTime);
cmd.AddValue ("stepsSize", "Distance between steps", stepsSize);
cmd.AddValue ("AP1_x", "Position of AP1 in x coordinate", ap1_x);
cmd.AddValue ("AP1_y", "Position of AP1 in y coordinate", ap1_y);
cmd.AddValue ("STA1_x", "Position of STA1 in x coordinate", sta1_x);
cmd.AddValue ("STA1_y", "Position of STA1 in y coordinate", sta1_y);
cmd.Parse (argc, argv);
int simuTime = steps * stepsTime;
// Define the APs
NodeContainer wifiApNodes;
wifiApNodes.Create (1);
//Define the STAs
NodeContainer wifiStaNodes;
wifiStaNodes.Create (1);
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211a);
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
NetDeviceContainer wifiApDevices;
NetDeviceContainer wifiStaDevices;
NetDeviceContainer wifiDevices;
//Configure the STA node
wifi.SetRemoteStationManager (manager, "RtsCtsThreshold", UintegerValue (rtsThreshold));
Ssid ssid = Ssid ("AP");
wifiMac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
wifiStaDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiStaNodes.Get (0)));
//Configure the AP node
wifi.SetRemoteStationManager (manager, "RtsCtsThreshold", UintegerValue (rtsThreshold));
ssid = Ssid ("AP");
wifiMac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
wifiApDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiApNodes.Get (0)));
wifiDevices.Add (wifiStaDevices);
wifiDevices.Add (wifiApDevices);
// Configure the mobility.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
//Initial position of AP and STA
positionAlloc->Add (Vector (ap1_x, ap1_y, 0.0));
positionAlloc->Add (Vector (sta1_x, sta1_y, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNodes.Get (0));
mobility.Install (wifiStaNodes.Get (0));
//Statistics counter
NodeStatistics atpCounter = NodeStatistics (wifiApDevices, wifiStaDevices);
//Move the STA by stepsSize meters every stepsTime seconds
Simulator::Schedule (Seconds (0.5 + stepsTime), &NodeStatistics::AdvancePosition, &atpCounter, wifiStaNodes.Get (0), stepsSize, stepsTime);
//Configure the IP stack
InternetStackHelper stack;
stack.Install (wifiApNodes);
stack.Install (wifiStaNodes);
Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = address.Assign (wifiDevices);
Ipv4Address sinkAddress = i.GetAddress (0);
uint16_t port = 9;
//Configure the CBR generator
PacketSinkHelper sink ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
ApplicationContainer apps_sink = sink.Install (wifiStaNodes.Get (0));
OnOffHelper onoff ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
onoff.SetConstantRate (DataRate ("54Mb/s"), 1420);
onoff.SetAttribute ("StartTime", TimeValue (Seconds (0.5)));
onoff.SetAttribute ("StopTime", TimeValue (Seconds (simuTime)));
ApplicationContainer apps_source = onoff.Install (wifiApNodes.Get (0));
apps_sink.Start (Seconds (0.5));
apps_sink.Stop (Seconds (simuTime));
//------------------------------------------------------------
//-- Setup stats and data collection
//--------------------------------------------
//Register packet receptions to calculate throughput
Config::Connect ("/NodeList/1/ApplicationList/*/$ns3::PacketSink/Rx",
MakeCallback (&NodeStatistics::RxCallback, &atpCounter));
//Callbacks to print every change of rate
Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
MakeCallback (RateCallback));
Simulator::Stop (Seconds (simuTime));
Simulator::Run ();
std::ofstream outfile (("throughput-" + outputFileName + ".plt").c_str ());
Gnuplot gnuplot = Gnuplot (("throughput-" + outputFileName + ".eps").c_str (), "Throughput");
gnuplot.SetTerminal ("post eps color enhanced");
gnuplot.SetLegend ("Time (seconds)", "Throughput (Mb/s)");
gnuplot.SetTitle ("Throughput (AP to STA) vs time");
gnuplot.AddDataset (atpCounter.GetDatafile ());
gnuplot.GenerateOutput (outfile);
Simulator::Destroy ();
return 0;
}
@@ -0,0 +1,179 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015 Sébastien Deronne
*
* 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: Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
// This example considers two hidden stations in an 802.11n network which supports MPDU aggregation.
// The user can specify whether RTS/CTS is used and can set the number of aggregated MPDUs.
//
// Example: ./waf --run "simple-ht-hidden-stations --enableRts=1 --nMpdus=8"
//
// Network topology:
//
// Wifi 192.168.1.0
//
// AP
// * * *
// | | |
// n1 n2 n3
//
// Packets in this simulation aren't marked with a QosTag so they are considered
// belonging to BestEffort Access Class (AC_BE).
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimplesHtHiddenStations");
int main (int argc, char *argv[])
{
uint32_t payloadSize = 1472; //bytes
uint64_t simulationTime = 10; //seconds
uint32_t nMpdus = 1;
bool enableRts = 0;
CommandLine cmd;
cmd.AddValue("nMpdus", "Number of aggregated MPDUs", nMpdus);
cmd.AddValue("payloadSize", "Payload size in bytes", payloadSize);
cmd.AddValue("enableRts", "Enable RTS/CTS", enableRts); // 1: RTS/CTS enabled; 0: RTS/CTS disabled
cmd.AddValue("simulationTime", "Simulation time in seconds", simulationTime);
cmd.Parse (argc, argv);
if(!enableRts)
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("999999"));
else
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
// Set the maximum wireless range to 5 meters in order to reproduce a hidden nodes scenario, i.e. the distance between hidden stations is larger than 5 meters
Config::SetDefault ("ns3::RangePropagationLossModel::MaxRange", DoubleValue (5));
NodeContainer wifiStaNodes;
wifiStaNodes.Create (2);
NodeContainer wifiApNode;
wifiApNode.Create(1);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
channel.AddPropagationLoss ("ns3::RangePropagationLossModel"); //wireless range limited to 5 meters!
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
phy.SetChannel (channel.Create());
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue("OfdmRate65MbpsBW20MHz"), "ControlMode", StringValue("OfdmRate6_5MbpsBW20MHz"));
HtWifiMacHelper mac = HtWifiMacHelper::Default ();
Ssid ssid = Ssid ("simple-mpdu-aggregation");
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
if (nMpdus > 1) mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable Block ACK when A-MPDU is enabled
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus*(payloadSize+100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes,
//i.e. nMpdus aggregated packets in an A-MPDU
NetDeviceContainer staDevices;
staDevices = wifi.Install (phy, mac, wifiStaNodes);
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
"BeaconInterval", TimeValue (MicroSeconds(102400)),
"BeaconGeneration", BooleanValue (true));
if (nMpdus > 1) mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable Block ACK when A-MPDU is enabled
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus*(payloadSize+100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes,
//i.e. nMpdus aggregated packets in an A-MPDU
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
// Setting mobility model
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
// AP is between the two stations, each station being located at 5 meters from the AP.
// The distance between the two stations is thus equal to 10 meters.
// Since the wireless range is limited to 5 meters, the two stations are hidden from each other.
positionAlloc->Add (Vector (5.0, 0.0, 0.0));
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (10.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNode);
mobility.Install (wifiStaNodes);
// Internet stack
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiStaNodes);
Ipv4AddressHelper address;
address.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer StaInterface;
StaInterface = address.Assign (staDevices);
Ipv4InterfaceContainer ApInterface;
ApInterface = address.Assign (apDevice);
// Setting applications
UdpServerHelper myServer (9);
ApplicationContainer serverApp = myServer.Install (wifiApNode);
serverApp.Start (Seconds (0.0));
serverApp.Stop (Seconds (simulationTime+1));
UdpClientHelper myClient (ApInterface.GetAddress (0), 9);
myClient.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
myClient.SetAttribute ("Interval", TimeValue (Time ("0.00002"))); //packets/s
myClient.SetAttribute ("PacketSize", UintegerValue (payloadSize));
// Saturated UDP traffic from stations to AP
ApplicationContainer clientApp1 = myClient.Install (wifiStaNodes);
clientApp1.Start (Seconds (1.0));
clientApp1.Stop (Seconds (simulationTime+1));
phy.EnablePcap ("SimpleHtHiddenStations_Ap", apDevice.Get (0));
phy.EnablePcap ("SimpleHtHiddenStations_Sta1", staDevices.Get (0));
phy.EnablePcap ("SimpleHtHiddenStations_Sta2", staDevices.Get (1));
Simulator::Stop (Seconds (simulationTime+1));
Simulator::Run ();
Simulator::Destroy ();
uint32_t totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get (0))->GetReceived ();
double throughput = totalPacketsThrough*payloadSize*8/(simulationTime*1000000.0);
std::cout << "Throughput: " << throughput << " Mbit/s" << '\n';
return 0;
}
@@ -0,0 +1,166 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015 Sébastien Deronne
*
* 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: Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
// This is a simple example in order to show how 802.11n MPDU aggregation feature works.
// The throughput is obtained for a given number of aggregated MPDUs.
//
// The number of aggregated MPDUs can be chosen by the user through the nMpdus attibute.
// A value of 1 means that no MPDU aggregation is performed.
//
// Example: ./waf --run "simple-mpdu-aggregation --nMpdus=64"
//
// Network topology:
//
// Wifi 192.168.1.0
//
// AP
// * *
// | |
// n1 n2
//
// Packets in this simulation aren't marked with a QosTag so they are considered
// belonging to BestEffort Access Class (AC_BE).
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleMpduAggregation");
int main (int argc, char *argv[])
{
uint32_t payloadSize = 1472; //bytes
uint64_t simulationTime = 10; //seconds
uint32_t nMpdus = 1;
bool enableRts = 0;
CommandLine cmd;
cmd.AddValue("nMpdus", "Number of aggregated MPDUs", nMpdus); //number of aggregated MPDUs specified by the user
cmd.AddValue("payloadSize", "Payload size in bytes", payloadSize);
cmd.AddValue("enableRts", "Enable RTS/CTS", enableRts);
cmd.AddValue("simulationTime", "Simulation time in seconds", simulationTime);
cmd.Parse (argc, argv);
if(!enableRts)
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("999999"));
else
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
NodeContainer wifiStaNode;
wifiStaNode.Create (1);
NodeContainer wifiApNode;
wifiApNode.Create(1);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
phy.SetChannel (channel.Create());
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue("OfdmRate65MbpsBW20MHz"), "ControlMode", StringValue("OfdmRate6_5MbpsBW20MHz"));
HtWifiMacHelper mac = HtWifiMacHelper::Default ();
Ssid ssid = Ssid ("simple-mpdu-aggregation");
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
if (nMpdus > 1) mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable Block ACK when A-MPDU is enabled (i.e. nMpdus > 1)
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus*(payloadSize+100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes, i.e. nMpdus aggregated packets in an A-MPDU
NetDeviceContainer staDevice;
staDevice = wifi.Install (phy, mac, wifiStaNode);
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
"BeaconInterval", TimeValue (MicroSeconds(102400)),
"BeaconGeneration", BooleanValue (true));
if (nMpdus > 1) mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable Block ACK when A-MPDU is enabled (i.e. nMpdus > 1)
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus*(payloadSize+100))); //enable MPDU aggregation for AC_BE with a maximum aggregated size of nMpdus*(payloadSize+100) bytes, i.e. nMpdus aggregated packets in an A-MPDU
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
/* Setting mobility model */
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (1.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNode);
mobility.Install (wifiStaNode);
/* Internet stack*/
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiStaNode);
Ipv4AddressHelper address;
address.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer StaInterface;
StaInterface = address.Assign (staDevice);
Ipv4InterfaceContainer ApInterface;
ApInterface = address.Assign (apDevice);
/* Setting applications */
UdpServerHelper myServer (9);
ApplicationContainer serverApp = myServer.Install (wifiStaNode.Get (0));
serverApp.Start (Seconds (0.0));
serverApp.Stop (Seconds (simulationTime+1));
UdpClientHelper myClient (StaInterface.GetAddress (0), 9);
myClient.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
myClient.SetAttribute ("Interval", TimeValue (Time ("0.00002"))); //packets/s
myClient.SetAttribute ("PacketSize", UintegerValue (payloadSize));
ApplicationContainer clientApp = myClient.Install (wifiApNode.Get (0));
clientApp.Start (Seconds (1.0));
clientApp.Stop (Seconds (simulationTime+1));
Simulator::Stop (Seconds (simulationTime+1));
Simulator::Run ();
Simulator::Destroy ();
uint32_t totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get (0))->GetReceived ();
double throughput = totalPacketsThrough*payloadSize*8/(simulationTime*1000000.0);
std::cout << "Throughput: " << throughput << " Mbit/s" << '\n';
return 0;
}
@@ -0,0 +1,160 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 MIRKO BANCHI
*
* 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
*
* Authors: Mirko Banchi <mk.banchi@gmail.com>
* Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
// This is a simple example in order to show how 802.11n MSDU aggregation feature works.
// The throughput is obtained for a given number of aggregated MSDUs.
//
// The number of aggregated MSDUs can be chosen by the user through the nMsdus attibute.
// A value of 1 means that no MSDU aggregation is performed.
//
// Example: ./waf --run "simple-msdu-aggregation --nMsdus=5"
//
// Network topology:
//
// Wifi 192.168.1.0
//
// AP
// * *
// | |
// n1 n2
//
// Packets in this simulation aren't marked with a QosTag so they are considered
// belonging to BestEffort Access Class (AC_BE).
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleMsduAggregation");
int main (int argc, char *argv[])
{
uint32_t payloadSize = 1472; //bytes
uint64_t simulationTime = 10; //seconds
uint32_t nMsdus = 1;
bool enableRts = 0;
CommandLine cmd;
cmd.AddValue("nMsdus", "Number of aggregated MSDUs", nMsdus); //number of aggregated MSDUs specified by the user
cmd.AddValue("payloadSize", "Payload size in bytes", payloadSize);
cmd.AddValue("enableRts", "Enable RTS/CTS", enableRts);
cmd.AddValue("simulationTime", "Simulation time in seconds", simulationTime);
cmd.Parse (argc, argv);
if(!enableRts)
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("999999"));
else
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
NodeContainer wifiStaNode;
wifiStaNode.Create (1);
NodeContainer wifiApNode;
wifiApNode.Create(1);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
phy.SetChannel (channel.Create());
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue("OfdmRate65MbpsBW20MHz"), "ControlMode", StringValue("OfdmRate6_5MbpsBW20MHz"));
HtWifiMacHelper mac = HtWifiMacHelper::Default ();
Ssid ssid = Ssid ("simple-msdu-aggregation");
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
"MaxAmsduSize", UintegerValue (nMsdus*(payloadSize+100))); //enable MSDU aggregation for AC_BE with a maximum aggregated size of nMsdus*(payloadSize+100) bytes, i.e. nMsdus aggregated packets in an A-MSDU
NetDeviceContainer staDevice;
staDevice = wifi.Install (phy, mac, wifiStaNode);
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
"MaxAmsduSize", UintegerValue (nMsdus*(payloadSize+100))); //enable MSDU aggregation for AC_BE with a maximum aggregated size of nMsdus*(payloadSize+100) bytes, i.e. nMsdus aggregated packets in an A-MSDU
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
/* Setting mobility model */
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (1.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNode);
mobility.Install (wifiStaNode);
/* Internet stack*/
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiStaNode);
Ipv4AddressHelper address;
address.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer StaInterface;
StaInterface = address.Assign (staDevice);
Ipv4InterfaceContainer ApInterface;
ApInterface = address.Assign (apDevice);
/* Setting applications */
UdpServerHelper myServer (9);
ApplicationContainer serverApp = myServer.Install (wifiStaNode.Get (0));
serverApp.Start (Seconds (0.0));
serverApp.Stop (Seconds (simulationTime+1));
UdpClientHelper myClient (StaInterface.GetAddress (0), 9);
myClient.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
myClient.SetAttribute ("Interval", TimeValue (Time ("0.00002"))); //packets/s
myClient.SetAttribute ("PacketSize", UintegerValue (payloadSize));
ApplicationContainer clientApp = myClient.Install (wifiApNode.Get (0));
clientApp.Start (Seconds (1.0));
clientApp.Stop (Seconds (simulationTime+1));
Simulator::Stop (Seconds (simulationTime+1));
Simulator::Run ();
Simulator::Destroy ();
uint32_t totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get (0))->GetReceived ();
double throughput = totalPacketsThrough*payloadSize*8/(simulationTime*1000000.0);
std::cout << "Throughput: " << throughput << " Mbit/s" << '\n';
return 0;
}
@@ -0,0 +1,214 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015 Sébastien Deronne
*
* 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: Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
// This is a simple example in order to show how 802.11n two-level aggregation feature works.
// Two-level aggregation is the simultaneous use of MSDU and MPDU aggregation schemes (known as one-level aggregation techniques).
//
// The throughput is obtained for a given number of aggregated MSDUs and MPDUs.
// The number of aggregated MSDUs and MPDUs can be chosen by the user through the nMsdus and nMpdus attibutes, respectively.
//
// Example: ./waf --run "simple-two-level-aggregation --nMsdus=3 --nMpdus=8"
//
// Network topology:
//
// Wifi 192.168.1.0
//
// AP
// * *
// | |
// n1 n2
//
// Packets in this simulation aren't marked with a QosTag so they are considered
// belonging to BestEffort Access Class (AC_BE).
//
// Throughput gets higher as either nMsdus or nMpdus is increased (one-level aggregation),
// or when both nMsdus and nMpdus are increases (two-level aggregation).
// MSDU aggregation offers a better header reduction compare to MPDU aggregation,
// while MPDU aggregation is more robust against transmission errors than MSDU aggregation.
// The good setting of nMsdu and nMpdus will depends on various factors (payload size, channel conditions, ...).
// Since this example considers an ideal channel, the highest throughput is obtained with the largest values for nMsdus and nMpdus parameters.
// Users should nevertheless take care that the standard rules limit the maximum MSDU size to 7935 bytes and the MPDU size to 65535 bytes.
// Consequently, more packets should be aggregated if their payload is small with standard-compliant parameters.
// Users should also note that the maximum duration of the frame is limited by the standard.
// As a result, higher values for nMsdus and nMpdus may not always provide throughput improvements.
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleTwoLevelAggregation");
int main (int argc, char *argv[])
{
uint32_t payloadSize = 1472; //bytes
uint64_t simulationTime = 10; //seconds
uint32_t nMsdus = 1;
uint32_t nMpdus = 1;
bool enableRts = 0;
CommandLine cmd;
cmd.AddValue ("nMsdus", "Number of aggregated MSDUs", nMsdus); //number of aggregated MSDUs specified by the user
cmd.AddValue ("nMpdus", "Number of aggregated MPDUs", nMpdus); //number of aggregated MPDUs specified by the user
cmd.AddValue ("payloadSize", "Payload size in bytes", payloadSize);
cmd.AddValue ("enableRts", "Enable RTS/CTS", enableRts);
cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
cmd.Parse (argc, argv);
if (!enableRts)
{
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("999999"));
}
else
{
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
}
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("990000"));
NodeContainer wifiStaNode;
wifiStaNode.Create (1);
NodeContainer wifiApNode;
wifiApNode.Create (1);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
phy.SetChannel (channel.Create ());
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
//We consider a constant bitrate since HT rate adaptation algorithms are not supported yet in the simulator
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("OfdmRate65MbpsBW20MHz"),
"ControlMode", StringValue ("OfdmRate6_5MbpsBW20MHz"));
HtWifiMacHelper mac = HtWifiMacHelper::Default ();
Ssid ssid = Ssid ("simple-two-level-aggregation");
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
//Enable aggregation at the station side
if (nMpdus > 1)
{
mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable BlockAck when A-MPDU is used
}
if (nMsdus > 0)
{
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus * (nMsdus * (payloadSize + 100)))); //Set the maximum size for A-MPDU with regards to the payload size and the number of MSDUs expected in each MPDU.
}
else //MPDU aggregation only (one-level aggregation)
{
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 200))); //Set the maximum size for A-MPDU with regards to the payload size
}
mac.SetMsduAggregatorForAc (AC_BE,"ns3::MsduStandardAggregator",
"MaxAmsduSize", UintegerValue (nMsdus * (payloadSize + 100))); //Set the maximum size for A-MSDU with regards to the payload size
NetDeviceContainer staDevice;
staDevice = wifi.Install (phy, mac, wifiStaNode);
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
"BeaconInterval", TimeValue (MicroSeconds (102400)),
"BeaconGeneration", BooleanValue (true));
//Enable aggregation at the AP side
if (nMpdus > 1)
{
mac.SetBlockAckThresholdForAc (AC_BE, 2); //enable BlockAck when A-MPDU is used
}
if (nMsdus > 0)
{
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus * (nMsdus * (payloadSize + 100)))); //Set the maximum size for A-MPDU according to the payload size and the number of MSDUs expected in each MPDU.
}
else //MPDU aggregation only (one-level aggregation)
{
mac.SetMpduAggregatorForAc (AC_BE,"ns3::MpduStandardAggregator",
"MaxAmpduSize", UintegerValue (nMpdus * (payloadSize + 200))); //Set the maximum size for A-MPDU with regards to the payload size
}
mac.SetMsduAggregatorForAc (AC_BE,"ns3::MsduStandardAggregator",
"MaxAmsduSize", UintegerValue (nMsdus * (payloadSize + 100))); //Set the maximum size for A-MSDU with regards to the payload size
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
/* Setting mobility model */
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (1.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNode);
mobility.Install (wifiStaNode);
/* Internet stack*/
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiStaNode);
Ipv4AddressHelper address;
address.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer StaInterface;
StaInterface = address.Assign (staDevice);
Ipv4InterfaceContainer ApInterface;
ApInterface = address.Assign (apDevice);
/* Setting applications */
UdpServerHelper myServer (9);
ApplicationContainer serverApp = myServer.Install (wifiStaNode.Get (0));
serverApp.Start (Seconds (0.0));
serverApp.Stop (Seconds (simulationTime + 1));
UdpClientHelper myClient (StaInterface.GetAddress (0), 9);
myClient.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
myClient.SetAttribute ("Interval", TimeValue (Time ("0.00002"))); //packets/s
myClient.SetAttribute ("PacketSize", UintegerValue (payloadSize));
ApplicationContainer clientApp = myClient.Install (wifiApNode.Get (0));
clientApp.Start (Seconds (1.0));
clientApp.Stop (Seconds (simulationTime + 1));
Simulator::Stop (Seconds (simulationTime + 1));
Simulator::Run ();
Simulator::Destroy ();
uint32_t totalPacketsThrough = DynamicCast<UdpServer> (serverApp.Get (0))->GetReceived ();
double throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0);
std::cout << "Throughput: " << throughput << " Mbit/s" << '\n';
return 0;
}
@@ -1,149 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 MIRKO BANCHI
*
* 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: Mirko Banchi <mk.banchi@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
//This is a simple example in order to show how 802.11n frame aggregation feature (A-MSDU) works.
//
//Network topology:
//
// Wifi 192.168.1.0
//
// AP
// * * *
// | | |
// n1 n2 n3
//
//Packets in this simulation aren't marked with a QosTag so they are considered
//belonging to BestEffort Access Class (AC_BE).
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleWifiFrameAggregation");
int main (int argc, char *argv[])
{
//LogComponentEnable ("EdcaTxopN", LOG_LEVEL_DEBUG);
LogComponentEnable ("MsduAggregator", LOG_LEVEL_INFO);
LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);
uint32_t nWifi = 1;
CommandLine cmd;
cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
cmd.Parse (argc,argv);
NodeContainer wifiNodes;
wifiNodes.Create (2);
NodeContainer wifiApNode;
wifiApNode.Create (1);
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetChannel (channel.Create ());
WifiHelper wifi = WifiHelper::Default ();
QosWifiMacHelper mac = QosWifiMacHelper::Default ();
wifi.SetRemoteStationManager ("ns3::AarfWifiManager", "FragmentationThreshold", UintegerValue (2500));
Ssid ssid = Ssid ("ns-3-802.11n");
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
"MaxAmsduSize", UintegerValue (3839));
NetDeviceContainer staDevices;
staDevices = wifi.Install (phy, mac, wifiNodes);
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
"MaxAmsduSize", UintegerValue (7935));
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
/* Setting mobility model */
MobilityHelper mobility;
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (0.0),
"MinY", DoubleValue (0.0),
"DeltaX", DoubleValue (5.0),
"DeltaY", DoubleValue (10.0),
"GridWidth", UintegerValue (3),
"LayoutType", StringValue ("RowFirst"));
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
"Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
mobility.Install (wifiNodes);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNode);
/* Internet stack*/
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiNodes);
Ipv4AddressHelper address;
address.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer wifiNodesInterfaces;
Ipv4InterfaceContainer apNodeInterface;
wifiNodesInterfaces = address.Assign (staDevices);
apNodeInterface = address.Assign (apDevice);
/* Setting applications */
UdpEchoServerHelper echoServer (9);
ApplicationContainer serverApps = echoServer.Install (wifiNodes.Get (1));
serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (10.0));
UdpEchoClientHelper echoClient (wifiNodesInterfaces.GetAddress (1), 9);
echoClient.SetAttribute ("MaxPackets", UintegerValue (3));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (0.000001)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1500));
ApplicationContainer clientApps =
echoClient.Install (wifiNodes.Get (0));
clientApps.Start (Seconds (2.0));
clientApps.Stop (Seconds (10.0));
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
Simulator::Stop (Seconds (10.0));
phy.EnablePcap ("test-802.11n",
wifiNodes.Get (nWifi - 1)->GetId (), 0);
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
+2 -2
View File
@@ -27,10 +27,10 @@
#include <iostream>
NS_LOG_COMPONENT_DEFINE ("Main");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("Main");
class Experiment
{
public:
+2 -2
View File
@@ -30,10 +30,10 @@
#include <vector>
#include <string>
NS_LOG_COMPONENT_DEFINE ("Main");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("Main");
class Experiment
{
public:
+1 -1
View File
@@ -149,7 +149,7 @@ void experiment (bool enableCtsRts)
// 10. Print per flow statistics
monitor->CheckForLostPackets ();
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
FlowMonitor::FlowStatsContainer stats = monitor->GetFlowStats ();
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin (); i != stats.end (); ++i)
{
// first 2 FlowIds are for ECHO apps, we don't want to display them
+9 -4
View File
@@ -84,13 +84,16 @@
#include <vector>
#include <string>
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhocGrid");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhocGrid");
void ReceivePacket (Ptr<Socket> socket)
{
NS_LOG_UNCOND ("Received one packet!");
while (socket->Recv ())
{
NS_LOG_UNCOND ("Received one packet!");
}
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
@@ -224,6 +227,8 @@ int main (int argc, char *argv[])
// Trace routing tables
Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper> ("wifi-simple-adhoc-grid.routes", std::ios::out);
olsr.PrintRoutingTableAllEvery (Seconds (2), routingStream);
Ptr<OutputStreamWrapper> neighborStream = Create<OutputStreamWrapper> ("wifi-simple-adhoc-grid.neighbors", std::ios::out);
olsr.PrintNeighborCacheAllEvery (Seconds (2), neighborStream);
// To do-- enable an IP-level trace that shows forwarding events only
}
@@ -235,7 +240,7 @@ int main (int argc, char *argv[])
// Output what we are doing
NS_LOG_UNCOND ("Testing from node " << sourceNode << " to " << sinkNode << " with grid distance " << distance);
Simulator::Stop (Seconds (32.0));
Simulator::Stop (Seconds (33.0));
Simulator::Run ();
Simulator::Destroy ();
+6 -3
View File
@@ -63,13 +63,16 @@
#include <vector>
#include <string>
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhoc");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhoc");
void ReceivePacket (Ptr<Socket> socket)
{
NS_LOG_UNCOND ("Received one packet!");
while (socket->Recv ())
{
NS_LOG_UNCOND ("Received one packet!");
}
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
+6 -3
View File
@@ -64,13 +64,16 @@
#include <vector>
#include <string>
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInfra");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInfra");
void ReceivePacket (Ptr<Socket> socket)
{
NS_LOG_UNCOND ("Received one packet!");
while (socket->Recv ())
{
NS_LOG_UNCOND ("Received one packet!");
}
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
+10 -5
View File
@@ -92,18 +92,23 @@
#include <vector>
#include <string>
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInterference");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInterference");
static inline std::string PrintReceivedPacket (Ptr<Socket> socket)
{
Address addr;
socket->GetSockName (addr);
InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
std::ostringstream oss;
oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ();
while (socket->Recv ())
{
socket->GetSockName (addr);
InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ();
}
return oss.str ();
}
+247
View File
@@ -0,0 +1,247 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 The Boeing Company
* 2014 Universita' degli Studi di Napoli "Federico II"
*
* 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
*
*/
//
// This script configures two nodes on an 802.11b physical layer, with
// 802.11b NICs in adhoc mode. One of the nodes generates on-off traffic
// destined to the other node.
//
// The purpose is to test the energy depletion on the nodes and the
// activation of the callback that puts a node in the sleep state when
// its energy is depleted. Furthermore, this script can be used to test
// the available policies for updating the transmit current based on
// the nominal tx power used to transmit each frame.
//
// There are a number of command-line options available to control
// the default behavior. The list of available command-line options
// can be listed with the following command:
// ./waf --run "wifi-sleep --help"
//
// Note that all ns-3 attributes (not just the ones exposed in the below
// script) can be changed at command line; see the documentation.
//
// This script can also be helpful to put the Wifi layer into verbose
// logging mode; this command will turn on all wifi logging:
//
// ./waf --run "wifi-sleep --verbose=1"
//
// When you are done, you will notice four trace files in your directory:
// two for the remaining energy on each node and two for the state transitions
// of each node.
//
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store-module.h"
#include "ns3/wifi-module.h"
#include "ns3/internet-module.h"
#include "ns3/applications-module.h"
#include "ns3/energy-module.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("WifiSleep");
template <int node>
void RemainingEnergyTrace (double oldValue, double newValue)
{
std::stringstream ss;
ss << "energy_" << node << ".log";
static std::fstream f (ss.str().c_str(), std::ios::out);
f << Simulator::Now().GetSeconds() << " remaining energy=" << newValue << std::endl;
}
template <int node>
void PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state)
{
std::stringstream ss;
ss << "state_" << node << ".log";
static std::fstream f (ss.str().c_str(), std::ios::out);
f << Simulator::Now().GetSeconds() << " state=" << state << " start=" << start << " duration=" << duration << std::endl;
}
int main (int argc, char *argv[])
{
std::string dataRate = "1Mbps";
uint32_t packetSize = 1000; // bytes
double duration = 10.0; // seconds
double initialEnergy = 7.5; // joule
double voltage = 3.0; // volts
double txPowerStart = 0.0; // dbm
double txPowerEnd = 15.0; // dbm
uint32_t nTxPowerLevels = 16;
uint32_t txPowerLevel = 0;
double idleCurrent = 0.273; // Ampere
double txCurrent = 0.380; // Ampere
bool verbose = false;
CommandLine cmd;
cmd.AddValue ("dataRate", "Data rate", dataRate);
cmd.AddValue ("packetSize", "size of application packet sent", packetSize);
cmd.AddValue ("duration", "duration (seconds) of the experiment", duration);
cmd.AddValue ("initialEnergy", "Initial Energy (Joule) of each node", initialEnergy);
cmd.AddValue ("voltage", "Supply voltage (Joule)", voltage);
cmd.AddValue ("txPowerStart", "Minimum available transmission level (dbm)", txPowerStart);
cmd.AddValue ("txPowerEnd", "Maximum available transmission level (dbm)", txPowerEnd);
cmd.AddValue ("nTxPowerLevels", "Number of transmission power levels available between txPowerStart and txPowerEnd included", nTxPowerLevels);
cmd.AddValue ("txPowerLevel", "Transmission power level", txPowerLevel);
cmd.AddValue ("idleCurrent", "The radio Idle current in Ampere", idleCurrent);
cmd.AddValue ("txCurrent", "The radio Tx current in Ampere", txCurrent);
cmd.AddValue ("verbose", "turn on all WifiNetDevice log components", verbose);
cmd.Parse (argc, argv);
NodeContainer c;
c.Create (2);
// The below set of helpers will help us to put together the wifi NICs we want
WifiHelper wifi;
if (verbose)
{
wifi.EnableLogComponents (); // Turn on all Wifi logging
}
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
wifiPhy.Set ("TxPowerStart", DoubleValue (txPowerStart));
wifiPhy.Set ("TxPowerEnd", DoubleValue (txPowerEnd));
wifiPhy.Set ("TxPowerLevels", UintegerValue (nTxPowerLevels));
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
// Add a non-QoS upper mac, and set the selected tx power level
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
wifi.SetRemoteStationManager ("ns3::ArfWifiManager", "DefaultTxPowerLevel", UintegerValue (txPowerLevel));
// Set it to adhoc mode
wifiMac.SetType ("ns3::AdhocWifiMac");
NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c);
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (10.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (c);
InternetStackHelper internet;
internet.Install (c);
Ipv4AddressHelper ipv4;
NS_LOG_INFO ("Assign IP Addresses.");
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = ipv4.Assign (devices);
ApplicationContainer apps;
std::string transportProto = std::string("ns3::UdpSocketFactory");
OnOffHelper onOff(transportProto, InetSocketAddress (Ipv4Address ("10.1.1.2"), 9000));
onOff.SetAttribute ("DataRate", DataRateValue (DataRate (dataRate)));
onOff.SetAttribute ("PacketSize", UintegerValue (packetSize));
onOff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.001]"));
apps = onOff.Install (c.Get (0));
apps.Start (Seconds (0.01));
apps.Stop (Seconds (duration));
// Create a packet sink to receive these packets
PacketSinkHelper sink (transportProto, InetSocketAddress (Ipv4Address::GetAny (), 9001));
apps = sink.Install (c.Get (1));
apps.Start (Seconds (0.01));
apps.Stop (Seconds (duration));
// Energy sources
EnergySourceContainer eSources;
BasicEnergySourceHelper basicSourceHelper;
WifiRadioEnergyModelHelper radioEnergyHelper;
basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (initialEnergy));
basicSourceHelper.Set ("BasicEnergySupplyVoltageV", DoubleValue (voltage));
radioEnergyHelper.Set ("IdleCurrentA", DoubleValue (idleCurrent));
radioEnergyHelper.Set ("TxCurrentA", DoubleValue (txCurrent));
// compute the efficiency of the power amplifier (eta) assuming that the provided value for tx current
// corresponds to the minimum tx power level
double eta = WifiTxCurrentModel::DbmToW (txPowerStart) / ((txCurrent - idleCurrent) * voltage);
radioEnergyHelper.SetTxCurrentModel ("ns3::LinearWifiTxCurrentModel",
"Voltage", DoubleValue (voltage),
"IdleCurrent", DoubleValue (idleCurrent),
"Eta", DoubleValue (eta));
// install an energy source on each node
for (NodeContainer::Iterator n = c.Begin(); n != c.End(); n++)
{
eSources.Add (basicSourceHelper.Install (*n));
Ptr<WifiNetDevice> wnd;
for (uint32_t i = 0; i < (*n)->GetNDevices (); ++i)
{
wnd = (*n)->GetDevice (i)->GetObject<WifiNetDevice> ();
// if it is a WifiNetDevice
if (wnd != 0)
{
// this device draws power from the last created energy source
radioEnergyHelper.Install (wnd, eSources.Get (eSources.GetN()-1));
}
}
}
// Tracing
eSources.Get (0)->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback(&RemainingEnergyTrace<0>));
eSources.Get (1)->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback(&RemainingEnergyTrace<1>));
Config::Connect ("/NodeList/0/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace<0>));
Config::Connect ("/NodeList/1/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace<1>));
// wifiPhy.EnablePcap ("wifi-sleep", devices);
Simulator::Stop (Seconds(duration+1));
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
+172
View File
@@ -0,0 +1,172 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015 SEBASTIEN DERONNE
*
* 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
*
* Authors: Sebastien Deronne <sebastien.deronne@gmail.com>
*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
// This example shows how to set Wi-Fi timing parameters through WifiMac attributes.
//
// Example: set slot time to 20 microseconds, while keeping other values as defined in the simulation script:
//
// ./waf --run "wifi-timing-attributes --slot=20"
//
// Network topology:
//
// Wifi 192.168.1.0
//
// AP
// * *
// | |
// n1 n2
//
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("wifi-timing-attributes");
int main (int argc, char *argv[])
{
uint32_t slot = 9; //slot time in microseconds
uint32_t sifs = 10; //SIFS duration in microseconds
uint32_t ackTimeout = 88; //ACK timeout duration in microseconds
uint32_t ctsTimeout = 88; //CTS timeout duration in microseconds
uint32_t rifs = 2; //RIFS duration in microseconds
uint32_t basicBlockAckTimeout = 286; //Basic Block ACK timeout duration in microseconds
uint32_t compressedBlockAckTimeout = 112; //Compressed Block ACK timeout duration in microseconds
double simulationTime = 10; //simulation time in seconds
CommandLine cmd;
cmd.AddValue ("slot", "Slot time in microseconds", slot);
cmd.AddValue ("sifs", "SIFS duration in microseconds", sifs);
cmd.AddValue ("ackTimeout", "ACK timeout duration in microseconds", ackTimeout);
cmd.AddValue ("ctsTimeout", "CTS timeout duration in microseconds", ctsTimeout);
cmd.AddValue ("rifs", "RIFS duration in microseconds", rifs);
cmd.AddValue ("basicBlockAckTimeoutTimeout", "Basic Block ACK timeout duration in microseconds", basicBlockAckTimeout);
cmd.AddValue ("compressedBlockAckTimeoutTimeout", "Compressed Block ACK timeout duration in microseconds", compressedBlockAckTimeout);
cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
cmd.Parse (argc,argv);
//Since default reference loss is defined for 5 GHz, it needs to be changed when operating at 2.4 GHz
Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue (40.046));
//Create nodes
NodeContainer wifiStaNode;
wifiStaNode.Create (1);
NodeContainer wifiApNode;
wifiApNode.Create (1);
//Create wireless channel
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetChannel (channel.Create ());
//Default IEEE 802.11n (2.4 GHz)
WifiHelper wifi = WifiHelper::Default ();
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_2_4GHZ);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue("OfdmRate65MbpsBW20MHz"),
"ControlMode", StringValue("OfdmRate6_5MbpsBW20MHz"));
HtWifiMacHelper mac = HtWifiMacHelper::Default ();
//Install PHY and MAC
Ssid ssid = Ssid ("ns3-wifi");
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
NetDeviceContainer staDevice;
staDevice = wifi.Install (phy, mac, wifiStaNode);
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
//Once install is done, we overwrite the standard timing values
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/Slot", TimeValue (MicroSeconds (slot)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/Sifs", TimeValue (MicroSeconds (sifs)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/AckTimeout", TimeValue (MicroSeconds (ackTimeout)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/CtsTimeout", TimeValue (MicroSeconds (ctsTimeout)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/Rifs", TimeValue (MicroSeconds (rifs)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BasicBlockAckTimeout", TimeValue (MicroSeconds (basicBlockAckTimeout)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/CompressedBlockAckTimeout", TimeValue (MicroSeconds (compressedBlockAckTimeout)));
//Mobility
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (1.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiApNode);
mobility.Install (wifiStaNode);
//Internet stack
InternetStackHelper stack;
stack.Install (wifiApNode);
stack.Install (wifiStaNode);
Ipv4AddressHelper address;
address.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer staNodeInterface;
Ipv4InterfaceContainer apNodeInterface;
staNodeInterface = address.Assign (staDevice);
apNodeInterface = address.Assign (apDevice);
//Setting applications
UdpServerHelper myServer (9);
ApplicationContainer serverApp = myServer.Install (wifiStaNode.Get (0));
serverApp.Start (Seconds (0.0));
serverApp.Stop (Seconds (simulationTime));
UdpClientHelper client (staNodeInterface.GetAddress (0), 9);
client.SetAttribute ("MaxPackets", UintegerValue (4294967295u));
client.SetAttribute ("Interval", TimeValue (Time ("0.00002"))); //packets/s
client.SetAttribute ("PacketSize", UintegerValue (1472)); //bytes
ApplicationContainer clientApp = client.Install (wifiApNode.Get (0));
clientApp.Start (Seconds (1.0));
clientApp.Stop (Seconds (simulationTime));
//Populate routing table
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
//Set simulation time and launch simulation
Simulator::Stop (Seconds (simulationTime));
Simulator::Run ();
Simulator::Destroy ();
//Get and print results
uint32_t totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get (0))->GetReceived ();
double throughput = totalPacketsThrough * 1472 * 8/((simulationTime-1) * 1000000.0); //Mbit/s
std::cout << "Throughput: " << throughput << " Mbit/s" << std::endl;
return 0;
}
+2 -2
View File
@@ -24,7 +24,7 @@
// +-----+ +-----+ +-----+ +-----+
// | STA | | STA | | STA | | STA |
// +-----+ +-----+ +-----+ +-----+
// 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6
// 192.168.0.2 192.168.0.3 192.168.0.5 192.168.0.6
// -------- -------- -------- --------
// WIFI STA WIFI STA WIFI STA WIFI STA
// -------- -------- -------- --------
@@ -37,7 +37,7 @@
// ############## ##############
// BRIDGE BRIDGE
// ############## ##############
// 192.168.0.1 192.168.0.2
// 192.168.0.1 192.168.0.4
// +---------+ +---------+
// | AP Node | | AP Node |
// +---------+ +---------+
+30 -3
View File
@@ -2,7 +2,7 @@
def build(bld):
obj = bld.create_ns3_program('mixed-wireless', ['core', 'mobility', 'wifi', 'applications', 'point-to-point',
'internet', 'csma', 'olsr'])
'internet', 'csma', 'olsr', 'netanim'])
obj.source = 'mixed-wireless.cc'
bld.register_ns3_script('mixed-wireless.py', ['core', 'mobility', 'wifi', 'applications', 'point-to-point',
@@ -22,8 +22,8 @@ def build(bld):
obj = bld.create_ns3_program('wifi-wired-bridging', ['internet', 'mobility', 'wifi', 'csma', 'bridge', 'applications'])
obj.source = 'wifi-wired-bridging.cc'
obj = bld.create_ns3_program('simple-wifi-frame-aggregation', ['internet', 'mobility', 'wifi', 'applications'])
obj.source = 'simple-wifi-frame-aggregation.cc'
obj = bld.create_ns3_program('simple-msdu-aggregation', ['internet', 'mobility', 'wifi', 'applications'])
obj.source = 'simple-msdu-aggregation.cc'
obj = bld.create_ns3_program('multirate', ['internet', 'mobility', 'wifi', 'stats', 'flow-monitor', 'olsr', 'applications', 'point-to-point'])
obj.source = 'multirate.cc'
@@ -46,8 +46,35 @@ def build(bld):
obj = bld.create_ns3_program('ofdm-validation', ['core', 'mobility', 'wifi', 'config-store', 'stats'])
obj.source = 'ofdm-validation.cc'
obj = bld.create_ns3_program('ofdm-ht-validation', ['core', 'mobility', 'wifi', 'config-store', 'stats'])
obj.source = 'ofdm-ht-validation.cc'
obj = bld.create_ns3_program('wifi-hidden-terminal', ['internet', 'mobility', 'wifi', 'applications', 'propagation', 'flow-monitor'])
obj.source = 'wifi-hidden-terminal.cc'
obj = bld.create_ns3_program('ht-wifi-network', ['core','internet', 'mobility', 'wifi', 'applications', 'propagation'])
obj.source = 'ht-wifi-network.cc'
obj = bld.create_ns3_program('wifi-timing-attributes', ['core','internet', 'mobility', 'wifi', 'applications', 'propagation'])
obj.source = 'wifi-timing-attributes.cc'
obj = bld.create_ns3_program('wifi-sleep', ['core', 'network', 'internet', 'mobility', 'wifi', 'applications', 'energy', 'config-store'])
obj.source = 'wifi-sleep.cc'
obj = bld.create_ns3_program('power-adaptation-distance', ['core', 'mobility', 'wifi', 'applications', 'flow-monitor'])
obj.source = 'power-adaptation-distance.cc'
obj = bld.create_ns3_program('power-adaptation-interference', ['core', 'mobility', 'wifi', 'applications', 'flow-monitor'])
obj.source = 'power-adaptation-interference.cc'
obj = bld.create_ns3_program('rate-adaptation-distance', ['core', 'mobility', 'wifi', 'applications', 'flow-monitor'])
obj.source = 'rate-adaptation-distance.cc'
obj = bld.create_ns3_program('simple-mpdu-aggregation', ['internet', 'mobility', 'wifi', 'applications'])
obj.source = 'simple-mpdu-aggregation.cc'
obj = bld.create_ns3_program('simple-two-level-aggregation', ['internet', 'mobility', 'wifi', 'applications'])
obj.source = 'simple-two-level-aggregation.cc'
obj = bld.create_ns3_program('simple-ht-hidden-stations', ['internet', 'mobility', 'wifi', 'applications'])
obj.source = 'simple-ht-hidden-stations.cc'
+5
View File
@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
-1
View File
@@ -1 +0,0 @@
This is a placeholder file used only to keep the ns3 directory present (needed for the WAF build system).
+5
View File
@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
+2 -2
View File
@@ -16,10 +16,10 @@
#include "ns3/core-module.h"
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
int
main (int argc, char *argv[])
{
+2 -2
View File
@@ -16,10 +16,10 @@
#include "ns3/core-module.h"
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
int
main (int argc, char *argv[])
{
Loaded 100 of 1944 files, more files were not shown because too many files have changed in this diff. Show more