Compare commits

..

2397 Commits

Author SHA1 Message Date
Craig Dowell 8869dc9630 Apply Patch for Bug 237 2008-06-27 14:56:18 -07:00
Craig Dowell 62c2e46c37 reposition trace hook in csma to address bug 241. 2008-06-27 14:38:08 -07:00
Craig Dowell 89e20b56c9 Patch for bug 240 2008-06-27 09:32:34 -07:00
Craig Dowell 2b1bc24321 Apply patch for bug 231 2008-06-24 19:09:49 -07:00
Craig Dowell cb19bb1404 Added tag release ns-3.1-RC2 for changeset 951296e9a277 2008-06-24 15:47:04 -07:00
Craig Dowell 92c9208ea6 Apply Patch for Bug 235 2008-06-24 15:40:24 -07:00
Craig Dowell 8c7759dc6b bug 233 2008-06-24 09:21:02 -07:00
Mathieu Lacage b9aeaf3650 more typos. 2008-06-23 16:03:08 -07:00
Mathieu Lacage 87c68d5a58 fix lots of typos 2008-06-23 15:46:04 -07:00
Mathieu Lacage 77d2f50c2f update ignore list 2008-06-23 15:45:52 -07:00
Mathieu Lacage ddef596d2f merge with HEAD 2008-06-23 15:24:27 -07:00
Mathieu Lacage fcf9b4cf5b application howto 2008-06-23 15:24:12 -07:00
Mathieu Lacage bdf0896c2a add helper code 2008-06-23 14:15:41 -07:00
Tom Henderson 3aa9ce9efd Add chapter on random numbers to manual 2008-06-23 13:58:30 -07:00
Mathieu Lacage 73f7efb2f2 a very simple howto for implementing NetDevice/Channel subclasses 2008-06-23 12:49:51 -07:00
Mathieu Lacage e10db3d576 add missing copyright statement 2008-06-23 12:45:01 -07:00
Mathieu Lacage daaed2d5e6 add small comment, fix typo, add missing copyright statement 2008-06-23 12:44:45 -07:00
Mathieu Lacage f1019e4026 dox missing SetNode method 2008-06-23 12:44:21 -07:00
Mathieu Lacage 398ffd3d58 avoid dox warning 2008-06-23 12:44:05 -07:00
Mathieu Lacage ae661f53e0 update doxygen to match the reality of the code 2008-06-23 12:43:54 -07:00
Mathieu Lacage 4b3b79be2f add packet header howto 2008-06-23 10:21:59 -07:00
Mathieu Lacage 2fb03d7aa3 testcase and fix, symmetric to changeset c861a47407a8 2008-06-21 21:20:38 -07:00
Mathieu Lacage 14c3cac1d1 fix testcase from changeset e367e86d7886 2008-06-21 21:14:28 -07:00
Mathieu Lacage c4ea047cb9 add documentation comment. 2008-06-21 21:08:16 -07:00
Mathieu Lacage 6746cc48eb bug 217: another testcase. 2008-06-21 21:07:45 -07:00
Mathieu Lacage 1fe76d94f1 remove tcp-2way from examples. mistake from changeset c8011a2a0c60 2008-06-21 13:22:39 -07:00
Mathieu Lacage 6d739bf2b5 bug 217: yet another testcase: make sure we handle degenerate testcases with tags which refer to non-existant data. 2008-06-21 10:30:47 -07:00
Mathieu Lacage c3fb9059ac another testcase for bug 217. Make sure we do not report tags outside of the current range 2008-06-21 08:55:04 -07:00
Mathieu Lacage 0c35c2b60f bug 217: avoid unsigned/signed confusion. Used signed all the time. 2008-06-21 08:11:10 -07:00
Mathieu Lacage 9008e089ae bug 217: add failing testcase 2008-06-21 08:05:21 -07:00
Mathieu Lacage ad46f21982 merge testcase 2008-06-20 19:21:11 -07:00
Mathieu Lacage 8a78bf66ae testcase for changeset 133490cf0210 2008-06-20 19:20:58 -07:00
Mathieu Lacage da514b5edb bug 217: Handle gracefully the case where a packet aggregated contains nothing. 2008-06-20 15:06:23 -07:00
Unknown 4743c2ff7c Patch addresses bug 227. 2008-06-19 14:58:46 -07:00
Unknown 7c05c10381 same messages for all versions of getting traces 2008-06-19 14:53:53 -07:00
Unknown 544f9d1a81 Bug 181 2008-06-19 14:46:27 -07:00
Unknown c7e37d1a18 move m_wouldBlock assignment to fix bug 226 2008-06-18 21:29:21 -07:00
Unknown b357866655 GetNNodes() in NodeList fixes bug 225 2008-06-18 21:17:56 -07:00
Craig Dowell aefd3e3371 tweaks after actually doing it 2008-06-18 11:57:43 -07:00
Craig Dowell 4587183489 tweak release steps 2008-06-18 11:04:07 -07:00
Craig Dowell 6f2e42050f print out which repo is used for regression 2008-06-18 10:39:30 -07:00
Craig Dowell a86ec45ec9 branch merge 2008-06-18 10:36:06 -07:00
Craig Dowell d99df782e9 regression 2008-06-18 10:34:05 -07:00
Craig Dowell e1d52991b6 fixes for regression numbering 2008-06-18 10:29:19 -07:00
Gustavo J. A. M. Carneiro 2d2675e6f8 Bug 223: Regression using other than mercurial traces no longer works 2008-06-18 18:07:48 +01:00
Gustavo J. A. M. Carneiro d4a0ae2a74 Add a WAF workaround for the 'Input line is too long.' error in win32/mingw. 2008-06-18 15:21:08 +01:00
Craig Dowell b5cfed2178 use dev traces 2008-06-17 13:37:04 -07:00
Craig Dowell a6aed94fe8 plug more holes in release steps 2008-06-17 12:52:46 -07:00
Craig Dowell 9da2bfa832 bump 2008-06-17 11:57:27 -07:00
Craig Dowell 098186e7e6 fill in some blanks 2008-06-17 11:53:20 -07:00
Craig Dowell 452bb57c9f Added tag release candidate ns-3.1-RC1 for changeset 8869a79a391f 2008-06-17 10:36:56 -07:00
Craig Dowell 1b8812d558 Changes for bug 205, unlisted FIN bug 2008-06-16 16:25:52 -07:00
Gustavo J. A. M. Carneiro 4a73b2abd0 [Bug 221] need a scratch directory 2008-06-16 14:17:27 +01:00
Tom Henderson c11554b553 Split out non-tutorial sections from tutorial; place into a doc/manual directory 2008-06-15 21:38:13 -07:00
Tom Henderson da05aa1327 split out manual sections from tutorial 2008-06-15 21:27:13 -07:00
Mathieu Lacage 2edda56a6f merge bug 213 repo 2008-06-13 17:20:55 -07:00
Mathieu Lacage 9ed0f04944 merge with HEAD 2008-06-13 17:20:06 -07:00
Raj Bhattacharjea 1aef4543cc bug 181: Normal Variable Infinite Value & Bounds 2008-06-13 17:19:53 -07:00
Raj Bhattacharjea 9ccd6dadcb Update the internet-stack documentation 2008-06-13 16:47:07 -04:00
Gustavo J. A. M. Carneiro 8ae203ce50 Correct the OLSR documentation; remove dead API declarations and source file. 2008-06-13 15:35:07 +01:00
Tom Henderson 1e4c17bc9f doxygen for applications 2008-06-13 06:32:54 -07:00
Tom Henderson cbc938e2bf OLSR doxygen 2008-06-12 22:21:19 -07:00
Tom Henderson cdb5cc083f Doxygen for global routing 2008-06-12 06:11:18 -07:00
Tom Henderson de189d447c tutorial: s/internet-node/internet-stack 2008-06-10 06:08:16 -07:00
Tom Henderson aebdb9fbfd Move other applications to RecvFrom () 2008-06-09 20:42:31 -07:00
Mathieu Lacage 82e92545aa bug 186: internet-node directory must be renamed to internet-stack 2008-06-09 15:40:22 -07:00
Mathieu Lacage 8559d575f5 bug 61: warning must be fatal. 2008-06-09 11:39:29 -07:00
Craig Dowell 5a3fbf3637 documentation to resolve bug 75 2008-06-09 08:53:47 -07:00
Tom Henderson 9ca1253956 Change OLSR to use RecvFrom 2008-06-09 07:01:12 -07:00
Tom Henderson de69fcb842 RecvFrom() expansion, add flags parameter to some Send calls 2008-06-09 06:40:21 -07:00
Craig Dowell 88d12f80eb CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox 2008-06-07 10:38:39 -07:00
Raj Bhattacharjea a37b419abd Merge 2008-06-06 16:30:28 -04:00
Raj Bhattacharjea 6c4692ea55 Restore tcp example to full size, also a bugfix 2008-06-06 16:10:54 -04:00
Raj Bhattacharjea 97d98fa1ce bug 195: naming inconsistency. 2008-06-06 11:42:19 -07:00
Raj Bhattacharjea 6bcd10f205 Merge last two changesets 2008-06-06 14:19:05 -04:00
Raj Bhattacharjea 36ac76b49c Merge last 6 changesets 2008-06-06 13:58:28 -04:00
Raj Bhattacharjea d003d6a34f Fix compile warning 2008-06-06 13:57:59 -04:00
Mathieu Lacage 3b217b603e a few new testcases, bug fixes. 2008-06-06 10:44:43 -07:00
Mathieu Lacage 43263bc0e7 add some logging 2008-06-06 10:22:05 -07:00
Raj Bhattacharjea 525969ca64 Part of bug 198 2008-06-06 12:22:50 -04:00
Mathieu Lacage fb9ca8f381 add support for attribtues to bug 34 2008-06-05 15:56:23 -07:00
Raj Bhattacharjea 1f9b7723b8 Update tcpsocket to use Ptr<Packet> in Send 2008-06-05 17:59:36 -04:00
Raj Bhattacharjea 60c2ddafa8 Tcp tx buffer (pendingdata) uses Ptr<Packet> internally; tagging should work 2008-06-05 16:49:59 -04:00
Florian Westphal 64e2c2bb8f Add ipv4 header checksum support. 2008-06-05 01:08:33 +02:00
Gustavo J. A. M. Carneiro b469955b1e Add OLSR attribute documentation; make Willingness an enum attribute instead of uint. Closes #211 2008-06-05 11:46:15 +01:00
Gustavo J. A. M. Carneiro c3557faf08 Add waf proxy script 2008-06-05 11:21:50 +01:00
Mathieu Lacage 4d144c5ec8 merge with HEAD 2008-06-04 16:59:58 -07:00
Mathieu Lacage 2b7b6628f3 bug 212: Packet::PrintTags fails 2008-06-04 16:59:41 -07:00
Raj Bhattacharjea de2475ddc3 Merge with ns-3-dev 2008-06-04 17:19:32 -04:00
Raj Bhattacharjea 4d2bbed418 Fix for bug 174 2008-06-04 16:14:49 -04:00
Mathieu Lacage 7ef64dd6ce mark internal class 2008-06-04 12:31:23 -07:00
Mathieu Lacage 90bbabf52f fix typo 2008-06-04 12:31:14 -07:00
Mathieu Lacage c43918d4c2 doxygen a couple of missing functions. Add acouple of more comments to existing mobility models 2008-06-04 12:29:07 -07:00
Mathieu Lacage 14562c914d this code is not wrong. 2008-06-04 11:59:31 -07:00
Mathieu Lacage 017b3b191d RemoveTag does not exist 2008-06-04 11:59:11 -07:00
Mathieu Lacage 49a48f01e8 remove un-implemented code 2008-06-04 11:58:51 -07:00
Mathieu Lacage 12ae07ddab bug 202: classes disappeared from doxygen output 2008-06-04 11:48:52 -07:00
Mathieu Lacage d86a521ff1 fix bug 208 for true. 2008-06-04 11:35:14 -07:00
Mathieu Lacage 3e3f102d62 remove misleading doxygen comment 2008-06-04 11:01:01 -07:00
Mathieu Lacage 45f9ff0ddc bug 210: must take device mtu into account. 2008-06-04 10:59:30 -07:00
Mathieu Lacage 44478e378d bug 209: remove buggy test for open state in PacketSocket::SendTo 2008-06-04 10:47:34 -07:00
Mathieu Lacage 1eb07aeaef bug 208: must clear flags bits in fragment offset deserialization. 2008-06-04 10:39:36 -07:00
Mathieu Lacage 10a7924d63 bug 207: ipv4-header.h needed in src/node module. 2008-06-04 10:18:57 -07:00
Mathieu Lacage d3b35a295c bug 206: allow comparing addresses of different types. 2008-06-04 10:09:29 -07:00
Mathieu Lacage 1a5577bc3d bug 204: implement Queue::DequeueAll. 2008-06-04 09:22:37 -07:00
Mathieu Lacage 92f2ed110a bug 203: Listen must be implemented for Udp and Packet sockets. 2008-06-04 09:19:16 -07:00
Mathieu Lacage 8b7d6955e6 improve attribute documentation 2008-06-04 09:18:44 -07:00
Gustavo J. A. M. Carneiro 1ae7ba74b9 merge 2008-06-04 14:02:06 +01:00
Gustavo J. A. M. Carneiro 94b7fd9434 Re-format the NQSTA state machine diagram so that it displays correctly with a fixed width font. 2008-06-04 14:00:41 +01:00
Mathieu Lacage 1ca824b340 merge with HEAD 2008-06-03 16:20:32 -07:00
Mathieu Lacage 94587dd4f3 bug 200: Packet::PrintTags is not implemented. 2008-06-03 16:20:17 -07:00
Gustavo J. A. M. Carneiro 6495130641 merge 2008-06-03 21:19:36 +01:00
Gustavo J. A. M. Carneiro d1cc848f30 Change default WiFi ProbeRequestTimeout to 50 ms; closes bug #199. 2008-06-03 21:16:21 +01:00
Mathieu Lacage 39b7522f4c merge with HEAD 2008-06-03 12:46:37 -07:00
Gustavo J. A. M. Carneiro 1840dfe6b1 Change the default beacon interval to a more realistic value (100 ms); closes bug #177. 2008-06-03 18:15:08 +01:00
Tom Henderson 5307dcfd48 Gustavo's API warnings 2008-06-03 07:09:40 -07:00
Tom Henderson 9dfc592a26 Added tag release ns-3.0.13 for changeset 79dba133b5f8 2008-06-02 21:21:26 -07:00
Tom Henderson be9d919a58 update RELEASE_NOTES and a few other files 2008-06-02 21:21:16 -07:00
Mathieu Lacage 937f78e7bc doxygen updates 2008-06-02 10:51:55 -07:00
Mathieu Lacage d9a606c58d update doxygen 2008-06-02 10:38:19 -07:00
Mathieu Lacage d3942cd4d0 remove dead code. 2008-06-02 10:38:10 -07:00
Mathieu Lacage 6badc137d9 add some doxygen, remove a couple of XXX 2008-06-02 10:30:24 -07:00
Mathieu Lacage 2eafd4b9b1 merge with HEAD 2008-06-02 09:42:29 -07:00
Mathieu Lacage add091ea23 bug197: fix infinite loop 2008-05-31 14:12:40 -07:00
Mathieu Lacage 92ebbd036d a testcase for bug 197 2008-05-31 14:12:24 -07:00
Mathieu Lacage f08ea71825 add small comment 2008-05-31 11:00:01 -07:00
Mathieu Lacage a5c312cb1c some more cleanup 2008-05-31 10:57:49 -07:00
Mathieu Lacage e20525cad9 add small comment 2008-05-31 10:47:24 -07:00
Mathieu Lacage 00d36e836c add logging, cleanup AddAtEnd. 2008-05-31 10:46:23 -07:00
Gustavo J. A. M. Carneiro 312b8da3a3 Check for the 'diff' command, don't allow running regression tests without it. 2008-05-31 16:14:49 +01:00
Raj Bhattacharjea 05a27250c1 Get rid of dead code from GTNetS 2008-05-30 15:31:50 -04:00
Raj Bhattacharjea a7a0a3de70 Change log output to be more consistent 2008-05-30 15:14:38 -04:00
Mathieu Lacage 26d46a960d fix a couple of XXX 2008-05-30 11:11:00 -07:00
Mathieu Lacage 2a323473e4 doxygen 2008-05-30 11:03:18 -07:00
Mathieu Lacage 4904c44f15 merge with HEAD 2008-05-30 10:39:43 -07:00
Mathieu Lacage e4ec46dd52 fix dox warnings 2008-05-30 10:38:59 -07:00
Tom Henderson a947ff3967 more doxygen 2008-05-30 10:36:02 -07:00
Mathieu Lacage bbf1d7cce3 fix dox warning 2008-05-30 10:35:25 -07:00
Tom Henderson dfb9b7360a Doxygen organization 2008-05-29 23:24:10 -07:00
Craig Dowell 554fcfda0d point-to-point cleanup 2008-05-29 19:09:56 -07:00
Mathieu Lacage 16d1d635a0 new Packet testcases, bug fix. 2008-05-29 12:13:42 -07:00
Mathieu Lacage 62d8743f1c bug 146: s/HostOrder// 2008-05-29 09:37:07 -07:00
Mathieu Lacage 5872949e0a make sure we output the right diff command 2008-05-29 09:06:42 -07:00
Mathieu Lacage f173b434dd DequeuePending returns 0 upon error, not the other way round. 2008-05-29 09:01:31 -07:00
Mathieu Lacage 48fa3d344c fix valgrind-reported leak 2008-05-29 08:16:53 -07:00
Gustavo J. A. M. Carneiro b9d448c83b Fix TCP valgrind problem (bug #194): TcpSocketImpl::m_wouldBlock was not always being initialized. 2008-05-29 15:10:40 +01:00
Gustavo J. A. M. Carneiro 6152ba1a89 Make Application::Start/Stop times relative, Simulator::StopAt(time) renamed to Simulator::Stop(time) and time also made relative, to improve consistency of the API which uses relative times everywhere else. Closes bug #191. 2008-05-29 11:45:57 +01:00
Gustavo J. A. M. Carneiro 08f2b87daa merge 2008-05-29 09:34:47 +01:00
Gustavo J. A. M. Carneiro 39c1412e3e Don't register IPv4 protocol handler for all interfaces, only for IPv4-enabled interfaces. 2008-05-29 09:34:31 +01:00
Tom Henderson 41b7eadd33 undo changeset 3161 (to pass unit tests) 2008-05-28 22:45:59 -07:00
Tom Henderson b851cc5b0b Undo changeset 3163 (breaks multicast) 2008-05-28 22:06:14 -07:00
Mathieu Lacage 08961f4883 make sure that the mac low listener is destroyed _after_ the mac low itself. 2008-05-28 13:59:53 -07:00
Mathieu Lacage c9ccce91ed remove dead code 2008-05-28 13:22:50 -07:00
Mathieu Lacage 76dd4d1db4 Fix off-by-2 errors 2008-05-28 13:03:29 -07:00
Mathieu Lacage 27e5640201 the TypeId for Packet sockets is PacketSocketFactory, not PacketSocket. fix bug introduced by changeset c33b6d2775b7. 2008-05-28 11:28:06 -07:00
Mathieu Lacage fdc3e27c11 merge with HEAD 2008-05-28 10:49:01 -07:00
Mathieu Lacage 709f6a6d5b document 2008-05-28 10:47:21 -07:00
Mathieu Lacage 45793c3a02 fix new packet bug 2008-05-28 10:47:14 -07:00
Mathieu Lacage 137ff47a46 fix the testcase 2008-05-28 10:31:09 -07:00
Mathieu Lacage ab01dd65a4 a failing testcase. 2008-05-28 10:11:25 -07:00
Mathieu Lacage 31870b3bc0 more logging code 2008-05-28 10:11:08 -07:00
Mathieu Lacage 0c34dea05b kill dead code 2008-05-28 10:10:47 -07:00
Gustavo J. A. M. Carneiro b135ced7aa Bug #154: Attach sockets to nodes. Patch by Rajib Bhattacharjea. 2008-05-28 17:52:42 +01:00
Mathieu Lacage 16018e8d7e add logging 2008-05-28 08:51:27 -07:00
Craig Dowell 0ef25b59c4 CSMA Model Description 2008-05-27 22:30:11 -07:00
Mathieu Lacage 20b1d65d07 avoid segfault 2008-05-27 15:57:51 -07:00
Mathieu Lacage eaf4fb4a6d doxygen. 2008-05-27 15:32:08 -07:00
Mathieu Lacage f86b2de0af merge with HEAD 2008-05-27 15:01:11 -07:00
Tom Henderson 4182edbc93 fix optimized build 2008-05-27 06:03:48 -07:00
Tom Henderson 6af434b9f9 branch merge 2008-05-26 21:41:23 -07:00
Mathieu Lacage f79ac9e373 fix optimized build 2008-05-26 21:03:59 -07:00
Mathieu Lacage c352b35d3f add NS_LOG_APPEND_CONTEXT 2008-05-26 21:00:25 -07:00
Mathieu Lacage b91e3b0e4c ATTRIBUTE_HELPER_HEADER_2 -> ATTRIBUTE_HELPER_HEADER 2008-05-26 20:48:54 -07:00
Mathieu Lacage 0d86d03be0 kill ATTRIBUTE_HELPER_HEADER_1 2008-05-26 20:44:19 -07:00
Tom Henderson 9a94ef7a2d some doxygen cleanup 2008-05-26 11:48:18 -07:00
Tom Henderson 791e9ae464 Receive raw buffer variant 2008-05-26 11:22:42 -07:00
Tom Henderson c2a543f568 Tutorial material for sockets 2008-05-26 11:07:41 -07:00
Mathieu Lacage b3390aaa3e report packet drops in ARP. 2008-05-25 14:58:22 -07:00
Mathieu Lacage 3d0264e3a3 fix bug 185 2008-05-25 14:44:36 -07:00
Mathieu Lacage 42fbffdbdb more logging. Make sure we do dispose attached Ipv4Interface 2008-05-25 14:44:14 -07:00
Mathieu Lacage f83b6c7ab1 more logging. Make sure we invoke parent's Dispose method 2008-05-25 14:43:41 -07:00
Mathieu Lacage 2f1e4574c0 more logging output 2008-05-25 14:42:55 -07:00
Mathieu Lacage de351e9388 re-organize the ARP code to expose arp cache attributes. 2008-05-25 11:07:08 -07:00
Mathieu Lacage 20f5f62292 add attributes to ArpCache 2008-05-25 10:27:34 -07:00
Tom Henderson 0008eeebce branch merge 2008-05-25 08:05:26 -07:00
Tom Henderson ca7b76ef27 Add tag serialize methods; add serialize routines to Address 2008-05-25 08:04:57 -07:00
Tom Henderson a41edb2fa1 remove std::endl from PPP header print 2008-05-25 05:35:22 -07:00
Craig Dowell ffd1766adc fix bug 183 2008-05-23 17:03:51 -07:00
Tom Henderson f9e025ad81 add dia to the supported figure generation tools for the tutorial; clean up 2008-05-23 15:50:00 -07:00
Tom Henderson b62c394703 dia command line options 2008-05-23 14:51:05 -07:00
Tom Henderson 4ba092f3aa branch merge 2008-05-23 12:26:21 -07:00
Tom Henderson 93126f3a55 tutorial work (add back packet chapter) 2008-05-23 12:25:55 -07:00
Raj Bhattacharjea 62ff82d0ca Fix up recv buffer stuff some more 2008-05-22 17:08:19 -04:00
Raj Bhattacharjea e62a059f05 Fix tcp rx buffer semantics; fromaddress tagging is broken at the moment 2008-05-22 11:55:42 -04:00
Tom Henderson 5f94a4cf59 merge with ns-3-dev 2008-05-21 22:40:18 -07:00
Craig Dowell 888a3bdad6 ppp model description 2008-05-21 21:20:30 -07:00
Tom Henderson 72dba0d456 branch merge 2008-05-21 19:00:38 -07:00
Raj Bhattacharjea 3bd417f4e5 Merge with tomh/ns-3-dev-socket 2008-05-21 12:01:24 -04:00
Tom Henderson 72d054a867 Move Tcp attributes from factory to TcpSocket 2008-05-21 00:38:49 -07:00
Gustavo J. A. M. Carneiro e9e87c3232 Require gtk+ >= 2.12; closes #182 2008-05-20 22:04:38 +01:00
Tom Henderson ef99300eff Add missing files 2008-05-20 12:55:23 -07:00
Tom Henderson 49d5404bfc Add abstract base class TcpSocket 2008-05-20 12:36:05 -07:00
Tom Henderson c21d79a87b change TcpImpl to TcpSocketFactoryImpl 2008-05-20 12:27:30 -07:00
Tom Henderson 8dc2460416 move Tcp to TcpSocketFactory 2008-05-20 12:16:55 -07:00
Tom Henderson e6bd2a7a6a change TcpSocket to TcpSocketImpl 2008-05-20 11:52:25 -07:00
Raj Bhattacharjea 3a34c3fff1 Merge with tomh/ns-3-dev-socket 2008-05-20 14:40:36 -04:00
Tom Henderson ad374c8d87 rename UdpSocket to UdpSocketImpl 2008-05-20 10:30:40 -07:00
Tom Henderson 935532822b Move UdpSocket to UdpSocketImpl 2008-05-20 10:16:03 -07:00
Mathieu Lacage 45d6dcd5f4 avoid warning with g++ 4.1.2 2008-05-20 08:01:11 -07:00
Mathieu Lacage e4c1b22090 fix build for g++ 3.4.6 2008-05-20 07:56:59 -07:00
Tom Henderson 2a14b1c408 remove spurious test line 2008-05-20 07:27:16 -07:00
Tom Henderson 5b119aa40d Add attributes to new abstract base class for UdpSocket 2008-05-20 07:25:17 -07:00
Tom Henderson 25de2ff3c4 s/UdpImpl/UdpSocketFactoryImpl 2008-05-17 22:02:09 -07:00
Tom Henderson 4c4ef85a93 s/ns3::Udp/ns3::UdpSocketFactory 2008-05-17 12:08:20 -07:00
Tom Henderson 67d54a7f8a Implement IPTTL socket option for UDP 2008-05-17 11:15:02 -07:00
Tom Henderson 0a476b4f04 undo SocketDefaults class; plumb in new UdpSocket option attributes 2008-05-16 21:28:07 -07:00
Mathieu Lacage 2c57f536e3 merge with HEAD 2008-05-16 15:52:04 -07:00
Mathieu Lacage a1882f8e10 merge from HEAD 2008-05-16 15:48:09 -07:00
Mathieu Lacage 7c509777e5 forgot to remove dead includes 2008-05-16 10:40:37 -07:00
Mathieu Lacage d5a75f0cec merge with HEAD 2008-05-16 10:29:34 -07:00
Mathieu Lacage 91c4ef481f remove dead code. 2008-05-16 10:25:24 -07:00
Craig Dowell d034ec3e08 fix bug 180 2008-05-16 10:11:49 -07:00
Mathieu Lacage dd4979ef89 merge with HEAD 2008-05-16 08:52:40 -07:00
Mathieu Lacage 84c9dd96db merge with HEAD 2008-05-16 08:41:19 -07:00
Tom Henderson 18011ba4eb improve send semantics, documentation 2008-05-15 23:06:58 -07:00
Tom Henderson aa7b91f890 branch merge 2008-05-15 21:35:55 -07:00
Mathieu Lacage 0e05b107fd avoid un-initialized bits 2008-05-15 11:37:36 -07:00
Mathieu Lacage 05c3383610 remove XXX 2008-05-15 11:25:17 -07:00
Mathieu Lacage 43c64f656b ensure that the list of positions is long enough 2008-05-15 10:39:44 -07:00
Mathieu Lacage 2b4b265b60 re-enable editing 2008-05-15 10:29:58 -07:00
Mathieu Lacage 0efe19fe76 cleanup the model memory. 2008-05-15 10:22:53 -07:00
Mathieu Lacage 1a990a1877 bug 179: Packet fragmentation bug 2008-05-15 09:49:04 -07:00
Gustavo J. A. M. Carneiro 6547b9222c GlobalRoutingManager: don't segfault for NetDevices that have no associated Channel (e.g. virtual NetDevices); just skip them. 2008-05-15 12:56:10 +01:00
Gustavo J. A. M. Carneiro a4a8086580 GlobalRoutingManager: don't abort with non-IP NetDevices, just skip them. 2008-05-15 12:54:28 +01:00
Unknown 8d3dfb1df9 Merged nonotifier with main branch. 2008-05-15 07:47:17 -04:00
Unknown 3226ce7f09 Changed MobilityModel::m_trace to be more descriptive. 2008-05-15 07:46:03 -04:00
Unknown 1b12b95ee9 Removed TraceContext and TraceResolver references, removed MobilityModelNotifier class, and minor changes on samples/main-random-walk.cc. 2008-05-14 19:24:17 -04:00
Mathieu Lacage ffdff79112 improve doxygen doc. 2008-05-14 15:47:44 -07:00
Mathieu Lacage 4b7bfc9b77 tweak log output 2008-05-14 15:47:35 -07:00
Mathieu Lacage ccb704ffc7 close the writer before deleting it 2008-05-14 15:00:58 -07:00
Mathieu Lacage ce87f97994 reset the output stream to get a proper trace path 2008-05-14 14:59:16 -07:00
Mathieu Lacage 8a7187fba3 also handle parent attributes. 2008-05-14 13:54:39 -07:00
Mathieu Lacage 3a8df9f3d6 make sure we iterate over the parent's attributes. 2008-05-14 13:54:27 -07:00
Mathieu Lacage 31a31ffc07 add missing TypeId::HasParent method 2008-05-14 13:54:23 -07:00
Mathieu Lacage 63dccc1973 make the iteration code more flexible. add tooltips to gtk config store 2008-05-14 13:33:55 -07:00
Gustavo J. A. M. Carneiro 36e6b69aaf PacketSocket bind-to-interface bug 2008-05-14 19:15:00 +01:00
Gustavo J. A. M. Carneiro dc624d46b3 merge 2008-05-14 18:16:02 +01:00
Gustavo J. A. M. Carneiro 1cecfe5548 Missing Packet::Copy in Node::ReceiveFromDevice for the multiple protocol handlers scenario. 2008-05-14 18:15:26 +01:00
Mathieu Lacage a54122b4e8 set a default window size. 2008-05-14 10:06:04 -07:00
Mathieu Lacage 693099a950 add scroll area and alternating row colors. 2008-05-14 09:51:25 -07:00
Mathieu Lacage ae1fed72b1 add missing getters 2008-05-14 09:44:39 -07:00
Mathieu Lacage b5e22fdc37 merge with HEAD 2008-05-14 09:37:53 -07:00
Mathieu Lacage 47e58be578 update pcap trace setup filename 2008-05-14 09:37:00 -07:00
Mathieu Lacage 833506428b merge with HEAD 2008-05-13 17:07:20 -07:00
Mathieu Lacage ca3c48f8e8 a basic but useful Gtk+-based config-store 2008-05-13 17:02:52 -07:00
Tom Henderson b00892cae7 swap SendTo parameters 2008-05-13 07:22:03 -07:00
Tom Henderson 2e116e5f74 Fix semantics of NotifySend() for Tcp 2008-05-13 06:57:57 -07:00
Tom Henderson 9eb007fd26 Add SocketDefaults to store socket option attributes (missing files) 2008-05-12 23:02:44 -07:00
Tom Henderson 6be343530f Add SocketDefaults to store socket option attributes 2008-05-12 23:02:23 -07:00
Gustavo J. A. M. Carneiro 9ee8930726 WAF: add uselib_local to the ns3 library to pull in library dependencies from the ns-3 modules into the main library. 2008-05-13 01:04:42 +01:00
Raj Bhattacharjea 0add09088e Use the correct semantics for sendcallback 2008-05-12 15:12:26 -04:00
Raj Bhattacharjea 006ac07f97 Tcp large transfer modified to keep sending for 10 seconds 2008-05-12 13:27:45 -04:00
Raj Bhattacharjea 5d5fd895f1 Add a socket callback that can unblock a blocked close 2008-05-12 13:13:50 -04:00
Tom Henderson a042d0bbef Move API for socket factory to a Socket::CreateSocket () factory method 2008-05-12 06:39:00 -07:00
Tom Henderson 3ebec1046c Some tcp socket cleanup for buffer limits 2008-05-11 22:12:16 -07:00
Tom Henderson 4340da4ca6 branch merge 2008-05-11 21:55:17 -07:00
Tom Henderson 6ec88588f1 tweak UdpSocket buffer limit behavior 2008-05-11 21:55:00 -07:00
Tom Henderson 32bc3d3664 Fix point-to-point unit tests 2008-05-11 21:43:55 -07:00
Tom Henderson ee62b6d04e Enable receive buffer limit for packet socket 2008-05-11 20:59:08 -07:00
Tom Henderson fc73accacd branch merge from ns-3-dev 2008-05-11 15:17:18 -07:00
Tom Henderson 9da8e1bb03 branch merge from Raj 2008-05-11 15:16:58 -07:00
Craig Dowell 515183caae fix bug 161 2008-05-11 11:18:21 -07:00
Tom Henderson 0f55fefaba API for SocketOptions class 2008-05-10 21:27:32 -07:00
Tom Henderson ddda864b77 branch merge 2008-05-10 20:22:27 -07:00
Craig Dowell 5a16ff1df4 bug 153 applied to CSMA 2008-05-08 13:26:49 -07:00
Raj Bhattacharjea 53841f6170 NotifySend ONLY when data is acked 2008-05-08 16:17:16 -04:00
Craig Dowell 3c8bfe6ae6 bug 153 2008-05-08 12:43:36 -07:00
Mathieu Lacage 2e699a4704 attempt to document some of the internal details 2008-05-08 12:40:44 -07:00
Raj Bhattacharjea 7089f682d6 Finite send buffer first cut 2008-05-08 15:31:44 -04:00
Mathieu Lacage 371ed54dc9 bench tags 2008-05-08 11:23:22 -07:00
Mathieu Lacage 0b6e955a24 help return-value-optimization 2008-05-08 11:22:40 -07:00
Mathieu Lacage f5bb823415 avoid doing the work twice. 2008-05-08 11:22:25 -07:00
Mathieu Lacage 83cd996471 inline a couple of tag methods. 2008-05-08 11:16:32 -07:00
Craig Dowell 418a3fae42 bug 170 2008-05-08 11:16:12 -07:00
Mathieu Lacage 66229167d2 enable metadata only on second run 2008-05-07 15:23:46 -07:00
Mathieu Lacage 164e8c83bc simplify code logic 2008-05-07 15:18:33 -07:00
Mathieu Lacage 2865203612 simplify code logic 2008-05-07 15:02:07 -07:00
Mathieu Lacage f2a37c6ca4 avoid stupid string allocation all the time. 2008-05-07 15:01:45 -07:00
Mathieu Lacage 6236cbf9a3 avoid useless ifdefs 2008-05-07 14:40:03 -07:00
Craig Dowell 58ab30c53c fix optimized build, bug 169 2008-05-07 14:24:45 -07:00
Mathieu Lacage beaf8569c0 add missing license headers 2008-05-07 13:47:19 -07:00
Mathieu Lacage 9679a25783 typos 2008-05-07 13:45:57 -07:00
Mathieu Lacage aaccadb46a a couple more tests. 2008-05-07 13:45:04 -07:00
Mathieu Lacage 4c424da911 add comments about previous bug fix 2008-05-07 11:33:40 -07:00
Mathieu Lacage 623d9898b7 avoid signed/unsigned comparison warning. 2008-05-07 11:28:17 -07:00
Mathieu Lacage 1c05220bba test self-assignment of packets 2008-05-06 15:04:36 -07:00
Mathieu Lacage ccd72825dd add dox doc 2008-05-06 14:54:52 -07:00
Mathieu Lacage 29169d42b6 add missing include for optimized builds 2008-05-06 14:54:44 -07:00
Mathieu Lacage 43ecf40b5a use a free list for tag buffers 2008-05-06 14:44:09 -07:00
Mathieu Lacage 119cf2035b use a shared buffer 2008-05-06 14:18:05 -07:00
Mathieu Lacage 73aec9c9b1 avoid segfault when setting NS_LOG=* 2008-05-06 12:20:10 -07:00
Gustavo J. A. M. Carneiro 04c8831510 merge 2008-05-04 22:46:31 +01:00
Gustavo J. A. M. Carneiro fbabf8129a Upgrade to WAF 1.4.1 2008-05-04 22:43:18 +01:00
Tom Henderson 08511f30c5 Add GetTxBuffer; add some socket options; make limited UDP receive buffer functional 2008-05-03 11:11:24 -07:00
Tom Henderson daddd90d07 Implement GetRxAvailable () 2008-05-02 10:55:07 -07:00
Tom Henderson bfe0533aa3 overloaded Recv() method suggested by Gustavo 2008-05-02 09:38:18 -07:00
Tom Henderson f8a2add627 more cleanup 2008-05-02 09:21:01 -07:00
Tom Henderson af58cc3026 remove more dead code 2008-04-28 21:54:48 -07:00
Tom Henderson c6f7bb2d3e remove previous socket receive methods 2008-04-28 21:45:55 -07:00
Tom Henderson 075851985f Move tcp socket to receive pull model 2008-04-28 21:33:15 -07:00
Gustavo J. A. M. Carneiro e4eeeb18f5 WAF: use os.path.join in the message 'Entering directory ...' 2008-04-26 22:02:12 +01:00
Gustavo J. A. M. Carneiro b61d0ff5f2 WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled. 2008-04-26 21:54:36 +01:00
Tom Henderson 288d193daa Cut over UDP applications to use the new receive API 2008-04-25 14:29:28 -07:00
Mathieu Lacage 0996a38b84 mtag -> tag 2008-04-24 16:06:33 -07:00
Mathieu Lacage 18ee064a79 Mtag -> Tag 2008-04-24 16:03:13 -07:00
Mathieu Lacage 96c43a7e26 remove now-unused Tags class 2008-04-24 16:01:53 -07:00
Mathieu Lacage 5c7b34db46 convert to new tag API. 2008-04-24 15:44:35 -07:00
Mathieu Lacage d3623e2142 add a couple of serialization/deserialization methods 2008-04-24 15:44:15 -07:00
Mathieu Lacage 062a2dcc42 add a couple of dox comments 2008-04-24 14:58:17 -07:00
Mathieu Lacage 2d581766fd a new tag implementation: Mtag 2008-04-24 14:52:59 -07:00
Tom Henderson d7a038431f Plumb in socket receive pull model, in parallel to existing Receive framework 2008-04-24 08:18:01 -07:00
Mathieu Lacage e17282f995 move test code to anon namespace 2008-04-23 15:01:27 -07:00
Mathieu Lacage 78829ba702 add a couple of helper test macros 2008-04-23 14:56:58 -07:00
Mathieu Lacage 4a78ce68d1 add adjustment report to overloaded Buffer::AddAtEnd method 2008-04-23 09:11:55 -07:00
Mathieu Lacage ad54b2ce62 make the code more consistent across AddAtStart and AddAtEnd 2008-04-23 09:05:18 -07:00
Mathieu Lacage f79e7581b6 report the adjustment delta in Buffer::AddAtEnd and Buffer::AddAtStart. 2008-04-23 08:54:29 -07:00
Mathieu Lacage aeffbb31d7 kill dead code 2008-04-23 08:35:59 -07:00
Tom Henderson b998a05cce A few minor cleanups to socket.h/cc 2008-04-22 22:39:17 -07:00
Tom Henderson 3752943c22 bug 131 partial fix: split out Send and DataSent callbacks 2008-04-22 22:29:16 -07:00
Tom Henderson 9fd7fbb86c Fix two nits that escaped checkin 2008-04-22 22:08:53 -07:00
Tom Henderson 829a6dd8bb branch merge 2008-04-22 21:19:39 -07:00
Tom Henderson 1f0dd55d8d EnablePcap()->EnablePcapAll(); EnableAscii()->EnableAsciiAll() 2008-04-22 21:18:04 -07:00
Mathieu Lacage 28bf2500e9 merge with HEAD 2008-04-22 14:36:24 -07:00
Mathieu Lacage 63d6b14d45 optimize case where fake payload is fragmented and re-assembled. 2008-04-22 14:35:42 -07:00
Mathieu Lacage 815f3721b7 move Packet::AddAtEnd implementation to the Buffer code. 2008-04-22 14:18:33 -07:00
Mathieu Lacage 0dab5235c9 kill unused code 2008-04-22 13:54:05 -07:00
Gustavo J. A. M. Carneiro eb9fa68703 Missing hg update when 'Synchronizing reference traces using Mercurial' 2008-04-21 17:31:01 +01:00
Mathieu Lacage 7be1b92968 merge with HEAD 2008-04-21 09:04:08 -07:00
Mathieu Lacage d1ddd3c89b merge 2008-04-21 08:58:23 -07:00
Mathieu Lacage 9b153c313b avoid crash due to mis-spelled data rate unit 2008-04-21 08:32:50 -07:00
Mathieu Lacage ea6e067812 merge with HEAD 2008-04-21 08:05:34 -07:00
Mathieu Lacage 6a93edb24e use CopyObject and not Create to copy RttMeanDeviation. Implement the copy constructor correctly. 2008-04-18 14:35:38 -07:00
Mathieu Lacage a6321aac60 add const version of CopyObject 2008-04-18 14:35:10 -07:00
Mathieu Lacage 450b10b597 merge with HEAD 2008-04-17 16:24:43 -07:00
Mathieu Lacage f91e2ff5a4 fix regression introduced by changeset 6244ea5e7831 to fix bug #173 2008-04-17 16:24:13 -07:00
Mathieu Lacage 35170aed54 merge with HEAD 2008-04-17 15:54:35 -07:00
Mathieu Lacage 2c1b7db441 merge with HEAD 2008-04-17 15:50:49 -07:00
Mathieu Lacage a557f1c064 output the initial value of the attributes 2008-04-17 15:40:25 -07:00
Mathieu Lacage f2b7b1795b small tweak to generated dox 2008-04-17 15:33:39 -07:00
Mathieu Lacage 3b711f9852 improve the auto-generated doxygen output. 2008-04-17 15:30:18 -07:00
Mathieu Lacage a890500150 add doxygen class definitions for native type Value classes. 2008-04-17 14:33:45 -07:00
Mathieu Lacage 7468230ede improve the doxygen output. 2008-04-17 14:15:33 -07:00
Mathieu Lacage 6a3326e529 fix dox warning 2008-04-17 14:13:27 -07:00
Mathieu Lacage 4ff40c4a07 get rid of Attribute class. Use AttributeValue subclasses directly. 2008-04-17 13:42:25 -07:00
Gustavo J. A. M. Carneiro 254057bd80 Add assertion to detect TimeUnit<N> divide by zero (if not detected, it creates an infinite loop) 2008-04-17 17:19:24 +01:00
Mathieu Lacage f5f32e0ea3 merge 2008-04-16 10:52:38 -07:00
Mathieu Lacage 39ef17d6a4 bug 107 2008-04-16 10:52:26 -07:00
Gustavo J. A. M. Carneiro 505de0c685 Address instances of different m_type's should compare differently; closes #173. 2008-04-16 18:37:20 +01:00
Raj Bhattacharjea bb10734d66 Fix for bug 166 2008-04-16 12:40:46 -04:00
Gustavo J. A. M. Carneiro edb480ad29 Fix bad usage of std container iteration and erase () all over OLSR code; closes #171; thanks to Liu Jian for spotting and submitting an initial patch. 2008-04-16 11:32:55 +01:00
Mathieu Lacage f4cff0e194 fix optimized build 2008-04-15 15:56:42 -07:00
Mathieu Lacage 78a2df8963 use function logging macros 2008-04-15 15:53:54 -07:00
Mathieu Lacage f8ec434cdb code was dead. 2008-04-15 15:29:43 -07:00
Mathieu Lacage 1649c1dc65 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION 2008-04-15 15:10:53 -07:00
Mathieu Lacage 5c5ab1f1f0 bug 150: CommandLine::Parse argc parameter should not be a reference 2008-04-15 11:01:13 -07:00
Mathieu Lacage 53be11fe6f update testcase to deal with the return value of Socket::Send. Make sure udp packets are copied before going down the ip stack. 2008-04-15 10:49:09 -07:00
Mathieu Lacage 6fd8b6c572 bug 143: rename scheduler files 2008-04-15 10:09:42 -07:00
Liu Jian 61375f8ef5 Fix bug 168: Socket::SendTo does not return the number of bytes sent for udp sockets. 2008-04-15 09:41:58 -07:00
Mathieu Lacage 8a32b1e369 fix bug reported by Gustavo Carneiro: AP does not reply to ARP request. 2008-04-14 17:12:52 -07:00
Mathieu Lacage 22d1a6046d change NS_LOG= syntax and default behavior to be more useful by default. 2008-04-14 16:39:26 -07:00
Mathieu Lacage db81db32a8 generate list of trace sources and attributes in separate dox groups. 2008-04-14 16:19:17 -07:00
Mathieu Lacage c9d422bbb6 fix some dox warnings 2008-04-14 16:18:50 -07:00
Mathieu Lacage bd1ef984cc improve doxygen 2008-04-14 16:18:30 -07:00
Mathieu Lacage 6d53b47cae improve documentation 2008-04-14 16:06:44 -07:00
Mathieu Lacage 09f00c5b34 remove old non-relevant documentation. 2008-04-14 16:06:08 -07:00
Mathieu Lacage fbe5e3949f add missing license statement. 2008-04-14 15:44:43 -07:00
Mathieu Lacage 43dbc0b4d1 fix optimized build 2008-04-14 12:21:24 -07:00
Mathieu Lacage 5e9344d2d4 add doxygen. 2008-04-14 12:15:05 -07:00
Mathieu Lacage 2b0056553c add time logging support 2008-04-14 11:30:15 -07:00
Mathieu Lacage 6cf0d2e645 cleanup to avoid too many #ifdefs 2008-04-14 10:40:46 -07:00
Mathieu Lacage 822e13a7df align with the semantics of _PARAMS 2008-04-14 10:28:42 -07:00
Mathieu Lacage a62f9d7771 do not use __PRETTY_PRINT__ 2008-04-14 10:26:26 -07:00
Mathieu Lacage 112b278854 kill NS_LOG_PARAMS_BEGIN/END. 2008-04-14 10:10:17 -07:00
Gustavo Carneiro 14c60f7ad3 Remove the restriction of waf option --command-template requiring option --run; it no longer makes sense. 2008-04-14 14:19:12 +01:00
Tom Henderson e855838ed1 Align helper API use of Install() 2008-04-13 15:46:17 -07:00
Mathieu Lacage 8a4b416428 ConfigStore allows you to dump and read from a file a simulation configuration 2008-04-11 16:58:50 -07:00
Mathieu Lacage ca687b56f6 avoid trailing | 2008-04-11 16:58:00 -07:00
Mathieu Lacage 556d973168 implement operator >> 2008-04-11 16:52:22 -07:00
Mathieu Lacage 42282f5512 implement operator >> 2008-04-11 16:52:12 -07:00
Mathieu Lacage 0e65d73baa implement operator >> 2008-04-11 16:51:58 -07:00
Mathieu Lacage f7691237f5 -1 cuts the trailing s if the time postfix is longer than 1 char. 2008-04-11 12:23:19 -07:00
Mathieu Lacage ed0dcc982b merge 2008-04-11 11:30:05 -07:00
Mathieu Lacage a390b13f86 Backed out changeset 9fa2f44cdafa 2008-04-11 11:29:49 -07:00
Mathieu Lacage 5d91e8c2d2 implement operator << for ObjectFactory. 2008-04-11 11:27:09 -07:00
Mathieu Lacage 0789c9b435 use HasSetter/HasGetter to improve doxygen output. 2008-04-11 11:25:44 -07:00
Mathieu Lacage 03b4114b20 add AttributeAccessor::HasGetter/HasSetter and implement it. 2008-04-11 11:25:21 -07:00
Mathieu Lacage fda39900e3 allow an std::string to be an attribute 2008-04-11 11:24:42 -07:00
Mathieu Lacage 9167a8b308 merge with HEAD 2008-04-11 11:20:05 -07:00
Mathieu Lacage 60c81de8b5 ensure that out PcapTraces are generated in a consistant format to allow simple comparison of traces against a single set of reference traces. 2008-04-11 11:19:54 -07:00
Mathieu Lacage 3211fbb0bf allocate/deallocate buffer by hand. 2008-04-10 14:08:14 -07:00
Raj Bhattacharjea 3327b9da92 Shorten Tcp attribute names (bug 163) 2008-04-10 16:33:44 -04:00
Mathieu Lacage 72b496b9ef use RefCountBase 2008-04-10 13:01:53 -07:00
Mathieu Lacage 8bfd88b80b get rid of scary implementation details of Attribute. 2008-04-10 12:59:31 -07:00
Mathieu Lacage c456128c6d add copy constructor and assignment operator to ensure proper initialization of refcount. 2008-04-10 12:59:15 -07:00
Mathieu Lacage dd283f6ead print list of trace sources 2008-04-10 12:24:36 -07:00
Raj Bhattacharjea 271ea4bc75 Add support for TCP cwnd tracing 2008-04-10 15:04:47 -04:00
Craig Dowell e7c2292d7b make duplicate aggregations fail; avoid duplicate aggregations 2008-04-10 13:16:43 -07:00
Mathieu Lacage c883517a1d generate path information for each type. 2008-04-10 11:50:47 -07:00
Mathieu Lacage 696859e936 add a few missing ns3:: prefixes in TypeId names. 2008-04-10 11:50:08 -07:00
Mathieu Lacage 267a3ca69d add missing registration macro call 2008-04-10 11:11:55 -07:00
Mathieu Lacage 27c1fab7fc add functions to access list of root namespace objects 2008-04-10 11:11:34 -07:00
Mathieu Lacage be27a1c03d add missing TypeId in base class 2008-04-10 10:24:18 -07:00
Mathieu Lacage ba319c457d make IsChildOf not return true for test against self. Add operator < for TypeId. 2008-04-10 10:23:56 -07:00
Mathieu Lacage 4a556dbf91 iterate over the _aggregated_ objects: this does not include the initial pointer. 2008-04-10 09:23:24 -07:00
Mathieu Lacage 923b1180f9 iterate over aggregated objects dynamically. 2008-04-09 17:35:18 -07:00
Mathieu Lacage f6ba778fc9 define a TypeId for ns3::Ipv4Interface 2008-04-09 17:28:19 -07:00
Mathieu Lacage cff773b8d2 use a specific type if you can 2008-04-09 17:27:56 -07:00
Mathieu Lacage 776a594c3c typos in WifiChannel 2008-04-09 17:27:12 -07:00
Mathieu Lacage a75e91cc03 add ObjectVector::GetItemTypeId 2008-04-09 14:58:52 -07:00
Mathieu Lacage dc271270a8 allow access to the pointee's TypeId. 2008-04-09 14:28:16 -07:00
Mathieu Lacage cc927f907f improve type linking behavior. 2008-04-09 13:05:20 -07:00
Mathieu Lacage 53fb65aea7 add doxygen documentation to avoid doxygen warnings. 2008-04-09 13:04:37 -07:00
Mathieu Lacage 560a34ba97 add space to ensure doxygen reference generation. 2008-04-09 13:04:18 -07:00
Mathieu Lacage e0570ec0b0 add doxygen anchors to avoid warnings. 2008-04-09 13:03:58 -07:00
Mathieu Lacage e110fea8ff get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class. 2008-04-09 12:15:24 -07:00
Mathieu Lacage d4cd3c92fd Pointer class for primitive type pointer. 2008-04-09 11:46:04 -07:00
Mathieu Lacage b807dfa090 Make sure that we really attempt to destroy everything upon process exit. Gets rid of spurious leak reports in valgrind. 2008-04-09 10:04:16 -07:00
Mathieu Lacage 5a16b2cad8 add destructor. Easier to plant a breakpoint in there. 2008-04-09 10:03:28 -07:00
Mathieu Lacage 9ea56ac66a add pcap files to ignore list. 2008-04-09 10:02:54 -07:00
Mathieu Lacage 478e810ad5 add some debugging 2008-04-09 10:01:16 -07:00
Mathieu Lacage bf90dded3c avoid compilation warning about undefined MobilityModel class. 2008-04-09 09:08:54 -07:00
Tom Henderson c22d5c5733 revive mixed-wireless example from Simutools tutorial 2008-04-08 23:12:19 -07:00
Tom Henderson bb5f9f1a50 Prevent internet stack helper from overwriting internet stack 2008-04-08 23:10:39 -07:00
Tom Henderson 3f1c2d2653 some additional debugging for addressing conflicts 2008-04-08 23:10:11 -07:00
Tom Henderson f6dcb76287 Added tag release ns-3.0.12 for changeset b17f2928291e 2008-04-07 21:39:40 -07:00
Tom Henderson 6740fc4627 note that waf generates reference trace tarball now 2008-04-07 21:35:54 -07:00
Tom Henderson edc7af8a02 nits for 3.0.12 release 2008-04-07 21:07:38 -07:00
Craig Dowell 80c8937a01 rework app constructors 2008-04-07 18:29:38 -07:00
Mathieu Lacage 4400054ebe SetupUdp -> SetUdpLocal, SetupTcp -> SetTcpLocal 2008-04-07 10:44:06 -07:00
Mathieu Lacage 3a43bd4987 Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign 2008-04-07 10:41:21 -07:00
Mathieu Lacage c140066890 Build -> Install 2008-04-07 10:38:37 -07:00
Gustavo J. A. M. Carneiro c3f0505ddc Create regression traces tarball automatically on waf dist. 2008-04-06 21:57:11 +01:00
Gustavo J. A. M. Carneiro 8501ca807c Ignore .py[co] files (python bytecodes) 2008-04-06 21:41:31 +01:00
Gustavo J. A. M. Carneiro 75643a53ef Fix a diff|head race condition; Fix regression error messages to indicate the new waf commands to run regression tests. 2008-04-06 19:58:29 +01:00
Gustavo J. A. M. Carneiro b6471a7749 merge 2008-04-06 19:54:39 +01:00
Gustavo J. A. M. Carneiro 0c393e38c4 Fix case of 'diff xxx | head' appearing to succeed even if the diff command returned non-zero exit statux. 2008-04-06 19:22:39 +01:00
Raj Bhattacharjea 05019b6214 Add TCP delayed acks 2008-04-04 17:20:36 -04:00
Gustavo J. A. M. Carneiro 737bc7cd00 Integrate regression testing into the main waf script. 2008-04-04 19:33:39 +01:00
Raj Bhattacharjea 31d26c1e84 Small fix to tcp example 2008-04-04 14:00:41 -04:00
Mathieu Lacage ec7c5d2dd6 merge with HEAD 2008-04-04 19:02:34 +02:00
Mathieu Lacage b34fbc477b fix bug 159 2008-04-04 19:02:03 +02:00
Tom Henderson a8acd5c5f0 try to improve obj->png conversion 2008-04-04 08:47:41 -07:00
Tom Henderson 621f07f0d2 revert figure directory change 2008-04-03 23:15:16 -07:00
Tom Henderson 11468a4235 Remove filename 2008-04-03 23:04:25 -07:00
Tom Henderson 441b674f96 workaround texinfo problem with non-local images 2008-04-03 23:03:25 -07:00
Tom Henderson 2c273b86cd fixes for Makefile due to tgif command-line limitations 2008-04-03 22:42:10 -07:00
Mathieu Lacage d4347bc1b5 testcase from bug 159 2008-04-04 07:28:27 +02:00
Tom Henderson 5a8c75187d Makefile tweaks 2008-04-03 21:08:28 -07:00
Tom Henderson 36049254af a few tutorial updates; tutorial Makefile; tutorial figures directory 2008-04-03 20:58:40 -07:00
Tom Henderson 18dd6edda3 branch merge 2008-04-03 09:07:28 -07:00
Tom Henderson c802635595 Some doxygen work 2008-04-03 09:07:15 -07:00
Gustavo J. A. M. Carneiro 56b59c5905 Add a --no-task-lines WAF option; together with -v it makes WAF just print executed commands, like 'make' does. 2008-04-03 14:15:17 +01:00
Craig Dowell 6490c81cf8 Point regression tests to final locations, update release steps, bug 158 2008-04-02 21:33:31 -07:00
Raj Bhattacharjea ec3d666f3b Add IP layer tracing helpers to InternetStackHelper 2008-04-02 14:09:36 -04:00
Craig Dowell 8dc44fbfaf helpful hint 2008-04-01 17:05:54 -07:00
Craig Dowell 5a8d264371 address some list comments 2008-04-01 16:30:08 -07:00
Craig Dowell 3faceb9149 minor cleanup 2008-03-31 18:20:33 -07:00
Craig Dowell aad4e224e5 test test 2008-03-31 18:14:47 -07:00
Craig Dowell 5bd019aba0 use global seed in examples, new regression tests 2008-03-31 17:48:21 -07:00
Craig Dowell 9fe0c49344 some examples disappeared 2008-03-31 16:31:34 -07:00
Craig Dowell bcc362cd11 branch merge 2008-03-31 16:22:24 -07:00
Craig Dowell 34c057c351 quiet clone and pull 2008-03-31 16:22:06 -07:00
Craig Dowell 9c1922aebe fix diffs 2008-03-31 16:16:43 -07:00
Craig Dowell 058f508927 move reference traces out of main repo 2008-03-31 16:03:44 -07:00
Mathieu Lacage 24863d5368 add guillaume vu-brugier to author list 2008-03-31 15:39:50 -07:00
Mathieu Lacage e103bc0ded add Federico to author list. 2008-03-31 15:38:44 -07:00
Mathieu Lacage 766efc6d0e initial draft of release notes. 2008-03-31 15:33:19 -07:00
Mathieu Lacage e4fa093d5f update platform build matrix and example program. 2008-03-31 15:33:05 -07:00
Mathieu Lacage cb1e1d0023 bump up version number. 2008-03-31 15:32:46 -07:00
Mathieu Lacage dc96b531b1 generate .pcap postfix for pcap filenames 2008-03-31 15:19:31 -07:00
Mathieu Lacage a4a18943f7 change pcap filename template to be slightly more coherent. 2008-03-31 15:19:11 -07:00
Mathieu Lacage a87eed74c2 change pcap filename template to be slightly more coherent. 2008-03-31 15:19:08 -07:00
Mathieu Lacage 5a614715ea quiet dox warning 2008-03-31 15:00:39 -07:00
Mathieu Lacage 27d2380327 remove unused code. 2008-03-31 14:57:30 -07:00
Mathieu Lacage d1d683ee21 remove 'All rigts reserved' keyword per tom's suggestion 2008-03-31 14:56:41 -07:00
Mathieu Lacage 812fc3be75 add missing license headers 2008-03-31 14:50:25 -07:00
Mathieu Lacage ae4529b819 fix typo 2008-03-31 14:44:13 -07:00
Mathieu Lacage 2c1c5afe91 get rid of channel during dispose 2008-03-31 14:43:38 -07:00
Mathieu Lacage b41554c18f kill dead code. 2008-03-31 14:36:21 -07:00
Mathieu Lacage 40349f92d8 do not include internet-node.h 2008-03-31 14:36:15 -07:00
Mathieu Lacage 6935a997e6 do not use InternetNode 2008-03-31 14:34:38 -07:00
Mathieu Lacage 41f6573c8d do not include internet-node.h 2008-03-31 14:34:27 -07:00
Mathieu Lacage 2b44913a70 convert to helper API 2008-03-31 14:34:06 -07:00
Mathieu Lacage 64f72686aa merge with HEAD 2008-03-31 14:23:44 -07:00
Mathieu Lacage d06c2b4fae add back max simulation time on olsr example 2008-03-31 14:23:07 -07:00
Mathieu Lacage 889e333a35 add ns2's stupid prefix on each ascii line output. 2008-03-31 14:09:46 -07:00
Mathieu Lacage 379c3d5390 port to helper API 2008-03-31 14:00:40 -07:00
Craig Dowell 02273c7da7 branch merge 2008-03-31 13:54:57 -07:00
Craig Dowell 2bb663d011 branch merge 2008-03-31 13:54:41 -07:00
Mathieu Lacage 0dfe8fa5df use static method syntax to setup tracing 2008-03-31 13:49:45 -07:00
Mathieu Lacage e173bb868d remove example of p2p static routing: this requires using the low-level API and we don't want to show how to do this. 2008-03-31 13:44:08 -07:00
Mathieu Lacage c5ffe4c9dc remove dead comment 2008-03-31 13:41:09 -07:00
Mathieu Lacage a053ff6896 port to helper API 2008-03-31 13:25:01 -07:00
Mathieu Lacage 537e375fe1 port to helper API 2008-03-31 13:21:22 -07:00
Mathieu Lacage 879b2cb91d port to helper API 2008-03-31 13:20:26 -07:00
Mathieu Lacage c0d60678d9 port to helper API 2008-03-31 13:18:31 -07:00
Raj Bhattacharjea 521c43eb23 Fix the fin retransmission; 2008-03-31 16:18:03 -04:00
Mathieu Lacage 627813fe6c port to helper API. 2008-03-31 13:10:59 -07:00
Mathieu Lacage 16f7931992 port to helper API 2008-03-31 13:10:17 -07:00
Mathieu Lacage 76847a02ca port to helper API. 2008-03-31 11:40:48 -07:00
Mathieu Lacage 935a7896e1 use src/node/ipv4-address-generator.h 2008-03-31 11:40:40 -07:00
Mathieu Lacage 7f6f6ba6a7 improve warning output 2008-03-31 11:40:17 -07:00
Mathieu Lacage 8977a827b2 kill now-useless code. 2008-03-31 11:39:55 -07:00
Mathieu Lacage 11608c6b16 convert to helper API 2008-03-31 11:07:19 -07:00
Mathieu Lacage 6ac2042e55 tweak doxygen 2008-03-31 09:51:30 -07:00
Mathieu Lacage 4ff7264001 add missing tracing helpers and doxygen 2008-03-31 09:49:22 -07:00
Mathieu Lacage 9bcf1cdac5 add wifi helper tracing. 2008-03-31 09:34:51 -07:00
Raj Bhattacharjea f2769ba5a5 Remove the TCP examples that aren't in line with the helper API 2008-03-31 12:22:05 -04:00
Tom Henderson db02706e4c Prepend ascii trace lines with action and time 2008-03-30 22:39:27 -07:00
Tom Henderson 78bfd610d9 Move csma-one-subnet to helper api 2008-03-30 21:41:25 -07:00
Tom Henderson 20726f8201 move csma-multicast to new tracing helpers 2008-03-30 21:12:02 -07:00
Tom Henderson 4fc3138b1e Prepend ascii trace lines with action and time 2008-03-30 21:05:50 -07:00
Tom Henderson b6932288ae csma-multicast helper-ized (w/o tracing cutover yet) 2008-03-30 14:04:57 -07:00
Tom Henderson 6397957980 documentation for class RngStream 2008-03-29 13:28:54 -07:00
Tom Henderson 8810ebfe02 Fix multicast forwarding problem 2008-03-29 08:47:25 -07:00
Tom Henderson 7771ab6562 enable csma multicast 2008-03-29 06:33:19 -07:00
Mathieu Lacage 27615d70d1 use lsb order rather than network order 2008-03-28 18:45:52 -07:00
Mathieu Lacage 1a443df051 initialize no more fragment flag 2008-03-28 18:45:26 -07:00
Mathieu Lacage ff4dfc3009 add Htolsb and Lsbtoh write/read methods 2008-03-28 18:45:10 -07:00
Mathieu Lacage a349c602db basic pcap output 2008-03-28 17:35:50 -07:00
Mathieu Lacage 62308cf1ce delete a packet chunk after deserializing it from a packet. 2008-03-28 17:03:03 -07:00
Mathieu Lacage 511e11e9be configure tracing post-topology construction, not before. 2008-03-28 16:58:44 -07:00
Mathieu Lacage 6de12cc9d2 port to new pcap/ascii trace helpers 2008-03-28 13:40:08 -07:00
Mathieu Lacage 9ad6948605 use new pcap/ascii api 2008-03-28 13:19:14 -07:00
Mathieu Lacage 7e17f8d7e1 add ascii/pcap trace helpers 2008-03-28 13:05:44 -07:00
Mathieu Lacage 67c8f12b67 add doxygen 2008-03-28 12:49:39 -07:00
Federico Maguolo e0346ac124 GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission 2008-03-28 12:14:02 -07:00
Providence SALUMU MUNGA 46cc3fab6d make sure dev is initialized correctly when binding to more than one interface. 2008-03-28 11:26:59 -07:00
Providence SALUMU MUNGA 02dc54f597 tx power shoudl reflect the user-selected power level, not be always the power level zero. 2008-03-28 11:25:07 -07:00
Mathieu Lacage a7677d77de use new csma pcap and ascii tracing 2008-03-28 11:20:02 -07:00
Mathieu Lacage e963c05aeb add ascii and pcap tracing support to csma helper. 2008-03-28 11:19:38 -07:00
Mathieu Lacage cb475c1750 improve doxygen documentation. 2008-03-28 10:38:03 -07:00
Mathieu Lacage 4202275d10 give refcounting powers to PcapWriter. 2008-03-28 10:23:31 -07:00
Mathieu Lacage e9c67a3ada Rx traces report the full packet and make sure we set the length field correctly in case of LLC encapsulation 2008-03-28 10:21:57 -07:00
Mathieu Lacage ba70c90271 export header. 2008-03-27 15:32:15 -07:00
George F. Riley 8d084573dc bug: 147. Add RefCountBase 2008-03-27 15:28:54 -07:00
Mathieu Lacage 9644e5ee88 remove include 2008-03-27 15:22:04 -07:00
Mathieu Lacage 74541b0d23 remove useless trailing ; 2008-03-27 15:21:08 -07:00
Mathieu Lacage fa2983e8a4 remove useless trailing ; 2008-03-27 15:21:05 -07:00
Mathieu Lacage a280c30a20 remove dead member 2008-03-27 15:20:47 -07:00
Mathieu Lacage a85420cd34 merge with HEAD 2008-03-27 12:21:58 -07:00
Mathieu Lacage 982fe8454b port to helper API 2008-03-27 12:20:26 -07:00
Mathieu Lacage b5cfd48e9a helper for UdpEcho client and server 2008-03-27 12:20:14 -07:00
Mathieu Lacage b7f945f750 add UdpEchoClient::SetRemote 2008-03-27 12:19:22 -07:00
Mathieu Lacage 942f3404a3 improve attribute help string 2008-03-27 12:19:00 -07:00
Mathieu Lacage fd49891782 fix missing includes 2008-03-27 11:47:58 -07:00
Raj Bhattacharjea 6191bda098 Implement TcpHeader::Print (bug 151) 2008-03-27 12:27:41 -04:00
Mathieu Lacage ac7ef5158d merge with HEAD 2008-03-27 09:13:41 -07:00
Mathieu Lacage c61932afc5 port to helper API 2008-03-27 09:13:29 -07:00
Raj Bhattacharjea 473ea28f10 Cleanup of RandomVariable doxygen (bug 110) 2008-03-27 11:36:23 -04:00
Craig Dowell 2158f87125 branch merge 2008-03-26 21:28:27 -07:00
Craig Dowell b4aaac11c6 olsr test 2008-03-26 21:28:13 -07:00
Mathieu Lacage 1d78ea62e8 port to helper API 2008-03-26 16:12:46 -07:00
Mathieu Lacage 37f1478f00 use an attribute name which matches the member variable and method 2008-03-26 16:12:36 -07:00
Mathieu Lacage 2fe2751c9e do not aggregate error model to device 2008-03-26 14:53:00 -07:00
Mathieu Lacage 80e0d082b4 convert to helper API 2008-03-26 14:51:03 -07:00
Mathieu Lacage 011e2bbb70 add extra convenience constructors 2008-03-26 14:50:56 -07:00
Mathieu Lacage 26fba17dc2 port to helper API 2008-03-26 14:18:22 -07:00
Mathieu Lacage 4e2a41ae85 add SetMetric 2008-03-26 14:18:12 -07:00
Mathieu Lacage cb3bcff3a6 fallout from gustavo's header inclusion policy change. 2008-03-26 14:17:58 -07:00
Mathieu Lacage 72f7ffdb6d merge with head 2008-03-26 13:51:46 -07:00
Mathieu Lacage 050af31b95 use Ipv4InterfaceContainer to avoid hardcoding ip addresses. 2008-03-26 13:51:24 -07:00
Mathieu Lacage 89d089c506 introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it. 2008-03-26 13:51:07 -07:00
Craig Dowell 3d0e59cd05 branch merge 2008-03-26 11:42:12 -07:00
Gustavo J. A. M. Carneiro 83dea96517 merge 2008-03-26 18:20:56 +00:00
Gustavo J. A. M. Carneiro e1d6ca18e1 Don't generate module dependencies includes in module headers. 2008-03-26 18:20:30 +00:00
Raj Bhattacharjea 7020d1611e A CSMA channel typo (Bug 152 reported by Guillaume Vu-Brugier) 2008-03-26 11:15:42 -04:00
Craig Dowell 0a3da46adc some tests and known traces 2008-03-26 01:33:41 -07:00
Craig Dowell ed271f5954 quiet diffs 2008-03-26 00:36:58 -07:00
Craig Dowell a3628b44c1 trace generation and comparison 2008-03-26 00:30:11 -07:00
Craig Dowell 23edc105e2 start of regression tests 2008-03-25 23:17:24 -07:00
Mathieu Lacage 44afb107ba convert to helper API. 2008-03-25 17:14:33 -07:00
Mathieu Lacage 5fe039c6a6 use the factories. 2008-03-25 17:13:32 -07:00
Mathieu Lacage cabb264eef initialize factories correctly. 2008-03-25 17:02:14 -07:00
Mathieu Lacage ab8a395c49 ensure type is registered 2008-03-25 17:01:56 -07:00
Mathieu Lacage da1d232338 make MaxBytes an attribute 2008-03-25 16:05:59 -07:00
Mathieu Lacage 08eb0aef35 use auto-generated headers 2008-03-25 14:48:37 -07:00
Mathieu Lacage d869416a92 merge with HEAD 2008-03-25 14:17:35 -07:00
Mathieu Lacage 77bf878ea8 convert PacketSocket scripts to PacketSocketHelper. 2008-03-25 14:16:40 -07:00
Mathieu Lacage 4966231237 add new files to build. 2008-03-25 14:16:26 -07:00
Mathieu Lacage 1724e3ceec aggregate PacketSocketFactory unconditionally. 2008-03-25 14:16:10 -07:00
Mathieu Lacage 58dd143df7 aggregate PacketSocketFactory when requested to. 2008-03-25 14:15:56 -07:00
Mathieu Lacage a6979a7bb9 remove PacketSocketFactory aggregation from Node base class 2008-03-25 14:15:34 -07:00
Raj Bhattacharjea 7b8b8e8de3 Fix a typo that caused stack overflow 2008-03-25 11:51:22 -04:00
Mathieu Lacage 7f56378951 merge with head 2008-03-24 16:32:16 -07:00
Mathieu Lacage b21f71e568 port to helper API 2008-03-24 16:31:19 -07:00
Mathieu Lacage 8872354a55 a bunch of new helpers. 2008-03-24 16:31:14 -07:00
Mathieu Lacage 69dfbe8707 port to helper API. 2008-03-24 16:30:37 -07:00
Mathieu Lacage 5117b61f63 create an ipv4 interface if there is none. 2008-03-24 16:30:25 -07:00
Mathieu Lacage bb59c6a9fb register constructor 2008-03-24 16:30:05 -07:00
Mathieu Lacage c6868e0961 ensure registration. 2008-03-24 16:29:43 -07:00
Craig Dowell ff02feb0b7 quiet unused variable warning 2008-03-24 15:48:09 -07:00
Craig Dowell 991e83fe2c address generator, address collision checker 2008-03-24 15:31:54 -07:00
Mathieu Lacage 0a9ad0c47c use auto-generated per-module headers 2008-03-24 13:57:26 -07:00
Mathieu Lacage dafc9f88ae doxygen 2008-03-24 13:57:14 -07:00
Mathieu Lacage 9b4661c799 add missing include 2008-03-24 13:57:07 -07:00
Mathieu Lacage 69ddf50d98 merge 2008-03-24 13:33:56 -07:00
Mathieu Lacage 386b5fe6eb make ns3::Channel wholy pure. 2008-03-24 13:33:41 -07:00
Mathieu Lacage 25374b7325 improve doxygen. 2008-03-24 13:25:08 -07:00
Mathieu Lacage da3541e88d cleanup. 2008-03-24 13:15:53 -07:00
Mathieu Lacage 3bf71817cf remove undeeded include. 2008-03-24 13:11:48 -07:00
Mathieu Lacage 8acd8baa33 use FailSafe postfix in a more rigorous way. 2008-03-24 13:04:55 -07:00
Mathieu Lacage 7c1cda0ccb doxygen 2008-03-24 13:04:27 -07:00
Craig Dowell a12b08bd3a branch merge 2008-03-24 12:57:32 -07:00
Craig Dowell 341ef1908c fix unit tests 2008-03-24 12:56:39 -07:00
Craig Dowell 18bfce3a97 typos in doxygen, default to 0.0.0.1, avoid broadcast address 2008-03-24 12:45:02 -07:00
Mathieu Lacage 35729f1717 merge 2008-03-24 12:21:20 -07:00
Mathieu Lacage f44690e9af doxygen 2008-03-24 12:12:22 -07:00
Mathieu Lacage 14690d8553 InternetStackHelper. 2008-03-24 12:11:30 -07:00
Gustavo J. A. M. Carneiro 44d0c56680 Fix swapped comments in wifi-ap.cc. 2008-03-24 19:00:18 +00:00
Mathieu Lacage 3a19364b1b introduce AddInternetStack 2008-03-24 11:56:50 -07:00
Mathieu Lacage 9ad409452b fix dox warnings. 2008-03-24 11:50:58 -07:00
Mathieu Lacage 47775d87da doxygen. 2008-03-24 11:49:58 -07:00
Mathieu Lacage 41bbee50af doxygen 2008-03-24 11:43:49 -07:00
Mathieu Lacage 80fec1898e do not use templates. 2008-03-24 11:28:42 -07:00
Mathieu Lacage 0ccf783437 doxygen 2008-03-24 11:14:05 -07:00
Mathieu Lacage 35d9ec1c8e change signature of MobilityHelper::Layout and MobilityHelper::LayoutAll. 2008-03-24 10:42:18 -07:00
Mathieu Lacage 4e5eab77e2 add NodeContainer::GetGlobal 2008-03-24 10:41:44 -07:00
Mathieu Lacage 29f19e164e doxygen. 2008-03-24 10:14:35 -07:00
Craig Dowell e1c0003987 ip helper and find ip interface for device method on ipv4 2008-03-21 17:26:01 -07:00
Mathieu Lacage 4404c371af doxygen 2008-03-21 15:58:20 -07:00
Mathieu Lacage 83ac55585c doxygen. 2008-03-21 15:52:49 -07:00
Mathieu Lacage e9a8648ae9 add \ref to get links. 2008-03-21 15:52:42 -07:00
Mathieu Lacage f17df2c2dc some more doxygen 2008-03-21 15:33:01 -07:00
Mathieu Lacage 18c92e855d TypeId::GetAttributeListN -> TypeId::GetAttributeN 2008-03-21 13:41:16 -07:00
Mathieu Lacage 048ffbe7d3 move another helper to the helper dir 2008-03-21 13:24:15 -07:00
Mathieu Lacage e5818f9865 remove references to non-existant code. 2008-03-21 13:24:01 -07:00
Mathieu Lacage 09b0afe3d5 fix the build, again. 2008-03-21 13:19:37 -07:00
Mathieu Lacage 4f3921d1bf remove reference to trace resolver. 2008-03-21 13:14:00 -07:00
Mathieu Lacage 48a799a6ac fix dox warnings 2008-03-21 13:06:34 -07:00
Mathieu Lacage 08ce187c6b doxygen. 2008-03-21 12:56:40 -07:00
Mathieu Lacage d3fb648979 fix build 2008-03-21 12:56:33 -07:00
Mathieu Lacage 2759411565 merge 2008-03-21 12:34:11 -07:00
Mathieu Lacage fa8f4bf528 improve doxygen 2008-03-21 12:33:35 -07:00
Tom Henderson eeaea6f03b tutorial updates for attributes 2008-03-21 12:14:07 -07:00
Mathieu Lacage 8125fab8c3 add missing header 2008-03-21 11:04:29 -07:00
Mathieu Lacage 7fe3f102ff remove dead header 2008-03-21 09:57:27 -07:00
Mathieu Lacage 53b38a05ea remove dead header 2008-03-21 09:56:48 -07:00
Mathieu Lacage 8aada40095 merge 2008-03-21 09:09:32 -07:00
Mathieu Lacage 621b84064a AllocateUid/Search seem to not calculate correctly mode uids. 2008-03-21 09:09:10 -07:00
Gustavo J. A. M. Carneiro 91cf6bfccd Fix the udp socket unit test problem discovered by Mathieu. 2008-03-21 14:17:58 +00:00
src/devices/wifi/Federico Maguolo c9785a0ef0 Composite and Jakes propagation loss models. 2008-03-21 04:51:36 +01:00
Federico Maguolo 73ea5d6192 PropagationLossModel::GetRxPower -> PropagationLossModel::GetLoss 2008-03-21 04:49:23 +01:00
Federico Maguolo 752658119f add missing prefix. 2008-03-21 04:38:09 +01:00
Mathieu Lacage 53b3d2bb1f SimpleChannel/SimpleNetDevice. Use them where needed. 2008-03-20 15:27:48 -07:00
Mathieu Lacage e22584cd79 merge with head 2008-03-20 13:37:27 -07:00
Raj Bhattacharjea 05b6cf11a8 Fix TCP handshake sequence numbers 2008-03-20 16:25:35 -04:00
Mathieu Lacage 960bc0d1ba add missing license headers. 2008-03-20 13:25:08 -07:00
Mathieu Lacage 745520c03d some doxygen work. 2008-03-20 13:23:03 -07:00
Raj Bhattacharjea de80ab4910 Pass TcpSockets as smart pointers into demux callbacks
fixes TcpSocket memory leaks
2008-03-20 14:04:24 -04:00
Mathieu Lacage c995c98e85 Add an explicit copy constructor. Bug reported by Raj. 2008-03-20 10:25:59 -07:00
Mathieu Lacage fc3824059b point to point smoke tests 2008-03-20 10:14:02 -07:00
Mathieu Lacage ef44869539 merge TypeId in headers and trailers branch 2008-03-20 09:56:03 -07:00
Gustavo J. A. M. Carneiro 4ef540a4e6 Fix parsing of GlobalValues as command line options. 2008-03-20 15:16:17 +00:00
Gustavo J. A. M. Carneiro 56299308b6 Fix deserialization for Constant and Uniform random variables. 2008-03-20 15:10:56 +00:00
Mathieu Lacage f7aa0eb745 static-ify 2008-03-19 15:43:08 -07:00
Mathieu Lacage 881590b6d7 A bunch of wifi smoke tests. 2008-03-19 15:30:41 -07:00
Mathieu Lacage c78d5b071a fix typename 2008-03-19 15:30:18 -07:00
Mathieu Lacage 6974ce4f24 get the typename right. make sure the object is registered with our type system. 2008-03-19 15:14:17 -07:00
Mathieu Lacage 627a2048f1 remove trailing ; 2008-03-19 13:11:25 -07:00
Mathieu Lacage 5cd592fe06 remove template methods. 2008-03-19 13:10:01 -07:00
Mathieu Lacage 295c1cd3d5 move wifi examples to example directory 2008-03-19 12:42:54 -07:00
Mathieu Lacage 931e5140e2 add a bunch of trace sinks for demonstration 2008-03-19 12:41:06 -07:00
Mathieu Lacage 574ed67011 convert Packet::Print to use Chunk::Print 2008-03-19 12:36:27 -07:00
Mathieu Lacage 5b42ef5b02 make sure the trace hooks get a full packet as input. 2008-03-19 12:36:09 -07:00
Mathieu Lacage c6aa4c8fb4 fix failing tests 2008-03-19 12:30:19 -07:00
Mathieu Lacage 6534020b54 add failing tests 2008-03-19 12:30:00 -07:00
Mathieu Lacage a3ed490b7f call SetAddress during construction to assign MAC-level addresses. 2008-03-19 11:19:29 -07:00
Mathieu Lacage 10bbdc4176 add SetAddress methods. 2008-03-19 11:19:05 -07:00
Mathieu Lacage 26f046edd5 fragmentEnd is not zero when this is a fragment. 2008-03-19 11:11:34 -07:00
Mathieu Lacage cabfd83031 improve pretty-printing output. 2008-03-19 11:10:37 -07:00
Mathieu Lacage 1518a1dbd1 add extra trace sources 2008-03-19 11:10:02 -07:00
Mathieu Lacage e5b7c28375 add Print to the Chunk base class. 2008-03-19 10:32:06 -07:00
Mathieu Lacage 2f666d9622 make sure all headers and trailers gets a constructor registered in their TypeId. 2008-03-19 10:31:50 -07:00
Mathieu Lacage 30525bef9a make sure the Rx trace event also gets the llc header to be symetric with the tx event. 2008-03-19 10:30:59 -07:00
Tom Henderson e14aaceabe Add sample file for attribute values 2008-03-19 07:10:01 -07:00
Mathieu Lacage c8f4d234ea improve doxygen. 2008-03-17 17:47:45 -07:00
Mathieu Lacage 8dc5510518 implement Packet::Print 2008-03-17 17:37:25 -07:00
Mathieu Lacage 6b9fc231e1 remove dead code. 2008-03-17 14:49:52 -07:00
Mathieu Lacage a0a7c6d88c stop using ChunkRegistry to get header and trailer uids 2008-03-17 14:01:55 -07:00
Mathieu Lacage f6438556ef add TypeId::SetUid/GetUid 2008-03-17 13:31:08 -07:00
Mathieu Lacage 5d4ecfc62c define a TypeId for each Header/Trailer. 2008-03-17 13:12:17 -07:00
Mathieu Lacage de502593ef make the base Header and Trailer classes virtual. 2008-03-17 12:12:17 -07:00
Mathieu Lacage b5bfc150e3 add TypeId::IsChildOf 2008-03-17 11:55:46 -07:00
Mathieu Lacage bcf92901ac really kill dead code. 2008-03-17 11:47:50 -07:00
Mathieu Lacage c7be59d0c1 replace PacketPrinter with an iterator 2008-03-17 11:45:36 -07:00
Mathieu Lacage 218c66592a move more code around 2008-03-17 05:42:20 +01:00
Mathieu Lacage 96e4874bdb move attribute code to ObjectBase. 2008-03-17 05:22:29 +01:00
Mathieu Lacage 0ef1e6b866 return the _current_ tid, not the Object tid. 2008-03-16 21:52:15 +01:00
Mathieu Lacage 0bfc594407 remove Object::m_collecting 2008-03-16 21:00:31 +01:00
Mathieu Lacage fd014845f7 introduce ObjectBase::GetInstanceTypeId 2008-03-16 20:59:04 +01:00
Mathieu Lacage 660e414f36 split code from object.h/object.cc 2008-03-16 20:55:18 +01:00
Mathieu Lacage 1806cbede9 get rid of unneeded object-base include 2008-03-16 20:47:46 +01:00
Mathieu Lacage 3aa9706150 replace TypeId::CreateObject with TypeId::GetConstructor 2008-03-16 19:24:50 +01:00
Mathieu Lacage 939cee7ac3 do not use ObjectBase as a base class. 2008-03-16 18:42:23 +01:00
Gustavo J. A. M. Carneiro 0f79c7d754 Make waf dist much more efficient. 2008-03-16 14:35:32 +00:00
Mathieu Lacage 6a96f3f3ea improve doxygen and add explicit getters/setters 2008-03-15 23:25:13 +01:00
Mathieu Lacage ef0a14d093 make sure that all the Setters can be invoked in any order without memory leak 2008-03-15 23:04:01 +01:00
Mathieu Lacage b66b302a6a add missing accessor construction functions. 2008-03-15 23:03:40 +01:00
Mathieu Lacage b685071f5a release the channel. 2008-03-15 22:27:42 +01:00
Mathieu Lacage 2ea43c9729 avoid double-frees. 2008-03-15 22:27:35 +01:00
Mathieu Lacage eb89e875f7 don't forget to setup propagation delay and loss models on channel. 2008-03-15 19:51:40 +01:00
Mathieu Lacage 7ecce753a6 use the right position attribute name. 2008-03-15 19:38:00 +01:00
Mathieu Lacage 8ab25173a1 more ns3:: prefix fixes. 2008-03-15 19:31:57 +01:00
Mathieu Lacage ac16151d22 need to use ns3:: prefix for TypeId names now. 2008-03-15 19:29:22 +01:00
Gustavo J. A. M. Carneiro b68fa9919b Fix 'deprecated conversion of string literal to char*' warning with GCC 4.2 2008-03-15 16:26:39 +00:00
Gustavo J. A. M. Carneiro 516eb971a3 Generate foo-module.h module aggreator header files, for use in user scripts. 2008-03-15 16:13:18 +00:00
Gustavo J. A. M. Carneiro 22a66ef917 Missing headers.module attribute in the new 'helper' module... 2008-03-15 15:30:37 +00:00
Gustavo J. A. M. Carneiro 9cf6137916 Add a 'module' attribute to the ns3header object specifying which module each set of headers belongs to. 2007-12-26 13:40:39 +00:00
Mathieu Lacage 36995793fb merge with HEAD 2008-03-14 16:37:02 -07:00
Mathieu Lacage 0ddbe50a61 add CopyObject 2008-03-14 16:36:55 -07:00
Raj Bhattacharjea 0d839a85c0 Merge in forking tcp servers 2008-03-14 16:50:37 -04:00
Mathieu Lacage be10286ae5 merge with HEAD 2008-03-13 14:35:54 -07:00
Mathieu Lacage 4163debdfb merge 2008-03-13 14:28:22 -07:00
Mathieu Lacage c4b1bff412 move helpers to their own dir. 2008-03-13 14:24:45 -07:00
Mathieu Lacage 848cb7cfb5 add back support for introspected doxygen. 2008-03-13 12:56:49 -07:00
Gustavo J. A. M. Carneiro 6df47b4d19 OLSR: fix default willingness value, cleanup and fix the MPR computation algorithm. 2008-03-13 19:00:30 +00:00
Raj Bhattacharjea c09319cab9 This callback is supposed to happen later 2008-03-13 14:32:46 -04:00
Raj Bhattacharjea 175518d248 Undo changes to the packet sink to accept incoming connections; change the default behavior of the socket connection request notifier instead 2008-03-13 14:22:26 -04:00
Mathieu Lacage 14ccd72505 rework the Wifi API to not use a single WifiNetDevice::Setup method 2008-03-13 11:21:12 -07:00
Mathieu Lacage fb452286e6 add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes. 2008-03-13 11:10:38 -07:00
Mathieu Lacage aa3db11715 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation. 2008-03-12 11:35:00 -07:00
Mathieu Lacage 250eed3667 Add sufficient information to AttributeChecker to generate nice-looking documentation. 2008-03-12 11:17:16 -07:00
Mathieu Lacage 5a7be54e31 make sure attributes always start with a capital letter. 2008-03-12 10:18:14 -07:00
Mathieu Lacage 4227fc706d fix typo 2008-03-12 10:17:52 -07:00
Mathieu Lacage 3e4aa96665 kill valueref dox macro. 2008-03-12 09:32:02 -07:00
Mathieu Lacage b97dfc9450 fix doxygen errors 2008-03-12 09:31:50 -07:00
Mathieu Lacage 3c32879211 Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect 2008-03-11 13:46:22 -07:00
Mathieu Lacage 5d2044ae93 TraceSourceConnect -> TraceConnect && TraceSourceDisconnect -> TraceDisconnect 2008-03-11 13:34:29 -07:00
Mathieu Lacage b5a8d46096 get rid of CreateObjectWith 2008-03-11 13:30:12 -07:00
Mathieu Lacage 7a1c14372c do not set attributes if they have their default value. 2008-03-11 11:35:26 -07:00
Mathieu Lacage 9cac5c71ee check all errors. 2008-03-11 11:35:03 -07:00
Mathieu Lacage ef8ee7e7ef kill multiple constructors per TypeId 2008-03-11 11:29:21 -07:00
Mathieu Lacage ae62a57f4e dox doc 2008-03-10 14:59:49 -07:00
Mathieu Lacage e3fe5ec788 dox doc 2008-03-10 14:57:04 -07:00
Mathieu Lacage bd1c208097 add missing copyright/license headers 2008-03-10 14:52:08 -07:00
Mathieu Lacage 56c82ac742 dox doc 2008-03-10 14:51:15 -07:00
Mathieu Lacage 321b953877 doxygen doc 2008-03-10 14:05:26 -07:00
Mathieu Lacage 603615d2d0 doxygen doc 2008-03-10 13:09:32 -07:00
Mathieu Lacage a4c5f55812 rename old VALUE leftovers 2008-03-10 00:46:44 +01:00
Mathieu Lacage 517c5e5bfd add missing copyright statements. 2008-03-10 00:38:48 +01:00
Mathieu Lacage 514685e9a6 attribute should be Uinteger, not Integer 2008-03-10 00:32:36 +01:00
Mathieu Lacage 9b1a38aa42 kill dead code. 2008-03-10 00:32:24 +01:00
Mathieu Lacage 9af9500a0c forgot to ensure registration of GridPositionAllocator. 2008-03-10 00:29:41 +01:00
Mathieu Lacage eb4fb0cb5d kill DefaultValue 2008-03-10 00:27:53 +01:00
Mathieu Lacage 415eb2496a handle string input in GlobalValue code. Improve tests. 2008-03-10 00:26:54 +01:00
Mathieu Lacage bb5e793580 rewrite CommandLine to not handle DefaultValues anymore. 2008-03-09 23:43:52 +01:00
Mathieu Lacage fcc2066d01 ensure that device is reported in node. 2008-03-09 23:43:29 +01:00
Mathieu Lacage ad625de65a make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp 2008-03-09 22:55:25 +01:00
Mathieu Lacage 6f26975964 more FailSafe methods 2008-03-09 21:28:27 +01:00
Mathieu Lacage 9a8cbe189f disable mobility visualizer temporarily. 2008-03-09 21:07:35 +01:00
Mathieu Lacage 782dd6d45b add FailSafe versions of setters which could fail. 2008-03-09 21:07:14 +01:00
Mathieu Lacage 5ed6f37ad9 make Disconnect work with trace contexts. 2008-03-07 12:18:34 -08:00
Guillaume Vu-Brugier fceeaca439 store length type field in ethernet packets in network order. 2008-03-07 11:36:33 -08:00
Gustavo J. A. M. Carneiro f46a1041b8 OLSR optimization: avoid doing routing table computation if no local DB changed after receiving a OLSR packet. 2008-03-06 19:14:52 +00:00
Mathieu Lacage 90a26d4d51 another typo in Attribute names. 2008-03-05 00:16:39 +01:00
Mathieu Lacage 90a367e2e1 use the right attribute names 2008-03-04 23:48:18 +01:00
Mathieu Lacage 5273535527 ensure proper initialization 2008-03-04 23:23:37 +01:00
Mathieu Lacage c777a6802f start the OLSR agent 2008-03-03 22:38:26 +01:00
Mathieu Lacage 267b3e487b avoid typeid initialization ordering pb. 2008-03-03 21:52:51 +01:00
Mathieu Lacage 4ca05b7aad initialize properly the max msdu field. 2008-03-03 21:22:05 +01:00
Mathieu Lacage b1d7592e34 initialize properly mtu field. 2008-03-03 21:21:48 +01:00
Mathieu Lacage b6d8a11148 avoid infinite loop. 2008-03-03 21:00:50 +01:00
Mathieu Lacage 8ca8824655 avoid optimized build warning. 2008-03-03 21:00:27 +01:00
Mathieu Lacage 59df24f63f do not use DefaultValues in simulator 2008-03-03 20:47:12 +01:00
Mathieu Lacage 81b8f0f159 kill DataRateDefaultValue 2008-03-03 20:01:24 +01:00
Mathieu Lacage e4a7b6e868 revert to previous behavior: windowSize is initialized by default to 0xffff 2008-03-03 19:57:56 +01:00
Mathieu Lacage 773b4d80a5 get rid of DefaultValue usage in internet-node 2008-03-03 19:38:05 +01:00
Mathieu Lacage b14aab2fe4 give Attribute power to ObjectFactory class. 2008-03-03 19:33:28 +01:00
Mathieu Lacage a02c29d25b remove from build removed files 2008-03-03 19:01:25 +01:00
Mathieu Lacage ec5c7742d9 kill usage of default-value.h 2008-03-03 18:49:21 +01:00
Mathieu Lacage 6916fd5c3b kill dead code 2008-03-03 18:48:10 +01:00
Mathieu Lacage 06e1a61fab make pac, phy, et al available through Attributes 2008-03-03 18:31:07 +01:00
Mathieu Lacage 93f5de21b1 typo is code unused until then. 2008-03-03 18:30:48 +01:00
Mathieu Lacage 8350d5d0af port propagation models and channel to attributes. 2008-03-03 18:30:29 +01:00
Gustavo J. A. M. Carneiro 0fa7cbe6a3 Small OLSR memory optimisation. 2008-03-03 15:02:33 +00:00
Mathieu Lacage 45d5f42ca3 kill dead files. 2008-03-03 05:11:11 +01:00
Mathieu Lacage f15c11d440 remove unused code 2008-03-03 05:10:49 +01:00
Mathieu Lacage 20d6fdf375 more renamed files 2008-03-03 05:10:12 +01:00
Mathieu Lacage c3d5b77c96 renamed files 2008-03-03 04:42:16 +01:00
Mathieu Lacage 9b37416720 port last rate control algorithms 2008-03-03 04:03:39 +01:00
Mathieu Lacage 163c32fc28 kill old code. 2008-03-03 02:07:40 +01:00
Mathieu Lacage a786828ddf kill TraceResolver et al. 2008-03-03 01:58:57 +01:00
Mathieu Lacage 23bfe3fe09 remove old trace system 2008-03-02 22:53:11 +01:00
Mathieu Lacage 732c7f1d0b use Config-based trace system 2008-03-02 22:52:55 +01:00
Mathieu Lacage ce83863f87 convert to new trace system 2008-03-02 22:52:21 +01:00
Mathieu Lacage 713c893939 get rid of uneeded TraceResolver 2008-03-02 22:34:27 +01:00
Mathieu Lacage 7951713874 be consistant in how lists of objects are named. 2008-03-02 22:34:09 +01:00
Mathieu Lacage 42c7a8c6ab port pcap trace to Config. 2008-03-02 22:33:44 +01:00
Mathieu Lacage 99f4928d7c port AsciiTrace to Config::ConnectWithContext 2008-03-02 22:08:17 +01:00
Mathieu Lacage 356b89e672 re-implement tracing using Attributes. 2008-03-02 21:57:51 +01:00
Mathieu Lacage 7b79b4cdef do not use Queue::CreateDefault 2008-03-02 21:57:28 +01:00
Mathieu Lacage db4e999d61 register and unregister the NodeList as a config root namespace 2008-03-02 21:12:21 +01:00
Mathieu Lacage 346b857c6c implement context-based trace connection 2008-03-02 21:00:37 +01:00
Mathieu Lacage 936b124ff7 avoid memory leaks 2008-03-02 06:43:12 +01:00
Mathieu Lacage ed22af820c ensure that Dispose is invoked at one point. 2008-03-02 06:32:03 +01:00
Mathieu Lacage a5e8bdf451 avoid crashing AP wifi sample 2008-03-02 01:53:26 +01:00
Mathieu Lacage 8b2caa1a2a give Attribute powers to ssid 2008-03-02 01:53:06 +01:00
Mathieu Lacage c43e0ecb14 make sure the default behavior does not crash. 2008-03-02 01:18:07 +01:00
Mathieu Lacage 4c40782b30 add missing include 2008-03-02 01:17:37 +01:00
Mathieu Lacage 5c83be026b port wifi model to Attributes 2008-03-01 21:21:53 +01:00
Mathieu Lacage 0a3b46fdf5 improve debugging output. 2008-03-01 20:41:08 +01:00
Mathieu Lacage af58f11739 report attribute setting errors as early as possible. 2008-03-01 20:20:14 +01:00
Mathieu Lacage 58d05259cb add some debugging output 2008-03-01 19:55:16 +01:00
Mathieu Lacage 662bf63f87 introduce AttributeChecker::Create and use it instead of AttributeValue::Copy. 2008-03-01 19:54:48 +01:00
Mathieu Lacage 947e86f4fa add default constructor 2008-03-01 05:42:14 +01:00
Mathieu Lacage a0f5714f8a add ListPositionAllocator 2008-03-01 05:41:17 +01:00
Mathieu Lacage b7ab54776d setup a working behavior by default 2008-03-01 05:40:57 +01:00
Mathieu Lacage 4a1cb62fce add extra NodeContainer constructors 2008-03-01 05:40:06 +01:00
Mathieu Lacage bf1aad6a7d add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE 2008-03-01 05:39:25 +01:00
Mathieu Lacage 93ee85a925 output correct information about non-matching types. 2008-03-01 05:37:56 +01:00
Mathieu Lacage 69a95852ba typos in untested code path. 2008-02-29 17:27:14 +01:00
Mathieu Lacage 8e4605294a avoid macro namespace polution. 2008-02-29 00:45:02 +01:00
Mathieu Lacage 289cf2170e merge with HEAD 2008-02-28 18:15:07 +01:00
Mathieu Lacage 8f6d84e669 Use a temporary to avoid confusing the compiler. 2008-02-28 08:59:35 -08:00
Mathieu Lacage 21466b9afe Copy is not needed anymore. 2008-02-28 08:59:06 -08:00
Mathieu Lacage de39c3b77a convert WifiMacParameters to Attributes. 2008-02-28 07:17:53 +01:00
Mathieu Lacage 374362b25c small typo 2008-02-28 06:18:39 +01:00
Mathieu Lacage 7965ccd65c MacParameters -> WifiMacParameters 2008-02-28 06:18:02 +01:00
Mathieu Lacage 893a2d0859 do not use anonymous namespace in header 2008-02-27 20:39:06 -08:00
Mathieu Lacage fea84ff0f2 add example for trace connect/disconnection with trace paths 2008-02-28 04:28:34 +01:00
Mathieu Lacage e06e3096cb merge with HEAD 2008-02-27 22:19:39 +01:00
Mathieu Lacage 0c586271e5 introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes 2008-02-27 21:41:34 +01:00
Mathieu Lacage 1d4187bd0f add missing NS_OBJECT_ENSURE_REGISTERED calls. 2008-02-27 20:48:43 +01:00
Mathieu Lacage fe07d43e5d convert CsmaNetDevice to Attributes. 2008-02-27 20:23:57 +01:00
Mathieu Lacage 9e40bb3bfd fix optimized build 2008-02-27 19:51:34 +01:00
Mathieu Lacage 4704c9d427 convert InternetNode to Attributes. 2008-02-27 19:44:22 +01:00
Mathieu Lacage 49087105ad do not use operator []. Use iterators instead to work with std::list. 2008-02-27 19:36:03 +01:00
Mathieu Lacage dd0ae959fe re-organize the code to avoid link-time errors due to duplicate symbols. 2008-02-27 19:35:37 +01:00
Mathieu Lacage 8f8639aa7a fix compilation bug on osx 2008-02-27 17:39:32 +01:00
Mathieu Lacage e5e35f6545 port Applications to Attributes 2008-02-27 00:05:23 +01:00
Mathieu Lacage 1ae525bf0e use names closer to those used in the previous DefaultValues. 2008-02-26 23:27:19 +01:00
Mathieu Lacage fb2f498e54 make Ipv4Address/Ipv4Mask attributes 2008-02-26 23:26:59 +01:00
Mathieu Lacage cf2466f185 typo. 2008-02-26 22:41:25 +01:00
Mathieu Lacage 5ea4a79c06 forgot to uncomment code. 2008-02-26 22:41:02 +01:00
Mathieu Lacage ed32045dc6 do not use the private constructor to avoid overload resolution confusions. 2008-02-26 22:40:20 +01:00
Mathieu Lacage 1fe93d4e86 add an extra overload of SetTypeId to avoid overload resolution confusions. 2008-02-26 22:39:57 +01:00
Mathieu Lacage e933b3091d add extra checker construction function 2008-02-26 20:23:47 +01:00
Mathieu Lacage 0a8fd09acf add extra checker construction function 2008-02-26 20:23:43 +01:00
Mathieu Lacage 200a9c69ff add extra checker construction function 2008-02-26 20:22:13 +01:00
Mathieu Lacage bfc21a4e47 port Olsr code to attributes/helpers 2008-02-26 19:52:17 +01:00
Mathieu Lacage 276147ac65 add templated version of ObjectFactory::Create 2008-02-26 19:51:58 +01:00
Mathieu Lacage 9094ef8b1b EventTraceSource -> TracedCallback, ValueTraceSource -> TracedValue. 2008-02-26 19:51:33 +01:00
Mathieu Lacage b4ca4f9cf3 use Attributes in ErrorModel. 2008-02-26 18:33:10 +01:00
Mathieu Lacage a5c397f21b convert NodeList to Attributes. 2008-02-26 18:17:29 +01:00
Mathieu Lacage d5221dcfe4 fix tests 2008-02-26 18:17:10 +01:00
Mathieu Lacage 847f7587ff application and netdevice lists are attributes now. 2008-02-26 18:03:59 +01:00
Mathieu Lacage 061f5a8426 export public header 2008-02-26 18:03:44 +01:00
Mathieu Lacage 6a2d2601fc Release all events left upon Simulator::Destroy 2008-02-26 01:39:59 +01:00
Federico Maguolo 0d49574056 Sync event must be properly canceled upon tx during sync. 2008-02-26 01:23:27 +01:00
Federico Maguolo 10d2a5b770 Use the physical rate where needed. 2008-02-26 01:22:44 +01:00
Mathieu Lacage 9b0290012f merge 2008-02-26 01:09:16 +01:00
Mathieu Lacage 9db1cd07e3 merge 2008-02-26 01:08:58 +01:00
Mathieu Lacage 5b36ba86ad A Config class which hooks into the Object Attribute/Tracing system. 2008-02-26 01:07:16 +01:00
Raj Bhattacharjea f38dfb4e28 Fix memory leaks in PendingData class by returning Ptr<Packet> instead of PendingData* where appropriate 2008-02-25 17:06:18 -05:00
Mathieu Lacage 38d882d889 add a base arg to MakeSimpleAttributeChecker 2008-02-25 22:08:56 +01:00
Mathieu Lacage 4e598bde94 do not attempt to access the AttributeList as a fallback from GlobalValue. 2008-02-25 22:07:19 +01:00
Mathieu Lacage 702a31b06e add a few public methods for the Config code 2008-02-25 22:06:14 +01:00
Raj Bhattacharjea b5664b575d Move TcpSocket::m_retxEvent.Cancel to TcpSocket::Destroy; undoes d4217d7ba4ba 2008-02-25 15:28:03 -05:00
Kulin Shah 0ffaf38602 Fix to make the TCP SYN retransmission do a binary exponential backoff 2008-02-25 14:40:25 -05:00
Mathieu Lacage 2eae2f926c make NetDevice fully virtual. 2008-02-25 19:33:46 +01:00
Mathieu Lacage 96b47442ea test the ValueTraceSource with an arbitrary class. 2008-02-24 20:18:02 +01:00
Mathieu Lacage 93ae3cea51 replace IntegerTraceSource with ValueTraceSource 2008-02-24 20:04:31 +01:00
Mathieu Lacage 6895e23eca InitialValue -> GlobalValue 2008-02-23 05:23:59 +01:00
Federico Maguolo b744916fb8 RRAA implementation. 2008-02-22 23:45:25 +01:00
Mathieu Lacage 0febad916b Hook trace sources into the trace system. Add WifiTrace to give a 'simple' API to tracing wifi-specific sources. 2008-02-22 23:34:53 +01:00
Federico Maguolo 7b44a35460 allow rate control algorithms to control more per-packet parameters. 2008-02-22 23:28:01 +01:00
Federico Maguolo 5e08c5cb5b the NAV should be updated only when the packet is _not_ addressed to us. (see section 9.2.5.4) 2008-02-22 23:16:51 +01:00
Mathieu Lacage c4238a2fb7 make EventTraceSource acceptable to the MakeTraceSourceAccessor function 2008-02-22 00:22:16 +01:00
Mathieu Lacage 2aa6ff8d7d invoke getters on tid temp variable to allow proper iteration over tid list. 2008-02-22 00:12:47 +01:00
Mathieu Lacage 6d05a9e061 get rid of useless accessor maker 2008-02-22 00:11:20 +01:00
Mathieu Lacage f8ca997175 actually allow connection and disconnection to trace sources registered in TypeIds 2008-02-22 00:08:00 +01:00
Mathieu Lacage 377f70de36 add an IntegerTraceSource which behaves just like an Integer. 2008-02-21 23:15:00 +01:00
Mathieu Lacage 0dbeed4691 remove accessor BASE arg to MakeAccessorHelper 2008-02-21 21:57:38 +01:00
Mathieu Lacage ca3a3794bf Object::Set/Get -> Object::SetAttribute/GetAttribute 2008-02-21 19:46:39 +01:00
Mathieu Lacage 1bcb523456 Attributes -> AttributeList 2008-02-21 19:31:17 +01:00
Mathieu Lacage 68a81eed0b AddParameter -> AddAttribute 2008-02-21 19:28:41 +01:00
Mathieu Lacage f9538ea708 enum-value -> enum 2008-02-21 19:16:00 +01:00
Mathieu Lacage 03cc15ebdd fp-value -> double 2008-02-21 19:13:39 +01:00
Mathieu Lacage 37b0481304 uint-value -> uinteger 2008-02-21 19:09:05 +01:00
Mathieu Lacage c1d4c1d4c5 int-value -> integer 2008-02-21 19:04:18 +01:00
Mathieu Lacage a7f4957c02 small typo 2008-02-21 18:58:08 +01:00
Mathieu Lacage e039942a02 boolean-value -> boolean 2008-02-21 18:57:34 +01:00
Mathieu Lacage 1706273d74 value-helper.h -> attribute-helper.h 2008-02-21 18:54:02 +01:00
Mathieu Lacage 23d972d9dd value-test.cc -> attribute-test.cc 2008-02-21 18:46:48 +01:00
Mathieu Lacage 3b50a66d0b param-spec-helper.h -> attribute-accessor-helper.h 2008-02-21 18:44:27 +01:00
Mathieu Lacage 969a41048d remove old helpers 2008-02-21 18:35:55 +01:00
Mathieu Lacage 5fc7981de6 convert to new helpers 2008-02-21 18:35:44 +01:00
Mathieu Lacage d041abd435 fix includes 2008-02-21 18:35:34 +01:00
Mathieu Lacage 9a0f0f438f convert RandomVariable to new helpers. 2008-02-21 18:28:05 +01:00
Mathieu Lacage baca67f7a3 fpValue -> Double 2008-02-21 00:54:05 +01:00
Mathieu Lacage cb069a418f indent align 2008-02-21 00:28:22 +01:00
Mathieu Lacage ae4e6226cf small typo: use the Value type for simple checking. 2008-02-21 00:19:43 +01:00
Mathieu Lacage fda20b8236 BooleanValue -> Boolean 2008-02-21 00:19:31 +01:00
Mathieu Lacage c5dc486e2c EnumValue -> Value 2008-02-21 00:00:18 +01:00
Mathieu Lacage 144e84154b UintValue -> Uinteger, IntValue -> Integer 2008-02-21 00:09:16 +01:00
Mathieu Lacage 5de083e234 value.h -> attribute.h 2008-02-20 21:45:42 +01:00
Mathieu Lacage e4529f9217 Value -> AttributeValue 2008-02-20 21:17:34 +01:00
Mathieu Lacage b511f31d39 Accessor -> AttributeAccessor 2008-02-20 20:57:59 +01:00
Raj Bhattacharjea 4d6e41a185 fix rtt::copy's signature 2008-02-20 14:26:42 -05:00
Raj Bhattacharjea 73740bdbc6 undoes 2326:eec07777d1a2 because localInterface is no longer needed (see bug 136) 2008-03-12 16:05:31 -04:00
Raj Bhattacharjea b30c9ee4b3 Cleanup of ipv4endpointdemux and tcpl4protocol 2008-03-12 15:33:11 -04:00
Raj Bhattacharjea 386b63ceb9 Fixes to tcp and to the ipv4endpointdemux to allow forking to work correctly 2008-03-12 14:52:29 -04:00
Raj Bhattacharjea ebbea8ae40 First cut at making the socket clone 2008-03-12 11:55:08 -04:00
Mathieu Lacage ad7d70ae34 ParamSpec -> Accessor 2008-02-20 20:24:52 +01:00
Mathieu Lacage c182f4d479 use helpr macro where needed. 2008-02-20 19:58:46 +01:00
Mathieu Lacage 6353d911c0 PValue -> Attribute 2008-02-20 19:57:31 +01:00
Mathieu Lacage 8c4ce99b89 add extra StopAt call to ensure that the simulation ends at some point. 2008-02-20 19:40:36 +01:00
Mathieu Lacage 6c34a2f48e PARAM -> ATTR 2008-02-20 19:33:59 +01:00
Mathieu Lacage f95a872d12 add missing include. 2008-02-20 19:30:12 +01:00
Tom Henderson 95c59da336 Update NS_LOG documentation 2008-02-19 21:33:08 -08:00
Gustavo J. A. M. Carneiro 78a151d337 Fix the WAF --run option for running a program with command line options 2008-02-19 21:43:28 +00:00
Mathieu Lacage cccdb1f6d6 small tweaking 2008-02-18 05:53:51 +01:00
Mathieu Lacage 4dce1b28b8 InitialValue support 2008-02-18 03:01:52 +01:00
Mathieu Lacage 8bac0c2ba3 move checker creation function to .cc file. 2008-02-18 03:01:42 +01:00
Mathieu Lacage c194579f5e split checker from ParamSpec. 2008-02-18 00:18:45 +01:00
Gustavo J. A. M. Carneiro 2a3e635cd1 Fix a typo in the WAF scripts; don't access m_linktask directly, use the get_target_name() method instead (to make it work with waf trunk). 2008-02-17 14:02:45 +00:00
Mathieu Lacage 82c3fa3aaa merge 2008-02-17 04:38:52 +01:00
Mathieu Lacage 2830225b2c Backed out changeset 7b145012b2eb 2008-02-17 04:38:41 +01:00
Mathieu Lacage cf9ed2855f split initial value from ParamSpec. 2008-02-17 04:38:34 +01:00
Mathieu Lacage b4edd36ec5 get rid of ParamSpec::CreateValue. 2008-02-17 00:46:24 +01:00
Tom Henderson 49d1a39d16 a few tweaks to the release steps document 2008-02-16 13:24:08 -08:00
Tom Henderson 23a8d8bf1b Added tag release-3.0.11 for changeset ee5e1da76ecc 2008-02-16 12:01:48 -08:00
Tom Henderson 1e70c7ac38 add Joe Kopena to AUTHORS list 2008-02-16 11:51:58 -08:00
Tom Henderson bf0d4e7154 avoid infinite recursion in Tcp callback (bug 131) 2008-02-15 19:54:34 -08:00
Mathieu Lacage e8fc6ec946 fix doxygen. 2008-02-15 20:53:07 +01:00
Mathieu Lacage be2b52ac8f update version number 2008-02-15 20:37:34 +01:00
Mathieu Lacage 7bb06e0661 initial release notes 2008-02-15 20:37:19 +01:00
Mathieu Lacage b56cad3cbc bug 133: automate RandomVariable memory management. 2008-02-15 20:03:48 +01:00
Mathieu Lacage 5bec43f720 fix bug 137: Make Ipv4Address (uint32_t) constructor explicit. patch by Gustavo. 2008-02-15 19:14:35 +01:00
Mathieu Lacage 25bb76ce20 macro-ify 2008-02-15 05:38:29 +01:00
Mathieu Lacage e94efb4a11 get rid of Value::ConvertFrom method. 2008-02-15 03:52:56 +01:00
Mathieu Lacage de438d035b helper getters and setters for c++ native types. 2008-02-15 02:08:55 +01:00
Mathieu Lacage 88c9b123ee add node/device containers to build 2008-02-14 23:57:18 +01:00
Mathieu Lacage 2c234e63e7 an initial draft of helper classes. don't work yet. 2008-02-14 23:56:54 +01:00
Mathieu Lacage bd94258500 add device/node containers for helper API. 2008-02-14 23:56:21 +01:00
Gustavo J. A. M. Carneiro ee5f2a5475 Make the OLSR routing protocol priority higher, not lower, than static routing.
The reason for this change is related to the fact that sockets now send
broadcast (255.255.255.255) packets as subnetwork directed broadcasts.  With
wireless OLSR nodes with only a single interface, in order for OLSR to hear
each other's broadcasts they all need to be in the same network.  On the other
hand, if the nodes are all in the same network then the static routing module
will mistakenly believe it has direct conectivity to all other nodes, thereby
bypassing OLSR completely.
2008-02-14 19:01:01 +00:00
Gustavo J. A. M. Carneiro 2806d0edbe Add support for tracing the OLSR routing table size. 2008-02-14 18:55:11 +00:00
Mathieu Lacage c51821715f convert DropTailQueue to parameters 2008-02-14 19:47:19 +01:00
Gustavo J. A. M. Carneiro 85cbeccd3e Check for malformed trace paths that do not start with '/'. 2008-02-14 18:15:26 +00:00
Gustavo J. A. M. Carneiro 147510bb00 Make Packet::RemoveTag behave as documented (bug #139) 2008-02-14 17:48:15 +00:00
Mathieu Lacage 450ca7325d replace ambiguous constructor with separate construction function. 2008-02-14 01:08:45 +01:00
Mathieu Lacage 3f5fa2d889 fix an old typo. 2008-02-14 00:43:46 +01:00
Mathieu Lacage 2e4860e39e add Value support to Address 2008-02-14 00:36:39 +01:00
Mathieu Lacage 392c7581eb add Value support to DataRate 2008-02-14 00:36:25 +01:00
Mathieu Lacage 81f0d2464c add Value support to Mac48Address 2008-02-14 00:36:14 +01:00
Mathieu Lacage 58a93485de introduce top-level ParamSpec for bindings. 2008-02-13 23:37:46 +01:00
Mathieu Lacage 23c4395731 convert RandomVariable, Rectangle, Vector, and Time to the new Class Helper 2008-02-13 22:39:17 +01:00
Mathieu Lacage 0a20822e64 rework param-spec-helper code to avoid having to deal with pointers to member functions et al. 2008-02-13 21:00:33 +01:00
Raj Bhattacharjea cdc9002e41 Fix TCP server socket connection notification (part of bug 132) 2008-02-13 09:55:15 -05:00
Gustavo J. A. M. Carneiro f8ae534480 A couple more OLSR bug fixes 2008-02-13 18:23:20 +00:00
Gustavo J. A. M. Carneiro c6f3793178 OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now. 2008-02-13 17:44:05 +00:00
Gustavo J. A. M. Carneiro 96451fdb37 Make the OLSR example a bit more complete, adding a 5th node, to exercise 3-hop routing. 2008-02-13 17:42:08 +00:00
Gustavo J. A. M. Carneiro feb47b3bb1 Fix broadcast packet reception for locally bound sockets (bug #136) 2008-02-13 17:37:43 +00:00
Gustavo J. A. M. Carneiro 4f02439cb1 Add the IPv4 header before deciding whether to drop packets. Closes bug #135. 2008-02-11 14:46:44 +00:00
Mathieu Lacage b0e8f9ff56 add XXX markers. 2008-02-11 05:11:55 +01:00
Mathieu Lacage 74a7f5d065 add big warning 2008-02-11 05:11:45 +01:00
Mathieu Lacage 8cc988f172 add ObjectVector value support. 2008-02-11 04:26:09 +01:00
Gustavo J. A. M. Carneiro a14e1de6cc The message "Unable to determine outbound interface. No default route set"
should not be fatal; just return false instead.
2008-02-10 22:34:04 +00:00
Gustavo J. A. M. Carneiro a30e3a7e94 Upgrade WAF to version 1.3.2 2008-02-10 13:19:07 +00:00
Gustavo J. A. M. Carneiro 450f9db5c6 RandomWalk2dMobilityModel changed name to RandomWalkMobilityModel (typo or intentional?) 2008-02-10 11:51:53 +00:00
Gustavo J. A. M. Carneiro eca7dc5b27 Make sequence-number.h a public header file (because it is included by another public header, tcp-header.h) 2008-02-09 18:37:58 +00:00
Mathieu Lacage e51df22a48 kill non-existant method 2008-02-09 02:35:38 +01:00
Mathieu Lacage fa3b613148 report more get/set errors 2008-02-09 02:28:21 +01:00
Mathieu Lacage d4a6b3ab85 merge with HEAD 2008-02-08 18:24:35 +01:00
Mathieu Lacage c295b15d7e add hierarchical support to MobilityHelper 2008-02-08 17:52:20 +01:00
Mathieu Lacage cf48df0f49 rework slightly ns2 mobility support 2008-02-08 17:27:38 +01:00
Mathieu Lacage 16a94230d2 convert Mobility subsystem to Value framework 2008-02-08 04:11:48 +01:00
Mathieu Lacage d226ebb036 fix typo: non-matching delaration/implementation 2008-02-08 04:11:29 +01:00
Mathieu Lacage 2c658704eb add automatic conversion from string to PValue. 2008-02-08 04:11:08 +01:00
Mathieu Lacage ea1eacc952 implement missing methods 2008-02-08 02:22:36 +01:00
Mathieu Lacage 161ff1c6b0 a pretty simple wrapper around TypeId+Parameters: ObjectFactory 2008-02-08 02:22:04 +01:00
Mathieu Lacage eec4df655d add a default constructor for the TypeId class 2008-02-08 02:21:23 +01:00
Mathieu Lacage bd0ca7917a untested templates rarely work. 2008-02-08 00:53:40 +01:00
Mathieu Lacage 5af34cc0da add missing Make functions 2008-02-08 00:53:16 +01:00
Mathieu Lacage 69f491c008 fix Value support 2008-02-08 00:52:57 +01:00
Mathieu Lacage 1f848288d8 add Value support to Time 2008-02-08 00:52:32 +01:00
Mathieu Lacage 9cd8e34252 make headers public. 2008-02-07 23:57:07 +01:00
Mathieu Lacage 5137b37f86 add Value support to Rectangle 2008-02-07 23:56:03 +01:00
Mathieu Lacage 16086b3349 add Value support to Vector 2008-02-07 23:55:43 +01:00
Mathieu Lacage 153e0f6d48 make param-spec-helper.h public 2008-02-07 23:55:23 +01:00
Mathieu Lacage f44a019aed add back FpValue support 2008-02-07 23:23:33 +01:00
Mathieu Lacage f826fbc2d9 add Value support to RandomVariable. 2008-02-07 22:40:46 +01:00
Mathieu Lacage f03f1c237b bug 133: automate RandomVariable memory management. 2008-02-07 19:57:21 +01:00
Craig Dowell b4c23f8ebf branch merge 2008-02-06 10:03:46 -08:00
Craig Dowell dd8985b92d further ns-3-obj changes 2008-02-06 10:03:09 -08:00
Mathieu Lacage bf9d59fe21 enforce TypeId::PARAM_* flags 2008-02-06 18:31:15 +01:00
Gustavo J. A. M. Carneiro 9fcd20505c Move TcpSocket's m_retxEvent.Cancel() to ~TcpSocket(), so that it is executed by all possible code paths leading up to a TcpSocket deallocation. 2008-02-06 17:11:56 +00:00
Raj Bhattacharjea a142d30a9d Merge 2008-02-05 15:30:16 -05:00
Raj Bhattacharjea c3658bd810 Slight refactor of TCP code so two way connections don't bug out 2008-02-05 15:29:17 -05:00
Raj Bhattacharjea 6e7d9062cb Patch for bug 130 from Gustavo 2008-02-05 09:54:32 -05:00
Tom Henderson a6438d91b4 some more edits to the front part of the tutorial 2008-02-04 23:09:07 -08:00
Craig Dowell d2d16360c1 fix instances of stale names 2008-02-04 19:17:45 -08:00
Craig Dowell 3b277785c0 object model section of tutorial needed to be rewritten due to ns-3-object changes. 2008-02-04 19:04:01 -08:00
Mathieu Lacage c94bc0c5c8 add back EnumValue 2008-02-04 23:13:54 +01:00
Mathieu Lacage b1495e485e split ParamSpec::CreateInitialValue -> ParamSpec::GetInitialValue + ParamSpec::CreateValue 2008-02-04 22:48:26 +01:00
Mathieu Lacage 6d6ba0c668 forgot to add new files 2008-02-04 22:47:26 +01:00
Mathieu Lacage 0bc09d7d86 add back UintValue 2008-02-04 22:32:21 +01:00
Mathieu Lacage 563f2e3594 remove un-needed object.h include. 2008-02-04 22:32:13 +01:00
Mathieu Lacage 6ba83d0891 weird leftover from the ClassId changes. 2008-02-04 22:19:20 +01:00
Mathieu Lacage f21962defc add back IntValue support 2008-02-04 22:18:07 +01:00
Craig Dowell c3719a2eca tutorial now agrees with ns3-object changes 2008-02-04 12:56:08 -08:00
Craig Dowell 3b58cf8c0e half of example describing how to plumb in new model without plumbing 2008-02-04 12:27:18 -08:00
Tom Henderson b390f1ef73 Further alignment of simple-point-to-point.cc with ns-2/simple.tcl (add TCP) 2008-02-03 14:34:10 -08:00
Gustavo J. A. M. Carneiro 02fd903228 OLSR: remove the 'Link tuple has no corresponding neighbor tuple' assertion; it happens now because MID messages may occasionally not arrive in time, but it's normal. 2008-02-03 19:09:35 +00:00
Gustavo J. A. M. Carneiro 52ca0dd3f6 merge 2008-02-03 19:05:37 +00:00
Gustavo J. A. M. Carneiro 6a874b283c OLSR: get main address of the peer from the UDP source address and the 'interface association' table; this way the UDP source address need not be the same as the main address. 2008-02-03 18:50:55 +00:00
Gustavo J. A. M. Carneiro fd238f3e40 Backed out changeset 055ff23aa034 (Tom does not like it turns out OLSR does not need it) 2008-02-03 18:29:25 +00:00
Tom Henderson 438036550f Fix tutorial TOC 2008-02-02 20:46:04 -08:00
Tom Henderson a0e14bd523 formatting cleanup 2008-02-02 15:52:54 -08:00
Tom Henderson c8a76b7dd5 typos and formatting of Introduction section 2008-02-01 21:31:15 -08:00
Gustavo J. A. M. Carneiro c86c3ce16d UDP sockets are fixed, remove the hack and note. 2008-02-01 19:37:27 +00:00
Gustavo J. A. M. Carneiro dd48772c9e Fix UDP source address, make it honor Bind(). 2008-02-01 19:29:56 +00:00
Gustavo J. A. M. Carneiro 53833582b7 Some more udp socket debug messages 2008-02-01 18:40:14 +00:00
Gustavo J. A. M. Carneiro f262b76a41 Put back the simulation time in 30 seconds, else we generate huge trace files. 2008-02-01 18:39:37 +00:00
Gustavo J. A. M. Carneiro 441e17174d Add more debug info to olsr routing table 2008-02-01 18:24:39 +00:00
Gustavo J. A. M. Carneiro defd58bc77 In OLSR agent, work around newly introduced bug in UDP sockets prenting Bind from working as e.g. Linux. Add note explaining what's wrong. 2008-02-01 18:07:45 +00:00
Gustavo J. A. M. Carneiro 38f2897c29 Fix OLSR example: don't add static routes, increase simulation time to 300 seconds. 2008-02-01 17:17:24 +00:00
Gustavo J. A. M. Carneiro d9d019c5d4 Unbreak ParameterLogger 2008-02-01 15:16:44 +00:00
Gustavo J. A. M. Carneiro f23152d7a7 Start the Olsr agent (accidentally removed during last code refactoring) 2008-02-01 14:05:59 +00:00
Mathieu Lacage d625837eb9 merge with HEAD 2008-02-01 08:50:03 +01:00
Mathieu Lacage cecd35e20b AddInterface -> AggregateObject 2008-01-31 22:23:46 +01:00
Mathieu Lacage 5ade799440 QueryInterface -> GetObject 2008-01-31 22:11:03 +01:00
Mathieu Lacage 2786b195ee merge with HEAD again 2008-01-31 21:58:13 +01:00
Mathieu Lacage ad6f51646d make Ptr<T> convertible to a Value. 2008-01-31 15:10:21 +01:00
Mathieu Lacage 328190ca63 get rid of very long constructor 2008-01-30 19:13:21 +01:00
Mathieu Lacage 5b5649de74 attempt to perform correctly automatic conversions. 2008-01-30 19:13:06 +01:00
Mathieu Lacage 78003d863a initial work on Value code 2008-01-30 17:28:18 +01:00
Mathieu Lacage 71c635dedc introduce ObjectBase 2008-01-30 17:25:06 +01:00
Mathieu Lacage 5f5518e05b merge with HEAD 2008-01-30 17:20:55 +01:00
Mathieu Lacage bd33305e5b remove dependency on Callbacks from Ptr test code 2008-01-30 15:33:48 +01:00
Tom Henderson aa8bd8a8ba some more tutorial updates 2008-01-27 10:58:22 -08:00
Tom Henderson 84cdad7f7d fix optimized build 2008-01-26 06:01:45 -08:00
Tom Henderson 3c38ca5a1b Fix uninitialized member 2008-01-25 15:41:47 -08:00
Tom Henderson ffaf3e7d91 Merge TCP implementation (raj/ns-3-tcp) 2008-01-25 15:21:40 -08:00
Tom Henderson a81a6fc0ec Add chapter on callbacks to the tutorial 2008-01-25 11:58:17 -08:00
Raj Bhattacharjea 6c3559792c Added in ns-3-tcp (second try) 2008-01-25 13:57:38 -05:00
Tom Henderson 6292ead1f7 add hyperlinks to wiki, Doxygen 2008-01-19 21:03:18 -08:00
Tom Henderson 9a15ceadf6 Split tutorial.texi into multiple files; some work on the tracing section 2008-01-19 20:58:01 -08:00
Mathieu Lacage f61e9a9941 interface-id -> type-id 2008-01-16 10:27:07 +01:00
Craig Dowell 21a113f38f Added tag release ns-3.0.10 for changeset b5bf2588cde2 2008-01-15 16:01:26 -08:00
Craig Dowell 4f3bd6f9dd bump version and add release notes 2008-01-15 15:43:00 -08:00
Gustavo J. A. M. Carneiro d2c80f4d1a Print the correct type in the callback assign error message (instead of Ptr<const CallbackImplBase>) 2008-01-15 15:14:24 +00:00
Mathieu Lacage 2949d86908 add an extra link to the PHY model paper 2008-01-15 13:29:41 +01:00
Mathieu Lacage 0fcbdbf0fe fix doxygen warnings 2008-01-15 13:27:45 +01:00
Mathieu Lacage 1dc22a9e8f merge with head 2008-01-15 12:58:27 +01:00
Mathieu Lacage 5c769d2d24 iid -> tid 2008-01-15 12:44:09 +01:00
Mathieu Lacage a2e63b7f0b iid (void) -> GetTypeId (void) 2008-01-15 12:43:07 +01:00
Mathieu Lacage 44c33f1618 InterfaceId -> TypeId 2008-01-15 12:36:22 +01:00
Mathieu Lacage 4730d7087f merge with HEAD 2008-01-15 12:07:31 +01:00
Tom Henderson 3b31a0234e Doxygen organization 2008-01-10 07:31:40 -08:00
Tom Henderson cac5b2ca97 Missing subsection text 2008-01-11 08:31:38 -08:00
Tom Henderson 3b08f13bf3 remove executable bit from file mode 2008-01-09 22:17:02 -08:00
Tom Henderson e51bb180d4 Fix bug 125 (make helper function non-virtual) 2008-01-09 22:09:21 -08:00
Gustavo J. A. M. Carneiro 4e97b6b47c Document the iid parameter of OnOffApplication. 2008-01-08 17:45:57 +00:00
Gustavo J. A. M. Carneiro ed6ee71ded Don't print 'Entering directory xxx' when running waf --shell; it is misleading. 2008-01-08 14:06:49 +00:00
Craig Dowell 6c69295696 fix node and up 2008-01-07 16:48:53 -08:00
Craig Dowell fb72939392 figures 2008-01-07 16:29:54 -08:00
Craig Dowell b61692f121 interfaces 2008-01-07 16:03:32 -08:00
Mathieu Lacage 9ff2549315 copy the packet before sending it down or up 2008-01-07 18:20:18 +01:00
Gustavo J. A. M. Carneiro 3a4eb97315 Add a --valgrind WAF option (bug #124) 2008-01-03 14:14:17 +00:00
Mathieu Lacage 4f58be6548 replace ComponentManager::Create and ClassId with InterfaceId::CreateObjest and InterfaceId 2008-01-03 11:39:45 +01:00
Mathieu Lacage 33bd62d32f typo 2008-01-03 11:37:23 +01:00
Mathieu Lacage c547c88e89 use NS_OBJECT_ENSURE_REGISTERED and fix off-by-one in IidManager::GetRegistered 2008-01-03 11:37:09 +01:00
Mathieu Lacage 2a4dcce444 add NS_OBJECT_ENSURE_REGISTERED 2008-01-03 11:30:02 +01:00
Mathieu Lacage b41d008223 go to the next element in search loop 2008-01-03 11:29:35 +01:00
Mathieu Lacage a144ad9a1e work around weird compiler warning/error. 2008-01-03 10:37:50 +01:00
Mathieu Lacage 93be0562cc check constructor with reference arguments 2008-01-03 10:15:41 +01:00
Mathieu Lacage 64bb988613 a replacement for ClassIdDefaultValue 2008-01-03 09:10:40 +01:00
Mathieu Lacage 3fcff1b1b3 add InterfaceId::HasConstructor 2008-01-03 09:10:23 +01:00
Mathieu Lacage 6150ba4860 make the internal InterfaceId constructor explicit 2008-01-03 08:42:04 +01:00
Mathieu Lacage 676307027c add support to browse the list of existing InterfaceId 2008-01-03 08:41:15 +01:00
Mathieu Lacage 976f16c4d9 get rid of MakeInterfaceId 2008-01-03 08:34:31 +01:00
Mathieu Lacage b88e90fec3 add 'factory' support to InterfaceId 2008-01-02 15:54:53 +01:00
Mathieu Lacage 2103459845 merge with callback improvements. 2008-01-02 13:40:37 +01:00
Mathieu Lacage 348eb1e187 Make the CallbackBase class more useful than it was. 2008-01-02 13:39:56 +01:00
Mathieu Lacage 1fb6ad5488 rewrite interface id metadata 2008-01-02 12:24:25 +01:00
Mathieu Lacage 328aa2cc45 remove some remnants from the iid-a-variable era. 2008-01-02 11:08:11 +01:00
Mathieu Lacage 2deb2ea0f0 add some separation markers 2008-01-02 10:57:25 +01:00
Mathieu Lacage bc1ab2d79b replace static const Interface iid; with static InterfaceId iid (void); 2008-01-02 10:33:39 +01:00
Mathieu Lacage f3e77eea3d fix bug 122: get rid of duplicate argument to QueryInterface 2008-01-02 09:25:31 +01:00
Mathieu Lacage 6b0e717a19 add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>. 2008-01-02 09:09:24 +01:00
Tom Henderson 906a9748b5 fix bug in PacketSink 2007-12-30 19:36:44 -08:00
Tom Henderson 414c33ffc9 remove const qualifier from uint16_t 2007-12-28 06:50:47 -08:00
Tom Henderson 77f8c5cbf2 Fix small typo 2007-12-26 20:08:48 -08:00
Tom Henderson 3f5d7030cb update doc/tracing.h to Ptr<Packet> 2007-12-26 13:02:09 -08:00
Tom Henderson c53c3afd46 back out doc/tutorial.h (not yet) 2007-12-26 11:41:47 -08:00
Tom Henderson 33fd7f0c67 Doxygen for internet-node.h 2007-12-26 11:39:52 -08:00
Mathieu Lacage 853f0a13e9 add missing copyright/license header 2007-12-26 15:41:48 +01:00
Mathieu Lacage 9569ad645b fix bug 98 2007-12-25 11:09:15 +01:00
Gustavo J. A. M. Carneiro 3a98117aa5 Remove ghost declaration of function AllocateClassId. 2007-12-22 18:46:43 +00:00
Gustavo J. A. M. Carneiro 42092bc91e Don't include the 'global-route-manager-impl.h' private header from the public header 'candidate-queue.h'. 2007-12-20 15:19:57 +00:00
Mathieu Lacage 2d6f46dfa8 forward only packets for ourselves. 2007-12-19 13:24:52 +01:00
Mathieu Lacage f1f400bcee it is possible to receive packets which are not tagged. ignore them rather than crash. 2007-12-19 13:24:30 +01:00
Mathieu Lacage a6e289c8ef ensure m_listener is initialized properly 2007-12-19 13:22:55 +01:00
Gustavo J. A. M. Carneiro a83ec513a1 const fixes (new GCC 4.2 warning) 2007-12-17 14:53:14 +00:00
Mathieu Lacage f043a8789c doxygen 2007-12-17 13:41:51 +01:00
Mathieu Lacage 30bbef4b14 add a few comments here and there 2007-12-17 13:27:22 +01:00
Mathieu Lacage 26fb62c748 more doxygen 2007-12-17 13:20:02 +01:00
Mathieu Lacage 77c0e85775 add some doxygen 2007-12-17 13:07:41 +01:00
Tom Henderson ac45276835 update release_steps.txt 2007-12-15 15:08:30 -08:00
Tom Henderson cfa242a6a5 Added tag release ns-3.0.9 for changeset 4db981a0d9eb 2007-12-15 14:58:58 -08:00
Tom Henderson 26599981a0 bump VERSION and finish RELEASE_NOTES 2007-12-15 14:01:36 -08:00
Tom Henderson 8fe2191d04 Repair doxygen errors 2007-12-15 13:59:33 -08:00
Tom Henderson 35b4c6c6b8 add internal keyword to udp-impl documentation 2007-12-15 13:52:00 -08:00
Mathieu Lacage e42ccef4a7 fix optimized build 2007-12-15 11:58:14 +01:00
Mathieu Lacage 8449139061 fix optimized build 2007-12-15 11:57:43 +01:00
Craig Dowell 16e7e60cab packet pointer police patrolled product preventing presence of prior pattern proactively 2007-12-14 16:05:37 -08:00
Mathieu Lacage c53988d01e success heuristic was inverted. 2007-12-14 17:42:16 +01:00
Mathieu Lacage 1fea8b38fc fix optimized build 2007-12-14 17:26:18 +01:00
Mathieu Lacage 7d6cd9ae7c some debugging. Max rate test was inverted. 2007-12-14 15:43:52 +01:00
Mathieu Lacage bd70c33606 avoid uninitialized variables. 2007-12-14 15:18:14 +01:00
Craig Dowell f2a0ca2b0e put updated tutorial.texi in doc directory 2007-12-13 23:50:16 -08:00
Raj Bhattacharjea 282543b759 Add uint8_t* based API for sockets 2007-12-13 09:40:21 -05:00
Mathieu Lacage 15748575d8 implement the MRR portion of AMRR 2007-12-13 15:07:08 +01:00
Mathieu Lacage cc9655af45 return the computed rate 2007-12-13 15:04:11 +01:00
Mathieu Lacage 465bf1c10a implement AMRR for true. 2007-12-13 14:43:56 +01:00
Mathieu Lacage eb1200a2cd AMRR rate control algorithm 2007-12-13 13:00:02 +01:00
Mathieu Lacage c1a71e53f9 the meat of the onoe rate control algorithm. 2007-12-13 09:26:20 +01:00
Mathieu Lacage f5fe661c13 Onoe rate control 2007-12-13 08:39:08 +01:00
Mathieu Lacage f42e5c4814 use the new MacStation::Report*Failed methods. 2007-12-12 13:36:16 +01:00
Mathieu Lacage 135a4ab58c add MacStation::ReportFinal* methods for onoe rate control model 2007-12-12 13:17:04 +01:00
Mathieu Lacage b192207132 introduce a low latency parameter for rate control algorithms 2007-12-12 12:03:38 +01:00
Mathieu Lacage 3464e84e90 initial release notes for upcoming release 2007-12-12 11:03:35 +01:00
Mathieu Lacage a0ee98cb4b add legend support to gnuplot output 2007-12-12 09:33:22 +01:00
Mathieu Lacage 01d7a64670 add legend support to gnuplot output 2007-12-12 09:33:22 +01:00
Mathieu Lacage cbafcb5aa6 updated doxygen 2007-12-11 17:53:54 +01:00
Mathieu Lacage b604bf2d7a estimation delay and jitter 2007-12-11 17:48:09 +01:00
Mathieu Lacage 05efca8430 merge with HEAD 2007-12-11 15:54:58 +01:00
Mathieu Lacage 007f125e46 add support for gnuplot error bars 2007-12-11 15:49:23 +01:00
Mathieu Lacage 83dd618e5b add tracing support to PacketSink 2007-12-11 14:03:20 +01:00
Mathieu Lacage ffc992893f fix small typo 2007-12-11 14:03:02 +01:00
Mathieu Lacage b04e3d6cd6 add tx packet trace support 2007-12-11 13:51:18 +01:00
Mathieu Lacage 5e19f9707b add application tracing support 2007-12-11 13:51:03 +01:00
Mathieu Lacage 457d07a50f make Packet::AddTag a const method 2007-12-11 13:42:09 +01:00
Mathieu Lacage 3262a4e103 add application tracing support 2007-12-11 13:51:03 +01:00
Mathieu Lacage df27c80c72 merge with HEAD 2007-12-12 08:15:04 +01:00
Tom Henderson bc54e34375 Doxygen the SocketFactory classes 2007-12-11 23:02:47 -08:00
Mathieu Lacage 49deb08b81 make Packet::AddTag a const method 2007-12-11 13:42:09 +01:00
Mathieu Lacage b8fbe8341f merge with HEAD 2007-12-11 10:25:34 +01:00
Tom Henderson 07e46fb8aa fix bug 113 on m_node parameter for GlobalRouter 2007-12-09 21:39:28 -08:00
Gustavo J. A. M. Carneiro 0ee86b72fb New waf snapshot; move the ns3 library back to the top build dir (the 'lib' was only a workaround for a waf problem); allow --enable-modules on a per build run basis. 2007-12-09 14:39:07 +00:00
Mathieu Lacage b54c43b966 the check was not really inverted after all. Damned. 2007-12-07 10:06:29 +01:00
Mathieu Lacage 1b82e5cba7 make sure we never set a negative duration 2007-12-07 09:51:59 +01:00
Mathieu Lacage 8a825ee775 merge with HEAD 2007-12-07 08:43:55 +01:00
Mathieu Lacage c91b667c13 use contrib gnuplot code 2007-12-07 08:41:52 +01:00
Mathieu Lacage 32611749b2 Gnuplot output class for contrib module 2007-12-06 13:30:26 +01:00
Federico Maguolo dd9e29c425 Avoid integer division 2007-12-06 13:12:27 +01:00
Gustavo J. A. M. Carneiro 8debe6ef1d Create a new contrib module; move event-garbage-collector.{h,cc} to the contrib module. 2007-12-06 11:05:17 +00:00
Gustavo J. A. M. Carneiro bab56b0d88 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it) 2007-12-05 11:51:10 +00:00
Mathieu Lacage 0b43b4fdc2 the bool check was inverted. reported by Federico Maguolo. 2007-11-29 16:28:16 +01:00
Mathieu Lacage 210fb3539c fix typo 2007-11-29 16:03:01 +01:00
Mathieu Lacage 026f3f2aef MaxSeconds -> Simulator::GetMaximumSimulationTime 2007-11-29 15:59:31 +01:00
Mathieu Lacage 9b5d0a50f7 ConnectTo -> Attach 2007-11-29 15:50:15 +01:00
Mathieu Lacage d3df13225d remove references to WifiNetDeviceFactory 2007-11-29 15:45:12 +01:00
Mathieu Lacage fb2ebab793 speed vector -> velocity vector 2007-11-29 01:03:41 +01:00
Mathieu Lacage 2f71efe6a7 merge 2007-11-29 01:01:46 +01:00
Mathieu Lacage 7813d6fdd7 fix typo due to Packet & -> Ptr<Packet> change 2007-11-29 00:59:00 +01:00
Gustavo J. A. M. Carneiro 8ce92e1bc2 Fix bad Message Size value in OLSR headers (which prevented wireshark from decoding most OLSR packets). 2007-11-27 10:36:27 +00:00
Federico Maguolo 9316a5c23f re-use the CaculateTxDuration method where it is needed. 2007-11-23 10:29:27 +01:00
Federico Maguolo 64684b6b71 Improve the accuracy of 802.11a tx duration calculations. 2007-11-23 10:23:55 +01:00
Mathieu Lacage f133bfaf9f avoid memory leak 2007-11-23 11:36:16 +01:00
Mathieu Lacage 3f174e0bd0 avoid confusion between code and uncoded rates. 2007-11-22 16:40:35 +01:00
Mathieu Lacage 39a0e3b29c fix a small style issue 2007-11-22 16:07:45 +01:00
Mathieu Lacage ac8e86643e initialize variable 2007-11-22 16:06:05 +01:00
Mathieu Lacage 6a51ea96c0 make sure that the retry bit is correctly initialized 2007-11-22 15:00:32 +01:00
Mathieu Lacage 94e2d9059a merge obvious fix from mainline 2007-11-22 14:52:57 +01:00
Mathieu Lacage 85c67ca048 the intent was to always send data if maxbytes is zero. 2007-11-22 14:50:59 +01:00
Mathieu Lacage 99a5a8370f port to Ptr<Packet> branch 2007-11-22 14:27:22 +01:00
Mathieu Lacage 284ebcc23f merge with Ptr<Packet> branch 2007-11-22 10:44:48 +01:00
Mathieu Lacage c156f29c86 merge 2007-11-22 10:30:29 +01:00
Mathieu Lacage e075fcd4f3 bug 104: add a method to retrive the maximum simulation time. 2007-11-21 15:54:34 +01:00
Mathieu Lacage 49a8c459a8 simplify the parsing logic and remove buggy comment and code. 2007-11-21 14:14:12 +01:00
Mathieu Lacage 1e45a4c9f5 bug 91: add print-list support to NS_LOG env var. 2007-11-21 14:06:46 +01:00
Mathieu Lacage dd825831c7 bug 109: improve the doxygen documentation for RandomVariable 2007-11-21 13:36:47 +01:00
Mathieu Lacage 1b17161758 code layout fix 2007-11-21 11:12:02 +01:00
Mathieu Lacage 908971e48b improve log output 2007-11-21 11:11:27 +01:00
Mathieu Lacage ca76e83370 add WifiPhy::GetDevice 2007-11-21 11:11:05 +01:00
Mathieu Lacage 4774f44062 fix small typo in debug log output 2007-11-21 10:02:17 +01:00
Mathieu Lacage f198acda79 use packet sockets for AP scenario too. 2007-11-21 09:54:43 +01:00
Mathieu Lacage 86a564094c use packet sockets and generate all graphics 2007-11-21 09:44:17 +01:00
Mathieu Lacage f2c5dd8d71 add constructors to specify the address of a device 2007-11-21 09:43:57 +01:00
Mathieu Lacage ed8ef96a61 add some info logs, improve snr vs ber curve output, linearize the ber calculations. 2007-11-20 16:45:52 +01:00
Mathieu Lacage 87a1ae56d7 plot the goodput for each data rate separately 2007-11-20 13:10:30 +01:00
Mathieu Lacage 63331e705a replace a buggy assert with a check with warning. 2007-11-20 12:48:51 +01:00
Mathieu Lacage 6f447c2b6a merge with HEAD 2007-11-19 16:54:04 +01:00
Mathieu Lacage f415e99a36 replace Dcf with DcfManager 2007-11-19 16:53:05 +01:00
Mathieu Lacage b699ad9ae1 use a simple request/grant scheme for dcf accesses 2007-11-19 16:20:30 +01:00
Mathieu Lacage 632a762654 The AIFSN has been taken into account in GetBackoffStartFor 2007-11-19 14:32:14 +01:00
Mathieu Lacage a4a3bc72fc test a backoff with an AIFSN != 1 2007-11-19 14:31:24 +01:00
Mathieu Lacage b809739d8c avoid decrementing by too many backoff slots 2007-11-19 14:22:45 +01:00
Mathieu Lacage 7ad2a4c3f2 another DCF test 2007-11-19 14:20:19 +01:00
Mathieu Lacage 4c4332c88b debugging output is more verbose. 2007-11-19 12:58:36 +01:00
Mathieu Lacage 6c0ef59a30 add WifiPhy::GetLastRxStart 2007-11-19 09:22:17 +01:00
Mathieu Lacage 83714d4d03 make the GetCw method public to allow DcaTxop to pick a random backoff duration 2007-11-19 08:38:48 +01:00
Mathieu Lacage 7498ef647c merge with HEAD 2007-11-17 18:58:47 +01:00
Mathieu Lacage 321dfcf741 add XXX for two bugs 2007-11-17 18:57:33 +01:00
Mathieu Lacage bdc6fcf5dd another more complex NAV test 2007-11-16 08:58:55 +01:00
Mathieu Lacage 50cd61e7c3 more comment on the test 2007-11-16 08:56:03 +01:00
Mathieu Lacage 125796fec7 simple NAV test 2007-11-16 08:54:16 +01:00
Mathieu Lacage d1d0e1c732 merge with HEAD 2007-11-16 08:48:57 +01:00
Mathieu Lacage 820fd1c13a merge with HEAD 2007-11-16 08:47:17 +01:00
Craig Dowell 577373aed9 Added tag release ns-3.0.8 for changeset 560a5091e0e6 2007-11-15 19:52:53 -08:00
Craig Dowell d1865a2c1e release files 2007-11-15 19:21:06 -08:00
Craig Dowell 60efef0caf branch merge 2007-11-15 18:57:07 -08:00
Craig Dowell 71c53d9f3d move in topo 2007-11-15 18:56:34 -08:00
Gustavo J. A. M. Carneiro 11a58a55c3 Add a few NS_LOG_LOGIC calls in PacketSocket::SendTo () 2007-11-15 16:08:28 +00:00
Gustavo J. A. M. Carneiro fc099a35ab Add DropTailQueue unit tests. 2007-11-15 15:42:07 +00:00
Mathieu Lacage f992fe0b8d test internal collisions. 2007-11-15 16:34:53 +01:00
Mathieu Lacage ac99f9e46c we need to accumulate a record of all changes before applying them in one go. 2007-11-15 16:34:41 +01:00
Mathieu Lacage 225df7593f backoff end time is never in the past. 2007-11-15 16:23:26 +01:00
Mathieu Lacage 5ecad32251 if the backoff end is now, the backoff is expired. 2007-11-15 14:50:27 +01:00
Mathieu Lacage cfd44fc50c even if an access timer is running, we need to start a backoff if needed 2007-11-15 14:42:16 +01:00
Mathieu Lacage 20f47863bf ignore cwmin/cwmax parameters since we set the backoff slots for every collision. 2007-11-15 14:29:06 +01:00
Mathieu Lacage c6cfbd4e8c test interupted eifs 2007-11-15 14:26:40 +01:00
Mathieu Lacage 8422056873 more working tests. 2007-11-15 14:23:01 +01:00
Mathieu Lacage 80ba651375 add a small comment 2007-11-15 14:22:54 +01:00
Mathieu Lacage 18e5bf9c07 keep track of the last time a backoff was updated. 2007-11-15 14:21:48 +01:00
Mathieu Lacage 0394180213 a new test-case with some comments 2007-11-15 13:44:58 +01:00
Mathieu Lacage b52be989ed start a backoff only if no backoff is started 2007-11-15 13:37:51 +01:00
Mathieu Lacage b15597dbe7 forgot sifs + aifsn for test 2007-11-15 13:37:38 +01:00
Mathieu Lacage 6aa4ae880a add a new test-case 2007-11-15 13:24:09 +01:00
Mathieu Lacage 01d2d77a76 backoff is finished when the end of backoff is _equal_ to now. 2007-11-15 13:03:09 +01:00
Gustavo J. A. M. Carneiro 640a49e1ce Bug 105: Queue getter methods should be const 2007-11-15 11:41:42 +00:00
Mathieu Lacage c8cf6df4cd allow OnOffApplication to send more than 0xffffffff bytes 2007-11-21 09:08:32 +01:00
Gustavo J. A. M. Carneiro 7f0a1a1caf WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build. 2007-11-20 18:27:43 +00:00
Mathieu Lacage d9942c0c32 merge with HEAD 2007-11-15 11:22:41 +01:00
Gustavo J. A. M. Carneiro 587d573a04 Add some missing NS_LOG_PARAM* definitions in optimized build 2007-11-15 10:16:26 +00:00
Mathieu Lacage 391adea516 update ignore list 2007-11-15 10:37:38 +01:00
Mathieu Lacage aad088e588 print-trace-sources.cc -> print-introspected-doxygen.cc 2007-11-15 10:35:55 +01:00
Mathieu Lacage ed31e39491 use the \valueref macro 2007-11-15 10:25:35 +01:00
Mathieu Lacage 34345b47d0 print default value list in trace source list doxygen output. 2007-11-15 10:24:51 +01:00
Mathieu Lacage 873a2c8dda add a valueref macro 2007-11-15 10:23:54 +01:00
Mathieu Lacage 838bef63b3 merge with Position -> Vector rename 2007-11-15 10:22:35 +01:00
Mathieu Lacage 6d97118181 merge with HEAD 2007-11-15 10:18:17 +01:00
Mathieu Lacage c1544ba7c4 check for Time bounds 2007-11-15 10:15:16 +01:00
Mathieu Lacage 008e02b03c add a new test 2007-11-15 09:44:23 +01:00
Tom Henderson 2e68155c6d nicer logging of parameters (bug 79 patch from Gustavo) 2007-11-14 21:59:14 -08:00
Tom Henderson a53e880346 Change default scheduler to Map from List (bug 90) 2007-11-14 21:29:27 -08:00
Tom Henderson 79f4bb679e get rid of non-const operators in DataRate 2007-11-14 21:17:43 -08:00
Mathieu Lacage 21baa41ccf timestep is a signed quantity. 2007-11-14 14:16:42 +01:00
Mathieu Lacage d20ccf186e handle NAV correctly 2007-11-14 14:11:11 +01:00
Mathieu Lacage 3128aadfe0 remove buggy test asserts 2007-11-14 14:03:38 +01:00
Mathieu Lacage 03da97b0b8 do not use GetBackoffSlots directly anymore 2007-11-14 14:02:03 +01:00
Mathieu Lacage 2d39b3c2d0 remove buggy assert and comment 2007-11-14 13:53:32 +01:00
Mathieu Lacage dada8dc1db improve debugging output. introduce GetBackoffStartFor and GetBackoffEndFor 2007-11-14 13:50:19 +01:00
Mathieu Lacage 5b47785ae4 add a ns3::MaxSeconds function 2007-11-14 13:45:17 +01:00
Mathieu Lacage c18e92df67 get rid of MacParameters from DcfManager 2007-11-14 12:43:01 +01:00
Mathieu Lacage 8828ac5d30 more debugging. 2007-11-14 12:36:08 +01:00
Mathieu Lacage 83d717bcae add debugging output 2007-11-14 12:23:56 +01:00
Mathieu Lacage 21f9524b3e a few more test asserts 2007-11-13 18:02:46 +01:00
Mathieu Lacage c7078a3e10 simplify memory management 2007-11-13 17:58:34 +01:00
Mathieu Lacage 1bbd9675b6 initialize more state variables 2007-11-13 17:58:22 +01:00
Mathieu Lacage 87db306da0 initialize state variables 2007-11-13 17:44:02 +01:00
Unknown c41da878f9 setup a simple test scenario 2007-11-13 17:40:39 +01:00
Unknown 0a17e5ab7f dcf test framework 2007-11-13 17:26:36 +01:00
Unknown 2f356fd916 add missing method implementations 2007-11-13 17:26:24 +01:00
Unknown 1bf52bda9e a new (wholy untested) Dcf implementation 2007-11-13 16:32:39 +01:00
Mathieu Lacage 89117a326c do nothing on cancel and explain why. 2007-11-09 13:25:01 +01:00
Mathieu Lacage 51bc877b4e update the last sequence control only for non-broadcast frames. 2007-11-09 13:24:38 +01:00
Mathieu Lacage f5772f0423 set the retry bit and use it to filter duplicates 2007-11-09 09:35:13 +01:00
Mathieu Lacage 95596a53b0 handle cancel events 2007-11-09 08:44:03 +01:00
Tom Henderson c114ad9aa7 minor fix for bug95; also const operators for DataRate 2007-11-08 23:08:00 -08:00
Craig Dowell bb9c35ffea baranch merge 2007-11-08 17:05:37 -08:00
Craig Dowell 6b426b5f83 branch merge 2007-11-08 16:58:24 -08:00
Mathieu Lacage 9e215a3493 calculate the delay, not -delay. 2007-11-08 15:25:57 +01:00
Mathieu Lacage 3321873fc6 implement AP beaconing 2007-11-08 15:23:06 +01:00
Mathieu Lacage fc57cac746 make sure that m_listener is not reset to zero _after_ calling a user-provided callback. This allows the user-provided callback to set the m_listener member to a new value if it wants to start a new transmission 2007-11-08 15:22:22 +01:00
Mathieu Lacage dbdd00fef8 zeroify the members after deleting them to improve debugging. 2007-11-08 13:58:26 +01:00
Mathieu Lacage 0986cb46d9 make debug build work 2007-11-08 13:57:50 +01:00
Mathieu Lacage e55384067b add WifiMacHeader::SetBeacon 2007-11-08 13:57:30 +01:00
Mathieu Lacage c905f0658d dox typo 2007-11-08 12:39:21 +01:00
Mathieu Lacage 99fca41f02 GetSpeed -> GetVelocity 2007-11-08 12:36:15 +01:00
Mathieu Lacage eb666a62ac replace Position and Speed by Vector 2007-11-08 12:33:30 +01:00
Mathieu Lacage 6e660e4c27 rename MobilityModel::Get/Set to GetPosition/SetPosition 2007-11-08 11:24:41 +01:00
Mathieu Lacage 00bf89e1d2 a vector class 2007-11-08 10:24:33 +01:00
Tom Henderson 48a98d8b1f update bench-packets.cc program 2007-11-06 15:45:05 -08:00
Mathieu Lacage 1a8421bbfe use the holland set of modes. 2007-11-06 16:16:18 +01:00
Mathieu Lacage ecc4bab8f2 add the holland 802.11a set of modes. 2007-11-06 16:16:06 +01:00
Mathieu Lacage b5a64f2fae a real test 2007-11-06 15:11:22 +01:00
Mathieu Lacage 7e11cfb891 use the new style support 2007-11-06 15:05:56 +01:00
Mathieu Lacage cdcfbd8ab2 add style support 2007-11-06 15:05:47 +01:00
Mathieu Lacage 9964005525 use the gnuplot machinery to output a set of plots 2007-11-06 14:50:20 +01:00
Mathieu Lacage 3dd8898aaf generate correct output. avoid infinite loop. 2007-11-06 14:48:49 +01:00
Mathieu Lacage d3acfdfa07 fix optimized builds 2007-11-06 14:48:31 +01:00
Mathieu Lacage cb0eeaeb32 generate gnuplot-compatible data script files 2007-11-06 13:30:40 +01:00
Mathieu Lacage b114ba4ec6 print the throughput vs distance curve 2007-11-06 12:32:58 +01:00
Mathieu Lacage 688683fdaf change the default tx and gain to be 1db again. 2007-11-06 12:32:42 +01:00
Mathieu Lacage f0740d8235 simplify the code a bit. Make sure we handle correctly the calculation of the reference rx power 2007-11-06 10:37:12 +01:00
Mathieu Lacage bf33ac89eb remove dead method 2007-11-06 10:36:07 +01:00
Tom Henderson baeee68d27 move ipv4 static to member functions 2007-11-05 21:08:02 -08:00
Tom Henderson 25d1f542d7 implement StringDefaultValue; bug93 patch from Mathieu 2007-11-14 21:05:31 -08:00
Tom Henderson 1b919575f2 fix bug 100 DefaultValue::Bind for floats 2007-11-08 22:31:54 -08:00
Tom Henderson f7e49cfb04 GetNetDevice method in PointToPointTopology class 2007-11-14 20:50:53 -08:00
Tom Henderson c3cbbcacd7 Add src/common/error-model implementation and example script, and add to NetDevices 2007-11-14 20:40:05 -08:00
Mathieu Lacage d030b978ab use dB instead of dbm where appropriate 2007-11-05 18:55:49 +01:00
Mathieu Lacage 1acb811437 clarify the formulas 2007-11-05 18:55:14 +01:00
Mathieu Lacage 1bf7be4d2a make the default match yans for debugging purposes 2007-11-05 17:41:58 +01:00
Mathieu Lacage 44096d2f95 add throughput printer 2007-11-05 16:45:22 +01:00
Mathieu Lacage 136cb036b4 test the friis model 2007-11-05 16:33:54 +01:00
Mathieu Lacage a1bfcd1216 test propagation losses 2007-11-05 16:31:52 +01:00
Mathieu Lacage 277173ae0f calculate correctly rx power 2007-11-05 16:31:16 +01:00
Mathieu Lacage 28e6e63c5d handle min distance for friis model in a saner way 2007-11-05 15:53:24 +01:00
Mathieu Lacage a49623136a document log distance propagation loss model. 2007-11-05 15:41:02 +01:00
Mathieu Lacage 9041f3ed1f Document the friis propagation model. 2007-11-05 14:54:40 +01:00
Tom Henderson bc759b5bb3 Minor change to doxygen due to debug-to-log cutover 2007-11-02 08:41:50 -07:00
Tom Henderson 0d70b12c75 update doxygen.conf to 1.5.4 2007-11-02 08:28:45 -07:00
Raj Bhattacharjea b471e74ef8 Fixed randomvariable memory bug that caused a segfault 2007-11-01 14:59:00 -04:00
Mathieu Lacage 745412ffb8 define a new dox module 2007-10-31 16:39:16 +01:00
Mathieu Lacage 680c125dde fix dox warnings 2007-10-31 16:27:37 +01:00
Mathieu Lacage d072cdd527 doxygen 2007-10-31 16:26:31 +01:00
Mathieu Lacage 570126f8ff use Time for the beacon interval. 2007-10-31 16:26:18 +01:00
Mathieu Lacage 5de828fa15 dox for WifiPhy 2007-10-31 13:17:45 +01:00
Mathieu Lacage 32f3411eca remove unused loggers 2007-10-31 12:29:28 +01:00
Mathieu Lacage 7509e66617 phy state logger 2007-10-31 12:27:20 +01:00
Mathieu Lacage 92d65a529f derive WifiPhy from Object and manage it with a Ptr<> 2007-10-31 12:05:25 +01:00
Mathieu Lacage 51590ad30f basic tracing support 2007-10-31 11:45:04 +01:00
Mathieu Lacage 7af70745f3 add missing default constructor 2007-10-31 11:39:26 +01:00
Mathieu Lacage 936c25c98b add missing type specifier in sample code 2007-10-31 11:35:06 +01:00
Mathieu Lacage fcbfa307ef merge with tip 2007-10-31 11:30:51 +01:00
Mathieu Lacage 534b655291 fix typo 2007-10-31 11:28:40 +01:00
Raj Bhattacharjea 5a0fa236cb Fixed randomvariable bugs and modified unit tests so that there is no non-deterministic failure on the tests 2007-10-30 13:27:33 -04:00
Gustavo J. A. M. Carneiro d17845d767 Remove empty OlsrTest unit test class. 2007-10-30 15:55:50 +00:00
Mathieu Lacage ecd20983e8 merge with tip 2007-10-30 10:31:20 +01:00
Mathieu Lacage 66b200178f bug 96: debug.h duplicates functionality from log.h 2007-10-30 10:09:39 +01:00
Craig Dowell 7dca6e0b04 olsr gets new packet 2007-10-29 13:40:25 -07:00
Craig Dowell 60b6fb3d39 merge in packet.bundle 2007-10-29 12:48:01 -07:00
Mathieu Lacage 9d1a3eff16 port to new Channel API. 2007-10-29 16:34:26 +01:00
Gustavo J. A. M. Carneiro e560f2329d Add OLSR message tracing, as discussed on ns-developers list. 2007-10-29 14:11:20 +00:00
Mathieu Lacage d58602289d merge with tip again 2007-10-29 15:04:47 +01:00
Mathieu Lacage 8845f347d3 merge with tip 2007-10-29 15:04:23 +01:00
Mathieu Lacage d6611f02ba rename print-trace-sources to print-introspected-doxygen 2007-10-29 15:01:36 +01:00
Mathieu Lacage 3ed9dc6a94 fix a few missing \valueref 2007-10-29 15:01:14 +01:00
Mathieu Lacage dbfc58c5ed move default value output to print-trace-sources utility 2007-10-29 14:55:16 +01:00
Mathieu Lacage aedad2ccb0 use valueref where needed. 2007-10-29 14:45:43 +01:00
Mathieu Lacage 1aa79965c7 make the default value names more coherent. 2007-10-29 14:40:25 +01:00
Gustavo J. A. M. Carneiro a7ec5d9b71 Make olsr-header.h a public header. 2007-10-29 12:45:02 +00:00
Gustavo J. A. M. Carneiro 4afb2919fa Put everything OLSR into the 'olsr' C++ namespace, for consistency. 2007-10-29 12:39:34 +00:00
Gustavo J. A. M. Carneiro 52d6092ffd merge 2007-10-29 11:01:46 +00:00
Mathieu Lacage 4bef99703a define valueref alias 2007-10-29 10:44:56 +01:00
Mathieu Lacage 1afa21922f update config file to latest doxygen 2007-10-29 10:44:46 +01:00
Tom Henderson d3cb3eccff Add Doxygen cleanup as a release step 2007-10-27 16:19:06 -07:00
Mathieu Lacage 937d727011 merge 2007-10-27 13:17:55 +02:00
Mathieu Lacage ca7f175fb7 add missing copyright header 2007-10-26 22:11:48 +02:00
Mathieu Lacage 81f5e4c039 remove extraneous empty line 2007-10-26 22:10:52 +02:00
Mathieu Lacage 2f4ed00c93 get rid of doxygen warnings 2007-10-26 22:06:46 +02:00
Mathieu Lacage cb1b1daacd change <table> to <ul> 2007-10-26 17:11:02 +02:00
Mathieu Lacage 6862cc0ce9 output a default value list 2007-10-26 17:05:39 +02:00
Mathieu Lacage 6ff8bda568 utility program to print the list of default values 2007-10-26 14:16:40 +02:00
Mathieu Lacage 8e78937160 add missing copyright headers 2007-10-26 14:14:20 +02:00
Mathieu Lacage d7bfb88be9 add missing headers 2007-10-26 14:03:22 +02:00
Mathieu Lacage 46654ba28a add missing headers 2007-10-26 14:02:19 +02:00
Mathieu Lacage 34889dfb6a doxygen PropagationDelayModel 2007-10-26 14:00:13 +02:00
Mathieu Lacage e2a3b89175 doxygen PropagationLossModel 2007-10-26 13:49:33 +02:00
Mathieu Lacage 6a51a05171 replace distance by a pair of mobility models 2007-10-26 13:31:17 +02:00
Mathieu Lacage 09bfa883ac start of work towards a wifi documentation 2007-10-26 13:14:29 +02:00
Mathieu Lacage 6f0268171d basic doxygen documentation for users 2007-10-26 13:14:14 +02:00
Tom Henderson e0da616e37 miscellaneous point-to-point-channel.h cleanups 2007-10-24 17:19:17 -07:00
Tom Henderson 224f0a0684 some cleanup of point-to-point-net-device.h 2007-10-24 17:11:59 -07:00
Tom Henderson f928f6c161 Make GetDevice return pointer to appropriately subclassed NetDevice 2007-10-24 16:17:19 -07:00
Mathieu Lacage 4e5203a3dd set the supported rates in assoc resp frames 2007-10-24 20:43:22 +02:00
Mathieu Lacage 58363c9dab do not add a basic mode more than once. 2007-10-24 20:42:11 +02:00
Mathieu Lacage 0e7024488d handle basic rate support 2007-10-24 20:41:49 +02:00
Mathieu Lacage 6310a6040b fix coding style 2007-10-24 20:00:30 +02:00
Mathieu Lacage ec31e714d6 add size to logging output 2007-10-24 16:43:09 +02:00
Mathieu Lacage a80d3bcf38 simplify logging output 2007-10-24 16:28:28 +02:00
Mathieu Lacage ad9b41e45e try to simplify duration calculations 2007-10-24 16:02:10 +02:00
Mathieu Lacage 9d643387fb initialize the m_length field. 2007-10-24 15:05:17 +02:00
Mathieu Lacage c570beefbd check the ssid length 2007-10-23 14:00:53 +02:00
Mathieu Lacage 6f97972582 enable packet metadata for debugging 2007-10-23 13:40:08 +02:00
Mathieu Lacage 736368f441 improve slightly the SupportedRates print output 2007-10-23 13:39:49 +02:00
Mathieu Lacage 8975be38ae add missing space separator 2007-10-23 13:38:03 +02:00
Mathieu Lacage 7aede726ca add missing space separator 2007-10-23 13:38:03 +02:00
Mathieu Lacage 228150cd72 add printing support 2007-10-23 13:12:04 +02:00
Mathieu Lacage 9f4f9e7b2f add printing support 2007-10-23 13:11:41 +02:00
Mathieu Lacage 629de5c931 add logging support 2007-10-23 13:11:23 +02:00
Mathieu Lacage 30af256bb6 add printing support 2007-10-23 13:11:10 +02:00
Mathieu Lacage 7340c86c61 enable logging 2007-10-23 12:49:09 +02:00
Mathieu Lacage 187c6692d8 avoid off by one effect when laying out objects in a grid. (reported by Joseph Kopena) 2007-10-21 12:54:18 +02:00
Mathieu Lacage 0c5de08870 ap/sta sample 2007-10-19 12:10:01 +02:00
Mathieu Lacage 36a6d0c93c handle the BasicRateSet in the AP 2007-10-18 17:19:53 +02:00
Mathieu Lacage 2d66b73e34 dynamically update the list of supported rates based on the ap supported rates 2007-10-18 15:59:33 +02:00
Mathieu Lacage 18517c1fe5 implement Reset and AddBasicMode 2007-10-18 15:58:19 +02:00
Mathieu Lacage 69dfc4fe32 add support for set/get supported rates in assoc resp packets 2007-10-18 15:12:39 +02:00
Mathieu Lacage d7fe272673 make sure we record all needed supported modes 2007-10-18 14:38:09 +02:00
Mathieu Lacage 40add040f9 convert int to uint32_t 2007-10-18 14:32:42 +02:00
Mathieu Lacage 766d7138ac control the rate control algorithms with default values. 2007-10-18 14:27:43 +02:00
Mathieu Lacage dc3fb38cbb support BRAND_NEW station in adhoc code. initialize the supported rates. 2007-10-18 13:37:22 +02:00
Mathieu Lacage eb1e734628 add dispose methods in subclasses of WifiNetDevice 2007-10-18 12:20:41 +02:00
Mathieu Lacage ba95d49a67 get rid of the dcf 2007-10-18 12:20:24 +02:00
Mathieu Lacage a90aee32a0 clear the list of NetDevice 2007-10-18 12:20:17 +02:00
Mathieu Lacage 8a9502ce01 dispose everything from WifiNetDevice::DoDispose 2007-10-18 11:53:35 +02:00
Mathieu Lacage 8d46c4debc dispose the channel from WifiNetDevice 2007-10-18 11:50:35 +02:00
Mathieu Lacage fe2ab99c52 remove buggy asserts 2007-10-18 11:25:33 +02:00
Mathieu Lacage a5467f201c cts, rts, and ack sizes must take into account fcs padding 2007-10-18 11:22:19 +02:00
Mathieu Lacage 976c3bbe98 eifs calculation is wrong: match the spec. 2007-10-18 11:21:40 +02:00
Mathieu Lacage 551de62f42 make sure that ack and cts delay take into account the fcs padding. 2007-10-18 11:21:14 +02:00
Gustavo J. A. M. Carneiro 860df74295 more const optimisations 2007-10-17 18:16:09 +01:00
Gustavo J. A. M. Carneiro eca4117497 Make OlsrAgentImpl::GetMainAddress const 2007-10-17 17:25:19 +01:00
Mathieu Lacage 434226dd01 add time to debug output 2007-10-17 17:49:56 +02:00
Mathieu Lacage e770997d09 do not call Unref directly anymore. 2007-10-17 17:01:51 +02:00
Mathieu Lacage 52d42bca30 fix valgrind warning: initialize RngStream correctly 2007-10-17 16:26:42 +02:00
Mathieu Lacage 3b5eba1c85 make sure we pass the Rts duration to the SendCtsAfterRts method. fix debugging output. 2007-10-17 16:20:30 +02:00
Mathieu Lacage 76af0aa6ed make sure that each new MacStation is correctly initialized 2007-10-17 16:19:51 +02:00
Mathieu Lacage 4a6e000a07 convert to and from dbms when needed 2007-10-17 15:52:11 +02:00
Mathieu Lacage cf2fbcb6e3 log channel behavior 2007-10-17 15:51:37 +02:00
Mathieu Lacage 11c2f8c991 tx and rx gain should have no impact by default 2007-10-17 15:51:20 +02:00
Mathieu Lacage 0d3182c278 use dbms consistently in the propagation loss models 2007-10-17 15:50:38 +02:00
Mathieu Lacage 1d2a21fa1f initialize uniqueUid field 2007-10-17 13:39:05 +02:00
Mathieu Lacage c6763e76ee index starts at zero 2007-10-17 13:38:44 +02:00
Mathieu Lacage 818c1ea9e9 specify real type 2007-10-17 13:38:33 +02:00
Mathieu Lacage 0b4d0fcf67 implement operator << and an assert 2007-10-17 12:01:08 +02:00
Mathieu Lacage 384c4b998e add asserts and some debug log 2007-10-17 12:00:43 +02:00
Mathieu Lacage 449bd78db7 convert TRACE to NS_LOG 2007-10-16 18:09:49 +02:00
Mathieu Lacage 5d2227d3a6 remove 'all rights reserved' 2007-10-16 17:22:13 +02:00
Mathieu Lacage 0058449576 remove uneeded trailing ';' 2007-10-16 17:20:09 +02:00
Mathieu Lacage 2059a57d96 goto the right location before serializing the wifi trailer 2007-10-16 17:18:29 +02:00
Mathieu Lacage 8bb9ab629f remove bogus assert 2007-10-16 17:15:30 +02:00
Mathieu Lacage 73c536fa04 replace cassert by ns3/assert.h 2007-10-16 15:57:45 +02:00
Mathieu Lacage 2d07bbdf2c configure correctly the ipv4 layer 2007-10-16 15:43:26 +02:00
Mathieu Lacage 83e7cf54f4 merge with HEAD 2007-10-16 14:44:36 +02:00
Mathieu Lacage 54725d30b1 fix position printing code 2007-10-16 14:43:40 +02:00
Mathieu Lacage e688cc520b convert tracing to log system 2007-10-16 14:43:08 +02:00
Mathieu Lacage ec5e79f86b fix valgrind warning 2007-10-16 14:29:23 +02:00
Mathieu Lacage 87d56eb866 use the new RandomStream class and fix a small bug in the testsuite 2007-10-16 13:32:48 +02:00
Mathieu Lacage 2922488eb9 add wrapper class around RngStream for testing. 2007-10-16 13:32:19 +02:00
Mathieu Lacage b8230bf5e6 fix bogus assert 2007-10-16 13:31:51 +02:00
Mathieu Lacage e66a3625b4 make sure to terminate vararg list correctly 2007-10-16 10:54:50 +02:00
Tom Henderson 61ed256846 more detail in release_steps.txt 2007-10-15 21:59:41 -07:00
Tom Henderson 31bafccb6c updates for 3.0.7 2007-10-15 21:13:21 -07:00
Tom Henderson db709dc4dc bump version number 2007-10-15 21:12:55 -07:00
Tom Henderson 9461d8ec13 updates for 3.0.7 2007-10-15 21:12:48 -07:00
Tom Henderson 834eb4c1b6 Release notes for 3.0.7 2007-10-15 21:10:46 -07:00
Craig Dowell 21ab738c72 Added tag release ns-3.0.7 for changeset 36472385a1cc 2007-10-15 15:09:56 -07:00
Craig Dowell 620a465f84 NS_LOG parsing changes to address bug 91 2007-10-15 14:54:32 -07:00
Mathieu Lacage 0c760dc107 build and link 2007-10-15 16:47:53 +02:00
Mathieu Lacage ad7ea01ee8 add some tests 2007-10-15 16:17:15 +02:00
Mathieu Lacage 1026821e33 add StringDefaultValue 2007-10-15 12:58:53 +02:00
Tom Henderson 302bdd366c Clarify pkt-uid field in doxygen 2007-10-13 15:14:00 -07:00
Tom Henderson e5241d93e5 back out unrelated changes 2007-10-13 15:10:23 -07:00
Tom Henderson 6804f40bc4 Clarify pkt-uid field in doxygen 2007-10-13 15:06:35 -07:00
Gustavo J. A. M. Carneiro a18fc4fd93 Fix OLSR agent finalization issues. 2007-10-13 14:21:27 +01:00
Gustavo J. A. M. Carneiro 315dfd2041 Remove 'All rights reserved.' GPL-incompatible phrase from OLSR sources. 2007-10-13 13:09:55 +01:00
Tom Henderson f5513abfc8 Reverting a few OLSR changes that leaked into simple-point-to-point.cc 2007-10-12 21:28:02 -07:00
Mathieu Lacage 0296999ec8 remove dead code 2007-10-11 16:53:42 +02:00
Mathieu Lacage b2a44942a8 use the default propagation models 2007-10-11 16:51:59 +02:00
Mathieu Lacage 268e4d5ec9 support DefaultValue 2007-10-11 16:16:31 +02:00
Mathieu Lacage 4f562dbbfb add missing trailing 0/(void *)0 2007-10-11 16:16:14 +02:00
Mathieu Lacage e9127c0427 add default value support 2007-10-11 15:43:47 +02:00
Mathieu Lacage b2545f4d89 missing file 2007-10-11 13:27:39 +02:00
Mathieu Lacage 9c922e0c73 use new WifiNetDevice naming 2007-10-11 13:23:33 +02:00
Mathieu Lacage d6721ea8ef add WifiNetDevice to build 2007-10-11 13:20:55 +02:00
Mathieu Lacage c8503d149e merge with HEAD 2007-10-11 13:15:21 +02:00
Mathieu Lacage cd045df1c3 bug 86: add missing functions to manipulate Mac48Address 2007-10-11 13:11:45 +02:00
Mathieu Lacage 20b226769f constify more conversion operators 2007-10-11 13:02:47 +02:00
Mathieu Lacage 8460428f2e constify conversion operator 2007-10-11 13:00:12 +02:00
Mathieu Lacage d7f63afae7 do not use the Watchdog class 2007-10-11 10:47:01 +02:00
Craig Dowell 6ad1a5b57f don't use any for starting address 2007-10-10 12:25:52 -07:00
Craig Dowell a2388cc4b4 improve obj design example 2007-10-10 11:55:07 -07:00
Mathieu Lacage f79ee4b582 fix build 2007-10-10 16:04:25 +02:00
Mathieu Lacage 03fd848f18 merge watchdog fix 2007-10-10 16:03:45 +02:00
Mathieu Lacage 258a44de1a build STA code 2007-10-10 16:03:26 +02:00
Mathieu Lacage 20a04408a6 install watchdog.h 2007-10-10 15:59:34 +02:00
Mathieu Lacage 662356311a merge with head 2007-10-10 15:49:59 +02:00
Mathieu Lacage 806cba6352 test the watchdog 2007-10-10 15:32:17 +02:00
Mathieu Lacage b42e00961b add missing call to Simulator::Destroy to cleanup after test 2007-10-10 15:32:04 +02:00
Mathieu Lacage fc0089c0f4 add missing call to Simulator::Destroy to cleanup after test 2007-10-10 15:32:04 +02:00
Mathieu Lacage 2c9b70a674 a Watchdog class 2007-10-10 15:04:46 +02:00
Mathieu Lacage 0bb0cb7b93 implement TimerImpl::Invoke 2007-10-10 14:28:37 +02:00
Mathieu Lacage 0e9a8e6c3d move traits definition down 2007-10-10 13:30:35 +02:00
Mathieu Lacage c7d39c7975 split timer implementation outside of Timer class 2007-10-10 13:18:15 +02:00
Gustavo J. A. M. Carneiro 86abaf4009 Fix CommandLine::AddArgCommand memory leak. 2007-10-10 11:14:16 +01:00
Mathieu Lacage 382c3d1787 add NQap to build 2007-10-10 11:23:28 +02:00
Mathieu Lacage 2ac8e7e496 add management frame implementations 2007-10-10 11:18:19 +02:00
Craig Dowell 2425ad39ef bus network 2007-10-09 21:54:03 -07:00
Craig Dowell 6b5b86f343 tutorial topologies 2007-10-09 18:02:32 -07:00
Mathieu Lacage 230645ffa5 add serialization/deserialization support to Ssid/SupportedRates 2007-10-09 17:19:13 +02:00
Mathieu Lacage 3861eada88 add new code to build 2007-10-09 16:47:34 +02:00
Mathieu Lacage a1691fda9b add SupportedRates to build 2007-10-09 16:40:24 +02:00
Mathieu Lacage ec7d64d30d avoid calling un-implemented method 2007-10-09 16:15:38 +02:00
Mathieu Lacage 8cda08d41c fix coding style 2007-10-09 16:11:37 +02:00
Mathieu Lacage 05fe040f88 add MacHighAdhoc to build 2007-10-09 16:11:08 +02:00
Mathieu Lacage 756cc86a23 add Mac48Address::GetBroadcast 2007-10-09 16:09:37 +02:00
Mathieu Lacage 9e470dffc3 remove all rights reserved mention 2007-10-09 16:03:09 +02:00
Mathieu Lacage 6e2080f092 rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build 2007-10-09 16:02:21 +02:00
Mathieu Lacage 24a0b73ce3 add DcaTxop to build 2007-10-09 12:42:45 +02:00
Mathieu Lacage 473c0eecb1 add missing class prefix 2007-10-09 12:42:20 +02:00
Gustavo J. A. M. Carneiro 10baa77dbc Bug 81 (CommandLine::AddArgValue not working correctly) 2007-10-09 11:38:01 +01:00
Mathieu Lacage dec333d063 add MacRxMiddle to build 2007-10-09 12:30:51 +02:00
Mathieu Lacage 61d85c75d3 add operator < 2007-10-09 12:30:37 +02:00
Mathieu Lacage 8dab22328c add MacTxMiddle to build 2007-10-09 12:23:14 +02:00
Mathieu Lacage ac0991a7cc add WifiMacQueue to build 2007-10-09 12:20:43 +02:00
Mathieu Lacage bc276b2bc1 add Dcf to build 2007-10-09 12:17:02 +02:00
Mathieu Lacage 1e6415ce45 add MacLow to build 2007-10-09 11:36:13 +02:00
Mathieu Lacage e4f6408939 do not include dead header 2007-10-09 11:07:18 +02:00
Mathieu Lacage 497bb74d5a replace header mode with preamble mode 2007-10-09 11:07:05 +02:00
Mathieu Lacage dee939e78c remove extra WifiPhy::SendPacket argument. Add header mode support 2007-10-09 10:21:46 +02:00
Craig Dowell 79aa1535f3 topologies 2007-10-08 22:00:04 -07:00
Craig Dowell 9f2902e9d2 support for star network, example in tutorial 2007-10-08 20:51:21 -07:00
Craig Dowell ace6574179 branch merge 2007-10-08 18:52:08 -07:00
Craig Dowell 8ac82843af tutorial file names 2007-10-08 18:51:48 -07:00
Craig Dowell 3e4acb6921 more descriptive name 2007-10-08 14:50:00 -07:00
Gustavo J. A. M. Carneiro 3a41b51160 Bug 82 (Add convenience API to retrieve default values) 2007-10-08 17:49:18 +01:00
Gustavo J. A. M. Carneiro c0ed9be287 Fix bug 80 (valgrind error when finalizing PacketMetadata). 2007-10-08 17:44:17 +01:00
Mathieu Lacage bb9a9fb06d port to new MacStation API 2007-10-08 17:04:34 +02:00
Mathieu Lacage 1a0edab86e port ArfMacStations to new MacStation API 2007-10-08 17:02:20 +02:00
Mathieu Lacage 673ac3faa9 remove 'All rights reserved' 2007-10-08 16:04:59 +02:00
Mathieu Lacage 3833b9b585 remove 'All rights reserved' 2007-10-08 16:04:57 +02:00
Mathieu Lacage 6ba9224f32 port to new MacStation API 2007-10-08 16:04:12 +02:00
Mathieu Lacage d138a49895 implement broadcast/multicast MacStation 2007-10-08 15:58:07 +02:00
Mathieu Lacage 0e434f0212 fix copyright statement 2007-10-08 15:44:08 +02:00
Mathieu Lacage f807067337 use WifiMode rather than mode indexes in MacStations API. 2007-10-08 15:43:19 +02:00
Mathieu Lacage 5e5800363e add operator == for WifiMode 2007-10-08 15:42:07 +02:00
Mathieu Lacage d643cf8c1d add WifiMode mandatory flag 2007-10-08 15:36:37 +02:00
Gustavo J. A. M. Carneiro 7a37ee7c30 merge 2007-10-08 14:14:24 +01:00
Mathieu Lacage d42e7a6d0a remove 'All rights reserved' mention 2007-10-08 15:54:36 +02:00
Mathieu Lacage 115506476b add missing copyright 2007-10-08 15:50:25 +02:00
Gustavo J. A. M. Carneiro fab9df7825 Use 'const Ptr<T>' rather than 'Ptr<T> const' 2007-10-08 14:13:58 +01:00
Mathieu Lacage 0873562023 add MacStations::LookupNonUnicast 2007-10-08 14:43:53 +02:00
Mathieu Lacage ca890b509a add Mac48Address::IsBroadcast/IsMulticast 2007-10-08 14:43:29 +02:00
Mathieu Lacage 59fc14c57c move mac-station code in mac-stations 2007-10-08 14:33:29 +02:00
Mathieu Lacage 907ad64f96 merge with HEAD 2007-10-08 10:28:52 +02:00
Tom Henderson c96ad24a35 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc 2007-10-06 21:21:07 -07:00
Craig Dowell 9a7694f32a deal with static constructor problem 2007-10-12 13:41:24 -07:00
Craig Dowell 73e9110b64 branch merge 2007-10-12 12:31:29 -07:00
Craig Dowell 90439fc8c4 env var changes 2007-10-12 12:30:19 -07:00
Mathieu Lacage 1a480445c9 make sure we cleanup after ourselves in DefaultValueTests 2007-10-12 15:49:04 +02:00
Gustavo J. A. M. Carneiro adf066acdd Add a missing const. 2007-10-11 18:34:15 +01:00
Gustavo J. A. M. Carneiro a2d11d8100 Optimize EventGarbageCollector by using std::multiset with EventIds sorted by expiration time. 2007-10-11 17:26:32 +01:00
Gustavo J. A. M. Carneiro f77b8a9137 Make EventGarbageCollector private to the olsr module; adapt olsr to Timer API changes. 2007-10-11 16:17:27 +01:00
Gustavo J. A. M. Carneiro ad0241047d merge 2007-10-11 15:51:36 +01:00
Gustavo J. A. M. Carneiro 6218b00486 Bug #88 (Ipv4Address operator ==, !=, < should be inline for performance reasons) 2007-10-11 15:39:39 +01:00
Mathieu Lacage 4585f14b5f bug 87: do not export the garbage collection facility from the Timer class. 2007-10-11 17:59:59 +02:00
Gustavo J. A. M. Carneiro c0af9c2bf1 merge 2007-10-09 13:25:30 +01:00
Craig Dowell bf2adc6861 log verbosity changes 2007-10-08 18:13:26 -07:00
Gustavo J. A. M. Carneiro 743a4eaf02 Adapt the OLSR agent code to use the new Timer class. 2007-10-08 11:37:03 +01:00
Gustavo J. A. M. Carneiro 4df07ae61f merge 2007-10-08 11:24:16 +01:00
Gustavo J. A. M. Carneiro 6c1d1db4b4 Fix typo 2007-10-08 11:23:53 +01:00
Craig Dowell 11ac94d449 exercise 2007-10-05 18:52:22 -07:00
Craig Dowell a84a41bc75 add seed calls 2007-10-05 18:17:18 -07:00
Craig Dowell 5f61c348c2 prototype address and network allocation 2007-10-05 16:00:04 -07:00
Gustavo J. A. M. Carneiro ffdc440926 Add operator < to Ptr smart pointers, to make them behave well with STL containers. 2007-10-05 19:13:36 +01:00
Gustavo J. A. M. Carneiro 3457fcb48b Fix race condition in mobility-visualizer-view; reduce refresh rate to 30fps. 2007-10-04 11:24:05 +01:00
Mathieu Lacage f70700c330 add Timer::GetDelayLeft 2007-10-04 09:22:05 +02:00
Mathieu Lacage b28727ef8c make the timer a tristate object 2007-10-04 09:14:16 +02:00
Craig Dowell 3af33c8b75 enable log prefix 2007-10-03 13:34:06 -07:00
Craig Dowell 9059dd7e3e log changes 2007-10-03 12:41:17 -07:00
Gustavo J. A. M. Carneiro 2d0f686964 Compile mobility-visualizer with -fno-strict-aliasing to avoid GNOME bug #316221 2007-10-03 19:38:03 +01:00
Gustavo J. A. M. Carneiro cf896e8064 Use GStaticMutex instead of G_DEFINE_LOCK 2007-10-03 19:36:56 +01:00
Gustavo J. A. M. Carneiro 2422ec276d Fix a couple more warnings in OLSR 2007-10-03 19:11:46 +01:00
Gustavo J. A. M. Carneiro c00aa2d807 Fix unused variable warning in optimized build. 2007-10-03 19:06:31 +01:00
Gustavo J. A. M. Carneiro ab400de069 merge 2007-10-03 17:54:38 +01:00
Gustavo J. A. M. Carneiro 829a28c986 merge 2007-10-03 17:38:49 +01:00
Gustavo J. A. M. Carneiro 666850a6bc Hide the velocity vector if it is null. 2007-10-03 17:38:05 +01:00
Gustavo J. A. M. Carneiro 89ff51cc09 mereg 2007-10-03 17:33:45 +01:00
Gustavo J. A. M. Carneiro c0ea316f44 Draw the velocity vector 2007-10-03 17:29:27 +01:00
Gustavo J. A. M. Carneiro 7fae03e300 Add a small mobility model visualization tool 2007-10-03 16:38:17 +01:00
Mathieu Lacage 728d858f15 add CrMacStations to build 2007-10-03 15:46:28 +02:00
Mathieu Lacage 2029981f00 build MacParameters 2007-10-03 15:44:02 +02:00
Gustavo J. A. M. Carneiro 3e2e67d88d hg ignore doc/trace-source-list.h 2007-10-03 13:59:32 +01:00
Gustavo J. A. M. Carneiro 4fd5e3dc74 Now run doxygen again before the build, but the doc/trace-source-list.h is generated during waf check; make doxygen less verbose, and give a warning when doc/trace-source-list.h is missing. 2007-10-03 13:58:01 +01:00
Mathieu Lacage 17a02b8fbb install header 2007-10-03 14:22:41 +02:00
Mathieu Lacage 75a174bc7b no need for ns3 prefix 2007-10-03 14:22:03 +02:00
Mathieu Lacage 086e01fcb8 no need for ns3 prefix 2007-10-03 14:21:19 +02:00
Mathieu Lacage a219428887 add missing header 2007-10-03 14:20:07 +02:00
Mathieu Lacage ca86b0acf9 add missing header 2007-10-03 14:19:54 +02:00
Mathieu Lacage f20df8a492 build WifiMacTrailer 2007-10-03 14:19:24 +02:00
Mathieu Lacage d742b306d7 forgot to add wscript file 2007-10-03 14:11:10 +02:00
Mathieu Lacage 119c647097 build WifiMacHeader 2007-10-03 14:08:31 +02:00
Mathieu Lacage 64c6fa6525 add more files to build 2007-10-03 13:12:26 +02:00
Mathieu Lacage 5a7965468d add MacStation to build 2007-10-03 13:11:28 +02:00
Mathieu Lacage 855ccbf300 add MacStations to build 2007-10-03 13:10:44 +02:00
Mathieu Lacage 855d52908b add Timer::Suspend/Resume/IsSuspended 2007-10-03 13:01:29 +02:00
Mathieu Lacage 1440302ab3 add Simulator::GetDelayLeft 2007-10-03 13:01:12 +02:00
Mathieu Lacage 9e055bd52f implement WifiPhy::GetChunkSuccessRate 2007-10-03 11:35:07 +02:00
Mathieu Lacage d4a36c2e0f use WifiMode rather than TransmissionMode 2007-10-03 11:01:17 +02:00
Craig Dowell ef9c8a4716 tutorial 2007-10-02 15:34:00 -07:00
Gustavo J. A. M. Carneiro cd21a5ed8a In trace sources list documentation, make the trace path stand out better, as it is extremely important but previously easy to miss. 2007-10-02 11:51:45 +01:00
Mathieu Lacage 1d0c9511a5 Phy80211 -> WifiPhy 2007-10-02 12:42:16 +02:00
Mathieu Lacage cd73b37673 WifiPhy class 2007-10-02 12:41:04 +02:00
Gustavo J. A. M. Carneiro f970ede20b merge 2007-10-02 11:11:27 +01:00
Gustavo J. A. M. Carneiro 9308382295 Run the program print-trace-sources to generate doc/trace-source-list.h when generating docs. As a side effect, --doxygen is now has to be processed at the end of the build. 2007-10-02 11:10:31 +01:00
Mathieu Lacage caf0a2c143 add ssid to build 2007-10-02 11:38:47 +02:00
Mathieu Lacage 06cb649b55 add missing implementations 2007-10-02 11:36:12 +02:00
Mathieu Lacage e216675ca1 remove uneeded forward declaration 2007-10-02 11:32:16 +02:00
Tom Henderson fec546e939 Fix callbacks in packet-sink 2007-10-01 21:04:46 -07:00
Gustavo J. A. M. Carneiro e7fb2a2c7c According to the literature, in RandomWaypointMobilityModel the pause should come before the walk, not after; fixed. 2007-10-01 18:55:04 +01:00
Gustavo J. A. M. Carneiro 1bc6f6eeda Add ns2-mobility-file-topology sources 2007-10-01 18:01:38 +01:00
Gustavo J. A. M. Carneiro afc46ac1d3 Adapt to StaticSpeedHelper change 2007-10-01 17:11:06 +01:00
Gustavo J. A. M. Carneiro 636e47d219 Adapt to StaticSpeedHelper change 2007-10-01 17:10:46 +01:00
Gustavo J. A. M. Carneiro 9c219d647d Refactor handling of pauses in StaticSpeedHelper to fix bug (must return null speed when paused) 2007-10-01 17:10:15 +01:00
Gustavo J. A. M. Carneiro 99da16b834 Improve the precision of the RandomDirection2dMobilityModel::PI constant (value copied from glibc's math.h header file). 2007-10-01 15:11:16 +01:00
Gustavo J. A. M. Carneiro d8e5697bfe Add the random-direction-2d-mobility-model.cc,h sources to the build. 2007-10-01 15:05:43 +01:00
Gustavo J. A. M. Carneiro b504a88459 Add a bit of function name logging. 2007-10-01 15:05:03 +01:00
Mathieu Lacage 3745686f38 merge with trunk 2007-10-01 15:41:19 +02:00
Gustavo J. A. M. Carneiro fda2e2d34d merge 2007-10-01 14:34:47 +01:00
Gustavo J. A. M. Carneiro 2f4da0f0b0 Make Object::QueryInterface and AddInterface check for the aggregate refcount instead of the object refcount, reason explained in a comment near Object::CheckLoose. Add the same check also to TraceConnect/Disconnect and GetTraceResolver. 2007-10-01 14:33:17 +01:00
Mathieu Lacage 327e60b275 do not use Packet objects directly. Use Ptr<Packet> instead 2007-10-01 14:15:56 +02:00
Mathieu Lacage 2450bac944 add Packet::Ref/Unref methods 2007-10-01 14:14:31 +02:00
Mathieu Lacage 46fe0fbc29 Simplify and optimize Create template function. Add Ptr::operator * 2007-10-01 14:07:53 +02:00
Gustavo J. A. M. Carneiro 8f30f628a0 Minor code readability improvements. 2007-10-01 12:45:27 +01:00
Gustavo J. A. M. Carneiro 27ba7608db Use this-> to access member variables of Rectangle, for clarity. 2007-10-01 12:34:32 +01:00
Gustavo J. A. M. Carneiro d2cd341615 merge 2007-10-01 12:01:26 +01:00
Gustavo J. A. M. Carneiro 978e3e6e81 merge 2007-10-01 12:00:31 +01:00
Gustavo J. A. M. Carneiro 5099bebba5 Put back an assertion in Object::DoQueryInterface, erroneously removed during branch merging. 2007-10-01 11:42:41 +01:00
Gustavo J. A. M. Carneiro 6951f13ce4 On course-change, print velocity in addition to position. 2007-09-28 19:13:19 +01:00
Gustavo J. A. M. Carneiro ea76a9f88e Create real nodes, not just mobility models. 2007-09-28 19:04:11 +01:00
Gustavo J. A. M. Carneiro 35ed9727d3 Add NotifyCourseChange support to RandomWaypointMobilityModel, and fix a bug in GetSpeed. 2007-09-28 18:17:25 +01:00
Gustavo J. A. M. Carneiro b7ddc30244 Fix bad RandomWaypointPosition default value 2007-09-28 17:33:18 +01:00
Gustavo J. A. M. Carneiro e525cd4465 Fix infinite loop in CommandLine::Parse when trying to ignore a badly formed parameter. 2007-09-28 17:13:20 +01:00
Gustavo J. A. M. Carneiro 3898752f67 Fix infinite loop in CommandLine::Parse when trying to ignore a badly formed parameter. 2007-09-28 17:13:20 +01:00
Gustavo J. A. M. Carneiro c0b11f6eab Update random mobility sample to new API 2007-09-28 16:54:04 +01:00
Gustavo J. A. M. Carneiro b6d9bf7319 Fix the enumeration value list end marker (0 and (void*)0 are very different things in amd64) 2007-09-28 16:51:34 +01:00
Gustavo J. A. M. Carneiro 16e4a3c10e Compile the random-walk-2d-mobility-model sources. 2007-09-28 16:50:15 +01:00
Mathieu Lacage 4b00999550 add a Timer::Schedule (delay) method 2007-09-28 16:14:16 +02:00
Mathieu Lacage c5797b916f add tests 2007-09-28 13:27:37 +02:00
Mathieu Lacage 7a6385b614 add support for 6-arg Timer::SetFunction 2007-09-28 13:19:43 +02:00
Mathieu Lacage 5391aa0fa2 add support for 6-arg SetArguments 2007-09-28 13:02:14 +02:00
Gustavo J. A. M. Carneiro 06659f1dfc merge 2007-09-28 11:59:46 +01:00
Mathieu Lacage eec001cad4 add 6 arg support to pointer to function traits 2007-09-28 12:49:05 +02:00
Mathieu Lacage d953614fe4 add 6 arg support to pointer to member traits 2007-09-28 12:46:17 +02:00
Mathieu Lacage 82070b999c simplicy policy handling 2007-09-28 10:42:29 +02:00
Mathieu Lacage cbf46c9ec4 re-implement the Timer class with the new type traits 2007-09-28 10:33:19 +02:00
Mathieu Lacage 13347878df implement the helper IntToType template 2007-09-28 10:32:59 +02:00
Mathieu Lacage 343d9fd63f forgot to add the nArgs enum in FunctionPtrTraits 2007-09-28 10:32:15 +02:00
Mathieu Lacage 4d1ab8f4ba rewrite the TypeTraits and add some tests 2007-09-28 09:27:57 +02:00
Gustavo J. A. M. Carneiro f7ff4d6cc7 merge 2007-09-27 12:49:17 +01:00
Mathieu Lacage c1717498f4 add testcase, make it work 2007-09-27 13:48:32 +02:00
Mathieu Lacage 74a57d9e12 implement the member function version of Timer::SetFunction (a1) 2007-09-27 13:45:55 +02:00
Gustavo J. A. M. Carneiro df3bfb2771 WAF: set env['INCLUDEDIR'] to PREFIX/include so that ns3 headers get installed on 'waf install' (also shuts up the warnings in waf distcheck) 2007-09-27 12:44:29 +01:00
Gustavo J. A. M. Carneiro 76dc77106f WAF: update to WAF trunk to get bug fixes and smaller script. 2007-09-27 12:40:01 +01:00
Mathieu Lacage 265df9d0f2 add some doxygen 2007-09-27 13:31:20 +02:00
Mathieu Lacage e4352e3c5a add doxygen for Timer class and implement the policy flags 2007-09-27 13:27:18 +02:00
Mathieu Lacage da44de59b9 Implement a Timer API 2007-09-27 12:51:17 +02:00
Mathieu Lacage 8180ca7a9d add TypeTraits<T>::NonConstType 2007-09-27 12:50:55 +02:00
Gustavo J. A. M. Carneiro 71125e4833 Event Garbage Collector 2007-09-27 12:50:26 +02:00
Craig Dowell 5408c387ba branch merge 2007-09-26 19:55:35 -07:00
Craig Dowell 8df3425a2e tutorial files 2007-09-26 19:55:09 -07:00
Gustavo J. A. M. Carneiro eb4e4b6b05 Enable ASCII tracing unconditionally, now that the associated problem is fixed in OLSR. 2007-09-26 18:28:42 +01:00
Gustavo J. A. M. Carneiro 166563d343 Make the OLSR headers usable from the AciiTracing point of view 2007-09-26 18:27:52 +01:00
Gustavo J. A. M. Carneiro f6dcef3b49 Add a couple of NS_LOG_PARAM calls for debugging. 2007-09-26 18:09:19 +01:00
Gustavo J. A. M. Carneiro 299015ae5d Add a couple of NS_LOG_PARAM calls for debugging. 2007-09-26 18:09:19 +01:00
Gustavo J. A. M. Carneiro dbc4beb71a merge 2007-09-25 17:16:57 +01:00
Gustavo J. A. M. Carneiro 7d23d0c5b0 Cleanup copyright headers and some unused includes. 2007-09-25 16:26:02 +01:00
Craig Dowell ac9d618188 add tutorial files 2007-09-24 13:28:27 -07:00
Gustavo J. A. M. Carneiro 87cd21f1f8 Need to enable packet metadata early, else we trigger an assertion. 2007-09-24 18:54:14 +01:00
Gustavo J. A. M. Carneiro a54dc98fad merge 2007-09-24 16:32:03 +01:00
Gustavo J. A. M. Carneiro 392b535cf0 Check for the common error of enabling packet metadata in the middle of a simulation, and give appropriate advice in this case. Closes #78. 2007-09-24 16:11:43 +01:00
Gustavo J. A. M. Carneiro eecce3f414 Move EventCollector and SingleEvent classes, making them private to the OLSR code. 2007-09-24 11:39:31 +01:00
Gustavo J. A. M. Carneiro bea31d6487 merge with ns-3-dev 2007-09-24 11:09:17 +01:00
Gustavo J. A. M. Carneiro bd51ec2c87 Fix a regression in handling of broadcast packets and UDP sockets (closes bug #51). 2007-09-24 11:00:08 +01:00
Gustavo J. A. M. Carneiro 75c461c8f9 Remove a redundant log message 2007-09-21 18:07:54 +01:00
Gustavo J. A. M. Carneiro c8d4f578af Call Simulator::Destroy () before running simulator unit tests, to force time to start from zero (some tests check for absolute times) 2007-09-21 18:04:53 +01:00
Gustavo J. A. M. Carneiro 4b242b57c8 Use NS_TEST_* macros for simulator unit tests 2007-09-21 17:57:06 +01:00
Gustavo J. A. M. Carneiro 6a5e3bf70d Fix a small error in the unit test added recently (though it doesn't change the result) 2007-09-21 15:57:20 +01:00
Gustavo J. A. M. Carneiro 43bb81fd82 Add a couple of Udp socket unit tests: unicast (passing) and broadcast (failing, bug #51). 2007-09-21 15:54:00 +01:00
Gustavo J. A. M. Carneiro 1f6d0347cc Update OLSR example. 2007-09-21 14:28:05 +01:00
Gustavo J. A. M. Carneiro 0826d6de53 merge with ns-3-dev 2007-09-21 13:59:03 +01:00
Tom Henderson df5905ace6 Added tag release ns-3.0.6 for changeset 606df29888e7 2007-09-15 14:07:35 -07:00
Tom Henderson acadb46e6c bump version number 2007-09-15 13:56:21 -07:00
Tom Henderson ccee2254e0 release notes for 3.0.6 2007-09-15 13:52:59 -07:00
Tom Henderson e26b497ccc Add PacketSink to receive multicast 2007-09-14 16:23:49 -07:00
Tom Henderson 5e49ae47a9 change port number used by example scripts to 'discard' or 'echo' instead of '80' 2007-09-14 16:17:10 -07:00
Tom Henderson 1d79c8dc53 change ephemeral port range to 49152-65535 (IANA recommendation) 2007-09-14 16:11:36 -07:00
Tom Henderson 7bf7f4bbe5 add PacketSinks, change port number to UDP discard port, fix comment on onoff-application, delete logic for setting a default route 2007-09-14 15:57:49 -07:00
Tom Henderson bba1cb3859 remove local address setting from UdpSocket::Connect() 2007-09-14 15:46:04 -07:00
Tom Henderson 36b77224c5 Remove temporary module documentation 2007-09-14 14:55:18 -07:00
Tom Henderson b310b6745d Revert accidental tweaks of example files (not intended for checkin) 2007-09-14 14:52:09 -07:00
Tom Henderson 9ef345f02d Enable enqueue/dequeue tracing for point-to-point links 2007-09-14 14:42:31 -07:00
Craig Dowell 8649c899db allow discrete levels 2007-09-14 09:57:53 -07:00
Craig Dowell ed9f98bda1 disable log unless debug build 2007-09-13 22:17:29 -07:00
Craig Dowell 2e1dcf1479 debug to log 2007-09-13 21:36:32 -07:00
Craig Dowell 90b02a4f6c checkpoint debug to log 2007-09-13 17:47:42 -07:00
Craig Dowell 16b634a7fc sorting out logging 2007-09-13 12:37:30 -07:00
Craig Dowell 873176a3e6 add tutorial directory and hello-simulator 2007-09-13 11:04:47 -07:00
Craig Dowell 6c30d76401 merge with trunk 2007-09-13 10:53:24 -07:00
Craig Dowell 9bc6fe4e7a finish up basic echo apps 2007-09-13 10:52:41 -07:00
Gustavo J. A. M. Carneiro 013a31afdb merge 2007-09-13 15:31:55 +01:00
Tom Henderson 57b0050ae7 change NS_DEBUG component name in simple-point-to-point.cc 2007-09-12 21:32:26 -07:00
Craig Dowell 61a105af21 working one way echo app 2007-09-12 16:54:21 -07:00
Craig Dowell 51a6c25e16 log rides along for free 2007-09-12 16:24:31 -07:00
Craig Dowell 0e3ff45eb9 server half 2007-09-12 16:20:07 -07:00
Craig Dowell 77e7c6f60f start of udp echo applications 2007-09-12 15:23:25 -07:00
Gustavo J. A. M. Carneiro d09deab2f1 Adapt OLSR to routing API changes 2007-09-12 18:28:18 +01:00
Gustavo J. A. M. Carneiro 3e77a6301d merge with ns-3-dev 2007-09-12 18:06:09 +01:00
Mathieu Lacage 3e89ecfdf6 rename Euixx to Macxx 2007-09-12 11:39:46 +02:00
Mathieu Lacage 644fffd69f merge with trunk 2007-09-12 11:22:32 +02:00
Mathieu Lacage a84dd0068c enable buffer heuristics 2007-09-12 11:22:05 +02:00
Mathieu Lacage eb05af8e74 add 'internal' documentation, cleanup a bit 2007-09-12 11:16:18 +02:00
Mathieu Lacage 7c6c5fe445 fix non-optimized build 2007-09-12 10:11:57 +02:00
Mathieu Lacage 191c80211b fix copyright statements 2007-09-12 09:34:38 +02:00
Tom Henderson b13164b2c0 turn off DEBUG on simple-point-to-point 2007-09-11 23:38:18 -07:00
Tom Henderson 28456d5486 branch merge 2007-09-11 22:47:13 -07:00
Tom Henderson eb99e12003 Copyrights/licenses for routing code 2007-09-11 22:46:29 -07:00
Tom Henderson 058529526c Remove m_quiet variable, fix copyright 2007-09-11 22:40:04 -07:00
Craig Dowell 49cf104a12 variable unused in optimized build -- fixed via attribute 2007-09-11 19:40:50 -07:00
Craig Dowell b639466adb turn off debugging flags 2007-09-11 19:11:03 -07:00
Craig Dowell 1cf86b9641 integrating broadcast with multicast and sockets with multiple interfaces required default route for disambiguation 2007-09-11 19:09:49 -07:00
Craig Dowell f894771e7d socket update broke multicast 2007-09-11 18:29:26 -07:00
Craig Dowell 451a4762df merge with trunk again 2007-09-11 12:20:09 -07:00
Gustavo J. A. M. Carneiro 92313a2d64 merge 2007-09-11 15:09:55 +01:00
Gustavo J. A. M. Carneiro 94743678a9 Use NS_DEBUG instead of NS_DEBUG_UNCOND in PacketSink code. 2007-09-11 15:09:00 +01:00
Gustavo J. A. M. Carneiro 4a6e5ee331 merge with ns-3-dev 2007-09-11 14:52:15 +01:00
Gustavo J. A. M. Carneiro b284eab745 WAF: in optimized builds, replace -O2 with -O3 2007-09-11 14:44:23 +01:00
Mathieu Lacage 6969cf239a optimize Iterator::ReadU8 2007-09-11 15:06:27 +02:00
Mathieu Lacage 2b3b68605e optimize Buffer::WriteU8 variants 2007-09-11 14:56:10 +02:00
Gustavo J. A. M. Carneiro 738735b808 WAF: fix debug level to be 'ultradebug' by default, instead of 'debug'. 2007-09-11 13:37:23 +01:00
Gustavo J. A. M. Carneiro c1034b9344 WAF: remove redundant -Wall (was appearing twice) 2007-09-11 13:33:06 +01:00
Mathieu Lacage 42e6c413b6 optimize Buffer::WriteU8 2007-09-11 14:10:02 +02:00
Mathieu Lacage 4e75362d4b move around Iterator code 2007-09-11 13:53:39 +02:00
Mathieu Lacage 9bbfa99b4c print some statistics about free list efficiency 2007-09-11 13:47:17 +02:00
Mathieu Lacage 1f49f40faa add a few missing doxygen method documentations 2007-09-11 12:42:37 +02:00
Mathieu Lacage 69735ce1a5 merge gustavo's changes 2007-09-11 12:13:16 +02:00
Mathieu Lacage 8d1ac59134 merge tracing overhaul in trunk 2007-09-11 12:11:00 +02:00
Gustavo J. A. M. Carneiro 3407a01845 Update and fix (entries are searched regexps, not globs) the hg ignored files list. 2007-09-11 11:04:06 +01:00
Mathieu Lacage 485a114a2d merge with trunk 2007-09-11 10:36:25 +02:00
Mathieu Lacage 4ae082bfc7 avoid allocating strings all the time. 2007-09-11 10:35:56 +02:00
Mathieu Lacage cbd6277844 merge with trunk 2007-09-11 10:01:23 +02:00
Mathieu Lacage 96f04b41cb re-enable packet benchmarking 2007-09-11 08:27:27 +02:00
Mathieu Lacage ba9338c522 ignore waf crap 2007-09-11 08:27:15 +02:00
Craig Dowell b39cf878a0 name changes missed 2007-09-10 15:57:33 -07:00
Craig Dowell 20bf1d71bb merge with trunk 2007-09-10 15:50:07 -07:00
Mathieu Lacage 313a167729 we handle gustavo's testcase now. Fix for bug 72 2007-09-10 18:52:48 +02:00
Mathieu Lacage ca342d8de2 fix buggy assert 2007-09-10 18:49:00 +02:00
Mathieu Lacage 0c2dd78f3b update carefully m_maxZeroAreaSize and update correctly m_end and m_zeroAreaEnd in RemoveAtStart 2007-09-10 18:43:29 +02:00
Mathieu Lacage 3c81d0423e it is possible to zeroAreaStart to be bigger than the data buffer size 2007-09-10 17:55:39 +02:00
Mathieu Lacage 3fcc420e08 CreateFullCopy: the data area at the end of the buffer starts at m_zeroAreaStart. AddAtStart: the assert should be used only when the optimization is enabled. 2007-09-10 17:43:33 +02:00
Mathieu Lacage 65c099c02a max zero area start can be bigger than m_end if data is removed from end of buffer 2007-09-10 16:57:25 +02:00
Mathieu Lacage c197a4a62c add state checking and fix Buffer::CreateFullCopy 2007-09-10 16:55:26 +02:00
Mathieu Lacage 60fbe881c1 improve debugging output 2007-09-10 16:55:03 +02:00
Mathieu Lacage e96365a4bc rewrite the buffer code extensively 2007-09-10 16:45:52 +02:00
Mathieu Lacage 1e865deaaf add Buffer::m_zeroAreaStart 2007-09-10 08:54:11 +02:00
Mathieu Lacage df98467eaf Added tag buffer-working-before-breaking for changeset 267e2ebc28e4 2007-09-10 08:53:55 +02:00
Tom Henderson 7265a5f3c0 adapt some example scripts to use the new PacketSink 2007-09-09 23:24:31 -07:00
Tom Henderson 0ac1983b66 Add PacketSink application 2007-09-09 23:21:47 -07:00
Mathieu Lacage a0e8906575 make Buffer::m_end really represent the end of the data rather than its size 2007-09-09 21:16:05 +02:00
Mathieu Lacage f13dc2777d Buffer::m_size -> Buffer::m_end 2007-09-09 10:38:22 +02:00
Mathieu Lacage 0f588a8d97 add testcase 2007-09-07 19:51:46 +02:00
Mathieu Lacage 6ce3443a34 add failing testcase 2007-09-07 19:50:40 +02:00
Mathieu Lacage 1e448915d1 get rid of GetIndex 2007-09-07 19:47:06 +02:00
Mathieu Lacage a9124f0a4a re-implement all Iterator::Write and Iterator::Read methods 2007-09-07 19:39:47 +02:00
Mathieu Lacage bd1adba17e rewrite Iterator::WriteU8 2007-09-07 19:22:20 +02:00
Mathieu Lacage 39cb30a4be simplify Iterator::GetDistanceFrom method 2007-09-07 18:49:47 +02:00
Mathieu Lacage 6ced31f8b5 add a m_dataStart member in Buffer::Iterator 2007-09-07 18:45:00 +02:00
Mathieu Lacage 74ceb06336 small typo 2007-09-07 17:39:18 +02:00
Mathieu Lacage ee35d8ada2 move inline code from header to .cc file prior to rework of Buffer 2007-09-07 08:34:46 +02:00
Craig Dowell 4e92674be7 monster changeset 2007-09-06 16:24:17 -07:00
Craig Dowell a39d25f6c1 readme file includes APIs 2007-09-06 15:57:53 -07:00
Mathieu Lacage 0147e59899 move include to implementation file 2007-09-06 18:19:22 +02:00
Gustavo J. A. M. Carneiro a08faa038f Stop OLSR simulation after 10 seconds (since OLSR never stops generating events) 2007-09-06 15:18:14 +01:00
Gustavo J. A. M. Carneiro 42189e5c52 Update OLSR code to NS-3 API changes. 2007-09-06 13:34:54 +01:00
Mathieu Lacage 6c05ba06ff rename ConnectPrinterToAll to TraceAll 2007-09-06 13:32:29 +02:00
Mathieu Lacage 1a75a82523 add support for NodeList::ConnectPrinterToAll 2007-09-06 12:56:31 +02:00
Mathieu Lacage 8b5b6d3636 add bound callback tests and make them work 2007-09-06 12:33:22 +02:00
Mathieu Lacage fd8b0ba57d an euclidian distance is always positive 2007-09-06 11:18:35 +02:00
Mathieu Lacage 187ae2fe0e add tests, fix the failing tests and add support for 6-arg callbacks 2007-09-06 10:04:19 +02:00
Gustavo J. A. M. Carneiro 4a6a601b5a fix olsr wscript 2007-09-05 18:46:13 +01:00
Gustavo J. A. M. Carneiro 5631c4d214 merge 2007-09-05 18:42:41 +01:00
Gustavo J. A. M. Carneiro 6be5ea55ce merge with ns-3-dev 2007-09-05 18:35:39 +01:00
Mathieu Lacage b43e2f9190 add failing test and fix for assignment to self 2007-09-05 16:28:55 +02:00
Mathieu Lacage eb81a302b0 fix a small typo 2007-09-05 12:39:11 +02:00
Mathieu Lacage 6b8f9a0d07 add missing section on simple trace connection 2007-09-05 12:36:21 +02:00
Mathieu Lacage 7d8b071049 add an overload of the TraceSource::AddCallback method 2007-09-05 12:34:53 +02:00
Mathieu Lacage e143b5d142 re-organize the tutorial and use sections 2007-09-05 12:08:57 +02:00
Tom Henderson 929e23b74e Fix for bug69: set local address correctly upon UDP connect; apply correct UDP connect() semantics (that sendto cannot override addresses on a connected socket); if destination is IPv4 limited broadcast address, convert to subnet-directed broadcast and send out on each interface; provide example csma-broadcast.cc script 2007-09-04 21:26:54 -07:00
Craig Dowell 07fb4b1e5b clarify use of wildcards in multicast routes versus default mulicast routes. 2007-09-04 18:06:06 -07:00
Craig Dowell f652969936 Don't flood multicasts if no route found 2007-09-04 15:10:47 -07:00
Craig Dowell 65c0b60e5f piles of doxygen, changes to SetDefaultMulticastRoute plumbing 2007-09-04 14:38:40 -07:00
Mathieu Lacage 5b76e3e70f merge with trunk 2007-09-04 15:35:23 +02:00
Mathieu Lacage 99d7c597b6 move tracing tutorial to doc directory 2007-09-04 15:34:04 +02:00
Tom Henderson 5e7e0d7b2a Fold the two patches for bu6 69 together, building on the bug 65 patch 2007-09-03 23:32:23 -07:00
Tom Henderson e377cbad38 Provide two new Ipv4 convenience functions: GetIfIndexByIpv4Address() and GetIpv4RouteToDestination (), and align global routing code to use the first function 2007-09-03 14:55:51 -07:00
Gustavo J. A. M. Carneiro 0824ceacd9 WAF: as suggested by George, add a bunch of helper waf scripts that call the toplevel waf script, so that it is possible to compile with ./waf from emacs regardless of which buffer you are visiting (the other alternative is to install waf system wide and run 'waf'. 2007-09-08 19:24:39 +01:00
Mathieu Lacage 4ddb327597 finish trace tutorial 2007-08-30 16:38:41 +02:00
Mathieu Lacage e068eb8bd1 add missing requirement to doxygen 2007-08-30 16:38:26 +02:00
Mathieu Lacage 0a9cb8d248 start section on registering new TraceSource objects 2007-08-30 16:00:26 +02:00
Mathieu Lacage bb1711de60 add section on TraceContexts in tutorial 2007-08-30 15:45:46 +02:00
Mathieu Lacage 8c85cc598d add missing const 2007-08-30 15:20:08 +02:00
Mathieu Lacage 5883e3db52 make sure that l4 protocols are correctly registered within the tracing namespace 2007-08-30 15:14:26 +02:00
Mathieu Lacage 2894f50005 add explanatory diagram 2007-08-30 14:57:59 +02:00
Mathieu Lacage 87a9c29cf7 add doxygen for each TraceSourceElement subclass 2007-08-30 14:54:05 +02:00
Mathieu Lacage 471e30d85e fix dox warnings 2007-08-30 14:42:38 +02:00
Mathieu Lacage 3330ba77b1 GetName -> GetTypeName 2007-08-30 14:35:44 +02:00
Mathieu Lacage 62df1e933b rewrite the TraceContext::SourceCollection::Iterator class 2007-08-30 14:25:09 +02:00
Mathieu Lacage d23b3123ba move printing to client code 2007-08-30 13:58:15 +02:00
Craig Dowell 2d73bd9927 Move MakeMulticastAddress to NetDevice 2007-08-29 12:11:11 -07:00
Mathieu Lacage ca379f0814 reference the proper trace source list group 2007-08-29 16:43:19 +02:00
Mathieu Lacage c5b3ed12a0 add PrintDoxygen method 2007-08-29 16:43:04 +02:00
Mathieu Lacage 0e177e766a add iterator to go through available list 2007-08-29 16:42:55 +02:00
Mathieu Lacage 15234069fe add trace-source-file.h to doxygen list 2007-08-29 16:42:18 +02:00
Mathieu Lacage 45c531c463 ignore empty file 2007-08-29 16:42:00 +02:00
Mathieu Lacage 01d0b1767c empty file for doxygen generation 2007-08-29 16:41:23 +02:00
Mathieu Lacage 45f247393e add some text on trace sink signatures 2007-08-29 15:11:29 +02:00
Mathieu Lacage c8967b4b5e add some tracing documentation 2007-08-29 14:43:31 +02:00
Mathieu Lacage cd40e70901 improve output of list of existing traces 2007-08-29 14:41:21 +02:00
Mathieu Lacage ec3c5c7774 s/lowleveltracing/tracing/ 2007-08-29 14:30:58 +02:00
Mathieu Lacage 69c4f021c9 make the output of the list of existing traces more readable 2007-08-29 14:30:44 +02:00
Gustavo J. A. M. Carneiro a2fb5d5cbe merge 2007-08-29 12:32:18 +01:00
Gustavo J. A. M. Carneiro 0261a0b795 New WAF, avoids the bright yellow color (hard to read on light background terminals) problem. 2007-08-29 12:31:17 +01:00
Mathieu Lacage 3b2ffd1a07 merge with trunk 2007-08-29 09:36:28 +02:00
Mathieu Lacage e20b40ee61 backout 9856d1175cbb:642d6798feaa:27dd3e15308a 2007-08-29 09:35:53 +02:00
Gustavo J. A. M. Carneiro a882435757 Add some tweaks to enable building under emacs. 2007-08-28 16:54:07 +01:00
Gustavo J. A. M. Carneiro afbb95d987 Build the ns3 library in the build/<variant> root, not in build/<variant>/src. 2007-08-28 16:53:01 +01:00
Raj Bhattacharjea 74f9163b24 Remove references to really-simple-point-to-point, fix build 2007-08-28 10:20:13 -04:00
Mathieu Lacage cda26929bd some doxygen additions 2007-08-28 16:06:12 +02:00
Mathieu Lacage f9a6120685 avoid method naming ambiguity in CompositeTraceResolver 2007-08-28 15:59:49 +02:00
George Riley 979da57982 Reconcile changes with Mathieu's latest 2007-08-28 09:55:21 -04:00
Mathieu Lacage 33e923540a add some doxygen 2007-08-28 15:04:37 +02:00
Mathieu Lacage c384b746f7 add doxygen documentation and rename TraceContext::Get to TraceContext::GetElement 2007-08-28 14:51:13 +02:00
Mathieu Lacage 4d9cf433ff constify 2007-08-28 14:33:53 +02:00
Mathieu Lacage 380cdf687a merge with trunk 2007-08-28 14:32:44 +02:00
Mathieu Lacage 722fb64245 use more NodeList::Iterator types 2007-08-28 14:31:53 +02:00
Mathieu Lacage 67b0c98578 merge with trunk 2007-08-28 14:10:54 +02:00
Mathieu Lacage 9f6f56f3ff use the NodeList::Iterator type 2007-08-28 14:09:52 +02:00
Mathieu Lacage 91a6beb749 api doxygen for Object base class 2007-08-28 13:14:43 +02:00
Mathieu Lacage a5cf22af80 document trace source signatures 2007-08-28 13:10:18 +02:00
Mathieu Lacage cc6d4c0c06 constify 2007-08-28 13:03:08 +02:00
Mathieu Lacage 0b0a187967 document trace source signature 2007-08-28 12:42:27 +02:00
Mathieu Lacage 966643a542 improve trace list output 2007-08-28 12:06:15 +02:00
Mathieu Lacage 04569d27b7 merge with trunk 2007-08-28 12:05:35 +02:00
Mathieu Lacage f55a3c0b3d document also mobility model notifier 2007-08-28 11:22:01 +02:00
Mathieu Lacage 579a173fbf avoid problems with recursive use of Object::DoCollectSources 2007-08-28 11:21:42 +02:00
Mathieu Lacage fa4bcd0cd4 make sure to get to the parent during trace resolution 2007-08-28 11:20:55 +02:00
Mathieu Lacage 8acd0300cd keep track of trace source help strings 2007-08-28 11:01:00 +02:00
Mathieu Lacage 65f12f1df5 replace TraceResolver::PrintAvailable with TraceResolver::CollectSources 2007-08-28 09:37:10 +02:00
Craig Dowell 551fe6ebc5 real multicast enet addr, more source routes, default multicast route 2007-08-27 23:46:14 -07:00
Mathieu Lacage 95c06276cf add TraceResolver::CollectSources 2007-08-27 20:46:10 +02:00
Mathieu Lacage 403ece5588 add TraceContext::IsSimilar 2007-08-27 20:45:49 +02:00
Mathieu Lacage fce27dc4de add TraceResolver::PrintAvailable method 2007-08-27 20:25:15 +02:00
Mathieu Lacage b41cef3631 add TraceContext::PrintAvailable 2007-08-27 16:02:55 +02:00
Mathieu Lacage 3eeae90472 replace enum with virtual class and subclasses 2007-08-27 15:34:57 +02:00
Mathieu Lacage e366a6eed4 remove dead code 2007-08-27 15:07:39 +02:00
Mathieu Lacage 90c8be1fa3 add TraceContextElement::GetName method 2007-08-27 14:59:50 +02:00
Mathieu Lacage 669ce539dd cleanup a bit 2007-08-27 14:06:11 +02:00
Mathieu Lacage ccef3f6d9f remove TraceRoot 2007-08-27 13:36:40 +02:00
Mathieu Lacage c1b38a9203 rename TraceContext::Add to AddElement and Union 2007-08-27 13:21:59 +02:00
Mathieu Lacage 3f159872c0 add operator << for Packet and TraceContext 2007-08-27 13:15:27 +02:00
Mathieu Lacage 9a836af0d0 add image path 2007-08-27 13:15:13 +02:00
Craig Dowell 4e486b1f59 semi-real multicast hardware addresses 2007-08-24 17:38:49 -07:00
Craig Dowell 217edad33c add ipv4 methods, remove source multicast route requirement, fix udp socket source address prob 2007-08-24 16:57:54 -07:00
Craig Dowell 89a326ebc5 merge with trunk 2007-08-24 13:29:51 -07:00
Raj Bhattacharjea bce75ae3a8 Removed SConstruct file 2007-08-24 16:05:17 -04:00
Raj Bhattacharjea 9bf17256fb Fixed inet-socket-address's opening IFDEF to be consistent with the filename 2007-08-24 14:00:52 -04:00
Raj Bhattacharjea 027cd21aa1 Added GPL and emacs modeline to inet-socket-address.h/cc 2007-08-24 13:21:33 -04:00
George Riley 391b3eef11 Change the protocol stack processing to pass packets by non-const
reference, rather than const reference and value as was previously done.
Also change  the queue semantics to return the packet on a deque, rather
than requiring a packet as a parameter.  The problem with the original
approach was that packet UID's were getting skipped.  The fix handles
the uid properly, and we get sequential packet uid's on the trace file.
2007-08-24 11:44:11 -04:00
Mathieu Lacage 4bf8491d01 get a few more files to compile 2007-08-24 16:27:59 +02:00
Mathieu Lacage a62ac4df3a build wifi sample code 2007-08-24 15:19:20 +02:00
Mathieu Lacage 9a7206b971 merge 2007-08-24 15:12:23 +02:00
Mathieu Lacage e23f26a8f3 start of work towards port of wifi code 2007-08-24 15:12:12 +02:00
Mathieu Lacage 490d38c9f1 fix last errors for new tests 2007-08-24 15:11:08 +02:00
Mathieu Lacage 02418f7498 fix first part of errors introduced by new tests 2007-08-24 15:05:34 +02:00
Mathieu Lacage ca21c26638 add failing tests 2007-08-24 14:45:25 +02:00
Mathieu Lacage 00a9973ca8 use a Ptr<> where needed. 2007-08-24 12:45:45 +02:00
Mathieu Lacage 2ee1d5fca6 the protocol number field is a 16 bit integer, not a 32 bit integer 2007-08-24 10:33:58 +02:00
Mathieu Lacage d8b046a69f add missing include 2007-08-24 10:32:35 +02:00
Raj Bhattacharjea 08bcb4249d clarified a comment 2007-08-22 12:02:42 -04:00
Gustavo J. A. M. Carneiro 35f5503e26 WAF: fix compatibility with Python 2.3 2007-08-21 18:04:48 +01:00
Craig Dowell c0b90df335 branch merge 2007-08-20 13:40:15 -07:00
Tom Henderson bea15392ec Added tag release ns-3.0.5 for changeset 08046b6aef37 2007-08-15 23:31:51 -07:00
Tom Henderson 52de20c3b6 Add Emmanuelle to authors list 2007-08-15 23:03:06 -07:00
Tom Henderson 365e662472 update release_steps.txt 2007-08-15 22:50:31 -07:00
Tom Henderson 89758558cf bump version number 2007-08-15 22:49:06 -07:00
Tom Henderson 8d5ddc0ddf Release notes updated 2007-08-15 22:48:40 -07:00
Craig Dowell 9d2617d9a0 Fix bug 68. Implement IsMulticast 2007-08-14 12:00:03 -07:00
Craig Dowell 6b17652197 fix non-unique ethernet addresses 2007-08-13 23:40:51 -07:00
Tom Henderson 6c2a73ebda cleanup valgrind errors 2007-08-13 23:06:25 -07:00
Tom Henderson ad45701790 restore ns-2 .tr format 2007-08-13 22:53:20 -07:00
Tom Henderson ad3b6a04cc Doxygen cleanup 2007-08-13 20:53:29 -07:00
Craig Dowell caab4a3f41 Silliness for optimized version 2007-08-13 20:14:36 -07:00
Craig Dowell aecc283cb5 set source IP address in udp-socket packets 2007-08-13 19:54:47 -07:00
Craig Dowell 87c9e523c7 set source address in socket 2007-08-13 16:21:39 -07:00
Craig Dowell 90451d9635 cleanup. more complex multicast example 2007-08-13 14:58:06 -07:00
Craig Dowell e567af9b24 more multicast plumbing 2007-08-13 12:08:01 -07:00
Craig Dowell dfae0be7d0 branch merge 2007-08-12 22:43:25 -07:00
Craig Dowell d62a38e533 many debug prints 2007-08-12 22:41:24 -07:00
Craig Dowell bc8ee80491 debug prints to make validation easier 2007-08-12 15:51:12 -07:00
Tom Henderson 915e34b32b fix optimized build; remove old comment 2007-08-12 14:24:49 -07:00
Craig Dowell 5099a91a21 untested multicast support 2007-08-12 13:59:49 -07:00
Mathieu Lacage 6f9ab0dea5 move includes down to where they are really needed 2007-08-12 22:45:24 +02:00
Mathieu Lacage f90c3d0350 more tests 2007-08-12 22:44:21 +02:00
Mathieu Lacage 66d375b3b3 add forgotten virtual keyword 2007-08-12 22:44:12 +02:00
Mathieu Lacage 233d71fec7 CompositeTraceResolver::Add -> CompositeTraceResolver::AddSource 2007-08-12 22:31:16 +02:00
Mathieu Lacage 14f3f82555 remove useless code 2007-08-12 22:24:45 +02:00
Mathieu Lacage 22fec82616 replace CallbackTraceSourceBase with TraceSource base class 2007-08-12 22:23:08 +02:00
Mathieu Lacage fcfdb18914 add some debugging for disconnect 2007-08-12 21:23:55 +02:00
Mathieu Lacage 23d17d56e9 test object-based tracing 2007-08-12 21:23:40 +02:00
Mathieu Lacage 4d50d21f78 rewrite tests with test.h macros 2007-08-12 21:08:28 +02:00
Mathieu Lacage 722285bd8f rewrite Object tests with test.h macros 2007-08-12 18:43:15 +02:00
Mathieu Lacage 2bd8f97709 add NS_TEST_ASSERT_UNEQUAL 2007-08-12 18:37:38 +02:00
Mathieu Lacage b4aae47556 replace the adhoc mobility course change callbacks with a trace source 2007-08-12 18:28:37 +02:00
Mathieu Lacage 1d546dbd83 an untested interface id trace resolver 2007-08-12 18:28:13 +02:00
Mathieu Lacage 9fbb2607a1 use the abstract base of CallbackTraceSource to avoid pushing too much code in the header 2007-08-12 18:27:52 +02:00
Mathieu Lacage 442d4c9e35 add an abstract base to CallbackTraceSource 2007-08-12 18:27:30 +02:00
Mathieu Lacage de7999c932 constify 2007-08-12 18:00:15 +02:00
Mathieu Lacage 03cf88211e constify 2007-08-12 17:59:56 +02:00
Mathieu Lacage ec4d9bbcb9 use the Object::GetTraceResolver tracing support rather than the old adhoc tracing code 2007-08-12 16:28:29 +02:00
Mathieu Lacage 2df1260c87 remove const keyword and add a TraceConnect method which takes a TraceContext argument 2007-08-12 16:27:42 +02:00
Mathieu Lacage 6e762c1ae3 the TerminalTraceResolver is not used anymore by the CompositeTraceResolver implementation 2007-08-12 16:26:53 +02:00
Mathieu Lacage 2db3a828d6 rewrite the CompositeTraceResolver to use a simpler implementation, not based on callbacks 2007-08-12 16:26:25 +02:00
Mathieu Lacage c62cf3c82d rewrite the ArrayTraceResolver to use iterators 2007-08-12 16:25:19 +02:00
Tom Henderson 5da9cd2205 remove spurious examples/simple-p2p.cc 2007-08-10 13:49:41 -07:00
Tom Henderson 883d92940f global routing csma patch 2007-08-10 13:33:45 -07:00
Craig Dowell f53e19589d merge ns-3-csma with tip 2007-08-10 10:52:30 -07:00
Craig Dowell 8e6b694d6e move m_rxTrace to trace enet header 2007-08-10 10:45:59 -07:00
Craig Dowell c298892833 print length/type in hex 2007-08-10 10:44:02 -07:00
Mathieu Lacage 971997fbc1 use implicit conversion rather than private explicit conversion: fixes build 2007-08-10 19:18:19 +02:00
Mathieu Lacage 8b87d39c72 merge with trunk 2007-08-10 16:28:09 +02:00
Mathieu Lacage 1124cf3a03 add Object::TraceConnect, TraceDisconnect, and GetTraceResolver methods 2007-08-10 16:05:20 +02:00
Mathieu Lacage 3691c3cc98 fix includes 2007-08-10 15:57:33 +02:00
Mathieu Lacage 072734f7e8 move trace code to core module 2007-08-10 15:53:43 +02:00
Mathieu Lacage 0b34c336f7 convert TraceResolver * to Ptr<TraceResolver> 2007-08-10 15:47:13 +02:00
Mathieu Lacage 6b64959309 avoid problems by converting back and forth between pointers and references 2007-08-10 15:47:00 +02:00
Mathieu Lacage 704cab010d remove dead code 2007-08-10 15:08:50 +02:00
Mathieu Lacage 3153bfd916 add refcounting to TraceResolver 2007-08-10 14:43:15 +02:00
Mathieu Lacage 493c34dfb9 remove dead code 2007-08-10 14:28:52 +02:00
Mathieu Lacage 346cdbfb18 override Connect from ArrayTraceResolver 2007-08-10 14:25:58 +02:00
Mathieu Lacage cb9fdc66e3 override Connect and Disconnect in Composite and Terminal Trace resolvers 2007-08-10 14:14:29 +02:00
Mathieu Lacage 07aedd4bb2 allow resolvers to override Connect and Disconnect directly 2007-08-10 14:13:47 +02:00
Mathieu Lacage 8881f8bd91 avoid more spurious whitespaces during testing 2007-08-10 13:24:36 +02:00
Mathieu Lacage ee2b9fc885 avoid output of spurious whitespaces during testing 2007-08-10 13:17:57 +02:00
Craig Dowell 250109b215 remove old file 2007-08-09 15:58:13 -07:00
Craig Dowell aaa8a45658 rename to csma 2007-08-09 15:56:28 -07:00
Mathieu Lacage e683e1ab1c remove TraceContext argument from TraceResolver constructor and move it to Connect 2007-08-09 21:25:23 +02:00
Mathieu Lacage 23a116b96e merge with win32 tree 2007-08-09 13:42:42 +02:00
Mathieu Lacage 29014acd87 add missing space in default PacketPrinter 2007-08-09 13:38:04 +02:00
Mathieu Lacage c4ccb4a8ca merge 2007-08-09 09:39:29 +02:00
Mathieu Lacage b392b2a867 merge with trunk 2007-08-09 09:36:59 +02:00
Tom Henderson a7de7bcf31 Removing (again?) src/devices/p2p 2007-08-08 20:56:59 -07:00
Craig Dowell 371b1b01cb fix race in csma-cd channel 2007-08-08 14:19:56 -07:00
Gustavo J. A. M. Carneiro 08062bc3c5 By popular demand, add the working waf snapshot to the ns-3 source tree. 2007-08-08 21:17:48 +01:00
Gustavo J. A. M. Carneiro bac11af00e Build all modules as a single ns3 shared library. 2007-08-08 21:07:52 +01:00
Mathieu Lacage 69ccebd108 avoid initialization ordering problem 2007-08-08 23:23:24 +02:00
Mathieu Lacage 7f3f471f12 rename Bind to DefaultValue::Bind. fix bug 62 2007-08-08 16:41:59 +02:00
Mathieu Lacage 9f7eb9eecb merge 2007-08-08 16:29:26 +02:00
Gustavo J. A. M. Carneiro 86f50b36d6 merge 2007-08-08 15:25:00 +01:00
Gustavo J. A. M. Carneiro 0eca73234a WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file. 2007-08-08 15:10:36 +01:00
Mathieu Lacage f346815b18 use fixed-width types to avoid portability problems 2007-08-08 15:59:08 +02:00
Mathieu Lacage 5e9325fad1 merge with trunk 2007-08-08 15:49:41 +02:00
Mathieu Lacage d668f7749f use NS_TEST_ASSERT macros 2007-08-08 15:43:05 +02:00
Gustavo J. A. M. Carneiro a34d15da01 Revert experimental code in src/wscript accidentally committed. 2007-08-08 14:11:29 +01:00
Mathieu Lacage 7bc4564029 merge with trunk 2007-08-08 14:00:45 +02:00
Gustavo J. A. M. Carneiro f302d055e9 WAF: handle --doxygen before building; now only generates docs and does not build anything. 2007-08-08 12:36:59 +01:00
Mathieu Lacage 9cb258d920 doxygen API documentation for TraceContextElement base class 2007-08-08 13:13:24 +02:00
Mathieu Lacage 4b8e9cf7d1 use full reference for \relates tag 2007-08-08 13:13:09 +02:00
Mathieu Lacage 9b33c46995 make sure assert macros are documented 2007-08-08 12:54:21 +02:00
Mathieu Lacage 6ae06014c5 fix dox warning 2007-08-08 12:51:12 +02:00
Mathieu Lacage 32cd28829a fix dox warning 2007-08-08 12:34:18 +02:00
Mathieu Lacage aceebd88bb fix dox warning 2007-08-08 12:33:33 +02:00
Mathieu Lacage 7ad0b27460 revert part of gustavo's patch for 'better breakpoints' 2007-08-08 12:33:14 +02:00
Mathieu Lacage 635374075f re-write header and trailer doxygen API doc 2007-08-08 12:18:11 +02:00
Mathieu Lacage d3672ded33 beautify packet API doxygen 2007-08-08 11:27:17 +02:00
Mathieu Lacage b5f68770a3 move header sample and build tag sample 2007-08-08 11:20:49 +02:00
Mathieu Lacage 1bd35c2b55 make sure udp-header.h is exported for main-packet-printer 2007-08-08 11:20:35 +02:00
Mathieu Lacage 1242430e2f improve print output 2007-08-08 11:20:09 +02:00
Mathieu Lacage 771bf92f78 Tag doxygen documentation 2007-08-08 11:19:39 +02:00
Mathieu Lacage 042f455113 add Packet::PrintTags and move tag documentation to tag.h 2007-08-08 11:19:19 +02:00
Mathieu Lacage 57464209b8 update reference to header sample code 2007-08-08 11:18:49 +02:00
Mathieu Lacage d6f35d7c5c make sure we include a space between tag printed output 2007-08-08 11:16:41 +02:00
Mathieu Lacage 1f73d0d258 remove dead code 2007-08-08 11:16:11 +02:00
Mathieu Lacage 7f9545754c sample packet tag code 2007-08-08 11:15:45 +02:00
Mathieu Lacage 1e22e6d203 rework the NS_XX_ENSURE_REGISTERED macros and make sure we typecheck the input to TraceContext::Add and TraceContext::Get methods 2007-08-08 10:18:55 +02:00
Mathieu Lacage 496f1d91d0 TraceContextElement::Register -> TraceContextElement::AllocateUid 2007-08-08 10:06:58 +02:00
Mathieu Lacage 5a38178db2 Trailer::Register -> Trailer::AllocateUid and Header::Register -> Header::AllocateUid 2007-08-08 10:01:19 +02:00
Mathieu Lacage 55b4291df0 introduce Tag base class similar to Header and Trailer 2007-08-08 09:49:56 +02:00
Mathieu Lacage 5c419ea37f remove Chunk base class 2007-08-08 09:12:55 +02:00
Tom Henderson 02ccad8fbc add unreachable statement to solve gcc-4.0.x compiler bug for optimized builds on os x 2007-08-07 20:37:52 -07:00
Mathieu Lacage 9a8e9dc34b merge with trunk 2007-08-07 08:36:31 +02:00
Gustavo J. A. M. Carneiro e6aae4aa5f Fix compilation of BreakpointFallback on win32/mingw, which has signal.h but does not define SIGTRAP. 2007-08-07 00:16:13 +01:00
Craig Dowell b8458246b8 fix opt warnings, let compiler do tail call optimization in csma nd, remove protected access from router iface 2007-08-06 14:40:43 -07:00
Mathieu Lacage 287416006a tweak ascii trace output 2007-08-06 19:43:09 +02:00
Mathieu Lacage 1a1dda1796 build with the new TraceContextElement API 2007-08-06 19:40:18 +02:00
Mathieu Lacage 3fd0b3ba42 merge with trunk 2007-08-06 17:21:57 +02:00
Mathieu Lacage 77712a63ad work in progress towards a working trace context 2007-08-06 17:19:13 +02:00
Mathieu Lacage caf9c39afa make the previous merge actually work 2007-08-06 15:45:29 +02:00
Mathieu Lacage 0db07e14d6 merge implicit conversion tree 2007-08-06 15:32:27 +02:00
Gustavo J. A. M. Carneiro 988d512b77 Correct misspelled BreakpointFallback function implementation; fixes OS X build. 2007-08-06 11:55:17 +01:00
Mathieu Lacage 06c632fa50 merge from trunk 2007-08-06 12:35:06 +02:00
Mathieu Lacage f750bcefab fix memory leak 2007-08-06 10:29:28 +02:00
Mathieu Lacage 4946bbcf97 main should return a value 2007-08-06 10:29:19 +02:00
Mathieu Lacage dcdca3338d fix memory leak 2007-08-06 10:09:18 +02:00
Mathieu Lacage fbbd5dc9a6 use the InetSocketAddress API for ip sockets 2007-08-06 10:06:25 +02:00
Mathieu Lacage 913319d9e3 merge packet socket with trunk 2007-08-06 09:59:29 +02:00
Mathieu Lacage 3919d03f97 merge with trunk 2007-08-06 09:58:03 +02:00
Mathieu Lacage 5c19b67791 fix optimized build 2007-08-05 14:34:23 +02:00
Mathieu Lacage a55fa0d833 merge with trunk 2007-08-04 17:17:23 +02:00
Mathieu Lacage 8e1489d85b update the Tag API to match the Header/Trailer API 2007-08-04 17:14:54 +02:00
Mathieu Lacage 797d537cb8 update dox 2007-08-04 16:58:16 +02:00
Mathieu Lacage b6618577c7 add doxygen 2007-08-04 16:52:01 +02:00
Mathieu Lacage 0cb76eb275 macros to ensure proper initialization 2007-08-04 16:49:06 +02:00
Mathieu Lacage 93cea27ad8 force users to register their header/trailer uid strings by hand rather than do lazy uid allocation. 2007-08-04 16:37:16 +02:00
Mathieu Lacage 263326ecbe fix packet serialization/deserialization 2007-08-04 16:07:46 +02:00
Mathieu Lacage 61c85465b9 ci fix metadata serialization/deserialization 2007-08-04 16:07:31 +02:00
Mathieu Lacage 25c33df302 test packet serialization/deserialization 2007-08-04 16:06:59 +02:00
Mathieu Lacage 7d5a47afe9 make sure we return a correct uid from ChunkRegistry::GetUidFromUidString 2007-08-04 16:06:38 +02:00
Mathieu Lacage fc7802ea0f avoid fatal error if NS_DEBUG is used before the 'main' function is reached 2007-08-04 16:03:08 +02:00
Mathieu Lacage b2ddd93191 test Tags serialization/deserialization 2007-08-04 14:51:09 +02:00
Mathieu Lacage d9a9624c6c finish packet serialization/deserialization 2007-08-04 14:41:33 +02:00
Mathieu Lacage aff09e3e34 implement packet metadata serialization/deserialization 2007-08-04 14:10:49 +02:00
Mathieu Lacage 6db993b589 add doxygen documentation, constify 2007-08-04 13:28:17 +02:00
Mathieu Lacage a454a51939 rework the PacketPrinter API and implementation 2007-08-04 13:22:08 +02:00
Mathieu Lacage 6a1e38d831 forgot to use std::string instead of const char * 2007-08-04 13:21:55 +02:00
Mathieu Lacage cb6943010a remove dead forward declaration 2007-08-04 10:05:51 +02:00
Mathieu Lacage 6929464500 use CreateFullCopy and implement Serialize/Deserialize 2007-08-04 09:32:10 +02:00
Mathieu Lacage 6e956f6cc3 add Buffer::CreateFullCopy and make TransformInto private 2007-08-04 09:31:52 +02:00
Tom Henderson b080a339a6 remove README.routing file 2007-08-03 21:39:19 -07:00
Tom Henderson 5de2add9c3 fix compilation problems and test 2007-08-03 09:49:02 -07:00
Tom Henderson de77db64fc interim 2007-08-03 09:29:57 -07:00
Mathieu Lacage 555885a3b0 add Tag documentation 2007-08-03 17:52:58 +02:00
Mathieu Lacage f6ec749e96 update sample code to use a std::string rather than a const char * 2007-08-03 17:52:39 +02:00
Mathieu Lacage a5b8f5af68 split test code out of the main PacketMetadata code 2007-08-03 17:52:21 +02:00
Tom Henderson fce7c3cc39 merge with ns-3-dev 2007-08-03 08:29:24 -07:00
Mathieu Lacage 4050d495ed fix valgrind warnings 2007-08-03 17:26:10 +02:00
Tom Henderson 3378f0de19 remove Channel::GetType 2007-08-03 08:23:23 -07:00
Mathieu Lacage c05e7134ed doxygen improvements to Packet, Tags, and Headers/Trailers 2007-08-03 17:00:40 +02:00
Mathieu Lacage f8a6287322 improve dox 2007-08-03 14:09:04 +02:00
Mathieu Lacage 6c6a9a073f implement Tags::Serialize and Tags::Deserialize 2007-08-03 13:58:53 +02:00
Mathieu Lacage 9c309707a7 add internal documentation 2007-08-03 13:07:10 +02:00
Mathieu Lacage 9c1e4a0e70 rework the Tags API to ensure proper uid generation for tags 2007-08-03 13:00:38 +02:00
Mathieu Lacage 7298cd1110 make sure we return the right integer uid if the header of trailer was already registered. 2007-08-03 10:39:55 +02:00
Mathieu Lacage e672f9711f add GetUid methods to all headers and trailers 2007-08-03 09:23:41 +02:00
Mathieu Lacage 740ad8c1b2 remove redundant printing output 2007-08-03 09:15:25 +02:00
Mathieu Lacage 62310f6b21 fix coding style 2007-08-03 09:15:11 +02:00
Mathieu Lacage 9c2de843b5 move constants to private section 2007-08-03 09:09:19 +02:00
Gustavo J. A. M. Carneiro a905bf35a7 Send PacketMetadataTest unit test output to Failure (), not std::cout. 2007-08-02 14:56:04 +01:00
Gustavo J. A. M. Carneiro bd1932f12c In some places, print debug messages / errors to stderr, not stdout. 2007-08-02 14:48:36 +01:00
Gustavo J. A. M. Carneiro d272bd4e05 Replace the stdout "warning" with a NS_FATAL_ERROR 2007-08-02 14:47:51 +01:00
Gustavo J. A. M. Carneiro 67e42e8600 Bug #7: Better breakpoints. 2007-08-02 13:59:08 +01:00
Mathieu Lacage 078d8b607c do not access the iterator after erasing it 2007-08-02 08:55:56 +02:00
Gustavo J. A. M. Carneiro 7c001bf468 Detect when running waf --shell with stale environment variables and give an error when it happens. 2007-08-01 21:35:34 +01:00
Mathieu Lacage 2eef3ac5fb small bug in InetSocketAddress deserialization 2007-08-01 20:17:28 +02:00
Gustavo J. A. M. Carneiro 63cc2150a0 WAF: when changing environment (e.g. LD_LIBRARY_PATH for --run and --shell), make the new paths take precedence over the old ones. 2007-08-01 18:34:23 +01:00
Mathieu Lacage 2476dd4474 merge with trunk 2007-08-01 19:52:59 +02:00
Mathieu Lacage b954d65b8f remove uint8_t * from the send path of the socket API 2007-08-01 19:19:42 +02:00
Mathieu Lacage 1b62aa5a79 consitify the API a bit 2007-08-01 19:19:28 +02:00
Mathieu Lacage 48d1219f5c remove uint8_t * buffers from socket receive API 2007-08-01 19:09:11 +02:00
Mathieu Lacage 210e88b511 split callback registration from socket operations in socket.h API. 2007-08-01 18:48:24 +02:00
Mathieu Lacage 21960157ae merge 2007-08-01 17:24:55 +02:00
Mathieu Lacage 73322272fe fix trace output 2007-08-01 17:22:10 +02:00
Mathieu Lacage 4d12a0bfdf merge with trunk 2007-08-01 13:56:30 +02:00
Mathieu Lacage b632880fde update address size 2007-08-01 13:54:09 +02:00
Mathieu Lacage 707b722c36 fix tracing 2007-08-01 13:53:48 +02:00
Mathieu Lacage dd3ca3aa63 replace Node::DoCreateTraceResolver with Node::DoFillTraceResolver 2007-08-01 12:33:44 +02:00
Mathieu Lacage a4c3028881 example code. 2007-08-01 10:29:40 +02:00
Mathieu Lacage b4b0d52ffb add an extra constructor 2007-08-01 10:29:22 +02:00
Mathieu Lacage 492afc0f9d PacketSocketAddress serialization code was buggy. 2007-08-01 10:29:03 +02:00
Mathieu Lacage 38b3f73a85 merge 2007-08-01 09:38:55 +02:00
Mathieu Lacage 2319629592 fix bug 59: debug output now goes to stderr. 2007-08-01 09:38:09 +02:00
Mathieu Lacage 802ac99d0d remove extra includes 2007-08-01 09:15:48 +02:00
Mathieu Lacage e91a1198a0 fix build: missing const 2007-08-01 09:14:31 +02:00
Mathieu Lacage b835a6b564 a packet socket 2007-08-01 09:02:03 +02:00
Mathieu Lacage 2687579986 add Address::IsInvalid 2007-08-01 09:01:54 +02:00
Mathieu Lacage e05f635db5 rework the NetDevice <-> Node interface 2007-08-01 08:58:18 +02:00
Tom Henderson d3f1f2a341 remove manual routing commands from example script 2007-07-31 09:45:13 -07:00
Gustavo J. A. M. Carneiro 4886a7c0fe Add emacs C++ mode selection line, missing from some header files. 2007-07-31 13:49:11 +01:00
Gustavo J. A. M. Carneiro 93ad9161ec Fix the OLSR documentation. 2007-07-31 11:53:11 +01:00
Mathieu Lacage 39633a0f09 packet socket address 2007-07-31 11:42:25 +02:00
Mathieu Lacage f8baaaf617 extra Address API to be used by packet socket address 2007-07-31 11:42:10 +02:00
Mathieu Lacage 354e017a33 fix build 2007-07-31 11:33:44 +02:00
Mathieu Lacage 3d9d4ce7be I wonder what the point of that code was: why should you test for zero _after_ using the pointer ? It needs to be tested _before_. 2007-07-31 10:47:29 +02:00
Mathieu Lacage 530b65e51d add license headers 2007-07-31 10:46:43 +02:00
Mathieu Lacage af6bed4995 an eui 64 address type 2007-07-31 10:45:37 +02:00
Mathieu Lacage f7f981d549 fix bugless in address allocation 2007-07-31 10:45:15 +02:00
Mathieu Lacage 1454050eef forgot to set the interface id 2007-07-31 09:21:40 +02:00
Mathieu Lacage 8c80e6c2f8 remove now-unused ArpPrivate class 2007-07-31 09:17:05 +02:00
Mathieu Lacage b4237e51dc implement the Node::ProtocolHandler support. 2007-07-31 09:09:31 +02:00
Mathieu Lacage 7af432c313 small cleanups 2007-07-31 07:54:26 +02:00
Craig Dowell 833462a84e add simple-global-routing.cc 2007-07-30 15:50:20 -07:00
Gustavo J. A. M. Carneiro 222eea66fa Patch from Mathieu, makes EnableNodes templated 2007-07-30 19:11:21 +01:00
Gustavo J. A. M. Carneiro 072626d390 Add documentation for the (few) OLSR public APIs 2007-07-30 17:43:52 +01:00
Gustavo J. A. M. Carneiro e4dedb226f Add a simpler olsr::EnableAllNodes API as suggested by Mathieu. 2007-07-30 17:33:12 +01:00
Gustavo J. A. M. Carneiro acde0b6311 fix indentation in some places (was broken due to class rename) 2007-07-30 17:15:35 +01:00
Gustavo J. A. M. Carneiro 8cb57d43d6 Reorganize source tree and rename classes in a more sensible way; Olsr becomes OlsrAgent, olsr::Olsr becomes OlsrAgentImpl. 2007-07-30 17:06:06 +01:00
Gustavo J. A. M. Carneiro f597f96152 solve some merge problems 2007-07-30 15:03:45 +01:00
Gustavo J. A. M. Carneiro 0f5b5f1f6c merge 2007-07-30 15:01:18 +01:00
Gustavo J. A. M. Carneiro ea0a9ae7ab EventCollector: tune the parameters and add a shrinking heuristic. 2007-07-30 14:48:56 +01:00
Gustavo J. A. M. Carneiro 98abf1d812 Add simple EventCollector benchmark 2007-07-30 14:22:12 +01:00
Mathieu Lacage f1b9327123 remove implicit conversion from Address to Eui48Address, to Ipv4Address and to InetSocketAddress 2007-07-30 14:57:49 +02:00
Mathieu Lacage 497b9deadc add implicit conversion to Ipv4Address 2007-07-30 14:20:10 +02:00
Mathieu Lacage 2e723a700d add implicit conversion to Eui48Address 2007-07-30 14:17:12 +02:00
Gustavo J. A. M. Carneiro 5b558714de EventCollector: move methods to the .cc file 2007-07-30 13:09:02 +01:00
Mathieu Lacage 2641f7fe88 InetSocketAddress: replace explicit conversion to implicit conversion 2007-07-30 14:07:39 +02:00
Mathieu Lacage 80bf1491e1 add doxygen 2007-07-30 13:59:13 +02:00
Mathieu Lacage 22cf3afdfa add Ipv4Address::IsMatchingType and Eui48Address::IsMatchingType 2007-07-30 13:58:39 +02:00
Mathieu Lacage f2084098e2 add InetSocketAddress::IsMatchingType and use it 2007-07-30 13:55:28 +02:00
Gustavo J. A. M. Carneiro 00e998e5f9 SingleEvent: move methods to .cc file; add EventId proxy methods, instead of a single GetEventId method. 2007-07-30 12:50:13 +01:00
Mathieu Lacage df7f115415 InetAddress -> InetSocketAddress 2007-07-30 13:29:36 +02:00
Gustavo J. A. M. Carneiro 0467d48201 merge with ns-3-dev 2007-07-30 11:04:11 +01:00
Mathieu Lacage 41074331ed fix optimized build 2007-07-30 11:07:56 +02:00
Mathieu Lacage 034469197c fix address deserialization 2007-07-30 11:03:13 +02:00
Mathieu Lacage c80acdf88f remove dead files after merge 2007-07-30 10:35:40 +02:00
Mathieu Lacage 7b9fbc36e1 merge 2007-07-30 10:35:03 +02:00
Tom Henderson ecd4f30e41 Fix lengthType initialization for optimized build 2007-07-28 23:20:58 -07:00
Gustavo J. A. M. Carneiro 8682d0293a WAF: remove the obj.includes = '.' part from modules, since it causes build failure in OS X, and waf was just fixed to enable header files dependency tracking by default without needing to change obj.includes 2007-07-28 14:14:16 +01:00
Mathieu Lacage 28ddc5db69 start filling release notes with merged items 2007-07-28 14:50:56 +02:00
Mathieu Lacage 9e23045867 fix basic coding style issues 2007-07-28 13:25:10 +02:00
Mathieu Lacage 08758e9129 fix indent, basic coding style issues 2007-07-28 13:22:47 +02:00
Mathieu Lacage 14404dff66 protocol number is a 16 bit unsigned integer 2007-07-28 13:20:47 +02:00
Mathieu Lacage 7b0e63b123 param is a 16 bit integer. implement proper llc encapsulation/decapsulation 2007-07-28 13:15:04 +02:00
Mathieu Lacage 3b52247058 small cleanups 2007-07-28 13:14:24 +02:00
Mathieu Lacage 4c5fe41f2b pktType -> encapMode 2007-07-28 12:41:53 +02:00
Mathieu Lacage b4ebd87229 disable copy constructor and operator = for CsmaCdNetDevice 2007-07-28 12:30:31 +02:00
Craig Dowell d5086e07a0 small readability change 2007-07-27 21:58:19 -07:00
Craig Dowell b4698b7cca doxygen update (@internal) 2007-07-27 20:48:21 -07:00
Craig Dowell 510083f0ea remove routing environment, move router interface creation to global-route-manager 2007-07-27 20:34:25 -07:00
Tom Henderson e7f300bc7c fix tracing 2007-07-27 14:54:41 -07:00
Tom Henderson 45773a987d disable tracing; fix ifIndex assignment 2007-07-27 14:43:56 -07:00
Tom Henderson 9f8910c258 return ifIndex when adding netdevice to node (topology) 2007-07-27 14:40:50 -07:00
Craig Dowell ef462dbb5e copywrongs 2007-07-27 14:09:02 -07:00
Craig Dowell d38da7ae3d rename party 2007-07-27 14:04:54 -07:00
Tom Henderson a9fe0f2d23 rename example from p2p to point-to-point 2007-07-27 13:07:36 -07:00
Tom Henderson 5e4dbc66dc new script for csma-cd 2007-07-27 12:50:31 -07:00
Gustavo J. A. M. Carneiro e85f337b2f Adapt OLSR code to use SingleEvent instead of Timer, and EventCollector. 2007-07-27 19:21:35 +01:00
Gustavo J. A. M. Carneiro a7d36f9f9f merge with ns-3-olsr-support 2007-07-27 18:54:01 +01:00
Gustavo J. A. M. Carneiro e6ef4109c8 Remove Timer, made mostly redundant with the introduction of SingleEvent. 2007-07-27 18:50:45 +01:00
Gustavo J. A. M. Carneiro fc7b62e329 Add a SingleEvent class. 2007-07-27 18:45:12 +01:00
Gustavo J. A. M. Carneiro 3cfda55a69 Add an EventCollector class, based on concepts discussed in the mailing list 2007-07-27 17:15:30 +01:00
Mathieu Lacage 64a8418674 optmize slightly Ptr<T>::Acquire 2007-07-27 17:49:04 +02:00
Mathieu Lacage c3e1f137e1 remove GetEventImpl 2007-07-27 17:44:15 +02:00
Mathieu Lacage 0b1819cdc8 be more consistant in the handling of references 2007-07-27 17:36:14 +02:00
Mathieu Lacage dcf642ffb0 more optimizations 2007-07-27 17:28:17 +02:00
Mathieu Lacage 21be3e3912 optimize EventImpl refcounting 2007-07-27 17:18:14 +02:00
Gustavo J. A. M. Carneiro d6cb167a0c Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority. 2007-07-27 15:38:04 +01:00
Gustavo J. A. M. Carneiro 1177dc94b8 WAF: handle the option --doxygen before building the entire project. 2007-07-27 15:04:25 +01:00
Mathieu Lacage daa9c3c13c use a Ptr<> to manage EventImpl instances 2007-07-27 15:37:22 +02:00
Mathieu Lacage 9d5184bae4 add an extra constructor to use when the Create template cannot be used 2007-07-27 15:37:05 +02:00
Mathieu Lacage c7906b2d61 add refcounting to EventImpl 2007-07-27 09:53:15 +02:00
Mathieu Lacage 0b1ddb45a2 GetEventImpl -> PeekEventImpl 2007-07-27 09:50:21 +02:00
Mathieu Lacage 3cec6af4a8 add doxygen 2007-07-27 09:44:24 +02:00
Mathieu Lacage 8474486b74 add extra conveniance constructors and use them 2007-07-27 08:47:58 +02:00
Mathieu Lacage 695119b3a5 Ipv4TransportAddress -> InetAddress 2007-07-27 08:44:26 +02:00
Mathieu Lacage 863de62880 ipv4-transport-address -> inet-address 2007-07-27 08:32:34 +02:00
Mathieu Lacage c716994cab convert Socket to use Address class 2007-07-27 08:23:20 +02:00
Mathieu Lacage db6a90d956 replace MacAddress by Address 2007-07-26 17:36:53 +02:00
Mathieu Lacage 4d847a04a7 merge 2007-07-26 17:23:55 +02:00
Mathieu Lacage a60ac679a0 disable copying PointToPointNetDevice 2007-07-26 16:04:54 +02:00
Mathieu Lacage 8a5f927d8d improve type checking 2007-07-26 14:47:05 +02:00
Mathieu Lacage 073e685b0d new address types 2007-07-26 14:03:41 +02:00
Gustavo J. A. M. Carneiro a7089873e9 Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia). 2007-07-26 12:49:00 +01:00
Gustavo J. A. M. Carneiro c2c7f7d71c Allow UDP sockets to receive broadcast (bug #51) 2007-07-26 12:27:49 +01:00
Gustavo J. A. M. Carneiro c2c923ba11 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Support sending IP broadcast (255.255.255.255) packets (bug #36).
2007-07-26 12:26:21 +01:00
Gustavo J. A. M. Carneiro e45d934cb6 Allow ARP resolution to work with broadcast IPv4 (dest=255.255.255.255) packets; Partially fixes bug #36. 2007-07-26 12:12:51 +01:00
Gustavo J. A. M. Carneiro f35ff8f583 Add Ipv4Address::CombineMask, and implement Ipv4Address::IsBroadcast. 2007-07-26 12:11:37 +01:00
Gustavo J. A. M. Carneiro 6b29b3c817 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority. 2007-07-27 15:38:04 +01:00
Gustavo J. A. M. Carneiro 317f336c76 Allow UDP sockets to receive broadcast (bug #51) 2007-07-26 12:27:49 +01:00
Gustavo J. A. M. Carneiro ddd0dc6dff Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Support sending IP broadcast (255.255.255.255) packets (bug #36).
2007-07-26 12:26:21 +01:00
Gustavo J. A. M. Carneiro 1da64ebbd6 Allow ARP resolution to work with broadcast IPv4 (dest=255.255.255.255) packets; Partially fixes bug #36. 2007-07-26 12:12:51 +01:00
Gustavo J. A. M. Carneiro 48cf146a6f Add Ipv4Address::CombineMask, and implement Ipv4Address::IsBroadcast. 2007-07-26 12:11:37 +01:00
Gustavo J. A. M. Carneiro ccd6240e23 Add a Timer class (bug #46) 2007-07-26 12:08:22 +01:00
Gustavo J. A. M. Carneiro 41c4b6453a EvenId const fixes. 2007-07-26 12:05:31 +01:00
Tom Henderson fda49d72c1 merge 2007-07-27 10:49:29 -07:00
Mathieu Lacage 230b3840ad cleanup simple example 2007-07-27 21:39:58 +02:00
Emmanuelle Laprise 31530c7311 a csma/cd NetDevice subclass and a test script 2007-07-27 21:17:14 +02:00
Emmanuelle Laprise ad5f36f2ac ethernet Header and Trailer classes 2007-07-27 21:16:40 +02:00
Emmanuelle Laprise 718ec64593 Move LLC encapsulation from NetDevice to subclasses. 2007-07-27 20:45:18 +02:00
Emmanuelle Laprise b078d91894 cleanup the wscripts 2007-07-27 20:45:07 +02:00
Emmanuelle Laprise 0e21d85be1 src/devices/point-to-point/p2p-* -> src/devices/point-to-point/point-to-point-* 2007-07-27 20:26:36 +02:00
Emmanuelle Laprise 54af49fe40 src/devices/p2p -> src/devices/point-to-point 2007-07-27 20:17:23 +02:00
Tom Henderson 2d950869f8 Add patch 49 (add/remove network route when bringing interface up/down) 2007-07-27 10:48:10 -07:00
Gustavo J. A. M. Carneiro d3ec8f8791 EvenId const fixes. 2007-07-26 12:05:31 +01:00
Mathieu Lacage 9033830375 fix optimized build 2007-07-26 08:18:11 +02:00
Gustavo J. A. M. Carneiro 35e5c48814 WAF: make list of modules (all_modules) a tuple instead of list, because it is hashable, and this way newer WAF is able to notice changes in it and automatically trigger a reconfiguration. 2007-07-24 16:13:31 +01:00
Tom Henderson b16efc8c0b a few edits on the doxygen 2007-07-23 20:06:00 -07:00
Tom Henderson bdf28a79fc revise README 2007-07-23 19:27:01 -07:00
Tom Henderson bc634975d4 remove old routing code 2007-07-23 19:02:55 -07:00
Craig Dowell 2f682ca9f8 single populate call 2007-07-23 15:53:37 -07:00
Craig Dowell bb8c8e5fa8 remove doxygen warnings, make waf work 2007-07-23 14:31:24 -07:00
Mathieu Lacage 014bc9ed79 mobility models 2007-07-23 15:53:54 +02:00
Mathieu Lacage a89dbfad01 a small typo 2007-07-23 15:24:17 +02:00
Mathieu Lacage b53716bd7f add operator << (std::ostream)for Ptr<T> 2007-07-23 15:23:14 +02:00
Mathieu Lacage 6e9b3d811b add dirtyness tracking to DefaultValueBase 2007-07-23 15:22:36 +02:00
Mathieu Lacage 3fa85ade3a make sure IsExpired handles destroy events correctly 2007-07-23 15:16:45 +02:00
Mathieu Lacage 1bd05e4561 add support to cancel Now and Destroy events. 2007-07-23 14:52:51 +02:00
Mathieu Lacage a38a0d5b81 add operator == and != t o EventId 2007-07-23 14:51:57 +02:00
Mathieu Lacage efcf28b96b TimeDefaultValue 2007-07-23 14:41:53 +02:00
Mathieu Lacage 6b827886a0 RandomVariableDefaultValue 2007-07-23 14:41:34 +02:00
Mathieu Lacage f6712c7cbd IntegerDefaultValue -> NumericDefaultValue 2007-07-23 14:13:03 +02:00
Mathieu Lacage 3e11da04df merge 2007-07-23 14:01:43 +02:00
Mathieu Lacage 56d6ee9a1c fix bug 57 2007-07-23 13:58:53 +02:00
Craig Dowell 897a518750 parenthesis police were here 2007-07-20 14:28:18 -07:00
Craig Dowell c9b7590dd9 turn off debug flag 2007-07-20 14:22:46 -07:00
Craig Dowell 4d3d250d5e make static router a singleton, make implementation details private 2007-07-20 14:21:21 -07:00
Gustavo J. A. M. Carneiro 43d93b87bc Update README to mention WAF instead of SCons. 2007-07-20 14:51:25 +01:00
Gustavo J. A. M. Carneiro f0a90a46ed WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default. 2007-07-20 11:38:16 +01:00
Gustavo J. A. M. Carneiro d379c41d72 WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes. 2007-07-20 11:27:34 +01:00
Gustavo J. A. M. Carneiro 57688559b1 WAF: add obj.includes = '.' to command waf to do dependency tracking on private header files. 2007-07-20 11:12:43 +01:00
Mathieu Lacage fa26073882 update ignore rules for waf generated files 2007-07-20 09:13:51 +02:00
Mathieu Lacage b37ca7868a remove scons scripts 2007-07-20 09:10:49 +02:00
Mathieu Lacage 767621d2cb forgot to update waf build scripts 2007-08-09 21:16:39 +02:00
Craig Dowell ab93e1f56d overlooked one 2007-07-19 23:04:09 -07:00
Craig Dowell f3523e8381 last parts of general cleaup and commenting 2007-07-19 22:48:50 -07:00
Mathieu Lacage 0eeaf31270 merge 2007-07-19 19:08:43 +02:00
Mathieu Lacage 5703b95d0e finish support for references as arguments to event handlers 2007-07-19 18:57:19 +02:00
Mathieu Lacage 7acaffa841 fix testcase 2007-07-19 15:10:59 +02:00
Mathieu Lacage ea7652677d rename traits to handle Ptr<> object pointers 2007-07-19 13:53:14 +02:00
Gustavo J. A. M. Carneiro b239441ff9 Buffer::Iterator::Write (buffer, size) should have a uint32_t parameter, not
uint16_t, else integer overflow may occur.  Fixes bug #54.
2007-07-19 12:48:22 +01:00
Mathieu Lacage 8bea90280f failing testcases to for events with references as arguments 2007-07-19 13:45:07 +02:00
Mathieu Lacage 4fef0935fb revert george's fix to support events with references as arguments 2007-07-19 13:44:42 +02:00
Mathieu Lacage 421e19ca4b make sure that dox generates html links 2007-07-19 13:17:35 +02:00
Mathieu Lacage 3e00c2d842 fix dox warnings 2007-07-19 13:11:08 +02:00
Mathieu Lacage 3fe8f75d1b a dox summary header for the mobility support 2007-07-19 13:02:02 +02:00
Mathieu Lacage 8e0837b6a1 fix link 2007-07-19 12:43:32 +02:00
Mathieu Lacage 347b7238dc create a mobility module 2007-07-19 12:38:30 +02:00
Mathieu Lacage fdb89d13ef more dox 2007-07-19 12:29:21 +02:00
Mathieu Lacage f3060d8a33 RandomDirection2dParameters -> RandomDirection2dMobilityModelParameters 2007-07-19 12:23:12 +02:00
Mathieu Lacage be743da973 more dox 2007-07-19 12:21:48 +02:00
Mathieu Lacage de8d7725be more dox 2007-07-19 11:31:17 +02:00
Mathieu Lacage 7033df8c0c Ns2Mobile -> Ns2Mobility 2007-07-19 11:31:07 +02:00
Mathieu Lacage 2e6e200962 fix typo 2007-07-19 11:30:47 +02:00
Mathieu Lacage b7a44adca0 remove dead code 2007-07-19 11:09:13 +02:00
Mathieu Lacage e831a050cd more dox 2007-07-19 11:05:47 +02:00
Mathieu Lacage 4e2af32bcf doxygen for mobility models 2007-07-19 10:46:50 +02:00
Mathieu Lacage 198b031d03 remove dead code 2007-07-19 10:43:41 +02:00
Mathieu Lacage 5ec60a6a2c RandomDirection -> RandomDirection2d 2007-07-19 10:31:04 +02:00
Mathieu Lacage eadaabbe62 random-direction -> random-direction-2d 2007-07-19 10:30:18 +02:00
Mathieu Lacage b2d7640a1d add MobilityModel::GetSpeed method and implement it in all mobility models 2007-07-19 10:28:48 +02:00
Mathieu Lacage 39ba117abf remove dead code 2007-07-19 10:21:27 +02:00
Mathieu Lacage 7a3849ffdb remove dead code 2007-07-19 10:21:23 +02:00
Mathieu Lacage 9a367b2be7 use the helper from the static speed mobility model 2007-07-19 10:17:02 +02:00
Mathieu Lacage f671c11773 remove mobility model helper, re-enable random direction model with new helper 2007-07-19 10:05:07 +02:00
Mathieu Lacage bb7208b754 move delay calculation code from helper to random walk class 2007-07-19 10:01:42 +02:00
Mathieu Lacage 3ae6f849ac move rebound code from helper to random walk model 2007-07-19 09:54:57 +02:00
Mathieu Lacage e682be574b move intersection code to rectangle class 2007-07-19 09:48:10 +02:00
Mathieu Lacage ab084a9399 move around rectangle class and move IsInside method from Position to Rectangle 2007-07-19 09:34:36 +02:00
Mathieu Lacage 3f4edebda6 remove 'now' events 2007-07-19 08:43:43 +02:00
Mathieu Lacage a59e3bb3cd remove schedule API to allow canceling and removing now and destroy events 2007-07-19 08:43:28 +02:00
Mathieu Lacage e62ea4cdb4 add operator == and != to EventId 2007-07-19 08:29:48 +02:00
Craig Dowell e3283739ce general cleanup of routing 2007-07-18 16:57:54 -07:00
Raj Bhattacharjea 600aa2ec16 Added Triangularly distributed random variables 2007-07-18 17:43:45 -04:00
Craig Dowell 0921355a74 General cleanup -- const correctness, encapsulation, documentation, etc. 2007-07-18 14:35:06 -07:00
Mathieu Lacage 1ac757bd60 get rid of old buggy random walk model 2007-07-18 17:56:43 +02:00
Mathieu Lacage 9c46074145 do not try to remove invalid events 2007-07-18 17:55:58 +02:00
Mathieu Lacage 2ad239b6c9 more debugging, make sure to save value string if it is value after parsing. 2007-07-18 17:52:18 +02:00
Mathieu Lacage 9bc8eb952b fix typos 2007-07-18 17:45:53 +02:00
Mathieu Lacage 83cbc1f450 be consistant with the rest of the code 2007-07-18 17:45:35 +02:00
Mathieu Lacage 5ef0970789 add disc center position and debugging 2007-07-18 17:45:07 +02:00
Mathieu Lacage 41920cc74f add debugging output 2007-07-18 17:44:32 +02:00
Mathieu Lacage bda63626d2 a real random walk model 2007-07-18 17:07:25 +02:00
Mathieu Lacage d0d364d729 add Rectangle class and use it. 2007-07-18 17:07:15 +02:00
Mathieu Lacage e896c2576b make sure we schedule the start event correctly 2007-07-18 17:06:36 +02:00
Emmanuelle Laprise 8b417ebd25 Fixed a typo in the documentation. Had to change NodeList::Index to
NodeList::NodeIndex
2007-07-18 09:27:22 -05:00
Emmanuelle Laprise 6d93d700bb trying to merge again 2007-07-18 09:11:48 -05:00
Mathieu Lacage 88b0af83b5 add cid support to waypoint model 2007-07-18 14:11:33 +02:00
Mathieu Lacage 5e3d0126e3 add default value support to random waypoint 2007-07-18 14:08:34 +02:00
Mathieu Lacage aef4192d6a add a 3d random waypoint model 2007-07-18 13:56:37 +02:00
Gustavo J. A. M. Carneiro 30b8b3c61f WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc. 2007-07-18 12:20:31 +01:00
Gustavo J. A. M. Carneiro 7a1c6388c2 Backed out changeset df68dad55087ea649a33f04e78b4ff4cf324acdd 2007-07-18 12:17:53 +01:00
Gustavo J. A. M. Carneiro a694ccb39e WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc. 2007-07-18 11:43:39 +01:00
Mathieu Lacage a85bcfc0d7 Random2dPosition -> RandomPosition 2007-07-18 11:04:54 +02:00
Mathieu Lacage 5cc787f648 move Position class in own header 2007-07-18 11:03:01 +02:00
Mathieu Lacage a011792fb6 RandomRectangleTopology -> RandomTopology 2007-07-18 10:53:53 +02:00
Mathieu Lacage 2bd88ed300 use Random2dPosition from RandomRectangleTopology 2007-07-18 10:46:44 +02:00
Mathieu Lacage bd234eafe3 add iid and cid support to Random2dPosition 2007-07-18 10:46:26 +02:00
Mathieu Lacage 0405be5bb0 a random position helper class 2007-07-18 10:13:28 +02:00
Craig Dowell f8616ba0b5 routing documentation 2007-07-17 22:20:48 -07:00
Mathieu Lacage c40b0f6f63 start support for random walk and random waypoint models 2007-07-17 16:11:49 +02:00
Mathieu Lacage b10c76a3a6 cleanup the header 2007-07-17 14:37:11 +02:00
Mathieu Lacage 683b301fb7 split useful code out of random direction mobility model 2007-07-17 14:32:19 +02:00
Gustavo J. A. M. Carneiro 76223227ba Allow compiling the 'routing' module and example with WAF 2007-07-17 11:02:14 +01:00
Craig Dowell 04e59f26b9 checkpoint documentation 2007-07-17 12:17:17 -07:00
Mathieu Lacage ba0f81e65c remove unused class declarations 2007-07-17 11:13:34 +02:00
Mathieu Lacage 204352ca8b fix small typo 2007-07-17 11:12:24 +02:00
Mathieu Lacage 8b07f89d13 remove extraneous setters/getters 2007-07-17 10:58:13 +02:00
Mathieu Lacage 2f01154847 fix small typo 2007-07-17 10:54:50 +02:00
Mathieu Lacage 24458b4bf1 a topology class to read ns2's mobility files and a mobility generator. 2007-07-17 10:47:25 +02:00
Tom Henderson 52049833fd update release checklist 2007-07-16 22:49:48 -07:00
Tom Henderson 3ec27d06ec Added tag release ns-3.0.4 for changeset 5701e60bf01a 2007-07-16 22:44:02 -07:00
Craig Dowell 510d234611 checkpoint 2007-07-16 16:59:23 -07:00
Emmanuelle Laprise 3006bcb3f7 Testing 2007-07-16 18:42:40 -05:00
Mathieu Lacage b9c2580f22 a hierarchical mobility model 2007-07-16 15:27:56 +02:00
Tom Henderson 2684031ff2 Fix SPFVertex destructor; make unit tests succeed again 2007-07-15 22:47:58 -07:00
Craig Dowell de2866fe38 merge 2007-07-13 14:37:00 -07:00
Craig Dowell 2f2b10d22b remove inappropriate assertions that popped when routing disabled 2007-07-13 14:35:24 -07:00
Tom Henderson 2065013a04 Small readme for the routing 2007-07-13 14:22:40 -07:00
Tom Henderson 57b3448019 Check for static routing flag before instantiating a StaticRouteManager 2007-07-13 14:21:44 -07:00
Craig Dowell 65faee4e7b fix merge problem that lost candidate queue changes 2007-07-13 14:05:12 -07:00
Craig Dowell e1c4bbed1d remove debug prints 2007-07-13 13:49:10 -07:00
Craig Dowell 420fb5f6cc merge probs 2007-07-13 13:46:01 -07:00
Tom Henderson c4ee764dd8 Debugged; works 2007-07-13 13:33:56 -07:00
Craig Dowell 3e0167a9e9 delete vertices, fix candidate queue pop/top semantics 2007-07-13 12:21:48 -07:00
Craig Dowell be74b3dca8 implement SPFIntraAddRouter 2007-07-12 22:15:59 -07:00
Tom Henderson ba94df76e1 Finish function prototypes 2007-07-12 11:41:59 -07:00
Tom Henderson 6361dd3f6e Initial logic for SPFNexthopCalculation 2007-07-12 11:05:23 -07:00
Craig Dowell 9f44a9d6a4 dox for candidate queue 2007-07-12 10:47:12 -07:00
Tom Henderson 534ab7a030 finish SPFNext logic; add declaration for NexthopCalculation 2007-07-11 23:43:09 -07:00
Tom Henderson e0399adca9 Non-default constructor for SPFVertex 2007-07-11 22:54:47 -07:00
Tom Henderson 33a0cc3759 move m_stat flag to LSA 2007-07-11 22:37:48 -07:00
Tom Henderson 9ff955496e Replace SPFVertexPriorityQueue with CandidateQueue 2007-07-11 17:31:43 -07:00
Tom Henderson 9424ed9669 Make LSDB back into a storage for LSAs 2007-07-11 17:13:11 -07:00
Tom Henderson 248122670f Adjust candidate queue implementation: rename Fetch to Find, and make Find based on m_vertexId 2007-07-11 16:45:19 -07:00
Craig Dowell 9dc9be484f candidate queue 2007-07-11 13:18:01 -07:00
Tom Henderson 3fc88faa51 merge the minor tweaks 2007-07-10 23:11:24 -07:00
Tom Henderson 8168ddcb40 Add candidate list (priority queue) 2007-07-10 23:10:18 -07:00
Craig Dowell d57291777f minor tweaks 2007-07-10 22:17:25 -07:00
Craig Dowell e47dd4f054 One RouterLSA per node 2007-07-10 17:59:11 -07:00
Tom Henderson 4e86f62a64 end of day checkin 2007-07-10 17:56:46 -07:00
Craig Dowell 711276e62b SPFVertex Priority Queue 2007-07-10 17:35:44 -07:00
Tom Henderson a2acacebe0 Iterate link records (16.1(2)) 2007-07-10 15:03:39 -07:00
Tom Henderson 40e70fc6e9 Dummy test node for unit testing 2007-07-10 13:58:13 -07:00
Tom Henderson f4d5687704 Branch merge 2007-07-10 13:40:36 -07:00
Tom Henderson 3adfd850c7 Initialize SPFCalculate 2007-07-10 13:39:54 -07:00
Tom Henderson 42019fca7c Initialize LSDB for SPF runs 2007-07-10 13:34:23 -07:00
Tom Henderson 0fc2f3d86d SPFVertex constructor 2007-07-10 13:28:07 -07:00
Craig Dowell b10355c846 made GetNumLSAs cheap, added DiscoverLSAs as expensive call. 2007-07-10 13:01:43 -07:00
Craig Dowell 05d649ef54 doxygen 2007-07-10 12:38:51 -07:00
Tom Henderson 71d55ebf18 more plumbing around SPFCalculate() 2007-07-10 11:29:08 -07:00
Tom Henderson dc80efa426 convert LSDB to class SPFVertex 2007-07-10 10:56:27 -07:00
Craig Dowell 0068da44d4 first working router 2007-07-10 09:31:07 -07:00
Craig Dowell 3640d302e1 checkpoint 2007-07-10 01:28:19 -07:00
Tom Henderson d07e17d85c Add LSDB destructor 2007-07-09 23:07:51 -07:00
Tom Henderson a87c498af8 branch merge 2007-07-09 22:21:31 -07:00
Tom Henderson 75070e1bfa Add LSDB functions 2007-07-09 22:21:01 -07:00
Craig Dowell 5487c20beb forgot to remove a header include 2007-07-09 22:12:58 -07:00
Craig Dowell bcedf25ebf checkpoint 2007-07-09 22:04:55 -07:00
Craig Dowell 7ce874f5d0 checkpoint 2007-07-09 22:03:41 -07:00
Craig Dowell bd0cbfb5b8 checkpoint 2007-07-09 15:16:27 -07:00
Tom Henderson dfb744bdf1 Fill out self-tests example 2007-07-09 02:41:33 -07:00
Tom Henderson 849c347d2e Remove m_numLinks LSA member (redundant with list.size() method) 2007-07-08 15:30:17 -07:00
Tom Henderson 9c3fa17ce2 Remove NS_DEBUG in destructor 2007-07-08 15:17:45 -07:00
Tom Henderson 37783c3446 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup 2007-07-08 15:12:50 -07:00
Tom Henderson 2447ea37ca Add Set methods to class Ipv4Address (like the non-default ctors) 2007-07-08 13:55:39 -07:00
Tom Henderson 4d0e208a2e Add routing module to run_tests; add node module as dependency to routing 2007-07-08 13:55:03 -07:00
Tom Henderson 3aa83b20ff include node.h 2007-07-06 17:13:49 -07:00
Tom Henderson 1194823a73 Add more scaffolding 2007-07-06 16:57:35 -07:00
Tom Henderson 60685f35d8 Add static-route-manager scaffolding 2007-07-06 16:44:58 -07:00
Tom Henderson 4d9b0f6157 Add routing dependency to inode in SConstruct 2007-07-06 16:21:50 -07:00
Craig Dowell e2428486b1 merge ns3-dev 2007-07-06 15:10:01 -07:00
Craig Dowell 5a7dd75687 static routing 2007-07-06 15:07:03 -07:00
Craig Dowell 42bc462559 static routing 2007-07-06 15:06:26 -07:00
Craig Dowell d0ff4c3306 static routing 2007-07-06 15:05:47 -07:00
Craig Dowell 2f5acd74d9 static routing 2007-07-06 15:04:33 -07:00
Craig Dowell 7979a01371 static routing 2007-07-06 15:03:59 -07:00
Tom Henderson 59633b8ba6 remove p2p strings in simple-static-routing example 2007-07-06 14:47:01 -07:00
Tom Henderson 1eecfd24f6 merge ns-3-dev 2007-07-06 14:39:59 -07:00
Tom Henderson fdda9161fe a few fixes to the LSAs 2007-07-06 14:19:40 -07:00
Tom Henderson 4156e28d78 add example static routing script; a few changes to static-router LSAs 2007-07-06 13:13:43 -07:00
Craig Dowell 418275589c beginnings of static routing 2007-07-05 23:27:28 -07:00
Mathieu Lacage be946aab50 new version of DoGet and DoSet 2007-07-04 13:52:12 +02:00
Mathieu Lacage 2aca908685 use new MobilityModel::Get and remove old one. 2007-07-04 10:27:49 +02:00
Mathieu Lacage 99ec33418a add Position class and Get/Set methods on MobilityModel 2007-07-04 10:24:45 +02:00
Mathieu Lacage c416887542 POSITION_H -> MOBILITY_MODEL_H 2007-07-04 10:18:14 +02:00
Mathieu Lacage dd0ff29f66 position.h -> mobility-model.h 2007-07-04 10:15:18 +02:00
Mathieu Lacage 3e22f47624 Position -> MobilityModel 2007-07-04 10:04:08 +02:00
Mathieu Lacage bda20507bd PositionSetNotifier -> MobilityModelNotifier 2007-07-04 09:56:22 +02:00
Mathieu Lacage 9111697a0b add missing constructor declaration 2007-07-04 09:48:49 +02:00
Emmanuelle Laprise 97ac1394fa Needed to push const changes 2007-07-03 22:28:45 -05:00
Emmanuelle Laprise 6966d2633a Remove the const after the DoAddDevice function 2007-07-03 22:25:42 -05:00
Craig Dowell 58d341cea3 test 2007-07-03 12:43:39 -07:00
Mathieu Lacage f27587f391 build the new code 2007-07-03 17:14:09 +02:00
Mathieu Lacage ce6536c1d8 RandomDirection model 2007-07-03 17:12:44 +02:00
Mathieu Lacage c0420dfa2a add a few constructors 2007-07-03 17:12:28 +02:00
Mathieu Lacage 0c77aa5a69 implement Dispose 2007-07-03 17:11:53 +02:00
Mathieu Lacage 96698c5783 In some cases, when an event is scheduled against a subclass of Object, and if no one owns a reference directly to this object, the object is alive, has a refcount of zero and the method ran when the event expires runs against the raw pointer which means that we are manipulating an object with a refcount of zero. So, we must disable this check. This is really evil but I see no way to work around this. 2007-07-03 17:05:23 +02:00
Mathieu Lacage 038bc809cb add operator << (std::ostream)for Ptr<T> 2007-07-03 16:11:40 +02:00
Mathieu Lacage 71d559e1f2 add dirtyness tracking to DefaultValueBase 2007-07-03 13:19:09 +02:00
Mathieu Lacage 184d929521 parse command-line arguments 2007-07-03 12:36:01 +02:00
Mathieu Lacage 5e975db36e a bunch of new DefaultValue subclasses 2007-07-03 12:34:26 +02:00
Mathieu Lacage 9a89cf1978 change GridTopology API and add RandomRectangle topology with similar API. 2007-07-03 10:04:16 +02:00
Mathieu Lacage 94c1f03300 test random walk position model with grid topology 2007-07-03 09:15:20 +02:00
Mathieu Lacage 872df4e54e RandomWalk is a Position 2007-07-03 08:56:40 +02:00
Mathieu Lacage 5fdde955b3 change default values and add some debugging 2007-07-03 08:54:37 +02:00
Emmanuelle Laprise 826d8e0303 Removed the const after the DoAddDevice function because it is used to
add a callback on the packet receive function. But, in some cases (ie
ethernet learning), it is going to be needed to have a non-const
function that is called on packet reception.
2007-07-02 19:59:40 -05:00
Mathieu Lacage 3f87b85886 add cid/iid support to RandomWalk 2007-07-02 20:25:25 +02:00
Mathieu Lacage af6777397c rename GridTopology::Create to GridTopology::ArrangeHorizontally 2007-07-02 20:17:06 +02:00
Mathieu Lacage 2f29b73496 improve grid topology sample code and add dox documentation 2007-07-02 20:12:01 +02:00
Mathieu Lacage c14499b211 add dox documentation 2007-07-02 18:14:20 +02:00
Mathieu Lacage 57b5993f8d add dox documentation 2007-07-02 18:12:27 +02:00
Mathieu Lacage 2f8fdae0db increase sample simulation run 2007-07-02 15:28:28 +02:00
Mathieu Lacage e57869a38e add some debugging output. initialize the time argument correctly. 2007-07-02 15:27:53 +02:00
Mathieu Lacage e4d291802b make the sample code actually do something 2007-07-02 15:15:25 +02:00
Mathieu Lacage 77eb4ec65a improve sample code, make it build 2007-07-02 15:08:10 +02:00
Mathieu Lacage d27798e797 rework the notification mechanism to allow its optional use with every position model 2007-07-02 14:57:19 +02:00
Mathieu Lacage fca6b52fba random walk position model (untested) 2007-07-02 14:07:51 +02:00
Mathieu Lacage 04ebac2279 forgot to add TypeName implementation for float and double 2007-07-02 14:07:27 +02:00
Mathieu Lacage fb968dccdf forgot to add missing constructor implementation 2007-07-02 14:02:57 +02:00
Mathieu Lacage 1271ada6e1 TimeDefaultValue class 2007-07-02 14:02:02 +02:00
Mathieu Lacage 7a86a8a8e7 make default constructor private to avoid potential problems 2007-07-02 14:01:49 +02:00
Mathieu Lacage e9ee638ae9 grid topology 2007-07-02 12:14:24 +02:00
Mathieu Lacage 965e14c3f9 add cid support 2007-07-02 12:14:12 +02:00
Mathieu Lacage a2ca638f47 add cid support to position subclasses 2007-07-02 11:29:54 +02:00
Mathieu Lacage 0197e59eb1 DoSet should not be const 2007-07-02 11:29:27 +02:00
Mathieu Lacage 418adb52a4 add Position::DoSet et al. 2007-07-02 10:50:18 +02:00
Mathieu Lacage 8894524474 add floating point support to type names 2007-07-02 10:50:07 +02:00
Mathieu Lacage 6ec6318d5f position models 2007-06-29 09:41:37 +02:00
Craig Dowell a5e90a8dea test 2007-06-28 14:54:42 -07:00
Craig Dowell b22e98aa01 test 2007-06-28 14:39:56 -07:00
Craig Dowell 89ea0a9911 test 2007-06-28 14:29:46 -07:00
Craig Dowell 7fec46aecf test 2007-06-20 12:07:31 -07:00
650 changed files with 97356 additions and 20254 deletions
+28 -9
View File
@@ -1,9 +1,28 @@
.*.orig$
.*\.o$
.*~$
build-dir
build
.*\.sconsign
doc/html.*
doc/latex.*
.lock-wscript
\.rej$
\.orig$
\.o$
~$
^build-dir
^build
^doc/html
^doc/latex
^\.lock-wscript
^\.waf
^doc/introspected-doxygen\.h$
.*\.py[co]$
\.pcap$
^doc/manual/manual/
doc/manual/manual.aux
doc/manual/manual.cp
doc/manual/manual.fn
doc/manual/manual.html
doc/manual/manual.ky
doc/manual/manual.log
doc/manual/manual.pdf
doc/manual/manual.pg
doc/manual/manual.toc
doc/manual/manual.tp
doc/manual/manual.vr
^doc/manual/figures/.*eps
^doc/manual/figures/.*pdf
^doc/manual/figures/.*png
+13
View File
@@ -2,3 +2,16 @@
7ac5a4b0969b255c4824c926c2b37ef450136ce9 release ns-3.0.2
0dc81e76166c56aaae64da48b673b62155943aad packet-history-working
38099dd26e9467b8f49f8632f22789858149a6e7 release ns-3.0.3
5701e60bf01a8ac1308945e69001e0cc07948faf release ns-3.0.4
08046b6aef37932507696a2f2f427b42d693781e release ns-3.0.5
267e2ebc28e4e4ae2f579e1cfc29902acade0c34 buffer-working-before-breaking
606df29888e7573b825fc891a002f0757166b616 release ns-3.0.6
36472385a1cc7c44d34fb7a5951b930010f4e8d2 release ns-3.0.7
560a5091e0e6ded47d269e2f2dee780f13950a63 release ns-3.0.8
4db981a0d9eb135e3e1c07765cff8d66f7a55cca release ns-3.0.9
b5bf2588cde2f1273b1095cc5c83a0c272e55370 release ns-3.0.10
ee5e1da76ecc52337f097cd90ebb50a3d49ec541 release-3.0.11
b17f2928291eec5bf5b1c59a4a5fd583f704ac40 release ns-3.0.12
79dba133b5f8a2d6f6f678a22e8519bc155e6a4e release ns-3.0.13
8869a79a391f49d0c787f0558cc9329b4e7ee40e release candidate ns-3.1-RC1
951296e9a277e14113a0d3ba86a9688b222569ae release ns-3.1-RC2
+4
View File
@@ -2,5 +2,9 @@ Raj Bhattarcharjea (raj.b@gatech.edu)
Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com)
Craig Dowell (craigdo@ee.washington.edu)
Tom Henderson (tomhend@u.washington.edu)
Joe Kopena (tjkopena@cs.drexel.edu)
Mathieu Lacage (mathieu.lacage@sophia.inria.fr)
Emmanuelle Laprise (emmmanuelle.laprise@bluekazoo.ca)
Federico Maguolo (maguolof@dei.unipd.it)
George F. Riley (riley@ece.gatech.edu)
Guillaume Vu-Brugier (gvubrugier@gmail.com)
+24 -47
View File
@@ -36,25 +36,26 @@ project. These steps are described in doc/contributing.txt
This package contains the latest version of ns-3 which aims
at being a replacement for ns-2. Currently, ns-3 provides a
number of very simple network simulation models:
- an ipv4 and udp stack
number of simple network simulation models:
- an ipv4 and tcp and udp stack
- arp support at the bottom of the stack
- point-to-point physical-layer links
- static global and OLSR unicast routing
- point-to-point, CSMA, and Wifi links
- mobility
- OnOff traffic generator
Our focus to date has been on getting an overall software
framework in place. The framework is there to make adding
new models as simple as possible:
- an extensive tracing system can be used to connect
any number of arbitrary trace sources to any number
of trace sinks. This tracing system is decoupled
from the act of serializing the trace events to a
file: users can and should provide their own
trace handling routines.
- an extensive callback-based tracing system
- simple file trace serialization support is included
to both text and pcap files.
- an attribute system for configuring parameters in the
models
- adding new MAC-level models simply requires subclassing
the pair of classes NetDevice and Channel.
@@ -71,29 +72,26 @@ use of these ns-3 libraries.
To build the set of default libraries and the example
programs included in this package, you need to use the
tool 'scons'. Detailed information on how to install
and use scons is included in the file doc/build.txt
tool 'waf'. Detailed information on how to install
and use waf is included in the file doc/build.txt
However, the real quick and dirty way to get started is to
type the command "scons" the the directory which contains
type the command "./waf" the the directory which contains
this README file. The files built will be copied in the
build-dir/dbg-shared/bin and build-dir/dbg-shared/lib
directories. build-dir/dbg-shared/bin will contain
one binary for each of the sample code in the 'samples'
directory and one binary for each of the detailed examples
found in the 'examples' directory.
build/debug or build/optimized.
The current codebase is expected to build and run on the
following set of platforms:
- linux x86 gcc 4.2, 4.1, and, 3.4.
- linux x86_64 gcc 4.0
- linux x86 gcc 4.2, 4.1, and, 3.4.6.
- linux x86_64 gcc 4.1.3, 4.2.1, 3.4.6
- MacOS X ppc and x86
- cygwin gcc 3.4.4 (debug only)
The current codebase is expected to fail to build on
the following platforms:
- gcc 3.3 and earlier
- optimized builds on gcc 3.4.4 and 3.4.5
- optimized builds on linux x86 gcc 4.0
- cygwin
Other platforms may or may not work: we welcome
patches to improve the portability of the code to these
@@ -106,22 +104,17 @@ On recent Linux systems, once you have built ns-3, it
should be easy to run the sample programs with the
following command:
./build-dir/dbg-shared/bin/simple-p2p
./waf --run simple-global-routing
or:
cd build-dir/dbg-shared/bin
./simple-p2p
That program should generate a simple-p2p.tr text
trace file and a set of simple-p2p-xx-xx.pcap binary
pcap trace files, which can be read by tcpdump.
That program should generate a simple-global-routing.tr text
trace file and a set of simple-global-routing-xx-xx.pcap binary
pcap trace files, which can be read by tcpdump -tt -r filename.pcap
5) Getting access to the ns-3 documentation
-------------------------------------------
Once you have verified that your build of ns-3 works by running
the simple-p2p example as outlined in 4) above, it is
the simple-point-to-point example as outlined in 4) above, it is
quite likely that you will want to get started on reading
some ns-3 documentation.
@@ -131,12 +124,7 @@ include some of it in this release for ease of use.
This documentation includes:
- an architecture document which describes a very
high-level view of ns-3: it tries to explain the
use-cases the ns-3 developers really focused on when
doing the initial design and then goes on to explain
the structure of the resulting framework.
See the file doc/architecture.pdf
- a tutorial
- a wiki for user-contributed tips: http://www.nsnam.org/wiki/
@@ -145,17 +133,6 @@ This documentation includes:
as introductory text:
http://www.nsnam.org/doxygen/index.html
If you want to re-generate this documentation, you can
easily do so:
- doc/architecture.pdf is generated from the architecture.tex
file in http://code.nsnam.org/docs
- the doxygen documentation is generated from the doc/doxygen.conf
configuration file. The command "scons doc" will generate it
as doc/html/index.html if you have installed the doxygen tools
(see http://www.doxygen.org)
6) Working with the development version of ns-3
-----------------------------------------------
+108
View File
@@ -3,6 +3,114 @@
This file contains ns-3 release notes (most recent releases first).
Release 3.1 (2008/06/30 tentatively)
========================
First supported ns-3 release.
- TCP bugfixes and support for packet tags
- CSMA NetDevice cleanup and documentation
- internet-node renamed to internet-stack
- Socket::RecvFrom added; "flags" argument added to Send calls
- updated doxygen
- several bugs and open issues closed out
- revised tutorial
Note: Some API in class ns3::Ipv4 and ns3::Ipv4RoutingProtocol is
deprecated and may be removed and replaced in future releases.
Release 3.0.13 (2008/06/02)
========================
- point to point links generate ppp pcap traces
- point to point links support asymmetrical data rates.
- generate doxygen documentation for all attributes and trace sources
- add ConfigStore and GtkConfigStore to contrib module
- socket API now support tx and rx buffers: implemented for UDP and TCP
- ARP cache now supports per-entry pending queues
- lots of bugfixes and implementation and API cleanups
Warning: among API changes in this release, Application::Start and
Application::Stop now interprets the time argument as a relative
instead of absolute simulation time, to align with how Simulator::Schedule
behaves. Any code that calls these APIs in the middle of the simulation
will need to be adapted.
The API of Simulator::StopAt (time) has also changed. Now it is
called Simulator::Stop (time), and takes a relative time, instead of
absolute.
Release 3.0.12 (2008/04/07)
========================
- Add Attribute support to the TypeId metadata system and add
attribute support to all in-tree models
- Add a mid-level helper API to build simulation topologies
and perform simple ascii and pcap link-level tracing.
- Large amount of structural changes to accomodate the needs
of the upcoming python bindings
- new rate control algorithm (RRAA) and a jakes propagation model
in the 802.11 model (Federico Maguolo).
- regression test framework added
- TCP delayed acknowledgements and multitasking server
Release 3.0.11 (2008/02/15)
========================
- Initial port of GTNetS TCP implementation (initial version
that does not support multitasking or delayed acknowledgments yet,
but supports a reliable stream service)
- Changes to the ns-3 object model to create a TypeId-based
metadata system
- lots of bug fixes throughout the system
- tutorial updates
Release 3.0.10 (2008/01/15)
========================
- Add tutorial document content;
- Valgrind option for "waf" tool;
- Doxygen organization changes.
Release 3.0.9 (2007/12/15)
========================
- A 802.11 model ported from Yans. This model supports:
* a rather extensive PHY model
* log-distance and friis propagation model
* a simple set of rate control algorithms (ARF, Ideal,
AARF, constant-rate)
* adhoc and infrastructure mode (beacon+assoc)
- Use smart pointer for Packet in the APIs
- A new contrib directory with helper classes:
EventGarbageCollector, Gnuplot
- Tracing support for Applications
- many bugs fixed
Release 3.0.8 (2007/11/15)
========================
- A simple error model
- Source files for ns-3 tutorial
Release 3.0.7 (2007/10/15)
========================
- OLSR routing protocol
- A timer class
- Additional mobility models (random waypoint, random 2D walk)
- A mobility visualization tool
Release 3.0.6 (2007/09/15)
========================
- Static multicast IPv4 routing
- Logging overhaul (NS_LOG macros)
- Refactoring of tracing subsystem
- Tutorial document started
Release 3.0.5 (2007/08/15)
========================
- Refactoring to support win32-based unix environments (Cygwin, mingw)
- "Packet socket" for allowing applications to access NetDevices directly
- Generalized, polymorphic Address class
- Add CSMA NetDevice model (from Emmanuelle Laprise)
- Modularize IPv4 routing support (from Gustavo Carneiro)
- Add mobility framework and basic mobility models
- Global unicast centralized routing
Release 3.0.4 (2007/07/15)
========================
-484
View File
@@ -1,484 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os.path
import build
version_file = open ('VERSION', 'r')
version = version_file.readline ()
version_file.close ()
version = version.strip ()
ns3 = build.Ns3()
ns3.build_dir = 'build-dir'
ns3.version = version
ns3.name = 'ns3'
ns3.distname = 'ns'
ns3.doxygen_config = os.path.join('doc', 'doxygen.conf')
ns3.add_extra_dist(os.path.join('doc', 'main.txt'))
ns3.add_extra_dist ('doc/architecture.pdf')
ns3.add_extra_dist ('doc/contributing.txt')
ns3.add_extra_dist ('doc/build.txt')
ns3.add_extra_dist ('doc/codingstd.txt')
ns3.add_extra_dist ('doc/mercurial.txt')
ns3.add_extra_dist ('README')
ns3.add_extra_dist ('RELEASE_NOTES')
ns3.add_extra_dist ('AUTHORS')
ns3.add_extra_dist ('VERSION')
ns3.add_extra_dist('ns3/_placeholder_')
for wscript in [
"src/core/wscript",
"src/node/wscript",
"src/devices/p2p/wscript",
"src/common/wscript",
"src/applications/wscript",
"src/simulator/wscript",
"src/internet-node/wscript",
"src/wscript",
"utils/wscript",
"samples/wscript",
"examples/wscript",
"wscript",
]:
ns3.add_extra_dist(wscript)
ns3.add_extra_dist('waf.bat')
#
# The Core module
#
core = build.Ns3Module('core', 'src/core')
ns3.add(core)
core.add_sources([
'callback-test.cc',
'debug.cc',
'assert.cc',
'ptr.cc',
'object.cc',
'test.cc',
'random-variable.cc',
'rng-stream.cc',
'uid-manager.cc',
'default-value.cc',
'command-line.cc',
'type-name.cc',
'component-manager.cc',
])
env = Environment()
if env['PLATFORM'] == 'posix' or env['PLATFORM'] == 'darwin' or env['PLATFORM'] == 'cygwin':
core.add_external_dep('pthread')
core.add_sources([
'unix-system-wall-clock-ms.cc',
])
elif env['PLATFORM'] == 'win32':
core.add_sources([
'win32-system-wall-clock-ms.cc',
])
core.add_headers ([
'uid-manager.h',
'singleton.h',
])
core.add_inst_headers([
'system-wall-clock-ms.h',
'empty.h',
'callback.h',
'ptr.h',
'object.h',
'debug.h',
'assert.h',
'fatal-error.h',
'test.h',
'random-variable.h',
'rng-stream.h',
'default-value.h',
'command-line.h',
'type-name.h',
'component-manager.h',
])
def config_core (env, config):
retval = []
# XXX This check is primitive but it should be
# good enough for now.
if config.CheckCHeader ('stdlib.h') == 1:
retval.append ('#define HAVE_STDLIB_H 1')
retval.append ('#define HAVE_GETENV 1')
else:
retval.append ('#undef HAVE_STDLIB_H')
retval.append ('#undef HAVE_GETENV')
return retval
core.add_config (config_core)
#
# The Simu module
#
simu = build.Ns3Module('simulator', 'src/simulator')
ns3.add(simu)
simu.add_dep('core')
simu.add_external_dep('m')
simu.add_sources([
'high-precision.cc',
'time.cc',
'event-id.cc',
'scheduler.cc',
'scheduler-factory.cc',
'scheduler-list.cc',
'scheduler-heap.cc',
'scheduler-map.cc',
'event-impl.cc',
'simulator.cc',
])
simu.add_headers([
'scheduler-heap.h',
'scheduler-map.h',
'scheduler-list.h'
])
simu.add_inst_headers([
'high-precision.h',
'nstime.h',
'event-id.h',
'event-impl.h',
'simulator.h',
'scheduler.h',
'scheduler-factory.h',
'simulation-singleton.h',
])
high_precision_as_double = ARGUMENTS.get('high-precision-as-double', 'n')
if high_precision_as_double == 'y':
simu.add_inst_header ('high-precision-double.h')
simu.add_source ('high-precision-double.cc')
else:
simu.add_inst_headers ([
'high-precision-128.h',
'cairo-wideint-private.h'
])
simu.add_sources ([
'high-precision-128.cc',
'cairo-wideint.c',
])
def config_simulator (env, config):
retval = []
high_precision_as_double = ARGUMENTS.get('high-precision-as-double', 'n')
if high_precision_as_double == 'y':
retval.append ('#define USE_HIGH_PRECISION_DOUBLE 1')
else:
retval.append ('#undef USE_HIGH_PRECISION_DOUBLE')
if config.CheckCHeader ('stdint.h') == 1:
retval.append ('#define HAVE_STDINT_H 1')
elif config.CheckCHeader ('inttypes.h') == 1:
retval.append ('#define HAVE_INTTYPES_H 1')
elif config.CheckCHeader ('sys/inttypes.h') == 1:
retval.append ('#define HAVE_SYS_INT_TYPES_H 1')
return retval
simu.add_config (config_simulator)
#
# The Common module
#
common = build.Ns3Module('common', 'src/common')
common.add_deps(['core', 'simulator'])
ns3.add(common)
common.add_sources([
'buffer.cc',
'chunk.cc',
'header.cc',
'trailer.cc',
'packet-printer.cc',
'packet-metadata.cc',
'packet.cc',
'tags.cc',
'pcap-writer.cc',
'variable-tracer-test.cc',
'trace-context.cc',
'trace-resolver.cc',
'callback-trace-source.cc',
'empty-trace-resolver.cc',
'composite-trace-resolver.cc',
'trace-root.cc',
'data-rate.cc',
])
common.add_headers ([
])
common.add_inst_headers([
'buffer.h',
'chunk.h',
'header.h',
'trailer.h',
'tags.h',
'packet.h',
'packet-printer.h',
'packet-metadata.h',
'uv-trace-source.h',
'sv-trace-source.h',
'fv-trace-source.h',
'pcap-writer.h',
'callback-trace-source.h',
'trace-context.h',
'trace-resolver.h',
'empty-trace-resolver.h',
'composite-trace-resolver.h',
'array-trace-resolver.h',
'trace-root.h',
'terminal-trace-resolver.h',
'data-rate.h',
])
node = build.Ns3Module ('node', 'src/node')
ns3.add (node)
node.add_deps (['core', 'common', 'simulator'])
node.add_sources ([
'node.cc',
'ipv4-address.cc',
'net-device.cc',
'mac-address.cc',
'llc-snap-header.cc',
'ipv4-route.cc',
'queue.cc',
'drop-tail-queue.cc',
'channel.cc',
'node-list.cc',
'socket.cc',
'socket-factory.cc',
'udp.cc',
'ipv4.cc',
'application.cc',
])
node.add_inst_headers ([
'node.h',
'ipv4-address.h',
'net-device.h',
'mac-address.h',
'ipv4-route.h',
'queue.h',
'drop-tail-queue.h',
'llc-snap-header.h',
'channel.h',
'node-list.h',
'socket.h',
'socket-factory.h',
'udp.h',
'ipv4.h',
'application.h',
])
applications = build.Ns3Module ('applications', 'src/applications')
ns3.add (applications)
applications.add_deps (['node'])
applications.add_sources ([
'onoff-application.cc',
])
applications.add_inst_headers ([
'onoff-application.h',
])
inode = build.Ns3Module ('internet-node', 'src/internet-node')
ns3.add (inode)
inode.add_deps (['node'])
inode.add_sources ([
'internet-node.cc',
'l3-demux.cc',
'l3-protocol.cc',
'ipv4-l4-demux.cc',
'ipv4-l4-protocol.cc',
'ipv4-header.cc',
'udp-header.cc',
'ipv4-checksum.cc',
'ipv4-interface.cc',
'ipv4-l3-protocol.cc',
'ipv4-end-point.cc',
'udp-l4-protocol.cc',
'arp-header.cc',
'arp-cache.cc',
'arp-ipv4-interface.cc',
'arp-l3-protocol.cc',
'ipv4-loopback-interface.cc',
'header-utils.cc',
'udp-socket.cc',
'ipv4-end-point-demux.cc',
'arp-private.cc',
'ipv4-impl.cc',
'ipv4-private.cc',
'ascii-trace.cc',
'pcap-trace.cc',
'udp-impl.cc',
])
inode.add_headers ([
'ipv4-checksum.h',
'arp-header.h',
'arp-cache.h',
'arp-l3-protocol.h',
'ipv4-loopback-interface.h',
'l3-demux.h',
'header-utils.h',
'arp-ipv4-interface.h',
'udp-socket.h',
'udp-l4-protocol.h',
'arp-private.h',
'ipv4-impl.h',
'ipv4-private.h',
'ipv4-l3-protocol.h',
'l3-protocol.h',
'ipv4-l4-protocol.h',
'ipv4-l4-demux.h',
'ipv4-end-point-demux.h',
'ipv4-end-point.h',
'ipv4-header.h',
'udp-header.h',
'ipv4-interface.h',
'sgi-hashmap.h',
'udp-impl.h',
])
inode.add_inst_headers ([
'internet-node.h',
'ascii-trace.h',
'pcap-trace.h',
'ipv4-header.h',
'udp-header.h',
])
p2p = build.Ns3Module ('p2p', 'src/devices/p2p')
ns3.add (p2p)
p2p.add_deps (['node'])
p2p.add_sources ([
'p2p-net-device.cc',
'p2p-channel.cc',
'p2p-topology.cc',
])
p2p.add_inst_headers ([
'p2p-net-device.h',
'p2p-channel.h',
'p2p-topology.h',
])
# utils
run_tests = build.Ns3Module('run-tests', 'utils')
ns3.add(run_tests)
run_tests.set_executable()
run_tests.add_deps(['core', 'simulator', 'common'])
run_tests.add_source('run-tests.cc')
bench_object = build.Ns3Module('bench-object', 'utils')
ns3.add(bench_object)
bench_object.set_executable()
bench_object.add_deps(['core'])
bench_object.add_source('bench-object.cc')
bench_packets = build.Ns3Module('bench-packets', 'utils')
ns3.add(bench_packets)
bench_packets.set_executable()
bench_packets.add_deps (['core', 'common'])
bench_packets.add_source('bench-packets.cc')
bench_simu = build.Ns3Module('bench-simulator', 'utils')
ns3.add(bench_simu)
bench_simu.set_executable()
bench_simu.add_dep('simulator')
bench_simu.add_source('bench-simulator.cc')
replay_simu = build.Ns3Module('replay-simulation', 'utils')
ns3.add(replay_simu)
replay_simu.set_executable()
replay_simu.add_dep('simulator')
replay_simu.add_source('replay-simulation.cc')
# samples
sample_debug = build.Ns3Module('sample-debug', 'samples')
sample_debug.set_executable()
ns3.add(sample_debug)
sample_debug.add_dep('core')
sample_debug.add_source('main-debug.cc')
sample_debug.add_source('main-debug-other.cc')
sample_packet_printer = build.Ns3Module('sample-packet-printer', 'samples')
sample_packet_printer.set_executable()
ns3.add(sample_packet_printer)
sample_packet_printer.add_deps (['common', 'internet-node'])
sample_packet_printer.add_source('main-packet-printer.cc')
sample_callback = build.Ns3Module('sample-callback', 'samples')
sample_callback.set_executable()
ns3.add(sample_callback)
sample_callback.add_dep('core')
sample_callback.add_source('main-callback.cc')
sample_ptr = build.Ns3Module('sample-ptr', 'samples')
sample_ptr.set_executable()
ns3.add(sample_ptr)
sample_ptr.add_dep('core')
sample_ptr.add_source('main-ptr.cc')
sample_trace = build.Ns3Module('sample-trace', 'samples')
#ns3.add(sample_trace)
sample_trace.add_dep('common')
sample_trace.set_executable()
sample_trace.add_source('main-trace.cc')
sample_query_interface = build.Ns3Module('sample-query-interface', 'samples')
ns3.add(sample_query_interface)
sample_query_interface.add_dep('common')
sample_query_interface.set_executable()
sample_query_interface.add_source('main-query-interface.cc')
sample_simu = build.Ns3Module('sample-simulator', 'samples')
ns3.add(sample_simu)
sample_simu.set_executable()
sample_simu.add_dep('simulator')
sample_simu.add_source('main-simulator.cc')
sample_packet = build.Ns3Module('sample-packet', 'samples')
ns3.add(sample_packet)
sample_packet.set_executable()
sample_packet.add_dep('common')
sample_packet.add_source('main-packet.cc')
sample_test = build.Ns3Module('sample-test', 'samples')
sample_test.set_executable()
ns3.add(sample_test)
sample_test.add_dep('core')
sample_test.add_source('main-test.cc')
sample_simple = build.Ns3Module('sample-simple', 'samples')
sample_simple.set_executable()
ns3.add(sample_simple)
sample_simple.add_deps(['core', 'simulator', 'node', 'internet-node'])
sample_simple.add_source('main-simple.cc')
sample_sp2p = build.Ns3Module('sample-simple-p2p', 'samples')
sample_sp2p.set_executable()
#n3.add(sample_sp2p)
sample_sp2p.add_deps(['core', 'simulator', 'node', 'internet-node', 'p2p'])
sample_sp2p.add_source('main-simple-p2p.cc')
sample_default_value = build.Ns3Module('sample-default-value', 'samples')
sample_default_value.set_executable()
ns3.add(sample_default_value)
sample_default_value.add_deps(['core', 'simulator', 'node', 'p2p'])
sample_default_value.add_source('main-default-value.cc')
sample_object = build.Ns3Module('sample-object', 'samples')
sample_object.set_executable()
ns3.add(sample_object)
sample_object.add_deps(['core'])
sample_object.add_source('main-object.cc')
sample_component_manager = build.Ns3Module('sample-component-manager', 'samples')
sample_component_manager.set_executable()
ns3.add(sample_component_manager)
sample_component_manager.add_deps(['core'])
sample_component_manager.add_source('main-component-manager.cc')
# examples
example_simple_p2p = build.Ns3Module('simple-p2p', 'examples')
example_simple_p2p.set_executable()
ns3.add(example_simple_p2p)
example_simple_p2p.add_deps(['core', 'simulator', 'node', 'p2p', 'internet-node', 'applications'])
example_simple_p2p.add_source('simple-p2p.cc')
ns3.generate_dependencies()
+1 -1
View File
@@ -1 +1 @@
3.0.4
3-dev
-561
View File
@@ -1,561 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# Copyright (c) 2006 INRIA
# All rights reserved.
#
# 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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
import os
import os.path
import shutil
from SCons.Environment import Environment
from SCons.Builder import Builder
from SCons.Action import Action
import SCons
# hack stolen from wengo
# to get an ARGUMENTS defined correctly
try:
ARGUMENTS = SCons.Script.ARGUMENTS
COMMAND_LINE_TARGETS = SCons.Script.COMMAND_LINE_TARGETS
except AttributeError:
from SCons.Script.SConscript import Arguments
from SCons.Script.SConscript import CommandLineTargets
ARGUMENTS = Arguments
COMMAND_LINE_TARGETS = CommandLineTargets
class Ns3Module:
def __init__(self, name, dir):
self.sources = []
self.inst_headers = []
self.headers = []
self.extra_dist = []
self.deps = []
self.external_deps = []
self.config = []
self.name = name
self.dir = dir
self.executable = False
self.library = True
self.ldflags = []
self.header_inst_dir = ''
def set_library(self):
self.library = True
self.executable = False
def set_executable(self):
self.library = False
self.executable = True
def add_config(self, config_fn):
self.config.append(config_fn)
def add_extra_dist(self, dist):
self.extra_dist.append(dist)
def add_external_dep(self, dep):
self.external_deps.append(dep)
def add_dep(self, dep):
self.deps.append(dep)
def add_deps(self, deps):
self.deps.extend(deps)
def add_source(self, source):
self.sources.append(source)
def add_sources(self, sources):
self.sources.extend(sources)
def add_header(self, header):
self.headers.append(header)
def add_headers(self, headers):
self.headers.extend(headers)
def add_inst_header(self, header):
self.inst_headers.append(header)
def add_inst_headers(self, headers):
self.inst_headers.extend(headers)
def add_ldflags (self, ldflags):
self.ldflags.extend (ldflags)
def add_ldflag (self, ldflag):
self.add_ldflags ([ldflag])
def set_header_inst_dir (self, inst_dir):
self.header_inst_dir = inst_dir
def MyCopyAction(target, source, env):
try:
if len(target) == len(source):
for i in range(len(target)):
shutil.copy(source[i].path, target[i].path)
return 0
else:
return 'invalid target/source match'
except:
print
return 'exception'
def MyCopyActionPrint(target, source, env):
if len(target) == len(source):
output = ''
for i in range(len(target)):
output = output + 'copy \'' + source[i].path + '\' to \'' + target[i].path + '\''
if i < len(target) - 1:
output = output + '\n'
return output
else:
return 'error in copy'
def GcxxEmitter(target, source, env):
if os.path.exists(source[0].path):
return [target, source]
else:
return [[], []]
def MyRmTree(target, source, env):
shutil.rmtree(env['RM_DIR'])
return 0
def MyRmTreePrint(target, source, env):
return ''
def print_cmd_line(s, target, src, env):
print 'Building ' + (' and '.join([str(x) for x in target])) + '...'
class Ns3BuildVariant:
def __init__(self):
self.static = False
self.gcxx_deps = False
self.gcxx_root = ''
self.build_root = ''
self.env = None
class Ns3:
def __init__(self):
self.__modules = []
self.extra_dist = []
self.build_dir = 'build'
self.version = '0.0.1'
self.name = 'noname'
self.distname = 'noname'
self.doxygen_config = ''
def add(self, module):
self.__modules.append(module)
def add_extra_dist(self, dist):
self.extra_dist.append(dist)
def __get_module(self, name):
for module in self.__modules:
if module.name == name:
return module
return None
def get_mod_output(self, module, variant):
if module.executable:
suffix = variant.env.subst(variant.env['PROGSUFFIX'])
filename = os.path.join(variant.build_root, 'bin',
module.name + suffix)
else:
if variant.static:
prefix = variant.env['LIBPREFIX']
suffix = variant.env['LIBSUFFIX']
else:
prefix = variant.env['SHLIBPREFIX']
suffix = variant.env['SHLIBSUFFIX']
prefix = variant.env.subst(prefix)
suffix = variant.env.subst(suffix)
filename = os.path.join(variant.build_root, 'lib',
prefix + module.name + suffix)
return filename
def get_obj_builders(self, variant, module):
env = variant.env.Copy ()
objects = []
hash = {}
self.get_internal_deps (module, hash)
for dep in hash.values ():
if dep.header_inst_dir != '':
inc_dir = os.path.join(variant.build_root, 'include',
self.name, dep.header_inst_dir)
env.Append (CPPPATH = [inc_dir])
if len(module.config) > 0:
src_config_file = os.path.join(self.build_dir, 'config', module.name + '-config.h')
tgt_config_file = os.path.join(variant.build_root, 'include',
self.name, module.name + '-config.h')
for source in module.sources:
obj_file = os.path.splitext(source)[0] + '.o'
tgt = os.path.join(variant.build_root, module.dir, obj_file)
src = os.path.join(module.dir, source)
if variant.static:
obj_builder = env.StaticObject(target = tgt, source = src)
else:
obj_builder = env.SharedObject(target = tgt, source = src)
if len(module.config) > 0:
config_file = env.MyCopyBuilder(target = [tgt_config_file],
source = [src_config_file])
env.Depends(obj_builder, config_file)
if variant.gcxx_deps:
gcno_tgt = os.path.join(variant.build_root, module.dir,
os.path.splitext(source)[0] + '.gcno')
gcda_tgt = os.path.join(variant.build_root, module.dir,
os.path.splitext(source)[0] + '.gcda')
gcda_src = os.path.join(variant.gcxx_root, module.dir,
os.path.splitext(source)[0] + '.gcda')
gcno_src = os.path.join(variant.gcxx_root, module.dir,
os.path.splitext(source)[0] + '.gcno')
gcno_builder = env.CopyGcxxBuilder(target = gcno_tgt, source = gcno_src)
gcda_builder = env.CopyGcxxBuilder(target = gcda_tgt, source = gcda_src)
env.Depends(obj_builder, gcda_builder)
env.Depends(obj_builder, gcno_builder)
objects.append(obj_builder)
return objects
def get_internal_deps(self, module, hash):
for dep_name in module.deps:
dep = self.__get_module(dep_name)
hash[dep_name] = dep
self.get_internal_deps(dep, hash)
def get_external_deps(self, module):
hash = {}
self.get_internal_deps(module, hash)
ext_hash = {}
for mod in hash.values():
for ext_dep in mod.external_deps:
ext_hash[ext_dep] = 1
return ext_hash.keys()
def get_sorted_deps(self, module):
h = {}
self.get_internal_deps(module, h)
modules = []
for dep in h.keys():
deps_copy = []
mod = h[dep]
deps_copy.extend(mod.deps)
modules.append([mod, deps_copy])
sorted = []
while len(modules) > 0:
to_remove = []
for item in modules:
if len(item[1]) == 0:
to_remove.append(item[0].name)
for item in to_remove:
for i in modules:
if item in i[1]:
i[1].remove(item)
new_modules = []
for mod in modules:
found = False
for i in to_remove:
if i == mod[0].name:
found = True
break
if not found:
new_modules.append(mod)
modules = new_modules
sorted.extend(to_remove)
sorted.reverse()
# append external deps
ext_deps = self.get_external_deps(module)
for dep in ext_deps:
sorted.append(dep)
return sorted
def gen_mod_dep(self, variant):
build_root = variant.build_root
cpp_path = os.path.join(variant.build_root, 'include')
env = variant.env
env.Append(CPPPATH = [cpp_path])
header_dir = os.path.join(build_root, 'include', self.name)
lib_path = os.path.join(build_root, 'lib')
env.Append (LIBPATH = [lib_path])
module_builders = []
for module in self.__modules:
my_env = env.Copy ();
objects = self.get_obj_builders(variant, module)
libs = self.get_sorted_deps(module)
my_env.Append (LIBS = libs)
my_env.Append (LINKFLAGS = module.ldflags)
filename = self.get_mod_output(module, variant)
if module.executable:
module_builder = my_env.Program(target=filename, source=objects)
else:
if variant.static:
module_builder = my_env.StaticLibrary(target=filename, source=objects)
else:
module_builder = my_env.SharedLibrary(target=filename, source=objects)
for dep_name in module.deps:
dep = self.__get_module(dep_name)
my_env.Depends(module_builder, self.get_mod_output(dep, variant))
for header in module.inst_headers:
if module.header_inst_dir != '':
tgt = os.path.join(header_dir, module.header_inst_dir, header)
else:
tgt = os.path.join(header_dir, header)
src = os.path.join(module.dir, header)
#builder = env.Install(target = tgt, source = src)
header_builder = my_env.MyCopyBuilder(target=tgt, source=src)
my_env.Depends(module_builder, header_builder)
module_builders.append(module_builder)
return module_builders
def gen_mod_config(self, env):
config_dir = os.path.join(self.build_dir, 'config')
for module in self.__modules:
if len(module.config) > 0:
config_file = os.path.join(config_dir, module.name + '-config.h')
config_file_guard = module.name + '_CONFIG_H'
config_file_guard.upper()
if not os.path.isfile(config_file):
if not os.path.isdir(config_dir):
os.makedirs(config_dir)
outfile = open(config_file, 'w')
outfile.write('#ifndef ' + config_file_guard + '\n')
outfile.write('#define ' + config_file_guard + '\n')
config = env.Configure()
for fn in module.config:
output = fn(env, config)
for o in output:
outfile.write(o)
outfile.write('\n')
outfile.write('#endif /*' + config_file_guard + '*/\n')
config.Finish()
def generate_dependencies(self):
inheritenv = (ARGUMENTS.get('inheritenv', 'n') in 'yY1')
if inheritenv:
env = Environment(ENV=os.environ)
else:
env = Environment()
self.gen_mod_config(env)
cc = env['CC']
cxx = env.subst(env['CXX'])
if cc == '':
print "Missing C compiler."
env.Exit (1);
if cxx == '':
print "Missing C++ compiler."
env.Exit (1);
common_flags = ARGUMENTS.get('cflags', '').split(' ')
cxxflags = ARGUMENTS.get('cxxflags', '').split(' ')
ldflags = ARGUMENTS.get('ldflags', '').split(' ')
if cc == 'cl' and cxx == 'cl':
env = Environment(tools=['mingw'])
cc = env['CC']
cxx = env.subst(env['CXX'])
if cc == 'gcc' and cxx == 'g++':
common_flags.extend(['-g3', '-Wall', '-Werror'])
debug_flags = []
opti_flags = ['-O3']
elif cc == 'cl' and cxx == 'cl':
env = Environment(ENV=os.environ)
debug_flags = ['-W1', '-GX', '-EHsc', '-D_DEBUG', '/MDd']
opti_flags = ['-O2', '-EHsc', '-DNDEBUG', '/MD']
cc = ARGUMENTS.get ('cc', '')
cxx = ARGUMENTS.get ('cxx', '')
if cc != '':
env.Replace (CC = cc)
if cxx != '':
env.Replace (CXX = cxx)
env.Append(CCFLAGS = common_flags,
CPPDEFINES = ['RUN_SELF_TESTS'],
TARFLAGS = '-c -z',
CPPFLAGS = cxxflags,
LINKFLAGS = ldflags)
if env['PLATFORM'] == 'posix':
env.Append(LINKFLAGS = ' -z origin')
env.Append(RPATH=env.Literal(os.path.join('\\$$ORIGIN', os.pardir, 'lib')))
verbose = ARGUMENTS.get('verbose', 'n')
if verbose == 'n':
env['PRINT_CMD_LINE_FUNC'] = print_cmd_line
header_builder = Builder(action = Action(MyCopyAction, strfunction=MyCopyActionPrint))
env.Append(BUILDERS = {'MyCopyBuilder':header_builder})
gcxx_builder = Builder(action = Action(MyCopyAction, strfunction=MyCopyActionPrint),
emitter = GcxxEmitter)
env.Append(BUILDERS = {'CopyGcxxBuilder':gcxx_builder})
variant = Ns3BuildVariant()
builders = []
gcov_env = env.Copy()
gcov_env.Append(CFLAGS = ['-fprofile-arcs', '-ftest-coverage'],
CXXFLAGS = ['-fprofile-arcs', '-ftest-coverage'],
LINKFLAGS = ['-fprofile-arcs'])
# code coverage analysis
variant.static = False
variant.env = gcov_env
variant.build_root = os.path.join(self.build_dir, 'gcov')
builders = self.gen_mod_dep(variant)
for builder in builders:
gcov_env.Alias('gcov', builder)
gcov_env.Alias('lcov-report')
if 'lcov-report' in COMMAND_LINE_TARGETS:
lcov_report_dir = os.path.join(self.build_dir, 'lcov-report')
create_dir_command = "rm -rf " + lcov_report_dir
create_dir_command += " && mkdir " + lcov_report_dir + ";"
gcov_env.Execute(create_dir_command)
info_file = os.path.join(lcov_report_dir, self.name + '.info')
lcov_command = "utils/lcov/lcov -c -d . -o " + info_file
lcov_command += " --source-dirs=" + os.getcwd()
lcov_command += ":" + os.path.join(os.getcwd(),
variant.build_root,
'include')
gcov_env.Execute(lcov_command)
genhtml_command = "utils/lcov/genhtml -o " + lcov_report_dir
genhtml_command += " " + info_file
gcov_env.Execute(genhtml_command)
opt_env = env.Copy()
opt_env.Append(CFLAGS=opti_flags,
CXXFLAGS=opti_flags,
CPPDEFINES=['NDEBUG'])
# optimized static support
variant.static = True
variant.env = opt_env
variant.build_root = os.path.join(self.build_dir, 'opt-static')
builders = self.gen_mod_dep(variant)
for builder in builders:
opt_env.Alias('opt-static', builder)
opt_env = env.Copy()
opt_env.Append(CFLAGS = opti_flags,
CXXFLAGS = opti_flags,
CPPDEFINES = ['NDEBUG'])
# optimized shared support
variant.static = False
variant.env = opt_env
variant.build_root = os.path.join(self.build_dir, 'opt-shared')
builders = self.gen_mod_dep(variant)
for builder in builders:
opt_env.Alias('opt-shared', builder)
arc_env = env.Copy()
arc_env.Append(CFLAGS=opti_flags,
CXXFLAGS=opti_flags,
CPPDEFINES=['NDEBUG'])
arc_env.Append(CFLAGS=['-frandom-seed=0', '-fprofile-generate'],
CXXFLAGS=['-frandom-seed=0', '-fprofile-generate'],
LINKFLAGS=['-frandom-seed=0', '-fprofile-generate'])
# arc profiling
variant.static = False
variant.env = arc_env
variant.build_root = os.path.join(self.build_dir, 'opt-arc')
builders = self.gen_mod_dep(variant)
for builder in builders:
arc_env.Alias('opt-arc', builder)
arcrebuild_env = env.Copy()
arcrebuild_env.Append(CFLAGS=opti_flags,
CXXFLAGS=opti_flags,
CPPDEFINES=['NDEBUG'])
arcrebuild_env.Append(CFLAGS=['-frandom-seed=0', '-fprofile-use'],
CXXFLAGS=['-frandom-seed=0', '-fprofile-use'],
LINKFLAGS=['-frandom-seed=0', '-fprofile-use'])
# arc rebuild
variant.static = False
variant.env = arcrebuild_env
variant.gcxx_deps = True
variant.gcxx_root = os.path.join(self.build_dir, 'opt-arc')
variant.build_root = os.path.join(self.build_dir, 'opt-arc-rebuild')
builders = self.gen_mod_dep(variant)
for builder in builders:
arcrebuild_env.Alias('opt-arc-rebuild', builder)
variant.gcxx_deps = False
dbg_env = env.Copy()
dbg_env.Append(CFLAGS = debug_flags,
CXXFLAGS = debug_flags,
CPPDEFINES = ['NS3_DEBUG_ENABLE',
'NS3_ASSERT_ENABLE'])
# debug static support
variant.static = True
variant.env = dbg_env
variant.build_root = os.path.join(self.build_dir, 'dbg-static')
builders = self.gen_mod_dep(variant)
for builder in builders:
dbg_env.Alias('dbg-static', builder)
dbg_env = env.Copy()
dbg_env.Append(CFLAGS=debug_flags,
CXXFLAGS=debug_flags,
CPPDEFINES = ['NS3_DEBUG_ENABLE',
'NS3_ASSERT_ENABLE'])
# debug shared support
variant.static = False
variant.env = dbg_env
variant.build_root = os.path.join(self.build_dir, 'dbg-shared')
builders = self.gen_mod_dep(variant)
for builder in builders:
dbg_env.Alias('dbg-shared', builder)
env.Alias('dbg', 'dbg-shared')
env.Alias('opt', 'opt-shared')
env.Default('dbg')
env.Alias('all', ['dbg-shared', 'dbg-static', 'opt-shared', 'opt-static'])
# dist support
dist_env = env.Copy()
if dist_env['PLATFORM'] == 'posix' or dist_env['PLATFORM'] == 'darwin':
dist_list = []
for module in self.__modules:
for f in module.sources:
dist_list.append(os.path.join(module.dir, f))
for f in module.headers:
dist_list.append(os.path.join(module.dir, f))
for f in module.inst_headers:
dist_list.append(os.path.join(module.dir, f))
for f in module.extra_dist:
dist_list.append(os.path.join(module.dir, f))
for f in self.extra_dist:
dist_list.append(f)
dist_list.append (self.doxygen_config)
dist_list.append('SConstruct')
dist_list.append('build.py')
targets = []
basename = self.distname + '-' + self.version
for src in dist_list:
tgt = os.path.join(basename, src)
targets.append(dist_env.MyCopyBuilder(target=tgt, source=src))
tar = basename + '.tar.gz'
zip = basename + '.zip'
tmp_tar = os.path.join(self.build_dir, tar)
tmp_zip = os.path.join(self.build_dir, zip)
dist_tgt = [tar, zip]
dist_src = [tmp_tar, tmp_zip]
dist_env.Tar(tmp_tar, targets)
dist_env.Zip(tmp_zip, targets)
dist_builder = dist_env.MyCopyBuilder(target=dist_tgt, source=dist_src)
dist_env.Alias('dist', dist_builder)
dist_env.Append(RM_DIR=basename)
dist_env.AddPostAction(dist_builder, dist_env.Action(MyRmTree,
strfunction=MyRmTreePrint))
dist_builder = dist_env.MyCopyBuilder(target=dist_tgt, source=dist_src)
dist_env.Alias('fastdist', dist_tgt)
# distcheck
distcheck_list = []
for src in dist_list:
tgt = os.path.join(self.build_dir, basename, src)
distcheck_list.append(tgt)
untar = env.Command(distcheck_list, tar,
['cd ' + self.build_dir + ' && tar -zxf ../' + tar])
scons_dir = os.path.join(self.build_dir, basename)
distcheck_builder = env.Command('x', distcheck_list,
['cd ' + scons_dir + ' && scons'])
env.AlwaysBuild(distcheck_builder)
env.Alias('distcheck', distcheck_builder)
if self.doxygen_config != '':
doxy = env.Command('doc/html/*', self.doxygen_config,
['doxygen ' + self.doxygen_config])
env.AlwaysBuild(doxy)
env.Alias('doc', doxy)
+25 -33
View File
@@ -3,70 +3,62 @@ build system (http://www.freehackers.org/~tnagy/waf.html)
=== Installing Waf ===
If this file is part of a development release tarball, the top-level
ns-3 directory should contain a current waf script.
However, the ns-3 Mercurial code repository does not contain the waf
script. Instead, developers should check it out from a subversion
repository:
svn checkout http://waf.googlecode.com/svn/tags/ns3/ waf
[ note: 'tags/ns3' is a tag that represents the last svn version
tested to work correctly with ns3, although 'trunk' will likely work
as well ]
Then it can be installed system-wide with 'sudo waf-light install'.
When preparing a distribution, the resulting 'waf' script, which is
self contained (no external files needed), can be easily included in
the tarball so that users downloading ns-3 can easily build it without
having Waf installed (although Python >= 2.3 is still needed).
The top-level ns-3 directory should contain a current waf script.
=== Building with Waf ===
To build ns-3 with waf type the commands:
1. waf configure [options]
2. waf
To build ns-3 with waf type the commands from the top-level directory:
1. ./waf configure [options]
2. ./waf
To see valid configure options, type waf --help. The most important
To see valid configure options, type ./waf --help. The most important
option is -d <debug level>. Valid debug levels (which are listed in
waf --help) are: ultradebug, debug, release, and optimized. It is
waf --help) are: "debug" or "optimized". It is
also possible to change the flags used for compilation with (e.g.):
CXXFLAGS="-O3" waf configure.
CXXFLAGS="-O3" ./waf configure.
[ Note: Unlike some other build tools, to change the build target,
the option must be supplied during the configure stage rather than
the build stage (i.e., "waf -d optimized" will not work; instead, do
"waf -d optimized configure; waf" ]
the build stage (i.e., "./waf -d optimized" will not work; instead, do
"./waf -d optimized configure; ./waf" ]
The resulting binaries are placed in build/<debuglevel>/srcpath.
Other waf usages include:
1. waf check
1. ./waf check
Runs the unit tests
2. waf --doxygen
2. ./waf --doxygen
Run doxygen to generate documentation
3. waf --lcov-report
3. ./waf --lcov-report
Run code coverage analysis (assuming the project was configured
with --enable-gcov)
4. waf --run "program [args]"
4. ./waf --run "program [args]"
Run a ns3 program, given its target name, with the given
arguments. This takes care of automatically modifying the the
path for finding the ns3 dynamic libraries in the environment
before running the program. Note: the "program [args]" string is
parsed using POSIX shell rules.
5. waf --shell
4.1 ./waf --run programname --command-template "... %s ..."
Same as --run, but uses a command template with %s replaced by the
actual program (whose name is given by --run). This can be use to
run ns-3 programs with helper tools. For example, to run unit
tests with valgrind, use the command:
./waf --run run-tests --command-template "valgrind %s"
5. ./waf --shell
Starts a nested system shell with modified environment to run ns3 programs.
6. waf distclean
6. ./waf distclean
Cleans out the entire build/ directory
7. waf dist
7. ./waf dist
The command 'waf dist' can be used to create a distribution tarball.
It includes all files in the source directory, except some particular
extensions that are blacklisted, such as back files (ending in ~).
+158 -65
View File
@@ -1,4 +1,4 @@
# Doxyfile 1.4.4
# Doxyfile 1.5.4
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
@@ -14,10 +14,18 @@
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file that
# follow. The default is UTF-8 which is also the encoding used for all text before
# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into
# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of
# possible encodings.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = "NS-3"
PROJECT_NAME = "NS-3 "
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
@@ -45,24 +53,14 @@ CREATE_SUBDIRS = NO
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
# Swedish, and Ukrainian.
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
OUTPUT_LANGUAGE = English
# This tag can be used to specify the encoding used in the generated output.
# The encoding is not always determined by the language that is chosen,
# but also whether or not the output is meant for Windows or non-Windows users.
# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
# forces the Windows encoding (this is the default for the Windows binary),
# whereas setting the tag to NO uses a Unix-style encoding (the default for
# all platforms other than Windows).
USE_WINDOWS_ENCODING = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
@@ -135,11 +133,19 @@ SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explicit @brief command for a brief description.
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
# comment as the brief description. If set to NO, the comments
# will behave just like regular Qt-style comments (thus requiring
# an explicit \brief command for a brief description.)
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
@@ -161,13 +167,6 @@ DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
# a new page for each member. If set to NO, the documentation of a member will
# be part of the file/class/namespace that contains it.
@@ -195,13 +194,40 @@ ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
# only. Doxygen will then generate output that is more tailored for Java.
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
# sources only. Doxygen will then generate output that is more tailored for Java.
# For instance, namespaces will be presented as packages, qualified scopes
# will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
# include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
# func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
# Doxygen will parse them like normal C++ but will assume all classes use public
# instead of private inheritance when no explicit protection keyword is present.
SIP_SUPPORT = NO
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
@@ -210,6 +236,16 @@ OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is
# documented as struct with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically
# be useful for C code where the coding convention is that all structs are
# typedef'ed and only the typedef is referenced never the struct's name.
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -244,6 +280,13 @@ EXTRACT_LOCAL_CLASSES = NO
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be extracted
# and appear in the documentation as a namespace called 'anonymous_namespace{file}',
# where file will be replaced with the base name of the file that contains the anonymous
# namespace. By default anonymous namespace are hidden.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
@@ -376,7 +419,7 @@ SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is YES.
# in the documentation. The default is NO.
SHOW_DIRECTORIES = NO
@@ -385,7 +428,7 @@ SHOW_DIRECTORIES = NO
# version control system). Doxygen will invoke the program by executing (via
# popen()) the command <command> <input-file>, where <command> is the value of
# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
# provided by doxygen. Whatever the progam writes to standard output
# provided by doxygen. Whatever the program writes to standard output
# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
@@ -397,7 +440,7 @@ FILE_VERSION_FILTER =
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
@@ -433,7 +476,7 @@ WARN_NO_PARAMDOC = NO
# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = "$file:$line: $text"
WARN_FORMAT = "$file:$line: $text "
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
@@ -450,16 +493,28 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = src doc/main.txt
INPUT = doc/modules \
doc/main.h \
doc/introspected-doxygen.h \
doc/howtos/ \
src
# This tag can be used to specify the character encoding of the source files that
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default
# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding.
# See http://www.gnu.org/software/libiconv for the list of possible encodings.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
FILE_PATTERNS = *.h *.tcc
FILE_PATTERNS = *.h \
*.tcc
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@@ -471,10 +526,12 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = \
src/simulator/high-precision.h \
src/simulator/high-precision-128.h \
src/simulator/high-precision-double.h
EXCLUDE = src/routing/olsr/olsr-state.h \
src/routing/olsr/repositories.h \
src/routing/olsr/routing-table.h \
src/simulator/high-precision.h \
src/simulator/high-precision-128.h \
src/simulator/high-precision-double.h
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
@@ -490,6 +547,13 @@ EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the output.
# The symbol name can be a fully qualified name, a word, or if the wildcard * is used,
# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
@@ -514,7 +578,7 @@ EXAMPLE_RECURSIVE = NO
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
IMAGE_PATH = doc
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -548,7 +612,9 @@ FILTER_SOURCE_FILES = NO
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH
# then you must also enable this option. If you don't then doxygen will produce
# a warning and turn it on anyway
SOURCE_BROWSER = NO
@@ -575,6 +641,13 @@ REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
# link to the source code. Otherwise they will link to the documentstion.
REFERENCES_LINK_SOURCE = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
@@ -667,6 +740,14 @@ HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
@@ -965,13 +1046,13 @@ ENABLE_PREPROCESSING = YES
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
@@ -999,14 +1080,18 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = RUN_SELF_TESTS NS3_DEBUG_ENABLE
PREDEFINED = RUN_SELF_TESTS \
NS3_ASSERT_ENABLE \
NS3_LOG_ENABLE
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED = ATTRIBUTE_VALUE_DEFINE \
ATTRIBUTE_VALUE_DEFINE_WITH_NAME \
ATTRIBUTE_HELPER_HEADER_2
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
@@ -1072,6 +1157,14 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to
# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to
# specify the directory where the mscgen tool resides. If left empty the tool is assumed to
# be found in the default search path.
MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
@@ -1129,7 +1222,7 @@ INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will
# generate a call dependency graph for every global function or class method.
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
@@ -1137,6 +1230,14 @@ INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will
# generate a caller dependency graph for every global function or class method.
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
@@ -1166,31 +1267,23 @@ DOT_PATH =
DOTFILE_DIRS =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
# visualized by representing a node as a red box. Note that doxygen if the number
# of direct children of the root node in a graph is already larger than
# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that a graph may be further truncated if the graph's
# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
# the graph is not depth-constrained.
# code bases. Also note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
MAX_DOT_GRAPH_DEPTH = 0
+203
View File
@@ -0,0 +1,203 @@
/*!
\page application How to create a traffic generator ?
\anchor howtos-application
<b>Question:</b> How do I create a new traffic generator ?
<b>Answer:</b> It is possible to instanciate \ref ns3::Packet "Packet"
objects, schedule events, and call functions from any piece of code
in ns-3 so, technically, there is no single answer to the question of
how we can write a new traffic generator. However, the
\ref ns3::Socket "Socket" API was really designed to be the single
point of entry for traffic generators or traffic analysers and the
\ref ns3::Application "Application" class was designed to hold
together any number of sockets.
Implementing a new traffic generator thus boils down to:
- implementing a new subclass of the \ref ns3::Application "Application"
base class
- instanciate one or many sockets within that application
- start scheduling events when \ref ns3::Application::StartApplication "StartApplication"
is called
- stop scheduling events when \ref ns3::Application::StopApplication "StopApplication"
is called
- create packets and send them over one or many sockets in each event
The following "random" generator generates packets separated by a random
delay and with a random size.
\code
class RandomGenerator : public Application
{
public:
RandomGenerator ();
void SetDelay (RandomVariable delay);
void SetSize (RandomVariable size);
void SetRemote (std::string socketType,
Address remote);
private:
virtual void StartApplication (void);
virtual void StopApplication (void);
void DoGenerate (void);
RandomVariable m_delay;
RandomVariable m_size;
Ptr<Socket> m_socket;
};
\endcode
The socket is created in the SetRemote method:
\code
void
RandomGenerator::SetRemote (std::string socketType,
Address remote)
{
TypeId tid = TypeId::LookupByName (socketType);
m_socket = Socket::CreateSocket (GetNode (), tid);
m_socket->Bind ();
m_socket->ShutdownRecv ();
m_socket->Connect (remote);
}
\endcode
While the the crux of the logic is located in the DoGenerate method
which is called from within StartApplication:
\code
void
RandomGenerator::DoGenerate (void)
{
m_next = Simulator::Schedule (Seconds (m_delay.GetValue ()),
&RandomGenerator::DoGenerate, this);
Ptr<Packet> p = Create<Packet> (m_size.GetIntValue ());
m_socket->Send (p);
}
\endcode
To make that application more integrated in ns-3, it needs an associated
helper class:
\code
class RandomAppHelper
{
public:
RandomAppHelper (std::string protocol, Address remote);
void SetPacketSize (RandomVariable packetSize);
void SetDelay (RandomVariable delay);
ApplicationContainer Install (NodeContainer nodes);
private:
std::string m_protocol;
Address m_remote;
RandomVariable m_packetSize;
RandomVariable m_delay;
};
\endcode
which could be trivially implemented as:
\code
ApplicationContainer
RandomAppHelper::Install (NodeContainer nodes)
{
ApplicationContainer applications;
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Ptr<RandomAppHelper> app = CreateObject<RandomAppHelper> ();
app->SetSize (m_packetSize);
app->SetDelay (m_delay);
app->SetRemote (m_protocol, m_remote);
(*i)->AddApplication (app);
applications.Add (app);
}
return applications;
}
\endcode
Despite being functional, this API is not very consistant with the style of
the other helper classes, all of which allow you to control the parameters
of the underlying class through attributes and not explicit setters. The
following API thus replaces the pair SetPacketSize/SetDelay with a single
method SetAttribute:
\code
class RandomAppHelper
{
public:
RandomAppHelper (std::string protocol, Address remote);
void SetAttribute (std::string name, const AttributeValue &value);
ApplicationContainer Install (NodeContainer c);
private:
std::string m_protocol;
Address m_remote;
ObjectFactory m_factory;
};
\endcode
And which can be used as follows:
\code
RandomAppHelper app = RandomAppHelper ("ns3::TcpSocketFactory",
InetSocketAddress (Ipv4Address ("192.168.1.10"), 10));
app.SetAttribute ("Delay", StringValue ("Constant:2.5"));
app.SetAttribute ("Size", StringValue ("Constant:2100"));
app.Install (nodes);
\endcode
The implementation, in this case, is not necessarily longer but its
simplicity hides a lot of behind-the-scenes complexity:
\code
void
RandomAppHelper::SetAttribute (std::string name, const AttributeValue &value)
{
m_factory.Set (name, value);
}
ApplicationContainer
RandomAppHelper::Install (NodeContainer nodes)
{
ApplicationContainer applications;
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Ptr<RandomAppHelper> app = m_factory.Create<RandomAppHelper> ();
app->SetRemote (m_socketType, m_remote);
(*i)->AddApplication (app);
applications.Add (app);
}
return applications;
}
\endcode
The key difference between this implementation and the previous one
is that this helper does not handle explicitely the attributes
delay and packet size. Instead, it stores them in an
\ref ns3::ObjectFactory "ObjectFactory" object. This, of course,
does not work magically, and requires extra support from the
underlying RandomGenerator class. Specifically, it requires
that the underlying RandomGenerator defines its attributes
in its \ref ns3::TypeId "TypeId" in a new public static method:
\code
class RandomGenerator
{
public:
static TypeId GetTypeId (void);
};
\endcode
The corresponding implementation is shown below:
\code
TypeId
RandomGenerator::GetTypeId (void)
{
static TypeId tid = TypeId ("RandomGenerator")
.SetParent<Application> ()
.AddConstructor<RandomGenerator> ()
.AddAttribute ("Delay", "The delay between two packets (s)",
RandomVariableValue (ConstantVariable (1.0)),
MakeRandomVariableAccessor (&RandomGenerator::m_delay),
MakeRandomVariableChecker ())
.AddAttribute ("PacketSize", "The size of each packet (bytes)",
RandomVariableValue (ConstantVariable (2000)),
MakeRandomVariableAccessor (&RandomGenerator::m_size),
MakeRandomVariableChecker ())
;
return tid;
}
\endcode
*/
+38
View File
@@ -0,0 +1,38 @@
/*!
\page callbacks Using ns-3 callbacks
\anchor howtos-callbacks
\section null_callbacks Null Callbacks
<b>Question:</b> The API I am using calls for using a callback (in the
function signature), but I do not
want to provide one. Is there a way to provide a null callback?
<b>Answer:</b> Use the ns3::MakeNullCallback construct:
\code
template<typename R>
Callback< R, T1, T2, T3, T4, T5, T6 > ns3::MakeNullCallback (void)
\endcode
Example usage: The ns3::Socket class uses callbacks to indicate completion
of events such as a successful TCP connect(). These callbacks are set
in the following function:
\code
void Socket::SetConnectCallback (Callback<void, Ptr<Socket> > connectionSucceeded,
Callback<void, Ptr<Socket> > connectionFailed,
Callback<void, Ptr<Socket> > halfClose);
\endcode
But suppose you do not care about registering a callback for the
halfClose event (but you want to register one for the
connectionSucceeded and connectionFailed cases). In that case, you
can pass a null callback as the third argument. You just need to
pass a callback with the matching signature, as follows:
\code
localSocket->SetConnectCallback (
MakeCallback (&ConnectionSucceededCallback),
MakeCallback (&ConnectionFailedCallback),
MakeNullCallback<void, Ptr<Socket> > () );
\endcode
*/
+162
View File
@@ -0,0 +1,162 @@
/*!
\page net-device How to create a new OSI layer 1 + 2 implementation ?
\anchor howtos-net-device
<b>Question:</b> How do I integrate a new OSI layer 1 + 2 implementation ?
<b>Answer:</b> The OSI layers 1 and 2 are represented by the ns3::NetDevice
and ns3::Channel classes. To plug transparently in ns-3, a new layer 1+2 model
thus simply needs to provide two new subclasses of these two base classes.
To make that subclassing process easy, two skeleton classes are provided in
the src/node directory: simple-net-device.h (ns3::SimpleNetDevice) and
simple-channel.h (ns3::SimpleChannel) implement a broadcast passthru medium
using 48bit MAC addresses without any kind of MAC access algorithm or PHY
layer modeling.
The ns3::SimpleChannel class is really very simple: it provides
an implementation for the ns3::Channel::GetNDevices and ns3::Channel::GetDevice
methods defined in the Channel base class and, then defines the channel-specific
send and add methods:
- The Add method is used by SimpleNetDevice::SetChannel to register a new
SimpleNetDevice with its associated channel.
- The Send method is used by SimpleNetDevice::Send to send a packet over the
broadcast medium and ensure that it gets delivered to all associated devices
(except the sender).
\code
class SimpleChannel : public Channel
{
public:
static TypeId GetTypeId (void);
SimpleChannel ();
void Send (Ptr<Packet> p, uint16_t protocol, Mac48Address to, Mac48Address from,
Ptr<SimpleNetDevice> sender);
void Add (Ptr<SimpleNetDevice> device);
// inherited from ns3::Channel
virtual uint32_t GetNDevices (void) const;
virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
private:
std::vector<Ptr<SimpleNetDevice> > m_devices;
};
\endcode
The SimpleNetDevice class is also trivial since it implements no special
MAC-layer processing:
\code
class SimpleNetDevice : public NetDevice
{
public:
static TypeId GetTypeId (void);
SimpleNetDevice ();
void Receive (Ptr<Packet> packet, uint16_t protocol, Mac48Address to, Mac48Address from);
void SetChannel (Ptr<SimpleChannel> channel);
void SetAddress (Mac48Address address);
// inherited from NetDevice base class.
virtual void SetName(const std::string name);
...
};
\endcode
The code below illustrates how the three model-specific methods defined above are
implemented:
\code
void
SimpleNetDevice::Receive (Ptr<Packet> packet, uint16_t protocol,
Mac48Address to, Mac48Address from)
{
if (to == m_address || to == Mac48Address::GetBroadcast ())
{
m_rxCallback (this, packet, protocol, from);
}
}
void
SimpleNetDevice::SetChannel (Ptr<SimpleChannel> channel)
{
m_channel = channel;
m_channel->Add (this);
}
void
SimpleNetDevice::SetAddress (Mac48Address address)
{
m_address = address;
}
\endcode
Building a topology with such a device is then a matter of
instanciating a set of SimpleNetDevice objects connected on a shared
SimpleChannel:
\code
NodeContainer nodes;
nodes.Create (10);
Ptr<SimpleChannel> channel = CreateObject<SimpleChannel> ();
for (uint32_t i = 0; i < nodes.GetN (); ++i)
{
CreateSimpleDevice (nodes.Get (i), channel);
}
\endcode
With the following CreateSimpleDevice function:
\code
static Ptr<SimpleNetDevice>
CreateSimpleDevice (Ptr<Node> node, Ptr<SimpleChannel> channel)
{
Ptr<SimpleNetDevice> device = CreateObject<SimpleNetDevice> ();
device->SetAddress (Mac48Address:Allocate ());
device->SetChannel (channel);
node->AddDevice (device);
return device;
}
\endcode
Of course, ultimately, you need to provide a helper class for this new device and channel
to save each user from having to re-implement their own CreateSimpleDevice helper
function:
\code
class SimpleHelper
{
public:
NetDeviceContainer Install (NodeContainer nodes, Ptr<SimpleChannel> channel);
NetDeviceContainer Install (NodeContainer nodes);
};
\endcode
with the following straightforward implementation, inspired by the CreateSimpleDevice
function defined above:
\code
NetDeviceContainer
SimpleHelper::Install (NodeContainer nodes, Ptr<SimpleChannel> channel)
{
NetDeviceContainer devices;
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Ptr<SimpleNetDevice> dev = CreateObject<SimpleNetDevice> ();
dev->SetAddress (Mac48Address::Allocate ());
dev->SetChannel (channel);
(*i)->AddDevice (dev);
devices.Add (dev);
}
return devices;
}
NetDeviceContainer
SimpleHelper::Install (NodeContainer nodes)
{
return Install (nodes, CreateObject<SimpleChannel> ());
}
\endcode
Of course, at some point, this device helper class should also contain a couple of
ascii and pcap tracing helper functions but, since the default SimpleNetDevice
class we used as an example here does not report any trace event, it would
be of little use.
*/
+119
View File
@@ -0,0 +1,119 @@
/*!
\page packet-header-trailer How to create a new type of protocol header or trailer
\anchor howtos-packet-header-trailer
<b>Question:</b> I want to implement a new protocol X which uses a new
type of header Y. How do I implement and use this new header Y in ns-3 ?
<b>Answer:</b> The key is to implement a new subclass of the ns3::Header
base class to represent your protocol header:
\code
class YHeader : public Header
{
public:
// must be implemented to become a valid new header.
static TypeId GetTypeId (void);
virtual TypeId GetInstanceTypeId (void) const;
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
// allow protocol-specific access to the header data.
void SetData (uint32_t data);
uint32_t GetData (void) const;
private:
uint32_t m_data;
};
\endcode
Once this class is implemented, you can easily store your protocol
header into a packet:
\code
Ptr<Packet> p = ...;
YHeader yHeader;
yHeader.SetData (0xdeadbeaf);
// copy the header into the packet
p->AddHeader (yHeader);
\endcode
and get it out of a packet:
\code
Ptr<Packet> p = ...;
YHeader yHeader;
// copy the header from the packet
p->RemoveHeader (yHeader);
uint32_t data = yHeader.GetData ();
\endcode
The implementation of the new header is very simple. First, you need
to give a TypeId to your YHeader class:
\code
TypeId
YHeader::GetTypeId (void)
{
static TypeId tid = TypeId ("YHeader")
.SetParent<Header> ()
.AddConstructor<YHeader> ()
;
return tid;
}
TypeId
YHeader::GetInstanceTypeId (void)
{
return GetTypeId ();
}
\endcode
Then, you need to allow your header to serialize and deserialize itself
to a byte buffer in its network representation. Here, our new protocol
header contains first a 2-byte constant, and, then, the data field so,
the total size of the header is 2+4=6 bytes.
\code
uint32_t
YHeader::GetSerializedSize (void) const
{
return 6;
}
void
YHeader::Serialize (Buffer::Iterator start) const
{
// The 2 byte-constant
start.WriteU8 (0xfe);
start.WriteU8 (0xef);
// The data.
start.WriteHtonU32 (m_data);
}
uint32_t
YHeader::Deserialize (Buffer::Iterator start)
{
uint8_t tmp;
tmp = start.ReadU8 ();
NS_ASSERT (tmp == 0xfe);
tmp = start.ReadU8 ();
NS_ASSERT (tmp == 0xef);
m_data = start.ReadNtohU32 ();
return 6; // the number of bytes consumed.
}
\endcode
Finally, to make sure that Packet::Print also prints the content
of your header, just as it prints the content of the other
headers of the system, you need to provide a Print method:
\code
void
YHeader::Print (std::ostream &os) const
{
os << "data=" << m_data;
}
\endcode
The code will look the same if you want to implement a trailer,
that is, a protocol data structure which will be appended to the
end of the packet, not its start: you need to make sure that
you derive from the ns3::Trailer base class and that you call
Packet::AddTrailer and Packet::RemoveTrailer. Another important
detail is that you must make sure to rewind the iterator in your
Serialize and Deserialize methods writing to or reading from
the underlying buffer.
*/
+20
View File
@@ -0,0 +1,20 @@
/*!
\page howtos ns-3 HOWTOs
\anchor howtos-anchor
This is an organized set of frequently asked questions (FAQ) and HOWTOs
for ns-3. This complements the following wiki pages:
- <a href="http://www.nsnam.org/wiki/index.php/User_FAQ">User FAQ</a>
- <a href="http://www.nsnam.org/wiki/index.php/Developer_FAQ">Developer FAQ</a>
Please consider contributing tips to either the wiki (yourself) or
by submitting a patch to this maintained documentation.
- \subpage callbacks
- \subpage packet-header-trailer
- \subpage net-device
- \subpage application
*/
+61
View File
@@ -0,0 +1,61 @@
/**
* \mainpage ns-3 Documentation
*
* \section intro-sec Introduction
* <a href="http://www.nsnam.org/">ns-3</a> documentation is maintained using
* <a href="http://www.doxygen.org">Doxygen</a>.
* Doxygen is typically used for
* API documentation, and organizes such documentation across different
* modules. This project uses Doxygen both for building the manual around
* the API documentation, and a separate GNU texinfo document is used for
* the manual.
*
* The ns-3 project documentation is organized as follows:
* - <b><a href="modules.html">modules</a></b>: The "Modules" tab (above)
* organizes all of the public API and supporting manual text
* along the source code directory structure. This forms the
* "ns-3 manual", and it is available in HTML and PDF forms.
* - \ref howtos-anchor "HOWTOs": A set of HOWTOs and FAQs is
* maintained on another Doxygen "Related Page"
* - <a href="http://www.nsnam.org/docs/tutorial/tutorial.html">tutorial</a>: The ns-3 tutorial is a separate document maintained in <a href="http://www.gnu.org/software/texinfo/"> GNU Texinfo</a>.
* - The <b><a href="http://www.nsnam.org/wiki/index.php/Main_Page">ns-3 wiki</a></b>
* contains additional user-contributed material. Some wiki-contributed
* material may migrate to and overlap with the Doxygen information.
*
* \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.
*
* Type "./waf check" followed by "./waf --doxygen" to build the documentation.
* There is a program that runs during "./waf check" that builds pieces of
* the documentation through introspection. The doc/ directory contains
* configuration for Doxygen (doxygen.conf and main.txt). The Doxygen
* build process puts html files into the doc/html/ directory, and latex
* filex into the doc/latex/ directory.
*
* \section module-sec Module overview
*
* The ns-3 library is split across multiple modules:
* - core: located in src/core and contains a number of facilities which
* do not depend on any other module. Some of these facilities are
* OS-dependent.
* - simulator: located in src/simulator and contains event scheduling
* facilities.
* - common: located in src/common and contains facilities specific
* to network simulations but shared by pretty much every model
* of a network component.
* - node: located in src/node. Defines the abstract interfaces which
* must be implemented by every node and more specifically, by ipv4 nodes.
* - devices: located in src/devices. Contains a set of MAC-level models
*
* More detail can be found in the <b><a href="modules.html">Modules</a></b>
* tab.
*
*/
/**
* \namespace ns3
* \brief Every class exported by the ns3 library is enclosed in the
* ns3 namespace.
*/
-68
View File
@@ -1,68 +0,0 @@
/**
* \mainpage An Introduction to ns-3
*
* The ns-3 library is split across multiple modules:
* - core: located in src/core and contains a number of facilities which
* do not depend on any other module. Some of these facilities are
* OS-dependent.
* - simulator: located in src/simulator and contains event scheduling
* facilities.
* - common: located in src/common and contains facilities specific
* to network simulations but shared by pretty much every model
* of a network component.
* - node: located in src/node. Defines the abstract interfaces which
* must be implemented by every node and more specifically, by ipv4 nodes.
* - devices: located in src/devices. Contains a set of MAC-level models
*
* The "core" module contains:
* - a Functor class: ns3::Callback
* - an os-independent interface to get access to the elapsed wall clock time: ns3::SystemWallClockMs
* - a class to register regression tests with the test manager: ns3::Test and ns3::TestManager
* - debugging facilities: \ref debugging, \ref assert, \ref error
* - \ref randomvariable
* - \ref config
* - a base class for objects which need to support reference counting
* and QueryInterface: ns3::Object and ns3::InterfaceId
* - a ns3::ComponentManager which can be used to manage the creation
* of any object which derives from ns3::Object through an ns3::ClassId
* - a smart-pointer class ns3::Ptr designed to work together with ns3::Object
*
* The "simulator" module contains:
* - a time management class to hold a time and convert between various time units: ns3::Time
* - a scheduler base class used to implement new simulation event schedulers:
* ns3::Scheduler and ns3::SchedulerFactory
* - a simulator class used to create, schedule and cancel events: ns3::Simulator
*
* The "common" module contains:
* - a packet class to create and manipulate simulation packets: ns3::Packet, ns3::Header,
* and ns3::Trailer. This packet class also supports per-packet ns3::Tag which are
* globs of data which can be attached to any packet.
* - a set of low-level trace facilities: \ref lowleveltracing
*
* The "node" module contains:
* - a ns3::Node base class which should be subclassed by any new type of
* network Node.
* - models which abstract the MAC-layer from the IP layer protocols:
* ns3::NetDevice and ns3::Channel.
* - models which abstract the application-layer API: ns3::Application,
* ns3::Socket, ns3::SocketFactory, and, ns3::Udp
*
* The "internet-node" module contains a set of classes which implement the
* APIs defined in the "node" module:
* - an Ipv4/Udp stack with socket support
* - an ARP module
* - an InternetNode class which is a Node subclass.
*
* The "devices" module contains:
* - a PointToPoint MAC device: ns3::PointToPointNetDevice, ns3::PointToPointChannel,
* and ns3::PointToPointTopology.
*/
/**
* \namespace ns3
* \brief Every class exported by the ns3 library is enclosed in the
* ns3 namespace.
*/
/**
* \defgroup constants Constants
* \brief Constants you can change
*/
+49
View File
@@ -0,0 +1,49 @@
TEXI2HTML = texi2html
TEXI2PDF = texi2dvi --pdf
EPSTOPDF = epstopdf
TGIF = tgif
DIA = dia
CONVERT = convert
CSS = --css-include=manual.css
SPLIT = --split section
DIA_SOURCES = buffer.dia sockets-overview.dia
TGIF_SOURCES = packet.obj
DIA_EPS = ${DIA_SOURCES:.dia=.eps}
DIA_PNG = ${DIA_SOURCES:.dia=.png}
DIA_PDF = ${DIA_SOURCES:.dia=.pdf}
TGIF_EPS = ${TGIF_SOURCES:.obj=.eps}
TGIF_PNG = ${TGIF_SOURCES:.obj=.png}
TGIF_PDF = ${TGIF_SOURCES:.obj=.pdf}
all: images html split-html pdf
# Note: tgif requires a valid x display to convert from .obj to .png.
# If running this makefile on a remote console, the X virtual frame
# buffer may be needed (xorg-x11-server-Xvfb) to provide a "fake"
# display
images:
cd figures/; $(DIA) -t png $(DIA_SOURCES)
cd figures/; $(DIA) -t eps $(DIA_SOURCES)
cd figures/; $(foreach FILE,$(DIA_EPS),$(EPSTOPDF) $(FILE);)
cd figures/; $(TGIF) -print -png $(TGIF_SOURCES)
cd figures/; $(TGIF) -print -eps $(TGIF_SOURCES)
cd figures/; $(foreach FILE,$(TGIF_EPS),$(EPSTOPDF) $(FILE);)
html: images
$(TEXI2HTML) ${CSS} manual.texi
split-html: images
$(TEXI2HTML) ${CSS} ${SPLIT} manual.texi
pdf: images
$(TEXI2PDF) manual.texi
figures-clean:
cd figures/; rm -rf $(DIA_EPS); rm -rf $(DIA_PNG); rm -rf $(DIA_PDF)
cd figures/; rm -rf $(TGIF_EPS); rm -rf $(TGIF_PNG); rm -rf $(TGIF_PDF)
clean: figures-clean
rm -rf manual.aux manual.cp manual.cps manual.fn manual.ky manual.pg manual.tp manual.vr manual.toc manual.log manual.pdf manual.html manual/
+559
View File
@@ -0,0 +1,559 @@
@node Attributes
@chapter Attributes
@anchor{chap:Attributes}
In ns-3 simulations, there are two main aspects to configuration:
@itemize @bullet
@item the simulation topology and how objects are connected
@item the values used by the models instantiated in the topology
@end itemize
This chapter focuses on the second item above: how the many values
in use in ns-3 are organized, documented, and modifiable by ns-3 users.
The ns-3 attribute system is also the underpinning of how traces
and statistics are gathered in the simulator.
Before delving into details of the attribute value system,
it will help to review some basic properties of @code{class ns3::Object}.
@node Object Overview
@section Object Overview
ns-3 is fundamentally a C++ object-based system. By this we mean that
new C++ classes (types) can be declared, defined, and subclassed
as usual.
Many ns-3 objects inherit from the @code{ns3::Object} base class. These
objects have some additional properties that we exploit for
organizing the system and improving the memory management
of our objects:
@itemize @bullet
@item a "metadata" system that links the class name to a lot of
meta-information about the object, including the base class of the subclass,
the set of accessible constructors in the subclass, and the set of
"attributes" of the subclass
@item a reference counting smart pointer implementation, for memory
management.
@end itemize
ns-3 objects that use the attribute system derive from either
@code{ns3::Object} or @code{ns3::ObjectBase}. Most ns-3 objects
we will discuss derive from @code{ns3::Object}, but a few that
are outside the smart pointer memory management framework derive
from @code{ns3::ObjectBase}.
Let's review a couple of properties of these objects.
@node Smart pointers
@subsection Smart pointers
As introduced above in @ref{Smart Pointers 101}, ns-3 objects
are memory managed by a
@uref{http://en.wikipedia.org/wiki/Smart_pointer,,reference counting smart pointer implementation}, @code{class ns3::Ptr}.
Smart pointers are used extensively in the ns-3 APIs, to avoid passing
references to heap-allocated objects that may cause memory leaks.
For most basic usage (syntax), treat a smart pointer like a regular pointer:
@verbatim
Ptr<WifiNetDevice> nd = ...;
nd->CallSomeFunction ();
// etc.
@end verbatim
@node CreateObject
@subsection CreateObject
As we discussed above in @ref{Object Creation},
at the lowest-level API, objects of type @code{ns3::Object} are
not instantiated using @code{operator new} as usual but instead by
a templated function called @code{CreateObject()}.
A typical way to create such an object is as follows:
@verbatim
Ptr<WifiNetDevice> nd = CreateObject<WifiNetDevice> ();
@end verbatim
You can think of this as being functionally equivalent to:
@verbatim
WifiNetDevice* nd = new WifiNetDevice ();
@end verbatim
Objects that derive from @code{ns3::Object} must be allocated
on the heap using CreateObject(). Those deriving from
@code{ns3::ObjectBase}, such as ns-3 helper functions and packet
headers and trailers, can be allocated on the stack.
In some scripts, you may not see a lot of CreateObject() calls
in the code;
this is because there are some helper objects in effect that
are doing the CreateObject()s for you.
@node TypeId
@subsection TypeId
ns-3 classes that derive from class ns3::Object can include
a metadata class called @code{TypeId} that records meta-information
about the class, for use in the object aggregation and component
manager systems:
@itemize @bullet
@item a unique string identifying the class
@item the base class of the subclass, within the metadata system
@item the set of accessible constructors in the subclass
@end itemize
@node Object Summary
@subsection Object Summary
Putting all of these concepts together, let's look at a specific
example: @code{class ns3::Node}.
The public header file node.h has a declaration that includes
a static GetTypeId function call:
@verbatim
class Node : public Object
{
public:
static TypeId GetTypeId (void);
...
@end verbatim
This is defined in the node.cc file as follows:
@verbatim
TypeId
Node::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Node")
.SetParent<Object> ()
;
return tid;
}
@end verbatim
Finally, when users want to create Nodes, they call:
@verbatim
Ptr<Node> n = CreateObject<Node> ();
@end verbatim
We next discuss how attributes (values associated with member variables
or functions of the class) are plumbed into the above TypeId.
@node Attribute Overview
@section Attribute Overview
The goal of the attribute system is to organize the access of
internal member objects of a simulation. This goal arises because,
typically in simulation, users will cut and paste/modify existing
simulation scripts, or will use higher-level simulation constructs,
but often will be interested in studying or tracing particular
internal variables. For instance, use cases such as:
@itemize @bullet
@item "I want to trace the packets on the wireless interface only on
the first access point"
@item "I want to trace the value of the TCP congestion window (every
time it changes) on a particular TCP socket"
@item "I want a dump of all values that were used in my simulation."
@end itemize
Similarly, users may want fine-grained access to internal
variables in the simulation, or may want to broadly change the
initial value used for a particular parameter in all subsequently
created objects. Finally, users may wish to know what variables
are settable and retrievable in a simulation configuration. This
is not just for direct simulation interaction on the command line;
consider also a (future) graphical user interface
that would like to be able to provide a feature whereby a user
might right-click on an node on the canvas and see a hierarchical,
organized list of parameters that are settable on the node and its
constituent member objects, and help text and default values for
each parameter.
@node Functional overview
@subsection Functional overview
We provide a way for users to access values deep in the system, without
having to plumb accessors (pointers) through the system and walk
pointer chains to get to them. Consider a class DropTailQueue that
has a member variable that is an unsigned integer @code{m_maxPackets};
this member variable controls the depth of the queue.
If we look at the declaration of DropTailQueue, we see the following:
@verbatim
class DropTailQueue : public Queue {
public:
static TypeId GetTypeId (void);
...
private:
std::queue<Ptr<Packet> > m_packets;
uint32_t m_maxPackets;
};
@end verbatim
Let's consider things that a user may want to do with the value of
m_maxPackets:
@itemize @bullet
@item Set a default value for the system, such that whenever a new
DropTailQueue is created, this member is initialized to that default.
@item Set or get the value on an already instantiated queue.
@end itemize
The above things typically require providing Set() and Get() functions,
and some type of global default value.
In the ns-3 attribute system, these value definitions and accessor
functions are moved into the TypeId class; e.g.:
@verbatim
TypeId DropTailQueue::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::DropTailQueue")
.SetParent<Queue> ()
.AddConstructor<DropTailQueue> ()
.AddAttribute ("MaxPackets",
"The maximum number of packets accepted by this DropTailQueue.",
UintegerValue (100),
MakeUintegerAccessor (&DropTailQueue::m_maxPackets),
MakeUintegerChecker<uint32_t> ())
;
return tid;
}
@end verbatim
The AddAttribute() method is performing a number of things with this
value:
@itemize @bullet
@item Binding the variable m_maxPackets to a string "MaxPackets"
@item Providing a default value (100 packets)
@item Providing some help text defining the value
@item Providing a "checker" (not used in this example) that can be used to set
bounds on the allowable range of values
@end itemize
The key point is that now the value of this variable and its default
value are accessible in the attribute namespace, which is based on
strings such as "MaxPackets" and TypeId strings. In the next
section, we will provide an example script that shows how users
may manipulate these values.
@node Basic usage
@subsection Basic usage
Let's look at how a user script might access these values.
This is based on the script found at @code{samples/main-attribute-value.cc},
with some details stripped out.
@verbatim
//
// This is a basic example of how to use the attribute system to
// set and get a value in the underlying system; namely, an unsigned
// integer of the maximum number of packets in a queue
//
int
main (int argc, char *argv[])
{
// By default, the MaxPackets attribute has a value of 100 packets
// (this default can be observed in the function DropTailQueue::GetTypeId)
//
// Here, we set it to 80 packets. We could use one of two value types:
// a string-based value or a Uinteger value
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("80"));
// The below function call is redundant
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (80));
// Allow the user to override any of the defaults and the above
// SetDefaults() at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
@end verbatim
The main thing to notice in the above are the two calls to
@code{Config::SetDefault}. This is how we set the default value
for all subsequently instantiated DropTailQueues. We illustrate
that two types of Value classes, a StringValue and a UintegerValue class,
can be used to assign the value to the attribute named by
"ns3::DropTailQueue::MaxPackets".
Now, we will create a few objects using the low-level API; here,
our newly created queues will not have a m_maxPackets initialized to
100 packets but to 80 packets, because of what we did above with
default values.
@verbatim
Ptr<Node> n0 = CreateObject<Node> ();
Ptr<PointToPointNetDevice> net0 = CreateObject<PointToPointNetDevice> ();
n0->AddDevice (net0);
Ptr<Queue> q = CreateObject<DropTailQueue> ();
net0->AddQueue(q);
@end verbatim
At this point, we have created a single node (Node 0) and a
single PointToPointNetDevice (NetDevice 0) and added a
DropTailQueue to it.
Now, we can manipulate the MaxPackets value of the already
instantiated DropTailQueue. Here are various ways to do that.
@subsubsection Pointer-based access
We assume that a smart pointer (Ptr) to a relevant network device is
in hand; here, it is the net0 pointer.
One way to change the value is to access a pointer to the
underlying queue and modify its attribute.
First, we observe that we can get a pointer to the (base class)
queue via the PointToPointNetDevice attributes, where it is called
TxQueue
@verbatim
PointerValue tmp;
net0->GetAttribute ("TxQueue", tmp);
Ptr<Object> txQueue = tmp.GetObject ();
@end verbatim
Using the GetObject function, we can perform a safe downcast
to a DropTailQueue, where MaxPackets is a member
@verbatim
Ptr<DropTailQueue> dtq = txQueue->GetObject <DropTailQueue> ();
NS_ASSERT (dtq != 0);
@end verbatim
Next, we can get the value of an attribute on this queue.
We have introduced wrapper "Value" classes for the underlying
data types, similar to Java wrappers around these types, since
the attribute system stores values and not disparate types.
Here, the attribute value is assigned to a UintegerValue, and
the Get() method on this value produces the (unwrapped) uint32_t.
@verbatim
UintegerValue limit;
dtq->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("1. dtq limit: " << limit.Get () << " packets");
@end verbatim
Note that the above downcast is not really needed; we could have
done the same using the Ptr<Queue> even though the attribute
is a member of the subclass
@verbatim
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("2. txQueue limit: " << limit.Get () << " packets");
@end verbatim
Now, let's set it to another value (60 packets)
@verbatim
txQueue->SetAttribute("MaxPackets", UintegerValue (60));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("3. txQueue limit changed: " << limit.Get () << " packets");
@end verbatim
@subsubsection Namespace-based access
An alternative way to get at the attribute is to use the configuration
namespace. Here, this attribute resides on a known path in this
namespace; this approach is useful if one doesn't have access to
the underlying pointers and would like to configure a specific
attribute with a single statement.
@verbatim
Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", UintegerValue (25));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("4. txQueue limit changed through namespace: " <<
limit.Get () << " packets");
@end verbatim
We could have also used wildcards to set this value for all nodes
and all net devices (which in this simple example has the same
effect as the previous Set())
@verbatim
Config::Set ("/NodeList/*/DeviceList/*/TxQueue/MaxPackets", UintegerValue (15));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("5. txQueue limit changed through wildcarded namespace: " <<
limit.Get () << " packets");
@end verbatim
@node Setting through constructors and helper classes
@subsection Setting through constructors helper classes
Arbitrary combinations of attributes can be set and fetched from
the helper and low-level APIs; either from the constructors themselves:
@verbatim
Ptr<Object> p = CreateObject<MyNewObject> ("n1", v1, "n2", v2, ...);
@end verbatim
or from the higher-level helper APIs, such as:
@verbatim
mobility.SetPositionAllocator ("GridPositionAllocator",
"MinX", DoubleValue (-100.0),
"MinY", DoubleValue (-100.0),
"DeltaX", DoubleValue (5.0),
"DeltaY", DoubleValue (20.0),
"GridWidth", UintegerValue (20),
"LayoutType", StringValue ("RowFirst"));
@end verbatim
@node Value classes
@subsection Value classes
Readers will note the new FooValue classes which are subclasses of the
AttributeValue base class. These can be thought of as
an intermediate class that can be used to convert from raw types to the
Values that are used by the attribute system. Recall that this database is holding
objects of many types with a single generic type. Conversions to this
type can either be done using an intermediate class (IntegerValue, DoubleValue for
"floating point") or via strings. Direct implicit conversion of types
to Value is not really practical. So in the above, users have a choice
of using strings or values:
@verbatim
p->Set ("cwnd", StringValue ("100")); // string-based setter
p->Set ("cwnd", IntegerValue (100)); // integer-based setter
@end verbatim
The system provides some macros that help users declare and define
new AttributeValue subclasses for new types that they want to introduce into
the attribute system:
@itemize @bullet
@item ATTRIBUTE_HELPER_HEADER
@item ATTRIBUTE_HELPER_CPP
@end itemize
@node Extending attributes
@section Extending attributes
The ns-3 system will place a number of internal values under the
attribute system, but undoubtedly users will want to extend this
to pick up ones we have missed, or to add their own classes to this.
@subsection Adding an existing internal variable to the metadata system
Consider this variable in class TcpSocket:
@verbatim
uint32_t m_cWnd; // Congestion window
@end verbatim
Suppose that someone working with Tcp wanted to get or set the
value of that variable using the metadata system. If it were not
already provided by ns-3, the user could declare the following addition
in the metadata system (to the TypeId declaration for TcpSocket):
@verbatim
.AddParameter ("Congestion window",
"Tcp congestion window (bytes)",
Uinteger (1),
MakeUintegerAccessor (&TcpSocket::m_cWnd),
MakeUintegerChecker<uint16_t> ());
@end verbatim
Now, the user with a pointer to the TcpSocket can perform operations
such as setting and getting the value, without having to add these
functions explicitly. Furthermore, access controls can be applied, such
as allowing the parameter to be read and not written, or bounds
checking on the permissible values can be applied.
@subsection Adding a new TypeId
Here, we discuss the impact on a user who wants to add a new class to
ns-3; what additional things must be done to hook it into this system.
We've already introduced what a TypeId definition looks like:
@verbatim
TypeId
RandomWalk2dMobilityModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::RandomWalk2dMobilityModel")
.SetParent<MobilityModel> ()
.SetGroupName ("Mobility")
.AddConstructor<RandomWalk2dMobilityModel> ()
.AddAttribute ("Bounds",
"Bounds of the area to cruise.",
RectangleValue (Rectangle (0.0, 0.0, 100.0, 100.0)),
MakeRectangleAccessor (&RandomWalk2dMobilityModel::m_bounds),
MakeRectangleChecker ())
.AddAttribute ("Time",
"Change current direction and speed after moving for this delay.",
TimeValue (Seconds (1.0)),
MakeTimeAccessor (&RandomWalk2dMobilityModel::m_modeTime),
MakeTimeChecker ())
// etc (more parameters).
;
return tid;
}
@end verbatim
The declaration for this in the class declaration is one-line public
member method:
@verbatim
public:
static TypeId GetTypeId (void);
@end verbatim
Typical mistakes here involve:
@itemize @bullet
@item Not calling the SetParent method or calling it with the wrong type
@item Not calling the AddConstructor method of calling it with the wrong type
@item Introducing a typographical error in the name of the TypeId in its constructor
@item Not using the fully-qualified c++ typename of the enclosing c++ class as the
name of the TypeId
@end itemize
None of these mistakes can be detected by the ns-3 codebase so, users
are advised to check carefully multiple times that they got these right.
@section Adding new class type to the attribute system
From the perspective of the user who writes a new class in the system and
wants to hook it in to the attribute system, there is mainly the matter
of writing
the conversions to/from strings and attribute values. Most of this can be
copy/pasted with macro-ized code. For instance, consider class
Rectangle in the @code{src/mobility/} directory:
One line is added to the class declaration:
@verbatim
/**
* \brief a 2d rectangle
*/
class Rectangle
{
...
};
@end verbatim
One macro call and two operators, are added below the class declaration:
@verbatim
std::ostream &operator << (std::ostream &os, const Rectangle &rectangle);
std::istream &operator >> (std::istream &is, Rectangle &rectangle);
ATTRIBUTE_HELPER_HEADER (Rectangle);
@end verbatim
In the class definition, the code looks like this:
@verbatim
ATTRIBUTE_HELPER_CPP (Rectangle);
std::ostream &
operator << (std::ostream &os, const Rectangle &rectangle)
{
os << rectangle.xMin << "|" << rectangle.xMax << "|" << rectangle.yMin << "|" << rectangle.yMax;
return os;
}
std::istream &
operator >> (std::istream &is, Rectangle &rectangle)
{
char c1, c2, c3;
is >> rectangle.xMin >> c1 >> rectangle.xMax >> c2 >> rectangle.yMin >> c3 >> rectangle.yMax;
if (c1 != '|' ||
c2 != '|' ||
c3 != '|')
{
is.setstate (std::ios_base::failbit);
}
return is;
}
@end verbatim
These stream operators simply convert from a string representation of the
Rectangle ("xMin|xMax|yMin|yMax") to the underlying Rectangle, and the
modeler must specify these operators and the string syntactical representation
of an instance of the new class.
+330
View File
@@ -0,0 +1,330 @@
@node Callbacks
@chapter Callbacks
Some new users to @command{ns-3} are unfamiliar with an extensively used
programming idiom used throughout the code: the ``ns-3 callback''. This
chapter provides some motivation on the callback, guidance on how to use
it, and details on its implementation.
@menu
* Motivation::
* Using the Callback API::
* Callback locations in ns-3::
* Implementation details::
@end menu
@node Motivation
@section Motivation
Consider that you have two simulation models A and B, and you wish
to have them pass information between them during the simulation. One
way that you can do that is that you can make A and B each explicitly
knowledgable about the other, so that they can invoke methods on each
other.
@verbatim
class A {
public:
void ReceiveInput ( // parameters );
...
}
(in another source file:)
class B {
public:
void ReceiveInput ( // parameters);
void DoSomething (void);
...
private:
A* a_instance; // pointer to an A
}
void
B::DoSomething()
{
// Tell a_instance that something happened
a_instance->ReceiveInput ( // parameters);
...
}
@end verbatim
This certainly works, but it has the drawback that it introduces a
dependency on A and B to know about the other at compile time (this
makes it harder to have independent compilation units in the simulator)
and is not generalized; if in a later usage scenario, B needs to talk
to a completely different C object, the source code for B needs to be
changed to add a ``c_instance'' and so forth. It is easy to see that
this is a brute force mechanism of communication that can lead to
programming cruft in the models.
This is not to say that objects should not know about one another
if there is a hard dependency between them, but that often the model
can be made more flexible if its interactions are less constrained at
compile time.
This is not an abstract problem for network simulation research,
but rather it has been a source of problems in previous simulators,
when researchers want to extend or modify the system to do different
things (as they are apt to do in research). Consider, for example,
a user who wants to add an IPsec security protocol sublayer
between TCP and IP:
@verbatim
------------ -----------
| TCP | | TCP |
------------ -----------
| becomes -> |
----------- -----------
| IP | | IPsec |
----------- -----------
|
-----------
| IP |
-----------
@end verbatim
If the simulator has
made assumptions, and hard coded into the code, that IP always talks
to a transport protocol above, the user may be forced to hack the
system to get the desired interconnections.
An alternative that provides this flexibility is to use a level of
indirection that is commonly known in programming as a callback.
A callback function is not invoked explicitly by the caller but is
rather delegated to another function that receives the callback
function's address and can call it.
You may be familiar with function pointers in C or C++; these can
be used to implement callbacks. For more information on introductory
callbacks, an online reference is:
@uref{http://www.inquiry.com/techtips/cpp_pro/10min/10min0300.asp,,Declaring Function Pointers and Implementing Callbacks} and
@uref{http://en.wikipedia.org/wiki/Callback_(computer_science),,Callback (computer science)-- Wikipedia}.
The callback API in @command{ns-3} is designed to minimize the overall
coupling between various pieces of of the simulator
by making each module depend on the callback API
itself rather than depend on other modules. It acts as a sort of
third-party to which work is delegated and which forwards this
work to the proper target module. This callback API, being based
on C++ templates,
is type-safe; that is, it performs static type checks to enforce
proper signature compatibility between callers and callees. It
is therefore more type-safe to use than traditional function
pointers, but the syntax may look imposing at first. This section
is designed to walk you through the callback system so that you
can be comfortable using it in @command{ns-3}.
@node Using the Callback API
@section Using the Callback API
The Callback API is fairly minimal, providing only two services:
@itemize @bullet
@item callback type declaration: a way to declare a type of callback
with a given signature, and,
@item callback instantiation: a way to instantiate a
template-generated forwarding callback which can forward any calls
to another C++ class member method or C++ function.
@end itemize
This is best observed via walking through an example, based on
@code{samples/main-callback.cc}.
@node Using the Callback API with static functions
@subsection Using the Callback API with static functions
Consider a function:
@verbatim
static double
CbOne (double a, double b)
{
std::cout << "invoke cbOne a=" << a << ", b=" << b << std::endl;
return a;
}
@end verbatim
Consider also the following main program snippett:
@verbatim
int main (int argc, char *argv[])
{
// return type: double
// first arg type: double
// second arg type: double
Callback<double, double, double> one;
}
@end verbatim
This class template Callback implements what is known as the Functor
Design Pattern. It is used to declare the type of a callback. It contains
one mandatory argument (the return type of the function to be assigned
to this callback) and up to five optional arguments, which each specify
the type of the arguments (if your function has more than five arguments,
then this can be handled by extending the callback implementation).
So in the above, we have a declared a callback named "one" that will
eventually hold a function pointer. The function that it will hold
must return double and must support two double arguments. If one
tries to pass a function whose signature does not match the declared
callback, the compilation will fail.
Now, we need to tie together this callback instance and the actual
target function (CbOne). Notice above that CbOne has the same function
signature types as the callback-- this is important. We can
pass in any such properly-typed function to this callback. Let's
look at this more closely:
@verbatim
static double CbOne (double a, double b) {}
^ ^ ^
| ---| ------|
| | |
Callback<double, double, double> one;
@end verbatim
You can only bind a function to a callback if they have the matching
signature. The first template argument is the return type, and the
additional template arguments are the types of the arguments of
the function signature.
Now, let's bind our callback "one" to the function that matches its
signature:
@verbatim
// build callback instance which points to cbOne function
one = MakeCallback (&CbOne);
@end verbatim
Then, later in the program, if the callback is to be used, it can be
used as follows:
@verbatim
// this is not a null callback
NS_ASSERT (!one.IsNull ());
// invoke cbOne function through callback instance
double retOne;
retOne = one (10.0, 20.0);
@end verbatim
The check @code{IsNull()} ensures that the callback is not null; that there
is a function to call behind this callback. Then, @code{one()} returns the
same result as if @code{CbOne()} had been called directly.
@node Using the Callback API with member functions
@subsection Using the Callback API with member functions
Generally, you will not be calling static functions but instead
public member functions of an object. In this case, an extra
argument is needed to the MakeCallback function, to tell the system
on which object the function should be invoked. Consider this example,
also from main-callback.cc:
@verbatim
class MyCb {
public:
int CbTwo (double a) {
std::cout << "invoke cbTwo a=" << a << std::endl;
return -5;
}
};
int main ()
{
...
// return type: int
// first arg type: double
Callback<int, double> two;
MyCb cb;
// build callback instance which points to MyCb::cbTwo
two = MakeCallback (&MyCb::CbTwo, &cb);
...
}
@end verbatim
Here, we pass a (raw) pointer to the @code{MakeCallback<>} function,
that says, when @code{two ()} is invoked, to call the @code{CbTwo} function
on the object pointed to by @code{&cb}.
A variation of this is used when objects are referred to by ns-3 smart
pointers. The MakeCallback API takes a raw pointer, so we need to
call @code{PeekPointer ()} to obtain this raw pointer. So the example
above would look like:
@verbatim
class MyCb : public Object {
public:
int CbTwo (double a) {
std::cout << "invoke cbTwo a=" << a << std::endl;
return -5;
}
};
int main ()
{
...
// return type: int
// first arg type: double
Callback<int, double> two;
Ptr<MyCb> cb = CreateObject<MyCb> ();
// build callback instance which points to MyCb::cbTwo
two = MakeCallback (&MyCb::CbTwo, PeekPointer (cb));
...
}
@end verbatim
@node Building Null Callbacks
@subsection Building Null Callbacks
It is possible for callbacks to be null; hence it may be wise to
check before using them. There is a special construct for a null
callback, which is preferable to simply passing "0" as an argument;
it is the @code{MakeNullCallback<>} construct:
@verbatim
two = MakeNullCallback<int, double> ();
// invoking a null callback is just like
// invoking a null function pointer:
// it will crash at runtime.
//int retTwoNull = two (20.0);
NS_ASSERT (two.IsNull ());
@end verbatim
@node Callback locations in ns-3
@section Callback locations in @command{ns-3}
Where are callbacks frequently used in @command{ns-3}? Here are some of the
more visible ones to typical users:
@subsection Socket API
@subsection Layer-2/Layer-3 API
@subsection Tracing subsystem
@subsection Routing
Route Reply
@node Implementation details
@section Implementation details
This section is advanced explanation for C++ experts interested in
the implementation, and may be skipped by most users.
This code was originally written based on the techniques described
@uref{http://www.codeproject.com/cpp/TTLFunction.asp,,here}.
It was subsequently rewritten to follow the architecture
outlined in
@uref{http://www.amazon.com/Modern-C\%2B\%2B-Design-Programming-Patterns/dp/0201704315/ref=pd_bbs_sr_1/102-0157303-1900156?ie=UTF8\&s=books\&qid=1187982662\&sr=1-1,,Modern C++ Design: Generic Programming and Design Patterns Applied-- Alexandrescu}, chapter 5, "Generalized Functors".
This code uses:
@itemize @bullet
@item default template parameters to saves users from having to
specify empty parameters when the number of parameters
is smaller than the maximum supported number
@item the pimpl idiom: the Callback class is passed around by
value and delegates the crux of the work to its pimpl pointer.
@item two pimpl implementations which derive from CallbackImpl
FunctorCallbackImpl can be used with any functor-type
while MemPtrCallbackImpl can be used with pointers to
member functions.
@item a reference list implementation to implement the Callback's
value semantics.
@end itemize
This code most notably departs from the Alexandrescu
implementation in that it does not use type lists to specify
and pass around the types of the callback arguments.
Of course, it also does not use copy-destruction semantics
and relies on a reference list rather than autoPtr to hold
the pointer.
+18
View File
@@ -0,0 +1,18 @@
Please write image files in a vector graphics format, when possible, and
generate the .png and .pdf versions on the fly (see ../Makefile).
Currently supported tools are dia and tgif. xfig could be added similarly
if someone wants to add it. The main requirement for adding another format
is that the tool to edit it is freely available and that a cron script can
autogenerate the pdf and png from the figure source.
Store the .dia, or .obj versions in mercurial, but not the .png or .pdfs.
If the figure is not available in a vector graphics format, store both
a .png and a .pdf version in this directory.
If you add a source (.dia, .obj) file here, remember to add it to
the list of figure sources in the Makefile in the directory above
Note: tgif can convert from .obj to .pdf, but the pdf that results takes
up a whole page. Instead, we convert to an intermediate .eps step, and
then run epstopdf.
File diff suppressed because it is too large Load Diff
+227
View File
@@ -0,0 +1,227 @@
%TGIF 4.1.43-QPL
state(0,37,100.000,0,64,0,32,0,9,1,1,1,0,0,0,1,0,'Courier-Bold',1,103680,0,3,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0).
%
% @(#)$Header$
% %W%
%
unit("1 pixel/pixel").
color_info(11,65535,0,[
"magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
"red", 65535, 0, 0, 65535, 0, 0, 1,
"green", 0, 65535, 0, 0, 65535, 0, 1,
"blue", 0, 0, 65535, 0, 0, 65535, 1,
"yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
"pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
"cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
"CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
"white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
"black", 0, 0, 0, 0, 0, 0, 1,
"DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
]).
script_frac("0.6").
fg_bg_colors('black','white').
dont_reencode("FFDingbests:ZapfDingbats").
page(1,"",1,'').
box('black','',32,48,240,256,0,3,1,0,0,0,0,0,0,'3',0,[
]).
text('black',64,10,1,0,1,121,28,3,22,6,0,0,0,0,2,121,28,0,0,"",0,0,0,0,32,'',[
minilines(121,28,0,0,0,0,0,[
mini_line(121,22,6,0,0,0,[
str_block(0,121,22,6,0,0,0,0,0,[
str_seg('black','Times-Roman',0,138240,121,22,6,0,0,0,0,0,0,0,
"class Packet")])
])
])]).
text('black',416,100,1,0,1,116,28,15,22,6,0,0,0,0,2,116,28,0,0,"",0,0,0,0,122,'',[
minilines(116,28,0,0,0,0,0,[
mini_line(116,22,6,0,0,0,[
str_block(0,116,22,6,0,0,0,0,0,[
str_seg('black','Times-Roman',0,138240,116,22,6,0,0,0,0,0,0,0,
"class Buffer")])
])
])]).
text('black',48,178,4,0,1,83,69,32,14,4,0,0,0,0,2,83,69,0,0,"",0,0,0,0,192,'',[
minilines(83,69,0,0,0,0,0,[
mini_line(80,14,4,0,0,0,[
str_block(0,80,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0,
"private data:")])
]),
mini_line(59,14,3,0,0,0,[
str_block(0,59,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,59,14,3,0,0,0,0,0,0,0,
"- unique id")])
]),
mini_line(83,14,3,0,0,0,[
str_block(0,83,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,83,14,3,0,0,0,0,0,0,0,
"- Buffer object")])
]),
mini_line(76,14,3,0,0,0,[
str_block(0,76,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,76,14,3,0,0,0,0,0,0,0,
"- Tags object")])
])
])]).
text('black',112,288,1,0,1,103,28,82,22,6,0,0,0,0,2,103,28,0,0,"",0,0,0,0,310,'',[
minilines(103,28,0,0,0,0,0,[
mini_line(103,22,6,0,0,0,[
str_block(0,103,22,6,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,138240,103,22,6,0,-1,0,0,0,0,0,
"class Tags")])
])
])]).
text('black',48,50,5,0,1,175,86,176,14,4,0,0,0,0,2,175,86,0,0,"",0,0,0,0,64,'',[
minilines(175,86,0,0,0,0,0,[
mini_line(105,14,4,0,0,0,[
str_block(0,105,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0,
"public functions:")])
]),
mini_line(80,14,3,0,0,0,[
str_block(0,80,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,80,14,3,0,-1,0,0,0,0,0,
"- constructors")])
]),
mini_line(175,14,3,0,0,0,[
str_block(0,175,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,175,14,3,0,-1,0,0,0,0,0,
"- add/remove/peek at Headers")])
]),
mini_line(155,14,3,0,0,0,[
str_block(0,155,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,155,14,3,0,-1,0,0,0,0,0,
"- add/remove/peek at Tags")])
]),
mini_line(88,14,3,0,0,0,[
str_block(0,88,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,88,14,3,0,0,0,0,0,0,0,
"- fragmentation")])
])
])]).
box('black','',384,144,614,352,0,3,1,245,0,0,0,0,0,'3',0,[
]).
text('black',400,274,4,0,1,204,69,246,14,4,0,0,0,0,2,204,69,0,0,"",0,0,0,0,288,'',[
minilines(204,69,0,0,0,0,0,[
mini_line(80,14,4,0,0,0,[
str_block(0,80,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0,
"private data:")])
]),
mini_line(193,14,3,0,0,0,[
str_block(0,193,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,193,14,3,0,0,0,0,0,0,0,
"- struct BufferData, a dynamically")])
]),
mini_line(160,14,3,0,0,0,[
str_block(0,160,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,160,14,3,0,0,0,0,0,0,0,
"varying byte buffer to which")])
]),
mini_line(204,14,3,0,0,0,[
str_block(0,204,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,204,14,3,0,0,0,0,0,0,0,
"data can be prepended or appended")])
])
])]).
text('black',400,146,5,0,1,188,86,247,14,4,0,0,0,0,2,188,86,0,0,"",0,0,0,0,160,'',[
minilines(188,86,0,0,0,0,0,[
mini_line(105,14,4,0,0,0,[
str_block(0,105,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0,
"public functions:")])
]),
mini_line(172,14,3,0,0,0,[
str_block(0,172,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,172,14,3,0,0,0,0,0,0,0,
"- Iterators to move byte buffer")])
]),
mini_line(171,14,3,0,0,0,[
str_block(0,171,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,171,14,3,0,0,0,0,0,0,0,
"pointers forward or backward")])
]),
mini_line(188,14,3,0,0,0,[
str_block(0,188,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,188,14,3,0,0,0,0,0,0,0,
"- functions to read and write data")])
]),
mini_line(132,14,3,0,0,0,[
str_block(0,132,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,132,14,3,0,-1,0,0,0,0,0,
"of various sized chunks")])
])
])]).
box('black','',96,324,304,532,0,3,1,264,0,0,0,0,0,'3',0,[
]).
text('black',112,454,4,0,1,167,69,265,14,4,0,0,0,0,2,167,69,0,0,"",0,0,0,0,468,'',[
minilines(167,69,0,0,0,0,0,[
mini_line(80,14,4,0,0,0,[
str_block(0,80,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0,
"private data:")])
]),
mini_line(167,14,3,0,0,0,[
str_block(0,167,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,167,14,3,0,0,0,0,0,0,0,
"- singly linked-list of TagData")])
]),
mini_line(158,14,3,0,0,0,[
str_block(0,158,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,158,14,3,0,0,0,0,0,0,0,
"structures, with a reference")])
]),
mini_line(32,14,3,0,0,0,[
str_block(0,32,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,32,14,3,0,0,0,0,0,0,0,
"count")])
])
])]).
text('black',112,326,5,0,1,155,86,266,14,4,0,0,0,0,2,155,86,0,0,"",0,0,0,0,340,'',[
minilines(155,86,0,0,0,0,0,[
mini_line(105,14,4,0,0,0,[
str_block(0,105,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0,
"public functions:")])
]),
mini_line(80,14,3,0,0,0,[
str_block(0,80,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,80,14,3,0,-1,0,0,0,0,0,
"- constructors")])
]),
mini_line(155,14,3,0,0,0,[
str_block(0,155,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,155,14,3,0,-1,0,0,0,0,0,
"- templates to add, remove,")])
]),
mini_line(148,14,3,0,0,0,[
str_block(0,148,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,148,14,3,0,-1,0,0,0,0,0,
"or peek at Tags of various")])
]),
mini_line(31,14,3,0,0,0,[
str_block(0,31,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,31,14,3,0,-1,0,0,0,0,0,
"types")])
])
])]).
poly('black','',2,[
59,245,96,320],0,2,1,272,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
poly('black','',2,[
123,246,288,320],0,2,1,280,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
poly('black','',2,[
141,219,379,147],0,2,1,286,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
poly('black','',2,[
132,226,375,335],0,2,1,287,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
@node Logging
@chapter Logging
@anchor{chap:Logging}
This chapter is the first in a series of chapters discussing things that
one can do to modify the input or output of existing ns-3 scripts.
Examples:
@itemize @bullet
@item Enable or disable the generation of log messages, with fine granularity
@item Set default values for configuration values in the system
@item Generate a report of all configuration values used during a simulation
run (not yet implemented)
@item Set or get values of member variables on objects already instantiated
@item Customizing the tracing output of the script
@item Generate statistics on (not yet implemented)
@item Perform a large number of independent runs of the same simulation
@end itemize
@node Logging Basics
@section Logging Basics
@node Enabling Log Output
@section Enabling Log Output
+156
View File
@@ -0,0 +1,156 @@
body {
font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
background: white;
color: black;
font-size: 11pt;
}
h1, h2, h3, h4, h5, h6 {
# color: #990000;
color: #009999;
}
pre {
font-size: 10pt;
background: #e0e0e0;
color: black;
}
a:link, a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
img {
border: 0px;
}
#main th {
font-size: 12pt;
background: #b0b0b0;
}
.odd {
font-size: 12pt;
background: white;
}
.even {
font-size: 12pt;
background: #e0e0e0;
}
.answer {
font-size: large;
font-weight: bold;
}
.answer p {
font-size: 12pt;
font-weight: normal;
}
.answer ul {
font-size: 12pt;
font-weight: normal;
}
#container {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
}
#feedback {
color: #b0b0b0;
font-size: 9pt;
font-style: italic;
}
#header {
position: absolute;
margin: 0px;
top: 10px;
height:96px;
left: 175px;
right: 10em;
bottom: auto;
background: white;
clear: both;
}
#middle {
position: absolute;
left: 0;
height: auto;
width: 100%;
}
#main {
position: absolute;
top: 50px;
left: 175px;
right: 100px;
background: white;
padding: 0em 0em 0em 0em;
}
#navbar {
position: absolute;
top: 75px;
left: 0em;
width: 146px;
padding: 0px;
margin: 0px;
font-size: 10pt;
}
#navbar a:link, #navbar a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
#navbar a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
#navbar dl {
width: 146px;
padding: 0;
margin: 0 0 10px 0px;
background: #99ffff url(images/box_bottom2.gif) no-repeat bottom left;
}
#navbar dt {
padding: 6px 10px;
font-size: 100%;
font-weight: bold;
background: #009999;
margin: 0px;
border-bottom: 1px solid #fff;
color: white;
background: #009999 url(images/box_top2.gif) no-repeat top left;
}
#navbar dd {
font-size: 100%;
margin: 0 0 0 0px;
padding: 6px 10px;
color: #0047b9;
}
dd#selected {
background: #99ffff url(images/arrow.gif) no-repeat;
background-position: 4px 10px;
}
+102
View File
@@ -0,0 +1,102 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ns-3.info
@settitle ns-3 manual
@c @setchapternewpage odd
@c %**end of header
@ifinfo
Primary documentation for the @command{ns-3} project is available in
four forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item @uref{http://www.nsnam.org/tutorial/index.html,,ns-3 Tutorial}
@item Reference Manual (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML versions
should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
@end ifinfo
@copying
This is an @command{ns-3} reference manual.
Primary documentation for the @command{ns-3} project is available in
four forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/tutorial/index.html,,ns-3 Tutorial}
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen}: Documentation of the public APIs of the simulator
@item Reference Manual (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML
versions should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This software 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, see @uref{http://www.gnu.org/licenses/}.
@end copying
@titlepage
@title ns-3 Reference Manual
@author ns-3 project
@author feedback: ns-developers@@isi.edu
@today{}
@c @page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@c So the toc is printed at the start.
@anchor{Full Table of Contents}
@contents
@ifnottex
@node Top, Overview, Full Table of Contents
@top ns-3 Manual (html version)
For a pdf version of this manual,
see @uref{http://www.nsnam.org/docs/manual.pdf}.
@insertcopying
@end ifnottex
@menu
* Random variables::
* Callbacks::
* Attributes::
* Packets::
* Sockets APIs::
* Routing overview::
* Troubleshooting
@end menu
@include random.texi
@include callbacks.texi
@include attributes.texi
@include packets.texi
@include sockets.texi
@c @include output.texi
@include routing.texi
@c @include other.texi
@include troubleshoot.texi
@printindex cp
@bye
File diff suppressed because it is too large Load Diff
+462
View File
@@ -0,0 +1,462 @@
@c ========================================================================
@c Simulation Output
@c ========================================================================
@node Simulation Output
@chapter Simulation Output
At this point, you should be able to execute any of the built-in
programs distributed with @command{ns-3}. Next, we will look at
how to generate and tailor the simulation output, before turning
to how to modify simulation scripts to do different things.
@node Tracing Basics
@section Tracing Basics
The whole point of simulation is to generate output for further
study, and the @command{ns-3} tracing system is a primary
mechanism for this.
Since @command{ns-3} is a C++ program, standard facilities for
generating output from C++ programs apply:
@verbatim
#include <iostream>
...
int main ()
{
...
std::cout << "The value of x is " << x << std::endl;
...
}
@end verbatim
The goal of the @command{ns-3} tracing system is to
provide a structured way to configure the simulator to output results
in standard or modifiable formats.
@itemize @bullet
@item For basic tasks, the tracing system should allow the user to
generate standard tracing for popular tracing sources, and to customize
which objects generate the tracing.
@item Intermediate users will be able to extend the tracing system to
modify the output format generated, or to insert new tracing sources,
without modifying the core of the simulator.
@item Advanced users can modify the simulator core to add new
tracing sources and sinks.
@end itemize
The @command{ns-3} tracing system is fundamentally built on the
concept of separating tracing sources from sinks.
@enumerate
@item Trace sources (e.g., provide access to every packet received)
@item Trace sinks (e.g., print out the packet)
@item A mechanism to tie together sources and sinks
@end enumerate
The rationale for this division is to allow users to attach new
types of sinks to existing tracing sources, without requiring
users to edit and recompile the core of the simulator.
Thus, in the example above, a user could write a new tracing sink
and attach it to an existing tracing source. What remains to
be defined is a way for users to find these hooks (tracing sources)
and attach sinks to them. A new tracing namespace is defined for
this purpose.
We will first walk through how some pre-defined sources and sinks
are provided and may be customized with little user effort. We
return later in this chapter to advanced tracing configuration including
extending the tracing namespace and creating new tracing sources.
@subsection ASCII tracing
@cindex ASCII
For Internet nodes, the ASCII trace wrapper is a wrapper around
the @command{ns-3} low-level
tracing system that lets you get access to underlying trace events easily.
The output of a trace of a simulation run is an ASCII file --- thus the name.
In the spririt of keeping things simple, you won't be able to control or
configure the output at this stage.
For those familiar with @command{ns-2} output, this type of trace is
analogous to the @command{out.tr} generated by many scripts.
@cindex tracing packets
Let's just jump right in. As usual, we need to include the definitions
related to using ASCII tracing (don't edit any files quite yet):
@verbatim
#include "ns3/ascii-trace.h"
@end verbatim
We then need to add the code to the script to actually enable the ASCII tracing
code. The following code must be inserted before the call to
@code{Simulator::Run ();}:
@verbatim
AsciiTrace asciitrace ("tutorial.tr");
asciitrace.TraceAllQueues ();
asciitrace.TraceAllNetDeviceRx ();
@end verbatim
The first line declares an object of type @code{AsciiTrace} named
@code{asciitrace} and passes a string parameter to its constructor. This
parameter is a file name to which all of the trace information will be written.
The second line, @code{asciitrace.TraceAllQueues ();} asks the trace object to
arrange that all queue operations (enqueue, dequeue, drop) on the queues
in all of the nodes of the system be traced. On the receive side,
@code{asciitrace.TraceAlllNetDeviceRx ()} traces packets received by
a NetDevice. For those familiar with @command{ns-2}, these are equivalent
to the popular trace points that log "+", "-", "d", and "r" events.
Try running the following program from the command line:
@verbatim
./waf --run tutorial-csma-echo-ascii-trace
@end verbatim
@cindex tutorial.tr
Just as you have seen previously, you will see some messages from @emph{Waf}
and then the ``Compilation finished successfully'' message. The
next message, @code{UDP Echo Simulation} is from the running program. When
it ran, the program will have created a file named @code{tutorial.tr}.
Because of the way that Waf works, the file is not created in the local
directory, it is created at the top-level directory of the repository. So,
change into the top level directory and take a look at the file
@code{tutorial.tr} in your favorite editor.
@subsubsection Parsing Ascii Traces
@cindex parsing ascii traces
This section parses in detail the structure of the ascii tracing
output. If you find this output format self explanatory (it
resembles tcpdump output), you may skip to the next
section on pcap tracing.
@cindex trace event
There's a lot of information there in a pretty dense form, but the first thing
to notice is that there are a number of distinct lines in this file. It may
be difficult to see this clearly unless you widen your windows considerably.
Each line in the file corresponds to a @emph{trace event}. A trace event
happens whenever specific conditions happen in the simulation. In this case
we are tracing events on the @emph{device queue} present in every net device
on every node in the simulation. The device queue is a queue through which
every packet destined for a channel must pass --- it is the device
@emph{transmit} queue. Note that each line in the trace file begins with a
lone character (has a space after it). This character will have the following
meaning:
@cindex enqueue
@cindex dequeue
@cindex drop
@itemize @bullet
@item @code{+}: An enqueue operation occurred on the device queue;
@item @code{-}: A dequeue operation occurred on the device queue;
@item @code{d}: A packet was dropped, typically because the queue was full.
@end itemize
Let's take a more detailed view of the first line. I'll break it down into
sections (indented for clarity) with a two digit reference number on the
left side:
@verbatim
00 +
01 2
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=9
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:00,
09 destination=ff:ff:ff:ff:ff:ff
10 ARP(request
11 source mac: 08:00:2e:00:00:00
12 source ipv4: 10.1.1.1
13 dest ipv4: 10.1.1.2)
14 ETHERNET fcs=0
@end verbatim
@cindex trace event
@cindex simulation time
The first line of this expanded trace event (reference number 00) is the
queue operation. We have a @code{+} character, so this corresponds to an
@emph{enqueue} operation. The second line (reference 01) is the simulation
time expressed in seconds. You may recall that we asked the
@code{UdpEchoClient} to start sending packets at two seconds. Here we see
confirmation that this is, indeed, happening.
@cindex node number
@cindex net device number
@cindex smart pointer
The next lines of the example listing (references 02 and 03) tell us that
this trace event originated in a given node and net device. Each time a node
is created it is given an identifying number that monotonically increases from
zero. Therefore, @code{nodeid=0} means that the node in which the given trace
event originated is the first node we created. In the case of our script,
this first node is is the node pointed to by the smart pointer @code{n0}. Not
too surpsisingly, this is also the node to which we attached the
@code{UdpEchoClient}. The device number is local to each node, and so the
device given by @code{device=0} is the first net device that we added to the
node in question. In our simulation, this corresponds to the
@code{CsmaNetDevice} we added to node zero (@code{n0}).
@cindex uid
@cindex unique ID
@cindex packet
The next line (reference 04) is a more readable form of the operation code
seen in the first line --- i.e., the character @code{+} means
@code{queue-enqueue}. Reference number 05 indicates that the @emph{unique id}
of the packet being enqueued is @code{9}. The fact that the first packet we
see has a unique ID of 9 should indicates to you that other things have
happened in the protocol stack before we got to this point. This will become
clear momentarily.
@cindex Ethernet
@cindex MAC address
Reference items 06 and 14 indicate that this is an Ethernet packet with
a zero (not computed) checksum (note the indentation to make parsing this
trace event a little easier). Reference 08 and 09 are the source and
destination addresses of this packet. The packet is from the MAC address we
assigned to the node zero net device in the script, and is destined for the
broadcast address --- this is a broadcast packet.
@cindex Address Resolution Protocol
@cindex ARP
@cindex ARP|request
Reference items 10 through 13 make clear what is happening. This is an ARP
(Address Resolution Protocol) request for the MAC address of the node on
which the @code{UdpEchoServer} resides. The protocol stack can't send a UDP
packet to be echoed until it knows (resolves) the MAC address; and this trace
event corresponds to an ARP request being queued for transmission to the local
network. The next line in the trace file (partially expanded),
@verbatim
00 -
01 2
02 nodeid=0
03 device=0
04 queue-dequeue
05 pkt-uid=9
...
@end verbatim
shows the (same) ARP request packet being dequeued from the device queue by
the net device and (implicitly) being sent down the channel to the broadcast
MAC address. We are not tracing net device reception events so we don't
actually see all of the net devices receiving the broadcast packet. We do,
however see the following in the third line of the trace file:
@verbatim
00 +
01 2.00207
02 nodeid=1
03 device=0
04 queue-enqueue
05 pkt-uid=10
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:01,
09 destination=08:00:2e:00:00:00,
10 ARP(reply
11 source mac: 08:00:2e:00:00:01
12 source ipv4: 10.1.1.2
13 dest mac: 08:00:2e:00:00:00
14 dest ipv4: 10.1.1.1)
15 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex ARP|response
Notice that this is a queue-enqueue operation (references 00 and 04) happening
on node one (reference 02) at simulation time 2.00207 seconds (reference 01).
Looking at the packet payload (references 10-14) we see that this is an ARP
reply to the request sent by node one. Note that the simulation time
(reference 01) is now 2.00207 seconds. This is direct result of the data rate
(5 mb/s) and latency (2 ms) parameters that we passed to the
@code{CsmaChannel} when we created it. Clearly the ARP request packet was
sent over the channel and received approximately 2 ms later by node one. A
corresponding ARP response packet was created and enqueued on node one's net
device. It is this enqueue trace event that has being logged.
@cindex queue
@cindex queue|transmit
@cindex echo
Given the current state of affairs, the next thing you may expect to see is
this ARP request being received by node zero, but remember we are only looking
at trace events on the device @emph{transmit} queue. The reception of the ARP
response by node zero will not directly trigger any trace event in this case,
but it will enable the protocol stack to continue what it was originally doing
(trying to send an echo packet). Thus, the next line we see in the trace file
(@code{tutorial.tr}) is the first UDP echo packet being sent to the net device.
@verbatim
00 +
01 2.00415
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=7
06 ETHERNET
07 length/type=0x800,
08 source=08:00:2e:00:00:00,
09 destination=08:00:2e:00:00:01
10 IPV4(
11 tos 0x0
12 ttl 64
13 id 0
14 offset 0
15 flags [none]
16 length: 1052) 10.1.1.1 > 10.1.1.2
17 UDP(length: 1032)
18 49153 > 7
19 DATA (length 1024)
20 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex echo
@cindex ARP
@cindex ARP|request
@cindex ARP|response
@cindex IP
@cindex Ipv4
I won't go into too much detail about this packet, but I will point out a
few key items in the trace. First, the packet was enqueued at simulation time
of 2.00415 seconds. This time reflects the fact that the echo client
application started at 2. seconds and there were two ARP packets transmitted
across the network (two milliseconds + data transmission time each way). The
packet unique identifier (reference 05) is 7. Notice that this is a lower
number than the ARP request packet, which had a unique ID of 9. This tells
us that the UDP packet was actually created before the ARP request packet ---
which makes perfect sense since it was the attempt to send packet 7 that
triggered sending the ARP request packet 9. Note that this an Ethernet
packet (reference 06) like all other packets in this simulation, however this
particular packet carries an IPV4 payload and therefore has an IP version 4
header (indicated by references 10-16). This Ipv4 in turn contains a UDP
header (references 17, 18) and finally 1024 bytes of data (reference 20).
Clearly, this is the UDP echo packet emitted by the
@code{UdpEchoClient Application}.
The next trace event is an ARP request from node one. We can infer that node
one has received the UDP echo packet and the @code{UdpEchoServer Application}
on that node has turned the packet around. Just as node zero needed to ARP
for the MAC address of node one, now node one must ARP for the MAC address of
node zero. We see the ARP request enqueued on the transmit queue of node one;
then we see the ARP request dequeued from the tranmit queue of node one (and
implicitly transmitted to node zero). Then we see an ARP response enqueued
on the transmit queue of node zero; and finally the ARP response dequeued (and
implicitly transmitted back to node one).
This exchange is summarized in the following trace event excerpts,
@verbatim
+ 2.00786 nodeid=1 ... ARP(request ...
- 2.00786 nodeid=1 ... ARP(request ...
+ 2.00994 nodeid=0 ... ARP(reply ...
- 2.00994 nodeid=0 ... ARP(reply ...
@end verbatim
The final two trace events in the @code{tutorial.tr} file correspond to the
echoed packet being enqueued for transmission on the net device for node one,
and that packet being dequeued (and implicitly transmitted back to node zero).
@cindex AsciiTrace!TraceAllNetDeviceRx
@cindex ARP!request
If you look at the trace file (@code{tutorial.tr}) you will also see some
entries with an @code{r} event, indicating a
@emph{receive} trace event. Recall that the first packet sent on the network
was a broadcast ARP request. We should then see all four nodes receive a
copy of this request. This is the case, as the first four receive trace
events are,
@verbatim
r 2.00207 nodeid=0 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=1 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=2 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=3 device=0 dev-rx pkt-uid=9 ARP(request ...
@end verbatim
@cindex unique ID
You can see that a copy of the broadcast packet with unique ID 9 was received
by the net devices on nodes 0, 1, 2 and 3. We leave it up to you to parse the
rest of the trace file and understand the remaining reception events.
@subsection PCAP Trace Wrapper
@cindex pcap
@cindex Wireshark
The @command{ns-3} @emph{pcap trace wrapper} is used to create trace files in
@code{.pcap} format. The acronym pcap (usually written in lower case) stands
for @emph{p}acket @emph{cap}ture, and is actually an API that includes the
definition of a @code{.pcap} file format. The most popular program that can
read and display this format is Wireshark (formerly called Ethereal).
However, there are many traffic trace analyzers that use this packet
format, including X, Y, and Z. We encourage users to exploit the
many tools available for analyzing pcap traces; below, we show how
tcpdump and Wireshark can be used..
@cindex tutorial-csma-echo-ascii-trace.cc
@cindex tutorial-csma-echo-pcap-trace.cc
The code used to enable pcap tracing is similar to that for ASCII tracing.
We have provided another file, @code{tutorial-csma-echo-pcap-trace.cc} that
uses the pcap trace wrapper. We have added the code to include the pcap
trace wrapper defintions:
@verbatim
#include "ns3/pcap-trace.h"
@end verbatim
And then added the following code below the AsciiTrace methods:
@cindex PcapTrace
@cindex PcapTrace!TraceAllIp
@verbatim
PcapTrace pcaptrace ("tutorial.pcap");
pcaptrace.TraceAllIp ();
@end verbatim
The first line of the code immediately above declares an object of type
@code{PcapTrace} named @code{pcaptrace} and passes a string parameter to its
constructor. This object is used to hide the details of the actual tracing
subsystem. The parameter is a base file name from which the actual trace file
names will be built. The second line of code tells the @code{PcamTrace}
object to trace all IP activity in all of the nodes present in the simulation.
@cindex interface index
Trace files are not created until trace activity is detected. Each file name
is composed of the base file name, followed by a @code{'-'}, a node id followed
by a @code{'-}', and an IP interface index. You will soon see a file named
@code{tutorial.pcap-0-1}, for example. This will be the trace file generated
as events are detected on node zero, interface index one. N.B. Interface
indices are different that net device indices --- interface index zero
corresponds to the loopback interface and interface index one corresponds to
the first net device you added to a node.
You may run the new program just like all of the others so far:
@cindex Waf
@verbatim
./waf --run tutorial-csma-echo-pcap-trace
@end verbatim
If you look at the top level directory of your distribution, you should now
see three log files: @code{tutorial.tr} is the ASCII trace file we have
previously examined. @code{tutorial.pcap-0-1} and @code{tutorial.pcap-1-1}
are the new pcap files we just generated. There will not be files
corresponding to nodes two and three since we have not sent any IP packets to
those nodes.
@subsubsection Reading output with tcpdump
@cindex tcpdump
@subsubsection Reading output with Wireshark
@cindex Wireshark
If you are unfamilar with Wireshark, there is a web site available from which
you can download programs and documentation: @uref{http://www.wireshark.org/}.
If you have Wireshark available, you can open each of the trace files and
display the contents as if you had captured the packets using a
@emph{packet sniffer}. Note that only IP packets are traced using this
wrapper, so you will not see the ARP exchanges that were logged when using
the ASCII trace wrapper. You are encouraged to take a look at the contents
of these pcap files using your favorite pcap software (or Wireshark).
@node Advanced Tracing
@section Advanced Tracing
+620
View File
@@ -0,0 +1,620 @@
@node Packets
@chapter Packets
The design of the Packet framework of @emph{ns} was heavily guided by a few
important use-cases:
@itemize @bullet
@item avoid changing the core of the simulator to introduce
new types of packet headers or trailers
@item maximize the ease of integration with real-world code
and systems
@item make it easy to support fragmentation, defragmentation,
and, concatenation which are important, especially in wireless systems.
@item make memory management of this object efficient
@item allow actual application data or dummy application bytes for
emulated applications
@end itemize
@emph{ns} Packet objects contain a buffer of bytes: protocol headers and
trailers are serialized in this buffer of bytes using user-provided
serialization and deserialization routines. The content of this byte
buffer is expected to match bit-for-bit the content of a real packet on
a real network implementing the protocol of interest.
Fragmentation and defragmentation are quite natural to implement within
this context: since we have a buffer of real bytes, we can split it in
multiple fragments and re-assemble these fragments. We expect that this
choice will make it really easy to wrap our Packet data structure within
Linux-style skb or BSD-style mbuf to integrate real-world kernel code in
the simulator. We also expect that performing a real-time plug of the
simulator to a real-world network will be easy.
Because we understand that simulation developers often wish to store in
packet objects data which is not found in the real packets (such as
timestamps or any kind of similar in-band data), the @emph{ns} Packet class
can also store extra per-packet "Tags" which are 16 bytes blobs of data.
Any Packet can store any number of unique Tags, each of which is
uniquely identified by its C++ type. These tags make it easy to attach
per-model data to a packet without having to patch the main Packet
class or Packet facilities.
Memory management of Packet objects is entirely automatic and extremely
efficient: memory for the application-level payload can be modelized by
a virtual buffer of zero-filled bytes for which memory is never allocated
unless explicitely requested by the user or unless the packet is fragmented.
Furthermore, copying, adding, and, removing headers or trailers to a packet
has been optimized to be virtually free through a technique known as
Copy On Write.
Packets (messages) are fundamental objects in the simulator and
their design is important from a performance and resource management
perspective. There
are various ways to design the simulation packet, and tradeoffs
among the different approaches. In particular, there is a
tension between ease-of-use, performance, and safe interface
design.
There are a few requirements on this object design:
@itemize @bullet
@item Creation, management, and deletion of this object
should be as simple as possible, while avoiding the
chance for memory leaks and/or heap corruption;
@item Packets should support serialization and deserialization
so that network emulation is supported;
@item Packets should support fragmentation and concatenation
(multiple packets in a data link frame), especially for wireless
support;
@item It should be natural for packets to carry actual application
data, or if there is only an emulated application and there is
no need to carry dummy bytes, smaller packets could be used with
just the headers and a record of the payload size, but not actual
application bytes, conveyed in the simulated packet.
@item Packets should facilitate BSD-like operations on mbufs, for
support of ported operating system stacks.
@item Additional side-information should be supported, such as
a tag for cross-layer information.
@end itemize
@section Packet design overview
Unlike @emph{ns-2}, in which Packet objects contain a buffer of C++
structures corresponding to protocol headers, each network packet in
@emph{ns-3} contains a byte Buffer and a list of Tags:
@itemize @bullet
@item The byte buffer stores the serialized content of the chunks
added to a packet. The serialized representation of these chunks is
expected to match that of real network packets bit for bit
(although nothing forces you to do this) which means that the content
of a packet buffer is expected to be that of a real packet.
Packets can also be created with an arbitrary zero-filled payload
for which no real memory is allocated.
@item The list of tags stores an arbitrarily large set of arbitrary
user-provided data structures in the packet. Each Tag is uniquely
identified by its type; only one instance of each
type of data structure is allowed in a list of tags. These tags typically
contain per-packet cross-layer information or flow identifiers (i.e.,
things that you wouldn't find in the bits on the wire). Each tag
stored in the tag list can be at most 16 bytes.
Trying to attach bigger data structures will trigger
crashes at runtime. The 16 byte limit is a modifiable compilation
constant.
@end itemize
@float Figure,fig:packets
@caption{Implementation overview of Packet class.}
@image{figures/packet}
@end float
Figure @ref{fig:packets} is a high-level overview of the Packet
implementation; more detail on the byte Buffer implementation
is provided later in Figure @ref{fig:buffer}.
In \nsthree, the Packet byte buffer is analogous to a Linux skbuff
or BSD mbuf; it is a serialized representation of the actual
data in the packet. The tag list is a container for extra
items useful for simulation convenience; if a Packet is converted
to an emulated packet and put over an actual network, the tags
are stripped off and the byte buffer is copied directly
into a real packet.
The Packet class has value semantics: it can be freely copied around,
allocated on the stack, and passed to functions as arguments. Whenever
an instance is copied, the full underlying data is not copied; it
has ``copy-on-write'' (COW) semantics. Packet instances can be passed
by value to function arguments without any performance hit.
The fundamental classes for adding to and removing from the byte
buffer are @code{class Header} and @code{class Trailer}.
Headers are more common but the below discussion also largely applies to
protocols using trailers. Every protocol header that needs to
be inserted and removed from a Packet instance should derive from
the abstract Header base class and implement the private pure
virtual methods listed below:
@itemize @bullet
@item @code{ns3::Header::SerializeTo()}
@item @code{ns3::Header::DeserializeFrom()}
@item @code{ns3::Header::GetSerializedSize()}
@item @code{ns3::Header::PrintTo()}
@end itemize
Basically, the first three functions are used to serialize and deserialize
protocol control information to/from a Buffer. For example,
one may define @code{class TCPHeader : public Header}. The
TCPHeader object will typically consist of some private data
(like a sequence number) and public interface access functions
(such as checking the bounds of an input). But the underlying
representation of the TCPHeader in a Packet Buffer is 20 serialized
bytes (plus TCP options). The TCPHeader::SerializeTo() function would
therefore be designed to write these 20 bytes properly into
the packet, in network byte order. The last function is used
to define how the Header object prints itself onto an output stream.
Similarly, user-defined Tags can be appended to the packet.
Unlike Headers, Tags are not serialized into a contiguous buffer
but are stored in an array. By default, Tags are limited to 16 bytes in
size. Tags can be flexibly defined to be any type, but there
can only be one instance of any particular object type in
the Tags buffer at any time. The implementation makes use
of templates to generate the proper set of Add(), Remove(),
and Peek() functions for each Tag type.
@section Packet interface
The public member functions of a Packet object are as follows:
@subsection Constructors
@verbatim
/**
* Create an empty packet with a new uid (as returned
* by getUid).
*/
Packet ();
/**
* Create a packet with a zero-filled payload.
* The memory necessary for the payload is not allocated:
* it will be allocated at any later point if you attempt
* to fragment this packet or to access the zero-filled
* bytes. The packet is allocated with a new uid (as
* returned by getUid).
*
* \param size the size of the zero-filled payload
*/
Packet (uint32_t size);
@end verbatim
@subsection Adding and removing Buffer data
The below code is reproduced for Header class only; similar functions
exist for Trailers.
@verbatim
/**
* Add header to this packet. This method invokes the
* ns3::Header::serializeTo method to request the header to serialize
* itself in the packet buffer.
*
* \param header a reference to the header to add to this packet.
*/
void Add (Header const &header);
/**
* Deserialize header from this packet. This method invokes the
* ns3::Header::deserializeFrom method to request the header to deserialize
* itself from the packet buffer. This method does not remove
* the data from the buffer. It merely reads it.
*
* \param header a reference to the header to deserialize from the buffer
*/
void Peek (Header &header);
/**
* Remove a deserialized header from the internal buffer.
* This method removes the bytes read by Packet::peek from
* the packet buffer.
*
* \param header a reference to the header to remove from the internal buffer.
*/
void Remove (Header const &header);
/**
* Add trailer to this packet. This method invokes the
* ns3::Trailer::serializeTo method to request the trailer to serialize
* itself in the packet buffer.
*
* \param trailer a reference to the trailer to add to this packet.
*/
@end verbatim
@subsection Adding and removing Tags
@verbatim
/**
* Attach a tag to this packet. The tag is fully copied
* in a packet-specific internal buffer. This operation
* is expected to be really fast.
*
* \param tag a pointer to the tag to attach to this packet.
*/
template <typename T>
void AddTag (T const &tag);
/**
* Remove a tag from this packet. The data stored internally
* for this tag is copied in the input tag if an instance
* of this tag type is present in the internal buffer. If this
* tag type is not present, the input tag is not modified.
*
* This operation can be potentially slow and might trigger
* unexpectedly large memory allocations. It is thus
* usually a better idea to create a copy of this packet,
* and invoke removeAllTags on the copy to remove all
* tags rather than remove the tags one by one from a packet.
*
* \param tag a pointer to the tag to remove from this packet
* \returns true if an instance of this tag type is stored
* in this packet, false otherwise.
*/
template <typename T>
bool RemoveTag (T &tag);
/**
* Copy a tag stored internally to the input tag. If no instance
* of this tag is present internally, the input tag is not modified.
*
* \param tag a pointer to the tag to read from this packet
* \returns true if an instance of this tag type is stored
* in this packet, false otherwise.
*/
template <typename T>
bool PeekTag (T &tag) const;
/**
* Remove all the tags stored in this packet. This operation is
* much much faster than invoking removeTag n times.
*/
void RemoveAllTags (void);
@end verbatim
@subsection Fragmentation
@verbatim
/**
* Create a new packet which contains a fragment of the original
* packet. The returned packet shares the same uid as this packet.
*
* \param start offset from start of packet to start of fragment to create
* \param length length of fragment to create
* \returns a fragment of the original packet
*/
Packet CreateFragment (uint32_t start, uint32_t length) const;
/**
* Concatenate the input packet at the end of the current
* packet. This does not alter the uid of either packet.
*
* \param packet packet to concatenate
*/
void addAtEnd (Packet packet);
/oncatenate the input packet at the end of the current
* packet. This does not alter the uid of either packet.
*
* \param packet packet to concatenate
*/
void AddAtEnd (Packet packet);
/**
* Concatenate the fragment of the input packet identified
* by the offset and size parameters at the end of the current
* packet. This does not alter the uid of either packet.
*
* \param packet to concatenate
* \param offset offset of fragment to copy from the start of the input packet
* \param size size of fragment of input packet to copy.
*/
void AddAtEnd (Packet packet, uint32_t offset, uint32_t size);
/**
* Remove size bytes from the end of the current packet
* It is safe to remove more bytes that what is present in
* the packet.
*
* \param size number of bytes from remove
*/
void RemoveAtEnd (uint32_t size);
/**
* Remove size bytes from the start of the current packet.
* It is safe to remove more bytes that what is present in
* the packet.
*
* \param size number of bytes from remove
*/
void RemoveAtStart (uint32_t size);
@end verbatim
@subsection Miscellaneous
@verbatim
/**
* \returns the size in bytes of the packet (including the zero-filled
* initial payload)
*/
uint32_t GetSize (void) const;
/**
* If you try to change the content of the buffer
* returned by this method, you will die.
*
* \returns a pointer to the internal buffer of the packet.
*/
uint8_t const *PeekData (void) const;
/**
* A packet is allocated a new uid when it is created
* empty or with zero-filled payload.
*
* \returns an integer identifier which uniquely
* identifies this packet.
*/
uint32_t GetUid (void) const;
@end verbatim
@section Using Headers
@emph{walk through an example of adding a UDP header}
@section Using Tags
@emph{walk through an example of adding a flow ID}
@section Using Fragmentation
@emph{walk through an example of link-layer fragmentation/reassembly}
@section Sample program
The below sample program (from @code{ns3/samples/main-packet.cc}) illustrates
some use of the Packet, Header, and Tag classes.
@verbatim
/* -*- Mode:C++; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
#include "ns3/packet.h"
#include "ns3/header.h"
#include <iostream>
using namespace ns3;
/* A sample Header implementation
*/
class MyHeader : public Header {
public:
MyHeader ();
virtual ~MyHeader ();
void SetData (uint16_t data);
uint16_t GetData (void) const;
private:
virtual void PrintTo (std::ostream &os) const;
virtual void SerializeTo (Buffer::Iterator start) const;
virtual void DeserializeFrom (Buffer::Iterator start);
virtual uint32_t GetSerializedSize (void) const;
uint16_t m_data;
};
MyHeader::MyHeader ()
{}
MyHeader::~MyHeader ()
{}
void
MyHeader::PrintTo (std::ostream &os) const
{
os << "MyHeader data=" << m_data << std::endl;
}
uint32_t
MyHeader::GetSerializedSize (void) const
{
return 2;
}
void
MyHeader::SerializeTo (Buffer::Iterator start) const
{
// serialize in head of buffer
start.WriteHtonU16 (m_data);
}
void
MyHeader::DeserializeFrom (Buffer::Iterator start)
{
// deserialize from head of buffer
m_data = start.ReadNtohU16 ();
}
void
MyHeader::SetData (uint16_t data)
{
m_data = data;
}
uint16_t
MyHeader::GetData (void) const
{
return m_data;
}
/* A sample Tag implementation
*/
struct MyTag {
uint16_t m_streamId;
};
static TagRegistration<struct MyTag> g_MyTagRegistration ("ns3::MyTag", 0);
static void
Receive (Packet p)
{
MyHeader my;
p.Peek (my);
p.Remove (my);
std::cout << "received data=" << my.GetData () << std::endl;
struct MyTag myTag;
p.PeekTag (myTag);
}
int main (int argc, char *argv[])
{
Packet p;
MyHeader my;
my.SetData (2);
std::cout << "send data=2" << std::endl;
p.Add (my);
struct MyTag myTag;
myTag.m_streamId = 5;
p.AddTag (myTag);
Receive (p);
return 0;
}
@end verbatim
@section Implementation details
@subsection Private member variables
A Packet object's interface provides access to some private
data:
@verbatim
Buffer m_buffer;
Tags m_tags;
uint32_t m_uid;
static uint32_t m_global_uid;
@end verbatim
Each Packet has a Buffer and a Tags object, and a 32-bit unique ID (m\_uid).
A static member variable keeps track of the UIDs allocated. Note
that real network packets do not have a UID; the UID is therefore an
instance of data that normally would be stored as a Tag in the packet.
However, it was felt that a UID is a special case that is so often
used in simulations that it would be more convenient to store it
in a member variable.
@subsection Buffer implementation
Class Buffer represents a buffer of bytes. Its size is
automatically adjusted to hold any data prepended
or appended by the user. Its implementation is optimized
to ensure that the number of buffer resizes is minimized,
by creating new Buffers of the maximum size ever used.
The correct maximum size is learned at runtime during use by
recording the maximum size of each packet.
Authors of new Header or Trailer classes need to know the public
API of the Buffer class. (add summary here)
The byte buffer is implemented as follows:
@verbatim
struct BufferData {
uint32_t m_count;
uint32_t m_size;
uint32_t m_initialStart;
uint32_t m_dirtyStart;
uint32_t m_dirtySize;
uint8_t m_data[1];
};
struct BufferData *m_data;
uint32_t m_zeroAreaSize;
uint32_t m_start;
uint32_t m_size;
@end verbatim
@itemize @bullet
@item @code{BufferData::m_count}: reference count for BufferData structure
@item @code{BufferData::m_size}: size of data buffer stored in BufferData structure
@item @code{BufferData::m_initialStart}: offset from start of data buffer where data was first inserted
@item @code{BufferData::m_dirtyStart}: offset from start of buffer where every Buffer which holds a reference to this BufferData instance have written data so far
@item @code{BufferData::m_dirtySize}: size of area where data has been written so far
@item @code{BufferData::m_data}: pointer to data buffer
@item @code{Buffer::m_zeroAreaSize}: size of zero area which extends before @code{m_initialStart}
@item @code{Buffer::m_start}: offset from start of buffer to area used by this buffer
@item @code{Buffer::m_size}: size of area used by this Buffer in its BufferData structure
@end itemize
@float Figure,fig:buffer
@caption{Implementation overview of a packet's byte Buffer.}
@image{figures/buffer,15cm}
@end float
This data structure is summarized in Figure @ref{fig:buffer}.
Each Buffer holds a pointer to an instance of a BufferData. Most
Buffers should be able to share the same underlying BufferData and
thus simply increase the BufferData's reference count. If they have to
change the content of a BufferData inside the Dirty Area, and if the
reference count is not one, they first create a copy of the BufferData and
then complete their state-changing operation.
@subsection Tags implementation
Tags are implemented by a single pointer which points to the start of a
linked list ofTagData data structures. Each TagData structure points
to the next TagData in the list (its next pointer contains zero to
indicate the end of the linked list). Each TagData contains an integer
unique id which identifies the type of the tag stored in the TagData.
@verbatim
struct TagData {
struct TagData *m_next;
uint32_t m_id;
uint32_t m_count;
uint8_t m_data[Tags::SIZE];
};
class Tags {
struct TagData *m_next;
};
@end verbatim
Adding a tag is a matter of inserting a new TagData at the head of
the linked list. Looking at a tag requires you to find the relevant
TagData in the linked list and copy its data into the user data
structure. Removing a tag and updating the content of a tag
requires a deep copy of the linked list before performing this operation.
On the other hand, copying a Packet and its tags is a matter of
copying the TagData head pointer and incrementing its reference count.
Tags are found by the unique mapping betweent the Tag type and
its underlying id. This is why at most one instance of any Tag
can be stored in a packet. The mapping between Tag type and
underlying id is performed by a registration as follows:
@verbatim
/* A sample Tag implementation
*/
struct MyTag {
uint16_t m_streamId;
};
@end verbatim
@emph{add description of TagRegistration for printing}
@subsection Memory management
@emph{Describe free list.}
@emph{Describe dataless vs. data-full packets.}
@subsection Copy-on-write semantics
The current implementation of the byte buffers and tag list is based
on COW (Copy On Write). An introduction to COW can be found in Scott
Meyer's "More Effective C++", items 17 and 29). This design feature
and aspects of the public interface borrows from the packet design
of the Georgia Tech Network Simulator.
This implementation of COW uses a customized reference counting
smart pointer class.
What COW means is that
copying packets without modifying them is very cheap (in terms of CPU
and memory usage) and modifying them can be also very cheap. What is
key for proper COW implementations is being
able to detect when a given modification of the state of a packet triggers
a full copy of the data prior to the modification: COW systems need
to detect when an operation is ``dirty'' and must therefore invoke
a true copy.
Dirty operations:
@itemize @bullet
@item Packet::RemoveTag()
@item Packet::Add()
@item both versions of ns3::Packet::AddAtEnd()
@end itemize
Non-dirty operations:
@itemize @bullet
@item Packet::AddTag()
@item Packet::RemoveAllTags()
@item Packet::PeekTag()
@item Packet::Peek()
@item Packet::Remove()
@item Packet::CreateFragment()
@item Packet::RemoveAtStart()
@item Packet::RemoveAtEnd()
@end itemize
Dirty operations will always be slower than non-dirty operations,
sometimes by several orders of magnitude. However, even the
dirty operations have been optimized for common use-cases which
means that most of the time, these operations will not trigger
data copies and will thus be still very fast.
+304
View File
@@ -0,0 +1,304 @@
@anchor{chap:rv}
@node Random variables
@chapter Random variables
ns-3 contains a built-in pseudo-random number generator (PRNG).
It is important for serious users of the simulator to understand
the functionality, configuration, and usage of this PRNG, and
to decide whether it is sufficient for his or her research use.
@node Quick Overview
@section Quick Overview
ns-3 random numbers are provided via instances of @code{class RandomVariable}.
@itemize @bullet
@item @strong{by default, ns-3 simulations use a random seed}; if there is any
randomness in the simulation, each run of the program will yield different results. To use a fixed seed, users must call
@code{RandomVariable::UseGlobalSeed ()} at the beginning of the program;
see section @xref{Seeding and independent replications}
@item each RandomVariable used in ns-3 has a virtual random number
generator associated with it; all random variables use either a fixed
or random seed based on the use of the global seed (previous bullet);
@item if you intend to perform multiple runs of the same scenario, with
different random numbers, please be sure to read the section on how to
perform independent replications: @xref{Seeding and independent replications}.
@end itemize
Read further for more explanation about the random number facility for
ns-3.
@node Background
@section Background
Simulations use a lot of random numbers; the study in [cite]
found that most network simulations spend as much as 50%
of the CPU generating random numbers. Simulation users need
to be concerned with the quality of the (pseudo) random numbers and
the independence between different streams of random numbers.
Users need to be concerned with a few issues, such as:
@itemize @bullet
@item the seeding of the random number generator and whether a
simulation run is deterministic or not,
@item how to acquire different streams of random numbers that are
independent from one another, and
@item how long it takes for streams to cycle
@end itemize
We will introduce a few terms here: a RNG provides a long sequence
of (pseudo) random numbers.
The length of this sequence is called the @emph{cycle length}
or @emph{period}, after which the RNG will repeat itself.
This sequence can
be partitioned into disjoint @emph{streams}. A stream of a
RNG is a contiguous subset or block of the RNG sequence.
For instance, if the
RNG period is of length N, and two streams are provided from this
RNG, then
the first stream might use the first N/2 values and the second
stream might produce the second N/2 values. An important property
here is that the two streams are uncorrelated. Likewise, each
stream can be partitioned disjointly to a number of
uncorrelated @emph{substreams}. The underlying RNG hopefully
produces a pseudo-random sequence of numbers with a very long
cycle length, and partitions this into streams and substreams in an
efficient manner.
ns-3 uses the same underlying random number generator as does
ns-2: the MRG32k3a generator from Pierre L'Ecuyer. A
detailed description can be found in
@uref{http://www.iro.umontreal.ca/~lecuyer/myftp/papers/streams00.pdf,,}.
The MRG32k3a generator provides 1.8x10^19 independent
streams of random numbers, each of which consists of
2.3x10^15 substreams. Each substream has a period
(@emph{i.e.}, the number of random numbers before overlap) of
7.6x10^22. The period of the entire generator is
3.1x10^57. Figure ref-streams provides a graphical idea of
how the streams and substreams fit together.
Class @code{ns3::RandomVariable} is the public interface to this
underlying random number generator. When users create new
RandomVariables (such as UniformVariable, ExponentialVariable,
etc.), they create an object that uses one of the distinct, independent
streams of the random number generator. Therefore, each
object of type RandomVariable has, conceptually, its own "virtual" RNG.
Furthermore, each RandomVariable can be configured to use
one of the set of substreams drawn from the main stream.
An alternate implementation would be to allow each RandomVariable
to have its own (differently seeded) RNG. However, we cannot
guarantee as strongly that the different sequences would be
uncorrelated in such a case; hence, we prefer to use a single RNG
and streams and substreams from it.
@anchor{chap:rv:indeprep}
@node Seeding and independent replications
@section Seeding and independent replications
ns-3 simulations can be configured to produce deterministic or
random results. If the ns-3 simulation is configured to use
a fixed, deterministic seed with the same run number, it should give
the same output each time it is run.
By default, ns-3 simulations use random seeds where the seeding
is drawn from @code{/dev/random} (if it is available) or else from
the time of day. A user who wants to fix the initial seeding
of the PRNG must call the following static method during simulation
configuration:
@verbatim
RandomVariable::UseGlobalSeed (uint32_t s0, s1, s2, s3, s4, s5);
@end verbatim
where the six parameters are each of type uint32_t.
A typical use case is to run a simulation as a sequence of independent
trials, so as to compute statistics on a large number of independent
runs. The user can either change the global seed and rerun the
simulation, or can advance the substream state of the RNG.
This seeding and substream state setting must be called before any
random variables are created; e.g.
@verbatim
RandomVariable::UseGlobalSeed(1,2,3,4,5,6);
int N = atol(argv[1]); //read in run number from command line
RandomVariable::SetRunNumber(N);
// Now, create random variables
UniformVariable x(0,10);
ExponentialVariable y(2902);
...
@end verbatim
Which is better, setting a new seed or advancing the substream state?
There is no guarantee that the streams
produced by two random seeds will not overlap. The only way to
guarantee that two streams do not overlap is to use the substream
capability provided by the RNG implementation.
@strong{Therefore, use the substream capability to produce
multiple independent runs of the same simulation.}
In other words, the more statistically rigorous way to configure
multiple independent replications is not to simply ignore the
seeding (and use /dev/random to seed the generator each time) but
instead to use a fixed seed and to iterate the run number.
This implementation allows for a maximum of
2.3x10^15 independent replications using the substreams.
@node class RandomVariable
@section class RandomVariable
All random variables should derive from @code{class RandomVariable}.
This base class provides a few static methods for globally configuring
the behavior of the random number generator. Derived classes
provide API for drawing random variates from the particular
distribution being supported.
Each RandomVariable created in the simulation is given a generator
that is a new RNGStream from the underlying PRNG.
Used in this manner, the L'Ecuyer implementation allows for a maximum of
1.8x10^19 random variables. Each random variable in
a single replication can produce up to 7.6x10^22 random
numbers before overlapping.
@node Base class public API
@section Base class public API
Below are excerpted a few public methods of @code{class RandomVariable}
that deal with the global configuration and state of the RNG.
@verbatim
/**
* \brief Set seeding behavior
*
* Specify whether the POSIX device /dev/random is to
* be used for seeding. When this is used, the underlying
* generator is seeded with data from /dev/random instead of
* being seeded based upon the time of day. Defaults to true.
*/
static void UseDevRandom(bool udr = true);
/**
* \brief Use the global seed to force precisely reproducible results.
*/
static void UseGlobalSeed(uint32_t s0, uint32_t s1, uint32_t s2,
uint32_t s3, uint32_t s4, uint32_t s5);
/**
* \brief Set the run number of this simulation
*/
static void SetRunNumber(uint32_t n);
/**
* \brief Get the internal state of the RNG
*
* This function is for power users who understand the inner workings
* of the underlying RngStream method used. It returns the internal
* state of the RNG via the input parameter.
* \param seed Output parameter; gets overwritten with the internal state
* of the RNG.
*/
void GetSeed(uint32_t seed[6]) const;
@end verbatim
We have already described the seeding configuration above.
@node Types of RandomVariables
@section Types of RandomVariables
The following types of random variables are provided, and are documented
in the ns-3 Doxygen or by reading @code{src/core/random-variable.h}. Users
can also create their own custom random variables by deriving from
class RandomVariable.
@itemize @bullet
@item @code{class UniformVariable }
@item @code{class ConstantVariable }
@item @code{class SequentialVariable }
@item @code{class ExponentialVariable }
@item @code{class ParetoVariable }
@item @code{class WeibullVariable }
@item @code{class NormalVariable }
@item @code{class EmpiricalVariable }
@item @code{class IntEmpiricalVariable }
@item @code{class DeterministicVariable }
@item @code{class LogNormalVariable }
@item @code{class TriangularVariable }
@end itemize
@node Semantics of RandomVariable objects
@section Semantics of RandomVariable objects
RandomVariable objects have value semantics. This means that they
can be passed by value to functions. The can also be passed by
reference to const. RandomVariables do not derive from
@code{ns3::Object} and we do not use smart pointers to manage them;
they are either allocated on the stack or else users explicitly manage
any heap-allocated RandomVariables.
RandomVariable objects can also be used in ns-3 attributes, which means
that values can be set for them through the ns-3 attribute system.
An example is in the propagation models for WifiNetDevice:
@verbatim
TypeId
RandomPropagationDelayModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::RandomPropagationDelayModel")
.SetParent<PropagationDelayModel> ()
.AddConstructor<RandomPropagationDelayModel> ()
.AddAttribute ("Variable",
"The random variable which generates random delays (s).",
RandomVariableValue (UniformVariable (0.0, 1.0)),
MakeRandomVariableAccessor (&RandomPropagationDelayModel::m_variable),
MakeRandomVariableChecker ())
;
return tid;
}
@end verbatim
Here, the ns-3 user can change the default random variable for this
delay model (which is a UniformVariable ranging from 0 to 1) through
the attribute system.
@node Using other PRNG
@section Using other PRNG
There is presently no support for substituting a different underlying
random number generator (e.g., the GNU Scientific Library or the Akaroa
package). Patches are welcome.
@node More advanced usage
@section More advanced usage
@emph{To be completed}
@node Publishing your results
@section Publishing your results
When you publish simulation results, a key piece of configuration
information that you should always state is how you used the
the random number generator.
@itemize @bullet
@item what seeds you used,
@item what RNG you used if not the default,
@item how were independent runs performed,
@item for large simulations, how did you check that you did not cycle.
@end itemize
It is incumbent on the researcher publishing results to include enough
information to allow others to reproduce his or her results. It is
also incumbent on the researcher to convince oneself that the random
numbers used were statistically valid, and to state in the paper why
such confidence is assumed.
@node Summary
@section Summary
Let's review what things you should do when creating a simulation.
@itemize @bullet
@item Decide whether you are running with a fixed seed or random seed;
a random seed is the default,
@item Decide how you are going to manage independent replications, if
applicable,
@item Convince yourself that you are not drawing more random values
than the cycle length, if you are running a long simulation, and
@item When you publish, follow the guidelines above about documenting your
use of the random number generator.
@end itemize
The program @emph{samples/main-random.cc} has some examples of usage.
+373
View File
@@ -0,0 +1,373 @@
@node Routing overview
@chapter Routing overview
This chapter describes the overall design of routing in the
@code{src/internet-stack}
module, and some details about the routing approachs currently
implemented.
@node Routing-Overview
@section Overview
We intend to support traditional routing approaches and protocols,
ports of open source routing implementations, and facilitate research
into unorthodox routing techniques.
For simulations that are not primarily focused on routing and that
simply want correct routing tables to occur somehow, we have an
global centralized routing capability. A singleton object
(GlobalRouteManager) be instantiated, builds a network map, and
populates a forwarding table on each node at time t=0 in the
simulation. Simulation script writers can use the same node
API to manually enter routes as well.
@node Support for multiple routing protocols
@section Support for multiple routing protocols
Typically, multiple routing protocols are supported in user space and
coordinate to write a single forwarding table in the kernel. Presently
in @command{ns-3}, the implementation instead allows for multiple routing
protocols to build/keep their own routing state, and the IPv4 implementation
will query each one of these routing protocols (in some order determined
by the simulation author) until a route is found.
We chose this approach because it may better
faciliate the integration of disparate routing approaches that may
be difficult to coordinate the writing to a single table, approaches
where more information than destination IP address (e.g., source
routing) is used to determine the next hop, and on-demand
routing approaches where packets must be cached.
There are presently two routing protocols defined:
@itemize @bullet
@item class Ipv4StaticRouting (covering both unicast and multicast)
@item Optimized Link State Routing (a MANET protocol defined in
@uref{http://www.ietf.org/rfc/rfc3626.txt,,RFC 3626})
@end itemize
but first we describe how multiple routing protocols are supported.
@subsection class Ipv4RoutingProtocol
@code{class Ipv4RoutingProtocol} derives from ns-3 Object which means
that it supports interface aggregation and reference counting. Routing
protocols should inherit from this class, defined in src/node/ipv4.cc.
The main function that must be supported by these protocols is called
@code{RequestRoute}.
@verbatim
* This method is called whenever a node's IPv4 forwarding engine
* needs to lookup a route for a given packet and IP header.
*
* The routing protocol implementation may determine immediately it
* should not be handling this particular the route request. For
* instance, a routing protocol may decline to search for routes for
* certain classes of addresses, like link-local. In this case,
* RequestRoute() should return false and the routeReply callback
* must not be invoked.
*
* If the routing protocol implementations assumes it can provide
* the requested route, then it should return true, and the
* routeReply callback must be invoked, either immediately before
* returning true (synchronously), or in the future (asynchronous).
* The routing protocol may use any information available in the IP
* header and packet as routing key, although most routing protocols
* use only the destination address (as given by
* ipHeader.GetDestination ()). The routing protocol is also
* allowed to add a new header to the packet, which will appear
* immediately after the IP header, although most routing do not
* insert any extra header.
*/
virtual bool RequestRoute (uint32_t ifIndex,
const Ipv4Header &ipHeader,
Ptr<Packet> packet,
RouteReplyCallback routeReply) = 0;
@end verbatim
This class also provides a typedef (used above) for a special Callback
that will pass to the callback function the Ipv4Route that is found (see the
Doxygen documentation):
@verbatim
typedef Callback<void, bool, const Ipv4Route&, Ptr<Packet>, const Ipv4Header&> RouteReplyCallback;
@end verbatim
@subsection Ipv4::AddRoutingProtocol
Class Ipv4 provides a pure virtual function declaration for the
method that allows one to add a routing protocol:
@verbatim
void AddRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol,
int16_t priority);
@end verbatim
This method is implemented by class Ipv4L3Protocol in the internet-stack
module.
The priority variable above governs the priority in which the routing
protocols are inserted. Notice that it is a signed int.
When the class Ipv4L3Protocol is instantiated, a single routing
protocol (Ipv4StaticRouting, introduced below) is added at priority
zero. Internally, a list of Ipv4RoutingProtocols is stored, and
and the routing protocols are each consulted in decreasing order
of priority to see whether a match is found. Therefore, if you
want your Ipv4RoutingProtocol to have priority lower than the static
routing, insert it with priority less than 0; e.g.:
@verbatim
m_ipv4->AddRoutingProtocol (m_routingTable, -10);
@end verbatim
@subsection Ipv4L3Protocol::Lookup
The main function for obtaining a route is shown below:
@verbatim
Ipv4L3Protocol::Lookup (
uint32_t ifIndex,
Ipv4Header const &ipHeader,
Ptr<Packet> packet,
Ipv4RoutingProtocol::RouteReplyCallback routeReply)
@end verbatim
This function will search the list of routing protocols, in priority order,
until a route is found. It will then invoke the RouteReplyCallback
and no further routing protocols will be searched. If the caller does
not want to constrain the possible interface, it can be wildcarded
as such:
@verbatim
Lookup (Ipv4RoutingProtocol::IF_INDEX_ANY, ipHeader, packet, routeReply);
@end verbatim
@node Roadmap and Future work
@section Roadmap and Future work
Some goals for future support are:
Users should be able to trace (either debug print, or redirect to a trace
file) the routing table in a format such as used in an
Unix implementation:
@verbatim
# netstat -nr (or # route -n)
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
127.0.0.1 * 255.255.255.255 UH 0 0 0 lo
172.16.1.0 * 255.255.255.0 U 0 0 0 eth0
172.16.2.0 172.16.1.1 255.255.255.0 UG 0 0 0 eth0
# ip route show
192.168.99.0/24 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.99.254 dev eth0
@end verbatim
Global computation of multicast routing should be implemented as well.
This would ignore group membership and ensure that a copy of every
sourced multicast datagram would be delivered to each node.
This might be implemented as an RPF mechanism that functioned on-demand
by querying the forwarding table,
and perhaps optimized by a small multicast forwarding cache. It is
a bit trickier to implement over wireless links where the input
interface is the same as the output interface; other aspects of the
packet must be considered and the forwarding logic slightly changed
to allow for forwarding out the same interface.
In the future, work on bringing XORP or quagga routing to ns, but it will
take several months to port and enable.
There are presently no roadmap plans for IPv6.
@node Static routing
@section Static routing
The internet-stack module provides one routing protocol (Ipv4StaticRouting)
by default. This routing protocol allows one to add unicast or multicast
static routes to a node.
@node Unicast routing
@section Unicast routing
The unicast static routing API may be accessed via the functions
@verbatim
void Ipv4::AddHostRouteTo ()
void Ipv4::AddNetworkRouteTo ()
void Ipv4::SetDefaultRoute ()
uint32_t Ipv4::GetNRoutes ()
Ipv4Route Ipv4::GetRoute ()
@end verbatim
@uref{http://www.nsnam.org/doxygen/index.html,,Doxygen} documentation
provides full documentation of these methods. These methods are forwarding
functions to the actual implementation in Ipv4StaticRouting, when using
the internet-stack module.
@node Multicast routing
@section Multicast routing
The following function is used to add a static multicast route
to a node:
@verbatim
void
Ipv4StaticRouting::AddMulticastRoute (Ipv4Address origin,
Ipv4Address group,
uint32_t inputInterface,
std::vector<uint32_t> outputInterfaces);
@end verbatim
A multicast route must specify an origin IP address, a multicast group and
an input network interface index as conditions and provide a vector of
output network interface indices over which packets matching the conditions
are sent.
Typically there are two main types of multicast routes: routes of the
first kind are used during forwarding. All of the conditions must be
exlicitly provided. The second kind of routes are used to get packets off
of a local node. The difference is in the input interface. Routes for
forwarding will always have an explicit input interface specified. Routes
off of a node will always set the input interface to a wildcard specified
by the index Ipv4RoutingProtocol::IF\_INDEX\_ANY.
For routes off of a local node wildcards may be used in the origin and
multicast group addresses. The wildcard used for Ipv4Adresses is that
address returned by Ipv4Address::GetAny () -- typically "0.0.0.0". Usage
of a wildcard allows one to specify default behavior to varying degrees.
For example, making the origin address a wildcard, but leaving the
multicast group specific allows one (in the case of a node with multiple
interfaces) to create different routes using different output interfaces
for each multicast group.
If the origin and multicast addresses are made wildcards, you have created
essentially a default multicast address that can forward to multiple
interfaces. Compare this to the actual default multicast address that is
limited to specifying a single output interface for compatibility with
existing functionality in other systems.
Another command sets the default multicast route:
@verbatim
void
Ipv4StaticRouting::SetDefaultMulticastRoute (uint32_t outputInterface);
@end verbatim
This is the multicast equivalent of the unicast version SetDefaultRoute.
We tell the routing system what to do in the case where a specific route
to a destination multicast group is not found. The system forwards
packets out the specified interface in the hope that "something out there"
knows better how to route the packet. This method is only used in
initially sending packets off of a host. The default multicast route is
not consulted during forwarding -- exact routes must be specified using
AddMulticastRoute for that case.
Since we're basically sending packets to some entity we think may know
better what to do, we don't pay attention to "subtleties" like origin
address, nor do we worry about forwarding out multiple interfaces. If the
default multicast route is set, it is returned as the selected route from
LookupStatic irrespective of origin or multicast group if another specific
route is not found.
Finally, a number of additional functions are provided to fetch and
remove multicast routes:
@verbatim
uint32_t GetNMulticastRoutes (void) const;
Ipv4MulticastRoute *GetMulticastRoute (uint32_t i) const;
Ipv4MulticastRoute *GetDefaultMulticastRoute (void) const;
bool RemoveMulticastRoute (Ipv4Address origin,
Ipv4Address group,
uint32_t inputInterface);
void RemoveMulticastRoute (uint32_t index);
@end verbatim
@node Global centralized routing
@section Global centralized routing
Presently, global centralized IPv4 @emph{unicast} routing over both
point-to-point and shared (CSMA) links is supported.
The global centralized routing will be modified in the future to
reduce computations once profiling finds the performance bottlenecks.
@node Global Unicast Routing API
@section Global Unicast Routing API
The public API is very minimal. User scripts include the following:
@verbatim
#include "ns3/global-route-manager.h"
@end verbatim
After IP addresses are configured, the following function call will
cause all of the nodes that have an Ipv4 interface to receive
forwarding tables entered automatically by the GlobalRouteManager:
@verbatim
GlobalRouteManager::PopulateRoutingTables ();
@end verbatim
@emph{Note:} A reminder that the wifi NetDevice is not yet supported
(only CSMA and PointToPoint).
@node Global Routing Implementation
@section Global Routing Implementation
A singleton object (GlobalRouteManager) is responsible for populating
the static routes on each node, using the public Ipv4 API of that node.
It queries each node in the topology for a "globalRouter" interface.
If found, it uses the API of that interface to obtain a "link state
advertisement (LSA)" for the router. Link State Advertisements
are used in OSPF routing, and we follow their formatting.
The GlobalRouteManager populates a link state database with LSAs
gathered from the entire topology. Then, for each router in the topology,
the GlobalRouteManager executes the OSPF shortest path first (SPF)
computation on the database, and populates the routing tables on each
node.
The quagga (http://www.quagga.net) OSPF implementation was used as the
basis for the routing computation logic.
One benefit of following an existing OSPF SPF implementation is that
OSPF already has defined link state advertisements for all common
types of network links:
@itemize @bullet
@item point-to-point (serial links)
@item point-to-multipoint (Frame Relay, ad hoc wireless)
@item non-broadcast multiple access (ATM)
@item broadcast (Ethernet)
@end itemize
Therefore, we think that enabling these other link types will be more
straightforward now that the underlying OSPF SPF framework is in place.
Presently, we can handle IPv4 point-to-point, numbered links, as well
as shared broadcast (CSMA) links, and we do not do equal-cost multipath.
The GlobalRouteManager first walks the list of nodes and aggregates
a GlobalRouter interface to each one as follows:
@verbatim
typedef std::vector < Ptr<Node> >::iterator Iterator;
for (Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
{
Ptr<Node> node = *i;
Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> (node);
node->AggregateObject (globalRouter);
}
@end verbatim
This interface is later queried and used to generate a Link State
Advertisement for each router, and this link state database is
fed into the OSPF shortest path computation logic. The Ipv4 API
is finally used to populate the routes themselves.
@node Optimized Link State Routing (OLSR)
@section Optimized Link State Routing (OLSR)
This is the first dynamic routing protocol for @command{ns-3}. The implementation
is found in the src/routing/olsr directory, and an example script is in
examples/simple-point-to-point-olsr.cc.
The following commands will enable OLSR in a simulation.
@verbatim
olsr::EnableAllNodes (); // Start OLSR on all nodes
olsr::EnableNodes(InputIterator begin, InputIterator end); // Start on
// a list of nodes
olsr::EnableNode (Ptr<Node> node); // Start OLSR on "node" only
@end verbatim
Once instantiated, the agent can be started with the Start() command,
and the OLSR "main interface" can be set with the SetMainInterface()
command. A number of protocol constants are defined in olsr-agent-impl.cc.
+243
View File
@@ -0,0 +1,243 @@
@node Sockets APIs
@chapter Sockets APIs
The @uref{http://en.wikipedia.org/wiki/Berkeley_sockets,,sockets API}
is a long-standing API used by user-space applications to access
network services in the kernel. A ``socket'' is an abstraction, like
a Unix file handle, that allows applications to connect to other
Internet hosts and exchange reliable byte streams and unreliable
datagrams, among other services.
ns-3 provides two types of sockets APIs, and it is important to
understand the differences between them. The first is a @emph{native}
ns-3 API, while the second uses the services of the native API to
provide a @uref{http://en.wikipedia.org/wiki/POSIX,,POSIX-like}
API as part of an overall application process. Both APIs strive
to be close to the typical sockets API that application writers
on Unix systems are accustomed to, but the POSIX variant is much
closer to a real system's sockets API.
@section ns-3 sockets API
The native sockets API for ns-3 provides an interface to various
types of transport protocols (TCP, UDP) as well as to packet sockets
and, in the future, Netlink-like sockets. However, users are cautioned
to understand that the semantics are @strong{not} the exact same as
one finds in a real system (for an API which is very much aligned
to real systems, see the next section).
@code{class ns3::Socket} is defined in @code{src/node/socket.cc,h}.
Readers will note that many public member functions are aligned
with real sockets function calls, and all other things being equal,
we have tried to align with a Posix sockets API. However, note that:
@itemize @bullet
@item ns-3 applications handle a smart pointer to a Socket object, not
a file descriptor;
@item there is no notion of synchronous API or a ``blocking'' API;
in fact, the model for interaction between application and socket is
one of asynchronous I/O, which is not typically found in real systems
(more on this below);
@item the C-style socket address structures are not used;
@item the API is not a complete sockets API, such as supporting
all socket options or all function variants;
@item many calls use @code{ns3::Packet} class to transfer data
between application and socket. This may seem a little funny to
people to pass ``Packets'' across a stream socket API, but think
of these packets as just fancy byte buffers at this level (more
on this also below).
@end itemize
@subsection Basic operation and calls
@float Figure,fig:sockets-overview
@caption{Implementation overview of native sockets API}
@image{figures/sockets-overview, 10cm}
@end float
@subsubsection Creating sockets
An application that wants to use sockets must first create one.
On real systems, this is accomplished by calling socket():
@verbatim
int
socket(int domain, int type, int protocol);
@end verbatim
which creates a socket in the system and returns an integer descriptor.
In ns-3, we have no equivalent of a system call at the lower layers,
so we adopt the following model. There are certain @emph{factory}
objects that can create sockets. Each factory is capable of creating
one type of socket, and if sockets of a particular type are able to
be created on a given node, then a factory that can create such sockets
must be aggregated to the Node.
@verbatim
static Ptr<Socket> CreateSocket (Ptr<Node> node, TypeId tid);
@end verbatim
Examples of TypeIds to pass to this method are @code{TcpSocketFactory},
@code{PacketSocketFactory}, and @code{UdpSocketFactory}.
This method returns a smart pointer to a Socket object. Here is an
example:
@verbatim
Ptr<Node> n0;
// Do some stuff to build up the Node's internet stack
Ptr<Socket> localSocket = Socket::CreateSocket (n0, TcpSocketFactory::GetTypeId ());
@end verbatim
In some ns-3 code, sockets will not be explicitly created by user's
main programs, if an ns-3 application does it. For instance, for
@code{class ns3::OnOffApplication}, the function @code{StartApplication()}
performs the socket creation, and the application holds the socket
pointer.
@subsubsection Using sockets
Below is a typical sequence of socket calls for a TCP client in a
real implementation:
@itemize @bullet
@item @code{sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);}
@item @code{bind(sock, ...);}
@item @code{connect(sock, ...);}
@item @code{send(sock, ...);}
@item @code{recv(sock, ...);}
@item @code{close(sock);}
@end itemize
There are analogs to all of these calls in ns-3, but we will focus on
two aspects here. First, most usage of sockets in real systems
requires a way to manage I/O between the application and kernel.
These models include @emph{blocking sockets}, @emph{signal-based I/O},
and @emph{non-blocking sockets} with polling. In ns-3, we make use
of the callback mechanisms to support a fourth mode, which is
analogous to POSIX @emph{asynchronous I/O}.
In this model, on the sending side, if the @code{send()} call were to
fail because of insufficient buffers, the application suspends the
sending of more data until a function registered at the
@code{SetSendCallback()} callback is invoked. An application can
also ask the socket how much space is available by calling
@code{GetTxAvailable ()}. A typical sequence of events for
sending data (ignoring connection setup) might be:
@itemize @bullet
@item @code{SetSendCallback (MakeCallback(&HandleSendCallback));}
@item @code{Send ();}
@item @code{Send ();}
@item ...
@item @code{// Send fails because buffer is full}
@item (wait until HandleSendCallback() is called)
@item (HandleSendCallback() is called by socket, since space now available)
@item @code{Send (); // Start sending again}
@end itemize
Similarly, on the receive side, the socket user does not block on
a call to @code{recv()}. Instead, the application sets a callback
with @code{SetRecvCallback ()} in which the socket will notify the
application when (and how much) there is data to be read, and
the application then calls @code{Recv()} to read the data until
no more can be read.
@subsection Packet vs. buffer variants
There are two basic variants of @code{Send()} and @code{Recv()} supported:
@verbatim
virtual int Send (Ptr<Packet> p) = 0;
int Send (const uint8_t* buf, uint32_t size);
Ptr<Packet> Recv (void);
int Recv (uint8_t* buf, uint32_t size);
@end verbatim
The non-Packet variants are left for legacy API reasons. When calling
the raw buffer variant of @code{Send()}, the buffer is immediately
written into a Packet and the @code{Send (Ptr<Packet> p)} is invoked.
Users may find it semantically odd to pass a Packet to a stream socket
such as TCP. However, do not let the name bother you; think of
@code{ns3::Packet} to be a fancy byte buffer. There are a few reasons why
the Packet variants are more likely to be preferred in ns-3:
@itemize @bullet
@item Users can use the Tags facility of packets to, for example, encode
a flow ID or other helper data.
@item Users can exploit the copy-on-write implementation to avoid
memory copies (on the receive side, the conversion back to a
@code{uint8_t* buf} may sometimes incur an additional copy).
@item Use of Packet is more aligned with the rest of the ns-3 API
@end itemize
@subsection Sending dummy data
Sometimes, users want the simulator to just pretend that there is an
actual data payload in the packet (e.g. to calculate transmission delay)
but do not want to actually produce or consume the data. This is
straightforward to support in ns-3; have applications call
@code{Create<Packet> (size);} instead of @code{Create<Packet> (buffer, size);}.
Similarly, passing in a zero to the pointer argument in the raw buffer
variants has the same effect. Note that, if some subsequent code tries
to read the Packet data buffer, the fake buffer will be converted to
a real (zero'ed) buffer on the spot, and the efficiency will be lost there.
@subsection Socket options
@emph{to be completed}
@subsection Socket errno
@emph{to be completed}
@subsection Example programs
@emph{to be completed}
@section POSIX-like sockets API
@emph{this capability is under development and is scheduled for
inclusion in August 2008 timeframe; see the repository
http://code.nsnam.org/mathieu/ns-3-simu for details}
The below is excerpted from Mathieu's post to ns-developers list
on April 4, 2008.
"To summarize, the goal is that the full posix/socket API is defined in
src/process/simu.h: each posix type and function is re-defined there
with a simu_ or SIMU_ prefix to avoid ugly name clashes and collisions
(feel free to come up with a better prefix).
Each process is created with a call to ProcessManager::Create and is
attached to that ProcessManager instance. So, if the ProcessManager
(which is aggregated to a Node in src/helper/process-helper.cc) is
killed when the simulation ends, the system will automatically reclaim
all the resources of each process associated to each manager. The same
happens when an application "exits" from its main function.
The example application defines two posix "processes": the function
ClientProgram creates a udp socket on the localhost port 2000 and the
function ServerProgram creates a udp socket on the localhost port 2000.
The code does not work right now because I did not get the details of
simu_read right yet but, I do plan to make this work at some point.
I really think that this approach is worthwhile for many reasons, a few
of which are outlined below:
@itemize @bullet
@item makes porting real world application code _much_ easier
@item makes write applications for new users much easier because they can
read the bsd socket api reference and documentation and write code
directly.
@item can be used to write applications which work in both simulation and
in the real world at the same time. To do this, all you have to do is
write your application to use the simu_ API, and, then, you can chose at
compile-time which implementation of that API you want to use: you can
pick one implementation which forwards all calls to the system BSD
socket API or another one which forwards all calls to the attached
ProcessManager. Arguably, I did not implement the version which forwards
to system BSD sockets but, that should be pretty trivial.
@end itemize
So, anyway, comments about the overall API would be welcome. Students
interested in the gsoc project for real-world code integration should
consider looking at this also."
+9
View File
@@ -0,0 +1,9 @@
@node Statistics
@chapter Statistics
@anchor{chap:Statistics}
ns-3 does not presently have support for statistics (automatically generated
statistical output). This is planned
for development later in 2008. If you are interested in contributing,
please see @uref{http://www.nsnam.org/wiki/index.php/Suggested_Projects,,our suggested projects page} or contact the ns-developers
list.
+82
View File
@@ -0,0 +1,82 @@
@node Troubleshooting
@chapter Troubleshooting
This chapter posts some information about possibly common errors in building
or running ns-3 programs.
Please note that the wiki (@uref{http://www.nsnam.org/wiki/index.php/Troubleshooting}) may have contributed items.
@node Build errors
@section Build errors
@node Run-time errors
@section Run-time errors
Sometimes, errors can occur with a program after a successful build. These
are run-time errors, and can commonly occur when memory is corrupted or
pointer values are unexpectedly null.
Here is an example of what might occur:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
Command ['/home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point'] exited with code -11
@end verbatim
The error message says that the program terminated unsuccessfully, but it is
not clear from this information what might be wrong. To examine more
closely, try running it under the @uref{http://sources.redhat.com/gdb/,,gdb debugger}:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="gdb %s"
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
GNU gdb Red Hat Linux (6.3.0.0-1.134.fc5rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xf5c000
Program received signal SIGSEGV, Segmentation fault.
0x0804aa12 in main (argc=1, argv=0xbfdfefa4)
at ../examples/tcp-point-to-point.cc:136
136 Ptr<Socket> localSocket = socketFactory->CreateSocket ();
(gdb) p localSocket
$1 = {m_ptr = 0x3c5d65}
(gdb) p socketFactory
$2 = {m_ptr = 0x0}
(gdb) quit
The program is running. Exit anyway? (y or n) y
@end verbatim
Note first the way the program was invoked-- pass the command to run as
an argument to the command template "gdb %s".
This tells us that there was an attempt to dereference a null pointer
socketFactory.
Let's look around line 136 of tcp-point-to-point, as gdb suggests:
@verbatim
Ptr<SocketFactory> socketFactory = n2->GetObject<SocketFactory> (Tcp::iid);
Ptr<Socket> localSocket = socketFactory->CreateSocket ();
localSocket->Bind ();
@end verbatim
The culprit here is that the return value of GetObject is not being
checked and may be null.
Sometimes you may need to use the @uref{http://valgrind.org,,valgrind memory
checker} for more subtle errors. Again, you invoke the use of valgrind
similarly:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="valgrind %s"
@end verbatim
+64
View File
@@ -0,0 +1,64 @@
/**
* @anchor modules_anchor
*
* @defgroup simulator Simulator
* The "simulator" module contains:
* - a time management class to hold a time and convert between various time units: ns3::Time
* - a scheduler base class used to implement new simulation event schedulers:
* ns3::Scheduler and ns3::SchedulerFactory
* - a simulator class used to create, schedule and cancel events: ns3::Simulator
*
* @defgroup core Core
* \brief The "core" module contains:
* - a Functor class: ns3::Callback
* - an os-independent interface to get access to the elapsed wall clock time: ns3::SystemWallClockMs
* - a class to register regression tests with the test manager: ns3::Test and ns3::TestManager
* - debugging facilities: \ref logging, \ref assert
* - \ref randomvariable
* - a base class for objects which need to support per-instance "attributes" and
* trace sources: ns3::ObjectBase
* - a base class for objects which need to support reference counting
* and dynamic object aggregation: ns3::Object
* - a smart-pointer class ns3::Ptr designed to work together with ns3::Object
* - a configuration class used to set and control all attributes and trace sources
* in a simulation: ns3::Config.
*
* @defgroup common Common
* The "common" module contains:
* - a packet class to create and manipulate simulation packets:
* ns3::Packet, ns3::Header, and ns3::Trailer. This packet class
* also supports per-packet ns3::Tag which are globs of data
* which can be attached to any packet.
*
* @defgroup node Node
* The "node" module contains:
* - a ns3::Node base class which should be subclassed by any new type of
* network Node.
* - models which abstract the MAC-layer from the IP layer protocols:
* ns3::NetDevice and ns3::Channel.
* - models which abstract the application-layer API: ns3::Application,
* ns3::Socket, ns3::SocketFactory, and, ns3::Udp
*
*
* @defgroup devices Devices
*
* @defgroup internetStack InternetStack
*
* The "internet-stack" module contains:
* - an Ipv4 stack
* - an ARP module
* - a UDP and a TCP implementation
*
* @defgroup helper Helpers
*
* @defgroup applications Applications
*
* @defgroup mobility Mobility
*
* @defgroup routing Routing
*
* @defgroup constants Constants
* @brief Constants you can change
*
* @defgroup contrib Contrib
*/
+1658
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

+71 -13
View File
@@ -1,19 +1,77 @@
Steps in doing an ns-3 release
1. prepare the source files
1. check out a clean ns-3-dev somewhere
2. prepare the source files
- revise and check in AUTHORS, if needed
- revise and check in RELEASE_NOTES
- update and check in VERSION to the latest release number
2. make a new "architecture.pdf" document and place it in the doc/ directory
3. scons dist
4. test tarball on release platforms (run-tests and simple-p2p)
5. tag ns-3-dev with "release ns-3.0.X"
6. clone the ns-3-dev and place it on the repository
7. upload "ns-3.0.x.tar.gz" to the releases/ directory on the server
8. update web page
- DO NOT change VERSION at this time
- confirm that Doxygen builds cleanly and without warnings
(./waf check; ./waf --doxygen), and check in any necessary changes
- ensure no regressions (./waf --regression)
3. ./waf configure; ./waf dist
- this will create an ns-3-dev.tar.bz2 tarball
- this will also create a ns-3-dev-ref-traces.tar.bz2 tarball
4. test dev tarball on release platforms (waf check and maybe some other
scripts)
5. once you are happy with the tarball, tag ns-3-dev and ns-3-dev-ref-traces
- hg tag "release ns-3.1x"
- hg push
- cd into regression/ns-3-dev-ref-traces
- hg tag "release ns-3.1x"
- hg push
6. clone the tagged ns-3-dev and place it on the repository
- ssh code.nsnam.org; sudo tcsh; su code;
- cp -r /home/code/repos/ns-3-dev /home/code/repos/ns-3.1x
- cd /home/code/repos/ns-3.1x/.hg and edit the hgrc appropriately:
"description = ns-3.1x release
name = ns-3.1x"
- clone the ns-3-dev-ref-traces and place it on the repository as above
but use the name ns-3.1x-ref-traces and edit the hgrc appropriately
7. check out a clean version of the new release (ns-3.1x) somewhere
8. Update the VERSION for this new release
- change the string 3-dev in the VERSION file to the real version
(e.g. 3.1) This must agree with the version name you chose in the clone
for the regression tests to work.
- hg commit
- hg push
9. Run the regression tests on the new release (debug and optimized)
- ./waf -d debug configure
- ./waf
- ./waf --regression
- ./waf --valgrind --regression (for valgrind version)
- ./waf -d optimized configure
- ./waf
- ./waf --regression
- ./waf --valgrind --regression (for valgrind version)
- There should be no regression errors at this time
10. Create final tarballs
- ./waf configure; ./waf dist
- this will create an ns-3.1x.tar.bz2 tarball
- this will also create a ns-3.1x-ref-traces.tar.bz2 tarball
11. upload "ns-3.1x.tar.bz2" to the /var/www/html/releases/ directory on
the www.nsnam.org server
- give it 644 file permissions, and user/group = apache
12. upload "ns-3.1x-ref-traces.tar.bz2" to the /var/www/html/releases/
directory on the www.nsnam.org server
- give it 644 file permissions, and user/group = apache
13. update web pages on www.nsnam.org (source is in the www/ module)
- clone the source repo (hg clone http://code.nsnam.org/www)
- add link to news.html
- update download.html
- update roadmap.html
- update getting_started.html
- update documents.html
- update roadmap on wiki
- commit and push changes
- build and update HTML directory on the server
-- ssh www.nsnam.org; sudo tcsh; su nsnam;
-- run ~/bin/update-html
- build and update Doxygen directory on the server
- update and upload software architecture document (PDF, HTML)
9. announce to ns-developers, with summary of release notes
-- edit ~/bin/update-doxygen-release file and change RELEASE variable
to the right version number
-- run ~/bin/update-doxygen-release
14. Final checks
- download tarball from web, build and run regression tests for as many
targets as you can
- download release from mercurial, build and run regression tests for as
many targets as you can
- test and verify until you're confident the release is solid.
15. announce to ns-developers, with summary of release notes
+49
View File
@@ -0,0 +1,49 @@
TEXI2HTML = texi2html
TEXI2PDF = texi2dvi --pdf
EPSTOPDF = epstopdf
TGIF = tgif
DIA = dia
CONVERT = convert
CSS = --css-include=tutorial.css
SPLIT = --split section
DIA_SOURCES = pp.dia dumbbell.dia star.dia
TGIF_SOURCES = helpers.obj
DIA_EPS = ${DIA_SOURCES:.dia=.eps}
DIA_PNG = ${DIA_SOURCES:.dia=.png}
DIA_PDF = ${DIA_SOURCES:.dia=.pdf}
TGIF_EPS = ${TGIF_SOURCES:.obj=.eps}
TGIF_PNG = ${TGIF_SOURCES:.obj=.png}
TGIF_PDF = ${TGIF_SOURCES:.obj=.pdf}
all: images html split-html pdf
# Note: tgif requires a valid x display to convert from .obj to .png.
# If running this makefile on a remote console, the X virtual frame
# buffer may be needed (xorg-x11-server-Xvfb) to provide a "fake"
# display
images:
cd figures/; $(DIA) -t png $(DIA_SOURCES)
cd figures/; $(DIA) -t eps $(DIA_SOURCES)
cd figures/; $(foreach FILE,$(DIA_EPS),$(EPSTOPDF) $(FILE);)
cd figures/; $(TGIF) -print -png $(TGIF_SOURCES)
cd figures/; $(TGIF) -print -eps $(TGIF_SOURCES)
cd figures/; $(foreach FILE,$(TGIF_EPS),$(EPSTOPDF) $(FILE);)
html: images
$(TEXI2HTML) ${CSS} tutorial.texi
split-html: images
$(TEXI2HTML) ${CSS} ${SPLIT} tutorial.texi
pdf: images
$(TEXI2PDF) tutorial.texi
figures-clean:
cd figures/; rm -rf $(DIA_EPS); rm -rf $(DIA_PNG); rm -rf $(DIA_PDF)
cd figures/; rm -rf $(TGIF_EPS); rm -rf $(TGIF_PNG); rm -rf $(TGIF_PDF)
clean: figures-clean
rm -rf tutorial.aux tutorial.cp tutorial.cps tutorial.fn tutorial.ky tutorial.pg tutorial.tp tutorial.vr tutorial.toc tutorial.log tutorial.pdf tutorial.html tutorial/
+535
View File
@@ -0,0 +1,535 @@
@node ns-3 Attributes
@chapter ns-3 Attributes
@anchor{chap:Attributes}
In ns-3 simulations, there are two main aspects to configuration:
@itemize @bullet
@item the simulation topology and how objects are connected
@item the values used by the models instantiated in the topology
@end itemize
This chapter focuses on the second item above: how the many values
in use in ns-3 are organized, documented, and modifiable by ns-3 users.
The ns-3 attribute system is also the underpinning of how traces
and statistics are gathered in the simulator.
Before delving into details of the attribute value system,
it will help to review some basic properties of @code{class ns3::Object}.
@node Object Overview
@section Object Overview
ns-3 is fundamentally a C++ object-based system. By this we mean that
new C++ classes (types) can be declared, defined, and subclassed
as usual.
Many ns-3 objects inherit from the @code{ns3::Object} base class. These
objects have some additional properties that we exploit for
organizing the system and improving the memory management
of our objects:
@itemize @bullet
@item a "metadata" system that links the class name to a lot of
meta-information about the object, including the base class of the subclass,
the set of accessible constructors in the subclass, and the set of
"attributes" of the subclass
@item a reference counting smart pointer implementation, for memory
management.
@end itemize
ns-3 objects that use the attribute system derive from either
@code{ns3::Object} or @code{ns3::ObjectBase}. Most ns-3 objects
we will discuss derive from @code{ns3::Object}, but a few that
are outside the smart pointer memory management framework derive
from @code{ns3::ObjectBase}.
Let's review a couple of properties of these objects.
@node Smart pointers
@subsection Smart pointers
As introduced above in @ref{Smart Pointers 101}, ns-3 objects
are memory managed by a
@uref{http://en.wikipedia.org/wiki/Smart_pointer,,reference counting smart pointer implementation}, @code{class ns3::Ptr}.
Smart pointers are used extensively in the ns-3 APIs, to avoid passing
references to heap-allocated objects that may cause memory leaks.
For most basic usage (syntax), treat a smart pointer like a regular pointer:
@verbatim
Ptr<WifiNetDevice> nd = ...;
nd->CallSomeFunction ();
// etc.
@end verbatim
@node CreateObject
@subsection CreateObject
As we discussed above in @ref{Object Creation},
at the lowest-level API, objects of type @code{ns3::Object} are
not instantiated using @code{operator new} as usual but instead by
a templated function called @code{CreateObject()}.
A typical way to create such an object is as follows:
@verbatim
Ptr<WifiNetDevice> nd = CreateObject<WifiNetDevice> ();
@end verbatim
You can think of this as being functionally equivalent to:
@verbatim
WifiNetDevice* nd = new WifiNetDevice ();
@end verbatim
Objects that derive from @code{ns3::Object} must be allocated
on the heap using CreateObject(). Those deriving from
@code{ns3::ObjectBase}, such as ns-3 helper functions and packet
headers and trailers, can be allocated on the stack.
In some scripts, you may not see a lot of CreateObject() calls
in the code;
this is because there are some helper objects in effect that
are doing the CreateObject()s for you.
@node TypeId
@subsection TypeId
ns-3 classes that derive from class ns3::Object can include
a metadata class called @code{TypeId} that records meta-information
about the class, for use in the object aggregation and component
manager systems:
@itemize @bullet
@item a unique string identifying the class
@item the base class of the subclass, within the metadata system
@item the set of accessible constructors in the subclass
@end itemize
@node Object Summary
@subsection Object Summary
Putting all of these concepts together, let's look at a specific
example: @code{class ns3::Node}.
The public header file node.h has a declaration that includes
a static GetTypeId function call:
@verbatim
class Node : public Object
{
public:
static TypeId GetTypeId (void);
...
@end verbatim
This is defined in the node.cc file as follows:
@verbatim
TypeId
Node::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Node")
.SetParent<Object> ()
return tid;
}
@end verbatim
Finally, when users want to create Nodes, they call:
@verbatim
Ptr<Node> n = CreateObject<Node> n;
@end verbatim
We next discuss how attributes (values associated with member variables
or functions of the class) are plumbed into the above TypeId.
@node Attribute Overview
@section Attribute Overview
The goal of the attribute system is to organize the access of
internal member objects of a simulation. This goal arises because,
typically in simulation, users will cut and paste/modify existing
simulation scripts, or will use higher-level simulation constructs,
but often will be interested in studying or tracing particular
internal variables. For instance, use cases such as:
@itemize @bullet
@item "I want to trace the packets on the wireless interface only on
the first access point"
@item "I want to trace the value of the TCP congestion window (every
time it changes) on a particular TCP socket"
@item "I want a dump of all values that were used in my simulation."
@end itemize
Similarly, users may want fine-grained access to internal
variables in the simulation, or may want to broadly change the
initial value used for a particular parameter in all subsequently
created objects. Finally, users may wish to know what variables
are settable and retrievable in a simulation configuration. This
is not just for direct simulation interaction on the command line;
consider also a (future) graphical user interface
that would like to be able to provide a feature whereby a user
might right-click on an node on the canvas and see a hierarchical,
organized list of parameters that are settable on the node and its
constituent member objects, and help text and default values for
each parameter.
@node Functional overview
@subsection Functional overview
We provide a way for users to access values deep in the system, without
having to plumb accessors (pointers) through the system and walk
pointer chains to get to them. Consider a class DropTailQueue that
has a member variable that is an unsigned integer @code{m_maxPackets};
this member variable controls the depth of the queue.
If we look at the declaration of DropTailQueue, we see the following:
@verbatim
class DropTailQueue : public Queue {
public:
static TypeId GetTypeId (void);
...
private:
std::queue<Ptr<Packet> > m_packets;
uint32_t m_maxPackets;
};
@end verbatim
Let's consider things that a user may want to do with the value of
m_maxPackets:
@itemize @bullet
@item Set a default value for the system, such that whenever a new
DropTailQueue is created, this member is initialized to that default.
@item Set or get the value on an already instantiated queue.
@end itemize
The above things typically require providing Set() and Get() functions,
and some type of global default value.
In the ns-3 attribute system, these value definitions and accessor
functions are moved into the TypeId class; e.g.:
@verbatim
TypeId DropTailQueue::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::DropTailQueue")
.SetParent<Queue> ()
.AddConstructor<DropTailQueue> ()
.AddAttribute ("MaxPackets", "The maximum number of packets accepted by this DropTailQueue.",
Uinteger (100),
MakeUintegerAccessor (&DropTailQueue::m_maxPackets),
MakeUintegerChecker<uint32_t> ())
;
return tid;
}
@end verbatim
The AddAttribute() method is performing a number of things with this
value:
@itemize @bullet
@item Binding the variable m_maxPackets to a string "MaxPackets"
@item Providing a default value (100 packets)
@item Providing some help text defining the value
@item Providing a "checker" (not used in this example) that can be used to set
bounds on the allowable range of values
@end itemize
The key point is that now the value of this variable and its default
value are accessible in the attribute namespace, which is based on
strings such as "MaxPackets" and TypeId strings. In the next
section, we will provide an example script that shows how users
may manipulate these values.
@node Basic usage
@subsection Basic usage
Let's look at how a user script might access these values.
This is based on the script found at @code{samples/main-attribute-value.cc},
with some details stripped out.
@verbatim
//
// This is a basic example of how to use the attribute system to
// set and get a value in the underlying system; namely, an unsigned
// integer of the maximum number of packets in a queue
//
int
main (int argc, char *argv[])
{
// By default, the MaxPackets attribute has a value of 100 packets
// (this default can be observed in the function DropTailQueue::GetTypeId)
//
// Here, we set it to 80 packets. We could use one of two value types:
// a string-based value or a Uinteger value
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", String ("80"));
// The below function call is redundant
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", Uinteger(80));
// Allow the user to override any of the defaults and the above
// SetDefaults() at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
@end verbatim
The main thing to notice in the above are the two calls to
@code{Config::SetDefault}. This is how we set the default value
for all subsequently instantiated DropTailQueues. We illustrate
that two types of Value classes, a String and a Uinteger class,
can be used to assign the value to the attribute named by
"ns3::DropTailQueue::MaxPackets".
Now, we will create a few objects using the low-level API; here,
our newly created queues will not have a m_maxPackets initialized to
100 packets but to 80 packets, because of what we did above with
default values.
@verbatim
Ptr<Node> n0 = CreateObject<Node> ();
Ptr<PointToPointNetDevice> net0 = CreateObject<PointToPointNetDevice> ();
n0->AddDevice (net0);
Ptr<Queue> q = CreateObject<DropTailQueue> ();
net0->AddQueue(q);
@end verbatim
At this point, we have created a single node (Node 0) and a
single PointToPointNetDevice (NetDevice 0) and added a
DropTailQueue to it.
Now, we can manipulate the MaxPackets value of the already
instantiated DropTailQueue. Here are various ways to do that.
@subsubsection Pointer-based access
We assume that a smart pointer (Ptr) to a relevant network device is
in hand; here, it is the net0 pointer.
One way to change the value is to access a pointer to the
underlying queue and modify its attribute.
First, we observe that we can get a pointer to the (base class)
queue via the PointToPointNetDevice attributes, where it is called
TxQueue
@verbatim
Ptr<Queue> txQueue = net0->GetAttribute ("TxQueue");
@end verbatim
Using the GetObject function, we can perform a safe downcast
to a DropTailQueue, where MaxPackets is a member
@verbatim
Ptr<DropTailQueue> dtq = txQueue->GetObject <DropTailQueue> ();
NS_ASSERT (dtq);
@end verbatim
Next, we can get the value of an attribute on this queue
We have introduced wrapper "Value" classes for the underlying
data types, similar to Java wrappers around these types, since
the attribute system stores values and not disparate types.
Here, the attribute value is assigned to a Uinteger, and
the Get() method on this value produces the (unwrapped) uint32_t.
@verbatim
Uinteger limit = dtq->GetAttribute ("MaxPackets");
NS_LOG_INFO ("1. dtq limit: " << limit.Get () << " packets");
@end verbatim
Note that the above downcast is not really needed; we could have
done the same using the Ptr<Queue> even though the attribute
is a member of the subclass
@verbatim
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("2. txQueue limit: " << limit.Get () << " packets");
@end verbatim
Now, let's set it to another value (60 packets)
@verbatim
txQueue->SetAttribute("MaxPackets", Uinteger (60));
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("3. txQueue limit changed: " << limit.Get () << " packets");
@end verbatim
@subsubsection Namespace-based access
An alternative way to get at the attribute is to use the configuration
namespace. Here, this attribute resides on a known path in this
namespace; this approach is useful if one doesn't have access to
the underlying pointers and would like to configure a specific
attribute with a single statement.
@verbatim
Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", Uinteger (25));
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("4. txQueue limit changed through namespace: " <<
limit.Get () << " packets");
@end verbatim
We could have also used wildcards to set this value for all nodes
and all net devices (which in this simple example has the same
effect as the previous Set())
@verbatim
Config::Set ("/NodeList/*/DeviceList/*/TxQueue/MaxPackets", Uinteger (15));
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("5. txQueue limit changed through wildcarded namespace: " <<
limit.Get () << " packets");
@end verbatim
@node Setting through constructors and helper classes
@subsection Setting through constructors helper classes
Arbitrary combinations of attributes can be set and fetched from
the helper and low-level APIs; either from the constructors themselves:
@verbatim
Ptr<Object> p = CreateObject<MyNewObject> ("n1", v1, "n2", v2, ...);
@end verbatim
or from the higher-level helper APIs, such as:
@verbatim
mobility.SetPositionAllocator ("GridPositionAllocator",
"MinX", FpValue (-100.0),
"MinY", FpValue (-100.0),
"DeltaX", FpValue (5.0),
"DeltaY", FpValue (20.0),
"GridWidth", UintValue (20),
"LayoutType", "RowFirst");
@end verbatim
@node Value classes
@subsection Value classes
Readers will note the new Value classes. These can be thought of as
an intermediate class that can be used to convert from raw types to the
Values that are used by the system. Recall that this database is holding
objects of many types with a single generic type. Conversions to this
type can either be done using an intermediate class (IntValue, FpValue for
"floating point") or via strings. Direct implicit conversion of types
to Value is not really practical. So in the above, users have a choice
of using strings or values:
@verbatim
p->Set ("cwnd", "100"); // string-based setter
p->Set ("cwnd", IntValue(100)); // value-based setter
@end verbatim
The system provides some macros that help users declare and define
new Value subclasses for new types that they want to introduce into
the attribute system.
@node Extending attributes
@section Extending attributes
The ns-3 system will place a number of internal values under the
attribute system, but undoubtedly users will want to extend this
to pick up ones we have missed, or to add their own classes to this.
@subsection Adding an existing internal variable to the metadata system
// XXX revise me
Consider this variable in class TcpSocket:
@verbatim
uint32_t m_cWnd; // Congestion window
@end verbatim
Suppose that someone working with Tcp wanted to get or set the
value of that variable using the metadata system. If it were not
already provided by ns-3, the user could declare the following addition
in the metadata system (to the TypeId declaration for TcpSocket):
@verbatim
.AddParameter ("Congestion window",
"Tcp congestion window (bytes)",
MakeUIntParamSpec (&TcpSocket::m_cWnd, 1));
@end verbatim
Now, the user with a pointer to the TcpSocket can perform operations
such as setting and getting the value, without having to add these
functions explicitly. Furthermore, access controls can be applied, such
as allowing the parameter to be read and not written, or bounds
checking on the permissible values can be applied.
@subsection Adding a new TypeId
Here, we discuss the impact on a user who wants to add a new class to
ns-3; what additional things must be done to hook it into this system.
We've already introduced what a TypeId definition looks like:
@verbatim
TypeId
RandomWalk2dMobilityModel::GetTypeId (void)
{
static TypeId tid = TypeId ("RandomWalkMobilityModel")
.SetParent<MobilityModel> ()
.SetGroupName ("Mobility")
.AddConstructor<RandomWalk2dMobilityModel> ()
// followed by a number of Parameters
.AddParameter ("bounds",
"Bounds of the area to cruise.",
MakeRectangleParamSpec (&RandomWalk2dMobilityModel::m_bounds, Rectangle (0.0, 0.0, 100.0, 100.0)))
.AddParameter ("time",
"Change current direction and speed after moving for this delay.",
MakeTimeParamSpec (&RandomWalk2dMobilityModel::m_modeTime,
Seconds (1.0)))
// etc (more parameters).
@end verbatim
The declaration for this in the class declaration is one-line public
member method:
@verbatim
public:
static TypeId GetTypeId (void);
@end verbatim
@section Adding new class type to the Value system
From the perspective of the user who writes a new class in the system and
wants to hook it in to the attribute system, there is mainly the matter
of writing
the conversions to/from strings and Values. Most of this can be
copy/pasted with macro-ized code. For instance, consider class
Rectangle in the @code{src/mobility/} directory:
One line is added to the class declaration:
@verbatim
/**
* \brief a 2d rectangle
*/
class Rectangle
{
...
VALUE_HELPER_HEADER_1 (Rectangle);
};
@end verbatim
One templatized declaration, and two operators, are added below the
class declaration:
@verbatim
std::ostream &operator << (std::ostream &os, const Rectangle &rectangle);
std::istream &operator >> (std::istream &is, Rectangle &rectangle);
VALUE_HELPER_HEADER_2 (Rectangle);
@end verbatim
In the class definition, the code looks like this:
@verbatim
VALUE_HELPER_CPP (Rectangle);
std::ostream &
operator << (std::ostream &os, const Rectangle &rectangle)
{
os << rectangle.xMin << "|" << rectangle.xMax << "|" << rectangle.yMin << "|" << rectangle.yMax;
return os;
}
std::istream &
operator >> (std::istream &is, Rectangle &rectangle)
{
char c1, c2, c3;
is >> rectangle.xMin >> c1 >> rectangle.xMax >> c2 >> rectangle.yMin >> c3 >> rectangle.yMax;
if (c1 != '|' ||
c2 != '|' ||
c3 != '|')
{
is.setstate (std::ios_base::failbit);
}
return is;
}
@end verbatim
These stream operators simply convert from a string representation of the
Rectangle ("xMin|xMax|yMin|yMax") to the underlying Rectangle, and the
modeler must specify these operators and the string syntactical representation
of an instance of the new class.
+18
View File
@@ -0,0 +1,18 @@
Please write image files in a vector graphics format, when possible, and
generate the .png and .pdf versions on the fly (see ../Makefile).
Currently supported tools are dia and tgif. xfig could be added similarly
if someone wants to add it. The main requirement for adding another format
is that the tool to edit it is freely available and that a cron script can
autogenerate the pdf and png from the figure source.
Store the .dia, or .obj versions in mercurial, but not the .png or .pdfs.
If the figure is not available in a vector graphics format, store both
a .png and a .pdf version in this directory.
If you add a source (.dia, .obj) file here, remember to add it to
the list of figure sources in the Makefile in the directory above
Note: tgif can convert from .obj to .pdf, but the pdf that results takes
up a whole page. Instead, we convert to an intermediate .eps step, and
then run epstopdf.
Binary file not shown.
+115
View File
@@ -0,0 +1,115 @@
%TGIF 4.1.43-QPL
state(0,37,100.000,0,0,0,32,1,9,1,1,0,0,1,2,1,0,'Courier',0,80640,0,2,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0).
%
% @(#)$Header$
% %W%
%
unit("1 pixel/pixel").
color_info(11,65535,0,[
"magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
"red", 65535, 0, 0, 65535, 0, 0, 1,
"green", 0, 65535, 0, 0, 65535, 0, 1,
"blue", 0, 0, 65535, 0, 0, 65535, 1,
"yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
"pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
"cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
"CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
"white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
"black", 0, 0, 0, 0, 0, 0, 1,
"DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
]).
script_frac("0.6").
fg_bg_colors('black','white').
dont_reencode("FFDingbests:ZapfDingbats").
page(1,"",1,'').
text('black',272,195,2,0,1,248,36,0,13,5,0,0,0,0,2,248,36,0,0,"",0,0,0,0,208,'',[
minilines(248,36,0,0,0,0,0,[
mini_line(200,13,5,0,0,0,[
str_block(0,200,13,5,0,-8,0,0,0,[
str_seg('black','Courier',0,80640,200,13,5,0,-8,0,0,0,0,0,
"low-level APIs (all src/ ")])
]),
mini_line(248,13,5,0,0,0,[
str_block(0,248,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,248,13,5,0,-2,0,0,0,0,0,
"directories except src/helper/)")])
])
])]).
rcbox('black','',96,240,384,288,5,1,1,0,16,2,0,0,0,0,'1',0,[
]).
text('black',192,259,1,0,1,112,18,3,13,5,2,0,0,0,2,112,18,0,0,"",0,0,0,0,272,'',[
minilines(112,18,0,0,0,0,0,[
mini_line(112,13,5,0,0,0,[
str_block(0,112,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,112,13,5,0,0,0,0,0,0,0,
"ns-3 simulator")])
])
])]).
poly('black','',2,[
272,208,240,240],0,1,1,17,0,0,2,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
poly('black','',2,[
240,176,240,240],1,1,1,18,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
rcbox('black','',176,128,384,176,5,1,1,0,16,25,0,0,0,0,'1',0,[
]).
text('black',192,131,2,0,1,120,36,26,13,5,2,0,0,0,2,120,36,0,0,"",0,0,0,0,144,'',[
minilines(120,36,0,0,0,0,0,[
mini_line(120,13,5,0,0,0,[
str_block(0,120,13,5,0,-1,0,0,0,[
str_seg('black','Courier',0,80640,120,13,5,0,-1,0,0,0,0,0,
"ns-3 helper API")])
]),
mini_line(96,13,5,0,0,0,[
str_block(0,96,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,96,13,5,0,-2,0,0,0,0,0,
"(src/helper)")])
])
])]).
rcbox('black','',96,16,384,64,0,1,1,0,16,32,0,0,0,0,'1',0,[
]).
poly('black','',2,[
240,64,240,128],1,1,1,36,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',272,83,2,0,1,200,36,40,13,5,0,0,0,0,2,200,36,0,0,"",0,0,0,0,96,'',[
minilines(200,36,0,0,0,0,0,[
mini_line(200,13,5,0,0,0,[
str_block(0,200,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,200,13,5,0,-2,0,0,0,0,0,
"helper APIs (src/helper/)")])
]),
mini_line(192,13,5,0,0,0,[
str_block(0,192,13,5,0,-1,0,0,0,[
str_seg('black','Courier',0,80640,192,13,5,0,-1,0,0,0,0,0,
"call into low-level APIs")])
])
])]).
poly('black','',2,[
272,96,240,128],0,1,1,41,0,0,2,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',128,19,2,0,1,232,36,47,13,5,0,0,0,0,2,232,36,0,0,"",0,0,0,0,32,'',[
minilines(232,36,0,0,0,0,0,[
mini_line(224,13,5,0,0,0,[
str_block(0,224,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,224,13,5,0,-2,0,0,0,0,0,
"ns-3 scripts (main programs)")])
]),
mini_line(232,13,5,0,0,0,[
str_block(0,232,13,5,0,-1,0,0,0,[
str_seg('black','Courier',0,80640,232,13,5,0,-1,0,0,0,0,0,
"- may use either or both APIs")])
])
])]).
poly('black','',2,[
144,64,144,240],1,1,1,50,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+20
View File
@@ -0,0 +1,20 @@
@node Helper Functions
@chapter Helper Functions
@anchor{chap:Helpers}
This chapter describes an intermediate API for the simulator; what we
call the "helper API". The helper API is implemented in
@code{src/helper/} directory; it depends on (and wraps) the low-level
API which is implemented everywhere else in @code{src/}. The following
figure shows this relationship.
@center @image{figures/helpers,,,,png}
The use of the helper API is optional. It has two main goals:
@itemize @bullet
@item Provide "syntactic sugar" to wrap a number of related low-level
API calls together, that would normally be grouped together often, into
something that is more user-friendly.
@item Handle configuration of larger topological units (e.g., a set
of nodes or a set of nodes on a particular link) .
@end itemize
(more to follow)
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
@node Logging
@chapter Logging
@anchor{chap:Logging}
This chapter is the first in a series of chapters discussing things that
one can do to modify the input or output of existing ns-3 scripts.
Examples:
@itemize @bullet
@item Enable or disable the generation of log messages, with fine granularity
@item Set default values for configuration values in the system
@item Generate a report of all configuration values used during a simulation
run (not yet implemented)
@item Set or get values of member variables on objects already instantiated
@item Customizing the tracing output of the script
@item Generate statistics on (not yet implemented)
@item Perform a large number of independent runs of the same simulation
@end itemize
@node Logging Basics
@section Logging Basics
@node Enabling Log Output
@section Enabling Log Output
File diff suppressed because it is too large Load Diff
+462
View File
@@ -0,0 +1,462 @@
@c ========================================================================
@c Simulation Output
@c ========================================================================
@node Simulation Output
@chapter Simulation Output
At this point, you should be able to execute any of the built-in
programs distributed with @command{ns-3}. Next, we will look at
how to generate and tailor the simulation output, before turning
to how to modify simulation scripts to do different things.
@node Tracing Basics
@section Tracing Basics
The whole point of simulation is to generate output for further
study, and the @command{ns-3} tracing system is a primary
mechanism for this.
Since @command{ns-3} is a C++ program, standard facilities for
generating output from C++ programs apply:
@verbatim
#include <iostream>
...
int main ()
{
...
std::cout << "The value of x is " << x << std::endl;
...
}
@end verbatim
The goal of the @command{ns-3} tracing system is to
provide a structured way to configure the simulator to output results
in standard or modifiable formats.
@itemize @bullet
@item For basic tasks, the tracing system should allow the user to
generate standard tracing for popular tracing sources, and to customize
which objects generate the tracing.
@item Intermediate users will be able to extend the tracing system to
modify the output format generated, or to insert new tracing sources,
without modifying the core of the simulator.
@item Advanced users can modify the simulator core to add new
tracing sources and sinks.
@end itemize
The @command{ns-3} tracing system is fundamentally built on the
concept of separating tracing sources from sinks.
@enumerate
@item Trace sources (e.g., provide access to every packet received)
@item Trace sinks (e.g., print out the packet)
@item A mechanism to tie together sources and sinks
@end enumerate
The rationale for this division is to allow users to attach new
types of sinks to existing tracing sources, without requiring
users to edit and recompile the core of the simulator.
Thus, in the example above, a user could write a new tracing sink
and attach it to an existing tracing source. What remains to
be defined is a way for users to find these hooks (tracing sources)
and attach sinks to them. A new tracing namespace is defined for
this purpose.
We will first walk through how some pre-defined sources and sinks
are provided and may be customized with little user effort. We
return later in this chapter to advanced tracing configuration including
extending the tracing namespace and creating new tracing sources.
@subsection ASCII tracing
@cindex ASCII
For Internet nodes, the ASCII trace wrapper is a wrapper around
the @command{ns-3} low-level
tracing system that lets you get access to underlying trace events easily.
The output of a trace of a simulation run is an ASCII file --- thus the name.
In the spririt of keeping things simple, you won't be able to control or
configure the output at this stage.
For those familiar with @command{ns-2} output, this type of trace is
analogous to the @command{out.tr} generated by many scripts.
@cindex tracing packets
Let's just jump right in. As usual, we need to include the definitions
related to using ASCII tracing (don't edit any files quite yet):
@verbatim
#include "ns3/ascii-trace.h"
@end verbatim
We then need to add the code to the script to actually enable the ASCII tracing
code. The following code must be inserted before the call to
@code{Simulator::Run ();}:
@verbatim
AsciiTrace asciitrace ("tutorial.tr");
asciitrace.TraceAllQueues ();
asciitrace.TraceAllNetDeviceRx ();
@end verbatim
The first line declares an object of type @code{AsciiTrace} named
@code{asciitrace} and passes a string parameter to its constructor. This
parameter is a file name to which all of the trace information will be written.
The second line, @code{asciitrace.TraceAllQueues ();} asks the trace object to
arrange that all queue operations (enqueue, dequeue, drop) on the queues
in all of the nodes of the system be traced. On the receive side,
@code{asciitrace.TraceAlllNetDeviceRx ()} traces packets received by
a NetDevice. For those familiar with @command{ns-2}, these are equivalent
to the popular trace points that log "+", "-", "d", and "r" events.
Try running the following program from the command line:
@verbatim
./waf --run tutorial-csma-echo-ascii-trace
@end verbatim
@cindex tutorial.tr
Just as you have seen previously, you will see some messages from @emph{Waf}
and then the ``Compilation finished successfully'' message. The
next message, @code{UDP Echo Simulation} is from the running program. When
it ran, the program will have created a file named @code{tutorial.tr}.
Because of the way that Waf works, the file is not created in the local
directory, it is created at the top-level directory of the repository. So,
change into the top level directory and take a look at the file
@code{tutorial.tr} in your favorite editor.
@subsubsection Parsing Ascii Traces
@cindex parsing ascii traces
This section parses in detail the structure of the ascii tracing
output. If you find this output format self explanatory (it
resembles tcpdump output), you may skip to the next
section on pcap tracing.
@cindex trace event
There's a lot of information there in a pretty dense form, but the first thing
to notice is that there are a number of distinct lines in this file. It may
be difficult to see this clearly unless you widen your windows considerably.
Each line in the file corresponds to a @emph{trace event}. A trace event
happens whenever specific conditions happen in the simulation. In this case
we are tracing events on the @emph{device queue} present in every net device
on every node in the simulation. The device queue is a queue through which
every packet destined for a channel must pass --- it is the device
@emph{transmit} queue. Note that each line in the trace file begins with a
lone character (has a space after it). This character will have the following
meaning:
@cindex enqueue
@cindex dequeue
@cindex drop
@itemize @bullet
@item @code{+}: An enqueue operation occurred on the device queue;
@item @code{-}: A dequeue operation occurred on the device queue;
@item @code{d}: A packet was dropped, typically because the queue was full.
@end itemize
Let's take a more detailed view of the first line. I'll break it down into
sections (indented for clarity) with a two digit reference number on the
left side:
@verbatim
00 +
01 2
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=9
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:00,
09 destination=ff:ff:ff:ff:ff:ff
10 ARP(request
11 source mac: 08:00:2e:00:00:00
12 source ipv4: 10.1.1.1
13 dest ipv4: 10.1.1.2)
14 ETHERNET fcs=0
@end verbatim
@cindex trace event
@cindex simulation time
The first line of this expanded trace event (reference number 00) is the
queue operation. We have a @code{+} character, so this corresponds to an
@emph{enqueue} operation. The second line (reference 01) is the simulation
time expressed in seconds. You may recall that we asked the
@code{UdpEchoClient} to start sending packets at two seconds. Here we see
confirmation that this is, indeed, happening.
@cindex node number
@cindex net device number
@cindex smart pointer
The next lines of the example listing (references 02 and 03) tell us that
this trace event originated in a given node and net device. Each time a node
is created it is given an identifying number that monotonically increases from
zero. Therefore, @code{nodeid=0} means that the node in which the given trace
event originated is the first node we created. In the case of our script,
this first node is is the node pointed to by the smart pointer @code{n0}. Not
too surpsisingly, this is also the node to which we attached the
@code{UdpEchoClient}. The device number is local to each node, and so the
device given by @code{device=0} is the first net device that we added to the
node in question. In our simulation, this corresponds to the
@code{CsmaNetDevice} we added to node zero (@code{n0}).
@cindex uid
@cindex unique ID
@cindex packet
The next line (reference 04) is a more readable form of the operation code
seen in the first line --- i.e., the character @code{+} means
@code{queue-enqueue}. Reference number 05 indicates that the @emph{unique id}
of the packet being enqueued is @code{9}. The fact that the first packet we
see has a unique ID of 9 should indicates to you that other things have
happened in the protocol stack before we got to this point. This will become
clear momentarily.
@cindex Ethernet
@cindex MAC address
Reference items 06 and 14 indicate that this is an Ethernet packet with
a zero (not computed) checksum (note the indentation to make parsing this
trace event a little easier). Reference 08 and 09 are the source and
destination addresses of this packet. The packet is from the MAC address we
assigned to the node zero net device in the script, and is destined for the
broadcast address --- this is a broadcast packet.
@cindex Address Resolution Protocol
@cindex ARP
@cindex ARP|request
Reference items 10 through 13 make clear what is happening. This is an ARP
(Address Resolution Protocol) request for the MAC address of the node on
which the @code{UdpEchoServer} resides. The protocol stack can't send a UDP
packet to be echoed until it knows (resolves) the MAC address; and this trace
event corresponds to an ARP request being queued for transmission to the local
network. The next line in the trace file (partially expanded),
@verbatim
00 -
01 2
02 nodeid=0
03 device=0
04 queue-dequeue
05 pkt-uid=9
...
@end verbatim
shows the (same) ARP request packet being dequeued from the device queue by
the net device and (implicitly) being sent down the channel to the broadcast
MAC address. We are not tracing net device reception events so we don't
actually see all of the net devices receiving the broadcast packet. We do,
however see the following in the third line of the trace file:
@verbatim
00 +
01 2.00207
02 nodeid=1
03 device=0
04 queue-enqueue
05 pkt-uid=10
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:01,
09 destination=08:00:2e:00:00:00,
10 ARP(reply
11 source mac: 08:00:2e:00:00:01
12 source ipv4: 10.1.1.2
13 dest mac: 08:00:2e:00:00:00
14 dest ipv4: 10.1.1.1)
15 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex ARP|response
Notice that this is a queue-enqueue operation (references 00 and 04) happening
on node one (reference 02) at simulation time 2.00207 seconds (reference 01).
Looking at the packet payload (references 10-14) we see that this is an ARP
reply to the request sent by node one. Note that the simulation time
(reference 01) is now 2.00207 seconds. This is direct result of the data rate
(5 mb/s) and latency (2 ms) parameters that we passed to the
@code{CsmaChannel} when we created it. Clearly the ARP request packet was
sent over the channel and received approximately 2 ms later by node one. A
corresponding ARP response packet was created and enqueued on node one's net
device. It is this enqueue trace event that has being logged.
@cindex queue
@cindex queue|transmit
@cindex echo
Given the current state of affairs, the next thing you may expect to see is
this ARP request being received by node zero, but remember we are only looking
at trace events on the device @emph{transmit} queue. The reception of the ARP
response by node zero will not directly trigger any trace event in this case,
but it will enable the protocol stack to continue what it was originally doing
(trying to send an echo packet). Thus, the next line we see in the trace file
(@code{tutorial.tr}) is the first UDP echo packet being sent to the net device.
@verbatim
00 +
01 2.00415
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=7
06 ETHERNET
07 length/type=0x800,
08 source=08:00:2e:00:00:00,
09 destination=08:00:2e:00:00:01
10 IPV4(
11 tos 0x0
12 ttl 64
13 id 0
14 offset 0
15 flags [none]
16 length: 1052) 10.1.1.1 > 10.1.1.2
17 UDP(length: 1032)
18 49153 > 7
19 DATA (length 1024)
20 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex echo
@cindex ARP
@cindex ARP|request
@cindex ARP|response
@cindex IP
@cindex Ipv4
I won't go into too much detail about this packet, but I will point out a
few key items in the trace. First, the packet was enqueued at simulation time
of 2.00415 seconds. This time reflects the fact that the echo client
application started at 2. seconds and there were two ARP packets transmitted
across the network (two milliseconds + data transmission time each way). The
packet unique identifier (reference 05) is 7. Notice that this is a lower
number than the ARP request packet, which had a unique ID of 9. This tells
us that the UDP packet was actually created before the ARP request packet ---
which makes perfect sense since it was the attempt to send packet 7 that
triggered sending the ARP request packet 9. Note that this an Ethernet
packet (reference 06) like all other packets in this simulation, however this
particular packet carries an IPV4 payload and therefore has an IP version 4
header (indicated by references 10-16). This Ipv4 in turn contains a UDP
header (references 17, 18) and finally 1024 bytes of data (reference 20).
Clearly, this is the UDP echo packet emitted by the
@code{UdpEchoClient Application}.
The next trace event is an ARP request from node one. We can infer that node
one has received the UDP echo packet and the @code{UdpEchoServer Application}
on that node has turned the packet around. Just as node zero needed to ARP
for the MAC address of node one, now node one must ARP for the MAC address of
node zero. We see the ARP request enqueued on the transmit queue of node one;
then we see the ARP request dequeued from the tranmit queue of node one (and
implicitly transmitted to node zero). Then we see an ARP response enqueued
on the transmit queue of node zero; and finally the ARP response dequeued (and
implicitly transmitted back to node one).
This exchange is summarized in the following trace event excerpts,
@verbatim
+ 2.00786 nodeid=1 ... ARP(request ...
- 2.00786 nodeid=1 ... ARP(request ...
+ 2.00994 nodeid=0 ... ARP(reply ...
- 2.00994 nodeid=0 ... ARP(reply ...
@end verbatim
The final two trace events in the @code{tutorial.tr} file correspond to the
echoed packet being enqueued for transmission on the net device for node one,
and that packet being dequeued (and implicitly transmitted back to node zero).
@cindex AsciiTrace!TraceAllNetDeviceRx
@cindex ARP!request
If you look at the trace file (@code{tutorial.tr}) you will also see some
entries with an @code{r} event, indicating a
@emph{receive} trace event. Recall that the first packet sent on the network
was a broadcast ARP request. We should then see all four nodes receive a
copy of this request. This is the case, as the first four receive trace
events are,
@verbatim
r 2.00207 nodeid=0 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=1 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=2 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=3 device=0 dev-rx pkt-uid=9 ARP(request ...
@end verbatim
@cindex unique ID
You can see that a copy of the broadcast packet with unique ID 9 was received
by the net devices on nodes 0, 1, 2 and 3. We leave it up to you to parse the
rest of the trace file and understand the remaining reception events.
@subsection PCAP Trace Wrapper
@cindex pcap
@cindex Wireshark
The @command{ns-3} @emph{pcap trace wrapper} is used to create trace files in
@code{.pcap} format. The acronym pcap (usually written in lower case) stands
for @emph{p}acket @emph{cap}ture, and is actually an API that includes the
definition of a @code{.pcap} file format. The most popular program that can
read and display this format is Wireshark (formerly called Ethereal).
However, there are many traffic trace analyzers that use this packet
format, including X, Y, and Z. We encourage users to exploit the
many tools available for analyzing pcap traces; below, we show how
tcpdump and Wireshark can be used..
@cindex tutorial-csma-echo-ascii-trace.cc
@cindex tutorial-csma-echo-pcap-trace.cc
The code used to enable pcap tracing is similar to that for ASCII tracing.
We have provided another file, @code{tutorial-csma-echo-pcap-trace.cc} that
uses the pcap trace wrapper. We have added the code to include the pcap
trace wrapper defintions:
@verbatim
#include "ns3/pcap-trace.h"
@end verbatim
And then added the following code below the AsciiTrace methods:
@cindex PcapTrace
@cindex PcapTrace!TraceAllIp
@verbatim
PcapTrace pcaptrace ("tutorial.pcap");
pcaptrace.TraceAllIp ();
@end verbatim
The first line of the code immediately above declares an object of type
@code{PcapTrace} named @code{pcaptrace} and passes a string parameter to its
constructor. This object is used to hide the details of the actual tracing
subsystem. The parameter is a base file name from which the actual trace file
names will be built. The second line of code tells the @code{PcamTrace}
object to trace all IP activity in all of the nodes present in the simulation.
@cindex interface index
Trace files are not created until trace activity is detected. Each file name
is composed of the base file name, followed by a @code{'-'}, a node id followed
by a @code{'-}', and an IP interface index. You will soon see a file named
@code{tutorial.pcap-0-1}, for example. This will be the trace file generated
as events are detected on node zero, interface index one. N.B. Interface
indices are different that net device indices --- interface index zero
corresponds to the loopback interface and interface index one corresponds to
the first net device you added to a node.
You may run the new program just like all of the others so far:
@cindex Waf
@verbatim
./waf --run tutorial-csma-echo-pcap-trace
@end verbatim
If you look at the top level directory of your distribution, you should now
see three log files: @code{tutorial.tr} is the ASCII trace file we have
previously examined. @code{tutorial.pcap-0-1} and @code{tutorial.pcap-1-1}
are the new pcap files we just generated. There will not be files
corresponding to nodes two and three since we have not sent any IP packets to
those nodes.
@subsubsection Reading output with tcpdump
@cindex tcpdump
@subsubsection Reading output with Wireshark
@cindex Wireshark
If you are unfamilar with Wireshark, there is a web site available from which
you can download programs and documentation: @uref{http://www.wireshark.org/}.
If you have Wireshark available, you can open each of the trace files and
display the contents as if you had captured the packets using a
@emph{packet sniffer}. Note that only IP packets are traced using this
wrapper, so you will not see the ARP exchanges that were logged when using
the ASCII trace wrapper. You are encouraged to take a look at the contents
of these pcap files using your favorite pcap software (or Wireshark).
@node Advanced Tracing
@section Advanced Tracing
+9
View File
@@ -0,0 +1,9 @@
@node Statistics
@chapter Statistics
@anchor{chap:Statistics}
ns-3 does not presently have support for statistics (automatically generated
statistical output). This is planned
for development later in 2008. If you are interested in contributing,
please see @uref{http://www.nsnam.org/wiki/index.php/Suggested_Projects,,our suggested projects page} or contact the ns-developers
list.
+82
View File
@@ -0,0 +1,82 @@
@node Troubleshooting
@chapter Troubleshooting
This chapter posts some information about possibly common errors in building
or running ns-3 programs.
Please note that the wiki (@uref{http://www.nsnam.org/wiki/index.php/Troubleshooting}) may have contributed items.
@node Build errors
@section Build errors
@node Run-time errors
@section Run-time errors
Sometimes, errors can occur with a program after a successful build. These
are run-time errors, and can commonly occur when memory is corrupted or
pointer values are unexpectedly null.
Here is an example of what might occur:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
Command ['/home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point'] exited with code -11
@end verbatim
The error message says that the program terminated unsuccessfully, but it is
not clear from this information what might be wrong. To examine more
closely, try running it under the @uref{http://sources.redhat.com/gdb/,,gdb debugger}:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="gdb %s"
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
GNU gdb Red Hat Linux (6.3.0.0-1.134.fc5rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xf5c000
Program received signal SIGSEGV, Segmentation fault.
0x0804aa12 in main (argc=1, argv=0xbfdfefa4)
at ../examples/tcp-point-to-point.cc:136
136 Ptr<Socket> localSocket = socketFactory->CreateSocket ();
(gdb) p localSocket
$1 = {m_ptr = 0x3c5d65}
(gdb) p socketFactory
$2 = {m_ptr = 0x0}
(gdb) quit
The program is running. Exit anyway? (y or n) y
@end verbatim
Note first the way the program was invoked-- pass the command to run as
an argument to the command template "gdb %s".
This tells us that there was an attempt to dereference a null pointer
socketFactory.
Let's look around line 136 of tcp-point-to-point, as gdb suggests:
@verbatim
Ptr<SocketFactory> socketFactory = n2->GetObject<SocketFactory> (Tcp::iid);
Ptr<Socket> localSocket = socketFactory->CreateSocket ();
localSocket->Bind ();
@end verbatim
The culprit here is that the return value of GetObject is not being
checked and may be null.
Sometimes you may need to use the @uref{http://valgrind.org,,valgrind memory
checker} for more subtle errors. Again, you invoke the use of valgrind
similarly:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="valgrind %s"
@end verbatim
+156
View File
@@ -0,0 +1,156 @@
body {
font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
background: white;
color: black;
font-size: 11pt;
}
h1, h2, h3, h4, h5, h6 {
# color: #990000;
color: #009999;
}
pre {
font-size: 10pt;
background: #e0e0e0;
color: black;
}
a:link, a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
img {
border: 0px;
}
#main th {
font-size: 12pt;
background: #b0b0b0;
}
.odd {
font-size: 12pt;
background: white;
}
.even {
font-size: 12pt;
background: #e0e0e0;
}
.answer {
font-size: large;
font-weight: bold;
}
.answer p {
font-size: 12pt;
font-weight: normal;
}
.answer ul {
font-size: 12pt;
font-weight: normal;
}
#container {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
}
#feedback {
color: #b0b0b0;
font-size: 9pt;
font-style: italic;
}
#header {
position: absolute;
margin: 0px;
top: 10px;
height:96px;
left: 175px;
right: 10em;
bottom: auto;
background: white;
clear: both;
}
#middle {
position: absolute;
left: 0;
height: auto;
width: 100%;
}
#main {
position: absolute;
top: 50px;
left: 175px;
right: 100px;
background: white;
padding: 0em 0em 0em 0em;
}
#navbar {
position: absolute;
top: 75px;
left: 0em;
width: 146px;
padding: 0px;
margin: 0px;
font-size: 10pt;
}
#navbar a:link, #navbar a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
#navbar a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
#navbar dl {
width: 146px;
padding: 0;
margin: 0 0 10px 0px;
background: #99ffff url(images/box_bottom2.gif) no-repeat bottom left;
}
#navbar dt {
padding: 6px 10px;
font-size: 100%;
font-weight: bold;
background: #009999;
margin: 0px;
border-bottom: 1px solid #fff;
color: white;
background: #009999 url(images/box_top2.gif) no-repeat top left;
}
#navbar dd {
font-size: 100%;
margin: 0 0 0 0px;
padding: 6px 10px;
color: #0047b9;
}
dd#selected {
background: #99ffff url(images/arrow.gif) no-repeat;
background-position: 4px 10px;
}
+105
View File
@@ -0,0 +1,105 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ns-3.info
@settitle ns-3 tutorial
@c @setchapternewpage odd
@c %**end of header
@ifinfo
Primary documentation for the @command{ns-3} project is available in
three forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item Tutorial (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML versions
should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
@end ifinfo
@copying
This is an @command{ns-3} tutorial.
Primary documentation for the @command{ns-3} project is available in
three forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item Tutorial (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML
versions should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This software 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, see @uref{http://www.gnu.org/licenses/}.
@end copying
@titlepage
@title ns-3 Tutorial
@author ns-3 project
@author feedback: ns-developers@@isi.edu
@today{}
@c @page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@c So the toc is printed at the start.
@anchor{Full Table of Contents}
@contents
@ifnottex
@node Top, Overview, Full Table of Contents
@top ns-3 Tutorial (html version)
For a pdf version of this tutorial,
see @uref{http://www.nsnam.org/docs/tutorial.pdf}.
@insertcopying
@end ifnottex
@menu
* Tutorial Goals::
Part 1: Getting Started with ns-3
* Overview::
* Browsing::
* Resources::
* Downloading and Compiling::
* Some-Prerequisites::
Part 2: Reading ns-3 Programs
* A-First-ns-3-Script::
Part 3: Reconfiguring Existing ns-3 Scripts
* Logging::
* ns-3 Attributes::
* Tracing::
* Statistics::
Part 4: Creating New or Revised Topologies
* Helper Functions::
@end menu
@include introduction.texi
@include log.texi
@include attributes.texi
@include statistics.texi
@include helpers.texi
@printindex cp
@bye
+126
View File
@@ -0,0 +1,126 @@
/* -*- 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
*/
//
// Example of the sending of a datagram to a broadcast address
//
// Network topology
// ==============
// | |
// n0 n1 n2
// | |
// ==========
//
// n0 originates UDP broadcast to 255.255.255.255/discard port, which
// is replicated and received on both n1 and n2
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaBroadcastExample");
int
main (int argc, char *argv[])
{
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
#if 0
LogComponentEnable ("CsmaBroadcastExample", LOG_LEVEL_INFO);
#endif
LogComponentEnable ("CsmaBroadcastExample", LOG_PREFIX_TIME);
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
// Allow the user to override any of the defaults and the above
// Bind()s at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (3);
NodeContainer c0 = NodeContainer (c.Get (0), c.Get (1));
NodeContainer c1 = NodeContainer (c.Get (0), c.Get (2));
NS_LOG_INFO ("Build Topology.");
CsmaHelper csma;
csma.SetChannelParameter ("DataRate", DataRateValue (DataRate(5000000)));
csma.SetChannelParameter ("Delay", TimeValue (MilliSeconds(2)));
NetDeviceContainer n0 = csma.Install (c0);
NetDeviceContainer n1 = csma.Install (c1);
InternetStackHelper internet;
internet.Install (c);
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.0.0", "255.255.255.0");
ipv4.Assign (n0);
ipv4.SetBase ("192.168.1.0", "255.255.255.0");
ipv4.Assign (n1);
// RFC 863 discard port ("9") indicates packet should be thrown away
// by the system. We allow this silent discard to be overridden
// by the PacketSink application.
uint16_t port = 9;
// Create the OnOff application to send UDP datagrams of size
// 512 bytes (default) at a rate of 500 Kb/s (default) from n0
NS_LOG_INFO ("Create Applications.");
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address ("255.255.255.255"), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer app = onoff.Install (c0.Get (0));
// Start the application
app.Start (Seconds (1.0));
app.Stop (Seconds (10.0));
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
sink.Install (c0.Get (1));
sink.Install (c1.Get (1));
// Also configure some tcpdump traces; each interface will be traced
// The output files will be named
// csma-broadcast.pcap-<nodeId>-<interfaceId>
// and can be read by the "tcpdump -tt -r" command
CsmaHelper::EnablePcapAll ("csma-broadcast");
std::ofstream ascii;
ascii.open ("csma-broadcast.tr");
CsmaHelper::EnableAsciiAll (ascii);
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+190
View File
@@ -0,0 +1,190 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Network topology
//
// Lan1
// ===========
// | | |
// n0 n1 n2 n3 n4
// | | |
// ===========
// Lan0
//
// - Multicast source is at node n0;
// - Multicast forwarded by node n2 onto LAN1;
// - Nodes n0, n1, n2, n3, and n4 receive the multicast frame.
// - Node n4 listens for the data
#include <iostream>
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaMulticastExample");
int
main (int argc, char *argv[])
{
//
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
//
// LogComponentEnable ("CsmaMulticastExample", LOG_LEVEL_INFO);
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
//
// Set up default values for the simulation.
//
// Select Ethernet II-style encapsulation (no LLC/Snap header)
Config::SetDefault ("ns3::CsmaNetDevice::EncapsulationMode", StringValue ("IpArp"));
// Allow the user to override any of the defaults at
// run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (5);
// We will later want two subcontainers of these nodes, for the two LANs
NodeContainer c0 = NodeContainer (c.Get (0), c.Get (1), c.Get (2));
NodeContainer c1 = NodeContainer (c.Get (2), c.Get (3), c.Get (4));
NS_LOG_INFO ("Build Topology.");
CsmaHelper csma;
csma.SetChannelParameter ("DataRate", DataRateValue (DataRate (5000000)));
csma.SetChannelParameter ("Delay", TimeValue (MilliSeconds (2)));
// We will use these NetDevice containers later, for IP addressing
NetDeviceContainer nd0 = csma.Install (c0); // First LAN
NetDeviceContainer nd1 = csma.Install (c1); // Second LAN
NS_LOG_INFO ("Add IP Stack.");
InternetStackHelper internet;
internet.Install (c);
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4Addr;
ipv4Addr.SetBase ("10.1.1.0", "255.255.255.0");
ipv4Addr.Assign (nd0);
ipv4Addr.SetBase ("10.1.2.0", "255.255.255.0");
ipv4Addr.Assign (nd1);
NS_LOG_INFO ("Configure multicasting.");
//
// Now we can configure multicasting. As described above, the multicast
// source is at node zero, which we assigned the IP address of 10.1.1.1
// earlier. We need to define a multicast group to send packets to. This
// can be any multicast address from 224.0.0.0 through 239.255.255.255
// (avoiding the reserved routing protocol addresses).
//
Ipv4Address multicastSource ("10.1.1.1");
Ipv4Address multicastGroup ("225.1.2.4");
// Now, we will set up multicast routing. We need to do three things:
// 1) Configure a (static) multicast route on node n2
// 2) Set up a default multicast route on the sender n0
// 3) Have node n4 join the multicast group
// We have a helper that can help us with static multicast
StaticMulticastRouteHelper multicast;
// 1) Configure a (static) multicast route on node n2 (multicastRouter)
Ptr<Node> multicastRouter = c.Get (2); // The node in question
Ptr<NetDevice> inputIf = nd0.Get (2); // The input NetDevice
NetDeviceContainer outputDevices; // A container of output NetDevices
outputDevices.Add (nd1.Get (0)); // (we only need one NetDevice here)
multicast.AddMulticastRoute (multicastRouter, multicastSource,
multicastGroup, inputIf, outputDevices);
// 2) Set up a default multicast route on the sender n0
Ptr<Node> sender = c.Get (0);
Ptr<NetDevice> senderIf = nd0.Get(0);
multicast.SetDefaultMulticastRoute (sender, senderIf);
// 3) Have node n4 join the multicast group
Ptr<Node> receiver = c.Get (4);
multicast.JoinMulticastGroup (receiver, multicastSource, multicastGroup);
//
// Create an OnOff application to send UDP datagrams from node zero to the
// multicast group (node four will be listening).
//
NS_LOG_INFO ("Create Applications.");
uint16_t multicastPort = 9; // Discard port (RFC 863)
// Configure a multicast packet generator that generates a packet
// every few seconds
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (multicastGroup, multicastPort)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate ("255b/s")));
onoff.SetAttribute ("PacketSize", UintegerValue (128));
ApplicationContainer srcC = onoff.Install (c0.Get (0));
//
// Tell the application when to start and stop.
//
srcC.Start(Seconds(1.));
srcC.Stop (Seconds(10.));
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny(), multicastPort));
ApplicationContainer sinkC = sink.Install (c1.Get (2)); // Node n4
// Start the sink
sinkC.Start (Seconds (1.0));
sinkC.Stop (Seconds (10.0));
//
// Configure tracing of all enqueue, dequeue, and NetDevice receive events.
NS_LOG_INFO ("Configure Tracing.");
//
// Ascii trace output will be sent to the file "csma-multicast.tr"
//
std::ofstream ascii;
ascii.open ("csma-multicast.tr");
CsmaHelper::EnableAsciiAll (ascii);
// Also configure some tcpdump traces; each interface will be traced.
// The output files will be named:
// csma-multicast.pcap-<nodeId>-<interfaceId>
// and can be read by the "tcpdump -r" command (use "-tt" option to
// display timestamps correctly)
CsmaHelper::EnablePcapAll ("csma-multicast");
//
// Now, do the actual simulation.
//
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+147
View File
@@ -0,0 +1,147 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Network topology
//
// n0 n1 n2 n3
// | | | |
// =================
// LAN
//
// - CBR/UDP flows from n0 to n1 and from n3 to n0
// - DropTail queues
// - Tracing of queues and packet receptions to file "csma-one-subnet.tr"
#include <iostream>
#include <fstream>
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/core-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaOneSubnetExample");
int
main (int argc, char *argv[])
{
//
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
//
#if 0
LogComponentEnable ("CsmaOneSubnetExample", LOG_LEVEL_INFO);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
//
// Allow the user to override any of the defaults and the above Bind() at
// run-time, via command-line arguments
//
CommandLine cmd;
cmd.Parse (argc, argv);
//
// Explicitly create the nodes required by the topology (shown above).
//
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
NS_LOG_INFO ("Build Topology");
CsmaHelper csma;
csma.SetChannelParameter ("DataRate", DataRateValue (5000000));
csma.SetChannelParameter ("Delay", TimeValue (MilliSeconds (2)));
//
// Now fill out the topology by creating the net devices required to connect
// the nodes to the channels and hooking them up. AddIpv4CsmaNetDevice will
// create a net device, add a MAC address (in memory of the pink flamingo) and
// connect the net device to a nodes and also to a channel. the
// AddIpv4CsmaNetDevice method returns a net device index for the net device
// created on the node. Interpret nd0 as the net device we created for node
// zero.
//
NetDeviceContainer nd0 = csma.Install (c);
InternetStackHelper internet;
internet.Install (c);
// We've got the "hardware" in place. Now we need to add IP addresses.
//
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
ipv4.Assign (nd0);
//
// Create an OnOff application to send UDP datagrams from node zero to node 1.
//
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address ("10.1.1.2"), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer app = onoff.Install (c.Get (0));
// Start the application
app.Start (Seconds (1.0));
app.Stop (Seconds (10.0));
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
sink.Install (c.Get (1));
//
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
//
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (Ipv4Address ("10.1.1.1"), port)));
ApplicationContainer app2 = onoff.Install (c.Get (3));
sink.Install (c.Get (0));
app2.Start(Seconds (1.1));
app2.Stop (Seconds (10.0));
//
// Configure tracing of all enqueue, dequeue, and NetDevice receive events.
// Trace output will be sent to the file "csma-one-subnet.tr"
//
NS_LOG_INFO ("Configure Tracing.");
std::ofstream ascii;
ascii.open ("csma-one-subnet.tr");
CsmaHelper::EnableAsciiAll (ascii);
//
// Also configure some tcpdump traces; each interface will be traced.
// The output files will be named:
// csma-one-subnet.pcap-<nodeId>-<interfaceId>
// and can be read by the "tcpdump -r" command (use "-tt" option to
// display timestamps correctly)
//
CsmaHelper::EnablePcapAll ("csma-one-subnet");
//
// Now, do the actual simulation.
//
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+114
View File
@@ -0,0 +1,114 @@
/* -*- 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
*/
// Port of ns-2/tcl/ex/simple.tcl to ns-3
//
// Network topology
//
// n0 n1 n2 n3
// | | | |
// =====================
//
// - CBR/UDP flows from n0 to n1, and from n3 to n0
// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
// (i.e., DataRate of 448,000 bps)
// - DropTail queues
// - Tracing of queues and packet receptions to file "csma-one-subnet.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaPacketSocketExample");
int
main (int argc, char *argv[])
{
#if 0
LogComponentEnable ("CsmaPacketSocketExample", LOG_LEVEL_INFO);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
CommandLine cmd;
cmd.Parse (argc, argv);
// Here, we will explicitly create four nodes.
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
PacketSocketHelper packetSocket;
packetSocket.Install (c);
// create the shared medium used by all csma devices.
NS_LOG_INFO ("Create channels.");
Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> (
"DataRate", DataRateValue (DataRate(5000000)),
"Delay", TimeValue (MilliSeconds(2)));
// use a helper function to connect our nodes to the shared channel.
NS_LOG_INFO ("Build Topology.");
CsmaHelper csma;
csma.SetDeviceParameter ("EncapsulationMode", StringValue ("Llc"));
NetDeviceContainer devs = csma.Install (c, channel);
NS_LOG_INFO ("Create Applications.");
// Create the OnOff application to send raw datagrams
PacketSocketAddress socket;
socket.SetSingleDevice(devs.Get (0)->GetIfIndex ());
socket.SetPhysicalAddress (devs.Get (1)->GetAddress ());
socket.SetProtocol (2);
OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1.0)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0.0)));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
socket.SetSingleDevice (devs.Get (3)->GetIfIndex ());
socket.SetPhysicalAddress (devs.Get (0)->GetAddress ());
socket.SetProtocol (3);
onoff.SetAttribute ("Remote", AddressValue (socket));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0.0)));
apps = onoff.Install (c.Get (3));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
// Configure tracing of all enqueue, dequeue, and NetDevice receive events
// Trace output will be sent to the csma-packet-socket.tr file
NS_LOG_INFO ("Configure Tracing.");
std::ofstream os;
os.open ("csma-packet-socket.tr");
csma.EnableAsciiAll (os);
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+136
View File
@@ -0,0 +1,136 @@
/* -*- 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
*
*/
// This script exercises global routing code in a mixed point-to-point
// and csma/cd environment
//
// Network topology
//
// n0
// \ p-p
// \ (shared csma/cd)
// n2 -------------------------n3
// / | |
// / p-p n4 n5 ---------- n6
// n1 p-p
//
// - CBR/UDP flows from n0 to n6
// - Tracing of queues and packet receptions to file "mixed-global-routing.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-route-manager.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("MixedGlobalRoutingExample");
int
main (int argc, char *argv[])
{
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s"));
// Allow the user to override any of the defaults and the above
// Bind ()s at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (7);
NodeContainer n0n2 = NodeContainer (c.Get (0), c.Get (2));
NodeContainer n1n2 = NodeContainer (c.Get (1), c.Get (2));
NodeContainer n5n6 = NodeContainer (c.Get (5), c.Get (6));
NodeContainer n2345 = NodeContainer (c.Get (2), c.Get (3), c.Get (4), c.Get (5));
InternetStackHelper internet;
internet.Install (c);
// We create the channels first without any IP addressing information
NS_LOG_INFO ("Create channels.");
PointToPointHelper p2p;
p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps"));
p2p.SetChannelParameter ("Delay", StringValue ("2ms"));
NetDeviceContainer d0d2 = p2p.Install (n0n2);
NetDeviceContainer d1d2 = p2p.Install (n1n2);
p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps"));
p2p.SetChannelParameter ("Delay", StringValue ("10ms"));
NetDeviceContainer d5d6 = p2p.Install (n5n6);
// We create the channels first without any IP addressing information
CsmaHelper csma;
csma.SetChannelParameter ("DataRate", StringValue ("5Mbps"));
csma.SetChannelParameter ("Delay", StringValue ("2ms"));
NetDeviceContainer d2345 = csma.Install (n2345);
// Later, we add IP addresses.
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
ipv4.Assign (d0d2);
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
ipv4.Assign (d1d2);
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
Ipv4InterfaceContainer i5i6 = ipv4.Assign (d5d6);
ipv4.SetBase ("10.250.1.0", "255.255.255.0");
ipv4.Assign (d2345);
// Create router nodes, initialize routing database and set up the routing
// tables in the nodes.
GlobalRouteManager::PopulateRoutingTables ();
// Create the OnOff application to send UDP datagrams of size
// 210 bytes at a rate of 448 Kb/s
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
InetSocketAddress (i5i6.GetAddress (1), port));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff.SetAttribute ("DataRate", StringValue ("300bps"));
onoff.SetAttribute ("PacketSize", UintegerValue (50));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
std::ofstream ascii;
ascii.open ("mixed-global-routing.tr");
PointToPointHelper::EnablePcapAll ("mixed-global-routing");
PointToPointHelper::EnableAsciiAll (ascii);
CsmaHelper::EnablePcapAll ("mixed-global-routing");
CsmaHelper::EnableAsciiAll (ascii);
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+365
View File
@@ -0,0 +1,365 @@
/* -*- 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
*
*/
//
// This ns-3 example demonstrates the use of helper functions to ease
// the construction of simulation scenarios.
//
// The simulation topology consists of a mixed wired and wireless
// scenario in which a hierarchical mobility model is used.
//
// The simulation layout consists of N backbone routers interconnected
// by an ad hoc wifi network.
// Each backbone router also has a local 802.11 network and is connected
// to a local LAN. An additional set of (K-1) nodes are connected to
// this backbone. Finally, a local LAN is connected to each router
// on the backbone, with L-1 additional hosts.
//
// The nodes are populated with TCP/IP stacks, and OLSR unicast routing
// on the backbone. An example UDP transfer is shown. The simulator
// be configured to output tcpdumps or traces from different nodes.
//
//
// +--------------------------------------------------------+
// | |
// | 802.11 ad hoc, ns-2 mobility |
// | |
// +--------------------------------------------------------+
// | o o o (N backbone routers) |
// +--------+ +--------+
// wired LAN | mobile | wired LAN | mobile |
// -----------| router | -----------| router |
// --------- ---------
// | |
// +----------------+ +----------------+
// | 802.11 | | 802.11 |
// | net | | net |
// | K-1 hosts | | K-1 hosts |
// +----------------+ +----------------+
//
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/common-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/mobility-module.h"
#include "ns3/contrib-module.h"
#include "ns3/wifi-module.h"
using namespace ns3;
//
// Define logging keyword for this file
//
NS_LOG_COMPONENT_DEFINE ("MixedWireless");
//
// This function will be used below as a trace sink
//
#ifdef ENABLE_FOR_TRACING_EXAMPLE
static void
CourseChangeCallback (std::string path, Ptr<const MobilityModel> model)
{
Vector position = model->GetPosition ();
std::cout << "CourseChange " << path << " x=" << position.x << ", y=" << position.y << ", z=" << position.z << std::endl;
}
#endif
int
main (int argc, char *argv[])
{
//
// First, we declare and initialize a few local variables that control some
// simulation parameters.
//
uint32_t backboneNodes = 10;
uint32_t infraNodes = 5;
uint32_t lanNodes = 5;
uint32_t stopTime = 10;
//
// 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 ("448kb/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"
//
CommandLine cmd;
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);
//
// 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 (argc, argv);
// The metadata system (off by default) is used by ascii tracing below
Packet::EnableMetadata ();
///////////////////////////////////////////////////////////////////////////
// //
// Construct the backbone //
// //
///////////////////////////////////////////////////////////////////////////
//
// Create a container to manage the nodes of the adhoc (backbone) network.
// Later we'll create the rest of the nodes we'll need.
//
NodeContainer backbone;
backbone.Create (backboneNodes);
//
// Create the backbone wifi net devices and install them into the nodes in
// our container
//
WifiHelper wifi;
wifi.SetMac ("ns3::AdhocWifiMac");
wifi.SetPhy ("ns3::WifiPhy");
NetDeviceContainer backboneDevices = wifi.Install (backbone);
//
// Add the IPv4 protocol stack to the nodes in our container
//
InternetStackHelper internet;
internet.Install (backbone);
//
// Assign IPv4 addresses to the device drivers (actually to the associated
// IPv4 interfaces) we just created.
//
Ipv4AddressHelper ipAddrs;
ipAddrs.SetBase ("192.168.0.0", "255.255.255.0");
ipAddrs.Assign (backboneDevices);
//
// The ad-hoc network nodes need a mobility model so we aggregate one to
// 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.SetMobilityModel ("ns3::RandomDirection2dMobilityModel",
"Bounds", RectangleValue (Rectangle (0, 1000, 0, 1000)),
"Speed", RandomVariableValue (ConstantVariable (2000)),
"Pause", RandomVariableValue (ConstantVariable (0.2)));
mobility.Install (backbone);
///////////////////////////////////////////////////////////////////////////
// //
// Construct the LANs //
// //
///////////////////////////////////////////////////////////////////////////
// Reset the address base-- all of the CSMA networks will be in
// the "172.16 address space
ipAddrs.SetBase ("172.16.0.0", "255.255.255.0");
for (uint32_t i = 0; i < backboneNodes; ++i)
{
NS_LOG_INFO ("Configuring local area network for backbone node " << i);
//
// Create a container to manage the nodes of the LAN. We need
// two containers here; one with all of the new nodes, and one
// with all of the nodes including new and existing nodes
//
NodeContainer newLanNodes;
newLanNodes.Create (lanNodes - 1);
// Now, create the container with all nodes on this link
NodeContainer lan (backbone.Get (i), newLanNodes);
//
// Create the CSMA net devices and install them into the nodes in our
// collection.
//
CsmaHelper csma;
csma.SetChannelParameter ("DataRate",
DataRateValue (DataRate (5000000)));
csma.SetChannelParameter ("Delay", TimeValue (MilliSeconds (2)));
NetDeviceContainer lanDevices = csma.Install (lan);
//
// Add the IPv4 protocol stack to the new LAN nodes
//
internet.Install (newLanNodes);
//
// Assign IPv4 addresses to the device drivers (actually to the
// associated IPv4 interfaces) we just created.
//
ipAddrs.Assign (lanDevices);
//
// Assign a new network prefix for the next LAN, according to the
// network mask initialized above
//
ipAddrs.NewNetwork ();
}
///////////////////////////////////////////////////////////////////////////
// //
// Construct the mobile networks //
// //
///////////////////////////////////////////////////////////////////////////
// Reset the address base-- all of the 802.11 networks will be in
// the "10.0" address space
ipAddrs.SetBase ("10.0.0.0", "255.255.255.0");
for (uint32_t i = 0; i < backboneNodes; ++i)
{
NS_LOG_INFO ("Configuring wireless network for backbone node " << i);
//
// Create a container to manage the nodes of the LAN. We need
// two containers here; one with all of the new nodes, and one
// with all of the nodes including new and existing nodes
//
NodeContainer newInfraNodes;
newInfraNodes.Create (infraNodes - 1);
// Now, create the container with all nodes on this link
NodeContainer infra (backbone.Get (i), newInfraNodes);
//
// Create another ad hoc network and devices
//
WifiHelper wifiInfra;
wifiInfra.SetMac ("ns3::AdhocWifiMac");
wifiInfra.SetPhy ("ns3::WifiPhy");
NetDeviceContainer infraDevices = wifiInfra.Install (infra);
// Add the IPv4 protocol stack to the nodes in our container
//
internet.Install (newInfraNodes);
//
// Assign IPv4 addresses to the device drivers (actually to the associated
// IPv4 interfaces) we just created.
//
ipAddrs.Assign (infraDevices);
//
// Assign a new network prefix for each mobile network, according to
// the network mask initialized above
//
ipAddrs.NewNetwork ();
//
// The new wireless nodes need a mobility model so we aggregate one
// to each of the nodes we just finished building.
//
Ptr<ListPositionAllocator> subnetAlloc =
CreateObject<ListPositionAllocator> ();
for (uint32_t j = 0; j < infra.GetN (); ++j)
{
subnetAlloc->Add (Vector (0.0, j, 0.0));
}
mobility.PushReferenceMobilityModel (backbone.Get (i));
mobility.SetPositionAllocator (subnetAlloc);
mobility.SetMobilityModel ("ns3::RandomDirection2dMobilityModel",
"Bounds", RectangleValue (Rectangle (-25, 25, -25, 25)),
"Speed", RandomVariableValue (ConstantVariable (30)),
"Pause", RandomVariableValue (ConstantVariable (0.4)));
mobility.Install (infra);
}
///////////////////////////////////////////////////////////////////////////
// //
// Routing configuration //
// //
///////////////////////////////////////////////////////////////////////////
NS_LOG_INFO ("Enabling OLSR routing on all backbone nodes");
OlsrHelper olsr;
olsr.Install (backbone);
///////////////////////////////////////////////////////////////////////////
// //
// Application configuration //
// //
///////////////////////////////////////////////////////////////////////////
// Create the OnOff application to send UDP datagrams of size
// 210 bytes at a rate of 448 Kb/s, between two nodes
NS_LOG_INFO ("Create Applications.");
uint16_t 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
NS_ASSERT (lanNodes >= 5);
Ptr<Node> appSource = NodeList::GetNode (11);
Ptr<Node> appSink = NodeList::GetNode (13);
Ipv4Address remoteAddr = Ipv4Address ("172.16.0.5");
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (remoteAddr, port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer apps = onoff.Install (appSource);
apps.Start (Seconds (3.0));
apps.Stop (Seconds (20.0));
// 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));
///////////////////////////////////////////////////////////////////////////
// //
// Tracing configuration //
// //
///////////////////////////////////////////////////////////////////////////
NS_LOG_INFO ("Configure Tracing.");
//
// Let's set up some ns-2-like ascii traces, using another helper class
//
std::ofstream ascii;
ascii.open ("mixed-wireless.tr");
WifiHelper::EnableAsciiAll (ascii);
CsmaHelper::EnableAsciiAll (ascii);
// Look at nodes 11, 13 only
//WifiHelper::EnableAscii (ascii, 11, 0);
//WifiHelper::EnableAscii (ascii, 13, 0);
// Let's do a pcap trace on the backbone devices
WifiHelper::EnablePcap ("mixed-wireless", backboneDevices);
// Let's additionally trace the application Sink, ifIndex 0
CsmaHelper::EnablePcap ("mixed-wireless", appSink->GetId (), 0);
#ifdef ENABLE_FOR_TRACING_EXAMPLE
Config::Connect ("/NodeList/*/$MobilityModel/CourseChange",
MakeCallback (&CourseChangeCallback));
#endif
///////////////////////////////////////////////////////////////////////////
// //
// Run simulation //
// //
///////////////////////////////////////////////////////////////////////////
NS_LOG_INFO ("Run Simulation.");
Simulator::Stop (Seconds (stopTime));
Simulator::Run ();
Simulator::Destroy ();
}
+171
View File
@@ -0,0 +1,171 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
//
// Network topology
//
// n0
// \ 5 Mb/s, 2ms
// \ 1.5Mb/s, 10ms
// n2 ------------------------n3
// / /
// / 5 Mb/s, 2ms /
// n1--------------------------
// 1.5 Mb/s, 100ms
//
// this is a modification of simple-global-routing to allow for
// a single hop but higher-cost path between n1 and n3
//
// - Tracing of queues and packet receptions to file "simple-rerouting.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-route-manager.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleAlternateRoutingExample");
int
main (int argc, char *argv[])
{
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
#if 0
LogComponentEnable("GlobalRouteManager", LOG_LOGIC);
LogComponentEnable("GlobalRouter", LOG_LOGIC);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("300b/s"));
// The below metric, if set to 3 or higher, will cause packets between
// n1 and n3 to take the 2-hop route through n2
CommandLine cmd;
//
// Additionally, we plumb this metric into the default value / command
// line argument system as well, for exemplary purposes. This means
// that it can be resettable at the command-line to the program,
// rather than recompiling
// e.g. waf --run "simple-alternate-routing --AlternateCost=5"
uint16_t sampleMetric = 1;
cmd.AddValue ("AlternateCost",
"This metric is used in the example script between n3 and n1 ",
sampleMetric);
// Allow the user to override any of the defaults and the above
// DefaultValue::Bind ()s at run-time, via command-line arguments
cmd.Parse (argc, argv);
// Here, we will explicitly create four nodes. In more sophisticated
// topologies, we could configure a node factory.
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
NodeContainer n0n2 = NodeContainer (c.Get (0), c.Get (2));
NodeContainer n1n2 = NodeContainer (c.Get (1), c.Get (2));
NodeContainer n3n2 = NodeContainer (c.Get (3), c.Get (2));
NodeContainer n1n3 = NodeContainer (c.Get (1), c.Get (3));
// We create the channels first without any IP addressing information
NS_LOG_INFO ("Create channels.");
PointToPointHelper p2p;
p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps"));
p2p.SetChannelParameter ("Delay", StringValue ("2ms"));
NetDeviceContainer d0d2 = p2p.Install (n0n2);
NetDeviceContainer d1d2 = p2p.Install (n1n2);
p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps"));
p2p.SetChannelParameter ("Delay", StringValue ("10ms"));
NetDeviceContainer d3d2 = p2p.Install (n3n2);
p2p.SetChannelParameter ("Delay", StringValue ("100ms"));
NetDeviceContainer d1d3 = p2p.Install (n1n3);
InternetStackHelper internet;
internet.Install (c);
// Later, we add IP addresses. The middle two octets correspond to
// the channel number.
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.0.0.0", "255.255.255.0");
ipv4.Assign (d0d2);
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
ipv4.SetBase ("10.2.2.0", "255.255.255.0");
ipv4.Assign (d3d2);
ipv4.SetBase ("10.3.3.0", "255.255.255.0");
Ipv4InterfaceContainer i1i3 = ipv4.Assign (d1d3);
i1i3.SetMetric (0, sampleMetric);
i1i3.SetMetric (1, sampleMetric);
// Create router nodes, initialize routing database and set up the routing
// tables in the nodes.
GlobalRouteManager::PopulateRoutingTables ();
// Create the OnOff application to send UDP datagrams
NS_LOG_INFO ("Create Application.");
uint16_t port = 9; // Discard port (RFC 863)
// Create a flow from n3 to n1, starting at time 1.1 seconds
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (i1i2.GetAddress (0), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer apps = onoff.Install (c.Get (3));
apps.Start (Seconds (1.1));
apps.Start (Seconds (10.0));
// Create a packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
apps = sink.Install (c.Get (1));
apps.Start (Seconds (1.1));
apps.Stop (Seconds (10.0));
std::ofstream ascii;
ascii.open ("simple-alternate-routing.tr");
PointToPointHelper::EnablePcapAll ("simple-alternate-routing");
PointToPointHelper::EnableAsciiAll (ascii);
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
return 0;
}
+183
View File
@@ -0,0 +1,183 @@
/* -*- 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
*
* ns-2 simple.tcl script (ported from ns-2)
* Originally authored by Steve McCanne, 12/19/1996
*/
// Port of ns-2/tcl/ex/simple.tcl to ns-3
//
// Network topology
//
// n0
// \ 5 Mb/s, 2ms
// \ 1.5Mb/s, 10ms
// n2 -------------------------n3
// /
// / 5 Mb/s, 2ms
// n1
//
// - all links are point-to-point links with indicated one-way BW/delay
// - CBR/UDP flows from n0 to n3, and from n3 to n1
// - FTP/TCP flow from n0 to n3, starting at time 1.2 to time 1.35 sec.
// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
// (i.e., DataRate of 448,000 bps)
// - DropTail queues
// - Tracing of queues and packet receptions to file
// "simple-error-model.tr"
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/common-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-route-manager.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleErrorModelExample");
int
main (int argc, char *argv[])
{
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
#if 0
LogComponentEnable ("SimplePointToPointExample", LOG_LEVEL_INFO);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
// Set a few parameters
Config::SetDefault ("ns3::RateErrorModel::ErrorRate", DoubleValue (0.01));
Config::SetDefault ("ns3::RateErrorModel::ErrorUnit", StringValue ("EU_PKT"));
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
Config::SetDefault ("ns3::OnOffApplication::DataRate", DataRateValue (DataRate ("448kb/s")));
// Allow the user to override any of the defaults and the above
// Bind()s at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
// Here, we will explicitly create four nodes. In more sophisticated
// topologies, we could configure a node factory.
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
NodeContainer n0n2 = NodeContainer (c.Get (0), c.Get (2));
NodeContainer n1n2 = NodeContainer (c.Get (1), c.Get (2));
NodeContainer n3n2 = NodeContainer (c.Get (3), c.Get (2));
InternetStackHelper internet;
internet.Install (c);
// We create the channels first without any IP addressing information
NS_LOG_INFO ("Create channels.");
PointToPointHelper p2p;
p2p.SetDeviceParameter ("DataRate", DataRateValue (DataRate (5000000)));
p2p.SetChannelParameter ("Delay", TimeValue (MilliSeconds (2)));
NetDeviceContainer d0d2 = p2p.Install (n0n2);
NetDeviceContainer d1d2 = p2p.Install (n1n2);
p2p.SetDeviceParameter ("DataRate", DataRateValue (DataRate (1500000)));
p2p.SetChannelParameter ("Delay", TimeValue (MilliSeconds (10)));
NetDeviceContainer d3d2 = p2p.Install (n3n2);
// Later, we add IP addresses.
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
ipv4.Assign (d0d2);
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
NS_LOG_INFO ("Use global routing.");
GlobalRouteManager::PopulateRoutingTables ();
// Create the OnOff application to send UDP datagrams of size
// 210 bytes at a rate of 448 Kb/s
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (i3i2.GetAddress (1), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable(1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable(0)));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start(Seconds(1.0));
apps.Stop (Seconds(10.0));
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
apps = sink.Install (c.Get (3));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (i1i2.GetAddress (0), port)));
apps = onoff.Install (c.Get (3));
apps.Start(Seconds(1.1));
apps.Stop (Seconds(10.0));
// Create a packet sink to receive these packets
sink.SetAttribute ("Local",
AddressValue (InetSocketAddress (Ipv4Address::GetAny (), port)));
apps = sink.Install (c.Get (1));
apps.Start (Seconds (1.1));
apps.Stop (Seconds (10.0));
//
// Error model
//
// Create an ErrorModel based on the implementation (constructor)
// specified by the default classId
Ptr<RateErrorModel> em = CreateObject<RateErrorModel> ("RanVar", RandomVariableValue (UniformVariable (0.0, 1.0)),
"ErrorRate", DoubleValue (0.001));
d3d2.Get (0)->SetAttribute ("ReceiveErrorModel", PointerValue (em));
// Now, let's use the ListErrorModel and explicitly force a loss
// of the packets with pkt-uids = 11 and 17 on node 2, device 0
std::list<uint32_t> sampleList;
sampleList.push_back (11);
sampleList.push_back (17);
// This time, we'll explicitly create the error model we want
Ptr<ListErrorModel> pem = CreateObject<ListErrorModel> ();
pem->SetList (sampleList);
d0d2.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (pem));
std::ofstream ascii;
ascii.open ("simple-error-model.tr");
PointToPointHelper::EnablePcapAll ("simple-error-model");
PointToPointHelper::EnableAsciiAll (ascii);
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+163
View File
@@ -0,0 +1,163 @@
/* -*- 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
*
* ns-2 simple.tcl script (ported from ns-2)
* Originally authored by Steve McCanne, 12/19/1996
*/
// Port of ns-2/tcl/ex/simple.tcl to ns-3
//
// Network topology
//
// n0
// \ 5 Mb/s, 2ms
// \ 1.5Mb/s, 10ms
// n2 -------------------------n3
// /
// / 5 Mb/s, 2ms
// n1
//
// - all links are point-to-point links with indicated one-way BW/delay
// - CBR/UDP flows from n0 to n3, and from n3 to n1
// - FTP/TCP flow from n0 to n3, starting at time 1.2 to time 1.35 sec.
// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
// (i.e., DataRate of 448,000 bps)
// - DropTail queues
// - Tracing of queues and packet receptions to file "simple-global-routing.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-route-manager.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleGlobalRoutingExample");
int
main (int argc, char *argv[])
{
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
#if 0
LogComponentEnable ("SimpleGlobalRoutingExample", LOG_LEVEL_INFO);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
// Set up some default values for the simulation. Use the
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s"));
//DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30);
// Allow the user to override any of the defaults and the above
// DefaultValue::Bind ()s at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
// Here, we will explicitly create four nodes. In more sophisticated
// topologies, we could configure a node factory.
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
NodeContainer n0n2 = NodeContainer (c.Get(0), c.Get (2));
NodeContainer n1n2 = NodeContainer (c.Get(1), c.Get (2));
NodeContainer n3n2 = NodeContainer (c.Get(3), c.Get (2));
InternetStackHelper internet;
internet.Install (c);
// We create the channels first without any IP addressing information
NS_LOG_INFO ("Create channels.");
PointToPointHelper p2p;
p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps"));
p2p.SetChannelParameter ("Delay", StringValue ("2ms"));
NetDeviceContainer d0d2 = p2p.Install (n0n2);
NetDeviceContainer d1d2 = p2p.Install (n1n2);
p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps"));
p2p.SetChannelParameter ("Delay", StringValue ("10ms"));
NetDeviceContainer d3d2 = p2p.Install (n3n2);
// Later, we add IP addresses.
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i0i2 = ipv4.Assign (d0d2);
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
// Create router nodes, initialize routing database and set up the routing
// tables in the nodes.
GlobalRouteManager::PopulateRoutingTables ();
// Create the OnOff application to send UDP datagrams of size
// 210 bytes at a rate of 448 Kb/s
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (i3i2.GetAddress (0), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
// Create a packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
apps = sink.Install (c.Get (3));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (i1i2.GetAddress (0), port)));
apps = onoff.Install (c.Get (3));
apps.Start (Seconds (1.1));
apps.Stop (Seconds (10.0));
// Create a packet sink to receive these packets
apps = sink.Install (c.Get (1));
apps.Start (Seconds (1.1));
apps.Stop (Seconds (10.0));
std::ofstream ascii;
ascii.open ("simple-global-routing.tr");
PointToPointHelper::EnablePcapAll ("simple-global-routing");
PointToPointHelper::EnableAsciiAll (ascii);
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
return 0;
}
-191
View File
@@ -1,191 +0,0 @@
/* -*- 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
*
* ns-2 simple.tcl script (ported from ns-2)
* Originally authored by Steve McCanne, 12/19/1996
*/
// Port of ns-2/tcl/ex/simple.tcl to ns-3
//
// Network topology
//
// n0
// \ 5 Mb/s, 2ms
// \ 1.5Mb/s, 10ms
// n2 -------------------------n3
// /
// / 5 Mb/s, 2ms
// n1
//
// - all links are p2p links with indicated one-way BW/delay
// - CBR/UDP flows from n0 to n3, and from n3 to n1
// - FTP/TCP flow from n0 to n3, starting at time 1.2 to time 1.35 sec.
// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
// (i.e., DataRate of 448,000 bps)
// - DropTail queues
// - Tracing of queues and packet receptions to file "simple-p2p.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/command-line.h"
#include "ns3/default-value.h"
#include "ns3/ptr.h"
#include "ns3/random-variable.h"
#include "ns3/simulator.h"
#include "ns3/nstime.h"
#include "ns3/data-rate.h"
#include "ns3/ascii-trace.h"
#include "ns3/pcap-trace.h"
#include "ns3/internet-node.h"
#include "ns3/p2p-channel.h"
#include "ns3/p2p-net-device.h"
#include "ns3/mac-address.h"
#include "ns3/ipv4-address.h"
#include "ns3/ipv4.h"
#include "ns3/socket.h"
#include "ns3/ipv4-route.h"
#include "ns3/p2p-topology.h"
#include "ns3/onoff-application.h"
using namespace ns3;
int main (int argc, char *argv[])
{
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
#if 0
DebugComponentEnable("Object");
DebugComponentEnable("Queue");
DebugComponentEnable("DropTailQueue");
DebugComponentEnable("Channel");
DebugComponentEnable("PointToPointChannel");
DebugComponentEnable("PointToPointNetDevice");
#endif
// Set up some default values for the simulation. Use the Bind()
// technique to tell the system what subclass of Queue to use,
// and what the queue limit is
// The below Bind command tells the queue factory which class to
// instantiate, when the queue factory is invoked in the topology code
Bind ("Queue", "DropTailQueue");
Bind ("OnOffApplicationPacketSize", "210");
Bind ("OnOffApplicationDataRate", "448kb/s");
//Bind ("DropTailQueue::m_maxPackets", 30);
// Allow the user to override any of the defaults and the above
// Bind()s at run-time, via command-line arguments
CommandLine::Parse (argc, argv);
// Here, we will explicitly create four nodes. In more sophisticated
// topologies, we could configure a node factory.
Ptr<Node> n0 = Create<InternetNode> ();
Ptr<Node> n1 = Create<InternetNode> ();
Ptr<Node> n2 = Create<InternetNode> ();
Ptr<Node> n3 = Create<InternetNode> ();
// We create the channels first without any IP addressing information
Ptr<PointToPointChannel> channel0 =
PointToPointTopology::AddPointToPointLink (
n0, n2, DataRate(5000000), MilliSeconds(2));
Ptr<PointToPointChannel> channel1 =
PointToPointTopology::AddPointToPointLink (
n1, n2, DataRate(5000000), MilliSeconds(2));
Ptr<PointToPointChannel> channel2 =
PointToPointTopology::AddPointToPointLink (
n2, n3, DataRate(1500000), MilliSeconds(10));
// Later, we add IP addresses.
PointToPointTopology::AddIpv4Addresses (
channel0, n0, Ipv4Address("10.1.1.1"),
n2, Ipv4Address("10.1.1.2"));
PointToPointTopology::AddIpv4Addresses (
channel1, n1, Ipv4Address("10.1.2.1"),
n2, Ipv4Address("10.1.2.2"));
PointToPointTopology::AddIpv4Addresses (
channel2, n2, Ipv4Address("10.1.3.1"),
n3, Ipv4Address("10.1.3.2"));
// Finally, we add static routes. These three steps (Channel and
// NetDevice creation, IP Address assignment, and routing) are
// separated because there may be a need to postpone IP Address
// assignment (emulation) or modify to use dynamic routing
PointToPointTopology::AddIpv4Routes(n0, n2, channel0);
PointToPointTopology::AddIpv4Routes(n1, n2, channel1);
PointToPointTopology::AddIpv4Routes(n2, n3, channel2);
// Create the OnOff application to send UDP datagrams of size
// 210 bytes at a rate of 448 Kb/s
Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
n0,
Ipv4Address("10.1.3.2"),
80,
"Udp",
ConstantVariable(1),
ConstantVariable(0));
// Start the application
ooff->Start(Seconds(1.0));
ooff->Stop (Seconds(10.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
ooff = Create<OnOffApplication> (
n3,
Ipv4Address("10.1.2.1"),
80,
"Udp",
ConstantVariable(1),
ConstantVariable(0));
// Start the application
ooff->Start(Seconds(1.1));
ooff->Stop (Seconds(10.0));
// Here, finish off packet routing configuration
// This will likely set by some global StaticRouting object in the future
Ptr<Ipv4> ipv4;
ipv4 = n0->QueryInterface<Ipv4> (Ipv4::iid);
ipv4->SetDefaultRoute (Ipv4Address ("10.1.1.2"), 1);
ipv4 = n3->QueryInterface<Ipv4> (Ipv4::iid);
ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.1"), 1);
// Configure tracing of all enqueue, dequeue, and NetDevice receive events
// Trace output will be sent to the simple-p2p.tr file
AsciiTrace asciitrace ("simple-p2p.tr");
asciitrace.TraceAllQueues ();
asciitrace.TraceAllNetDeviceRx ();
// Also configure some tcpdump traces; each interface will be traced
// The output files will be named simple-p2p.pcap-<nodeId>-<interfaceId>
// and can be read by the "tcpdump -r" command (use "-tt" option to
// display timestamps correctly)
PcapTrace pcaptrace ("simple-p2p.pcap");
pcaptrace.TraceAllIp ();
Simulator::Run ();
Simulator::Destroy ();
}
+172
View File
@@ -0,0 +1,172 @@
/* -*- 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
*
* ns-2 simple.tcl script (ported from ns-2)
* Originally authored by Steve McCanne, 12/19/1996
*/
// Port of ns-2/tcl/ex/simple.tcl to ns-3
//
// Network topology
//
// n0
// \ 5 Mb/s, 2ms
// \ 1.5Mb/s, 10ms
// n2 -------------------------n3---------n4
// /
// / 5 Mb/s, 2ms
// n1
//
// - all links are point-to-point links with indicated one-way BW/delay
// - CBR/UDP flows from n0 to n3, and from n3 to n1
// - FTP/TCP flow from n0 to n3, starting at time 1.2 to time 1.35 sec.
// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
// (i.e., DataRate of 448,000 bps)
// - DropTail queues
// - Tracing of queues and packet receptions to file "simple-point-to-point-olsr.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("SimpleGlobalRoutingExample");
int
main (int argc, char *argv[])
{
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
#if 0
LogComponentEnable ("SimpleGlobalRoutingExample", LOG_LEVEL_INFO);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
// Set up some default values for the simulation. Use the
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s"));
//DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30);
// Allow the user to override any of the defaults and the above
// DefaultValue::Bind ()s at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
// Here, we will explicitly create four nodes. In more sophisticated
// topologies, we could configure a node factory.
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (5);
NodeContainer n02 = NodeContainer (c.Get(0), c.Get (2));
NodeContainer n12 = NodeContainer (c.Get(1), c.Get (2));
NodeContainer n32 = NodeContainer (c.Get(3), c.Get (2));
NodeContainer n34 = NodeContainer (c.Get (3), c.Get (4));
InternetStackHelper internet;
internet.Install (c);
// We create the channels first without any IP addressing information
NS_LOG_INFO ("Create channels.");
PointToPointHelper p2p;
p2p.SetDeviceParameter ("DataRate", StringValue ("5Mbps"));
p2p.SetChannelParameter ("Delay", StringValue ("2ms"));
NetDeviceContainer nd02 = p2p.Install (n02);
NetDeviceContainer nd12 = p2p.Install (n12);
p2p.SetDeviceParameter ("DataRate", StringValue ("1500kbps"));
p2p.SetChannelParameter ("Delay", StringValue ("10ms"));
NetDeviceContainer nd32 = p2p.Install (n32);
NetDeviceContainer nd34 = p2p.Install (n34);
// Later, we add IP addresses.
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i02 = ipv4.Assign (nd02);
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
Ipv4InterfaceContainer i12 = ipv4.Assign (nd12);
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
Ipv4InterfaceContainer i32 = ipv4.Assign (nd32);
ipv4.SetBase ("10.1.4.0", "255.255.255.0");
Ipv4InterfaceContainer i34 = ipv4.Assign (nd34);
// Enable OLSR
NS_LOG_INFO ("Enabling OLSR Routing.");
OlsrHelper olsr;
olsr.InstallAll ();
// Create the OnOff application to send UDP datagrams of size
// 210 bytes at a rate of 448 Kb/s
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
InetSocketAddress (i34.GetAddress (1), port));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
// Create a packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), port));
apps = sink.Install (c.Get (3));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (i12.GetAddress (0), port)));
apps = onoff.Install (c.Get (3));
apps.Start (Seconds (1.1));
apps.Stop (Seconds (10.0));
// Create a packet sink to receive these packets
apps = sink.Install (c.Get (1));
apps.Start (Seconds (1.1));
apps.Stop (Seconds (10.0));
std::ofstream ascii;
ascii.open ("simple-point-to-point-olsr.tr");
PointToPointHelper::EnablePcapAll ("simple-point-to-point-olsr");
PointToPointHelper::EnableAsciiAll (ascii);
Simulator::Stop (Seconds (30));
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
return 0;
}
+220
View File
@@ -0,0 +1,220 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
//
// Network topology
//
// 10Mb/s, 10ms 10Mb/s, 10ms
// n0-----------------n1-----------------n2
//
//
// - Tracing of queues and packet receptions to file
// "tcp-large-transfer.tr"
// - pcap traces also generated in the following files
// "tcp-large-transfer-$n-$i.pcap" where n and i represent node and interface
// numbers respectively
// Usage (e.g.): ./waf --run tcp-large-transfer
#include <ctype.h>
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/helper-module.h"
#include "ns3/node-module.h"
#include "ns3/global-route-manager.h"
#include "ns3/simulator-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TcpLargeTransfer");
// The number of bytes to send in this simulation.
static uint32_t txBytes = 2000000;
// These are for starting the writing process, and handling the sending
// socket's notification upcalls (events). These two together more or less
// implement a sending "Application", although not a proper ns3::Application
// subclass.
void StartFlow(Ptr<Socket>, Ipv4Address, uint16_t);
void WriteUntilBufferFull (Ptr<Socket>, uint32_t);
int main (int argc, char *argv[])
{
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
// LogComponentEnable("TcpL4Protocol", LOG_LEVEL_ALL);
// LogComponentEnable("TcpSocketImpl", LOG_LEVEL_ALL);
// LogComponentEnable("PacketSink", LOG_LEVEL_ALL);
// LogComponentEnable("TcpLargeTransfer", LOG_LEVEL_ALL);
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
// Allow the user to override any of the defaults and the above
// Bind()s at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
// Here, we will explicitly create three nodes. The first container contains
// nodes 0 and 1 from the diagram above, and the second one contains nodes
// 1 and 2. This reflects the channel connectivity, and will be used to
// install the network interfaces and connect them with a channel.
NodeContainer n0n1;
n0n1.Create (2);
NodeContainer n1n2;
n1n2.Add (n0n1.Get (1));
n1n2.Create (1);
// We create the channels first without any IP addressing information
// First make and configure the helper, so that it will put the appropriate
// parameters on the network interfaces and channels we are about to install.
PointToPointHelper p2p;
p2p.SetDeviceParameter ("DataRate", DataRateValue (DataRate(10000000)));
p2p.SetChannelParameter ("Delay", TimeValue (MilliSeconds(10)));
// And then install devices and channels connecting our topology.
NetDeviceContainer dev0 = p2p.Install (n0n1);
NetDeviceContainer dev1 = p2p.Install (n1n2);
// Now add ip/tcp stack to all nodes.
NodeContainer allNodes = NodeContainer (n0n1, n1n2.Get (1));
InternetStackHelper internet;
internet.Install (allNodes);
// Later, we add IP addresses.
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
ipv4.Assign (dev0);
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev1);
// and setup ip routing tables to get total ip-level connectivity.
GlobalRouteManager::PopulateRoutingTables ();
///////////////////////////////////////////////////////////////////////////
// Simulation 1
//
// Send 2000000 bytes over a connection to server port 50000 at time 0
// Should observe SYN exchange, a lot of data segments and ACKS, and FIN
// exchange. FIN exchange isn't quite compliant with TCP spec (see release
// notes for more info)
//
///////////////////////////////////////////////////////////////////////////
uint16_t servPort = 50000;
// Create a packet sink to receive these packets on n2...
PacketSinkHelper sink ("ns3::TcpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), servPort));
ApplicationContainer apps = sink.Install (n1n2.Get (1));
apps.Start (Seconds (0.0));
// Create a source to send packets from n0. Instead of a full Application
// and the helper APIs you might see in other example files, this example
// will use sockets directly and register some socket callbacks as a sending
// "Application".
// Create and bind the socket...
Ptr<Socket> localSocket =
Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ());
localSocket->Bind ();
// ...and schedule the sending "Application"; This is similar to what an
// ns3::Application subclass would do internally.
Simulator::ScheduleNow (&StartFlow, localSocket,
ipInterfs.GetAddress (1), servPort);
// One can toggle the comment for the following line on or off to see the
// effects of finite send buffer modelling. One can also change the size of
// said buffer.
//localSocket->SetAttribute("SndBufSize", UintegerValue(4096));
//Ask for ASCII and pcap traces of network traffic
std::ofstream ascii;
ascii.open ("tcp-large-transfer.tr");
PointToPointHelper::EnableAsciiAll (ascii);
PointToPointHelper::EnablePcapAll ("tcp-large-transfer");
// Finally, set up the simulator to run. The 1000 second hard limit is a
// failsafe in case some change above causes the simulation to never end
Simulator::Stop (Seconds(1000));
Simulator::Run ();
Simulator::Destroy ();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//begin implementation of sending "Application"
void StartFlow(Ptr<Socket> localSocket,
Ipv4Address servAddress,
uint16_t servPort)
{
NS_LOG_LOGIC("Starting flow at time " << Simulator::Now ().GetSeconds ());
localSocket->Connect (InetSocketAddress (servAddress, servPort));//connect
// tell the tcp implementation to call WriteUntilBufferFull again
// if we blocked and new tx buffer space becomes available
localSocket->SetSendCallback (MakeCallback (&WriteUntilBufferFull));
WriteUntilBufferFull (localSocket, txBytes);
}
void WriteUntilBufferFull (Ptr<Socket> localSocket, uint32_t txSpace)
{
// Perform series of 1040 byte writes (this is a multiple of 26 since
// we want to detect data splicing in the output stream)
uint32_t writeSize = 1040;
uint8_t data[writeSize];
while (txBytes > 0) {
uint32_t curSize= txBytes > writeSize ? writeSize : txBytes;
if (curSize > txSpace)
curSize = txSpace;
for(uint32_t i = 0; i < curSize; ++i)
{
char m = toascii (97 + i % 26);
data[i] = m;
}
int amountSent = localSocket->Send (data, curSize, 0);
if(amountSent < 0)
{
// we will be called again when new tx space becomes available.
std::cout << "Socket blocking, " << txBytes << " left to write, returning" << std::endl;
return;
}
txBytes -= curSize;
if (amountSent != (int)curSize)
{
std::cout << "Short Write, returning" << std::endl;
return;
}
}
localSocket->Close ();
}
+141
View File
@@ -0,0 +1,141 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Network topology
//
// n0 n1 n2 n3
// | | | |
// =================
// LAN
//
// - UDP flows from n0 to n1 and back
// - DropTail queues
// - Tracing of queues and packet receptions to file "udp-echo.tr"
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("UdpEchoExample");
int
main (int argc, char *argv[])
{
//
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
//
#if 0
LogComponentEnable ("UdpEchoExample", LOG_LEVEL_INFO);
LogComponentEnable("Object", LOG_LEVEL_ALL);
LogComponentEnable("Queue", LOG_LEVEL_ALL);
LogComponentEnable("DropTailQueue", LOG_LEVEL_ALL);
LogComponentEnable("Channel", LOG_LEVEL_ALL);
LogComponentEnable("CsmaChannel", LOG_LEVEL_ALL);
LogComponentEnable("NetDevice", LOG_LEVEL_ALL);
LogComponentEnable("CsmaNetDevice", LOG_LEVEL_ALL);
LogComponentEnable("Ipv4L3Protocol", LOG_LEVEL_ALL);
LogComponentEnable("PacketSocket", LOG_LEVEL_ALL);
LogComponentEnable("Socket", LOG_LEVEL_ALL);
LogComponentEnable("UdpSocket", LOG_LEVEL_ALL);
LogComponentEnable("UdpL4Protocol", LOG_LEVEL_ALL);
LogComponentEnable("Ipv4L3Protocol", LOG_LEVEL_ALL);
LogComponentEnable("Ipv4StaticRouting", LOG_LEVEL_ALL);
LogComponentEnable("Ipv4Interface", LOG_LEVEL_ALL);
LogComponentEnable("ArpIpv4Interface", LOG_LEVEL_ALL);
LogComponentEnable("Ipv4LoopbackInterface", LOG_LEVEL_ALL);
LogComponentEnable("OnOffApplication", LOG_LEVEL_ALL);
LogComponentEnable("PacketSinkApplication", LOG_LEVEL_ALL);
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_ALL);
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_ALL);
#endif
// Allow the user to override any of the defaults and the above Bind() at
// run-time, via command-line arguments
//
CommandLine cmd;
cmd.Parse (argc, argv);
//
// Explicitly create the nodes required by the topology (shown above).
//
NS_LOG_INFO ("Create nodes.");
NodeContainer n;
n.Create (4);
InternetStackHelper internet;
internet.Install (n);
NS_LOG_INFO ("Create channels.");
//
// Explicitly create the channels required by the topology (shown above).
//
CsmaHelper csma;
csma.SetChannelParameter ("DataRate", DataRateValue (DataRate(5000000)));
csma.SetChannelParameter ("Delay", TimeValue (MilliSeconds (2)));
NetDeviceContainer d = csma.Install (n);
Ipv4AddressHelper ipv4;
//
// We've got the "hardware" in place. Now we need to add IP addresses.
//
NS_LOG_INFO ("Assign IP Addresses.");
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = ipv4.Assign (d);
NS_LOG_INFO ("Create Applications.");
//
// Create a UdpEchoServer application on node one.
//
uint16_t port = 9; // well-known echo port number
UdpEchoServerHelper server;
server.SetPort (port);
ApplicationContainer apps = server.Install (n.Get(1));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
//
// Create a UdpEchoClient application to send UDP datagrams from node zero to
// node one.
//
uint32_t packetSize = 1024;
uint32_t maxPacketCount = 1;
Time interPacketInterval = Seconds (1.);
UdpEchoClientHelper client;
client.SetRemote (i.GetAddress (1), port);
client.SetAppAttribute ("MaxPackets", UintegerValue (maxPacketCount));
client.SetAppAttribute ("Interval", TimeValue (interPacketInterval));
client.SetAppAttribute ("PacketSize", UintegerValue (packetSize));
apps = client.Install (n.Get (0));
apps.Start (Seconds (2.0));
apps.Stop (Seconds (10.0));
std::ofstream ascii;
ascii.open ("udp-echo.tr");
CsmaHelper::EnablePcapAll ("udp-echo");
CsmaHelper::EnableAsciiAll (ascii);
//
// Now, do the actual simulation.
//
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
Vendored Executable
+1
View File
@@ -0,0 +1 @@
exec "`dirname "$0"`"/../waf "$@"
+261
View File
@@ -0,0 +1,261 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005,2006,2007 INRIA
*
* 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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#include "ns3/core-module.h"
#include "ns3/common-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/mobility-module.h"
#include "ns3/contrib-module.h"
#include <iostream>
NS_LOG_COMPONENT_DEFINE ("Main");
using namespace ns3;
class Experiment
{
public:
Experiment ();
Experiment (std::string name);
GnuplotDataset Run (const WifiHelper &wifi);
private:
void ReceivePacket (Ptr<Socket> socket);
void SetPosition (Ptr<Node> node, Vector position);
Vector GetPosition (Ptr<Node> node);
void AdvancePosition (Ptr<Node> node);
Ptr<Socket> SetupPacketReceive (Ptr<Node> node);
uint32_t m_bytesTotal;
GnuplotDataset m_output;
};
Experiment::Experiment ()
: m_output ()
{}
Experiment::Experiment (std::string name)
: m_output (name)
{
m_output.SetStyle (GnuplotDataset::LINES);
}
void
Experiment::SetPosition (Ptr<Node> node, Vector position)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
mobility->SetPosition (position);
}
Vector
Experiment::GetPosition (Ptr<Node> node)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
return mobility->GetPosition ();
}
void
Experiment::AdvancePosition (Ptr<Node> node)
{
Vector pos = GetPosition (node);
double mbs = ((m_bytesTotal * 8.0) / 1000000);
m_bytesTotal = 0;
m_output.Add (pos.x, mbs);
pos.x += 1.0;
if (pos.x >= 210.0)
{
return;
}
SetPosition (node, pos);
//std::cout << "x="<<pos.x << std::endl;
Simulator::Schedule (Seconds (1.0), &Experiment::AdvancePosition, this, node);
}
void
Experiment::ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
while (packet = socket->Recv ())
{
m_bytesTotal += packet->GetSize ();
}
}
Ptr<Socket>
Experiment::SetupPacketReceive (Ptr<Node> node)
{
TypeId tid = TypeId::LookupByName ("ns3::PacketSocketFactory");
Ptr<Socket> sink = Socket::CreateSocket (node, tid);
sink->Bind ();
sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this));
return sink;
}
GnuplotDataset
Experiment::Run (const WifiHelper &wifi)
{
m_bytesTotal = 0;
NodeContainer c;
c.Create (2);
PacketSocketHelper packetSocket;
packetSocket.Install (c);
NetDeviceContainer devices = wifi.Install (c);
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (5.0, 0.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::StaticMobilityModel");
mobility.Install (c);
PacketSocketAddress socket;
socket.SetSingleDevice(devices.Get (0)->GetIfIndex ());
socket.SetPhysicalAddress (devices.Get (1)->GetAddress ());
socket.SetProtocol (1);
OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (250)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate (60000000)));
onoff.SetAttribute ("PacketSize", UintegerValue (2000));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (0.5));
apps.Stop (Seconds (250.0));
Simulator::Schedule (Seconds (1.5), &Experiment::AdvancePosition, this, c.Get (1));
Ptr<Socket> recvSink = SetupPacketReceive (c.Get (1));
Simulator::Run ();
Simulator::Destroy ();
return m_output;
}
int main (int argc, char *argv[])
{
// disable fragmentation
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200"));
CommandLine cmd;
cmd.Parse (argc, argv);
Gnuplot gnuplot = Gnuplot ("reference-rates.png");
Experiment experiment;
WifiHelper wifi;
GnuplotDataset dataset;
wifi.SetMac ("ns3::AdhocWifiMac");
wifi.SetPhy ("ns3::WifiPhy");
NS_LOG_DEBUG ("54");
experiment = Experiment ("54mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-54mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("48");
experiment = Experiment ("48mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-48mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("36");
experiment = Experiment ("36mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-36mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("24");
experiment = Experiment ("24mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-24mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("18");
experiment = Experiment ("18mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-18mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("12");
experiment = Experiment ("12mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-12mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("9");
experiment = Experiment ("9mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-9mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("6");
experiment = Experiment ("6mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-6mbs"));
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
gnuplot.GenerateOutput (std::cout);
gnuplot = Gnuplot ("rate-control.png");
Config::SetDefault ("ns3::WifiPhy::Standard", StringValue ("holland"));
NS_LOG_DEBUG ("arf");
experiment = Experiment ("arf");
wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("aarf");
experiment = Experiment ("aarf");
wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("ideal");
experiment = Experiment ("ideal");
wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
dataset = experiment.Run (wifi);
gnuplot.AddDataset (dataset);
gnuplot.GenerateOutput (std::cout);
return 0;
}
+187
View File
@@ -0,0 +1,187 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005,2006,2007 INRIA
*
* 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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#include "ns3/core-module.h"
#include "ns3/common-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/mobility-module.h"
#include "ns3/contrib-module.h"
#include "ns3/wifi-module.h"
#include <iostream>
using namespace ns3;
void
DevTxTrace (std::string context, Ptr<const Packet> p, Mac48Address address)
{
std::cout << " TX to=" << address << " p: " << *p << std::endl;
}
void
DevRxTrace (std::string context, Ptr<const Packet> p, Mac48Address address)
{
std::cout << " RX from=" << address << " p: " << *p << std::endl;
}
void
PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble)
{
std::cout << "PHYRXOK mode=" << mode << " snr=" << snr << " " << *packet << std::endl;
}
void
PhyRxErrorTrace (std::string context, Ptr<const Packet> packet, double snr)
{
std::cout << "PHYRXERROR snr=" << snr << " " << *packet << std::endl;
}
void
PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
{
std::cout << "PHYTX mode=" << mode << " " << *packet << std::endl;
}
void
PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state)
{
std::cout << " state=";
switch (state) {
case WifiPhy::TX:
std::cout << "tx ";
break;
case WifiPhy::SYNC:
std::cout << "sync ";
break;
case WifiPhy::CCA_BUSY:
std::cout << "cca-busy";
break;
case WifiPhy::IDLE:
std::cout << "idle ";
break;
}
std::cout << " start="<<start<<" duration="<<duration<<std::endl;
}
static void
SetPosition (Ptr<Node> node, Vector position)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
mobility->SetPosition (position);
}
static Vector
GetPosition (Ptr<Node> node)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
return mobility->GetPosition ();
}
static void
AdvancePosition (Ptr<Node> node)
{
Vector pos = GetPosition (node);
pos.x += 5.0;
if (pos.x >= 210.0)
{
return;
}
SetPosition (node, pos);
//std::cout << "x="<<pos.x << std::endl;
Simulator::Schedule (Seconds (1.0), &AdvancePosition, node);
}
int main (int argc, char *argv[])
{
Packet::EnableMetadata ();
// enable rts cts all the time.
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
// disable fragmentation
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
WifiHelper wifi;
MobilityHelper mobility;
NodeContainer stas;
NodeContainer ap;
NetDeviceContainer staDevs;
PacketSocketHelper packetSocket;
stas.Create (2);
ap.Create (1);
// give packet socket powers to nodes.
packetSocket.Install (stas);
packetSocket.Install (ap);
Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
channel->SetPropagationLossModel (log);
Ssid ssid = Ssid ("wifi-default");
wifi.SetPhy ("ns3::WifiPhy");
wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
// setup stas.
wifi.SetMac ("ns3::NqstaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
staDevs = wifi.Install (stas, channel);
// setup ap.
wifi.SetMac ("ns3::NqapWifiMac", "Ssid", SsidValue (ssid),
"BeaconGeneration", BooleanValue (true),
"BeaconInterval", TimeValue (Seconds (2.5)));
wifi.Install (ap, channel);
// mobility.
mobility.Install (stas);
mobility.Install (ap);
Simulator::Schedule (Seconds (1.0), &AdvancePosition, ap.Get (0));
PacketSocketAddress socket;
socket.SetSingleDevice(staDevs.Get (0)->GetIfIndex ());
socket.SetPhysicalAddress (staDevs.Get (1)->GetAddress ());
socket.SetProtocol (1);
OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (42)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer apps = onoff.Install (stas.Get (0));
apps.Start (Seconds (0.5));
apps.Stop (Seconds (43.0));
Simulator::Stop (Seconds (44.0));
Config::Connect ("/NodeList/*/DeviceList/*/Tx", MakeCallback (&DevTxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Rx", MakeCallback (&DevRxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/RxOk", MakeCallback (&PhyRxOkTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/RxError", MakeCallback (&PhyRxErrorTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/Tx", MakeCallback (&PhyTxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State", MakeCallback (&PhyStateTrace));
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
+56 -8
View File
@@ -1,13 +1,61 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import Params
def build(bld):
def create_ns_prog(name, source, deps=['core', 'common', 'simulator']):
obj = bld.create_obj('cpp', 'program')
obj.target = name
obj.uselib_local = ["ns3-%s" % dep for dep in deps]
obj.source = source
return obj
obj = create_ns_prog('simple-p2p', 'simple-p2p.cc', deps=['p2p', 'internet-node'])
obj = bld.create_ns3_program('mixed-wireless',
['core', 'simulator', 'mobility', 'wifi', 'point-to-point', 'internet-stack'])
obj.source = 'mixed-wireless.cc'
obj = bld.create_ns3_program('simple-global-routing',
['point-to-point', 'internet-stack', 'global-routing'])
obj.source = 'simple-global-routing.cc'
obj = bld.create_ns3_program('simple-alternate-routing',
['point-to-point', 'internet-stack', 'global-routing'])
obj.source = 'simple-alternate-routing.cc'
obj = bld.create_ns3_program('simple-error-model',
['point-to-point', 'internet-stack'])
obj.source = 'simple-error-model.cc'
obj = bld.create_ns3_program('csma-one-subnet',
['csma', 'internet-stack'])
obj.source = 'csma-one-subnet.cc'
obj = bld.create_ns3_program('udp-echo',
['csma', 'internet-stack'])
obj.source = 'udp-echo.cc'
obj = bld.create_ns3_program('csma-broadcast',
['csma', 'internet-stack'])
obj.source = 'csma-broadcast.cc'
obj = bld.create_ns3_program('csma-packet-socket',
['csma', 'internet-stack'])
obj.source = 'csma-packet-socket.cc'
obj = bld.create_ns3_program('csma-multicast',
['csma', 'internet-stack'])
obj.source = 'csma-multicast.cc'
obj = bld.create_ns3_program( 'mixed-global-routing',
['point-to-point', 'internet-stack', 'global-routing' , 'csma-cd'])
obj.source = 'mixed-global-routing.cc'
obj = bld.create_ns3_program('simple-point-to-point-olsr',
['point-to-point', 'internet-stack', 'olsr'])
obj.source = 'simple-point-to-point-olsr.cc'
obj = bld.create_ns3_program('tcp-large-transfer',
['point-to-point', 'internet-stack'])
obj.source = 'tcp-large-transfer.cc'
obj = bld.create_ns3_program('wifi-adhoc',
['core', 'simulator', 'mobility', 'wifi'])
obj.source = 'wifi-adhoc.cc'
obj = bld.create_ns3_program('wifi-ap',
['core', 'simulator', 'mobility', 'wifi'])
obj.source = 'wifi-ap.cc'
+12
View File
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "csma-broadcast")
+12
View File
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "csma-multicast")
+12
View File
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "csma-one-subnet")
@@ -0,0 +1,13 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
"csma-packet-socket")
@@ -0,0 +1,13 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
"simple-error-model")
@@ -0,0 +1,13 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
"simple-global-routing")
@@ -0,0 +1,13 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
"simple-point-to-point-olsr")
@@ -0,0 +1,13 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
"tcp-large-transfer")
+12
View File
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "udp-echo")
Vendored Executable
+1
View File
@@ -0,0 +1 @@
exec "`dirname "$0"`"/../waf "$@"
+142
View File
@@ -0,0 +1,142 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2008 University of Washington
*
* 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: Tom Henderson <tomh@tomh.org>
*/
#include "ns3/log.h"
#include "ns3/command-line.h"
#include "ns3/ptr.h"
#include "ns3/config.h"
#include "ns3/uinteger.h"
#include "ns3/string.h"
#include "ns3/pointer.h"
#include "ns3/simulator.h"
#include "ns3/node.h"
#include "ns3/queue.h"
#include "ns3/drop-tail-queue.h"
#include "ns3/point-to-point-net-device.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("AttributeValueSample");
//
// This is a basic example of how to use the attribute system to
// set and get a value in the underlying system; namely, an unsigned
// integer of the maximum number of packets in a queue
//
int
main (int argc, char *argv[])
{
LogComponentEnable ("AttributeValueSample", LOG_LEVEL_INFO);
// By default, the MaxPackets attribute has a value of 100 packets
// (this default can be observed in the function DropTailQueue::GetTypeId)
//
// Here, we set it to 80 packets. We could use one of two value types:
// a string-based value or a UintegerValue value
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("80"));
// The below function call is redundant
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (80));
// Allow the user to override any of the defaults and the above
// SetDefaults() at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
// Now, we will create a few objects using the low-level API
Ptr<Node> n0 = CreateObject<Node> ();
Ptr<PointToPointNetDevice> net0 = CreateObject<PointToPointNetDevice> ();
n0->AddDevice (net0);
Ptr<Queue> q = CreateObject<DropTailQueue> ();
net0->SetQueue(q);
// At this point, we have created a single node (Node 0) and a
// single PointToPointNetDevice (NetDevice 0) and added a
// DropTailQueue to it.
// Now, we can manipulate the MaxPackets value of the already
// instantiated DropTailQueue. Here are various ways to do that.
// We assume that a smart pointer (Ptr) to a relevant network device
// is in hand; here, it is the net0 pointer.
// 1. Pointer-based access
//
// One way to change the value is to access a pointer to the
// underlying queue and modify its attribute.
//
// First, we observe that we can get a pointer to the (base class)
// queue via the PointToPointNetDevice attributes, where it is called
// TxQueue
PointerValue ptr;
net0->GetAttribute ("TxQueue", ptr);
Ptr<Queue> txQueue = ptr.Get<Queue> ();
// Using the GetObject function, we can perform a safe downcast
// to a DropTailQueue, where MaxPackets is a member
Ptr<DropTailQueue> dtq = txQueue->GetObject <DropTailQueue> ();
NS_ASSERT (dtq);
// Next, we can get the value of an attribute on this queue
// We have introduced wrapper "Value" classes for the underlying
// data types, similar to Java wrappers around these types, since
// the attribute system stores values and not disparate types.
// Here, the attribute value is assigned to a Uinteger, and
// the Get() method on this value produces the (unwrapped) uint32_t.
UintegerValue limit;
dtq->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("1. dtq limit: " << limit.Get () << " packets");
// Note that the above downcast is not really needed; we could have
// done the same using the Ptr<Queue> even though the attribute
// is a member of the subclass
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("2. txQueue limit: " << limit.Get () << " packets");
// Now, let's set it to another value (60 packets)
txQueue->SetAttribute("MaxPackets", UintegerValue (60));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("3. txQueue limit changed: " << limit.Get () << " packets");
// 2. Namespace-based access
//
// An alternative way to get at the attribute is to use the configuration
// namespace. Here, this attribute resides on a known path in this
// namespace; this approach is useful if one doesn't have access to
// the underlying pointers and would like to configure a specific
// attribute with a single statement.
Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", UintegerValue (25));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("4. txQueue limit changed through namespace: " <<
limit.Get () << " packets");
// we could have also used wildcards to set this value for all nodes
// and all net devices (which in this simple example has the same
// effect as the previous Set())
Config::Set ("/NodeList/*/DeviceList/*/TxQueue/MaxPackets", UintegerValue (15));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("5. txQueue limit changed through wildcarded namespace: " <<
limit.Get () << " packets");
Simulator::Destroy ();
}
-219
View File
@@ -1,219 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2007 University of Washington
* All rights reserved.
*
* 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
*/
#include <string>
#include "ns3/debug.h"
#include "ns3/assert.h"
#include "ns3/packet.h"
#include "ns3/drop-tail.h"
#include "ns3/layer-connector.h"
#include "ns3/channel.h"
using namespace ns3;
// ===========================================================================
// Cook up a simplistic Internet Node
// ===========================================================================
class FakeInternetNode : public LayerConnectorUpper
{
public:
FakeInternetNode ();
~FakeInternetNode ();
void Doit (void);
protected:
bool UpperDoSendUp (Packet &p);
bool UpperDoPull (Packet &p);
DropTailQueue m_dtqOutbound;
DropTailQueue m_dtqInbound;
};
FakeInternetNode::FakeInternetNode ()
{
NS_DEBUG_UNCOND("FakeInternetNode::FakeInternetNode ()");
}
FakeInternetNode::~FakeInternetNode ()
{
NS_DEBUG_UNCOND("FakeInternetNode::~FakeInternetNode ()");
}
void
FakeInternetNode::Doit (void)
{
NS_DEBUG_UNCOND("FakeInternetNode::Doit ()");
NS_DEBUG_UNCOND("FakeInternetNode::Doit (): **** Send outbound packet");
Packet p;
m_dtqOutbound.Enqueue(p);
UpperNotify();
}
bool
FakeInternetNode::UpperDoSendUp (Packet &p)
{
NS_DEBUG_UNCOND("FakeInternetNode::UpperDoSendUp (" << &p << ")");
NS_DEBUG_UNCOND("FakeInternetNode::UpperDoSendUp (): **** Receive inbound packet");
m_dtqInbound.Enqueue(p);
return m_dtqInbound.Dequeue(p);
}
bool
FakeInternetNode::UpperDoPull (Packet &p)
{
NS_DEBUG_UNCOND("FakeInternetNode::DoPull (" << &p << ")");
return m_dtqOutbound.Dequeue(p);
}
// ===========================================================================
// Cook up a simplistic Physical Layer
// ===========================================================================
class FakePhysicalLayer :
public LayerConnectorLower,
public LayerConnectorUpper
{
public:
FakePhysicalLayer ();
~FakePhysicalLayer ();
protected:
bool LowerDoNotify (LayerConnectorUpper *upper);
bool UpperDoSendUp (Packet &p);
bool UpperDoPull (Packet &p);
DropTailQueue m_dtqInbound;
DropTailQueue m_dtqOutbound;
};
FakePhysicalLayer::FakePhysicalLayer ()
{
NS_DEBUG_UNCOND("FakePhysicalLayer::FakePhysicalLayer ()");
}
FakePhysicalLayer::~FakePhysicalLayer ()
{
NS_DEBUG_UNCOND("FakePhysicalLayer::~FakePhysicalLayer ()");
}
bool
FakePhysicalLayer::LowerDoNotify (LayerConnectorUpper *upper)
{
NS_DEBUG_UNCOND("FakePhysicalLayer::LowerDoNotify ()");
Packet p;
NS_DEBUG_UNCOND("FakePhysicalLayer::LowerDoNotify (): Starting pull");
NS_ASSERT(m_upperPartner);
m_upperPartner->UpperPull(p);
m_dtqOutbound.Enqueue(p);
NS_DEBUG_UNCOND("FakePhysicalLayer::LowerDoNotify (): Got bits, Notify lower");
NS_ASSERT(m_lowerPartner);
return m_lowerPartner->LowerNotify(this);
}
bool
FakePhysicalLayer::UpperDoSendUp (Packet &p)
{
NS_DEBUG_UNCOND("FakePhysicalLayer::UpperDoSendUp (" << &p << ")");
NS_ASSERT(m_upperPartner);
return m_upperPartner->UpperSendUp(p);
}
bool
FakePhysicalLayer::UpperDoPull (Packet &p)
{
NS_DEBUG_UNCOND("FakePhysicalLayer::DoPull (" << &p << ")");
return m_dtqOutbound.Dequeue(p);
}
// ===========================================================================
// Cook up a simplistic Channel, just to add any moby hack we feel like
// ===========================================================================
class FakeChannel : public Channel
{
public:
FakeChannel ();
~FakeChannel ();
};
FakeChannel::FakeChannel ()
{
NS_DEBUG_UNCOND("FakeChannel::FakeChannel ()");
}
FakeChannel::~FakeChannel ()
{
NS_DEBUG_UNCOND("FakeChannel::~FakeChannel ()");
}
int main (int argc, char *argv[])
{
NS_DEBUG_UNCOND("Channel Hackorama");
#if 0
DebugComponentEnable("Queue");
DebugComponentEnable("DropTailQueue");
DebugComponentEnable("LayerConnector");
DebugComponentEnable("Channel");
#endif
FakeInternetNode node1, node2, node3, node4;
FakePhysicalLayer phys1, phys2, phys3, phys4;
FakeChannel channel;
Packet pkt;
// all the hassle above lets us do something very simple here
node1.ConnectToLower(phys1);
phys1.ConnectToUpper(node1);
phys1.ConnectToLower(channel);
channel.ConnectToUpper(phys1);
node2.ConnectToLower(phys2);
phys2.ConnectToUpper(node2);
phys2.ConnectToLower(channel);
channel.ConnectToUpper(phys2);
node3.ConnectToLower(phys3);
phys3.ConnectToUpper(node3);
phys3.ConnectToLower(channel);
channel.ConnectToUpper(phys3);
node4.ConnectToLower(phys4);
phys4.ConnectToUpper(node4);
phys4.ConnectToLower(channel);
channel.ConnectToUpper(phys4);
node1.Doit();
node2.Doit();
node3.Doit();
node4.Doit();
return 0;
}
-38
View File
@@ -1,38 +0,0 @@
#include "ns3/object.h"
#include "ns3/component-manager.h"
using namespace ns3;
class AnObject : public Object
{
public:
static const InterfaceId iid;
static const ClassId cid;
AnObject (int a, double b);
protected:
virtual void DoDispose (void);
};
const InterfaceId AnObject::iid = MakeInterfaceId ("AnObject", Object::iid);
const ClassId AnObject::cid = MakeClassId<AnObject, int, double> ("AnObject", AnObject::iid);
AnObject::AnObject (int a, double b)
{
// enable our interface
SetInterfaceId (AnObject::iid);
}
void
AnObject::DoDispose (void)
{
// Do your work here.
// chain up
Object::DoDispose ();
}
int main (int argc, char *argv[])
{
Ptr<AnObject> anObject = ComponentManager::Create<AnObject,int,double> (AnObject::cid, AnObject::iid, 10, 20.0);
NS_ASSERT (anObject != 0);
return 0;
}
-13
View File
@@ -1,13 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/debug.h"
NS_DEBUG_COMPONENT_DEFINE ("MyComponentB");
namespace foo {
void OneFunction (void)
{
NS_DEBUG ("OneFunction debug");
}
}; // namespace foo
-27
View File
@@ -1,27 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/debug.h"
#include "ns3/assert.h"
NS_DEBUG_COMPONENT_DEFINE ("MyComponentA");
// declare other function
namespace foo {
void OneFunction (void);
}
int main (int argc, int argv)
{
NS_DEBUG ("nargc="<<argc);
foo::OneFunction ();
NS_DEBUG ("other debug output");
int a;
a = 0;
NS_ASSERT (a == 0);
NS_ASSERT_MSG (a == 0, "my msg");
NS_ASSERT (a != 0);
NS_ASSERT_MSG (a != 0, "my 2 msg");
}
-85
View File
@@ -1,85 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include <string>
#include "ns3/default-value.h"
#include "ns3/command-line.h"
#include "ns3/debug.h"
using namespace ns3;
//
// This sample file demonstrates how to take some simple member
// variables and hook them into the default variable system
// Typically, you will establish a static variable to maintain the current
// value of the default parameter. Then as other code require the values of
// the defaults, they query them with GetValue() to get the present value.
static BooleanDefaultValue defaultTestBool1 ("testBool1", "helpBool", true);
static IntegerDefaultValue<int> defaultTestInt1 ("testInt1", "helpInt1", 33);
static IntegerDefaultValue<uint32_t> defaultTestInt2 ("testInt2", "helpInt2", 47);
//
// This test class demonstrates the declaration of variables that
// may be overridden by the default-value system
//
// You will see in the core ns-3 modules that many member variables
// can be overridden in this manner
//
class TestClass {
public:
TestClass();
virtual ~TestClass () {}
bool m_testBool1;
int m_testInt1;
uint32_t m_testInt2;
};
//
// In the constructor, you can assign default values in the initializer
// list such as below; note that the instance of the created TestClass
// will have the values as dictated by the current value of the default.
// This means that the behavior of this class can be changed on the fly with
// calls to bind.
//
TestClass::TestClass () :
m_testBool1(defaultTestBool1.GetValue()),
m_testInt1(defaultTestInt1.GetValue()),
m_testInt2(defaultTestInt2.GetValue())
{
}
using std::cout;
int main (int argc, char* argv[])
{
//The following allows the default values established so far to be hooked
//into the command line argument processing unit. Essentially, the command
//line processor is aware of the DefaultValues that have been registered, and
//will accept command line overrides of these. The call automatically
//provides a --help option in addition to allowing overrides of defaults.
uint32_t loops = 0;
CommandLine::AddArgValue("loops","a test of the command line",loops);
CommandLine::Parse(argc,argv);
//utilize the loops variable to show that it can be read from the command line
if(loops>0)
{
cout<<"You requested "<<loops<<" iterations of a loop";
for(uint32_t i=0;i<loops;++i)
cout<<"iteration "<<i;
}
// Before objects are instantiated in your simulation script, you have
// the opportunity to overwrite any default value in the system.
// The Bind () method allows you to specify the name (string) of the
// global variable and value (string) to overwrite the default.
// Here, the default value of 33 for testInt1 is overwritten with 57
//
Bind("testInt1", "57");
TestClass* testclass = new TestClass ();
NS_DEBUG_UNCOND("TestBool1 default value (" << testclass->m_testBool1 << ")");
NS_DEBUG_UNCOND("TestInt1 default value (" << testclass->m_testInt1 << ")");
NS_DEBUG_UNCOND("TestInt2 default value (" << testclass->m_testInt2 << ")");
delete testclass;
return 0;
}
+54
View File
@@ -0,0 +1,54 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/core-module.h"
#include "ns3/helper-module.h"
#include "ns3/mobility-module.h"
using namespace ns3;
int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse (argc, argv);
NodeContainer nodes;
// create an array of empty nodes for testing purposes
nodes.Create (120);
MobilityHelper mobility;
// setup the grid itself: objects are layed out
// started from (-100,-100) with 20 objects per row,
// the x interval between each object is 5 meters
// and the y interval between each object is 20 meters
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (-100.0),
"MinY", DoubleValue (-100.0),
"DeltaX", DoubleValue (5.0),
"DeltaY", DoubleValue (20.0),
"GridWidth", UintegerValue (20),
"LayoutType", StringValue ("RowFirst"));
// each object will be attached a static position.
// i.e., once set by the "position allocator", the
// position will never change.
mobility.SetMobilityModel ("ns3::StaticMobilityModel");
// finalize the setup by attaching to each object
// in the input array a position and initializing
// this position with the calculated coordinates.
mobility.Install (nodes);
// iterate our nodes and print their position.
for (NodeContainer::Iterator j = nodes.Begin ();
j != nodes.End (); ++j)
{
Ptr<Node> object = *j;
Ptr<MobilityModel> position = object->GetObject<MobilityModel> ();
NS_ASSERT (position != 0);
Vector pos = position->GetPosition ();
std::cout << "x=" << pos.x << ", y=" << pos.y << ", z=" << pos.z << std::endl;
}
return 0;
}
-121
View File
@@ -1,121 +0,0 @@
#include "ns3/object.h"
using namespace ns3;
class AnObject : public Object
{
public:
static const InterfaceId iid;
AnObject ();
protected:
virtual void DoDispose (void);
};
const InterfaceId AnObject::iid = MakeInterfaceId ("AnObject", Object::iid);
AnObject::AnObject ()
{
// enable our interface
SetInterfaceId (AnObject::iid);
}
void
AnObject::DoDispose (void)
{
// Do your work here.
// chain up
Object::DoDispose ();
}
class AnotherObject : public Object
{
public:
static const InterfaceId iid;
AnotherObject (int a);
private:
virtual void DoDispose (void);
};
const InterfaceId AnotherObject::iid = MakeInterfaceId ("AnotherObject", Object::iid);
AnotherObject::AnotherObject (int a)
{
// enable our interface
SetInterfaceId (AnotherObject::iid);
}
void
AnotherObject::DoDispose (void)
{
// Do your work here.
// chain up
Object::DoDispose ();
}
class YetAnotherObject : public Object
{
public:
static const InterfaceId iid;
YetAnotherObject (int a);
private:
virtual void DoDispose (void);
};
const InterfaceId YetAnotherObject::iid = MakeInterfaceId ("YetAnotherObject", Object::iid);
YetAnotherObject::YetAnotherObject (int a)
{
// enable our interface
SetInterfaceId (YetAnotherObject::iid);
// aggregated directly to another object.
AddInterface (Create<AnObject> ());
}
void
YetAnotherObject::DoDispose (void)
{
// Do your work here.
// chain up
Object::DoDispose ();
}
int main (int argc, char *argv[])
{
Ptr<Object> p;
Ptr<AnObject> anObject;
Ptr<AnotherObject> anotherObject;
Ptr<YetAnotherObject> yetAnotherObject;
p = Create<AnObject> ();
// p gives you access to AnObject's interface
anObject = p->QueryInterface<AnObject> (AnObject::iid);
NS_ASSERT (anObject != 0);
// p does not give you access to AnotherObject's interface
anotherObject = p->QueryInterface<AnotherObject> (AnotherObject::iid);
NS_ASSERT (anotherObject == 0);
anotherObject = Create<AnotherObject> (1);
// AnotherObject does not give you access to AnObject's interface
anObject = anotherObject->QueryInterface<AnObject> (AnObject::iid);
NS_ASSERT (anObject == 0);
// aggregate the two objects
p->AddInterface (anotherObject);
// p gives you access to AnObject's interface
anObject = p->QueryInterface<AnObject> (AnObject::iid);
NS_ASSERT (anObject != 0);
// p gives you access to AnotherObject's interface
anotherObject = p->QueryInterface<AnotherObject> (AnotherObject::iid);
NS_ASSERT (anotherObject != 0);
yetAnotherObject = Create<YetAnotherObject> (2);
// gives you acess to AnObject interface too.
anObject = yetAnotherObject->QueryInterface<AnObject> (AnObject::iid);
NS_ASSERT (anObject != 0);
return 0;
}
+122
View File
@@ -0,0 +1,122 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/ptr.h"
#include "ns3/packet.h"
#include "ns3/header.h"
#include <iostream>
using namespace ns3;
/* A sample Header implementation
*/
class MyHeader : public Header
{
public:
MyHeader ();
virtual ~MyHeader ();
void SetData (uint16_t data);
uint16_t GetData (void) const;
static TypeId GetTypeId (void);
virtual TypeId GetInstanceTypeId (void) const;
virtual void Print (std::ostream &os) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual uint32_t GetSerializedSize (void) const;
private:
uint16_t m_data;
};
MyHeader::MyHeader ()
{
// we must provide a public default constructor,
// implicit or explicit, but never private.
}
MyHeader::~MyHeader ()
{}
TypeId
MyHeader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::MyHeader")
.SetParent<Header> ()
;
return tid;
}
TypeId
MyHeader::GetInstanceTypeId (void) const
{
return GetTypeId ();
}
void
MyHeader::Print (std::ostream &os) const
{
// This method is invoked by the packet printing
// routines to print the content of my header.
os << "data=" << m_data << std::endl;
}
uint32_t
MyHeader::GetSerializedSize (void) const
{
// we reserve 2 bytes for our header.
return 2;
}
void
MyHeader::Serialize (Buffer::Iterator start) const
{
// we can serialize two bytes at the start of the buffer.
// we write them in network byte order.
start.WriteHtonU16 (m_data);
}
uint32_t
MyHeader::Deserialize (Buffer::Iterator start)
{
// we can deserialize two bytes from the start of the buffer.
// we read them in network byte order and store them
// in host byte order.
m_data = start.ReadNtohU16 ();
// we return the number of bytes effectively read.
return 2;
}
void
MyHeader::SetData (uint16_t data)
{
m_data = data;
}
uint16_t
MyHeader::GetData (void) const
{
return m_data;
}
int main (int argc, char *argv[])
{
// instantiate a header.
MyHeader sourceHeader;
sourceHeader.SetData (2);
// instantiate a packet
Ptr<Packet> p = Create<Packet> ();
// and store my header into the packet.
p->AddHeader (sourceHeader);
// print the content of my packet on the standard output.
p->Print (std::cout);
// you can now remove the header from the packet:
MyHeader destinationHeader;
p->RemoveHeader (destinationHeader);
// and check that the destination and source
// headers contain the same values.
NS_ASSERT (sourceHeader.GetData () == destinationHeader.GetData ());
return 0;
}
+32 -46
View File
@@ -1,7 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2006,2007 INRIA
* All rights reserved.
*
* 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
@@ -49,7 +48,7 @@ void DefaultPrint (void)
{
// We create a packet with 1000 bytes of zero payload
// and add 3 headers to this packet.
Packet p (1000);
Ptr<Packet> p = Create<Packet> (1000);
Ipv4Header ipv4;
UdpHeader udp;
ipv4.SetSource (Ipv4Address ("192.168.0.1"));
@@ -57,48 +56,39 @@ void DefaultPrint (void)
udp.SetSource (1025);
udp.SetDestination (80);
udp.SetPayloadSize (1000);
p.AddHeader (udp);
p.AddHeader (ipv4);
p->AddHeader (udp);
p->AddHeader (ipv4);
std::cout << "full packet size=" << p.GetSize () << std::endl;
std::cout << "full packet size=" << p->GetSize () << std::endl;
// Here, invoke the default Print routine, directed to std out
p.Print (std::cout);
p->Print (std::cout);
std::cout << std::endl;
// Now, we fragment our packet in 3 consecutive pieces.
Packet p1 = p.CreateFragment (0, 2);
Packet p2 = p.CreateFragment (2, 1000);
Packet p3 = p.CreateFragment (1002, 26);
Ptr<Packet> p1 = p->CreateFragment (0, 2);
Ptr<Packet> p2 = p->CreateFragment (2, 1000);
Ptr<Packet> p3 = p->CreateFragment (1002, 26);
std::cout << "fragment1" << std::endl;
p1.Print (std::cout);
p1->Print (std::cout);
std::cout << std::endl;
std::cout << "fragment2" << std::endl;
p2.Print (std::cout);
p2->Print (std::cout);
std::cout << std::endl;
std::cout << "fragment3" << std::endl;
p3.Print (std::cout);
p3->Print (std::cout);
std::cout << std::endl;
// And, finally, we re-aggregate the 3 consecutive pieces.
Packet aggregate = p1;
aggregate.AddAtEnd (p2);
aggregate.AddAtEnd (p3);
Ptr<Packet> aggregate = p1->Copy ();
aggregate->AddAtEnd (p2);
aggregate->AddAtEnd (p3);
std::cout << "aggregated" << std::endl;
aggregate.Print (std::cout);
aggregate->Print (std::cout);
std::cout << std::endl;
}
// The below functions are used in place of default versions, in the
// non-default case below. For instance, DoPrintIpv4Header will print
// out less IPv4 header information than the default print function
void
DoPrintDefault (std::ostream &os,uint32_t packetUid, uint32_t size,
std::string &name, struct PacketPrinter::FragmentInformation info)
{
os << name <<" (size " << size << " trim_start " << info.start << " trim_end " << info.end << ")";
}
void
DoPrintPayload (std::ostream & os,uint32_t packetUid,uint32_t size,
struct PacketPrinter::FragmentInformation info)
@@ -129,19 +119,15 @@ void NonDefaultPrint (void)
// set a string separator automatically inserted
// between each call to a printing function.
printer.SetSeparator (" - ");
// set the default print function: invoked if no
// specialized function has been provided for a header
// or trailer
printer.AddDefaultPrinter (MakeCallback (&DoPrintDefault));
// set the payload print function
printer.AddPayloadPrinter (MakeCallback (&DoPrintPayload));
printer.SetPayloadPrinter (MakeCallback (&DoPrintPayload));
// set the print function for the header type Ipv4Header.
printer.AddHeaderPrinter (MakeCallback (&DoPrintIpv4Header),
printer.SetHeaderPrinter (MakeCallback (&DoPrintIpv4Header),
MakeCallback (&DoPrintIpv4HeaderFragment));
// We create a packet with 1000 bytes of zero payload
Packet p (1000);
Ptr<Packet> p = Create<Packet> (1000);
Ipv4Header ipv4;
UdpHeader udp;
ipv4.SetSource (Ipv4Address ("192.168.0.1"));
@@ -149,35 +135,35 @@ void NonDefaultPrint (void)
udp.SetSource (1025);
udp.SetDestination (80);
udp.SetPayloadSize (1000);
p.AddHeader (udp);
p.AddHeader (ipv4);
p->AddHeader (udp);
p->AddHeader (ipv4);
std::cout << "full packet size=" << p.GetSize () << std::endl;
p.Print (std::cout, printer);
std::cout << "full packet size=" << p->GetSize () << std::endl;
p->Print (std::cout, printer);
std::cout << std::endl;
// fragment our packet in 3 pieces
Packet p1 = p.CreateFragment (0, 2);
Packet p2 = p.CreateFragment (2, 1000);
Packet p3 = p.CreateFragment (1002, 26);
Ptr<Packet> p1 = p->CreateFragment (0, 2);
Ptr<Packet> p2 = p->CreateFragment (2, 1000);
Ptr<Packet> p3 = p->CreateFragment (1002, 26);
std::cout << "fragment1" << std::endl;
p1.Print (std::cout, printer);
p1->Print (std::cout, printer);
std::cout << std::endl;
std::cout << "fragment2" << std::endl;
p2.Print (std::cout, printer);
p2->Print (std::cout, printer);
std::cout << std::endl;
std::cout << "fragment3" << std::endl;
p3.Print (std::cout, printer);
p3->Print (std::cout, printer);
std::cout << std::endl;
// aggregate all 3 fragments of the original packet
// to reconstruct a copy of the original packet.
Packet aggregate = p1;
aggregate.AddAtEnd (p2);
aggregate.AddAtEnd (p3);
Ptr<Packet> aggregate = p1->Copy ();
aggregate->AddAtEnd (p2);
aggregate->AddAtEnd (p3);
std::cout << "aggregated" << std::endl;
aggregate.Print (std::cout, printer);
aggregate->Print (std::cout, printer);
std::cout << std::endl;
}
+120
View File
@@ -0,0 +1,120 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2006,2007 INRIA
*
* 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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#include "ns3/tag.h"
#include "ns3/packet.h"
#include "ns3/uinteger.h"
#include <iostream>
using namespace ns3;
// define this class in a public header
class MyTag : public Tag
{
public:
static TypeId GetTypeId (void);
virtual TypeId GetInstanceTypeId (void) const;
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (TagBuffer i) const;
virtual void Deserialize (TagBuffer i);
virtual void Print (std::ostream &os) const;
// these are our accessors to our tag structure
void SetSimpleValue (uint8_t value);
uint8_t GetSimpleValue (void) const;
private:
uint8_t m_simpleValue;
};
TypeId
MyTag::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::MyTag")
.SetParent<Tag> ()
.AddConstructor<MyTag> ()
.AddAttribute ("SimpleValue",
"A simple value",
EmptyAttributeValue (),
MakeUintegerAccessor (&MyTag::GetSimpleValue),
MakeUintegerChecker<uint8_t> ())
;
return tid;
}
TypeId
MyTag::GetInstanceTypeId (void) const
{
return GetTypeId ();
}
uint32_t
MyTag::GetSerializedSize (void) const
{
return 1;
}
void
MyTag::Serialize (TagBuffer i) const
{
i.WriteU8 (m_simpleValue);
}
void
MyTag::Deserialize (TagBuffer i)
{
m_simpleValue = i.ReadU8 ();
}
void
MyTag::Print (std::ostream &os) const
{
os << "v=" << (uint32_t)m_simpleValue;
}
void
MyTag::SetSimpleValue (uint8_t value)
{
m_simpleValue = value;
}
uint8_t
MyTag::GetSimpleValue (void) const
{
return m_simpleValue;
}
int main (int argc, char *argv[])
{
// create a tag.
MyTag tag;
tag.SetSimpleValue (0x56);
// store the tag in a packet.
Ptr<Packet> p = Create<Packet> (100);
p->AddTag (tag);
// create a copy of the packet
Ptr<Packet> aCopy = p->Copy ();
// read the tag from the packet copy
MyTag tagCopy;
p->FindFirstMatchingTag (tagCopy);
// the copy and the original are the same !
NS_ASSERT (tagCopy.GetSimpleValue () == tag.GetSimpleValue ());
aCopy->PrintTags (std::cout);
std::cout << std::endl;
return 0;
}
-103
View File
@@ -1,103 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/packet.h"
#include "ns3/header.h"
#include <iostream>
using namespace ns3;
/* A sample Header implementation
*/
class MyHeader : public Header {
public:
MyHeader ();
virtual ~MyHeader ();
void SetData (uint16_t data);
uint16_t GetData (void) const;
private:
virtual std::string DoGetName (void) const;
virtual void PrintTo (std::ostream &os) const;
virtual void SerializeTo (Buffer::Iterator start) const;
virtual uint32_t DeserializeFrom (Buffer::Iterator start);
virtual uint32_t GetSerializedSize (void) const;
uint16_t m_data;
};
MyHeader::MyHeader ()
{}
MyHeader::~MyHeader ()
{}
std::string
MyHeader::DoGetName (void) const
{
return "MyHeader";
}
void
MyHeader::PrintTo (std::ostream &os) const
{
os << "MyHeader data=" << m_data << std::endl;
}
uint32_t
MyHeader::GetSerializedSize (void) const
{
return 2;
}
void
MyHeader::SerializeTo (Buffer::Iterator start) const
{
// serialize in head of buffer
start.WriteHtonU16 (m_data);
}
uint32_t
MyHeader::DeserializeFrom (Buffer::Iterator start)
{
// deserialize from head of buffer
m_data = start.ReadNtohU16 ();
return GetSerializedSize ();
}
void
MyHeader::SetData (uint16_t data)
{
m_data = data;
}
uint16_t
MyHeader::GetData (void) const
{
return m_data;
}
/* A sample Tag implementation
*/
struct MyTag {
uint16_t m_streamId;
};
static TagRegistration<struct MyTag> g_MyTagRegistration ("ns3::MyTag", 0);
static void
Receive (Packet p)
{
MyHeader my;
p.RemoveHeader (my);
std::cout << "received data=" << my.GetData () << std::endl;
struct MyTag myTag;
p.PeekTag (myTag);
}
int main (int argc, char *argv[])
{
Packet p;
MyHeader my;
my.SetData (2);
std::cout << "send data=2" << std::endl;
p.AddHeader (my);
struct MyTag myTag;
myTag.m_streamId = 5;
p.AddTag (myTag);
Receive (p);
return 0;
}
+60
View File
@@ -0,0 +1,60 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2007 INRIA
*
* 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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#include "ns3/propagation-loss-model.h"
#include "ns3/static-mobility-model.h"
#include "ns3/config.h"
#include "ns3/string.h"
using namespace ns3;
static void
PrintOne (double minTxpower, double maxTxpower, double stepTxpower, double min, double max, double step)
{
Ptr<StaticMobilityModel> a = CreateObject<StaticMobilityModel> ();
Ptr<StaticMobilityModel> b = CreateObject<StaticMobilityModel> ();
Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
Ptr<PropagationLossModel> model = log;
a->SetPosition (Vector (0.0, 0.0, 0.0));
for (double x = min; x < max; x+= step)
{
b->SetPosition (Vector (x, 0.0, 0.0));
std::cout << x << " ";
for (double txpower = minTxpower; txpower < maxTxpower; txpower += stepTxpower)
{
double rxPowerDbm = txpower + model->GetLoss (a, b);
std::cout << rxPowerDbm << " ";
}
std::cout << std::endl;
}
}
int main (int argc, char *argv[])
{
Config::SetGlobal ("LogDistancePropagationLossModel::ReferenceDistance", StringValue ("1.0"));
Config::SetGlobal ("LogDistancePropagationLossModel::Exponent", StringValue ("4"));
PrintOne (-10, 20, 5, 0, 10000, 2);
return 0;
}
+2 -2
View File
@@ -49,7 +49,7 @@ int main (int argc, char *argv[])
{
// Create a new object of type A, store it in global
// variable g_a
Ptr<A> a = Create<A> ();
Ptr<A> a = CreateObject<A> ();
a->Method ();
Ptr<A> prev = StoreA (a);
NS_ASSERT (prev == 0);
@@ -58,7 +58,7 @@ int main (int argc, char *argv[])
{
// Create a new object of type A, store it in global
// variable g_a, get a hold on the previous A object.
Ptr<A> a = Create<A> ();
Ptr<A> a = CreateObject<A> ();
Ptr<A> prev = StoreA (a);
// call method on object
prev->Method ();
-280
View File
@@ -1,280 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2007 University of Washington
* Authors: Tom Henderson, Craig Dowell
*
* 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
*/
#include "ns3/debug.h"
#include "ns3/object.h"
#include "ns3/component-manager.h"
using namespace ns3;
//
// This sample file shows examples of how to use QueryInterface.
//
// QueryInterface is a templated method of class Object, defined in
// src/core/object.h. ns-3 objects that derive from class Object
// can have QueryInterface invoked on them.
//
// QueryInterface is a type-safe way to ask an object, at run-time,
// "Do you support the interface identified by the given InterfaceId?"
// It avoids deprecated techniques of having to downcast pointers to
// an object to ask questions about its type. One or more interfaces
// may be associated with a given object.
//
// QueryInterface is of most use when working with base class
// pointers of objects that may be subclassed. For instance,
// one may have a pointer to a Node, but not know whether it has
// an IPv4 stack. Another example might be to determine whether
// a Node has an EnergyModel, to which calls to decrement energy
// from the node's battery might be made.
//
//
// Object is the base class for ns-3 node-related objects used at
// the public API. Object provides reference counting implementations
// and the QueryInterface.
//
// A common design paradigm for an ns-3 node object, such as a Queue,
// is that we provide an abstract base class that inherits from
// Object. This class is assigned an interface ID (iid) and
// contains the basic API for objects in this class and subclasses.
// This base class is specialized to provide implementations of
// the object in question (such as a DropTailQueue).
//
// The design pattern commonly used is known as the "non-virtual
// public interface" pattern, whereby the public API for this
// object is a set of public non-virtual functions that forward
// to private virtual functions. The forwarding functions can
// impose pre- and post-conditions on the forwarding call at
// the base class level.
//
// We'll call this base class "AnInterface" in the example below.
//
//
class AnInterface : public Object
{
public:
static const InterfaceId iid;
void methodA (void);
private:
virtual void domethodA (void) = 0;
};
void
AnInterface::methodA (void)
{
// pre-dispatch asserts
NS_DEBUG_UNCOND("AnInterface pre-condition::methodA");
domethodA ();
NS_DEBUG_UNCOND("AnInterface post-condition::methodA\n");
// post-dispatch asserts
}
//
// The below assignment assigns the InterfaceId of the class AnInterface,
// and declares that the parent iid is that of class Object.
//
const InterfaceId AnInterface::iid = MakeInterfaceId ("AnInterface", Object::iid);
//
// AnImplementation is an implementation of the abstract base class
// defined above. It provides implementation for the virtual functions
// in the base class. It defines one ClassId for each constructor,
// and can also provide an interface itself (in this example,
// a methodImpl is available)
//
class AnImplementation : public AnInterface
{
public:
static const InterfaceId iid;
static const ClassId cid;
AnImplementation ();
void methodImpl (void);
private:
virtual void domethodA (void);
};
void
AnImplementation::methodImpl (void)
{
NS_DEBUG_UNCOND("AnImplementation::methodImpl\n");
}
AnImplementation::AnImplementation (void)
{
// enable our interface
SetInterfaceId (AnImplementation::iid);
}
void
AnImplementation::domethodA ()
{
NS_DEBUG_UNCOND("AnImplementation::domethodA");
}
//
// The below assignment assigns the InterfaceId of the class AnImplementation,
// and declares that the parent iid is that of class Object.
//
const InterfaceId AnImplementation::iid =
MakeInterfaceId ("AnImplementation", AnInterface::iid);
//
// The next few lines are used by the component manager. They
// state that the component manager can create a new object
// AnImplementation and return an interface corresponding to
// the AnImplementation iid.
//
const ClassId AnImplementation::cid =
MakeClassId<AnImplementation>
("AnImplementation", AnImplementation::iid);
//
// Extending interfaces
// ==================
// What if AnInterface doesn't provide enough API for your
// object type?
// - if you aren't concerned about backward compatibility and
// don't mind recompiling, you just add new methods to AnInterface
// and recompile.
// - if you want to address backward compatibiliy, or allow part
// of the system to use the old interface, you have to do more.
// You have to declare a new interface with the new functionality.
//
class AnExtendedInterface : public AnInterface
{
public:
static const InterfaceId iid;
void methodB (void);
private:
virtual void domethodB (void) = 0;
};
const InterfaceId AnExtendedInterface::iid =
MakeInterfaceId ("AnExtendedInterface", AnInterface::iid);
//
// Then you need provide an implementation for the virtual
// methods. If you are providing a new implementation for
// everything, the answer is straightforward
//
class ANewImplementation : public AnExtendedInterface
{
public:
static const InterfaceId iid;
static const ClassId cid;
ANewImplementation ();
void methodImpl (void);
private:
virtual void domethodA (void) { /* new-implementation-behavior (); */}
virtual void domethodB (void) { /* new-implementation-behavior (); */}
};
ANewImplementation::ANewImplementation (void)
{
// enable our interface
SetInterfaceId (ANewImplementation::iid);
}
void
ANewImplementation::methodImpl (void)
{
NS_DEBUG_UNCOND("ANewImplementation::methodImpl\n");
}
const InterfaceId ANewImplementation::iid =
MakeInterfaceId ("ANewImplementation", AnExtendedInterface::iid);
//
// If you want to extend an existing implementation, you can use
// the existing class to instantiate an implementation of its
// methods (hasa) and do the following if you can use stuff from
// the existing class.
//
class AnExtendedImplementation : public AnExtendedInterface
{
public:
static const InterfaceId iid;
static const ClassId cid;
AnExtendedImplementation ();
void methodImpl (void) { /* pImpl->methodImpl (); */ }
void methodExtendedImpl (void);
private:
virtual void domethodA (void) { /* new-implementation-behavior (); */}
virtual void domethodB (void) { /* new-implementation-behavior (); */}
Ptr<AnImplementation> pImpl;
};
AnExtendedImplementation::AnExtendedImplementation (void)
{
pImpl = Create<AnImplementation> ();
SetInterfaceId (AnExtendedImplementation::iid);
}
void
AnExtendedImplementation::methodExtendedImpl (void)
{
NS_DEBUG_UNCOND("AnExtendedImplementation::methodExtendedImpl\n");
}
const InterfaceId AnExtendedImplementation::iid =
MakeInterfaceId ("AnExtendedImplementation", AnExtendedInterface::iid);
//
// Inheriting from an existing implementation (isa) and an extended
// interface is tricky, because of the diamond multiple inheritance
// problem. If the pImpl method above is not desirable, it may
// be that the implementation extension could be aggregated.
//
// The extension will not have access to the base implementation,
// so this design pattern may be more appropriate if the extension
// is very modular (e.g., add an EnergyModel to a wireless interface)
//
// EXAMPLE NOT YET PROVIDED
int main (int argc, char *argv[])
{
Ptr<AnInterface> aBase = ComponentManager::Create<AnImplementation>
(AnImplementation::cid, AnInterface::iid);
NS_ASSERT (aBase != 0);
aBase->methodA ();
//aBase->methodImpl (); // XXX won't compile, aBase not right ptr type
Ptr<AnImplementation> aBaseImplPtr =
aBase-> QueryInterface<AnImplementation> (AnImplementation::iid);
aBaseImplPtr->methodImpl ();
aBaseImplPtr->methodA();
// Test symmetric property of QueryInterface
Ptr<AnInterface> aBase2 =
aBaseImplPtr-> QueryInterface<AnInterface> (AnInterface::iid);
aBase2->methodA ();
return 0;
}
+43
View File
@@ -0,0 +1,43 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/core-module.h"
#include "ns3/mobility-module.h"
#include "ns3/helper-module.h"
#include "ns3/simulator-module.h"
using namespace ns3;
static void
CourseChange (std::string context, Ptr<const MobilityModel> position)
{
Vector pos = position->GetPosition ();
std::cout << Simulator::Now () << ", pos=" << position << ", x=" << pos.x << ", y=" << pos.y
<< ", z=" << pos.z << std::endl;
}
int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse (argc, argv);
NodeContainer c;
c.Create (10000);
MobilityHelper mobility;
mobility.SetPositionAllocator ("ns3::RandomDiscPositionAllocator",
"X", StringValue ("100.0"),
"Y", StringValue ("100.0"),
"Rho", StringValue ("Uniform:0:30"));
mobility.SetMobilityModel ("ns3::StaticMobilityModel");
mobility.Install (c);
Config::Connect ("/NodeList/*/$ns3::MobilityModelNotifier/CourseChange",
MakeCallback (&CourseChange));
Simulator::Stop (Seconds (100.0));
Simulator::Run ();
return 0;
}

Some files were not shown because too many files have changed in this diff Show More