Compare commits
1397 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a3e26a68f4 | |||
| 937c3c388c | |||
| a64d062b49 | |||
| 2c66f4c020 | |||
| 4da74c6430 | |||
| cb9702a556 | |||
| d2e78ccb33 | |||
| 1cdf54260b | |||
| a22fb1ba66 | |||
| 5e112ceba3 | |||
| 55025b4713 | |||
| 8200d73066 | |||
| 7ce4e68e5e | |||
| f4014037e8 | |||
| 4b404bb9bb | |||
| 0ac1381146 | |||
| dd25de7e36 | |||
| 2d976ae200 | |||
| cb4770b9d2 | |||
| 8ab3d4ecc4 | |||
| e1fd51ee82 | |||
| 86e477e13b | |||
| a0c8acfa66 | |||
| 15c018ff25 | |||
| 4193a68e34 | |||
| f0773a150e | |||
| 0c20bbf621 | |||
| 117d21b1dd | |||
| ef9e955e6c | |||
| 174704abba | |||
| efabb7dcaa | |||
| dec52190b7 | |||
| 718d156554 | |||
| ebd742ba2d | |||
| be83597fd4 | |||
| 111035d3fa | |||
| bfb95b39dd | |||
| 1c7a870d29 | |||
| 5ebab00295 | |||
| 65b2e8d837 | |||
| 7e6ca121d6 | |||
| 134aadf85e | |||
| 34b3521638 | |||
| a9196fc0c6 | |||
| a7cb5fb195 | |||
| fee54949b1 | |||
| 3a690bd071 | |||
| 56dbc49aa3 | |||
| bc4d797dbf | |||
| 95ffc4d89b | |||
| c67535dc7a | |||
| de61c2f689 | |||
| d81c292aba | |||
| 6db467ef95 | |||
| 2704990f20 | |||
| 04a0f64427 | |||
| 686844f601 | |||
| 1723645d4e | |||
| c66070b52c | |||
| 3f1a93b68b | |||
| 292979e742 | |||
| 7fb26bfe59 | |||
| 19488ad7aa | |||
| 0afb4dcc80 | |||
| a32da6615b | |||
| 57fa7f7b9b | |||
| 2e0d44a130 | |||
| 35f4c249d4 | |||
| a623762bd9 | |||
| 8509f28877 | |||
| 6c4f5c7c79 | |||
| ded303057a | |||
| b62cf68711 | |||
| 01983101a6 | |||
| 6250c61bcf | |||
| fd74ac7616 | |||
| 3ae948f663 | |||
| b0577a2eac | |||
| 8f515dcc03 | |||
| def03785bf | |||
| 47d54736d4 | |||
| 8c21bdae76 | |||
| dabdc5f45b | |||
| f7311ec17a | |||
| 62eb723a6b | |||
| e5697f0c2c | |||
| 9b2f73e9ae | |||
| 1ad026d2bd | |||
| 871b92f377 | |||
| fd1bda1bb9 | |||
| e1a48462bc | |||
| 91a1e78dca | |||
| 0e5781ee97 | |||
| 885bb7e1cd | |||
| 62f72a7048 | |||
| 9e71fc449f | |||
| aa14800121 | |||
| d5be610a4d | |||
| 4d180f672c | |||
| 69dd251a0f | |||
| 39c2b005a4 | |||
| 715841d0b3 | |||
| cce40e5148 | |||
| c971b0de7d | |||
| cb8b2a5ad1 | |||
| 773bee35ac | |||
| 31211f8dc2 | |||
| bc89ea5288 | |||
| 368aa197c4 | |||
| 2f63edb779 | |||
| 559d337432 | |||
| 1b432fecac | |||
| c75d2fb8f5 | |||
| 34cde13d3f | |||
| 66f58aab5a | |||
| 7f8dc7e404 | |||
| f228c5c17b | |||
| 43051b28c0 | |||
| 5c99689061 | |||
| 8f11338195 | |||
| c489647301 | |||
| d3f916a917 | |||
| 3dc863a005 | |||
| b97b0de553 | |||
| fdcf89dd53 | |||
| ec3ff0953b | |||
| b4e765c5b6 | |||
| 5c66f6fa1f | |||
| dcdbc179fb | |||
| f612ebca1c | |||
| 93ce0ad194 | |||
| 1606c90844 | |||
| 173514d457 | |||
| 4ad1a2c90e | |||
| ac797fccec | |||
| 198428de10 | |||
| 425490bc54 | |||
| ce9e786d23 | |||
| 0ec7a3b9d4 | |||
| e43b4acbde | |||
| 051d5b1aa1 | |||
| 3d53962700 | |||
| b332bce32f | |||
| 270691c72d | |||
| 435859a64b | |||
| 3c4d250b4b | |||
| 1ffa01e505 | |||
| b7e891ccfa | |||
| a096ecca2f | |||
| 0d5fc14442 | |||
| 84452d7d9e | |||
| f1a1922cc0 | |||
| a944617f27 | |||
| 6cb06ce560 | |||
| 46297abcda | |||
| 9f10edb665 | |||
| 7567960935 | |||
| 412cf215b9 | |||
| d8c14885b2 | |||
| 9e70317df6 | |||
| cf45881bcc | |||
| 30c95658e9 | |||
| dfd965e6f8 | |||
| 0e03b5828f | |||
| 5a76830b73 | |||
| dc3667a937 | |||
| d8ee7fffa4 | |||
| 6433205b6c | |||
| 340437104d | |||
| 4146d77eaf | |||
| 2006e41baa | |||
| 5506d60922 | |||
| 8cfb0bf43f | |||
| 246166d593 | |||
| 46b7c2ac8a | |||
| 660756646a | |||
| cd0f4ad075 | |||
| 9ca914b2b3 | |||
| 34ca3a8c0b | |||
| 2c13d2dbe8 | |||
| 65f248403a | |||
| 560af5e3d8 | |||
| e6d5b2752d | |||
| b19606dc73 | |||
| 9080f150a6 | |||
| 40d10240cf | |||
| ecbd57326b | |||
| 569f1c2dce | |||
| 3109031c35 | |||
| 90806e1f2a | |||
| d74e9fdf30 | |||
| c5f127c193 | |||
| cbe83c6f5a | |||
| 8df0d04bbb | |||
| ba17f6168e | |||
| f47b9bce81 | |||
| d67ced0392 | |||
| 1420606fc6 | |||
| a2e0ed145a | |||
| d85ad22554 | |||
| ab88e121ca | |||
| 0ac6727a82 | |||
| c16fb42027 | |||
| 8bd7f62305 | |||
| ef49c036ec | |||
| af65a032f1 | |||
| 823d1b1642 | |||
| 5a7a4fff83 | |||
| 5dcc405843 | |||
| cc2d4e4c12 | |||
| e9c14c2b54 | |||
| 9ad27ed6ec | |||
| c16d0b97ac | |||
| 69e4cc6139 | |||
| 5545a7f224 | |||
| 9f88bd50f0 | |||
| eb4138894f | |||
| 9c250b48c9 | |||
| 13deae792b | |||
| dabc95ee4d | |||
| e1b0f8c2f1 | |||
| f5147ff55e | |||
| 06835eb89d | |||
| 7033e74a3f | |||
| 0ddd5c62b7 | |||
| 23f15b7afc | |||
| 3436e5f599 | |||
| 8628634ffa | |||
| 59b9e08aa2 | |||
| d9b4528ca1 | |||
| 72e8f65b8a | |||
| 98bf5861f3 | |||
| cc0ac11580 | |||
| d216402e96 | |||
| 097bbd8859 | |||
| c2e3f10058 | |||
| 64c6e1e1ad | |||
| 557c77fd8f | |||
| 6a91f578fa | |||
| 3bbda53949 | |||
| 5b0071da70 | |||
| b38935c93f | |||
| e04641af04 | |||
| 6976fb3247 | |||
| a195154331 | |||
| 5a7d7b1684 | |||
| 92d33e8c9e | |||
| 295d85e52f | |||
| 1d91a535e0 | |||
| da6dbe6141 | |||
| 94d1b71324 | |||
| c292a5853c | |||
| b1a22bb343 | |||
| 0970b68bc9 | |||
| 00676af822 | |||
| d9af1797dc | |||
| 3720eeeef9 | |||
| 27d57e4107 | |||
| 35f4f02b9d | |||
| d06cf0a82e | |||
| f2a7e5c36c | |||
| 3b2d0fa8ec | |||
| e31acccefc | |||
| 964748e197 | |||
| 8f0c89ea5f | |||
| 46584b732f | |||
| 2e4b36c82e | |||
| db17672017 | |||
| bfacdf5413 | |||
| 90784f5eef | |||
| 02d5a5ef6b | |||
| b34e8c4a0c | |||
| 0f2f1a7055 | |||
| 5ce6f9786a | |||
| 4d899db6d2 | |||
| d0ec938b42 | |||
| 60b507ccdf | |||
| 21bdddfaf0 | |||
| 6359554d59 | |||
| 2cdc197553 | |||
| 9656e972a2 | |||
| 3da098f018 | |||
| 4e5366f09f | |||
| ed20015f6d | |||
| 656edfa6d0 | |||
| 6a865108ab | |||
| 44ecc463dc | |||
| c044954bb4 | |||
| bf5ba0c085 | |||
| 3349e79085 | |||
| 65d00d330b | |||
| e0165db56c | |||
| dda924a53a | |||
| ba148aad49 | |||
| f195c26440 | |||
| db4eb7bbf2 | |||
| f0395aeec0 | |||
| c28ea66957 | |||
| 16a35c6e49 | |||
| e10195a6ec | |||
| 7e773082ae | |||
| 15b8c704a9 | |||
| 240f1f7891 | |||
| 0cccb3d7ac | |||
| 2c1627a2f1 | |||
| 95eb0e7adf | |||
| e3e8613a07 | |||
| 9fcf2037b0 | |||
| 1df9c273b8 | |||
| a4b5738b44 | |||
| 5b023387a4 | |||
| 3cadd60395 | |||
| a352d731a2 | |||
| 1714d7a450 | |||
| e1931bbd3a | |||
| 0e06d19022 | |||
| 089ae3ba9e | |||
| ed8b9eedfa | |||
| 36f51b8607 | |||
| 0596d0d97b | |||
| c1b59f5fbc | |||
| d861f430ad | |||
| c9f32caa50 | |||
| 7e795e2891 | |||
| 6c8d39f935 | |||
| 034b9777cd | |||
| 6b3f645a55 | |||
| 79e72f03fa | |||
| 4ae98b0b1e | |||
| 278855b4c1 | |||
| 2c53e2289a | |||
| 8613522840 | |||
| d4e9a7968e | |||
| 203a80dd73 | |||
| 5b1e6bd728 | |||
| 9cb3e2b28c | |||
| 651ef94645 | |||
| 76c94fb285 | |||
| 3ea8979c01 | |||
| f2705e06cf | |||
| 15e79488cd | |||
| d6975fd00e | |||
| adb81dc26d | |||
| 4096553768 | |||
| b2b25df074 | |||
| c00c55f933 | |||
| c4765573f9 | |||
| 9377247c1f | |||
| d503c92234 | |||
| cce8378466 | |||
| 5a78f132f2 | |||
| 7890ab6c2f | |||
| a1b74e3271 | |||
| 9984e96d5a | |||
| aed74121a3 | |||
| d99dc82675 | |||
| f58bbe717c | |||
| 8b5ec4b5ec | |||
| 47fe0d4747 | |||
| 368e8fcbf6 | |||
| 44d377e425 | |||
| 1d86e7edca | |||
| 6641331242 | |||
| 3eebe47911 | |||
| 447e418d6c | |||
| 4772204a59 | |||
| 7639d04f17 | |||
| b7142a8384 | |||
| c68cfb15ed | |||
| d8494dfb97 | |||
| 811962d3e0 | |||
| a25dbffd6f | |||
| 61c6d8227f | |||
| 08e3414452 | |||
| 70af4a402c | |||
| 47fdaa9927 | |||
| 78758da486 | |||
| d2b290924d | |||
| b04062ce08 | |||
| 7967235960 | |||
| 3edd12c191 | |||
| b27422fb2f | |||
| 0630f6dee9 | |||
| 17e5e203b3 | |||
| ac61b6229a | |||
| 2eb6010bb0 | |||
| 2aa44ad287 | |||
| 55a43bb5bc | |||
| 0e1d8c6f17 | |||
| 03154fb21f | |||
| 107b274009 | |||
| f1336f4f21 | |||
| ea8ccecfde | |||
| 845511f9ae | |||
| 77423c2a20 | |||
| 2b005b32ca | |||
| 0be6196946 | |||
| a7af33f1fb | |||
| a3a68eeb55 | |||
| d6e9171e07 | |||
| c0fc91bce1 | |||
| 9bddf4b972 | |||
| e75db59186 | |||
| a90b921903 | |||
| a25be3e3d5 | |||
| 47789200d4 | |||
| bce2be09a8 | |||
| 20fa8f04a3 | |||
| c4d93c7490 | |||
| fc96da1266 | |||
| 7cf8a0b73a | |||
| cc86ee0dac | |||
| ad6c64aec9 | |||
| 68c826b445 | |||
| f91739ec9a | |||
| 4ea974bb7f | |||
| ffa4909b25 | |||
| 2be7d2e686 | |||
| 2ab35569ae | |||
| 7b3b202b10 | |||
| e42b3baae0 | |||
| 26fda68e9c | |||
| 5cd540a9f8 | |||
| 576769caf1 | |||
| 641362c6b5 | |||
| 60e7012077 | |||
| 73f5b282c8 | |||
| abda6e30dd | |||
| 80c0d68e5d | |||
| 0ff09f4b1f | |||
| 1306851023 | |||
| 6e96735487 | |||
| 99e1e3a121 | |||
| eb0275013f | |||
| 3eaf58a12b | |||
| aa848ad33a | |||
| 1a4da81c69 | |||
| b4707275ab | |||
| ced1f9d8f9 | |||
| 7a1e463097 | |||
| 13b111e4b2 | |||
| e6ca702ea6 | |||
| e9f8133bc9 | |||
| f566c68220 | |||
| 3e74003142 | |||
| a31a3245f2 | |||
| d2379471c7 | |||
| 176f9722ea | |||
| 733c4ece17 | |||
| 024fa2e09f | |||
| d4d29990c8 | |||
| 7e4542f5c0 | |||
| f651927bc8 | |||
| 2099979b4e | |||
| ec924126b2 | |||
| 6b1895ba57 | |||
| 7aaed33421 | |||
| 3d3123d490 | |||
| 7ab8bbe5db | |||
| 3e8ccda80e | |||
| 3a4b604ea3 | |||
| 6dac3ff450 | |||
| a62f4ca624 | |||
| 40eb448c95 | |||
| 2e45a2ffd9 | |||
| 32827de86a | |||
| 5a5407f654 | |||
| 94ce1f5cd9 | |||
| 90cf5b60a2 | |||
| 26fde12a8c | |||
| 067e28d8bc | |||
| f1f6465277 | |||
| 41c2e48906 | |||
| 2d51379aa9 | |||
| 7e2079057b | |||
| 708bb9de05 | |||
| c69d60dba5 | |||
| f3c11d2676 | |||
| 05ae5cd63b | |||
| 63c9018c81 | |||
| 4f10ff3ee6 | |||
| f1a32c6a7c | |||
| 58af432dab | |||
| 911cb8512a | |||
| 9ec51410d2 | |||
| 6e064c60de | |||
| c0090f77b3 | |||
| 03bb3c4a82 | |||
| 8de4b6ed1e | |||
| 8198c25bf0 | |||
| 7ea01038c3 | |||
| e1108928f1 | |||
| 6d8611cb32 | |||
| 6609007746 | |||
| 95eae84b3f | |||
| 433d2b3a70 | |||
| c3509f31ee | |||
| e5024de5b3 | |||
| dba84a150e | |||
| 2549938ad7 | |||
| a9e442320b | |||
| 60e8768b83 | |||
| 16460c0a7b | |||
| 9fef12b955 | |||
| ac56317859 | |||
| 18f8464a00 | |||
| d74ec5df40 | |||
| f71a5e0b5c | |||
| 345c8a94ac | |||
| 846fd6a6d9 | |||
| 2b7fafe698 | |||
| 63040fc74e | |||
| a5c748e8ab | |||
| ec697908bb | |||
| ef6bffdb7c | |||
| 07a422bf86 | |||
| 9878843ed3 | |||
| 3f609f8e31 | |||
| 6930a5263f | |||
| 3395e180e1 | |||
| f140db6a63 | |||
| a790246c4b | |||
| c1b266efad | |||
| 37ed3b545b | |||
| d4f2adc449 | |||
| d6edb8dcbd | |||
| 9489036c50 | |||
| 3ca7f202b4 | |||
| 8855ecbf5b | |||
| c961293eed | |||
| 497cb5cd28 | |||
| 5601229646 | |||
| 92fc236e1c | |||
| 8434fca41f | |||
| 891e8de991 | |||
| cd94f509c3 | |||
| 8de030d7fb | |||
| d32f30ed8a | |||
| dc2307c5ae | |||
| 692bf472e6 | |||
| 2babf9f21e | |||
| 7f08ea7bb0 | |||
| c0ab716d67 | |||
| 28da60a47c | |||
| 9f00ef58da | |||
| 8baac9e338 | |||
| fea8fe1b78 | |||
| 48b150cbf3 | |||
| 42879179bd | |||
| 048d77d474 | |||
| 6e5e36c1c2 | |||
| e4d8f11e55 | |||
| f2f1683a60 | |||
| 2491fc7833 | |||
| 1e1a1edbdc | |||
| ee641c723b | |||
| c9cdd11ceb | |||
| c568af328f | |||
| 96be4f282b | |||
| e013980b83 | |||
| 8fa5f0e741 | |||
| 57bba404ab | |||
| fe56ee1741 | |||
| 033973ca72 | |||
| cccfc167dd | |||
| 9d326c107d | |||
| 8903ab265e | |||
| cf5b6ec37f | |||
| e4848b2055 | |||
| 81f6d0c1c9 | |||
| 3ad3ffaa2d | |||
| c3c3d4e98f | |||
| 203c408a67 | |||
| 5b64122a3e | |||
| 98b82e35a7 | |||
| 0674674ad0 | |||
| 31d2a3aad7 | |||
| be2a37427c | |||
| 5d2310d3d8 | |||
| 37bab66bfe | |||
| cd7311b76c | |||
| a532ec20b1 | |||
| c41ba4e79a | |||
| 411020b4c9 | |||
| 41b83c9851 | |||
| 52ba1be9f9 | |||
| 9f3b3bf4d2 | |||
| 244f1cc32d | |||
| cee4e4ac5e | |||
| da653eed57 | |||
| f0a030b94b | |||
| 455db9e086 | |||
| 013d328e7d | |||
| b703ac7f27 | |||
| d767aaddd2 | |||
| dd7996b57d | |||
| 3f92b8e1c5 | |||
| 6254c4b242 | |||
| 2aebf37542 | |||
| 9e5633feff | |||
| 792c339edc | |||
| 06777c4102 | |||
| bdad6336fe | |||
| fcda743c44 | |||
| 9346f805f2 | |||
| b2dc58dcb9 | |||
| 6313928fbc | |||
| a4d68196e7 | |||
| 132655443b | |||
| c10b5622a0 | |||
| d471d382ac | |||
| 899626019f | |||
| bd3ba18da4 | |||
| a49957015e | |||
| 4943ed3c70 | |||
| d9b1ff4d71 | |||
| 1ba5df7bc3 | |||
| 6603ec2fb3 | |||
| cedd6d624b | |||
| 0bb6e095b3 | |||
| 94cd3d8542 | |||
| d00ccf814c | |||
| 4cb9c7b916 | |||
| 4cd32401ec | |||
| 0976e2d58a | |||
| a47df0d6a3 | |||
| 4e9c93545f | |||
| 5b9e3507b7 | |||
| 8bdfaee6e9 | |||
| 81b4f79c43 | |||
| cc56e83767 | |||
| 24144c56f9 | |||
| 179361f956 | |||
| fd0426c762 | |||
| c9f4bc4e68 | |||
| 504c41fa1b | |||
| 853105d4bd | |||
| 285124fa83 | |||
| a8b9cb97c2 | |||
| d880a29e2d | |||
| bfdb6ef10a | |||
| 3611bd11a5 | |||
| b489a74147 | |||
| 5d52c03318 | |||
| 78985e5d68 | |||
| 4231c89fee | |||
| e6a48c0188 | |||
| 234e84dc35 | |||
| c0168538ae | |||
| 29c216b93f | |||
| aa9be76b3f | |||
| add76409e0 | |||
| c994aa10d8 | |||
| 47e3b01c82 | |||
| 55501d239e | |||
| fdfece661a | |||
| 9f77006419 | |||
| 52567ff22b | |||
| d01fcfd9ab | |||
| 9b1f7c5b4b | |||
| 4ea5aa6f01 | |||
| 8e781d4d16 | |||
| 1bfd17915d | |||
| a39ea72650 | |||
| 1d0b7ff106 | |||
| 9cfe687e4a | |||
| 45b1b3daa1 | |||
| 4394d1d4ba | |||
| 5b1096a52a | |||
| 161c703a1f | |||
| 6674f95bc1 | |||
| 066e14f83f | |||
| 3d1daf7c5a | |||
| 070e2da241 | |||
| 3048ebcced | |||
| 077579b060 | |||
| 2cafbd6dbd | |||
| e2f347c513 | |||
| 884ad61823 | |||
| 3a872a1d8c | |||
| cc9e4d787b | |||
| 80c9d1e629 | |||
| fb59f7982a | |||
| bc68d4f0e0 | |||
| 9133c72c96 | |||
| cbc91604dd | |||
| fafad95f72 | |||
| f17bd8c546 | |||
| 274fcc293a | |||
| 8d4db65927 | |||
| f627ad5df2 | |||
| 9db13b8df4 | |||
| 87c3097be5 | |||
| bb457316d4 | |||
| d4901ad3b0 | |||
| bf9893dbf3 | |||
| 15333eaf9a | |||
| a80337baab | |||
| 8443885e88 | |||
| d559ff6c4c | |||
| b38e12c90c | |||
| dd89970f66 | |||
| ddf4cc5bb2 | |||
| 6681ddceb8 | |||
| 0950f7f943 | |||
| b6d33fd296 | |||
| 1857322c43 | |||
| 208fdf2681 | |||
| 65d1ba667b | |||
| ae9fbb2eaa | |||
| b489a41127 | |||
| 9d2770100d | |||
| 287bda5b7e | |||
| 98945439e1 | |||
| 3ae1348425 | |||
| a0fefe1074 | |||
| 5072f3a3c6 | |||
| 68a33cd7ba | |||
| f6fc901227 | |||
| 74f0cf7073 | |||
| a9ef49d196 | |||
| a64d69ce19 | |||
| 07357e4048 | |||
| 4c20e1b099 | |||
| 153479dac9 | |||
| 16e4f9b004 | |||
| e6fc8c2ad2 | |||
| 14ee3219ae | |||
| 5a00199a04 | |||
| eac8c0a104 | |||
| b9b6bacc5f | |||
| ba584e1ac1 | |||
| 2a1014565d | |||
| 620d770f3c | |||
| 15a9d1bb55 | |||
| 131381a91a | |||
| 50cb988c49 | |||
| f80a00ba88 | |||
| b5f51f5366 | |||
| 243e8a0645 | |||
| b6a990f767 | |||
| 0c9e87a440 | |||
| c9051e4101 | |||
| c9c31cce11 | |||
| 70f3450c5e | |||
| b9c2b3087c | |||
| 0cc9e25227 | |||
| 17ef04d50b | |||
| d1171adee8 | |||
| fe5b9e2242 | |||
| f5b4f0961e | |||
| f32803f7b9 | |||
| 6b05c585d1 | |||
| 07364f0e31 | |||
| b4a48d02b2 | |||
| bd8c6c8a32 | |||
| d3ff87aeb2 | |||
| 47d531fb41 | |||
| 81820dd14f | |||
| c69d0bfe09 | |||
| 07040f354c | |||
| 51aa7c22a4 | |||
| dda7b43d44 | |||
| 6d42b5f6c1 | |||
| 8225948ffd | |||
| be8cd47fc8 | |||
| 6ac283a20b | |||
| 35f32fe073 | |||
| 62eaf4f7cb | |||
| af37384cff | |||
| 16af384434 | |||
| e34b13367b | |||
| fb985d0860 | |||
| 97f06df836 | |||
| 06fe039cd9 | |||
| e22f7b5958 | |||
| 27e7935c6c | |||
| b8b676a8d7 | |||
| fa19c3d5e3 | |||
| 60505541ec | |||
| 894e118a3b | |||
| 49bf6a544f | |||
| 2d79be2427 | |||
| fbad78fbb4 | |||
| 10269d0a5b | |||
| fe90df6c23 | |||
| 9a8bbca8df | |||
| d762f84977 | |||
| c53882872b | |||
| 6af34ad829 | |||
| e3729362c9 | |||
| 691b9f892f | |||
| f0d6341ddf | |||
| f8bb25d058 | |||
| e4f944939c | |||
| 005ea81ecf | |||
| 9fd85ad079 | |||
| b3a080b633 | |||
| 4078d90539 | |||
| 19653b4a77 | |||
| 057f56133b | |||
| fe5ee0c29b | |||
| 4af772ceaa | |||
| 7ec65a1816 | |||
| b397d2775e | |||
| 31f05a6594 | |||
| d7731afca3 | |||
| 16671aa50d | |||
| aa3a17d3e5 | |||
| 7716182610 | |||
| a0be1da4b5 | |||
| 6bde2bde12 | |||
| b7a3cff456 | |||
| 69d284bc83 | |||
| 5a3b3d38e3 | |||
| 71d0c0f554 | |||
| 060d270a04 | |||
| e77f033498 | |||
| e74cb7f6cd | |||
| 23a3e5f751 | |||
| 1164685c68 | |||
| cd8eaad8cb | |||
| 23a41e0e22 | |||
| 7867d64876 | |||
| ddd060a1cc | |||
| 894699eccf | |||
| 2661df4606 | |||
| 6fcc641c25 | |||
| c4269df612 | |||
| c612a2b43a | |||
| ea04312f27 | |||
| d9e06f64fa | |||
| 8604dad16c | |||
| 7dbc7f63e4 | |||
| d746b4a9d9 | |||
| a43d770825 | |||
| 84d277bfa3 | |||
| 08a075ef1d | |||
| ff1f9f9c5f | |||
| 2c89f96f00 | |||
| e0bb22b2f2 | |||
| 20e713630a | |||
| 022360d1f3 | |||
| 2d87ec3973 | |||
| 57889369b1 | |||
| 2d90b21794 | |||
| fa763e41c5 | |||
| 1e7427bab1 | |||
| 74081e597a | |||
| 45884e4786 | |||
| 95b22341a9 | |||
| 7059e4d396 | |||
| d53f68be0c | |||
| ce1c08f9a7 | |||
| cc1ff6ac3b | |||
| 2eda1ac2e6 | |||
| 6ded61e205 | |||
| bdbf0fd6e7 | |||
| 42ccc4e1dc | |||
| b5f0ebcab2 | |||
| e49d50c75a | |||
| 9c76f9ff43 | |||
| a6316eb5a3 | |||
| c6f406fe8a | |||
| f9fedcc59e | |||
| 91621686b4 | |||
| c65a263dbd | |||
| f6ad02364e | |||
| 1e75a2cb6b | |||
| 92b2936c5d | |||
| d486f26151 | |||
| 6c6dcbaf31 | |||
| e0d8349d71 | |||
| 7b51212b96 | |||
| 65d236b00a | |||
| 29e97984bd | |||
| 4507193d46 | |||
| 62afc9063e | |||
| 29f5bd43f3 | |||
| a32593c948 | |||
| 4737871613 | |||
| 74d8c0d6c7 | |||
| ff799f5cbd | |||
| 90dc67f344 | |||
| f4b5e5e4e2 | |||
| 131f31f56a | |||
| b5d3e81f81 | |||
| ba22dba981 | |||
| 5084f6a5af | |||
| c162fcb75b | |||
| b5735684f1 | |||
| b1c73cc5d5 | |||
| a9c97531cc | |||
| ad4c214b8a | |||
| 6c81abe28a | |||
| 39d721981d | |||
| db23930d21 | |||
| 2ce9615e73 | |||
| 123caf7cf3 | |||
| 9ce6ffeb61 | |||
| 1051191967 | |||
| a4f7e7dc47 | |||
| 97494a63ff | |||
| 50dce179c6 | |||
| eae942732d | |||
| cc655b5c49 | |||
| 341fcd0ce8 | |||
| 5894f2b28b | |||
| 63445557bc | |||
| b5108b031d | |||
| 5df093ae50 | |||
| 2b72b059ae | |||
| b24053a707 | |||
| 7885a9a847 | |||
| a8caac4db1 | |||
| 22fe0b7120 | |||
| f593f652a1 | |||
| 472839ca28 | |||
| 27967f1c68 | |||
| 926f89eea2 | |||
| 6acf41814e | |||
| 7d415cd3ba | |||
| e22f63ffe4 | |||
| 58235a7b39 | |||
| fc244dde4d | |||
| eaa124d2bb | |||
| ff91dd3e26 | |||
| c9e7103635 | |||
| 7689fdc0de | |||
| 6ca7bc423e | |||
| 80382ac6db | |||
| b19046c64a | |||
| 460eea1be5 | |||
| 216983828c | |||
| ebe45e5924 | |||
| 4b7cf8f4e4 | |||
| 1558d08adf | |||
| 762131e218 | |||
| 88fd0f04eb | |||
| d0391be1b2 | |||
| 16deeeaa4f | |||
| 03d493b128 | |||
| 1e81e10718 | |||
| 08f30e7815 | |||
| 96a259dec6 | |||
| 4668c18e0d | |||
| 82ba393469 | |||
| 63ebe3e674 | |||
| 9852907d33 | |||
| 69091e3dbe | |||
| f7fc0542e6 | |||
| ef51173b0f | |||
| 013f400365 | |||
| 54947ecb22 | |||
| d352331827 | |||
| 16219843f0 | |||
| 8ef0956af1 | |||
| ad1ef6acc0 | |||
| e7cfaab44d | |||
| d72152fb05 | |||
| 6c16817c8c | |||
| bf7c850715 | |||
| e06996f8a4 | |||
| 0ff3f5a861 | |||
| 3647146e3c | |||
| 509541bc27 | |||
| 46f613cb48 | |||
| 1951adcd6c | |||
| 8ef28580f8 | |||
| 3c2f2a51ca | |||
| e852bd8b8f | |||
| e06d00b0ec | |||
| ef975e2309 | |||
| 39afbfc8c8 | |||
| 2937461f0d | |||
| 73744f4af1 | |||
| 61ad9eedb4 | |||
| 06beb889b1 | |||
| ef9dc2aadc | |||
| eb3a9225fe | |||
| 9499558186 | |||
| 865faaa288 | |||
| 8173067467 | |||
| dff5e13d77 | |||
| 89c36100ae | |||
| dbffc3a3ee | |||
| 26b060e979 | |||
| c612fe086a | |||
| 5cb5bc407f | |||
| 4251cddf3d | |||
| 31b66adf3d | |||
| ae1c7e1209 | |||
| 6ee55d25a2 | |||
| 2a479f198a | |||
| 198b05a384 | |||
| d2a821bfa7 | |||
| bafc4932e7 | |||
| 1f05126531 | |||
| a8305cea49 | |||
| f27ed705b5 | |||
| 229afd99d0 | |||
| c1c272ccef | |||
| f780559565 | |||
| df005f262e | |||
| c9d57eae6d | |||
| 0e2e602eb6 | |||
| ed1bf7577e | |||
| ca69a3255e | |||
| 43fb06b64c | |||
| b6b1371fd1 | |||
| 1cc097b05a | |||
| 1cb6b1dc86 | |||
| d0a414b7d5 | |||
| bb98e9ad55 | |||
| 668d3df3e5 | |||
| 9106524e8c | |||
| 6c601767c8 | |||
| 82fb571d05 | |||
| 0de0dbca1d | |||
| 044cba4bbd | |||
| f1f6d27091 | |||
| bd6c92c79f | |||
| de5acedb80 | |||
| 649862bd07 | |||
| 24c15324a0 | |||
| c60bb0e13c | |||
| ba992c272d | |||
| 89ad730710 | |||
| 905ba123eb | |||
| d26723ce24 | |||
| 6c331e9627 | |||
| 70422516a9 | |||
| 9dd092a374 | |||
| cc5715fc43 | |||
| 3d75fe5639 | |||
| 28906f3245 | |||
| dd20c79584 | |||
| a3e7cb04e6 | |||
| 9d0747d32c | |||
| 331a645768 | |||
| ad96327325 | |||
| 5a1d345b0e | |||
| aa302c54f5 | |||
| c05f78550c | |||
| 71d515c83d | |||
| 0c7f5ca3d2 | |||
| 4ce28e76f1 | |||
| dd7459606e | |||
| ad2239fe80 | |||
| adb677eddd | |||
| a3f979febf | |||
| 0f42e4c34c | |||
| da4b470778 | |||
| 2290a2beef | |||
| 1f27f3f987 | |||
| c56b925dff | |||
| afdb830d5c | |||
| 7315243e84 | |||
| cc8ccb3cc3 | |||
| 639d8a219f | |||
| 36d7a434dc | |||
| 66d2f1225c | |||
| 763e433c88 | |||
| 5bea383284 | |||
| 4c879da5c3 | |||
| 32aba6de7d | |||
| 6a1e4a9f17 | |||
| 42f5949410 | |||
| 11f6f2330f | |||
| 2b751f4a2e | |||
| c7ba3a551e | |||
| e2971f7a72 | |||
| 5a2488e6db | |||
| d75ff3559e | |||
| cce3b82113 | |||
| 1c3e6149ab | |||
| 578f3a1f04 | |||
| b0640f8065 | |||
| 2fa1712985 | |||
| 4213b79edd | |||
| ea4c4c364e | |||
| fb295e22c9 | |||
| 31652e9763 | |||
| 3cde3fa84b | |||
| df6271a1da | |||
| 6da37422ba | |||
| 4e950036c8 | |||
| 513740a776 | |||
| 52f8515147 | |||
| 0c7f6ff413 | |||
| 9fdf10eb97 | |||
| 0b57da4bec | |||
| faa1fb3db2 | |||
| b119930437 | |||
| d930bb83f4 | |||
| ce9e267057 | |||
| a644406aad | |||
| 0aa9708044 | |||
| 55c4718c70 | |||
| ec958d44bb | |||
| b6565284f7 | |||
| 8c0ee18262 | |||
| eda0bbade0 | |||
| 3d17935885 | |||
| ab92594cff | |||
| c4c297ad85 | |||
| cd7f7154b1 | |||
| bae86f8e78 | |||
| 6fbfd3ffd5 | |||
| b6569d7991 | |||
| 010b2ac109 | |||
| 170467f247 | |||
| 6d96614e35 | |||
| efc6f7e6c8 | |||
| 556c5ee911 | |||
| e57ef0d520 | |||
| 119acded67 | |||
| 4a465e8a9b | |||
| 5f90f383ce | |||
| 2608c9f98a | |||
| dcd708c846 | |||
| c67bd2b301 | |||
| 9fc8e11e00 | |||
| 7607136792 | |||
| 2a3f610eb9 | |||
| c2317d7c75 | |||
| 04ecaa54cf | |||
| a435cd4cf5 | |||
| 12b08d2185 | |||
| a97e64ba17 | |||
| 990cf5a7a7 | |||
| 41d7f8e590 | |||
| 735a0183a7 | |||
| 336f420bc5 | |||
| be1cd514a5 | |||
| 1fab1d96bd | |||
| b028c9ef84 | |||
| 1e6493c8ee | |||
| 397689f94e | |||
| c1d598d496 | |||
| 70970ce418 | |||
| d60e59b608 | |||
| 1d0d1555ad | |||
| 6af79bf7df | |||
| fb55f9a6b3 | |||
| 382fa53396 | |||
| 47f185eab0 | |||
| c788e2ff5b | |||
| ae2fd7e6bd | |||
| 316ab795a9 | |||
| eb3161e4ac | |||
| c16f4fa7c9 | |||
| e9f60429c1 | |||
| b0ce8acbea | |||
| 14cf6679c8 | |||
| 87fa62c388 | |||
| 64a768a21e | |||
| f5131a37c0 | |||
| 6f6a15457d | |||
| f60d2f14a3 | |||
| 48aabc2171 | |||
| d08cdaddde | |||
| 0ad82ab3b4 | |||
| 6b68862bbd | |||
| 5ee85fd7d0 | |||
| bc2465e148 | |||
| 27a2582c37 | |||
| 611e124f5c | |||
| 50e72aaad2 | |||
| 8168cfac18 | |||
| 1d8322b8e3 | |||
| 0389cc8021 | |||
| d6288badf4 | |||
| e48f3466b1 | |||
| e3bc429a38 | |||
| 11f8a59286 | |||
| 42935dffca | |||
| e83db03597 | |||
| 20c79bb05e | |||
| 06f653f1b5 | |||
| 2df5bc99df | |||
| d90a395329 | |||
| c5db2d45ac | |||
| c5d79310d3 | |||
| a0dc2bf45b | |||
| 3b1c9d0196 | |||
| 7fa99399c8 | |||
| d68107aa9d | |||
| 5a3a2f13d5 | |||
| 72471f5f33 | |||
| 9778d30bb8 | |||
| 698380bda5 | |||
| 404dd583fa | |||
| 7c0d6d1255 | |||
| 3ad66df568 | |||
| e46947d777 | |||
| f6cd092201 | |||
| 45cba68616 | |||
| 6d4c290170 | |||
| abe882ea95 | |||
| dfe28a253f | |||
| 9100b307dc | |||
| 6db0fffd14 | |||
| dc3ef42bbd | |||
| 697755b1fe | |||
| b4c068cfbb | |||
| 3439967223 | |||
| a3eadefe4b | |||
| 880a48f0b9 | |||
| a7327aa9f0 | |||
| cdffe69512 | |||
| 3294c71024 | |||
| 6592bc8f58 | |||
| 0b7929d6b4 | |||
| eddab79fdb | |||
| c1adaa985d | |||
| 9f0ba0f883 | |||
| f25ecbfd4e | |||
| a604e2d91f | |||
| 03b293375a | |||
| 2ffc089b6f | |||
| 5f541bc22f | |||
| 7553c905c7 | |||
| 4051839d03 | |||
| bd435c4fc7 | |||
| 9c67c38609 | |||
| 585b1ced9e | |||
| aca9b556d5 | |||
| 63809ba7b9 | |||
| 7ae10a085b | |||
| dd59b7acb3 | |||
| a0b74cea40 | |||
| 8a8559d63c | |||
| dbe5bad5bd | |||
| 7f81232309 | |||
| 46b47877e5 | |||
| 6f4d7a2990 | |||
| 9ef9da1519 | |||
| 4e208dae3c | |||
| e0d555f72f | |||
| 6883144780 | |||
| 0948488e79 | |||
| b9a1aefc2b | |||
| 00e9365a2d | |||
| 994ed53c08 | |||
| e2032bcc90 | |||
| 561e156ce3 | |||
| 7ff45b07d0 | |||
| 9a5004d4cd | |||
| 209ecc9f3f | |||
| 0ef013fc85 | |||
| 34558334e8 | |||
| 8c205db428 | |||
| eb12357011 | |||
| 11bbca6467 | |||
| cde30ab205 | |||
| 662f996003 | |||
| b9eafb57e3 | |||
| 3d8b10622a | |||
| 9c99b5e988 | |||
| 176d7dfdb5 | |||
| 694f70284d | |||
| c1fe8b8558 | |||
| a4ac0f8915 | |||
| 8d895fc3c3 | |||
| e9dc5fbd4c | |||
| 8f70c1a43f | |||
| f74b34aac2 | |||
| 1acbf3eb64 | |||
| 9a66307754 | |||
| d7bd267c7e | |||
| a15640d10e | |||
| b314b544e5 | |||
| 1c8972af9d | |||
| ae5d2c7131 | |||
| 058c71d944 | |||
| c75d24d0d3 | |||
| f30b671683 | |||
| 3588837aa6 | |||
| f7e18f35b4 | |||
| af31d858d2 | |||
| 16187bdb69 | |||
| f7769e0ea0 | |||
| 2834944fc2 | |||
| 2f07ece0bb | |||
| 9d815d019d | |||
| 6fc2de6382 | |||
| aa5b099870 | |||
| ae5bc1b527 | |||
| 9193ac9dd7 | |||
| 1abd142de9 | |||
| f3a3fb85b1 | |||
| 45530120f2 | |||
| 210aefc777 | |||
| de004b4c7d | |||
| afb50f1c25 | |||
| f625c86e22 | |||
| 7feb0b73c8 | |||
| a88ee6e269 | |||
| 9b31bc95cb | |||
| 9afed6b932 | |||
| 226c9005c3 | |||
| edc382137b | |||
| cb9eeb2af2 | |||
| be090649a2 | |||
| cb1f9a0c9f | |||
| d25133fd5e | |||
| efccb54a60 | |||
| c6ccba38d4 | |||
| 0a3856e45c | |||
| c04ebb1c5f | |||
| 7c6b38c6f4 | |||
| 1ff598b75c | |||
| 19e595c09f | |||
| 03d268196b | |||
| 384eb5a622 | |||
| d9a09ae2f3 | |||
| a2e81e7341 | |||
| fa320437c0 | |||
| 72cea610f0 | |||
| 36368b6db9 | |||
| 701d152d37 | |||
| 1b4424dbcc | |||
| 19db0e31cb | |||
| 4517c16fe7 | |||
| cf7605fafc | |||
| a274c8ea37 | |||
| 5469adc1a4 | |||
| cd3da7143d | |||
| 104ff32b23 | |||
| bfeb265434 | |||
| f647edb0e5 | |||
| 57ccecc74d | |||
| 661b5c9144 | |||
| ff3054b592 | |||
| 60e2a6c117 | |||
| 89b3183f65 | |||
| cb559e2947 | |||
| 851b2f961c | |||
| b43ee31622 | |||
| 3c032987f0 | |||
| 94a4233910 | |||
| 52da92bf5b | |||
| 3e16d73f38 | |||
| 50317fc036 | |||
| 727fa3f326 | |||
| 0ba37f72a9 | |||
| 44e6ff72b0 | |||
| b24df55aa8 | |||
| 8a5d58beda | |||
| 3ec3b6a878 | |||
| 22e31f0c68 | |||
| 7daf507a80 | |||
| 1bc5e2265a | |||
| 9ce5538ff4 | |||
| 28ac4c7f40 | |||
| 98ec76d941 | |||
| 410b30f6fd | |||
| 65bf9d35e8 | |||
| 4faabb5898 | |||
| 73ceda8109 | |||
| 13176beb94 | |||
| 63d8c0f509 | |||
| 4f03cb0b56 | |||
| bee049436d | |||
| 7b9f3873da | |||
| 208294924d | |||
| 8181d545fd | |||
| 4a5acb6109 | |||
| eba6d81509 | |||
| 1a54ac7031 | |||
| 8d73d7448e | |||
| 900d3ace25 | |||
| 1b2b22150b | |||
| 03fe7f5b3a | |||
| 4ef03c0719 | |||
| 1e4e8e1a11 | |||
| 3de55e7d5e | |||
| e367628f60 | |||
| f3631afcf7 | |||
| 7d8eea6cce | |||
| a6eea770e2 | |||
| 7ed263378e | |||
| 8f6bcf630c | |||
| 7fe84f050c | |||
| f332b3cc2e | |||
| dd3118a745 | |||
| 0d2691af8b | |||
| 9e3bec943f | |||
| 678da4f186 | |||
| 022f3ad024 | |||
| d8d337c3d4 | |||
| ffba6c64ee | |||
| 3a447bbcc0 | |||
| bbb25ddb08 | |||
| 32a11da551 | |||
| 281f06e639 |
@@ -48,4 +48,9 @@ massif.*
|
||||
src/ndnSIM
|
||||
configure
|
||||
toggle
|
||||
.ns3rc
|
||||
.cproject
|
||||
.project
|
||||
.settings/
|
||||
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@ massif.*
|
||||
\.patch$
|
||||
\.diff$
|
||||
\.tr$
|
||||
\.txt$
|
||||
\.sh$
|
||||
\.dat$
|
||||
\.plt$
|
||||
\#[^\#/]+\#$
|
||||
^coverity
|
||||
^(D|U)l[A-Z][a-z]*Stats.txt$
|
||||
syntax: glob
|
||||
TAGS
|
||||
waf
|
||||
|
||||
@@ -66,3 +66,8 @@ ae540de68a2534213342c5e0b12afb47d7518a90 ns-3.14
|
||||
49d343e55caec257bb01e400eef6c14522f37e1b ns-3.16
|
||||
b4a70b99171ade6e9628a87780994238950a1df1 ns-3.17
|
||||
cfbc9491d7e7c9d346cc042fd35b8afb8836e81f ns-3.18
|
||||
322102df792e2be6c74df74f776b3470fb1db795 ns-3.19
|
||||
da0eb48df23f96335f32a37f047a6bc27e197c8d ns-3.20
|
||||
fa4be182ef17746cea50e89af557c79a28b76533 ns-3.21
|
||||
103f62fc7d586cf6d4d6fd9f5e488d2f7f8fe436 ns-3.22
|
||||
8ea92bc090cdc01e683a2116d7668ce745ae92e2 ns-3.23
|
||||
|
||||
@@ -2,6 +2,7 @@ Alexander Afanasyev (alexander.afanasyev@ucla.edu)
|
||||
Rohit Agarwal (mindprince@gmail.com)
|
||||
Kirill Andreev (andreev@iitp.ru)
|
||||
Dean Armstrong (deanarm@gmail.com)
|
||||
Stefano Avallone (stefano.avallone@unina.it)
|
||||
Ghada Badawy (gbadawy@gmail.com)
|
||||
Nicola Baldo (nbaldo@cttc.es)
|
||||
Mirko Banchi (mk.banchi@gmail.com)
|
||||
@@ -11,29 +12,47 @@ Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu)
|
||||
Raj Bhattacharjea (raj.b@gatech.edu)
|
||||
Timo Bingmann (timo.bingmann@student.kit.edu)
|
||||
Julien Boite (juboite@gmail.com)
|
||||
Biljana Bojovic (bbojovic@cttc.es)
|
||||
Elena Borovkova (borokovaes@iitp.ru)
|
||||
Pavel Boyko (boyko@iitp.ru)
|
||||
Dan Broyles (muxman@sbcglobal.net)
|
||||
Jonathan Brugge (j.d.brugge@student.utwente.nl)
|
||||
Junling Bu (linlinjavaer@gmail.com)
|
||||
Elena Buchatskaia (borovkovaes@iitp.ru)
|
||||
Nuno Cardoso (nunopcardoso@gmail.com)
|
||||
Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com)
|
||||
Scott Carpenter (scarpen@ncsu.edu)
|
||||
Tiago Cerqueira (tiago.miguel43@gmail.com)
|
||||
Egemen K. Cetinkaya (ekc@iitc.ku.edu)
|
||||
Angelos Chatzipapas (chatzipa@ceid.upatras.gr)
|
||||
Eugene Chemeritskiy (echemeritskiy@arccn.ru)
|
||||
Yufei Cheng (yfcheng@ittc.ku.edu)
|
||||
Andrey Churin (aachurin@gmail.com)
|
||||
Benjamin Cizdziel (ben.cizdziel@gmail.com)
|
||||
Salva Climent (jocliba@gmail.com)
|
||||
Luis Cortes (cortes@gatech.edu)
|
||||
Luca Costantino (luca.costantino@gmail.com)
|
||||
Matthieu Coudron (matthieu.coudron@lip6.fr)
|
||||
Alexander D'souza (moijes12@gmail.com)
|
||||
Sébastien Deronne (sebastien.deronne@gmail.com)
|
||||
Craig Dowell (craigdo@ee.washington.edu)
|
||||
Gilaras Drakeson (gilaras@gmail.com)
|
||||
Christian Facchini (c.facchini@gmail.com)
|
||||
Denis Fakhriev (fakhriev@iitp.ru)
|
||||
Jahanzeb Farooq (Jahanzeb.Farooq@inria.fr, Jahanzeb.Farooq@gmail.com)
|
||||
Luca Favatella (slackydeb@gmail.com)
|
||||
Margherita Filippetti (morag87@gmail.com)
|
||||
Pedro Fortuna (pedro.fortuna@inescporto.pt)
|
||||
Juliana Freitag Borin (juliana.freitag@gmail.com)
|
||||
Piotr Gawlowicz (gawlowicz.p@gmail.com)
|
||||
Eric Gamess (egamess@gmail.com)
|
||||
Yida Gao (yidapb@gmail.com)
|
||||
Thomas Geithner (thomas.geithner@dai-labor.de)
|
||||
Ashim Ghosh (ashim.atiit@gmail.com)
|
||||
Martin Giachino (martin.giachino@gmail.com,giachino@fing.edu.uy)
|
||||
Tom Goff (tgoff@tgoff.net)
|
||||
Mohit Goyal (mohit.bits@gmail.com)
|
||||
Juan C. Granda (jcgranda@uniovi.es)
|
||||
David Gross (gdavid.devel@gmail.com)
|
||||
Maja Grubišić (maja.grubisic@live.com)
|
||||
Charline Taibi Guguen (charline.guguen@gmail.com)
|
||||
@@ -41,63 +60,110 @@ Daniel Halperin (daniel@halper.in)
|
||||
Bruno Haick (bghaick@hotmail.com)
|
||||
Frank Helbert (frank@ime.usp.br)
|
||||
Tom Henderson (tomhend@u.washington.edu)
|
||||
Christopher Hepner (hepner@hs-ulm.de)
|
||||
Budiarto Herman (budiarto.herman@magister.fi)
|
||||
Tom Hewer (tomhewer@mac.com)
|
||||
Kristian A. Hiorth (kristahi@ifi.uio.no)
|
||||
Kim Højgaard-Hansen (kimrhh@gmail.com)
|
||||
Chris Hood (chood8@gatech.edu)
|
||||
Blake Hurd (naimorai@gmail.com)
|
||||
ishan (ishan.chhabra@gmail.com)
|
||||
Mohamed Amine Ismail (amine.ismail@inria.fr, iamine@udcast.com)
|
||||
Jared Ivey (j.ivey@gatech.edu)
|
||||
Atishay Jain (atishayjain25@gmail.com)
|
||||
Sascha Alexander Jopen (jopen@informatik.uni-bonn.de)
|
||||
Sam Jansen (sam.jansen@gmail.com)
|
||||
Liu Jian (liujatp@gmail.com)
|
||||
Joe Kopena (tjkopena@cs.drexel.edu)
|
||||
Piotr Jurkiewicz (piotr.jerzy.jurkiewicz@gmail.com)
|
||||
Evgeny Kalishenko (ydginster@gmail.com)
|
||||
Konstantinos Katsaros (dinos.katsaros@gmail.com)
|
||||
Morteza Kheirkhah (m.kheirkhah@sussex.ac.uk)
|
||||
Flavio Kobuta (flaviokubota@gmail.com)
|
||||
Joe Kopena (tjkopena@cs.drexel.edu)
|
||||
Christopher Kosecki (christopher.l.kosecki.ctr@mail.mil)
|
||||
Aleksey Kovalenko (kovalenko@iitp.ru)
|
||||
Mathieu Lacage (mathieu.lacage@inria.fr)
|
||||
Emmanuelle Laprise (emmmanuelle.laprise@bluekazoo.ca)
|
||||
Kristijan Lenković (k.lenkovic@me.com)
|
||||
Daniel Lertpratchya (nikkipui@gmail.com)
|
||||
Brett Levasseur (brettl20@gmail.com)
|
||||
Björn Lichtblau (lichtbla@informatik.hu-berlin.de)
|
||||
Timo Lindhorst (tlnd@online.de)
|
||||
Erwan Livolant (erwan.livolant@inria.fr)
|
||||
Keith Ma (keith.nwsuaf@gmail.com)
|
||||
Federico Maguolo (maguolof@dei.unipd.it)
|
||||
Antti Makela (zarhan@cc.hut.fi)
|
||||
Francesco Malandrino (francesco.malandrino@gmail.com)
|
||||
Rubén Martínez (rmartinez@deic.uab.cat)
|
||||
Fabian Mauchle (f1mauchl@hsr.ch)
|
||||
Andrey Mazo (mazo@iitp.ru)
|
||||
Jonathan McCrohan (jmccroha@tcd.ie)
|
||||
Andrew McGregor (andrewmcgr@gmail.com)
|
||||
Vedran Miletić (rivanvx@gmail.com)
|
||||
Jens Mittag (jens.mittag@kit.edu)
|
||||
Marco Miozzo (mmiozzo@cttc.es)
|
||||
Faker Moatamri (faker.moatamri@inria.fr)
|
||||
Edvin Močibob (edvin.mocibob@gmail.com)
|
||||
Mike Moreton (mjvm_ns@hotmail.com)
|
||||
Michele Muccio (michelemuccio@virgilio.it)
|
||||
Esteban Municio (esteban.municio@urjc.es)
|
||||
Sidharth Nabar (snabar@uw.edu)
|
||||
Hemanth Narra (hemanth@ittc.ku.edu)
|
||||
Roman Naumann (naumann@informatik.hu-berlin.de)
|
||||
Ben Newton (bn@cs.unc.edu)
|
||||
Cecchi Niccolò (insa@igeek.it)
|
||||
Andreas Nilsson (andrnils@gmail.com)
|
||||
Jaume Nin (jnin@cttc.es)
|
||||
Michael Nowatkowski (nowatkom@gmail.com)
|
||||
Anh Nguyen (annguyen@ittc.ku.edu)
|
||||
Duy Nguyen (duy@soe.ucsc.edu)
|
||||
Luis Pacheco (luisbelem@gmail.com)
|
||||
Lluís Parcerisa (parcerisa@gmail.com)
|
||||
Natale Patriciello (natale.patriciello@gmail.com)
|
||||
Tommaso Pecorella (tommaso.pecorella@unifi.it)
|
||||
Vikas Pushkar (vikaskupushkar@gmail.com)
|
||||
Guangyu Pei (guangyu.pei@boeing.com)
|
||||
Josh Pelkey (jpelkey@gatech.edu)
|
||||
Per (per_e_lists@rocketmail.com)
|
||||
Fernando Pereira (ferdonfeup@gmail.com)
|
||||
Colin Perkins (csp@csperkins.org)
|
||||
Giuseppe Piro (g.piro@poliba.it)
|
||||
Yana Podkosova (yanapdk@rambler.ru)
|
||||
Guangyu Pei (guangyu.pei@boeing.com)
|
||||
Vikas Pushkar (vikaskupushkar@gmail.com)
|
||||
Andrea Ranieri (andreran@uno.it)
|
||||
Bruno Ranieri (Yrrsinn@googlemail.com)
|
||||
Ken Renard (kenneth.renard@arl.army.mil)
|
||||
Manuel Requena (mrequena@cttc.es)
|
||||
Matias Richart (mrichart@fing.edu.uy)
|
||||
George F. Riley (riley@ece.gatech.edu)
|
||||
Juergen Rinas (jrinas@gmx.de)
|
||||
Sebastian Rohde (sebastian.rohde@tu-dortmund.de)
|
||||
Karsten Roscher (sfx@rocktale.de)
|
||||
Bill Roome (wdr@bell-labs.com)
|
||||
David (david.rua@gmail.com)
|
||||
Andrea Sacco (andrea.sacco85@gmail.com)
|
||||
Lynne Salameh (l.salameh@cs.ucl.ac.uk)
|
||||
Providence Salumu Munga (Providence.Salumu@gmail.com, Providence.Salumu_Munga@it-sudparis.eu)
|
||||
Francisco Javier Sánchez-Roselly (fnavarro@ujaen.es)
|
||||
Florian Schmidt (Florian.Schmidt@cs.rwth-aachen.de)
|
||||
Guillaume Seguin (guillaume.seguin@inria.fr)
|
||||
Ioannis Selinis (selinis.g@gmail.com)
|
||||
Tomasz Seweryn (tomasz.seweryn7@gmail.com)
|
||||
Dmitrii Shakshin (d.shakshin@gmail.com)
|
||||
Kulin Shah (m.kulin@gmail.com)
|
||||
Guowang Shi (shiguowang2007@gmail.com)
|
||||
Phillip Sitbon (phillip.sitbon@gmail.com)
|
||||
Pedro Silva (pmms@inesctec.pt)
|
||||
Anirudh Sivaraman (sk.anirudh@gmail.com)
|
||||
Steven Smith (smith84@llnl.gov)
|
||||
Andrew Stanton (acstanton515@gmail.com)
|
||||
Ewgenij Starostin (estar@cs.tu-berlin.de)
|
||||
YunQiang Su (wzssyqa@gmail.com)
|
||||
Brian Swenson (bswenson3@gatech.edu)
|
||||
Lalith Suresh (suresh.lalith@gmail.com)
|
||||
Dave Taht (dave.taht@bufferbloat.net)
|
||||
Marcos Talau (talau@users.sourceforge.net)
|
||||
Adrian S. W. Tam (adrian.sw.tam@gmail.com)
|
||||
Cristiano Tapparello (cristiano.tapparello@rochester.edu)
|
||||
Hajime Tazaki (tazaki@sfc.wide.ad.jp)
|
||||
Wilson Thong (wilsonwk@ee.cityu.edu.hk)
|
||||
Mauro Tortonesi (mauro.tortonesi@unife.it)
|
||||
@@ -113,3 +179,4 @@ Florian Westphal (fw@strlen.de)
|
||||
He Wu (mdzz@u.washington.edu)
|
||||
Yoshihiko Yazawa (yoshiyaz@gmail.com)
|
||||
Dizhi Zhou (dizhi.zhou@gmail.com)
|
||||
Gaurav Sathe (gaurav.sathe@tcs.com)
|
||||
|
||||
+406
-5
@@ -51,22 +51,423 @@ to this file based on your experience, please contribute a patch or drop
|
||||
us a note on ns-developers mailing list.</p>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.18 to ns-3.19</h1>
|
||||
<h1>Changes from ns-3.23 to ns-3.24</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li></li>
|
||||
<li> The signatures on several TcpHeader methods were changed to take const arguments.</li>
|
||||
<li> class TcpL4Protocol replaces Send() methods with SendPacket(), and adds new methods to AddSocket() and RemoveSocket() from a node. Also, a new PacketReceived() method was introduced to get the TCP header of an incoming packet and check its checksum.</li>
|
||||
<li> The CongestionWindow and SlowStartThreshold trace sources have been moved from the TCP subclasses such as NewReno, Reno, Tahoe, and Westwood to the TcpSocketBase class.</li>
|
||||
</ul>
|
||||
<h2>Changes to build system:</h2>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
<h2>Changed behavior:</h2>
|
||||
This section is for behavioral changes to the models that were not due to a bug fix.
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.22 to ns-3.23</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li> The mobility module includes a GeographicPositions class used to
|
||||
convert geographic to cartesian coordinates, and to generate randomly
|
||||
distributed geographic coordinates.
|
||||
</li>
|
||||
<li> The spectrum module includes new TvSpectrumTransmitter classes and helpers to create television transmitter(s) that transmit PSD spectrums customized by attributes such as modulation type, power, antenna type, channel frequency, etc.
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li> In LteSpectrumPhy, LtePhyTxEndCallback and the corresponding methods have been removed, since they were unused.
|
||||
</li>
|
||||
<li> In the DataRate class in the network module, CalculateTxTime has been declared deprecated. CalculateBytesTxTime and CalculateBitsTxTime are to be used instead. The return value is a Time, instead of a double.
|
||||
</li>
|
||||
<li> In the Wi-Fi InterferenceHelper, the interference event now takes the WifiTxVector as an input parameter, instead of the WifiMode. A similar change was made to the WifiPhy::RxOkCallback signature.
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Changes to build system:</h2>
|
||||
<ul>
|
||||
<li> None </li>
|
||||
</ul>
|
||||
<h2>Changed behavior:</h2>
|
||||
This section is for behavioral changes to the models that were not due to a bug fix.
|
||||
<ul>
|
||||
<li> In Wi-Fi, HT stations (802.11n) now support two-level aggregation. The InterferenceHelper now distinguishes between the PLCP and regular payload reception, for higher fidelity modeling. ACKs are now sent using legacy rates and preambles. Acces points now establish BSSBasicRateSet for control frame transmissions. PLCP header and PLCP payload reception have been decoupled to improve PHY layer modeling accuracy. RTS/CTS with A-MPDU is now fully supported.
|
||||
</li>
|
||||
<li> The mesh module was made more compliant to the IEEE 802.11s-2012 standard and packet traces are now parseable by Wireshark.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.21 to ns-3.22</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li> New classes were added for the PARF and APARF WiFi power and rate control mechanisms.
|
||||
</li>
|
||||
<li> Support for WiFi 802.11n MPDU aggregation has been added.
|
||||
</li>
|
||||
<li> Additional support for modeling of vehicular WiFi networks has been added, including the channel-access coordination feature of IEEE 1609.4. In addition, a Basic Safety Message (BSM) packet generator and related statistics-gathering classes have been added to the wave module.
|
||||
</li>
|
||||
<li> A complete LTE release bearer procedure is now implemented which can be invoked by calling the new helper method LteHelper::DeActivateDedicatedEpsBearer ().
|
||||
</li>
|
||||
<li> It is now possible to print the Neighbor Cache (ARP and NDISC) by using
|
||||
the RoutingProtocolHelper
|
||||
</li>
|
||||
<li> A TimeProbe class has been added to the data collection framework in
|
||||
the stats module, enabling TracedValues emitting values of type
|
||||
ns3::Time to be handled by the framework.
|
||||
</li>
|
||||
<li> A new attribute 'ClockGranularity' was added to the TcpSocketBase class,
|
||||
to control modeling of RTO calculation.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li> Several deprecated classes and class methods were removed, including EmuNetDevice, RandomVariable and derived classes, Packet::PeekData(), Ipv6AddressHelper::NewNetwork(Ipv6Address, Ipv6Prefix), Ipv6InterfaceContainer::SetRouter(), Ipv4Route::GetOutputTtl(), TestCase::AddTestCase(TestCase*), and TestCase::GetErrorStatus().
|
||||
</li>
|
||||
<li> Print methods involving routing tables and neighbor caches, in classes Ipv4RoutingHelper and Ipv6RoutingHelper, were converted to static methods.
|
||||
</li>
|
||||
<li>PointerValue attribute types in class UanChannel (NoiseModel), UanPhyGen (PerModel and SinrModel), UanPhyDual (PerModelPhy1, PerModelPhy2, SinrModelPhy1, and SinrModelPhy2), and SimpleNetDevice (TxQueue), were changed from PointerValue type to StringValue type, making them configurable via the Config subsystem.
|
||||
</li>
|
||||
<li> WifiPhy::CalculateTxDuration() and WifiPhy::GetPayloadDurationMicroSeconds () now take an additional frequency parameter.
|
||||
</li>
|
||||
<li> The attribute 'Recievers' in class YansWifiPhy was misspelled, so
|
||||
this has been corrected to 'Receivers'.
|
||||
</li>
|
||||
<li> We have now documented the callback function signatures
|
||||
for all TracedSources, using an extra (fourth) argument to
|
||||
TypeId::AddTraceSource to pass the fully-qualified name
|
||||
of the signature typedef. To ensure that future TraceSources
|
||||
are similarly documented, the three argument version of
|
||||
AddTraceSource has been deprecated.
|
||||
</li>
|
||||
<li> The "MinRTO" attribute of the RttEstimator class was moved to the TcpSocketBase class. The "Gain" attribute of the RttMeanDeviation class was replaced
|
||||
by new "Alpha" and "Beta" attributes.
|
||||
</li>
|
||||
<li> Attributes of the TcpTxBuffer and TcpRxBuffer class are now accessible through the TcpSocketBase class.
|
||||
</li>
|
||||
<li> The LrWpanHelper class has a new constructor allowing users to configure a MultiModelSpectrumChannel as an option, and also provides Set/Get API to allow users to access the underlying channel object.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to build system:</h2>
|
||||
<ul>
|
||||
<li> waf was upgraded to version 1.7.16
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changed behavior:</h2>
|
||||
This section is for behavioral changes to the models that were not due to a bug fix.
|
||||
<ul>
|
||||
<li> The default value of the `Speed` attribute of ConstantSpeedPropagationDelayModel was changed from 300,000,000 m/s to 299,792,458 m/s (speed of light in a vacuum), causing propagation delays using this model to vary slightly.
|
||||
</li>
|
||||
<li> The LrWpanHelper object was previously instantiating only a LogDistancePropagationLossModel on a SingleModelSpectrumChannel, but no PropagationDelayModel. The constructor now adds by default a ConstantSpeedPropagationDelayModel.
|
||||
</li>
|
||||
<li> The Nix-vector routing implementation now uses a lazy flush mechanism,
|
||||
which dramatically speeds up the creation of large topologies.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.20 to ns-3.21</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li> New "const double& SpectrumValue:: operator[] (size_t index) const".
|
||||
</li>
|
||||
<li> A new TraceSource has been added to TCP sockets: SlowStartThreshold.
|
||||
</li>
|
||||
<li> New method CommmandLine::AddValue (name, attibutePath) to provide a
|
||||
shorthand argument "name" for the Attribute "path". This also has
|
||||
the effect of including the help string for the Attribute in the
|
||||
Usage message.
|
||||
</li>
|
||||
<li> The GSoC 2014 project in the LTE module has brought some additional APIs:
|
||||
<ul>
|
||||
<li>a new abstract class LteFfrAlgorithm, which every future
|
||||
implementation of frequency reuse algorithm should inherit from</li>
|
||||
<li>a new SAPs: one between MAC Scheduler and FrAlgorithm, one between
|
||||
RRC and FrAlgorithm</li>
|
||||
<li>new attribute to enable Uplink Power Control in LteUePhy</li>
|
||||
<li>new LteUePowerControl class, an implementation of Uplink Power Control, which is
|
||||
configurable by attributes. ReferenceSignalPower is sent by eNB in SIB2.
|
||||
Uplink Power Control in Closed Loop Accumulative Mode is enabled by default</li>
|
||||
<li>seven different Frequency Reuse Algorithms (each has its own attributes): </li>
|
||||
<ul>
|
||||
<li>LteFrNoOpAlgorithm</li>
|
||||
<li>LteFrHardAlgorithm</li>
|
||||
<li>LteFrStrictAlgorithm</li>
|
||||
<li>LteFrSoftAlgorithm</li>
|
||||
<li>LteFfrSoftAlgorithm</li>
|
||||
<li>LteFfrEnhancedAlgorithm</li>
|
||||
<li>LteFfrDistributedAlgorithm</li>
|
||||
</ul>
|
||||
<li>attribute in LteFfrAlgorithm to set FrCellTypeId which is used in automatic
|
||||
Frequency Reuse algorithm configuration</li>
|
||||
<li>LteHelper has been updated with new methods related to frequency reuse algorithm:
|
||||
SetFfrAlgorithmType and SetFfrAlgorithmAttribute</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> A new SimpleNetDeviceHelper can now be used to install SimpleNetDevices.
|
||||
</li>
|
||||
<li> New PacketSocketServer and PacketSocketClient apps, meant to be used in tests.
|
||||
</li>
|
||||
<li> Tcp Timestamps and Window Scale options have been added and are enabled by default (controllable by attribute).
|
||||
</li>
|
||||
<li> A new CoDel queue model has been added to the 'internet' module.
|
||||
</li>
|
||||
<li> New test macros NS_TEST_ASSERT_MSG_GT_OR_EQ() and NS_TEST_EXPECT_MSG_GT_OR_EQ() have been added.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li> "Icmpv6L4Protocol::ForgeEchoRequest" is now returning a packet with the proper IPv6 header.
|
||||
</li>
|
||||
<li> The TCP socket Attribute "SlowStartThreshold" has been renamed "InitialSlowStartThreshold" to
|
||||
clarify that the effect is only on the initial value.
|
||||
</li>
|
||||
<li> all schedulers were updated to interact with FR entity via FFR-SAP. Only PF, PSS, CQA,
|
||||
FD-TBFQ, TD-TBFQ schedulers supports Frequency Reuse functionality. In the beginning
|
||||
of scheduling process, schedulers ask FR entity for avaiable RBGs and then ask if UE
|
||||
can be scheduled on RB</li>
|
||||
<li> eNB RRC interacts with FFR entity via RRC-FFR SAP</li>
|
||||
<li> new DL-CQI generation approach was implemented. Now DL-CQI is computed from control channel as signal
|
||||
and data channel (if received) as interference. New attribute in LteHelper was added to specify
|
||||
DL-CQI generation approach. New approach is default one in LteHelper </li>
|
||||
<li> RadioEnvironmentMap can be generated for Data or Control channel and for specified RbId;
|
||||
Data or Control channel and RbId can be configured by new attributes in RadioEnvironmentMapHelper </li>
|
||||
<li> lte-sinr-chunk-processor refactored to lte-chunk-processor. Removed all lte-xxx-chunk-processor
|
||||
implementations</li>
|
||||
<li> BindToNetDevice affects also sockets using IPv6.</li>
|
||||
<li> BindToNetDevice now calls implicitly Bind (). To bind a socket to a NetDevice and to a specific address,
|
||||
the correct sequence is Bind (address) - BindToNetDevice (device). The opposite will raise an error.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to build system:</h2>
|
||||
<ul>
|
||||
<li> None for this release. </li>
|
||||
</ul>
|
||||
|
||||
<h2>Changed behavior:</h2>
|
||||
<ul>
|
||||
<li> Behavior will be changed due to the list of bugs fixed (listed in RELEASE_NOTES); users are requested to review that list as well.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.19 to ns-3.20</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li> Models have been added for low-rate, wireless personal area networks
|
||||
(LR-WPAN) as specified by IEEE standard 802.15.4 (2006). The current
|
||||
emphasis is on the unslotted mode of 802.15.4 operation for use in Zigbee,
|
||||
and the scope is limited to enabling a single mode (CSMA/CA) with basic
|
||||
data transfer capabilities. Association with PAN coordinators is not yet
|
||||
supported, nor the use of extended addressing. Interference is modeled as
|
||||
AWGN but this is currently not thoroughly tested. The NetDevice Tx queue
|
||||
is not limited, i.e., packets are never dropped due to queue becoming full.
|
||||
They may be dropped due to excessive transmission retries or channel access
|
||||
failure. </li>
|
||||
<li> A new IPv6 routing protocol has been added: RIPng. This protocol is
|
||||
an Interior Gateway Protocol and it is available in the Internet module. </li>
|
||||
<li> A new LTE MAC downlink scheduling algorithm named Channel and QoS
|
||||
Aware (CQA) Scheduler is provided by the new "ns3::CqaFfMacScheduler" object.
|
||||
</li>
|
||||
<li> Units may be attached to Time objects, to facilitate specific output
|
||||
formats (see Time::As()) </li>
|
||||
<li> FlowMonitor "SerializeToXml" functions are now directly available
|
||||
from the helper. </li>
|
||||
<li> Access to OLSR's HNA table has been enabled </li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li> The SixLowPan model can now use uncompressed IPv6 headers. An option to
|
||||
define the minimum compressed packet size has been added. </li>
|
||||
<li> MinDistance wsa replaced by MinLoss in FriisPropagationLossModel, to
|
||||
better handle conditions outside of the assumed far field region. </li>
|
||||
<li> In the DSR model, the attribute DsrOptionRerrHeader::ErrorType" has
|
||||
been removed. </li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to build system:</h2>
|
||||
<ul>
|
||||
<li> Python 3.3 is now supported for Python bindings for ns-3. Python 3.3
|
||||
support for API scanning is not supported. Python 3.2 is not supported.</li>
|
||||
<li> Enable selection of high precision int64x64_t implementation
|
||||
at configure time, for debugging purposes.</li>
|
||||
<li> Optimized builds are now enabling signed overflow optimization
|
||||
(-fstrict-overflow) and for gcc 4.8.2 and greater, also warning for cases
|
||||
where an optimizization may occur due to compiler assumption that
|
||||
overflow will not occur. </li>
|
||||
</ul>
|
||||
|
||||
<h2>Changed behavior:</h2>
|
||||
<ul>
|
||||
<li> The Internet FlowMonitor can now track IPv6 packets. </li>
|
||||
<li> Ipv6Extension::m_dropTrace has been removed. Ipv6L3Protocol::m_dropTrace
|
||||
is now fired when appropriate. </li>
|
||||
<li> IPv4 identification field value is now dependent on the protocol
|
||||
field. </li>
|
||||
<li> Point-to-point trace sources now contain PPP headers </li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.18.1 to ns-3.19</h1>
|
||||
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li> A new wifi extension for vehicular simulation support is available in the
|
||||
src/wave directory. The current code represents an interim capability to
|
||||
realize an IEEE 802.11p-compliant device, but without the WAVE extensions
|
||||
(which are planned for a later patch). The WaveNetDevice modelled herein
|
||||
enforces that a WAVE-compliant physical layer (at 5.9 GHz) is selected, and
|
||||
does not require any association between devices (similar to an adhoc WiFi
|
||||
MAC), but is otherwise similar (at this time) to a WifiNetDevice. WAVE
|
||||
capabililties of switching between control and service channels, or using
|
||||
multiple radios, are not yet modelled.
|
||||
</li>
|
||||
<li>New SixLowPanNetDevice class providing a shim between
|
||||
IPv6 and real NetDevices. The new module implements 6LoWPAN:
|
||||
"Transmission of IPv6 Packets over IEEE 802.15.4 Networks" (see
|
||||
<a href="http://www.ietf.org/rfc/rfc4944.txt">RFC 4944</a> and
|
||||
<a href="http://www.ietf.org/rfc/rfc6262.txt">RFC 6262</a>),
|
||||
resulting in a heavy header compression for IPv6 packets.
|
||||
The module is intended to be used on 802.15.4 NetDevices, but
|
||||
it can be used over other NetDevices. See the manual for
|
||||
further discussion.
|
||||
</li>
|
||||
<li> LteHelper has been updated with some new APIs:
|
||||
<ul>
|
||||
<li>new overloaded Attach methods to enable UE to automatically determine
|
||||
the eNodeB to attach to (using initial cell selection);</li>
|
||||
<li>new methods related to handover algorithm: SetHandoverAlgorithmType
|
||||
and SetHandoverAlgorithmAttribute;</li>
|
||||
<li>a new attribute AnrEnabled to activate/deactivate Automatic Neighbour
|
||||
Relation (ANR) function; and</li>
|
||||
<li>a new method SetUeDeviceAttribute for configuring LteUeNetDevice.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> The GSoC 2013 project in the LTE module has brought some additional APIs:
|
||||
<ul>
|
||||
<li>a new abstract class LteHandoverAlgorithm, which every future
|
||||
implementation of automatic handover trigger should inherit from;</li>
|
||||
<li>new classes LteHandoverAlgorithm and LteAnr as sub-modules of
|
||||
LteEnbNetDevice class; both interfacing with the LteEnbRrc sub-module
|
||||
through Handover Management SAP and ANR SAP;</li>
|
||||
<li>new attributes in LteEnbNetDevice and LteUeNetDevice classes related
|
||||
to Closed Subscriber Group (CSG) functionality in initial cell
|
||||
selection;</li>
|
||||
<li>new attributes in LteEnbRrc for configuring UE measurements' filtering
|
||||
coefficient (i.e., quantity configuration);</li>
|
||||
<li>a new public method AddUeMeasReportConfig in LteEnbRrc for setting up
|
||||
custom UE measurements' reporting configuration; measurement reports
|
||||
can then be captured from the RecvMeasurementReport trace source;
|
||||
and</li>
|
||||
<li>new trace sources in LteUeRrc to capture more events, such as System
|
||||
Information messages (MIB, SIB1, SIB2), initial cell selection, random
|
||||
access, and handover.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>A new parallel scheduling algorithm based on null messages, a common
|
||||
parallel DES scheduling algorithm, has been added. The null message
|
||||
scheduler has better scaling properties when running on some scenarios
|
||||
with large numbers of nodes since it does not require a global
|
||||
communication.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li> It is now possible to use Ipv6PacketInfoTag from UDP applications in the
|
||||
same way as with Ipv4PacketInfoTag. See Doxygen for current limitations in
|
||||
using Ipv[4,6]PacketInfoTag to set IP properties.</li>
|
||||
<li>A change is introduced for the usage of the EpcHelper
|
||||
class. Previously, the EpcHelper class included both the API
|
||||
definition and its (only) implementation; as such, users would
|
||||
instantiate and use the EpcHelper class directly in their
|
||||
simulation programs. From now on,
|
||||
EpcHelper is just the base class defining the API, and the
|
||||
implementation has been moved to derived classes; as such,
|
||||
users are now expected to use one of the derived classes in
|
||||
their simulation program. The implementation previously
|
||||
provided by the EpcHelper class has been moved to the new
|
||||
derived class PointToPointEpcHelper.</li>
|
||||
<li> The automatic handover trigger and ANR functions in LTE module have been
|
||||
moved from LteEnbRrc class to separate classes. As a result, the related
|
||||
attributes, e.g., ServingCellHandoverThreshold, NeighbourCellHandoverOffset,
|
||||
EventA2Threshold, and EventA4Threshold have been removed from LteEnbRrc
|
||||
class. The equivalent attributes are now in A2A4RsrqHandoverAlgorithm and
|
||||
LteAnr classes.</li>
|
||||
<li> Master Information Block (MIB) and System Information Block Type 1 (SIB1)
|
||||
are now transmitted as LTE control messages, so they are no longer part of
|
||||
RRC protocol.</li>
|
||||
<li> UE RRC state model in LTE module has been considerably modified and is
|
||||
not backward compatible with the previous state model.</li>
|
||||
<li> Additional time units (Year, Day, Hour, Minute) were added to the time
|
||||
value class that represents simulation time; the largest unit prior to
|
||||
this addition was Second.
|
||||
</li>
|
||||
<li> SimpleNetDevice and SimpleChannel are not so simple anymore. SimpleNetDevice can be now a
|
||||
Broadcast or PointToPoint NetDevice, it can have a limited bandwidth and it uses an output
|
||||
queue.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to build system:</h2>
|
||||
|
||||
<h2>Changed behavior:</h2>
|
||||
<ul>
|
||||
<li> For the TapBridge device, in UseLocal mode there is a MAC learning function. TapBridge has been waiting for the first packet received from tap interface to set the address of the bridged device to the source address of the first packet. This has caused problems with WiFi. The new behavior is that after connection to the tap interface, ns-3 learns the MAC address of that interface with a system call and immediately sets the address of the bridged device to the learned one. See <a href="https://www.nsnam.org/bugzilla/show_bug.cgi?id=1777">bug 1777</a> for more details.</li>
|
||||
<li> TapBridge device now correctly implements IsLinkUp() method.</li>
|
||||
<li> IPv6 addresses and routing tables are printed like in Linux "route -A inet6" command.</li>
|
||||
<li> A change in Ipv[4,6]Interface enforces the correct behaviour of IP
|
||||
when a device do not support the minimum MTU requirements.
|
||||
This is set to 68 and 1280 octects respectively. IP simulations that
|
||||
may have run over devices with smaller MTUs than 68 or 1280, respectively,
|
||||
will no longer be able to use such devices.</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.18 to ns-3.18.1</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<li> It is now possible to randomize the time of the first beacon from an
|
||||
access point. Use an attribute "EnableBeaconJitter" to enable/disable
|
||||
this feature.
|
||||
</li>
|
||||
<li> A new FixedRoomPositionAllocator helper class is available; it
|
||||
allows one to generate a random position uniformly distributed in the
|
||||
volume of a chosen room inside a chosen building.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li> Logging wildcards: allow "***" as synonym for "*=**" to turn on all logging.
|
||||
</li>
|
||||
<li> The log component list ("NS_LOG=print-list") is now printed alphabetically.
|
||||
</li>
|
||||
<li> Some deprecated IEEE 802.11p code has been removed from the wifi module
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to build system:</h2>
|
||||
<ul>
|
||||
<li> The Python API scanning system (./waf --apiscan) has been fixed (bug 1622)
|
||||
</li>
|
||||
<li> Waf has been upgraded from 1.7.11 to 1.7.13
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changed behavior:</h2>
|
||||
<ul>
|
||||
<li> Wifi simulations have additional jitter on AP beaconing (see above) and some bug fixes have been applied to wifi module (see RELEASE_NOTES)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -5,7 +5,8 @@ all:
|
||||
|
||||
# free free to change this part to suit your requirements
|
||||
configure:
|
||||
./waf configure --enable-examples --enable-tests
|
||||
#./waf configure --enable-examples --enable-tests
|
||||
./waf configure -d optimized --enable-examples --disable-python --disable-tests
|
||||
|
||||
build:
|
||||
./waf build
|
||||
|
||||
+577
-18
@@ -10,7 +10,7 @@ Consult the file CHANGES.html for more detailed information about changed
|
||||
API and behavior across ns-3 releases.
|
||||
|
||||
Release 3-dev
|
||||
=============
|
||||
============
|
||||
|
||||
Availability
|
||||
------------
|
||||
@@ -21,21 +21,580 @@ Supported platforms
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
- It is now possible to randomize the time of the first beacon from an access point.
|
||||
Use an attribute "EnableBeaconJitter" to enable/disable this feature.
|
||||
- a new FixedRoomPositionAllocator helper class is available, it
|
||||
allows to generate a random position uniformly distributed in the
|
||||
- (network) SimpleChannel allows per-NetDevice blacklists, in order to do hidden terminal testcases.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 730 - Enabling fragmentation at run-time breaks simulation
|
||||
- Bug 1249 - doxygen comments on device-level SetMobility ()
|
||||
- Bug 1482 - mesh module was producing fatal error with ASCII and netanim traces
|
||||
- Bug 1736 - default dot11EDCATableMSDULifetime
|
||||
- Bug 1901 - mesh module producing malformed pcaps
|
||||
- Bug 1929 - TcpL4Protocol::Send must indicate the source address to routing (if known)
|
||||
- Bug 1982 - AODV and mesh modules use random variables before seeds can be set
|
||||
- Bug 2058 - TCP window update can shrink left edge of window
|
||||
- Bug 2063 - FdNetDevice::SendFrom assert does not account for headers correctly
|
||||
- Bug 2082: Empirical RV fails if value provided in CDF function is negative
|
||||
- Bug 2093 - MultiModelSpectrumChannel::GetDevice only works for 0-th index
|
||||
- Bug 2096 - Wrong pcap information when MPDU aggregation is used
|
||||
- Bug 2108 - Erroneous implementation in InterferenceHelper
|
||||
- Bug 2119 - Fix memory leaks in FdNetDevice test due to non-executed events
|
||||
- Bug 2124 - UdpSocketImpl::ShutdownRecv doesn't stop the Ipv[4,6]EndPointDemux
|
||||
- Bug 2125 - subclasses must chain up to base class NotifyNewAggregate
|
||||
- Bug 2126 - LrWpanNetDevice silently accepts no mobility on the node
|
||||
- Bug 2127 - Scheduler benchmark utility works in first run only
|
||||
- Bug 2130 - Allow SimpleChannel to simulate hidden terminals.
|
||||
- Bug 2135 - TCP doesn't honor the socket's output interface
|
||||
- Bug 2136 - The usage of tid in wifi and wave module shall be "if (tid > 7)" rather than "if (tid >= 7)"
|
||||
- Bug 2132 - TCP RST packets were incorrectly formatted if no endpoints matched
|
||||
- Bug 2138 - SimpleNetDevice could send overlapped packets
|
||||
- Bug 2148 - Ipv6Interface::SetUp doesn't re-create the Link-Local addresses
|
||||
- Bug 2153 - Incorrect power limits in wifi power control algorithms
|
||||
- Bug 2154 - Incorrect power calculation in wifi power adaptation examples
|
||||
- Bug 2156 - Duplicate packets when using two level aggregation
|
||||
|
||||
Known issues
|
||||
------------
|
||||
In general, known issues are tracked on the project tracker available
|
||||
at http://www.nsnam.org/bugzilla/
|
||||
|
||||
Release 3.23
|
||||
============
|
||||
|
||||
Availability
|
||||
------------
|
||||
This release is available from:
|
||||
http://www.nsnam.org/release/ns-allinone-3.23.tar.bz2
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
This release has been tested on the following platforms:
|
||||
- Ubuntu 15.04 (64 bit) with g++-4.9.2
|
||||
- Fedora Core 21 (64 bit) with g++-4.9.2
|
||||
- Ubuntu 14.04 (64 bit) with g++-4.8.2
|
||||
- Ubuntu 12.04.4 (32/64 bit) with g++-4.6.3
|
||||
- CentOS/RHEL 6.6 (64-bit) with g++-4.4.7
|
||||
- OS X Yosemite 10.10.3 with Xcode 6.3.1 and Apple LLVM version 6.1.0
|
||||
- FreeBSD 10.1-RELEASE (64 bit) with clang-3.4.1
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
- (network) CalculateTxTime has been declared obsolete.
|
||||
CalculateBytesTxTime and CalculateBitsTxTime are to be used instead.
|
||||
The return value is a Time, instead of a double.
|
||||
- (mobility) Classes added for converting geographic to cartesian coordinates.
|
||||
- (spectrum) TvSpectrumTransmitter models added to create television
|
||||
transmitter(s) that transmit PSD spectrums customized by attributes such
|
||||
as modulation type, power, antenna type, channel frequency, etc.
|
||||
- (wifi) Several model improvements have been made. Access points now
|
||||
establish BSSBasicRateSet for control frame transmissions. PLCP header
|
||||
and payload reception have been decoupled for improved PHY modeling
|
||||
accuracy. RTS/CTS with A-MPDU is now fully supported, and 802.11n
|
||||
stations now support two-level aggregation.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1757 - RLC AM not using NACK_SN
|
||||
- Bug 1974 - CalculateTxTime should return a Time, not a double
|
||||
- Bug 1982 - AODV and mesh use random variables before seed can be set
|
||||
- Bug 2004 - Wrong timeout calculation for 802.11n in WifiMac
|
||||
- Bug 2008 - (lr-wpan) Crash if ending rx while status change is in progress
|
||||
- Bug 2025 - (lr-wpan) Changing the channel doesn't affect the Tx params
|
||||
- Bug 2034 - (lr-wpan) CSMA-CA BackoffPeriod is too short
|
||||
- Bug 2054 - TCP window update can shrink the Left Edge of the window
|
||||
- Bug 2066 - A-MPDU reception should check for successful preamble
|
||||
- Bug 2067 - TCP performance when advertised window exceeds sender buffer size
|
||||
- Bug 2070 - Wrong report of Packets and Bytes stored in CoDeL
|
||||
- Bug 2073 - NDisc cache entries update timer might be stuck in a loop
|
||||
- Bug 2075 - A-MPDU using RTS/CTS behaves wrongly when MaxSsrc is reached
|
||||
- Bug 2076 - TCP MinRTO Attribute is not actually used
|
||||
- Bug 2077 - Icmpv6L4Protocol::HandleDestinationUnreachable must check the packet size, not its serialized size
|
||||
- Bug 2079 - mcs variable in ht-wifi-network example is confusing
|
||||
- Bug 2082 - Empirical RV fails if the value provided in the CDF member function is negative
|
||||
- Bug 2083 - BridgeNetDevice may send corrupted packets
|
||||
- Bug 2087 - Waf fails to build ns-3 if the path contains accented characters
|
||||
- Bug 2090 - (rip-ng) Routes may be added twice on interface activation
|
||||
- Bug 2093 - MultiModelSpectrumChannel::GetDevice only works for 0-th index
|
||||
- Bug 2095 - (wimax) Wrong values in default-traces.h for 16 QAM 3/4
|
||||
- Bug 2097 - ACKs should be sent using legacy rates and preambles in 802.11n
|
||||
- Bug 2103 - Ipv[4,6]RoutingHelper::PrintRoutingTableAll[At,Every] hangs if a node doesn't have IP
|
||||
|
||||
Known issues
|
||||
------------
|
||||
In general, known issues are tracked on the project tracker available
|
||||
at http://www.nsnam.org/bugzilla/
|
||||
|
||||
Release 3.22
|
||||
============
|
||||
|
||||
Availability
|
||||
------------
|
||||
This release is available from:
|
||||
http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
This release has been tested on the following platforms:
|
||||
- Fedora Core 21 (64 bit) with g++-4.9.2
|
||||
- Ubuntu 14.10 (32 bit) with g++-4.9.1
|
||||
- Ubuntu 14.04 (64 bit) with g++-4.8.2
|
||||
- Ubuntu 12.04.4 (32/64 bit) with g++-4.6.3
|
||||
- CentOS/RHEL 6.6 (64-bit) with g++-4.4.7
|
||||
- OS X Yosemite 10.10 with Xcode 6.1.1 and clang-600.0.56
|
||||
- FreeBSD 10.1-RELEASE (64 bit) with clang-3.4.1
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
- (wifi) Support for MPDU aggregation has been added to the wifi model,
|
||||
as well as a number of related example programs.
|
||||
- (wifi) Added two combined power and rate control mechanisms to the
|
||||
wifi module. The new mechanisms, PARF and APARF, are the first in the
|
||||
wifi module to jointly control transmission power and data rate. Two use
|
||||
case examples (PowerAdaptationDistance and PowerAdaptationInterference)
|
||||
and a test case have also been added.
|
||||
- (lte) In previous releases of the LTE module, the bearer release
|
||||
functionality was only partially supported. As an enhancement, a
|
||||
complete release bearer procedure is now implemented, which can be
|
||||
invoked by calling the new helper method
|
||||
LteHelper::DeActivateDedicatedEpsBearer(). The related output can be
|
||||
seen through the stats collected at different layers like PDCP, RLC,
|
||||
MAC, PHY. To support this implementation, an example and test suite is
|
||||
added within the LTE module examples and tests folder.
|
||||
- (wave) Additional support has been added for WiFi-based vehicular networks,
|
||||
including the channel-access coordination features of IEEE 1609.4 and a
|
||||
comprehensive VANET routing example that includes a Basic Safety
|
||||
Message (BSM) packet generator application and associated statistics
|
||||
counters. Together, these allow users to evaluate the performance effects
|
||||
in a VANET of varying transmission and channel properties (e.g., packet
|
||||
rate, message size, transmit power, propagation loss model, impact of
|
||||
routing protocol traffic, etc.).
|
||||
- (internet) It is now possible to print the Neighbor Cache (ARP and NDISC)
|
||||
by using the RoutingProtocolHelper
|
||||
- (stats) A new TimeProbe class has been added to hook the data collection
|
||||
framework to traced values emitting Time objects
|
||||
- (documentation) the callback function signatures for all TraceSources
|
||||
is documented in Doxygen
|
||||
- (utils) print-introspected-doxygen.cc has had several enhancements;
|
||||
use -h to read the usage message for details.
|
||||
- (core) TracedValue and TracedCallback function signatures are now documented,
|
||||
which required changing the TypeId::AddTraceSource API.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1405 - RttEstimator improvements
|
||||
- Bug 1551 - NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
|
||||
- Bug 1726 - WiFi Minstrel rate control algorithm doesn't save state
|
||||
- Bug 1734 - TcpSocketBase produces spurious delayed ACKs
|
||||
- Bug 1758 - Yans and Nist error rate models for 5/6 code rate 802.11n HT
|
||||
- Bug 1770 - mesh test and example crash for 32-bit optimized builds
|
||||
- Bug 1774 - compute signal power around channel, not across whole band, and fix LrWpanHelper to add a default PropagationDelayModel
|
||||
- Bug 1791 - TCP Endpoint never deallocates when closing
|
||||
- Bug 1801 - Setting Wi-Fi timing parameters through WifiMac attributes (documentation fix)
|
||||
- Bug 1906 - 802.11n PHY configuration for 2.4GHz and 5GHz devices
|
||||
- Bug 1957 - UdpSocketImpl is stuck after a Close()
|
||||
- Bug 1968 - Missing supported 802.11n HT rates in the WifiPhy constructor
|
||||
- Bug 1969 - Support short guard interval durations in 802.11n
|
||||
- Bug 1970 - Missing NotifyAckTimeoutStartNow in MacLow::StartDataTxTimers
|
||||
- Bug 1971 - 802.11n at 2.4 GHz should include a signal extension duration
|
||||
- Bug 1972 - CommandLine duplicate argument handling: documentation updated.
|
||||
- Bug 1983 - FlowMonitor returns containers copies instead of references.
|
||||
- Bug 1986 - test result divergence for lte-frequency-reuse test
|
||||
- Bug 1991 - PcapFileWrapper::CaptureSize attribute (snaplen) has no effect.
|
||||
- Bug 1995 - avoid multiple definitions of PI
|
||||
- Bug 1996 - RSRQ calculation: misleading variable names
|
||||
- Bug 1997 - Fix PlotProbe() documentation and usage for GnuplotHelper and FileHelper
|
||||
- Bug 2002 - Hardcoded include paths cause breakage
|
||||
- Bug 2011 - Default Speed attribute in ConstantSpeedPropagationDelayModel
|
||||
- Bug 2016 - Radvd do not consider the SendAdvert option and don't reply to RS
|
||||
- Bug 2020 - Erroneous MCS field in 802.11n PCAP files
|
||||
- Bug 2021 - Missing const qualifier in TopologyReader::Link::Attributes{Begin,End}()
|
||||
- Bug 2026 - 802.11n Ness parameter badly set for data frames
|
||||
- Bug 2027 - Calculation of HT training symbol duration does not accurately follow 802.11n standard
|
||||
- Bug 2028 - remove unnecessary Time to double conversions in Wifi models
|
||||
- Bug 2029 - new CQI generation approach fix
|
||||
- Bug 2030 - provide default values for WifiTxVector
|
||||
- Bug 2037 - HT capabilities may print bogus chars
|
||||
- Bug 2038 - Stop method does not stop next wave in WaveformGenerator
|
||||
- Bug 2042 - LTE a3-rsrp-handover-algorithm.cc: error: overflow in implicit constant conversion
|
||||
- Bug 2043 - print-introspected-doxygen crashes when some modules are disabled
|
||||
- Bug 2044 - Buffer::Iterator::ReadNtohU16() and ReadNtohU32() not implemented correctly
|
||||
- Bug 2045 - Missing NS_OBJECT_ENSURE_REGISTERED in TcpTxBuffer and TcpRxBuffer
|
||||
- Bug 2046 - set Block Ack timeout when SetStandard is called
|
||||
- Bug 2047 - Ipv6EndPointDemux::Lookup may crash
|
||||
- Bug 2049 - CQI feedback should always use the same calculation method
|
||||
- Bug 2053 - In tcp-socket-base.cc, NotifyDataSent incorrectly called with retransmits
|
||||
- Bug 2055 - TCP TxBuffer and RxBuffer traces don't work
|
||||
- Nix-vector routing implementation now uses a lazy flush mechanism,
|
||||
which dramatically speeds up the creation of large topologies.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
In general, known issues are tracked on the project tracker available
|
||||
at http://www.nsnam.org/bugzilla/
|
||||
|
||||
Release 3.21
|
||||
============
|
||||
|
||||
Availability
|
||||
------------
|
||||
This release is available from:
|
||||
http://www.nsnam.org/release/ns-allinone-3.21.tar.bz2
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
- Fedora Core 20 (32/64 bit) with g++-4.8.2
|
||||
- Ubuntu 14.04 (32/64 bit) with g++-4.8.2
|
||||
- Ubuntu 12.04.4 (64 bit) with g++-4.6.3
|
||||
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
|
||||
- CentOS/RHEL 6.5 (64-bit) with g++-4.4.7
|
||||
- OS X Mavericks 10.9 with Xcode 5.1.1 and clang-503.0.40
|
||||
- FreeBSD 9.2-RELEASE (64 bit) with clang-3.3
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
|
||||
- The LTE module now supports the transport of the S1-U, X2-U and X2-C
|
||||
interfaces over emulated links via the new helper class EmuEpcHelper.
|
||||
- CommandLine can now provide a shorthand argument name for any
|
||||
Attribute.
|
||||
- Implemented support for Frequency Reuse algorithms in LTE module, as the
|
||||
outcome of GSoC 2014 project.
|
||||
The project also includes several sub-features, such as:
|
||||
- implementation of Downlink Power Control
|
||||
- implementation of Uplink Power Control
|
||||
- new DL-CQI generation approach, which increases throughput if FR algorithms
|
||||
are used
|
||||
- seven options of Frequency Reuse algorithms: LteFrNoOpAlgorithm,
|
||||
LteFrHardAlgorithm, LteFrStrictAlgorithm, LteFrSoftAlgorithm,
|
||||
LteFfrSoftAlgorithm, LteFfrEnhancedAlgorithm, LteFfrDistributedAlgorithm
|
||||
- updated RadioEnvironmentMapHelper. Now RadioEnvironmentMap can be generated
|
||||
for Data or Control channel and for specified RbId, what is helpful when
|
||||
using FR algorithms
|
||||
- Added a CoDel queue model. CoDel queues measure and control the queue
|
||||
traversal delay. The ns-3 implementation is a port of the Linux
|
||||
implementation.
|
||||
- Added support for TCP timestamp and window scale options, and added
|
||||
ability to trace the TCP slow start threshold value.
|
||||
- SimpleNetDevice and SimpleChannel (used for adding basic link effects
|
||||
for testing of higher-layer protocols) have been extended to support
|
||||
the option of broadcast or PointToPoint link semantics. The bandwidth
|
||||
and link delay can be constrained, and it uses an output queue.
|
||||
- SimpleNetDevice and SimpleChannel can be installed in a node through
|
||||
a new helper: SimpleNetDeviceHelper.
|
||||
- Implemented new PacketSocketServer and PacketSocketClient applications.
|
||||
The primary use is in tests, to avoid using the ones from the
|
||||
application module that also bring in a dependency on the internet module.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
- Bug 1673 - Config::Set/Connect does not search for attributes in parent class
|
||||
- Bug 1762 - UE stuck in IDLE_CONNECTING because RRC CONN REQ is not transmitted
|
||||
- Bug 1811 - basic traffic generator for network module
|
||||
- Bug 1824 - L4 protocol sockets should support BindToNetDevice over IPv6
|
||||
- Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
|
||||
- Bug 1851 - WifiRadioEnergyModel energy consumption values are taken from a 802.15.4 chip
|
||||
- Bug 1854 - std::out_of_range Problem
|
||||
- Bug 1858 - wireless examples not correctly recording packet reception
|
||||
- Bug 1860 - TCP needs the Window Scale option
|
||||
- Bug 1893 - issue in DoSchedUlTriggerReq with harq
|
||||
- Bug 1911 - AODV cannot work on nodes with more than one netdevice
|
||||
- Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet
|
||||
- Bug 1930 - Use of invalid reference in OLSR RemoveLinkTuple
|
||||
- Bug 1932 - NdiscCache entry is not failsafe on double neighbor probing.
|
||||
- Bug 1937 - FlowMonitor fails to track multiplexed packets
|
||||
- Bug 1942 - refactoring of lte-sinr-chunk-processor -> lte-chunk-processor
|
||||
- Bug 1943 - Waveform generator signal duration calc error
|
||||
- Bug 1951 - AODV does not update nexthop for 1-hop nodes
|
||||
- Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple
|
||||
- Bug 1960 - Wrong information on index range, about Node::GetDevice
|
||||
- Bug 1961 - planetlab-tap-creator "variable set but not used"
|
||||
- Bug 1963 - AODV can tag the same packet twice (and raise an assert)
|
||||
- Bug 1964 - Integer overflow on UniformRandomVariable::GetInteger()
|
||||
- Bug 1967 - LL Multicast is not compressed in the right way in IPHC
|
||||
- Bug 1981 - PyViz shell not compatible with ipython >= 0.11
|
||||
|
||||
Known issues
|
||||
------------
|
||||
- Bug 1770 - The mesh module will crash if used for g++ version >= 4.8.1
|
||||
in optimized mode, on a 32-bit Linux machine. Lowering the optimization
|
||||
level to -O1 in this case can be used as a workaround.
|
||||
|
||||
Release 3.20
|
||||
=============
|
||||
|
||||
Availability
|
||||
------------
|
||||
This release is available from:
|
||||
http://www.nsnam.org/release/ns-allinone-3.20.tar.bz2
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
- Fedora Core 20 (32/64 bit) with g++-4.8.2
|
||||
- Ubuntu 14.04 (32/64 bit) with g++-4.8.2
|
||||
- Ubuntu 12.04.4 (64 bit) with g++-4.6.3
|
||||
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
|
||||
- CentOS/RHEL 6.5 (64-bit) with g++-4.4.7
|
||||
- OS X Mavericks 10.9 with Xcode 5.1.1 and clang-503.0.40
|
||||
- FreeBSD 9.2-RELEASE (64 bit) with clang-3.3
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
|
||||
- A new LrWpan model, providing initial support for IEEE 802.15.4 networks
|
||||
- A new IPv6 routing protocol has been added: RIPng. This protocol is
|
||||
an Interior Gateway Protocol and it is available in the Internet module.
|
||||
- A new LTE MAC downlink scheduling algorithm named Channel and QoS Aware (CQA)
|
||||
Scheduler is provided by the new ``ns3::CqaFfMacScheduler`` object.
|
||||
- The Internet FlowMonitor can now track IPv6 packets.
|
||||
- FlowMonitor no longer tracks multicast/broadcast packets, reflecting
|
||||
its original design.
|
||||
- FlowMonitor "SerializeToXml" functions are now directly available
|
||||
from the helper.
|
||||
- The SixLowPan model can now use uncompressed IPv6 headers. An option to
|
||||
define the minimum compressed packet size has been added.
|
||||
- Simplify output of Times in a specific unit; see Time::As ()
|
||||
- Ipv6Extension::m_dropTrace has been removed. Ipv6L3Protocol::m_dropTrace
|
||||
is now fired when appropriate.
|
||||
- IPv4 identification field value is now dependent on the protocol field.
|
||||
- Fixes to support Python >= 3.3 in ns3 Python bindings
|
||||
- Enable selection of high precision int64x64_t implementation
|
||||
at configure time, for debugging purposes.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1276 - optimize NistErrorRateModel
|
||||
- Bug 1294 - New PeekU8 () and Read (Buffer::Iterator start, uint32_t size) methods in Buffer::Iterator
|
||||
- Bug 1443 - MinDistance replaced by MinLoss in FriisPropagationLossModel, to
|
||||
better handle conditions outside of the assumed far field region.
|
||||
- Bug 1653 - Extension of CommandLine interface: restored operator << (CommandLine)
|
||||
- Bug 1717 - Detect unsettable attributes
|
||||
- Bug 1730 - no model library documentation for spectrum module
|
||||
- Bug 1739 - The endpoint is not deallocated for UDP sockets
|
||||
- Bug 1786 - os << int64x64_t prints un-normalized fractional values
|
||||
- Bug 1787 - Runtime error when using AnimationInterface::EnablePacketMetadata() to fetch metadata of CSMA packet
|
||||
- Bug 1792 - Parameter logger constructor
|
||||
- Bug 1808 - FlowMon relies on IPv4's Identification field to trace packets
|
||||
- Bug 1817 - IPv4 Identification field should consider protocol as well.
|
||||
- Bug 1818 - FlowMonitor needs IPv6 support
|
||||
- Bug 1820 - models library doc: make should not rm -rf figures
|
||||
- Bug 1821 - Setting an interface to Down state will cause various asserts in IPv6
|
||||
- Bug 1829 - Multiple TCP socket entries
|
||||
- Bug 1837 - AODV crashes when using multiple interfaces
|
||||
- Bug 1838 - FlowMonitorHelper must not be copied.
|
||||
- Bug 1841 - FlowMonitor fails to install if IPv4 is not installed in the node
|
||||
- Bug 1842 - FlowMonitor SerializeToXml<Something> should be called by the helper
|
||||
- Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
|
||||
- Bug 1845 - FlowMonitor should discard any broadcast/multicast packet
|
||||
- Bug 1846 - IPv6 should send Destination Unreachable if no route is available
|
||||
- Bug 1850 - TCP NewReno loss behavior
|
||||
- Bug 1852 - cairo-wideint-private.h error cannot find definitions for fixed-width integral types
|
||||
- Bug 1853 - NS_LOG_FUNCTION broken on OSX 10.9
|
||||
- Bug 1855 - SixLowPanNetDevice is not correctly indexed
|
||||
- Bug 1857 - Detect location of installed boost libraries
|
||||
- Bug 1862 - NS_LOG="Time=*|prefix_time" causes stack overflow
|
||||
- Bug 1868 - Optimized builds are sensitive to -fstrict-overflow
|
||||
- Bug 1870 - Remove unnecessary AsInt functions
|
||||
- Bug 1872 - Inside RREQ processing, in case of IP duplication, packet dropped instead of being forwarded
|
||||
- Bug 1873 - Energy source checked to be aggregated to the node
|
||||
- Bug 1874 - Ipv4L3Protocol::ProcessFragment: addressCombination and idProto identifiers not properly computed
|
||||
- Bug 1876 - enable OLSR HNA table access
|
||||
- Bug 1877 - constructors missing for PropagationLossModels
|
||||
- Bug 1882 - int64x64 tests trigger valgrind bug
|
||||
- Bug 1883 - IPv6 don't consider the prefix and network when choosing output address
|
||||
- Bug 1885 - WifiSpectrumValue5MhzFactory::CreateRfFilter does not align with the used 5Mhz SpectrumModel
|
||||
- Bug 1887 - Point-to-point traces should contain PPP headers
|
||||
- Bug 1888 - COST231 propagation loss model: corrections
|
||||
- Bug 1889 - PointToPointNetDevice: In some cases MacTxDrop trace is not called
|
||||
- Bug 1890 - UdpClientTrace: MPEG frame size is squeezed into (insufficient) 16 bit integer
|
||||
- Bug 1891 - UdpSocketImpl::GetSockName doesn't return the IPv6 address
|
||||
- Bug 1894 - CqaFfMacScheduler needs an update
|
||||
- Bug 1895 - IP header Source Address changed while forwarding RREQ
|
||||
- Bug 1900 - Avoid floating point differences across platforms in test outputs
|
||||
- Bug 1903 - Namespace usage in olsr-state.cc/h
|
||||
- Bug 1907 - Add IsSupportedMcs method in YansWifiPhy
|
||||
- Bug 1912 - Avoid multiple Wifi MacTxMiddle instances
|
||||
- Bug 1913 - Avoid crash in Wifi BlockAckManager::GetNextPacket()
|
||||
- Bug 1915 - BRITE channel delay is rounded to an integer
|
||||
- Bug 1916 - RandomWalk2dMobilityMode default "Bounds" attribute is not a rectangle
|
||||
- Bug 1919 - Strip trailing semi-colons from mobility trace files
|
||||
- Bug 1920 - Remove DSR attributes so file can be re-loaded by config-store
|
||||
- Bug 1922 - WAVE GetSsid should not be fatal
|
||||
- Bug 1923 - Setting Active Probing to false in Wifi Sta has no effect
|
||||
- Bug 1924 - sensing radius and CCA
|
||||
|
||||
Known issues
|
||||
------------
|
||||
- Bug 1770 - The mesh module will crash if used for g++ version >= 4.8.1
|
||||
in optimized mode, on a 32-bit Linux machine. Lowering the optimization
|
||||
level to -O1 in this case can be used as a workaround.
|
||||
|
||||
Release 3.19
|
||||
=============
|
||||
|
||||
Availability
|
||||
------------
|
||||
This release is available from:
|
||||
http://www.nsnam.org/release/ns-allinone-3.19.tar.bz2
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
These platforms have been tested; others may work also:
|
||||
- Fedora Core 20 (32 bit) with g++-4.8.2
|
||||
- Fedora Core 19 (32/64 bit) with g++-4.8.1
|
||||
- Ubuntu 13.10 (64 bit) with g++-4.8.1
|
||||
- Ubuntu 12.04.3 (32/64 bit) with g++-4.6.3
|
||||
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
|
||||
- OS X Mavericks 10.9 with Xcode 5.0.1 and clang-500.2.79
|
||||
- OS X Mountain Lion 10.8.5 with Xcode 5 and g++-4.2.1
|
||||
- FreeBSD 9.2-RELEASE (64 bit) with clang-3.3
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
- Extension to UE measurements and improved handover algorithm models in LTE
|
||||
module, as the outcome of GSoC 2013 project. The project also includes several
|
||||
sub-features, such as:
|
||||
- implementation of System Information Block Type 1 (SIB1);
|
||||
- a new option for automatic UE attachment using Idle mode cell selection
|
||||
procedure;
|
||||
- improved configurability of UE measurements; and
|
||||
- two options of handover algorithms for enabling automatic handover trigger
|
||||
in LTE simulation: A2-A4-RSRQ and strongest cell (A3-RSRP).
|
||||
|
||||
- A new FixedRoomPositionAllocator has been added to the buildings
|
||||
module. It allows one to generate a random position uniformly
|
||||
distributed in the volume of a chosen room inside a chosen building.
|
||||
|
||||
- A new attribute ns3::LteRlcAm::TxOpportunityForRetxAlwaysBigEnough
|
||||
allows to overcome the lack for re-segmentation in the RLC AM
|
||||
implementation by assuming that the size of a TxOpportunity is
|
||||
always big enough for the RLC AM PDU to be retransmitted.
|
||||
|
||||
- After some profiling, the code of LteMiErrorModel has been optimized
|
||||
for speed, resulting in a significantly lower execution time of the
|
||||
LTE model when used with the error model enabled.
|
||||
|
||||
- A new WiFi extension for vehicular simulation support is available in
|
||||
the src/wave directory. The current code represents an interim capability
|
||||
to realize an IEEE 802.11p-compliant device, but without the WAVE
|
||||
extensions (which are planned for a later patch). The WaveNetDevice
|
||||
modelled herein enforces that a WAVE-compliant physical layer (at 5.9 GHz)
|
||||
is selected, and does not require any association between devices (similar
|
||||
to an adhoc WiFi MAC), but is otherwise similar (at this time) to a
|
||||
WifiNetDevice. WAVE capabililties of switching between control and
|
||||
service channels, or using multiple radios, are not yet modelled.
|
||||
|
||||
- A new IPv6 over Low power Wireless Personal Area Networks (6LoWPAN) model
|
||||
is available. Using ns-3's naming convention, the acronym is expanded
|
||||
to SixLowPanNetDevice. The SixLowPanNetDevice is able to act as a
|
||||
shim between IPv6 and a NetDevice, compressing IPv6 headers according
|
||||
to RFCs 4944 and 6262. The SixLowPanNetDevice is meant to be used over
|
||||
IEEE 802.15.4 NetDevices, but it can be used on other NetDevices as
|
||||
well (see the manual for full details). This model precedes the
|
||||
general availability of an 802.15.4 model, so must be run in conjunction
|
||||
with a wired NetDevice model for now, or with experimental versions of
|
||||
802.15.4 models.
|
||||
|
||||
- It is now possible to use Ipv6PacketInfoTag from UDP applications in the
|
||||
same way as with Ipv4PacketInfoTag. See Doxygen for current limitations in
|
||||
using Ipv[4,6]PacketInfoTag to set IP properties.
|
||||
|
||||
- Ipv[4,6]Interfaces not respecting the minimum MTU requirements (68 octects
|
||||
for IPv4 and 1280 octects for IPv6) will be automatically set as Down.
|
||||
|
||||
- IPv6 addresses and routing tables are printed in a more conventional way,
|
||||
closely matching the Linux "route -A inet6" command.
|
||||
|
||||
- Additional time units (Year, Day, Hour, Minute) were added to the time
|
||||
value class that represents simulation time; the largest unit prior to
|
||||
this addition was Second.
|
||||
|
||||
- A new parallel scheduling algorithm based on null messages, a common
|
||||
parallel DES scheduling algorithm, has been added. The null message
|
||||
scheduler has better scaling properties when running on some scenarios
|
||||
with large numbers of nodes since it does not require a global
|
||||
communication.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1496 - Option to print log level in NS_LOG messages, and documentation.
|
||||
- Bug 1592 - Parsing bug in FlowMonitor example script
|
||||
- Bug 1756 - RLC AM Mode State Variable Bug
|
||||
- Bug 1763 - Message 3 should be sent using the UL GRANT in the RAR
|
||||
- Bug 1778 - Implement TapBridge::IsLinkUp() function
|
||||
- Bug 1777 - Implement the more direct way of "using" configuration of existing tap interface
|
||||
- Bug 1776 - Improve CRC performance for CsmaNetDevice in emulation modes
|
||||
- Bug 1788 - unused private field warning
|
||||
- Bug 1789 - missing test condition for sigma in buildings-shadowing-test
|
||||
- Bug 1796 - Ipv6PacketInfoTag is not filled by UdpSocketImpl::ForwardUp6
|
||||
- Bug 1798 - Changing the rate of onOffApplication might stop transmission
|
||||
- Bug 1802 - FlowMon header deserialization problem with IPv4 fragments
|
||||
- Bug 1803 - Lookup /NodeList/4/DeviceList/0/LteEnbRrc/UeMap/0 got no matches
|
||||
- Bug 1807 - Multiple bugs in Ipv4L3Protocol::LocalDeliver
|
||||
- Bug 1810 - IP packets can be sent on NetDevices not respecting the minimum MTU requirements
|
||||
- Bug 1814 - IPv6 Packet with length not multiple of 8 bytes are fragmented incorrectly.
|
||||
- Bug 1815 - Python bindings compilation with clang compiler toolchain
|
||||
- Bug 1816 - IPv4 fragmentation loses Packet tags
|
||||
- Bug 1877 - constructor missing for <something>PropagationLossModels
|
||||
|
||||
Release 3.18.2
|
||||
==============
|
||||
|
||||
ns-allinone-3.18.2 was released to include a bake configuration file update
|
||||
for Direct Code Execution. The ns-3 code in this release was unchanged
|
||||
from that of ns-3.18.1.
|
||||
|
||||
Release 3.18.1
|
||||
==============
|
||||
|
||||
This release is mainly to provide updated compiler support (clang/LLVM)
|
||||
and fix the Python API scanning facility. A few additional bug fixes
|
||||
and new features are described below.
|
||||
|
||||
Availability
|
||||
------------
|
||||
This release is available from:
|
||||
http://www.nsnam.org/release/ns-allinone-3.18.1.tar.bz2
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
These platforms have been tested; others may work also:
|
||||
- Fedora Core 19 (32/64 bit) with g++-4.8.1
|
||||
- Ubuntu 13.10 (64 bit) with g++-4.8.1
|
||||
- Ubuntu 12.04.3 (32/64 bit) with g++-4.6.3
|
||||
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
|
||||
- OS X Mavericks 10.9 with Xcode 5.0.1 and clang-500.2.79
|
||||
- OS X Mountain Lion 10.8.5 with Xcode 5 and g++-4.2.1
|
||||
- FreeBSD 9.2-RELEASE (64 bit) with clang-3.3
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
- It is now possible to randomize the time of the first beacon from an
|
||||
access point. Use an attribute "EnableBeaconJitter" to enable/disable
|
||||
this feature.
|
||||
- A new FixedRoomPositionAllocator helper class is available; it
|
||||
allows one to generate a random position uniformly distributed in the
|
||||
volume of a chosen room inside a chosen building.
|
||||
- Logging wildcards: allow "***" as synonym for "*=**" to turn on all logging.
|
||||
- The log component list ("NS_LOG=print-list") is now printed alphabetically.
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1552 - Storing log name inside LogComponent class (NS_LOG) as std::string
|
||||
- Bug 1722 - beacons transmitted concurrently
|
||||
- Bug 1616 - WifiPhyStateHelper reports false CCA_BUSY times at State trace source
|
||||
- Bug 1011 - assert failed. file=../src/devices/wifi/dcf-manager.cc
|
||||
- Bug 1779 - NS_UNUSED_GLOBAL not working in attribute test class declaration
|
||||
- Bug 1766 - Fixes to wifi-hidden-terminal.cc example
|
||||
- Bug 1722 - Avoid transmitting beacons concurrently
|
||||
- Bug 1691 - RTS/CTS NAV reset prematurely
|
||||
- Bug 1622 - Avoid waf hanging during apiscan
|
||||
- Bug 1616 - WifiPhyStateHelper reports false CCA_BUSY times at State trace source
|
||||
- Bug 1552 - Storing log name inside LogComponent class (NS_LOG) as std::string
|
||||
- Bug 1011 - assert failed. file=../src/devices/wifi/dcf-manager.cc
|
||||
- bug 945 - remove deprecated IEEE 802.11p code from wifi module
|
||||
- Fix aliasing bug in optimized static builds
|
||||
- Fix memory leak due to circular reference in MPI module
|
||||
- Make wifi tests more robust to random variable perturbations
|
||||
- Fix Time class doxygen
|
||||
- Fix compilation with Clang 3.2 and newer versions, including Apple Xcode 5
|
||||
- Miscellaneous NetAnim fixes
|
||||
|
||||
Release 3.18
|
||||
=============
|
||||
@@ -982,7 +1541,7 @@ ns-3.9 has been tested on the following platforms:
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1139,7 +1698,7 @@ ns-3.8 has been tested on the following platforms:
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1283,7 +1842,7 @@ Unofficially supported platform
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1403,7 +1962,7 @@ ns-3.6 has been tested on the following platforms:
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1480,7 +2039,7 @@ ns-3.5 has been tested on the following platforms:
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1538,7 +2097,7 @@ ns-3.4 has been tested on the following platforms:
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1602,7 +2161,7 @@ ns-3.3 has been tested on the following platforms:
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1669,7 +2228,7 @@ ns-3.2 has been tested on the following platforms:
|
||||
|
||||
Not all ns-3 options are available on all platforms; consult the
|
||||
wiki for more information:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
@@ -1697,7 +2256,7 @@ New user-visible features
|
||||
keep track of simulation data in persistent storage across multiple
|
||||
runs (database and ascii file backends are available).
|
||||
More information on the wiki:
|
||||
http://www.nsnam.org/wiki/index.php/Statistical_Framework_for_Network_Simulation
|
||||
http://www.nsnam.org/wiki/Statistical_Framework_for_Network_Simulation
|
||||
|
||||
API changes from ns-3.1
|
||||
-----------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from __future__ import print_function
|
||||
import warnings
|
||||
import sys
|
||||
import os
|
||||
@@ -6,6 +7,8 @@ from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandler
|
||||
from pybindgen.module import MultiSectionFactory
|
||||
import ns3modulegen_core_customizations
|
||||
|
||||
import logging
|
||||
|
||||
pybindgen.settings.wrapper_registry = pybindgen.settings.StdMapWrapperRegistry
|
||||
|
||||
import traceback
|
||||
@@ -55,6 +58,9 @@ class MyMultiSectionFactory(MultiSectionFactory):
|
||||
|
||||
|
||||
def main(argv):
|
||||
logging.basicConfig()
|
||||
logging.getLogger("pybindgen.typehandlers").setLevel(logging.DEBUG)
|
||||
|
||||
module_abs_src_path, target, extension_name, output_cc_file_name = argv[1:]
|
||||
module_name = os.path.basename(module_abs_src_path)
|
||||
out = MyMultiSectionFactory(output_cc_file_name)
|
||||
@@ -71,11 +77,11 @@ def main(argv):
|
||||
|
||||
try:
|
||||
from callbacks_list import callback_classes
|
||||
except ImportError, ex:
|
||||
print >> sys.stderr, "***************", repr(ex)
|
||||
except ImportError as ex:
|
||||
print("***************", repr(ex), file=sys.stderr)
|
||||
callback_classes = []
|
||||
else:
|
||||
print >> sys.stderr, ">>>>>>>>>>>>>>>>", repr(callback_classes)
|
||||
print(">>>>>>>>>>>>>>>>", repr(callback_classes), file=sys.stderr)
|
||||
|
||||
finally:
|
||||
sys.path.pop(0)
|
||||
@@ -97,7 +103,7 @@ def main(argv):
|
||||
module_customization.post_register_types(root_module)
|
||||
|
||||
# register Callback<...> type handlers
|
||||
ns3modulegen_core_customizations.generate_callback_classes(root_module.after_forward_declarations,
|
||||
ns3modulegen_core_customizations.register_callback_classes(root_module.after_forward_declarations,
|
||||
callback_classes)
|
||||
|
||||
# -----------
|
||||
@@ -108,20 +114,18 @@ def main(argv):
|
||||
|
||||
ns3modulegen_core_customizations.Object_customizations(root_module)
|
||||
ns3modulegen_core_customizations.Attribute_customizations(root_module)
|
||||
|
||||
ns3modulegen_core_customizations.generate_callback_classes(root_module,
|
||||
callback_classes)
|
||||
|
||||
# -----------
|
||||
module_apidefs.register_functions(root_module)
|
||||
|
||||
|
||||
if hasattr(module_customization, 'post_register_functions'):
|
||||
module_customization.post_register_functions(root_module)
|
||||
|
||||
|
||||
# -----------
|
||||
root_module.generate(out)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
main(sys.argv)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import re
|
||||
|
||||
from pybindgen.typehandlers import base as typehandlers
|
||||
@@ -5,6 +7,7 @@ from pybindgen import ReturnValue, Parameter
|
||||
from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper
|
||||
from pybindgen.typehandlers.codesink import MemoryCodeSink
|
||||
from pybindgen.typehandlers import ctypeparser
|
||||
from pybindgen.typehandlers.base import ForwardWrapperBase
|
||||
from pybindgen import cppclass
|
||||
import warnings
|
||||
|
||||
@@ -25,11 +28,13 @@ class SmartPointerTransformation(typehandlers.TypeTransformation):
|
||||
def __init__(self):
|
||||
super(SmartPointerTransformation, self).__init__()
|
||||
self.rx = re.compile(r'(ns3::|::ns3::|)Ptr<([^>]+)>\s*$')
|
||||
print("{0!r}".format(self), file=sys.stderr)
|
||||
|
||||
def _get_untransformed_type_traits(self, name):
|
||||
m = self.rx.match(name)
|
||||
is_const = False
|
||||
if m is None:
|
||||
print("{0!r} did not match".format(name), file=sys.stderr)
|
||||
return None, False
|
||||
else:
|
||||
name1 = m.group(2).strip()
|
||||
@@ -60,9 +65,9 @@ class SmartPointerTransformation(typehandlers.TypeTransformation):
|
||||
## fix the ctype, add ns3:: namespace
|
||||
orig_ctype, is_const = self._get_untransformed_type_traits(args[0])
|
||||
if is_const:
|
||||
correct_ctype = 'ns3::Ptr< %s const >' % orig_ctype[:-2]
|
||||
correct_ctype = 'ns3::Ptr< {0} const >'.format(orig_ctype[:-2])
|
||||
else:
|
||||
correct_ctype = 'ns3::Ptr< %s >' % orig_ctype[:-2]
|
||||
correct_ctype = 'ns3::Ptr< {0} >'.format(orig_ctype[:-2])
|
||||
args = tuple([correct_ctype] + list(args[1:]))
|
||||
|
||||
handler = type_handler(*args, **kwargs)
|
||||
@@ -83,58 +88,6 @@ typehandlers.param_type_matcher.register_transformation(transf)
|
||||
del transf
|
||||
|
||||
|
||||
class ArgvParam(Parameter):
|
||||
"""
|
||||
Converts a python list-of-strings argument to a pair of 'int argc,
|
||||
char *argv[]' arguments to pass into C.
|
||||
|
||||
One Python argument becomes two C function arguments -> it's a miracle!
|
||||
|
||||
Note: this parameter type handler is not registered by any name;
|
||||
must be used explicitly.
|
||||
"""
|
||||
|
||||
DIRECTIONS = [Parameter.DIRECTION_IN]
|
||||
CTYPES = []
|
||||
|
||||
def convert_c_to_python(self, wrapper):
|
||||
raise NotImplementedError
|
||||
|
||||
def convert_python_to_c(self, wrapper):
|
||||
py_name = wrapper.declarations.declare_variable('PyObject*', 'py_' + self.name)
|
||||
argc_var = wrapper.declarations.declare_variable('int', 'argc')
|
||||
name = wrapper.declarations.declare_variable('char**', self.name)
|
||||
idx = wrapper.declarations.declare_variable('Py_ssize_t', 'idx')
|
||||
wrapper.parse_params.add_parameter('O!', ['&PyList_Type', '&'+py_name], self.name)
|
||||
|
||||
#wrapper.before_call.write_error_check('!PyList_Check(%s)' % py_name) # XXX
|
||||
|
||||
wrapper.before_call.write_code("%s = (char **) malloc(sizeof(char*)*PyList_Size(%s));"
|
||||
% (name, py_name))
|
||||
wrapper.before_call.add_cleanup_code('free(%s);' % name)
|
||||
wrapper.before_call.write_code('''
|
||||
for (%(idx)s = 0; %(idx)s < PyList_Size(%(py_name)s); %(idx)s++)
|
||||
{
|
||||
''' % vars())
|
||||
wrapper.before_call.sink.indent()
|
||||
wrapper.before_call.write_code('''
|
||||
PyObject *item = PyList_GET_ITEM(%(py_name)s, %(idx)s);
|
||||
''' % vars())
|
||||
#wrapper.before_call.write_error_check('item == NULL')
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyString_Check(item)',
|
||||
failure_cleanup=('PyErr_SetString(PyExc_TypeError, '
|
||||
'"argument %s must be a list of strings");') % self.name)
|
||||
wrapper.before_call.write_code(
|
||||
'%s[%s] = PyString_AsString(item);' % (name, idx))
|
||||
wrapper.before_call.sink.unindent()
|
||||
wrapper.before_call.write_code('}')
|
||||
wrapper.before_call.write_code('%s = PyList_Size(%s);' % (argc_var, py_name))
|
||||
|
||||
wrapper.call_params.append(argc_var)
|
||||
wrapper.call_params.append(name)
|
||||
|
||||
|
||||
class CallbackImplProxyMethod(typehandlers.ReverseWrapperBase):
|
||||
"""
|
||||
Class that generates a proxy virtual method that calls a similarly named python method.
|
||||
@@ -159,7 +112,73 @@ class CallbackImplProxyMethod(typehandlers.ReverseWrapperBase):
|
||||
|
||||
|
||||
|
||||
def generate_callback_classes(out, callbacks):
|
||||
def register_callback_classes(out, callbacks):
|
||||
for callback_impl_num, template_parameters in enumerate(callbacks):
|
||||
cls_name = "ns3::Callback< %s >" % ', '.join(template_parameters)
|
||||
#print >> sys.stderr, "***** trying to register callback: %r" % cls_name
|
||||
class_name = "PythonCallbackImpl%i" % callback_impl_num
|
||||
|
||||
class PythonCallbackParameter(Parameter):
|
||||
"Class handlers"
|
||||
CTYPES = [cls_name]
|
||||
print("***** registering callback handler: %r (%r)" % (ctypeparser.normalize_type_string(cls_name), cls_name), file=sys.stderr)
|
||||
DIRECTIONS = [Parameter.DIRECTION_IN]
|
||||
PYTHON_CALLBACK_IMPL_NAME = class_name
|
||||
TEMPLATE_ARGS = template_parameters
|
||||
DISABLED = False
|
||||
|
||||
def convert_python_to_c(self, wrapper):
|
||||
"parses python args to get C++ value"
|
||||
assert isinstance(wrapper, typehandlers.ForwardWrapperBase)
|
||||
|
||||
if self.DISABLED:
|
||||
raise CodeGenerationError("wrapper could not be generated")
|
||||
|
||||
if self.default_value is None:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name)
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name)
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
callback_impl = wrapper.declarations.declare_variable(
|
||||
'ns3::Ptr<%s>' % self.PYTHON_CALLBACK_IMPL_NAME,
|
||||
'%s_cb_impl' % self.name)
|
||||
wrapper.before_call.write_code("%s = ns3::Create<%s> (%s);"
|
||||
% (callback_impl, self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
wrapper.call_params.append(
|
||||
'ns3::Callback<%s> (%s)' % (', '.join(self.TEMPLATE_ARGS), callback_impl))
|
||||
else:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name, 'NULL')
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name, optional=True)
|
||||
value = wrapper.declarations.declare_variable(
|
||||
'ns3::Callback<%s>' % ', '.join(self.TEMPLATE_ARGS),
|
||||
self.name+'_value',
|
||||
self.default_value)
|
||||
|
||||
wrapper.before_call.write_code("if (%s) {" % (py_callback,))
|
||||
wrapper.before_call.indent()
|
||||
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
|
||||
wrapper.before_call.write_code("%s = ns3::Callback<%s> (ns3::Create<%s> (%s));"
|
||||
% (value, ', '.join(self.TEMPLATE_ARGS),
|
||||
self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
|
||||
wrapper.before_call.unindent()
|
||||
wrapper.before_call.write_code("}") # closes: if (py_callback) {
|
||||
|
||||
wrapper.call_params.append(value)
|
||||
|
||||
|
||||
def convert_c_to_python(self, wrapper):
|
||||
raise typehandlers.NotSupportedError("Reverse wrappers for ns3::Callback<...> types "
|
||||
"(python using callbacks defined in C++) not implemented.")
|
||||
|
||||
|
||||
def generate_callback_classes(module, callbacks):
|
||||
out = module.after_forward_declarations
|
||||
for callback_impl_num, template_parameters in enumerate(callbacks):
|
||||
sink = MemoryCodeSink()
|
||||
cls_name = "ns3::Callback< %s >" % ', '.join(template_parameters)
|
||||
@@ -203,7 +222,7 @@ public:
|
||||
kwargs = {}
|
||||
try:
|
||||
return_type = ReturnValue.new(str(return_ctype), **kwargs)
|
||||
except (typehandlers.TypeLookupError, typehandlers.TypeConfigurationError), ex:
|
||||
except (typehandlers.TypeLookupError, typehandlers.TypeConfigurationError) as ex:
|
||||
warnings.warn("***** Unable to register callback; Return value '%s' error (used in %s): %r"
|
||||
% (callback_return, cls_name, ex),
|
||||
Warning)
|
||||
@@ -222,74 +241,29 @@ public:
|
||||
kwargs = {}
|
||||
try:
|
||||
arguments.append(Parameter.new(str(param_ctype), arg_name, **kwargs))
|
||||
except (typehandlers.TypeLookupError, typehandlers.TypeConfigurationError), ex:
|
||||
except (typehandlers.TypeLookupError, typehandlers.TypeConfigurationError) as ex:
|
||||
warnings.warn("***** Unable to register callback; parameter '%s %s' error (used in %s): %r"
|
||||
% (arg_type, arg_name, cls_name, ex),
|
||||
Warning)
|
||||
ok = False
|
||||
if not ok:
|
||||
try:
|
||||
typehandlers.return_type_matcher.lookup(cls_name)[0].DISABLED = True
|
||||
except typehandlers.TypeLookupError:
|
||||
pass
|
||||
try:
|
||||
typehandlers.param_type_matcher.lookup(cls_name)[0].DISABLED = True
|
||||
except typehandlers.TypeLookupError:
|
||||
pass
|
||||
continue
|
||||
|
||||
wrapper = CallbackImplProxyMethod(return_type, arguments)
|
||||
wrapper.generate(sink, 'operator()', decl_modifiers=[])
|
||||
|
||||
|
||||
sink.unindent()
|
||||
sink.writeln('};\n')
|
||||
print("Flushing to ", out, file=sys.stderr)
|
||||
sink.flush_to(out)
|
||||
|
||||
class PythonCallbackParameter(Parameter):
|
||||
"Class handlers"
|
||||
CTYPES = [cls_name]
|
||||
print >> sys.stderr, "***** registering callback handler: %r" % ctypeparser.normalize_type_string(cls_name)
|
||||
DIRECTIONS = [Parameter.DIRECTION_IN]
|
||||
PYTHON_CALLBACK_IMPL_NAME = class_name
|
||||
TEMPLATE_ARGS = template_parameters
|
||||
|
||||
def convert_python_to_c(self, wrapper):
|
||||
"parses python args to get C++ value"
|
||||
assert isinstance(wrapper, typehandlers.ForwardWrapperBase)
|
||||
|
||||
if self.default_value is None:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name)
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name)
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
callback_impl = wrapper.declarations.declare_variable(
|
||||
'ns3::Ptr<%s>' % self.PYTHON_CALLBACK_IMPL_NAME,
|
||||
'%s_cb_impl' % self.name)
|
||||
wrapper.before_call.write_code("%s = ns3::Create<%s> (%s);"
|
||||
% (callback_impl, self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
wrapper.call_params.append(
|
||||
'ns3::Callback<%s> (%s)' % (', '.join(self.TEMPLATE_ARGS), callback_impl))
|
||||
else:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name, 'NULL')
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name, optional=True)
|
||||
value = wrapper.declarations.declare_variable(
|
||||
'ns3::Callback<%s>' % ', '.join(self.TEMPLATE_ARGS),
|
||||
self.name+'_value',
|
||||
self.default_value)
|
||||
|
||||
wrapper.before_call.write_code("if (%s) {" % (py_callback,))
|
||||
wrapper.before_call.indent()
|
||||
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
|
||||
wrapper.before_call.write_code("%s = ns3::Callback<%s> (ns3::Create<%s> (%s));"
|
||||
% (value, ', '.join(self.TEMPLATE_ARGS),
|
||||
self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
|
||||
wrapper.before_call.unindent()
|
||||
wrapper.before_call.write_code("}") # closes: if (py_callback) {
|
||||
|
||||
wrapper.call_params.append(value)
|
||||
|
||||
|
||||
def convert_c_to_python(self, wrapper):
|
||||
raise typehandlers.NotSupportedError("Reverse wrappers for ns3::Callback<...> types "
|
||||
"(python using callbacks defined in C++) not implemented.")
|
||||
|
||||
|
||||
# def write_preamble(out):
|
||||
@@ -421,15 +395,28 @@ def add_std_ofstream(module):
|
||||
ofstream.add_constructor([Parameter.new("const char *", 'filename'),
|
||||
Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")])
|
||||
ofstream.add_method('close', None, [])
|
||||
|
||||
|
||||
add_std_ios_openmode(module)
|
||||
|
||||
|
||||
def add_std_ios_openmode(module):
|
||||
import pybindgen.typehandlers.base
|
||||
for alias in "std::_Ios_Openmode", "std::ios::openmode":
|
||||
pybindgen.typehandlers.base.param_type_matcher.add_type_alias(alias, "int")
|
||||
class IosOpenmodeParam(Parameter):
|
||||
|
||||
DIRECTIONS = [Parameter.DIRECTION_IN]
|
||||
CTYPES = ['std::ios::openmode', 'std::_Ios_Openmode']
|
||||
|
||||
def convert_c_to_python(self, wrapper):
|
||||
assert isinstance(wrapper, ReverseWrapperBase)
|
||||
wrapper.build_params.add_parameter('i', [self.value])
|
||||
|
||||
def convert_python_to_c(self, wrapper):
|
||||
assert isinstance(wrapper, ForwardWrapperBase)
|
||||
name = wrapper.declarations.declare_variable("std::ios::openmode", self.name, self.default_value)
|
||||
wrapper.parse_params.add_parameter('i', ['&'+name], self.name, optional=bool(self.default_value))
|
||||
wrapper.call_params.append(name)
|
||||
|
||||
|
||||
|
||||
def add_std_ios_openmode(module):
|
||||
for flag in 'in', 'out', 'ate', 'app', 'trunc', 'binary':
|
||||
module.after_init.write_code('PyModule_AddIntConstant(m, (char *) "STD_IOS_%s", std::ios::%s);'
|
||||
% (flag.upper(), flag))
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
+50
-25
@@ -12,11 +12,11 @@ from waflib.Errors import WafError
|
||||
# feature = TaskGen.feature
|
||||
# after = TaskGen.after
|
||||
|
||||
## https://launchpad.net/pybindgen/
|
||||
REQUIRED_PYBINDGEN_VERSION = (0, 16, 0, 898)
|
||||
# https://github.com/named-data-ndnSIM/pybindgen
|
||||
REQUIRED_PYBINDGEN_VERSION = '0.17.0.post45+ng4806e4f'
|
||||
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
|
||||
|
||||
|
||||
RUN_ME=-3
|
||||
|
||||
def add_to_python_path(path):
|
||||
if os.environ.get('PYTHONPATH', ''):
|
||||
@@ -47,6 +47,10 @@ def options(opt):
|
||||
opt.add_option('--with-python',
|
||||
help=('Path to the Python interpreter to use.'),
|
||||
default=None, dest='with_python', type="string")
|
||||
opt.add_option('--no32bit-scan',
|
||||
help=("Don't scan for the 32-bit variant of the bindings on 64-bit platforms."),
|
||||
action="store_true", default=False,
|
||||
dest='no32bit_scan')
|
||||
|
||||
|
||||
def configure(conf):
|
||||
@@ -159,17 +163,26 @@ def configure(conf):
|
||||
"PyBindGen missing")
|
||||
return
|
||||
else:
|
||||
out = subprocess.Popen([conf.env['PYTHON'][0], "-c",
|
||||
"import pybindgen.version; "
|
||||
"print '.'.join([str(x) for x in pybindgen.version.__version__])"],
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
pybindgen_version_str = out.strip()
|
||||
pybindgen_version = tuple([int(x) for x in pybindgen_version_str.split('.')])
|
||||
conf.msg('Checking for pybindgen version', pybindgen_version_str)
|
||||
def getVersion():
|
||||
out = subprocess.Popen([conf.env['PYTHON'][0], "-c",
|
||||
"try:\n"
|
||||
" import pybindgen.version\n"
|
||||
" print(pybindgen.__version__)\n"
|
||||
"except:\n"
|
||||
" pass"],
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
return out.strip()
|
||||
pybindgen_version = getVersion()
|
||||
if pybindgen_version == '': # version is not generated yet (e.g., cloned from git repo directly)
|
||||
subprocess.Popen([conf.env['PYTHON'][0], "setup.py", "--version"],
|
||||
cwd=conf.env['WITH_PYBINDGEN'],
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
pybindgen_version = getVersion()
|
||||
|
||||
conf.msg('Checking for pybindgen version', pybindgen_version)
|
||||
if not (pybindgen_version == REQUIRED_PYBINDGEN_VERSION):
|
||||
Logs.warn("pybindgen (found %s), (need %s)" %
|
||||
(pybindgen_version_str,
|
||||
'.'.join([str(x) for x in REQUIRED_PYBINDGEN_VERSION])))
|
||||
Logs.warn("pybindgen (found %r), (need %r)" %
|
||||
(pybindgen_version, REQUIRED_PYBINDGEN_VERSION))
|
||||
conf.report_optional_feature("python", "Python Bindings", False,
|
||||
"PyBindGen version not correct and newer version could not be retrieved")
|
||||
return
|
||||
@@ -188,13 +201,11 @@ int main ()
|
||||
''' % dict(type1=t1, type2=t2)
|
||||
|
||||
try:
|
||||
ret = conf.run_c_code(code=test_program,
|
||||
env=conf.env.derive(), compile_filename='test.cc',
|
||||
features='cxx cprogram', execute=False)
|
||||
ret = conf.check(compiler='cxx', fragment=test_program, features='cxx')
|
||||
except Errors.ConfigurationError:
|
||||
ret = 1
|
||||
ret = False
|
||||
conf.msg('Checking for types %s and %s equivalence' % (t1, t2), (ret and 'no' or 'yes'))
|
||||
return not ret
|
||||
return ret
|
||||
|
||||
uint64_is_long = test("uint64_t", "unsigned long")
|
||||
uint64_is_long_long = test("uint64_t", "unsigned long long")
|
||||
@@ -251,6 +262,8 @@ int main ()
|
||||
"import pygccxml; print pygccxml.__version__"],
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
pygccxml_version_str = out.strip()
|
||||
# Bug 2013: pygccxml versions > 1.0.0 prepend a 'v' to version number
|
||||
pygccxml_version_str = pygccxml_version_str.lstrip('v')
|
||||
pygccxml_version = tuple([int(x) for x in pygccxml_version_str.split('.')])
|
||||
conf.msg('Checking for pygccxml version', pygccxml_version_str)
|
||||
if not (pygccxml_version >= REQUIRED_PYGCCXML_VERSION):
|
||||
@@ -261,7 +274,7 @@ int main ()
|
||||
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
|
||||
"pygccxml too old")
|
||||
return
|
||||
|
||||
|
||||
|
||||
## Check gccxml version
|
||||
try:
|
||||
@@ -274,13 +287,17 @@ int main ()
|
||||
"gccxml missing")
|
||||
return
|
||||
|
||||
gccxml_version_line = os.popen(gccxml + " --version").readline().strip()
|
||||
gccxml_version_line = os.popen(gccxml[0] + " --version").readline().strip()
|
||||
m = re.match( "^GCC-XML version (\d\.\d(\.\d)?)$", gccxml_version_line)
|
||||
gccxml_version = m.group(1)
|
||||
gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9])
|
||||
try:
|
||||
gccxml_version = m.group(1)
|
||||
gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9])
|
||||
except AttributeError:
|
||||
gccxml_version = gccxml_version_line
|
||||
gccxml_version_ok = False
|
||||
conf.msg('Checking for gccxml version', gccxml_version)
|
||||
if not gccxml_version_ok:
|
||||
Logs.warn("gccxml too old, need version >= 0.9; automatic scanning of API definitions will not be possible")
|
||||
Logs.warn("gccxml version unknown or too old, need version >= 0.9; automatic scanning of API definitions will not be possible")
|
||||
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
|
||||
"gccxml too old")
|
||||
return
|
||||
@@ -365,6 +382,12 @@ class apiscan_task(Task.Task):
|
||||
retval = scan.wait()
|
||||
return retval
|
||||
|
||||
def runnable_status(self):
|
||||
# By default, Waf Task will skip running a task if the signature of
|
||||
# the build has not changed. We want this task to always run if
|
||||
# invoked by the user, particularly since --apiscan=all will require
|
||||
# invoking this task many times, once per module.
|
||||
return RUN_ME
|
||||
|
||||
def get_modules_and_headers(bld):
|
||||
"""
|
||||
@@ -399,7 +422,7 @@ class gen_ns3_compat_pymod_task(Task.Task):
|
||||
"""Generates a 'ns3.py' compatibility module."""
|
||||
before = 'cxx'
|
||||
color = 'BLUE'
|
||||
|
||||
|
||||
def run(self):
|
||||
assert len(self.outputs) == 1
|
||||
outfile = file(self.outputs[0].abspath(), "w")
|
||||
@@ -430,7 +453,9 @@ def build(bld):
|
||||
else:
|
||||
import struct
|
||||
if struct.calcsize('I') == 4 and struct.calcsize('L') == 8 and struct.calcsize('P') == 8:
|
||||
scan_targets.extend([('gcc_ILP32', '-m32'), ('gcc_LP64', '-m64')])
|
||||
if not Options.options.no32bit_scan:
|
||||
scan_targets.append(('gcc_ILP32', '-m32'))
|
||||
scan_targets.append(('gcc_LP64', '-m64'))
|
||||
elif struct.calcsize('I') == 4 and struct.calcsize('L') == 4 and struct.calcsize('P') == 4:
|
||||
scan_targets.append(('gcc_ILP32', ''))
|
||||
else:
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ build system (http://www.freehackers.org/~tnagy/waf.html)
|
||||
|
||||
Note: We've added a wiki page with more complete build instructions
|
||||
than the quick ones you find below:
|
||||
http://www.nsnam.org/wiki/index.php/Installation
|
||||
http://www.nsnam.org/wiki/Installation
|
||||
|
||||
=== Installing Waf ===
|
||||
|
||||
|
||||
+1550
-943
File diff suppressed because it is too large
Load Diff
+284
-41
@@ -1,62 +1,287 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Process doxygen.warnings.log to generate sorted list of top offenders
|
||||
# Process doxygen log to generate sorted list of top offenders.
|
||||
#
|
||||
|
||||
# Flag to skip the build and running doxygen, and just analyze the log
|
||||
skipdoxy=${1:-""}
|
||||
me=$(basename $0)
|
||||
DIR="$(dirname $0)"
|
||||
# Trick to get the absolute path, since doxygen prefixes errors that way
|
||||
ROOT=$(cd "$DIR/.."; pwd)
|
||||
|
||||
DIR=`dirname $0`
|
||||
ROOT=`hg root`
|
||||
# Final resting place for the log file
|
||||
log=$DIR/doxygen.warnings.log
|
||||
# Known log files
|
||||
STANDARDLOGFILE=doxygen.log
|
||||
WARNINGSLOGFILE=doxygen.warnings.log
|
||||
# Default choice: generate it
|
||||
LOG="$DIR/$WARNINGSLOGFILE"
|
||||
|
||||
# Verbose log
|
||||
VERBLOG="$DIR/doxygen.verbose.log"
|
||||
|
||||
|
||||
# First, we have to modify doxygen.conf to generate all the warnings
|
||||
# (We also suppress dot graphs, so shorten the run time.)
|
||||
# Options ------------------------------
|
||||
#
|
||||
|
||||
if [ "$skipdoxy" == "" ]; then
|
||||
function usage
|
||||
{
|
||||
cat <<-EOF
|
||||
|
||||
Usage: $me [-eithv] [-f <log-file> | -l | -s] [-m <module> | -F <regex>]
|
||||
|
||||
Run doxygen to generate all errors; report error counts
|
||||
by module and file.
|
||||
|
||||
-i Skip build and print-introspected-doxygen.
|
||||
|
||||
-f Skip doxygen run; use existing <log-file>.
|
||||
-s Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
|
||||
-l Skip doxygen run; use the normal doxygen log doc/$STANDARDLOGFILE
|
||||
|
||||
-e Filter out warnings from */examples/*
|
||||
-t Filter out warnings from */test/*
|
||||
-m Only include files matching src/<module>
|
||||
-F Only include files matching the <regex>
|
||||
|
||||
# Run introspection, which may require a build
|
||||
cd $(hg root) && ./waf --run print-introspected-doxygen >doc/introspected-doxygen.h
|
||||
-v Show the doxygen run output
|
||||
-h Print this usage message
|
||||
|
||||
The default behavior is to modify doxygen.conf temporarily to
|
||||
report all undocumented elements, and to reduce the run time.
|
||||
The output of this special run is kept in doc/$WARNINGSLOGFILE.
|
||||
To further reduce the run time, the -i option also skips
|
||||
print-introspected-doxygen, so waf doesn\'t have to compile
|
||||
any modified files at all.
|
||||
|
||||
The -f, -l, and -s options skip the doxygen run altogether.
|
||||
The first two use a specified or the standard log file;
|
||||
the -s option uses the warnings log from a prior run.
|
||||
Only the first of -f <log-file>, -s, or -l will have effect.
|
||||
|
||||
The -e and -t options exclude examples and test directories
|
||||
from the counts. The -m option only includes a specific module.
|
||||
The -F option only includes files (or warnings) matching the <regex>.
|
||||
The -m and -F options append the relevant warnings after the
|
||||
numerical report. These can be used in any combination.
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Messaging ----------------------------
|
||||
#
|
||||
|
||||
# Arg -v Verbosity level
|
||||
verbosity=0
|
||||
|
||||
function verbose
|
||||
{
|
||||
if [ "$1" == "-n" ]; then
|
||||
echo -n "$2"
|
||||
elif [ $verbosity -eq 1 ]; then
|
||||
echo "$1 $2"
|
||||
else
|
||||
echo "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
# Use file handle 6 for verbose output
|
||||
rm -f $VERBLOG
|
||||
exec 6>$VERBLOG
|
||||
|
||||
function status_report
|
||||
{
|
||||
local status="$1"
|
||||
local long_msg="$2"
|
||||
if [ $status -eq 0 ]; then
|
||||
verbose "$long_msg " "done."
|
||||
rm -f $VERBLOG
|
||||
else
|
||||
verbose "$long_msg " "FAILED. Details:"
|
||||
cat $VERBLOG
|
||||
rm -f $VERBLOG
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Argument processing ------------------
|
||||
#
|
||||
|
||||
# -f argument
|
||||
use_filearg=0
|
||||
logfile_arg=
|
||||
# -l
|
||||
use_standard=0
|
||||
# skip doxygen run; using existing log file
|
||||
skip_doxy=0
|
||||
# skip print-introspected-doxygen, avoiding a build
|
||||
skip_intro=0
|
||||
|
||||
# Filtering flags
|
||||
filter_examples=0
|
||||
filter_test=0
|
||||
filter_module=""
|
||||
filter_regex=""
|
||||
|
||||
echo
|
||||
echo "$me:"
|
||||
|
||||
while getopts :eitm:F:lF:svh option ; do
|
||||
|
||||
case $option in
|
||||
|
||||
(e) filter_examples=1 ;;
|
||||
|
||||
(i) skip_intro=1 ;;
|
||||
|
||||
(t) filter_test=1 ;;
|
||||
|
||||
(m) filter_module="$OPTARG" ;;
|
||||
|
||||
(F) filter_regex="$OPTARG" ;;
|
||||
|
||||
(l) use_standard=1 ;;
|
||||
|
||||
(f) use_filearg=1
|
||||
logfile_arg="$OPTARG"
|
||||
;;
|
||||
|
||||
(s) use_filearg=1
|
||||
logfile_arg="$DIR/$WARNINGSLOGFILE"
|
||||
;;
|
||||
|
||||
(v) verbosity=1
|
||||
exec 6>&1
|
||||
;;
|
||||
|
||||
(h) usage ;;
|
||||
|
||||
(:) echo "$me: Missing argument to -$OPTARG" ; usage ;;
|
||||
|
||||
(\?) echo "$me: Invalid option: -$OPTARG" ; usage ;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
||||
function checklogfile
|
||||
{
|
||||
if [ -e "$1" ] ; then
|
||||
skip_doxy=1
|
||||
LOG="$1"
|
||||
else
|
||||
echo "$me: log file $1 does not exist."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Which log file
|
||||
if [[ $use_filearg -eq 1 && "${logfile_arg:-}" != "" ]] ; then
|
||||
checklogfile "$logfile_arg"
|
||||
elif [ $use_standard -eq 1 ]; then
|
||||
checklogfile "$DIR/$STANDARDLOGFILE"
|
||||
fi
|
||||
|
||||
# Run doxygen -------------------------
|
||||
#
|
||||
|
||||
if [ $skip_doxy -eq 1 ]; then
|
||||
echo
|
||||
echo "Skipping doxygen run, using existing log file $LOG"
|
||||
else
|
||||
|
||||
if [ $skip_intro -eq 1 ]; then
|
||||
verbose "" "Skipping ./waf build and print-introspected-doxygen."
|
||||
else
|
||||
# Run introspection, which may require a build
|
||||
verbose -n "Building and running print-introspected-doxygen..."
|
||||
(cd "$ROOT" && ./waf --run print-introspected-doxygen >doc/introspected-doxygen.h >&6 2>&6 )
|
||||
status_report $? "./waf build"
|
||||
fi
|
||||
|
||||
# Modify doxygen.conf to generate all the warnings
|
||||
# (We also suppress dot graphs, so shorten the run time.)
|
||||
|
||||
conf=$DIR/doxygen.conf
|
||||
|
||||
sed -i.bak -E '/^EXTRACT_ALL |^HAVE_DOT |^WARNINGS /s/YES/no/' $conf
|
||||
rm -f $conf.bak
|
||||
|
||||
echo -n "Rebuilding doxygen docs with full errors..."
|
||||
(cd $ROOT && ./waf --doxygen >/dev/null 2>&1)
|
||||
verbose -n "Rebuilding doxygen (v$(doxygen --version)) docs with full errors..."
|
||||
(cd "$ROOT" && ./waf --doxygen-no-build >&6 2>&6 )
|
||||
status=$?
|
||||
|
||||
hg revert $conf
|
||||
rm -f $conf
|
||||
mv -f $conf.bak $conf
|
||||
|
||||
if [ "$status" = "0" ]; then
|
||||
echo "Done."
|
||||
else
|
||||
echo "FAILED."
|
||||
exit 1
|
||||
fi
|
||||
status_report $status "Doxygen run"
|
||||
|
||||
mv $DIR/doxygen.log $log
|
||||
cp -f "$DIR/$STANDARDLOGFILE" "$DIR/$WARNINGSLOGFILE"
|
||||
|
||||
else
|
||||
echo "Skipping doxygen run, using existing log file $log"
|
||||
fi
|
||||
|
||||
# Log filters --------------------------
|
||||
#
|
||||
|
||||
# Analyze the log
|
||||
# Filter regular expression for -m and -F
|
||||
filter_inRE=""
|
||||
if [ "$filter_module" != "" ] ; then
|
||||
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}src/$filter_module"
|
||||
fi
|
||||
if [ "$filter_regex" != "" ] ; then
|
||||
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_regex"
|
||||
fi
|
||||
|
||||
# Filter regular expression for -e and -t
|
||||
filter_outRE=""
|
||||
if [ $filter_examples -eq 1 ]; then
|
||||
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/examples/"
|
||||
fi
|
||||
if [ $filter_test -eq 1 ]; then
|
||||
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/test/"
|
||||
fi
|
||||
|
||||
if [ "${filter_inRE:-}" != "" ] ; then
|
||||
echo "Filtering in \"$filter_inRE\""
|
||||
fi
|
||||
if [ "${filter_outRE:-}" != "" ] ; then
|
||||
echo "Filtering out \"$filter_outRE\""
|
||||
fi
|
||||
echo
|
||||
|
||||
# Filter log file
|
||||
function filter_log
|
||||
{
|
||||
local flog;
|
||||
flog=$( cat "$LOG" | grep "^$ROOT" )
|
||||
|
||||
if [ "${filter_inRE:-}" != "" ] ; then
|
||||
flog=$( echo "$flog" | grep "$filter_inRE" )
|
||||
fi
|
||||
|
||||
if [ "${filter_outRE:-}" != "" ] ; then
|
||||
flog=$( echo "$flog" | grep -v "$filter_outRE" )
|
||||
fi
|
||||
|
||||
flog=$( \
|
||||
echo "$flog" | \
|
||||
sort -t ':' -k1,1 -k2,2n | \
|
||||
uniq \
|
||||
)
|
||||
|
||||
echo "$flog"
|
||||
}
|
||||
|
||||
# Analyze the log ----------------------
|
||||
#
|
||||
|
||||
# List of module directories (e.g, "src/core/model")
|
||||
undocmods=$( \
|
||||
grep "^$ROOT" "$log" | \
|
||||
filter_log | \
|
||||
cut -d ':' -f 1 | \
|
||||
sed "s|$ROOT||g" | \
|
||||
cut -d '/' -f 2-4 | \
|
||||
sed "s|$ROOT/||g" | \
|
||||
cut -d '/' -f 1-3 | \
|
||||
sort | \
|
||||
uniq -c | \
|
||||
sort -nr \
|
||||
)
|
||||
|
||||
|
||||
# Number of directories
|
||||
modcount=$( \
|
||||
@@ -68,24 +293,24 @@ modcount=$( \
|
||||
# For a function with multiple undocumented parameters,
|
||||
# Doxygen prints the additional parameters on separate lines,
|
||||
# so they don't show up in the totals above.
|
||||
# Rather than work too hard to get the exact number,
|
||||
# Rather than work too hard to get the exact number for each file,
|
||||
# we just list the total here.
|
||||
addlparam=$( \
|
||||
grep -v "^$ROOT" $log | \
|
||||
grep -v "not generated, too many nodes" | \
|
||||
grep "^ parameter '" $log | \
|
||||
grep "^ parameter '" "$LOG" | \
|
||||
wc -l | \
|
||||
sed 's/^[ \t]*//;s/[ \t]*$//' \
|
||||
)
|
||||
|
||||
# Total number of warnings
|
||||
warncount=$(echo "$undocmods" | \
|
||||
awk '{total += $1}; END {print total}' )
|
||||
warncount=$( \
|
||||
echo "$undocmods" | \
|
||||
awk '{total += $1}; END {print total}' \
|
||||
)
|
||||
warncount=$((warncount + addlparam))
|
||||
|
||||
# List of files appearing in the log
|
||||
undocfiles=$( \
|
||||
grep "^$ROOT" "$log" | \
|
||||
undocfiles=$( \
|
||||
filter_log | \
|
||||
cut -d ':' -f 1 | \
|
||||
sed "s|$ROOT||g" | \
|
||||
cut -d '/' -f 2- | \
|
||||
@@ -95,7 +320,7 @@ undocfiles=$( \
|
||||
)
|
||||
|
||||
# Sorted by number, decreasing
|
||||
undocsort=$(echo "$undocfiles" | sort -r )
|
||||
undocsort=$(echo "$undocfiles" | sort -k1nr,2 )
|
||||
|
||||
# Total number of files
|
||||
filecount=$( \
|
||||
@@ -104,7 +329,19 @@ filecount=$( \
|
||||
sed 's/^[ \t]*//;s/[ \t]*$//' \
|
||||
)
|
||||
|
||||
# Now we're ready to summarize the log
|
||||
# Filtered in warnings
|
||||
filterin=
|
||||
if [ "${filter_inRE:-}" != "" ] ; then
|
||||
filterin=$( \
|
||||
filter_log | \
|
||||
sed "s|$ROOT/||g" \
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Summarize the log --------------------
|
||||
#
|
||||
|
||||
echo
|
||||
echo "Report of Doxygen warnings"
|
||||
@@ -147,4 +384,10 @@ printf "%6d directories\n" $modcount
|
||||
printf "%6d files\n" $filecount
|
||||
printf "%6d warnings\n" $warncount
|
||||
|
||||
|
||||
if [ "$filterin" != "" ] ; then
|
||||
echo
|
||||
echo
|
||||
echo "Filtered Warnings"
|
||||
echo "========================================"
|
||||
echo "$filterin"
|
||||
fi
|
||||
|
||||
+26
-2
@@ -13,8 +13,7 @@
|
||||
*
|
||||
* \section install-sec Building the Documentation
|
||||
*
|
||||
* ns-3 requires Doxygen version 1.5.4 or greater to fully build all items,
|
||||
* although earlier versions of Doxygen will mostly work.
|
||||
* ns-3 requires Doxygen version 1.8.3.1 or greater.
|
||||
*
|
||||
* Type "./waf --doxygen" or "./waf --doxygen-no-build" to build the
|
||||
* documentation. The doc/ directory contains
|
||||
@@ -71,3 +70,28 @@
|
||||
* ns3 namespace.
|
||||
*/
|
||||
|
||||
// Macros defined by the build system.
|
||||
//
|
||||
// These have to be visible for doxygen to document them,
|
||||
// so we put them here in a file only seen by doxygen, not the compiler.
|
||||
/**
|
||||
* \ingroup assert
|
||||
*
|
||||
* \def NS3_ASSERT_ENABLE
|
||||
*
|
||||
* Enable asserts at compile time.
|
||||
*
|
||||
* This is normally set by `./waf configure --build-profile=debug`.
|
||||
*/
|
||||
#define NS3_ASSERT_ENABLE
|
||||
|
||||
/**
|
||||
* \ingroup logging
|
||||
*
|
||||
* \def NS3_LOG_ENABLE
|
||||
*
|
||||
* Enable logging at compile time.
|
||||
*
|
||||
* This is normally set by `./waf configure --build-profile=debug`.
|
||||
*/
|
||||
#define NS3_LOG_ENABLE
|
||||
|
||||
+17
-7
@@ -16,6 +16,7 @@ SOURCES = \
|
||||
source/replace.txt \
|
||||
source/attributes.rst \
|
||||
source/callbacks.rst \
|
||||
source/documentation.rst \
|
||||
source/enable-modules.rst \
|
||||
source/enable-tests.rst \
|
||||
source/events.rst \
|
||||
@@ -89,13 +90,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
|
||||
|
||||
RESCALE = ../../utils/rescale-pdf.sh
|
||||
|
||||
%.eps : %.dia; $(DIA) -t eps $< -e $@
|
||||
%.png : %.dia; $(DIA) -t png $< -e $@
|
||||
%.png : %.eps; $(CONVERT) $< $@
|
||||
%.pdf : %.eps;
|
||||
$(EPSTOPDF) $< -o=$@
|
||||
if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
%.eps : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t eps $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t png $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.eps
|
||||
@echo convert $(notdir $<)
|
||||
@$(CONVERT) $< $@ >/dev/null
|
||||
|
||||
%.pdf : %.eps
|
||||
@echo epstopdf $(notdir $<)
|
||||
@$(EPSTOPDF) $< -o=$@ >/dev/null
|
||||
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
@@ -134,7 +144,7 @@ help:
|
||||
copy-sources: $(SOURCES)
|
||||
@rm -rf $(SOURCETEMP)
|
||||
@mkdir -p $(SOURCETEMP)
|
||||
@mkdir -p $(FIGURES)
|
||||
@mkdir -p $(FIGURES)
|
||||
@cp -r $(SOURCES) $(SOURCETEMP)
|
||||
@cp -r $(SOURCEFIGS) $(FIGURES)
|
||||
|
||||
|
||||
+499
-283
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,647 @@
|
||||
.. include:: replace.txt
|
||||
.. highlight:: cpp
|
||||
|
||||
Creating Documentation
|
||||
----------------------
|
||||
|
||||
|ns3| supplies two kinds of documentation: expository "user-guide"-style
|
||||
chapters, and source code API documentation.
|
||||
|
||||
The "user-guide" chapters are written by hand in reStructuredText_
|
||||
format (``.rst``), which is processed by the Python documentation
|
||||
system Sphinx_ to generate web pages and pdf files.
|
||||
The API documentation is generated from the source code itself,
|
||||
using Doxygen_, to generate cross-linked web pages.
|
||||
Both of these are important: the Sphinx chapters explain the *why*
|
||||
and overview of using a model; the API documentation explains the
|
||||
*how* details.
|
||||
|
||||
This chapter gives a quick overview of these
|
||||
tools, emphasizing preferred usage and customizations for |ns3|.
|
||||
|
||||
To build all the standard documentation:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ ./waf docs
|
||||
|
||||
For more specialized options, read on.
|
||||
|
||||
.. _reStructuredText: http://sphinx-doc.org/rest.html
|
||||
.. _sphinx: http://sphinx-doc.org/
|
||||
.. _doxygen: http://www.doxygen.org/
|
||||
|
||||
|
||||
Documenting with Sphinx
|
||||
***********************
|
||||
|
||||
We use Sphinx_ to generate expository chapters describing
|
||||
the design and usage of each module. Right now you are reading the
|
||||
:doc:`Documentation <documentation>` Chapter.
|
||||
If you are reading the html version, the
|
||||
`Show Source <_sources/documentation.txt>`_ link in the sidebar
|
||||
will show you the reStructuredText source for this chapter.
|
||||
|
||||
Adding New Chapters
|
||||
===================
|
||||
|
||||
Adding a new chapter takes three steps (described in more detail below):
|
||||
|
||||
#. Choose `Where?`_ the documentation file(s) will live.
|
||||
#. `Link`_ from an existing page to the new documentation.
|
||||
#. Add the new file to the `Makefile`_.
|
||||
|
||||
Where?
|
||||
######
|
||||
|
||||
Documentation for a specific module, ``foo``, should normally go in
|
||||
``src/foo/doc/``. For example ``src/foo/doc/foo.rst`` would be the
|
||||
top-level document for the module. The ``src/create-module.py`` script
|
||||
will create this file for you.
|
||||
|
||||
Some models require several ``.rst`` files, and figures; these should
|
||||
all go in the ``src/foo/doc/`` directory. The docs are actually built
|
||||
by a Sphinx Makefile. For especially involved
|
||||
documentation, it may be helpful to have a local ``Makefile``
|
||||
in the ``src/foo/doc/`` directory to
|
||||
simplify building the documentation for this module
|
||||
(`Antenna`_ is an example). Setting this up
|
||||
is not particularly hard, but is beyond the scope of this chapter.
|
||||
|
||||
In some cases, documentation spans multiple models; the
|
||||
`Network`_ chapter is an example. In these cases
|
||||
adding the ``.rst`` files directly to ``doc/models/source/`` might
|
||||
be appropriate.
|
||||
|
||||
.. _antenna: http://www.nsnam.org/docs/models/html/antenna.html
|
||||
.. _network: http://www.nsnam.org/docs/models/html/network.html
|
||||
|
||||
Link
|
||||
####
|
||||
|
||||
Sphinx has to know *where* your new chapter should appear. In most
|
||||
cases, a new model chapter should appear the in `Models` book.
|
||||
To add your chapter there, edit ``doc/models/source/index.rst``
|
||||
|
||||
.. sourcecode:: rest
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
organization
|
||||
animation
|
||||
antenna
|
||||
aodv
|
||||
applications
|
||||
...
|
||||
|
||||
Add the name of your document (without the ``.rst`` extension) to
|
||||
this list. Please keep the Model chapters in alphabetical order,
|
||||
to ease visual scanning for specific chapters.
|
||||
|
||||
Makefile
|
||||
########
|
||||
|
||||
You also have to add your document to the appropriate ``Makefile``,
|
||||
so ``make`` knows to check it for updates. The Models book Makefile
|
||||
is ``doc/models/Makefile``, the Manual book Makefile is
|
||||
``doc/manual/Makefile``.
|
||||
|
||||
.. sourcecode:: make
|
||||
|
||||
# list all model library .rst files that need to be copied to $SOURCETEMP
|
||||
SOURCES = \
|
||||
source/conf.py \
|
||||
source/_static \
|
||||
source/index.rst \
|
||||
source/replace.txt \
|
||||
source/organization.rst \
|
||||
...
|
||||
$(SRC)/antenna/doc/source/antenna.rst \
|
||||
...
|
||||
|
||||
You add your ``.rst`` files to the ``SOURCES`` variable. To add figures,
|
||||
read the comments in the ``Makefile`` to see which variable should contain
|
||||
your image files. Again, please keep these in alphabetical order.
|
||||
|
||||
Building Sphinx Docs
|
||||
====================
|
||||
|
||||
Building the Sphinx documentation is pretty simple.
|
||||
To build all the Sphinx documentation:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ ./waf sphinx
|
||||
|
||||
To build just the Models documentation:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ make -C doc/models html
|
||||
|
||||
To see the generated documentation point your browser at
|
||||
``doc/models/build/html``.
|
||||
|
||||
As you can see, Sphinx uses Make to guide the process.
|
||||
The default target builds all enabled output forms, which in
|
||||
|ns3| are the multi-page ``html``, single-page ``singlehtml``, and pdf
|
||||
(``latex``). To build just the multi-page html, you add the ``html`` target:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ make -C doc/models html
|
||||
|
||||
This can be helpful to reduce the build time (and the size of the
|
||||
build chatter) as you are writing your chapter.
|
||||
|
||||
Before committing your documentation to the repo, please check
|
||||
that it builds without errors or warnings. The build process
|
||||
generates lots of output (mostly normal chatter from LaTeX),
|
||||
which can make it difficult to see if there are any Sphinx
|
||||
warnings or errors. To find important warnings and errors
|
||||
build just the ``html`` version, then search the build log
|
||||
for ``warning`` or ``error``.
|
||||
|
||||
|
||||
|ns3| Specifics
|
||||
===============
|
||||
|
||||
The Sphinx documentation_ and tutorial_ are pretty good. We won't duplicate
|
||||
the basics here, instead focusing on preferred usage for |ns3|.
|
||||
|
||||
.. _documentation: http://sphinx-doc.org/contents.html
|
||||
.. _tutorial: http://sphinx-doc.org/tutorial.html
|
||||
|
||||
|
||||
* Start documents with these two lines:
|
||||
|
||||
.. sourcecode:: rest
|
||||
|
||||
.. include:: replace.txt
|
||||
.. highlight:: cpp
|
||||
|
||||
The first line enables some simple replacements. For example,
|
||||
typing ``|ns3|`` renders as |ns3|.
|
||||
The second sets the default source code highlighting language explicitly
|
||||
for the file, since the parser guess isn't always accurate.
|
||||
(It's also possible to set the language explicitly for a single code block,
|
||||
see below.)
|
||||
|
||||
* Sections:
|
||||
|
||||
Sphinx is pretty liberal about marking section headings. By convention,
|
||||
we prefer this hierarchy:
|
||||
|
||||
.. sourcecode:: rest
|
||||
|
||||
.. heading hierarchy:
|
||||
------------- Chapter
|
||||
************* Section (#.#)
|
||||
============= Subsection (#.#.#)
|
||||
############# Sub-subsection
|
||||
|
||||
* Syntax Highlighting:
|
||||
|
||||
To use the default syntax highlighter, simply start a sourcecode block:
|
||||
|
||||
+--------------------------------------+------------------------------------+
|
||||
| Sphinx Source | Rendered Output |
|
||||
+======================================+====================================+
|
||||
| .. sourcecode:: rest | |
|
||||
| | |
|
||||
| The ``Frobnitz`` is accessed by:: | The ``Frobnitz`` is accessed by:: |
|
||||
| | |
|
||||
| Foo::Frobnitz frob; | Foo::Frobnitz frob; |
|
||||
| frob.Set (...); | frob.Set (...); |
|
||||
+--------------------------------------+------------------------------------+
|
||||
|
||||
To use a specific syntax highlighter, for example, ``bash`` shell commands:
|
||||
|
||||
+--------------------------------------+------------------------------------+
|
||||
| Sphinx Source | Rendered Output |
|
||||
+======================================+====================================+
|
||||
| .. sourcecode:: rest | |
|
||||
| | |
|
||||
| .. sourcecode:: bash | .. sourcecode:: bash |
|
||||
| | |
|
||||
| $ ls | $ ls |
|
||||
+--------------------------------------+------------------------------------+
|
||||
|
||||
* Shorthand Notations:
|
||||
|
||||
These shorthands are defined:
|
||||
|
||||
+--------------------------------------+------------------------------------+
|
||||
| Sphinx Source | Rendered Output |
|
||||
+======================================+====================================+
|
||||
| .. sourcecode:: rest | |
|
||||
| | |
|
||||
| |ns3| | |ns3| |
|
||||
+--------------------------------------+------------------------------------+
|
||||
| .. sourcecode:: rest | |
|
||||
| | |
|
||||
| |ns2| | |ns2| |
|
||||
+--------------------------------------+------------------------------------+
|
||||
| .. sourcecode:: rest | |
|
||||
| | |
|
||||
| |check| | |check| |
|
||||
+--------------------------------------+------------------------------------+
|
||||
| .. sourcecode:: rest | |
|
||||
| | |
|
||||
| :rfc:`6282` | :rfc:`6282` |
|
||||
+--------------------------------------+------------------------------------+
|
||||
|
||||
|
||||
Documenting with Doxygen
|
||||
************************
|
||||
|
||||
We use Doxygen_ to generate browsable_ API documentation. Doxygen
|
||||
provides a number of useful features:
|
||||
|
||||
* Summary table of all class members.
|
||||
* Graphs of inheritance and collaboration for all classes.
|
||||
* Links to the source code implementing each function.
|
||||
* Links to every place a member is used.
|
||||
* Links to every object used in implementing a function.
|
||||
* Grouping of related classes, such as all the classes related to
|
||||
a specific protocol.
|
||||
|
||||
In addition, we use the ``TypeId`` system to add to the documentation
|
||||
for every class
|
||||
|
||||
* The ``Config`` paths by which such objects can be reached.
|
||||
* Documentation for any ``Attributes``, including ``Attributes``
|
||||
defined in parent classes.
|
||||
* Documentation for any ``Trace`` sources defined by the class.
|
||||
* The memory footprint for each class.
|
||||
|
||||
Doxygen operates by scaning the source code, looking for
|
||||
specially marked comments. It also creates a cross reference,
|
||||
indicating *where* each file, class, method, and variable is used.
|
||||
|
||||
.. _browsable: https://www.nsnam.org/docs/doxygen
|
||||
|
||||
|
||||
Preferred Style
|
||||
===============
|
||||
|
||||
The preferred style for Doxygen comments is the JavaDoc style::
|
||||
|
||||
/**
|
||||
* Brief description of this class or method.
|
||||
* Adjacent lines become a single paragraph.
|
||||
*
|
||||
* Longer description, with lots of details.
|
||||
*
|
||||
* Blank lines separate paragraphs.
|
||||
*
|
||||
* Explain what the class or method does, using what algorithm.
|
||||
* Explain the units of arguments and return values.
|
||||
*
|
||||
* \note Note any limitations or gotchas.
|
||||
*
|
||||
* (For functions with arguments or return valued:)
|
||||
* \param [in] foo Brief noun phrase describing this argument. Note
|
||||
* that we indicate if the argument is input,
|
||||
* output, or both.
|
||||
* \param [in,out] bar Note Sentence case, and terminating period.
|
||||
* \param [in] baz Indicate boolean values with \c true or \c false.
|
||||
* \return Brief noun phrase describing the value.
|
||||
*
|
||||
* \internal
|
||||
*
|
||||
* You can also discuss internal implementation details.
|
||||
* Understanding this material shouldn't be necessary to using
|
||||
* the class or method.
|
||||
*/
|
||||
void ExampleFunction (const int foo, double & bar, const bool baz);
|
||||
|
||||
In this style the Doxygen comment block begins with two \`*' characters:
|
||||
``/**``, and precedes the item being documented.
|
||||
|
||||
For items needing only a brief description, either of these short forms
|
||||
is appropriate::
|
||||
|
||||
/** Destructor implementation. */
|
||||
void DoDispose ();
|
||||
|
||||
int m_count; //!< Count of ...
|
||||
|
||||
Note the special form of the end of line comment, ``//!<``, indicating
|
||||
that it refers to the *preceding* item.
|
||||
|
||||
Some items to note:
|
||||
|
||||
* Use sentence case, including the initial capital.
|
||||
* Use punctuation, especially \`.'s at the end of sentences or phrases.
|
||||
* The ``\brief`` tag is not needed; the first sentence will be
|
||||
used as the brief description.
|
||||
|
||||
Every class, method, typedef, member variable, function argument
|
||||
and return value should be documented in all source code files
|
||||
which form the formal API and implementation for |ns3|, such as
|
||||
``src/<module>/model/*``, ``src/<module>/helper/*`` and
|
||||
``src/<module>/utils/*``. Documentation for items in ``src/<module>/test/*``
|
||||
and ``src/<module>/examples/*`` is preferred, but not required.
|
||||
|
||||
Useful Features
|
||||
===============
|
||||
|
||||
* Inherited members will automatically inherit docs from the parent,
|
||||
(but can be replaced by local documentation).
|
||||
|
||||
#. Document the base class.
|
||||
#. In the sub class mark inherited functions with an ordinary comment::
|
||||
|
||||
// Inherited methods
|
||||
virtual void FooBar (void);
|
||||
virtual int BarFoo (double baz);
|
||||
|
||||
Note that the signatures have to match exactly, so include the formal
|
||||
argument ``(void)``
|
||||
|
||||
This doesn't work for static functions; see ``GetTypeId``, below, for an
|
||||
example.
|
||||
|
||||
Building Doxygen Docs
|
||||
=====================
|
||||
|
||||
Building the Doxygen documentation is pretty simple:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ ./waf doxygen
|
||||
|
||||
This builds using the default configuration, which generates
|
||||
documentation sections for *all* items, even if they do not have
|
||||
explicit comment documentation blocks. This has the effect of
|
||||
suppressing warnings for undocumented items, but makes sure everything
|
||||
appears in the generated output, which is usually what you want for
|
||||
general use. Note that we generate documentation even for modules
|
||||
which are disabled, to make it easier to see all the features
|
||||
available in |ns3|.
|
||||
|
||||
When writing documentation, it's often more useful to see which items
|
||||
are generating warnings, typically about missing documentation. To
|
||||
see the full warnings list, use the ``doc/doxygen.warnings.report.sh``
|
||||
script:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ doc/doxygen.warnings.report.sh
|
||||
|
||||
doxygen.warnings.report.sh:
|
||||
Building and running print-introspected-doxygen...done.
|
||||
Rebuilding doxygen (v1.8.10) docs with full errors...done.
|
||||
|
||||
|
||||
Report of Doxygen warnings
|
||||
----------------------------------------
|
||||
|
||||
(All counts are lower bounds.)
|
||||
|
||||
Warnings by module/directory:
|
||||
|
||||
Count Directory
|
||||
----- ----------------------------------
|
||||
3414 src/lte/model
|
||||
1532 src/wimax/model
|
||||
825 src/lte/test
|
||||
....
|
||||
1 src/applications/test
|
||||
97 additional undocumented parameters.
|
||||
----------------------------------------
|
||||
12460 total warnings
|
||||
100 directories with warnings
|
||||
|
||||
|
||||
Warnings by file (alphabetical)
|
||||
|
||||
Count File
|
||||
----- ----------------------------------
|
||||
15 examples/routing/manet-routing-compare.cc
|
||||
26 examples/stats/wifi-example-apps.h
|
||||
12 examples/tutorial/fifth.cc
|
||||
....
|
||||
17 utils/python-unit-tests.py
|
||||
----------------------------------------
|
||||
771 files with warnings
|
||||
|
||||
|
||||
Warnings by file (numerical)
|
||||
|
||||
Count File
|
||||
----- ----------------------------------
|
||||
273 src/lte/model/lte-rrc-sap.h
|
||||
272 src/core/model/simulator.h
|
||||
221 src/netanim/model/animation-interface.h
|
||||
....
|
||||
1 src/wimax/model/ul-job.cc
|
||||
----------------------------------------
|
||||
771 files with warnings
|
||||
|
||||
|
||||
Doxygen Warnings Summary
|
||||
----------------------------------------
|
||||
100 directories
|
||||
771 files
|
||||
12460 warnings
|
||||
|
||||
(This snippet has *a lot* of lines suppressed!)
|
||||
|
||||
The script modifies the configuration to show all warnings, and to
|
||||
shorten the run time. (It shortens the run time primarily by
|
||||
disabling creation of diagrams, such as call trees, and doesn't
|
||||
generate documentation for undocumented items, in order to trigger the
|
||||
warnings.) As you can see, at this writing we have *a lot* of
|
||||
undocumented items. The report summarizes warnings by module
|
||||
``src/*/*``, and by file, in alphabetically and numerical order.
|
||||
|
||||
The script has a few options to pare things down and make the output more
|
||||
manageable. For help, use the ``-h`` option. Having run it once
|
||||
to do the Doxygen build and generate the full warnings log,
|
||||
you can reprocess the log file with various "filters,"
|
||||
without having to do the full Doxygen build again by
|
||||
using the ``-s`` option. You can exclude warnings
|
||||
from ``*/examples/*`` files (``-e`` option), and/or ``*/test/*`` files
|
||||
(``-t``). Just to be clear, all of the filter options do the complete
|
||||
fast doxygen build; they just filter doxygen log and warnings output.
|
||||
|
||||
Perhaps the most useful option when writing documentation comments
|
||||
is ``-m <module>``, which will limit the report to just files matching
|
||||
``src/<module>/*``, and follow the report with the actual warning lines.
|
||||
Combine with ``-et`` and you can focus on the warnings that are most
|
||||
urgent in a single module:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ doc/doxygen.warnings.report.sh -m mesh/helper
|
||||
...
|
||||
Doxygen Warnings Summary
|
||||
----------------------------------------
|
||||
1 directories
|
||||
3 files
|
||||
149 warnings
|
||||
|
||||
|
||||
Filtered Warnings
|
||||
========================================
|
||||
src/mesh/helper/dot11s/dot11s-installer.h:72: warning: Member m_root (variable) of class ns3::Dot11sStack is not documented.
|
||||
src/mesh/helper/dot11s/dot11s-installer.h:35: warning: return type of member ns3::Dot11sStack::GetTypeId is not documented
|
||||
src/mesh/helper/dot11s/dot11s-installer.h:56: warning: return type of member ns3::Dot11sStack::InstallStack is not documented
|
||||
src/mesh/helper/flame/lfame-installer.h:40: warning: Member GetTypeId() (function) of class ns3::FlameStack is not documented.
|
||||
src/mesh/helper/flame/flame-installer.h:60: warning: return type of member ns3::FlameStack::InstallStack is not documented
|
||||
src/mesh/helper/mesh-helper.h:213: warning: Member m_nInterfaces (variable) of class ns3::MeshHelper is not documented.
|
||||
src/mesh/helper/mesh-helper.h:214: warning: Member m_spreadChannelPolicy (variable) of class ns3::MeshHelper is not documented.
|
||||
src/mesh/helper/mesh-helper.h:215: warning: Member m_stack (variable) of class ns3::MeshHelper is not documented.
|
||||
src/mesh/helper/mesh-helper.h:216: warning: Member m_stackFactory (variable) of class ns3::MeshHelper is not documented.
|
||||
src/mesh/helper/mesh-helper.h:209: warning: parameters of member ns3::MeshHelper::CreateInterface are not (all) documented
|
||||
src/mesh/helper/mesh-helper.h:119: warning: parameters of member ns3::MeshHelper::SetStandard are not (all) documented
|
||||
|
||||
|
||||
Finally, note that undocumented items (classes, methods, functions,
|
||||
typedefs, *etc.* won't produce documentation when you build with
|
||||
``doxygen.warnings.report.sh``, and only the outermost item
|
||||
will produce a warning. As a result, if you don't see documentation
|
||||
for a class method in the generated documentation, the class itself
|
||||
probably needs documentation.
|
||||
|
||||
Now it's just a matter of understanding the code, and writing some
|
||||
docs!
|
||||
|
||||
|
||||
|
||||
|ns3| Specifics
|
||||
===============
|
||||
|
||||
As for Sphinx, the Doxygen docs_ and reference_ are pretty good.
|
||||
We won't duplicate the basics here, instead focusing on preferred
|
||||
usage for |ns3|.
|
||||
|
||||
.. _docs: http://www.stack.nl/~dimitri/doxygen/index.html
|
||||
.. _reference: http://www.stack.nl/~dimitri/doxygen/manual/commands.html
|
||||
|
||||
|
||||
* Use Doxygen ``Modules`` to group related items.
|
||||
|
||||
In the main header for a module, create a Doxgyen group::
|
||||
|
||||
/**
|
||||
* \defgroup foo Foo protocol.
|
||||
* Implemenation of the Foo protocol.
|
||||
*/
|
||||
|
||||
The symbol ``foo`` is how other items can add themselves to this group.
|
||||
The string following that will be the title for the group. Any futher
|
||||
text will be the detailed description for the group page.
|
||||
|
||||
* Document each file, assigning it to the relevant group. In a header file::
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup foo
|
||||
* Class Foo declaration.
|
||||
*/
|
||||
|
||||
or in the corresponding ``.cc`` file::
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup foo
|
||||
* Class FooBar implementation.
|
||||
*/
|
||||
|
||||
* Mark each associated class as belonging to the group::
|
||||
|
||||
/**
|
||||
* \ingroup foo
|
||||
*
|
||||
* FooBar packet type.
|
||||
*/
|
||||
class FooBar
|
||||
|
||||
* Did you know ``typedefs`` can have formal arguments? This enables
|
||||
documentation of function pointer signatures::
|
||||
|
||||
/**
|
||||
* Bar callback function signature.
|
||||
*
|
||||
* \param ale The size of a pint of ale, in Imperial ounces.
|
||||
*/
|
||||
typedef void (* BarCallback)(const int ale);
|
||||
|
||||
* Copy the ``Attribute`` help strings from the ``GetTypeId`` method to use
|
||||
as the brief descriptions of associated members.
|
||||
|
||||
* ``\bugid{298}`` will create a link to bug 298 in our Bugzilla.
|
||||
|
||||
* ``\p foo`` in a description will format ``foo``
|
||||
the same as the ``\param foo`` parameter, making it clear that you
|
||||
are referring to an actual argument.
|
||||
|
||||
* ``\RFC{301}`` will create a link to RFC 301.
|
||||
|
||||
* Document the direction of function arguments with ``\param [in]``, *etc*.
|
||||
The allowed values of the direction token are ``[in]``, ``[out]``, and
|
||||
``[in,out]`` (note the explicit square brackets), as discussed in the
|
||||
Doxygen docs for ``\param``.
|
||||
|
||||
* Document template arguments with ``\tparam``, just as you use ``\param``
|
||||
for function arguments.
|
||||
|
||||
* For template arguments, indicate if they will be deduced or must be given
|
||||
explicitly::
|
||||
|
||||
/**
|
||||
* A templated function.
|
||||
* \tparam T \explicit The return type.
|
||||
* \tparam U \deduced The argument type.
|
||||
* \param [in] a The argument.
|
||||
*/
|
||||
template <typename T, typename U> T Function (U a);
|
||||
|
||||
* Use ``\tparam U \deduced`` because the type ``U`` can be deduced at
|
||||
the site where the template is invoked. Basically deduction can only
|
||||
be done for function arguments.
|
||||
|
||||
* Use ``\tparam T \explicit`` because the type ``T`` can't be deduced;
|
||||
it must be given explicitly at the invocation site.
|
||||
|
||||
* ``\internal`` should be used only to set off a discussion of implementation
|
||||
details, not to mark ``private`` functions (they are already marked,
|
||||
as ``private``!)
|
||||
|
||||
* Don't create classes with trivial names, such as ``class A``,
|
||||
even in test suites. These cause all instances of the class name
|
||||
literal \`A' to be rendered as links.
|
||||
|
||||
|
||||
As noted above, static functions don't inherit the documentation
|
||||
of the same functions in the parent class. |ns3| uses a few static
|
||||
functions ubiquitously; the suggested documentation block for these
|
||||
cases is:
|
||||
|
||||
* Default constructor/destructor::
|
||||
|
||||
MyClass (); //!< Default constructor
|
||||
~MyClass (); //!< Destructor
|
||||
|
||||
* Dummy destructor and DoDispose::
|
||||
|
||||
/** Dummy destructor, see DoDispose. */
|
||||
~MyClass ();
|
||||
|
||||
/** Destructor implementation */
|
||||
virtual void DoDispose ();
|
||||
|
||||
* GetTypeId::
|
||||
|
||||
/**
|
||||
* Register this type.
|
||||
* \return The object TypeId.
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ available in five forms:
|
||||
|
||||
* `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentation of the public APIs of the simulator
|
||||
* Tutorial, Manual *(this document)*, and Model Library for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/Main_Page>`_
|
||||
|
||||
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
|
||||
``doc/manual`` directory of ns-3's source code.
|
||||
Contents
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
@@ -34,3 +34,10 @@ This document is written in `reStructuredText <http://docutils.sourceforge.net/r
|
||||
python
|
||||
tests
|
||||
support
|
||||
|
||||
Source
|
||||
------
|
||||
|
||||
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
|
||||
``doc/manual`` directory of ns-3's source code.
|
||||
|
||||
|
||||
+353
-83
@@ -22,16 +22,14 @@ the same over time. Users are cautioned against building simulation output
|
||||
frameworks on top of logging code, as the output and the way the output
|
||||
is enabled may change over time.
|
||||
|
||||
Logging overview
|
||||
****************
|
||||
Overview
|
||||
********
|
||||
|
||||
|ns3| logging statements are typically used to log various program
|
||||
execution events, such as the occurrence of simulation events or the
|
||||
use of a particular function.
|
||||
|
||||
For example, this code snippet is from ``Ipv4L3Protocol::IsDestinationAddress()``:
|
||||
|
||||
::
|
||||
For example, this code snippet is from ``Ipv4L3Protocol::IsDestinationAddress()``::
|
||||
|
||||
if (address == iaddr.GetBroadcast ())
|
||||
{
|
||||
@@ -39,71 +37,33 @@ For example, this code snippet is from ``Ipv4L3Protocol::IsDestinationAddress()`
|
||||
return true;
|
||||
}
|
||||
|
||||
If logging has been enabled for the ``Ipv4L3Protocol`` component at a level
|
||||
of ``LOGIC`` or above (see below about logging levels), the statement
|
||||
If logging has been enabled for the ``Ipv4L3Protocol`` component at a severity
|
||||
of ``LOGIC`` or above (see below about log severity), the statement
|
||||
will be printed out; otherwise, it will be suppressed.
|
||||
|
||||
Logging levels
|
||||
==============
|
||||
Enabling Output
|
||||
===============
|
||||
|
||||
The following levels are defined; each level will enable the levels above
|
||||
it, with the ``ALL`` level being most verbose:
|
||||
|
||||
#. ``LOG_NONE``: the default, no logging
|
||||
#. ``LOG_ERROR``: serious error messages only
|
||||
#. ``LOG_WARN``: warning messages
|
||||
#. ``LOG_DEBUG``: for use in debugging
|
||||
#. ``LOG_FUNCTION``: function tracing
|
||||
#. ``LOG_LOGIC``: control flow tracing within functions
|
||||
#. ``LOG_ALL``: print everything
|
||||
|
||||
A special logging level will cause logging output to unconditionally
|
||||
appear on ``std::clog``, regardless of whether the user has explicitly enabled
|
||||
logging.
|
||||
This macro, ``NS_LOG_UNCOND()``, can be used like a kind of ``printf()`` in
|
||||
your code. An example can be found in ``scratch/scratch-simulator.cc``:
|
||||
|
||||
::
|
||||
|
||||
NS_LOG_UNCOND ("Scratch Simulator");
|
||||
|
||||
Logging prefixes
|
||||
================
|
||||
|
||||
This section still needs documentation; bug 1496 is open on this:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="*=all|prefix_all" ./waf --run scratch-simulator
|
||||
Scratch Simulator
|
||||
ScratchSimulator:main(): [ERROR] error message
|
||||
ScratchSimulator:main(): [WARN] warn message
|
||||
ScratchSimulator:main(): [DEBUG] debug message
|
||||
ScratchSimulator:main(): [INFO] info message
|
||||
ScratchSimulator:main(function)
|
||||
ScratchSimulator:main(): [LOGIC] logic message
|
||||
|
||||
Enabling logging output
|
||||
=======================
|
||||
|
||||
There are two ways that users typically control logging output. The
|
||||
first is by setting an ``NS_LOG`` environment variable; e.g.:
|
||||
There are two ways that users typically control log output. The
|
||||
first is by setting the ``NS_LOG`` environment variable; e.g.:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="*" ./waf --run first
|
||||
|
||||
will run the first tutorial program with all logging output. This can
|
||||
be made more granular by selecting individual components:
|
||||
will run the ``first`` tutorial program with all logging output. (The
|
||||
specifics of the ``NS_LOG`` format will be discussed below.)
|
||||
|
||||
This can be made more granular by selecting individual components:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="Ipv4L3Protocol" ./waf --run first
|
||||
|
||||
The second way to enable this is to use explicit statements in your
|
||||
program, such as in the first tutorial program:
|
||||
|
||||
::
|
||||
The output can be further tailored with prefix options.
|
||||
|
||||
The second way to enable logging is to use explicit statements in your
|
||||
program, such as in the ``first`` tutorial program::
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
@@ -112,48 +72,358 @@ program, such as in the first tutorial program:
|
||||
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
...
|
||||
|
||||
Some helpers have special methods to enable the logging of all components
|
||||
in a module (across different compilation units, but logically grouped
|
||||
together such as the |ns3| wifi code:
|
||||
(The meaning of ``LOG_LEVEL_INFO``, and other possible values,
|
||||
will be discussed below.)
|
||||
|
||||
::
|
||||
``NS_LOG`` Syntax
|
||||
=================
|
||||
|
||||
The ``NS_LOG`` environment variable contains a list of log components
|
||||
and options. Log components are separated by \`:' characters:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="<log-component>:<log-component>..."
|
||||
|
||||
Options for each log component are given as flags after
|
||||
each log component:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="<log-component>=<option>|<option>...:<log-component>..."
|
||||
|
||||
Options control the severity and level for that component,
|
||||
and whether optional information should be included, such as the
|
||||
simulation time, simulation node, function name, and the symbolic severity.
|
||||
|
||||
Log Components
|
||||
==============
|
||||
|
||||
Generally a log component refers to a single source code ``.cc`` file,
|
||||
and encompasses the entire file.
|
||||
|
||||
Some helpers have special methods to enable the logging of all components
|
||||
in a module, spanning different compilation units, but logically grouped
|
||||
together, such as the |ns3| wifi code::
|
||||
|
||||
WifiHelper wifiHelper;
|
||||
wifiHelper.EnableLogComponents ();
|
||||
|
||||
The ``NS_LOG`` log component wildcard \`*' will enable all components.
|
||||
|
||||
To see what log components are defined, any of these will work:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="print-list" ./waf --run ...
|
||||
|
||||
$ NS_LOG="foo" # a token not matching any log-component
|
||||
|
||||
The first form will print the name and enabled flags for all log components
|
||||
which are linked in; try it with ``scratch-simulator``.
|
||||
The second form prints all registered log components,
|
||||
then exit with an error.
|
||||
|
||||
|
||||
Severity and Level Options
|
||||
==========================
|
||||
|
||||
Individual messages belong to a single "severity class," set by the macro
|
||||
creating the message. In the example above,
|
||||
``NS_LOG_LOGIC(..)`` creates the message in the ``LOG_LOGIC`` severity class.
|
||||
|
||||
The following severity classes are defined as ``enum`` constants:
|
||||
|
||||
================ =====================================
|
||||
Severity Class Meaning
|
||||
================ =====================================
|
||||
``LOG_NONE`` The default, no logging
|
||||
``LOG_ERROR`` Serious error messages only
|
||||
``LOG_WARN`` Warning messages
|
||||
``LOG_DEBUG`` For use in debugging
|
||||
``LOG_INFO`` Informational
|
||||
``LOG_FUNCTION`` Function tracing
|
||||
``LOG_LOGIC`` Control flow tracing within functions
|
||||
================ =====================================
|
||||
|
||||
Typically one wants to see messages at a given severity class *and higher*.
|
||||
This is done by defining inclusive logging "levels":
|
||||
|
||||
====================== ===========================================
|
||||
Level Meaning
|
||||
====================== ===========================================
|
||||
``LOG_LEVEL_ERROR`` Only ``LOG_ERROR`` severity class messages.
|
||||
``LOG_LEVEL_WARN`` ``LOG_WARN`` and above.
|
||||
``LOG_LEVEL_DEBUG`` ``LOG_DEBUG`` and above.
|
||||
``LOG_LEVEL_INFO`` ``LOG_INFO`` and above.
|
||||
``LOG_LEVEL_FUNCTION`` ``LOG_FUNCTION`` and above.
|
||||
``LOG_LEVEL_LOGIC`` ``LOG_LOGIC`` and above.
|
||||
``LOG_LEVEL_ALL`` All severity classes.
|
||||
``LOG_ALL`` Synonym for ``LOG_LEVEL_ALL``
|
||||
====================== ===========================================
|
||||
|
||||
The severity class and level options can be given in the ``NS_LOG``
|
||||
environment variable by these tokens:
|
||||
|
||||
============ =================
|
||||
Class Level
|
||||
============ =================
|
||||
``error`` ``level_error``
|
||||
``warn`` ``level_warn``
|
||||
``debug`` ``level_debug``
|
||||
``info`` ``level_info``
|
||||
``function`` ``level_function``
|
||||
``logic`` ``level_logic``
|
||||
.. | ``level_all``
|
||||
| ``all``
|
||||
| ``*``
|
||||
============ =================
|
||||
|
||||
Using a severity class token enables log messages at that severity only.
|
||||
For example, ``NS_LOG="*=warn"`` won't output messages with severity ``error``.
|
||||
``NS_LOG="*=level_debug"`` will output messages at severity levels
|
||||
``debug`` and above.
|
||||
|
||||
Severity classes and levels can be combined with the \`|' operator:
|
||||
``NS_LOG="*=level_warn|logic"`` will output messages at severity levels
|
||||
``error``, ``warn`` and ``logic``.
|
||||
|
||||
The ``NS_LOG`` severity level wildcard \`*' and ``all``
|
||||
are synonyms for ``level_all``.
|
||||
|
||||
For log components merely mentioned in ``NS_LOG``
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="<log-component>:..."
|
||||
|
||||
the default severity is ``LOG_LEVEL_ALL``.
|
||||
|
||||
|
||||
Prefix Options
|
||||
==============
|
||||
|
||||
A number of prefixes can help identify
|
||||
where and when a message originated, and at what severity.
|
||||
|
||||
The available prefix options (as ``enum`` constants) are
|
||||
|
||||
====================== ===========================================
|
||||
Prefix Symbol Meaning
|
||||
====================== ===========================================
|
||||
``LOG_PREFIX_FUNC`` Prefix the name of the calling function.
|
||||
``LOG_PREFIX_TIME`` Prefix the simulation time.
|
||||
``LOG_PREFIX_NODE`` Prefix the node id.
|
||||
``LOG_PREFIX_LEVEL`` Prefix the severity level.
|
||||
``LOG_PREFIX_ALL`` Enable all prefixes.
|
||||
====================== ===========================================
|
||||
|
||||
The prefix options are described briefly below.
|
||||
|
||||
The options can be given in the ``NS_LOG``
|
||||
environment variable by these tokens:
|
||||
|
||||
================ =========
|
||||
Token Alternate
|
||||
================ =========
|
||||
``prefix_func`` ``func``
|
||||
``prefix_time`` ``time``
|
||||
``prefix_node`` ``node``
|
||||
``prefix_level`` ``level``
|
||||
``prefix_all`` | ``all``
|
||||
| ``*``
|
||||
================ =========
|
||||
|
||||
For log components merely mentioned in ``NS_LOG``
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="<log-component>:..."
|
||||
|
||||
the default prefix options are ``LOG_PREFIX_ALL``.
|
||||
|
||||
Severity Prefix
|
||||
###############
|
||||
|
||||
The severity class of a message can be included with the options
|
||||
``prefix_level`` or ``level``. For example, this value of ``NS_LOG``
|
||||
enables logging for all log components (\`*') and all severity
|
||||
classes (``=all``), and prefixes the message with the severity
|
||||
class (``|prefix_level``).
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="*=all|prefix_level" ./waf --run scratch-simulator
|
||||
Scratch Simulator
|
||||
[ERROR] error message
|
||||
[WARN] warn message
|
||||
[DEBUG] debug message
|
||||
[INFO] info message
|
||||
[FUNCT] function message
|
||||
[LOGIC] logic message
|
||||
|
||||
Time Prefix
|
||||
###########
|
||||
|
||||
The simulation time can be included with the options
|
||||
``prefix_time`` or ``time``. This prints the simulation time in seconds.
|
||||
|
||||
Node Prefix
|
||||
###########
|
||||
|
||||
The simulation node id can be included with the options
|
||||
``prefix_node`` or ``node``.
|
||||
|
||||
Function Prefix
|
||||
###############
|
||||
|
||||
The name of the calling function can be included with the options
|
||||
``prefix_func`` or ``func``.
|
||||
|
||||
|
||||
``NS_LOG`` Wildcards
|
||||
####################
|
||||
|
||||
The log component wildcard \`*' will enable all components. To
|
||||
enable all components at a specific severity level
|
||||
use ``*=<severity>``.
|
||||
|
||||
The severity level option wildcard \`*' is a synonym for ``all``.
|
||||
This must occur before any \`|' characters separating options.
|
||||
To enable all severity classes, use ``<log-component>=*``,
|
||||
or ``<log-component>=*|<options>``.
|
||||
|
||||
The option wildcard \`*' or token ``all`` enables all prefix options,
|
||||
but must occur *after* a \`|' character. To enable a specific
|
||||
severity class or level, and all prefixes, use
|
||||
``<log-component>=<severity>|*``.
|
||||
|
||||
The combined option wildcard ``**`` enables all severities and all prefixes;
|
||||
for example, ``<log-component>=**``.
|
||||
|
||||
The uber-wildcard ``***`` enables all severities and all prefixes
|
||||
for all log components. These are all equivalent:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ NS_LOG="***" ... $ NS_LOG="*=all|*" ... $ NS_LOG="*=*|all" ...
|
||||
$ NS_LOG="*=**" ... $ NS_LOG="*=level_all|*" ... $ NS_LOG="*=*|prefix_all" ...
|
||||
$ NS_LOG="*=*|*" ...
|
||||
|
||||
Be advised: even the trivial ``scratch-simulator`` produces over
|
||||
46K lines of output with ``NS_LOG="***"``!
|
||||
|
||||
|
||||
How to add logging to your code
|
||||
*******************************
|
||||
|
||||
To add logging to your code, please follow the below steps:
|
||||
Adding logging to your code is very simple:
|
||||
|
||||
1) Put ``NS_LOG_COMPONENT_DEFINE`` macro outside of namespace ns3
|
||||
1. Invoke the ``NS_LOG_COMPONENT_DEFINE (...);`` macro
|
||||
inside of ``namespace ns3``.
|
||||
|
||||
Create a unique string identifier (usually based on the name of the file
|
||||
and/or class defined within the file) and register it with a macro call
|
||||
such as follows:
|
||||
Create a unique string identifier (usually based on the name of the file
|
||||
and/or class defined within the file) and register it with a macro call
|
||||
such as follows:
|
||||
|
||||
::
|
||||
::
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Ipv4L3Protocol");
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Ipv4L3Protocol");
|
||||
...
|
||||
|
||||
namespace ns3 {
|
||||
...
|
||||
This registers ``Ipv4L3Protocol`` as a log component.
|
||||
|
||||
The macro was carefully written to permit inclusion either within or
|
||||
outside of namespace ``ns3``, and usage will vary across the codebase, but
|
||||
the original intent was to register this *outside* of namespace ``ns3``.
|
||||
(The macro was carefully written to permit inclusion either within or
|
||||
outside of namespace ``ns3``, and usage will vary across the codebase, but
|
||||
the original intent was to register this *outside* of namespace ``ns3``
|
||||
at file global scope.)
|
||||
|
||||
2. Add logging statements (macro calls) to your functions and function bodies.
|
||||
|
||||
Logging Macros
|
||||
==============
|
||||
|
||||
The logging macros and associated severity levels are
|
||||
|
||||
================ ==========================
|
||||
Severity Class Macro
|
||||
================ ==========================
|
||||
``LOG_NONE`` (none needed)
|
||||
``LOG_ERROR`` ``NS_LOG_ERROR (...);``
|
||||
``LOG_WARN`` ``NS_LOG_WARN (...);``
|
||||
``LOG_DEBUG`` ``NS_LOG_DEBUG (...);``
|
||||
``LOG_INFO`` ``NS_LOG_INFO (...);``
|
||||
``LOG_FUNCTION`` ``NS_LOG_FUNCTION (...);``
|
||||
``LOG_LOGIC`` ``NS_LOG_LOGIC (...);``
|
||||
================ ==========================
|
||||
|
||||
The macros function as output streamers, so anything you can send to
|
||||
``std::cout``, joined by ``<<`` operators, is allowed::
|
||||
|
||||
void MyClass::Check (int value, char * item)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << arg << item);
|
||||
if (arg > 10)
|
||||
{
|
||||
NS_LOG_ERROR ("encountered bad value " << value <<
|
||||
" while checking " << name << "!");
|
||||
}
|
||||
...
|
||||
}
|
||||
|
||||
Note that ``NS_LOG_FUNCTION`` automatically inserts a \`\ :literal:`,\ `'
|
||||
(comma-space) separator between each of its arguments.
|
||||
This simplifies logging of function arguments;
|
||||
just concatenate them with ``<<`` as in the example above.
|
||||
|
||||
Unconditional Logging
|
||||
=====================
|
||||
|
||||
As a convenience, the ``NS_LOG_UNCOND (...);`` macro will always log its
|
||||
arguments, even if the associated log-component is not enabled at any
|
||||
severity. This macro does not use any of the prefix options. Note that
|
||||
logging is only enabled in debug builds; this macro won't produce
|
||||
output in optimized builds.
|
||||
|
||||
|
||||
Guidelines
|
||||
==========
|
||||
|
||||
* Start every class method with ``NS_LOG_FUNCTION (this << args...);``
|
||||
This enables easy function call tracing.
|
||||
|
||||
* Except: don't log operators or explicit copy constructors,
|
||||
since these will cause infinite recursion and stack overflow.
|
||||
|
||||
* For methods without arguments use the same form:
|
||||
``NS_LOG_FUNCTION (this);``
|
||||
|
||||
* For static functions:
|
||||
|
||||
* With arguments use ``NS_LOG_FUNCTION (...);`` as normal.
|
||||
* Without arguments use ``NS_LOG_FUNCTION_NOARGS ();``
|
||||
|
||||
* Use ``NS_LOG_ERROR`` for serious error conditions that probably
|
||||
invalidate the simulation execution.
|
||||
|
||||
* Use ``NS_LOG_WARN`` for unusual conditions that may be correctable.
|
||||
Please give some hints as to the nature of the problem and how
|
||||
it might be corrected.
|
||||
|
||||
* ``NS_LOG_DEBUG`` is usually used in an *ad hoc* way to understand
|
||||
the execution of a model.
|
||||
|
||||
* Use ``NS_LOG_INFO`` for additional information about the execution,
|
||||
such as the size of a data structure when adding/removing from it.
|
||||
|
||||
* Use ``NS_LOG_LOGIC`` to trace important logic branches within a function.
|
||||
|
||||
* Test that your logging changes do not break the code.
|
||||
Run some example programs with all log components turned on (e.g.
|
||||
``NS_LOG="***"``).
|
||||
|
||||
2) Add logging statements to your functions and function bodies.
|
||||
|
||||
There are a couple of guidelines on this:
|
||||
|
||||
* Do *not* add function logging in operators or explicit copy constructors,
|
||||
since these will cause infinite recursion and stack overflow.
|
||||
* Use the ``NS_LOG_FUNCTION_NOARGS()`` variant for static methods *only*. When
|
||||
a non-static member function has no arguments, it should be logged by
|
||||
``NS_LOG_FUNCTION (this)`` macro.
|
||||
* Make sure that you test that your logging changes do not break the code;
|
||||
running some example programs with all log components turned on (e.g.
|
||||
``NS_LOG="*"``) is one way to test this.
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.. include:: replace.txt
|
||||
.. highlight:: cpp
|
||||
|
||||
Creating a new ns-3 model
|
||||
-------------------------
|
||||
Creating a new |ns3| model
|
||||
--------------------------
|
||||
|
||||
This chapter walks through the design process of an |ns3| model. In many
|
||||
research cases, users will not be satisfied to merely adapt existing models, but
|
||||
@@ -11,7 +11,16 @@ example of adding an ErrorModel to a simple |ns3| link as a motivating example
|
||||
of how one might approach this problem and proceed through a design and
|
||||
implementation.
|
||||
|
||||
Design-approach
|
||||
.. note:: Documentation
|
||||
|
||||
Here we focus on the process of creating new models
|
||||
and new modules, and some of the design choices involved.
|
||||
For the sake of clarity, we defer discussion of the
|
||||
*mechanics* of documenting models and source code to the
|
||||
:doc:`Documentation <documentation>` chapter.
|
||||
|
||||
|
||||
Design Approach
|
||||
***************
|
||||
|
||||
Consider how you want it to work; what should it do. Think about these things:
|
||||
@@ -26,13 +35,13 @@ Consider how you want it to work; what should it do. Think about these things:
|
||||
should I avoid any dependence on IPv4 if I want it to also be used by IPv6?
|
||||
Should I avoid any dependency on IP at all?
|
||||
|
||||
Do not be hesitant to contact the ns-3-users or ns-developers list if you have
|
||||
Do not be hesitant to contact the `ns-3-users` or `ns-developers` list if you have
|
||||
questions. In particular, it is important to think about the public API of your
|
||||
new model and ask for feedback. It also helps to let others know of your work in
|
||||
case you are interested in collaborators.
|
||||
|
||||
Example: ErrorModel
|
||||
+++++++++++++++++++
|
||||
Example: `ErrorModel`
|
||||
+++++++++++++++++++++
|
||||
|
||||
An error model exists in |ns2|. It allows packets to be passed to a stateful
|
||||
object that determines, based on a random variable, whether the packet is
|
||||
@@ -44,7 +53,7 @@ return value of this function is a boolean that tells the caller whether any
|
||||
corruption occurred. Note that depending on the error model, the packet data
|
||||
buffer may or may not be corrupted. Let's call this function "IsCorrupt()".
|
||||
|
||||
So far, in our design, we have:::
|
||||
So far, in our design, we have::
|
||||
|
||||
class ErrorModel
|
||||
{
|
||||
@@ -95,7 +104,7 @@ a user to force errors on otherwise successful packet transmissions, at the
|
||||
NetDevice level.
|
||||
|
||||
After some thinking and looking at existing |ns2| code, here is a sample API of
|
||||
a base class and first subclass that could be posted for initial review:::
|
||||
a base class and first subclass that could be posted for initial review::
|
||||
|
||||
class ErrorModel
|
||||
{
|
||||
@@ -158,16 +167,16 @@ your model since if you follow the error model verbatim, the code you produce
|
||||
will collide with the existing error model. The below is just an outline of how
|
||||
ErrorModel was built that you can adapt to other models.
|
||||
|
||||
Review the ns-3 coding style document
|
||||
+++++++++++++++++++++++++++++++++++++
|
||||
Review the |ns3| Coding Style Document
|
||||
++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
At this point, you may want to pause and read the |ns3| coding style document,
|
||||
especially if you are considering to contribute your code back to the project.
|
||||
The coding style document is linked off the main project page: `ns-3 coding
|
||||
style <http://www.nsnam.org/developers/contributing-code/coding-style/>`_.
|
||||
|
||||
Decide where in the source tree the model will reside in
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
Decide Where in the Source Tree the Model Should Reside
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
All of the |ns3| model source code is in the directory ``src/``. You will need
|
||||
to choose which subdirectory it resides in. If it is new model code of some
|
||||
@@ -178,8 +187,8 @@ In the case of the error model, it is very related to the packet class, so it
|
||||
makes sense to implement this in the ``src/network/`` module where |ns3|
|
||||
packets are implemented.
|
||||
|
||||
waf and wscript
|
||||
+++++++++++++++
|
||||
`waf` and `wscript`
|
||||
+++++++++++++++++++
|
||||
|
||||
|ns3| uses the `Waf <http://www.freehackers.org/~tnagy/waf.html>`_ build system.
|
||||
You will want to integrate your new |ns3| uses the Waf build system. You will
|
||||
@@ -193,7 +202,7 @@ rest of the source files, and the .h file to the list of the header files.
|
||||
Now, pop up to the top level directory and type "./test.py". You
|
||||
shouldn't have broken anything by this operation.
|
||||
|
||||
include guards
|
||||
Include Guards
|
||||
++++++++++++++
|
||||
|
||||
Next, let's add some `include guards
|
||||
@@ -204,8 +213,8 @@ Next, let's add some `include guards
|
||||
...
|
||||
#endif
|
||||
|
||||
namespace ns3
|
||||
+++++++++++++
|
||||
`namespace ns3`
|
||||
+++++++++++++++
|
||||
|
||||
|ns3| uses the |ns3| `namespace
|
||||
<http://en.wikipedia.org/wiki/Namespace_(computer_science)#Use_in_common_languages>`_
|
||||
@@ -217,7 +226,7 @@ an |ns3| namespace block in both the cc and h file.::
|
||||
}
|
||||
|
||||
At this point, we have some skeletal files in which we can start defining
|
||||
our new classes. The header file looks like this:::
|
||||
our new classes. The header file looks like this::
|
||||
|
||||
#ifndef ERROR_MODEL_H
|
||||
#define ERROR_MODEL_H
|
||||
@@ -227,7 +236,7 @@ our new classes. The header file looks like this:::
|
||||
} // namespace ns3
|
||||
#endif
|
||||
|
||||
while the ``error-model.cc`` file simply looks like this:::
|
||||
while the ``error-model.cc`` file simply looks like this::
|
||||
|
||||
#include "error-model.h"
|
||||
|
||||
@@ -244,8 +253,8 @@ Initial Implementation
|
||||
At this point, we're still working on some scaffolding, but we can begin to
|
||||
define our classes, with the functionality to be added later.
|
||||
|
||||
use of class Object?
|
||||
++++++++++++++++++++
|
||||
Inherit from the `Object` Class?
|
||||
++++++++++++++++++++++++++++++++
|
||||
|
||||
This is an important design step; whether to use class :cpp:class:`Object` as a
|
||||
base class for your new classes.
|
||||
@@ -268,7 +277,7 @@ In our case, we want to make use of the attribute system, and we will be passing
|
||||
instances of this object across the |ns3| public API, so class
|
||||
:cpp:class:`Object` is appropriate for us.
|
||||
|
||||
initial classes
|
||||
Initial Classes
|
||||
+++++++++++++++
|
||||
|
||||
One way to proceed is to start by defining the bare minimum functions and see if
|
||||
@@ -332,6 +341,7 @@ file.::
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::ErrorModel")
|
||||
.SetParent<Object> ()
|
||||
.SetGroupName ("Network")
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
@@ -350,6 +360,7 @@ file.::
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::RateErrorModel")
|
||||
.SetParent<ErrorModel> ()
|
||||
.SetGroupName ("Network")
|
||||
.AddConstructor<RateErrorModel> ()
|
||||
;
|
||||
return tid;
|
||||
@@ -374,28 +385,28 @@ every class that defines a new GetTypeId method, and it does the actual
|
||||
registration of the class into the system. The :ref:`Object-model` chapter
|
||||
discusses this in more detail.
|
||||
|
||||
how to include files from elsewhere
|
||||
+++++++++++++++++++++++++++++++++++
|
||||
Including External Files
|
||||
++++++++++++++++++++++++
|
||||
|
||||
log component
|
||||
+++++++++++++
|
||||
Logging Support
|
||||
+++++++++++++++
|
||||
|
||||
*Here, write a bit about adding |ns3| logging macros. Note that
|
||||
LOG_COMPONENT_DEFINE is done outside the namespace ns3*
|
||||
|
||||
constructor, empty function prototypes
|
||||
Constructor, Empty Function Prototypes
|
||||
++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
key variables (default values, attributes)
|
||||
Key Variables (Default Values, Attributes)
|
||||
++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
test program 1
|
||||
Test Program 1
|
||||
++++++++++++++
|
||||
|
||||
Object Framework
|
||||
++++++++++++++++
|
||||
|
||||
Adding-a-sample-script
|
||||
Adding a Sample Script
|
||||
**********************
|
||||
|
||||
At this point, one may want to try to take the basic scaffolding defined above
|
||||
@@ -404,7 +415,7 @@ model when plumbing into the system and may also reveal whether any design or
|
||||
API modifications need to be made. Once this is done, we will return to building
|
||||
out the functionality of the ErrorModels themselves.
|
||||
|
||||
Add basic support in the class
|
||||
Add Basic Support in the Class
|
||||
++++++++++++++++++++++++++++++
|
||||
|
||||
::
|
||||
@@ -435,7 +446,7 @@ Add Accessor
|
||||
MakePointerAccessor (&PointToPointNetDevice::m_receiveErrorModel),
|
||||
MakePointerChecker<ErrorModel> ())
|
||||
|
||||
Plumb into the system
|
||||
Plumb Into the System
|
||||
+++++++++++++++++++++
|
||||
|
||||
::
|
||||
@@ -469,7 +480,7 @@ Plumb into the system
|
||||
}
|
||||
}
|
||||
|
||||
Create null functional script
|
||||
Create Null Functional Script
|
||||
+++++++++++++++++++++++++++++
|
||||
|
||||
::
|
||||
@@ -499,8 +510,8 @@ the receive path of the PointToPointNetDevice. It prints out the string
|
||||
"Corrupt!" for each packet received at node n3. Next, we return to the error
|
||||
model to add in a subclass that performs more interesting error modeling.
|
||||
|
||||
Add subclass
|
||||
************
|
||||
Add a Subclass
|
||||
**************
|
||||
|
||||
The trivial base class ErrorModel does not do anything interesting, but it
|
||||
provides a useful base class interface (Corrupt () and Reset ()), forwarded to
|
||||
@@ -523,7 +534,7 @@ Here are a few simple requirements we will consider:
|
||||
of granularity.
|
||||
* Ability to enable/disable (default is enabled)
|
||||
|
||||
How to subclass
|
||||
How to Subclass
|
||||
+++++++++++++++
|
||||
|
||||
We declare BasicErrorModel to be a subclass of ErrorModel as follows,::
|
||||
@@ -541,21 +552,22 @@ We declare BasicErrorModel to be a subclass of ErrorModel as follows,::
|
||||
}
|
||||
|
||||
and configure the subclass GetTypeId function by setting a unique TypeId string
|
||||
and setting the Parent to ErrorModel:::
|
||||
and setting the Parent to ErrorModel::
|
||||
|
||||
TypeId RateErrorModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::RateErrorModel")
|
||||
.SetParent<ErrorModel> ()
|
||||
.SetGroupName ("Network")
|
||||
.AddConstructor<RateErrorModel> ()
|
||||
...
|
||||
|
||||
Build-core-functions-and-unit-tests
|
||||
Build Core Functions and Unit Tests
|
||||
***********************************
|
||||
|
||||
assert macros
|
||||
Assert Macros
|
||||
+++++++++++++
|
||||
|
||||
Writing unit tests
|
||||
Writing Unit Tests
|
||||
++++++++++++++++++
|
||||
|
||||
|
||||
+204
-178
@@ -11,14 +11,15 @@ used with existing |ns3| modules and by other researchers.
|
||||
This chapter walks you through the steps necessary to add a new module
|
||||
to |ns3|.
|
||||
|
||||
Step 1 - Familiarize yourself with the module layout
|
||||
****************************************************
|
||||
.. _Step-0:
|
||||
|
||||
Step 0 - Module Layout
|
||||
**********************
|
||||
|
||||
All modules can be found in the ``src`` directory. Each module can be
|
||||
found in a directory that has the same name as the module. For
|
||||
example, the spectrum module can be found here: ::
|
||||
|
||||
src/spectrum
|
||||
example, the ``spectrum`` module can be found here: ``src/spectrum``.
|
||||
We'll be quoting from the ``spectrum`` module for illustration.
|
||||
|
||||
A prototypical module has the following directory structure and
|
||||
required files:
|
||||
@@ -26,129 +27,164 @@ required files:
|
||||
.. sourcecode:: text
|
||||
|
||||
src/
|
||||
module-name/
|
||||
bindings/
|
||||
doc/
|
||||
examples/
|
||||
wscript
|
||||
helper/
|
||||
model/
|
||||
test/
|
||||
examples-to-run.py
|
||||
wscript
|
||||
module-name/
|
||||
bindings/
|
||||
doc/
|
||||
examples/
|
||||
wscript
|
||||
helper/
|
||||
model/
|
||||
test/
|
||||
examples-to-run.py
|
||||
wscript
|
||||
|
||||
Not all directories will be present in each module.
|
||||
|
||||
Step 2 - Create your new module based on the template module
|
||||
************************************************************
|
||||
Step 1 - Create a Module Skeleton
|
||||
*********************************
|
||||
|
||||
A python program is provided in the source directory that will create a skeleton for a new module
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ src/create-module.py
|
||||
|
||||
For the purposes of this discussion we will assume that your new module is called "new-module". From the ``src`` directory, do the following to create the new module:
|
||||
A python program is provided in the source directory that
|
||||
will create a skeleton for a new module. For the purposes
|
||||
of this discussion we will assume that your new module
|
||||
is called ``new-module``. From the ``src`` directory, do the following
|
||||
to create the new module:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ ./create-module.py new-module
|
||||
|
||||
Next, cd into ``new-module``; you will find this directory layout:
|
||||
Next, ``cd`` into ``new-module``; you will find this directory layout:
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
$ examples helper model test wscript
|
||||
$ cd new-module
|
||||
$ ls
|
||||
doc examples helper model test wscript
|
||||
|
||||
We next walk through how to customize this module. All |ns3| modules
|
||||
depend on the 'core' module and usually on other modules. This
|
||||
dependency is specified in the wscript file.
|
||||
Let's assume that 'new-module' depends on the internet,
|
||||
mobility, and aodv modules. Then the call to the function that will
|
||||
create this module should look like this before editing:
|
||||
In more detail, the ``create-module.py`` script will create the
|
||||
directories as well as initial skeleton ``wscript``, ``.h``, ``.cc``
|
||||
and ``.rst`` files. The complete module with skeleton files looks like this:
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/
|
||||
new-module/
|
||||
doc/
|
||||
new-module.rst
|
||||
examples/
|
||||
new-module-example.cc
|
||||
wscript
|
||||
helper/
|
||||
new-module-helper.cc
|
||||
new-module-helper.h
|
||||
model/
|
||||
new-module.cc
|
||||
new-module.h
|
||||
test/
|
||||
new-module-test-suite.cc
|
||||
wscript
|
||||
|
||||
(If required the ``bindings/`` directory listed in
|
||||
:ref:`Step-0 <Step-0>` will be created automatically during
|
||||
the build.)
|
||||
|
||||
We next walk through how to customize this module. Informing ``waf``
|
||||
about the files which make up your module is done by editing the two
|
||||
``wscript`` files. We will walk through the main steps in this chapter.
|
||||
|
||||
All |ns3| modules depend on the ``core`` module and usually on
|
||||
other modules. This dependency is specified in the ``wscript`` file
|
||||
(at the top level of the module, not the separate ``wscript`` file
|
||||
in the ``examples`` directory!). In the skeleton ``wscript``
|
||||
the call that will declare your new module to ``waf`` will look
|
||||
like this (before editing):
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
def build(bld):
|
||||
module = bld.create_ns3_module('new-module', ['core'])
|
||||
|
||||
and after editing:
|
||||
Let's assume that ``new-module`` depends on the ``internet``,
|
||||
``mobility``, and ``aodv`` modules. After editing it the ``wscript`` file
|
||||
should look like:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
def build(bld):
|
||||
module = bld.create_ns3_module('new-module', ['internet', 'mobility', 'aodv'])
|
||||
|
||||
Your module will most likely have model source files. Initial skeletons (which will compile successfully) are created in ``model/new-module.cc`` and ``model/new-module.h``.
|
||||
Note that only first level module dependencies should be listed, which
|
||||
is why we removed ``core``; the ``internet`` module in turn depends on
|
||||
``core``.
|
||||
|
||||
If your module will have helper source files, then they will go into the helper/ directory; again, initial skeletons are created in that directory.
|
||||
Your module will most likely have model source files. Initial skeletons
|
||||
(which will compile successfully) are created in ``model/new-module.cc``
|
||||
and ``model/new-module.h``.
|
||||
|
||||
Finally, it is good practice to write tests. A skeleton test suite and test case is created in the test/ directory. The below constructor specifies that it will be a unit test named 'new-module': ::
|
||||
If your module will have helper source files, then they will go into
|
||||
the ``helper/`` directory; again, initial skeletons are created
|
||||
in that directory.
|
||||
|
||||
New-moduleTestSuite::New-moduleTestSuite ()
|
||||
Finally, it is good practice to write tests and examples. These will
|
||||
almost certainly be required for new modules to be accepted into
|
||||
the official |ns3| source tree. A skeleton
|
||||
test suite and test case is created in the ``test/`` directory.
|
||||
The skeleton test suite will contain the below constructor,
|
||||
which declares a new unit test named ``new-module``,
|
||||
with a single test case consisting of the class ``NewModuleTestCase1``::
|
||||
|
||||
NewModuleTestSuite::NewModuleTestSuite ()
|
||||
: TestSuite ("new-module", UNIT)
|
||||
{
|
||||
AddTestCase (new New-moduleTestCase1);
|
||||
AddTestCase (new NewModuleTestCase1);
|
||||
}
|
||||
|
||||
Step 3 - Adding to your module's source files
|
||||
*********************************************
|
||||
Step 3 - Declare Source Files
|
||||
*****************************
|
||||
|
||||
If your new module has model and/or helper source files, then they
|
||||
must be specified in your
|
||||
The public header and source code files for your new module
|
||||
should be specified in the ``wscript`` file by modifying it with
|
||||
your text editor.
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/new-module/wscript
|
||||
|
||||
file by modifying it with your text editor.
|
||||
|
||||
As an example, the source files for the spectrum module are specified
|
||||
in
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/spectrum/wscript
|
||||
|
||||
with the following list of source files:
|
||||
As an example, after declaring the ``spectrum`` module,
|
||||
the ``src/spectrum/wscript`` specifies the source code files
|
||||
with the following list:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
module.source = [
|
||||
'model/spectrum-model.cc',
|
||||
'model/spectrum-value.cc',
|
||||
def build(bld):
|
||||
|
||||
module = bld.create_ns3_module('spectrum', ['internet', 'propagation', 'antenna', 'applications'])
|
||||
|
||||
module.source = [
|
||||
'model/spectrum-model.cc',
|
||||
'model/spectrum-value.cc',
|
||||
.
|
||||
.
|
||||
.
|
||||
'model/microwave-oven-spectrum-value-helper.cc',
|
||||
'helper/spectrum-helper.cc',
|
||||
'helper/adhoc-aloha-noack-ideal-phy-helper.cc',
|
||||
'helper/waveform-generator-helper.cc',
|
||||
'helper/spectrum-analyzer-helper.cc',
|
||||
]
|
||||
'model/microwave-oven-spectrum-value-helper.cc',
|
||||
'helper/spectrum-helper.cc',
|
||||
'helper/adhoc-aloha-noack-ideal-phy-helper.cc',
|
||||
'helper/waveform-generator-helper.cc',
|
||||
'helper/spectrum-analyzer-helper.cc',
|
||||
]
|
||||
|
||||
Step 4 - Specify your module's header files
|
||||
*******************************************
|
||||
The objects resulting from compiling these sources will be assembled
|
||||
into a link library, which will be linked to any programs relying on this
|
||||
module.
|
||||
|
||||
If your new module has model and/or helper header files, then they
|
||||
must be specified in your
|
||||
But how do such programs learn the public API of our new module? Read on!
|
||||
|
||||
.. sourcecode:: text
|
||||
Step 4 - Declare Public Header Files
|
||||
************************************
|
||||
|
||||
src/new-module/wscript
|
||||
The header files defining the public API of your model and helpers
|
||||
also should be specified in the ``wscript`` file.
|
||||
|
||||
file by modifying it with your text editor.
|
||||
|
||||
As an example, the header files for the spectrum module are specified
|
||||
in
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/spectrum/wscript
|
||||
|
||||
with the following function call, module name, and list of header
|
||||
files. Note that the argument for the function new_task_gen() tells
|
||||
waf to install this module's headers with the other |ns3| headers:
|
||||
Continuing with the ``spectrum`` model illustration,
|
||||
the public header files are specified with the following stanza.
|
||||
(Note that the argument to the ``bld`` function tells
|
||||
``waf`` to install this module's headers with the other |ns3| headers):
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
@@ -169,24 +205,29 @@ waf to install this module's headers with the other |ns3| headers:
|
||||
'helper/spectrum-analyzer-helper.h',
|
||||
]
|
||||
|
||||
Step 5 - Specify your module's tests
|
||||
************************************
|
||||
Headers made public in this way will be accessible to users of your model
|
||||
with include statements like
|
||||
|
||||
.. sourcecode:: cpp
|
||||
|
||||
#include "ns3/spectrum-model.h"
|
||||
|
||||
Headers used strictly internally in your implementation should not
|
||||
be included here. They are still accessible to your implemenation by
|
||||
include statements like
|
||||
|
||||
.. sourcecode:: cpp
|
||||
|
||||
#include "my-module-implementation.h"
|
||||
|
||||
|
||||
Step 5 - Declare Tests
|
||||
**********************
|
||||
|
||||
If your new module has tests, then they must be specified in your
|
||||
``wscript`` file by modifying it with your text editor.
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/new-module/wscript
|
||||
|
||||
file by modifying it with your text editor.
|
||||
|
||||
As an example, the tests for the spectrum module are specified in
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/spectrum/wscript
|
||||
|
||||
with the following function call and list of test suites:
|
||||
The ``spectrum`` model tests are specified with the following stanza:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
@@ -197,62 +238,62 @@ with the following function call and list of test suites:
|
||||
'test/spectrum-value-test.cc',
|
||||
]
|
||||
|
||||
See :doc:`Tests <tests>` for more information on how to write test cases.
|
||||
|
||||
Step 6 - Specify your module's examples
|
||||
***************************************
|
||||
Step 6 - Declare Examples
|
||||
*************************
|
||||
|
||||
If your new module has examples, then they must be specified in your
|
||||
``examples/wscript`` file. (The skeleton top-level ``wscript`` will
|
||||
recursively include ``examples/wscript`` only if the examples were
|
||||
enabled at configure time.)
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/new-module/examples/wscript
|
||||
|
||||
file by modifying it with your text editor.
|
||||
|
||||
As an example, the examples for the core module are specified in
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/core/examples/wscript
|
||||
|
||||
The core module's C++ examples are specified using the following
|
||||
function calls and source file names. Note that the second argument
|
||||
for the function ``create_ns3_program()`` is the list of modules that the
|
||||
program being created depends on:
|
||||
The ``spectrum`` model defines it's first example in
|
||||
``src/spectrum/examples/wscript`` with
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
obj = bld.create_ns3_program('main-callback', ['core'])
|
||||
obj.source = 'main-callback.cc'
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('adhoc-aloha-ideal-phy',
|
||||
['spectrum', 'mobility'])
|
||||
obj.source = 'adhoc-aloha-ideal-phy.cc'
|
||||
|
||||
obj = bld.create_ns3_program('sample-simulator', ['core'])
|
||||
obj.source = 'sample-simulator.cc'
|
||||
Note that the second argument to the function ``create_ns3_program()``
|
||||
is the list of modules that the program being created depends on; again,
|
||||
don't forget to include ``new-module`` in the list. It's best practice
|
||||
to list only the direct module dependencies, and let ``waf`` deduce
|
||||
the full dependency tree.
|
||||
|
||||
The core module's Python examples are specified using the following
|
||||
Occasionally, for clarity, you may want to split the implementation
|
||||
for your example among several source files. In this case, just
|
||||
include those files as additional explicit sources of the example:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
obj = bld.create_ns3_program('new-module-example', [new-module])
|
||||
obj.source = ['new-module-example.cc', 'new-module-example-part.cc']
|
||||
|
||||
Python examples are specified using the following
|
||||
function call. Note that the second argument for the function
|
||||
register_ns3_script() is the list of modules that the Python example
|
||||
``register_ns3_script()`` is the list of modules that the Python example
|
||||
depends on:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
bld.register_ns3_script('sample-simulator.py', ['core'])
|
||||
bld.register_ns3_script('new-module-example.py', ['new-module'])
|
||||
|
||||
Step 7 - Specify which of your module's examples should be run as tests
|
||||
***********************************************************************
|
||||
Step 7 - Examples Run as Tests
|
||||
******************************
|
||||
|
||||
The test framework can also be instrumented to run example programs to
|
||||
In addition to running explicit test code, the test framework
|
||||
can also be instrumented to run full example programs to
|
||||
try to catch regressions in the examples. However, not all examples
|
||||
are suitable for regression tests. A file called ``examples-to-run.py``
|
||||
that exists in each module's test directory can control the invocation
|
||||
of the examples when the test framework runs.
|
||||
are suitable for regression tests. The file ``test/examples-to-run.py``
|
||||
controls the invocation of the examples when the test framework runs.
|
||||
|
||||
As an example, the examples that are run by ``test.py`` for the core module are specified in
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
src/core/test/examples-to-run.py
|
||||
|
||||
using the following two lists of C++ and Python examples:
|
||||
The ``spectrum`` model examples run by ``test.py`` are specified in
|
||||
``src/spectrum/test/examples-to-run.py`` using the following
|
||||
two lists of C++ and Python examples:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
@@ -263,12 +304,9 @@ using the following two lists of C++ and Python examples:
|
||||
#
|
||||
# See test.py for more information.
|
||||
cpp_examples = [
|
||||
("main-attribute-value", "True", "True"),
|
||||
("main-callback", "True", "True"),
|
||||
("sample-simulator", "True", "True"),
|
||||
("main-ptr", "True", "True"),
|
||||
("main-random-variable", "True", "True"),
|
||||
("sample-random-variable", "True", "True"),
|
||||
("adhoc-aloha-ideal-phy", "True", "True"),
|
||||
("adhoc-aloha-ideal-phy-with-microwave-oven", "True", "True"),
|
||||
("adhoc-aloha-ideal-phy-matrix-propagation-loss-model", "True", "True"),
|
||||
]
|
||||
|
||||
# A list of Python examples to run in order to ensure that they remain
|
||||
@@ -281,57 +319,43 @@ using the following two lists of C++ and Python examples:
|
||||
("sample-simulator.py", "True"),
|
||||
]
|
||||
|
||||
Each tuple in the C++ list of examples to run contains
|
||||
As indicated in the comment, each entry in the C++ list of examples to run
|
||||
contains the tuple ``(example_name, do_run, do_valgrind_run)``, where
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
(example_name, do_run, do_valgrind_run)
|
||||
|
||||
where example_name is the executable to be run, do_run is a
|
||||
condition under which to run the example, and do_valgrind_run is
|
||||
a condition under which to run the example under valgrind. This
|
||||
is needed because NSC causes illegal instruction crashes with
|
||||
some tests when they are run under valgrind.
|
||||
* ``example_name`` is the executable to be run,
|
||||
* ``do_run`` is a condition under which to run the example, and
|
||||
* ``do_valgrind_run`` is a condition under which to run the example
|
||||
under valgrind. (This is needed because NSC causes illegal instruction
|
||||
crashes with some tests when they are run under valgrind.)
|
||||
|
||||
Note that the two conditions are Python statements that
|
||||
can depend on waf configuration variables. For example,
|
||||
can depend on ``waf`` configuration variables. For example,
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
("tcp-nsc-lfn", "NSC_ENABLED == True", "NSC_ENABLED == False"),
|
||||
|
||||
Each tuple in the Python list of examples to run contains
|
||||
Each entry in the Python list of examples to run contains the tuple
|
||||
``(example_name, do_run)``, where, as for the C++ examples,
|
||||
|
||||
.. sourcecode:: python
|
||||
* ``example_name`` is the Python script to be run, and
|
||||
* ``do_run`` is a condition under which to run the example.
|
||||
|
||||
(example_name, do_run)
|
||||
|
||||
where example_name is the Python script to be run and
|
||||
do_run is a condition under which to run the example.
|
||||
|
||||
Note that the condition is a Python statement that can
|
||||
depend on waf configuration variables. For example,
|
||||
Again, the condition is a Python statement that can
|
||||
depend on ``waf`` configuration variables. For example,
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
("realtime-udp-echo.py", "ENABLE_REAL_TIME == False"),
|
||||
|
||||
If your new module has examples, then you must specify which of them
|
||||
should be run in your
|
||||
|
||||
.. sourcecode:: text
|
||||
Step 8 - Configure and Build
|
||||
****************************
|
||||
|
||||
src/new-module/test/examples-to-run.py
|
||||
|
||||
file by modifying it with your text editor. These examples are run by
|
||||
test.py.
|
||||
|
||||
Step 8 - Build and test your new module
|
||||
***************************************
|
||||
|
||||
You can now build and test your module as normal. You must reconfigure
|
||||
the project as a first step or else your new module will not be included
|
||||
in the build.
|
||||
You can now configure, build and test your module as normal.
|
||||
You must reconfigure the project as a first step so that ``waf``
|
||||
caches the new information in your ``wscript`` files,
|
||||
or else your new module will not be included in the build.
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
@@ -339,9 +363,11 @@ in the build.
|
||||
$ ./waf build
|
||||
$ ./test.py
|
||||
|
||||
and look for your new module's test suite (and example programs, if enabled) in the test output.
|
||||
Look for your new module's test suite (and example programs,
|
||||
if your module has any enabled) in the test output.
|
||||
|
||||
Step 9 - Python bindings
|
||||
|
||||
Step 9 - Python Bindings
|
||||
************************
|
||||
|
||||
Adding Python bindings to your module is optional, and the step is
|
||||
|
||||
@@ -27,7 +27,7 @@ Object-oriented behavior
|
||||
C++ objects, in general, provide common object-oriented capabilities
|
||||
(abstraction, encapsulation, inheritance, and polymorphism) that are part
|
||||
of classic object-oriented design. |ns3| objects make use of these
|
||||
properties; for instance:::
|
||||
properties; for instance::
|
||||
|
||||
class Address
|
||||
{
|
||||
@@ -130,7 +130,7 @@ holds true for |ns3| also, but some objects in the system have some additional
|
||||
frameworks available. Specifically, reference counted objects are usually
|
||||
allocated using a templated Create or CreateObject method, as follows.
|
||||
|
||||
For objects deriving from class :cpp:class:`Object`:::
|
||||
For objects deriving from class :cpp:class:`Object`::
|
||||
|
||||
Ptr<WifiNetDevice> device = CreateObject<WifiNetDevice> ();
|
||||
|
||||
@@ -139,7 +139,7 @@ Please do not create such objects using ``operator new``; create them using
|
||||
|
||||
For objects deriving from class :cpp:class:`SimpleRefCount`, or other objects
|
||||
that support usage of the smart pointer class, a templated helper function is
|
||||
available and recommended to be used:::
|
||||
available and recommended to be used::
|
||||
|
||||
Ptr<B> b = Create<B> ();
|
||||
|
||||
@@ -176,7 +176,7 @@ problems. This design is based on elements of the `Component Object Model
|
||||
binary-level compatibility of replaceable components is not supported and we
|
||||
have tried to simplify the syntax and impact on model developers.
|
||||
|
||||
Exmaples
|
||||
Examples
|
||||
********
|
||||
|
||||
Aggregation example
|
||||
@@ -218,7 +218,7 @@ Consider a node pointer ``m_node`` that points to a Node object that has an
|
||||
implementation of IPv4 previously aggregated to it. The client code wishes to
|
||||
configure a default route. To do so, it must access an object within the node
|
||||
that has an interface to the IP forwarding configuration. It performs the
|
||||
following:::
|
||||
following::
|
||||
|
||||
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> ();
|
||||
|
||||
@@ -281,7 +281,7 @@ to the subclass API?"
|
||||
|
||||
The answer to this is that in many situations, both techniques will work.
|
||||
|ns3| provides a templated function for making the syntax of Object
|
||||
dynamic casting much more user friendly:::
|
||||
dynamic casting much more user friendly::
|
||||
|
||||
template <typename T1, typename T2>
|
||||
Ptr<T1>
|
||||
|
||||
@@ -312,4 +312,4 @@ The ``src/<module>/bindings`` directory may contain the following files, some of
|
||||
More Information for Developers
|
||||
*******************************
|
||||
|
||||
If you are a developer and need more information on |ns3|'s Python bindings, please see the `Python Bindings wiki page <http://www.nsnam.org/wiki/index.php/NS-3_Python_Bindings>`_.
|
||||
If you are a developer and need more information on |ns3|'s Python bindings, please see the `Python Bindings wiki page <http://www.nsnam.org/wiki/NS-3_Python_Bindings>`_.
|
||||
|
||||
@@ -105,6 +105,41 @@ use a single RNG and streams and substreams from it.
|
||||
|
||||
.. _seeding-and-independent-replications:
|
||||
|
||||
Creating random variables
|
||||
*************************
|
||||
|
||||
|ns3| supports a number of random variable objects from the base class
|
||||
:cpp:class:`RandomVariableStream`. These objects derive from
|
||||
:cpp:class:`ns3::Object` and are handled by smart pointers.
|
||||
|
||||
The correct way to create these objects is to use the templated
|
||||
`CreateObject<>` method, such as:
|
||||
|
||||
::
|
||||
|
||||
Ptr<UniformRandomVariable> x = CreateObject<UniformRandomVariable> ();
|
||||
|
||||
then you can access values by calling methods on the object such as:
|
||||
|
||||
::
|
||||
|
||||
myRandomNo = x->GetInteger ();
|
||||
|
||||
|
||||
If you try to instead do something like this:
|
||||
|
||||
::
|
||||
|
||||
myRandomNo = UniformRandomVariable().GetInteger ();
|
||||
|
||||
your program will encounter a segmentation fault, because the implementation
|
||||
relies on some attribute construction that occurs only when `CreateObject`
|
||||
is called.
|
||||
|
||||
Much of the rest of this chapter now discusses the properties of the
|
||||
stream of pseudo-random numbers generated from such objects, and how to
|
||||
control the seeding of such objects.
|
||||
|
||||
Seeding and independent replications
|
||||
************************************
|
||||
|
||||
@@ -242,6 +277,7 @@ An example is in the propagation models for WifiNetDevice::
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::RandomPropagationDelayModel")
|
||||
.SetParent<PropagationDelayModel> ()
|
||||
.SetGroupName ("Propagation")
|
||||
.AddConstructor<RandomPropagationDelayModel> ()
|
||||
.AddAttribute ("Variable",
|
||||
"The random variable which generates random delays (s).",
|
||||
|
||||
@@ -5,6 +5,7 @@ Support
|
||||
|
||||
new-models
|
||||
new-modules
|
||||
documentation
|
||||
enable-modules
|
||||
enable-tests
|
||||
troubleshoot
|
||||
|
||||
@@ -4,58 +4,51 @@
|
||||
Testing framework
|
||||
-----------------
|
||||
|
||||
ns-3 consists of a simulation core engine, a set of models, example programs,
|
||||
|ns3| consists of a simulation core engine, a set of models, example programs,
|
||||
and tests. Over time, new contributors contribute models, tests, and
|
||||
examples. A Python test program ``test.py`` serves as the test
|
||||
execution manager; ``test.py`` can run test code and examples to
|
||||
look for regressions, can output the results into a number of forms, and
|
||||
can manage code coverage analysis tools. On top of this, we layer
|
||||
*Buildbots* that are automated build robots that perform
|
||||
*buildslaves* that are automated build robots that perform
|
||||
robustness testing by running the test framework on different systems
|
||||
and with different configuration options.
|
||||
|
||||
BuildBots
|
||||
*********
|
||||
Buildslaves
|
||||
***********
|
||||
|
||||
At the highest level of ns-3 testing are the buildbots (build robots).
|
||||
At the highest level of |ns3| testing are the buildslaves (build robots).
|
||||
If you are unfamiliar with
|
||||
this system look at `<http://djmitche.github.com/buildbot/docs/0.7.11/>`_.
|
||||
this system look at `<https://ns-buildmaster.ee.washington.edu:8010/>`_.
|
||||
This is an open-source automated system that allows |ns3| to be rebuilt
|
||||
and tested each time something has changed. By running the buildbots on a number
|
||||
and tested daily. By running the buildbots on a number
|
||||
of different systems we can ensure that |ns3| builds and executes
|
||||
properly on all of its supported systems.
|
||||
|
||||
Users (and developers) typically will not interact with the buildbot system other
|
||||
Users (and developers) typically will not interact with the buildslave system other
|
||||
than to read its messages regarding test results. If a failure is detected in
|
||||
one of the automated build and test jobs, the buildbot will send an email to the
|
||||
*ns-developers* mailing list. This email will look something like
|
||||
*ns-commits* mailing list. This email will look something like
|
||||
|
||||
.. sourcecode: text
|
||||
|
||||
The Buildbot has detected a new failure of osx-ppc-g++-4.2 on NsNam.
|
||||
Full details are available at:
|
||||
http://ns-regression.ee.washington.edu:8010/builders/osx-ppc-g%2B%2B-4.2/builds/0
|
||||
|
||||
Buildbot URL: http://ns-regression.ee.washington.edu:8010/
|
||||
|
||||
Buildslave for this Build: darwin-ppc
|
||||
|
||||
Build Reason: The web-page 'force build' button was pressed by 'ww': ww
|
||||
|
||||
Build Source Stamp: HEAD
|
||||
Blamelist:
|
||||
|
||||
BUILD FAILED: failed shell_5 shell_6 shell_7 shell_8 shell_9 shell_10 shell_11 shell_12
|
||||
|
||||
sincerely,
|
||||
-The Buildbot
|
||||
[Ns-commits] Build failed in Jenkins: daily-ubuntu-without-valgrind » Ubuntu-64-15.04 #926
|
||||
|
||||
In the full details URL shown in the email, one can search for the keyword
|
||||
``failed`` and select the ``stdio`` link for the corresponding step to see
|
||||
the reason for the failure.
|
||||
...
|
||||
281 of 285 tests passed (281 passed, 3 skipped, 1 failed, 0 crashed, 0 valgrind errors)
|
||||
List of SKIPped tests:
|
||||
ns3-tcp-cwnd
|
||||
ns3-tcp-interoperability
|
||||
nsc-tcp-loss
|
||||
List of FAILed tests:
|
||||
random-variable-stream-generators
|
||||
+ exit 1
|
||||
Build step 'Execute shell' marked build as failure
|
||||
|
||||
The buildbot will do its job quietly if there are no errors, and the system will
|
||||
undergo build and test cycles every day to verify that all is well.
|
||||
In the full details URL shown in the email, one can find links to the detailed test output.
|
||||
|
||||
The buildslave system will do its job quietly if there are no errors, and the
|
||||
system will undergo build and test cycles every day to verify that all is well.
|
||||
|
||||
Test.py
|
||||
*******
|
||||
@@ -73,7 +66,7 @@ have been built by doing the following
|
||||
::
|
||||
|
||||
$ ./waf configure --enable-examples --enable-tests
|
||||
$ ./waf
|
||||
$ ./waf build
|
||||
|
||||
By default, ``test.py`` will run all available tests and report status
|
||||
back in a very concise form. Running the command
|
||||
@@ -90,7 +83,7 @@ indications followed by the kind of test that was run and its display name.
|
||||
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
|
||||
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
|
||||
'build' finished successfully (0.939s)
|
||||
FAIL: TestSuite ns3-wifi-propagation-loss-models
|
||||
FAIL: TestSuite propagation-loss-model
|
||||
PASS: TestSuite object-name-service
|
||||
PASS: TestSuite pcap-file-object
|
||||
PASS: TestSuite ns3-tcp-cwnd
|
||||
@@ -120,6 +113,17 @@ if you run ``test.py --help`` you should see a command summary like:
|
||||
-e EXAMPLE, --example=EXAMPLE
|
||||
specify a single example to run (no relative path is
|
||||
needed)
|
||||
-d, --duration print the duration of each test suite and example
|
||||
-e EXAMPLE, --example=EXAMPLE
|
||||
specify a single example to run (no relative path is
|
||||
needed)
|
||||
-u, --update-data If examples use reference data files, get them to re-
|
||||
generate them
|
||||
-f FULLNESS, --fullness=FULLNESS
|
||||
choose the duration of tests to run: QUICK, EXTENSIVE,
|
||||
or TAKES_FOREVER, where EXTENSIVE includes QUICK and
|
||||
TAKES_FOREVER includes QUICK and EXTENSIVE (only QUICK
|
||||
tests are run by default)
|
||||
-g, --grind run the test suites and examples using valgrind
|
||||
-k, --kinds print the kinds of tests available
|
||||
-l, --list print the list of known tests
|
||||
@@ -167,25 +171,25 @@ to be specified. Running the command
|
||||
|
||||
::
|
||||
|
||||
$ ./test.py --suite=ns3-wifi-propagation-loss-models
|
||||
$ ./test.py --suite=propagation-loss-model
|
||||
|
||||
or equivalently
|
||||
|
||||
::
|
||||
|
||||
$ ./test.py -s ns3-wifi-propagation-loss-models
|
||||
$ ./test.py -s propagation-loss-model
|
||||
|
||||
results in that single test suite being run.
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
FAIL: TestSuite ns3-wifi-propagation-loss-models
|
||||
FAIL: TestSuite propagation-loss-model
|
||||
|
||||
To find detailed information regarding the failure, one must specify the kind
|
||||
of output desired. For example, most people will probably be interested in
|
||||
a text file::
|
||||
|
||||
$ ./test.py --suite=ns3-wifi-propagation-loss-models --text=results.txt
|
||||
$ ./test.py --suite=propagation-loss-model --text=results.txt
|
||||
|
||||
This will result in that single test suite being run with the test status written to
|
||||
the file ''results.txt''.
|
||||
@@ -194,7 +198,7 @@ You should find something similar to the following in that file
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
FAIL: Test Suite ''ns3-wifi-propagation-loss-models'' (real 0.02 user 0.01 system 0.00)
|
||||
FAIL: Test Suite ''propagation-loss-model'' (real 0.02 user 0.01 system 0.00)
|
||||
PASS: Test Case "Check ... Friis ... model ..." (real 0.01 user 0.00 system 0.00)
|
||||
FAIL: Test Case "Check ... Log Distance ... model" (real 0.01 user 0.01 system 0.00)
|
||||
Details:
|
||||
@@ -271,31 +275,39 @@ will result in a list of the test suite being displayed, similar to
|
||||
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
|
||||
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
|
||||
'build' finished successfully (0.939s)
|
||||
histogram
|
||||
ns3-wifi-interference
|
||||
ns3-tcp-cwnd
|
||||
ns3-tcp-interoperability
|
||||
sample
|
||||
devices-mesh-flame
|
||||
devices-mesh-dot11s
|
||||
devices-mesh
|
||||
|
||||
Test Type Test Name
|
||||
--------- ---------
|
||||
performance many-uniform-random-variables-one-get-value-call
|
||||
performance one-uniform-random-variable-many-get-value-calls
|
||||
performance type-id-perf
|
||||
system buildings-pathloss-test
|
||||
system buildings-shadowing-test
|
||||
system devices-mesh-dot11s-regression
|
||||
system devices-mesh-flame-regression
|
||||
system epc-gtpu
|
||||
...
|
||||
unit wimax-phy-layer
|
||||
unit wimax-service-flow
|
||||
unit wimax-ss-mac-layer
|
||||
unit wimax-tlv
|
||||
example adhoc-aloha-ideal-phy
|
||||
example adhoc-aloha-ideal-phy-matrix-propagation-loss-model
|
||||
example adhoc-aloha-ideal-phy-with-microwave-oven
|
||||
example aodv
|
||||
...
|
||||
object-name-service
|
||||
callback
|
||||
attributes
|
||||
config
|
||||
global-value
|
||||
command-line
|
||||
basic-random-number
|
||||
object
|
||||
|
||||
Any of these listed suites can be selected to be run by itself using the
|
||||
``--suite`` option as shown above.
|
||||
``--suite`` option as shown above. Examples are handled differently.
|
||||
|
||||
Similarly to test suites, one can run a single C++ example program
|
||||
using the ``--example`` option. Note that the relative path for the
|
||||
example does not need to be included and that the executables built
|
||||
for C++ examples do not have extensions. Entering
|
||||
for C++ examples do not have extensions. Furthermore, the example
|
||||
must be registered as an example to the test framework; it is not
|
||||
sufficient to create an example and run it through test.py; it must
|
||||
be added to the relevant ``examples-to-run.py`` file, explained below.
|
||||
Entering
|
||||
|
||||
::
|
||||
|
||||
@@ -307,7 +319,7 @@ results in that single example being run.
|
||||
|
||||
PASS: Example examples/udp/udp-echo
|
||||
|
||||
You can specify the directory where ns-3 was built using the
|
||||
You can specify the directory where |ns3| was built using the
|
||||
``--buildpath`` option as follows.
|
||||
|
||||
::
|
||||
@@ -329,7 +341,7 @@ results in that single example being run.
|
||||
PASS: Example examples/tutorial/first.py
|
||||
|
||||
Because Python examples are not built, you do not need to specify the
|
||||
directory where ns-3 was built to run them.
|
||||
directory where |ns3| was built to run them.
|
||||
|
||||
Normally when example programs are executed, they write a large amount of trace
|
||||
file data. This is normally saved to the base directory of the distribution
|
||||
@@ -358,12 +370,12 @@ will result in a list of the currently built test suites being displayed, simila
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
ns3-wifi-propagation-loss-models
|
||||
propagation-loss-model
|
||||
ns3-tcp-cwnd
|
||||
ns3-tcp-interoperability
|
||||
pcap-file-object
|
||||
pcap-file
|
||||
object-name-service
|
||||
random-number-generators
|
||||
random-variable-stream-generators
|
||||
|
||||
Note the absence of the ``Waf`` build messages.
|
||||
|
||||
@@ -399,7 +411,7 @@ and examples. Select verbose in the following way::
|
||||
$ ./test.py --verbose
|
||||
|
||||
All of these options can be mixed and matched. For example, to run all of the
|
||||
ns-3 core test suites under valgrind, in verbose mode, while generating an HTML
|
||||
|ns3| core test suites under valgrind, in verbose mode, while generating an HTML
|
||||
output file, one would do::
|
||||
|
||||
$ ./test.py --verbose --grind --constrain=core --html=results.html
|
||||
@@ -417,14 +429,32 @@ kinds of testing that need to be done.
|
||||
* Examples
|
||||
* Performance Tests
|
||||
|
||||
Moreover, each test is further classified according to the expected time needed to
|
||||
run it. Tests are classified as:
|
||||
|
||||
* QUICK
|
||||
* EXTENSIVE
|
||||
* TAKES_FOREVER
|
||||
|
||||
Note that specifying EXTENSIVE fullness will also run tests in QUICK category.
|
||||
Specifying TAKES_FOREVER will run tests in EXTENSIVE and QUICK categories.
|
||||
By default, only QUICK tests are ran.
|
||||
|
||||
As a rule of thumb, tests that must be run to ensure |ns3| coherence should be
|
||||
QUICK (i.e., take a few seconds). Tests that could be skipped, but are nice to do
|
||||
can be EXTENSIVE; these are tests that typically need minutes. TAKES_FOREVER is
|
||||
left for tests that take a really long time, in the order of several minutes.
|
||||
The main classification goal is to be able to run the buildbots in a reasonable
|
||||
time, and still be able to perform more extensive tests when needed.
|
||||
|
||||
BuildVerificationTests
|
||||
++++++++++++++++++++++
|
||||
|
||||
These are relatively simple tests that are built along with the distribution
|
||||
and are used to make sure that the build is pretty much working. Our
|
||||
current unit tests live in the source files of the code they test and are
|
||||
built into the ns-3 modules; and so fit the description of BVTs. BVTs live
|
||||
in the same source code that is built into the ns-3 code. Our current tests
|
||||
built into the |ns3| modules; and so fit the description of BVTs. BVTs live
|
||||
in the same source code that is built into the |ns3| code. Our current tests
|
||||
are examples of this kind of test.
|
||||
|
||||
Unit Tests
|
||||
@@ -432,10 +462,10 @@ Unit Tests
|
||||
|
||||
Unit tests are more involved tests that go into detail to make sure that a
|
||||
piece of code works as advertised in isolation. There is really no reason
|
||||
for this kind of test to be built into an ns-3 module. It turns out, for
|
||||
for this kind of test to be built into an |ns3| module. It turns out, for
|
||||
example, that the unit tests for the object name service are about the same
|
||||
size as the object name service code itself. Unit tests are tests that
|
||||
check a single bit of functionality that are not built into the ns-3 code,
|
||||
check a single bit of functionality that are not built into the |ns3| code,
|
||||
but live in the same directory as the code it tests. It is possible that
|
||||
these tests check integration of multiple implementation files in a module
|
||||
as well. The file src/core/test/names-test-suite.cc is an example of this kind
|
||||
@@ -451,11 +481,11 @@ have lots of this kind of test running in our current regression framework,
|
||||
but they are typically overloaded examples. We provide a new place
|
||||
for this kind of test in the directory ``src/test``. The file
|
||||
src/test/ns3tcp/ns3-interop-test-suite.cc is an example of this kind of
|
||||
test. It uses NSC TCP to test the ns-3 TCP implementation. Often there
|
||||
test. It uses NSC TCP to test the |ns3| TCP implementation. Often there
|
||||
will be test vectors required for this kind of test, and they are stored in
|
||||
the directory where the test lives. For example,
|
||||
ns3tcp-interop-response-vectors.pcap is a file consisting of a number of TCP
|
||||
headers that are used as the expected responses of the ns-3 TCP under test
|
||||
headers that are used as the expected responses of the |ns3| TCP under test
|
||||
to a stimulus generated by the NSC TCP which is used as a ''known good''
|
||||
implementation.
|
||||
|
||||
@@ -492,7 +522,7 @@ stage, and also (optionally) examples if examples are to be checked:
|
||||
|
||||
$ ./waf --configure --enable-examples --enable-tests
|
||||
|
||||
Then, build ns-3, and after it is built, just run ``test.py``. ``test.py -h``
|
||||
Then, build |ns3|, and after it is built, just run ``test.py``. ``test.py -h``
|
||||
will show a number of configuration options that modify the behavior
|
||||
of test.py.
|
||||
|
||||
@@ -503,12 +533,19 @@ below, this ``test-runner`` can be a helpful way to debug tests.
|
||||
Debugging Tests
|
||||
***************
|
||||
|
||||
The debugging of the test programs is best performed running the low-level test-runner program. The test-runner is the bridge from generic Python code to |ns3| code. It is written in C++ and uses the automatic test discovery process in the
|
||||
|ns3| code to find and allow execution of all of the various tests.
|
||||
The debugging of the test programs is best performed running the low-level
|
||||
test-runner program. The test-runner is the bridge from generic Python
|
||||
code to |ns3| code. It is written in C++ and uses the automatic test
|
||||
discovery process in the |ns3| code to find and allow execution of all
|
||||
of the various tests.
|
||||
|
||||
The main reason why ``test.py`` is not suitable for debugging is that it is not allowed for logging to be turned on using the ``NS_LOG`` environmental variable when test.py runs. This limitation does not apply to the test-runner executable. Hence, if you want to see logging output from your tests, you have to run them using the test-runner directly.
|
||||
The main reason why ``test.py`` is not suitable for debugging is that it is
|
||||
not allowed for logging to be turned on using the ``NS_LOG`` environmental
|
||||
variable when test.py runs. This limitation does not apply to the test-runner
|
||||
executable. Hence, if you want to see logging output from your tests, you
|
||||
have to run them using the test-runner directly.
|
||||
|
||||
In order to execute the test-runner, you run it like any other ns-3 executable
|
||||
In order to execute the test-runner, you run it like any other |ns3| executable
|
||||
-- using ``waf``. To get a list of available options, you can type::
|
||||
|
||||
$ ./waf --run "test-runner --help"
|
||||
@@ -517,19 +554,35 @@ You should see something like the following
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
|
||||
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build'
|
||||
'build' finished successfully (0.353s)
|
||||
--assert: Tell tests to segfault (like assert) if an error is detected
|
||||
--basedir=dir: Set the base directory (where to find src) to ''dir''
|
||||
--tempdir=dir: Set the temporary directory (where to find data files) to ''dir''
|
||||
--constrain=test-type: Constrain checks to test suites of type ''test-type''
|
||||
--help: Print this message
|
||||
--kinds: List all of the available kinds of tests
|
||||
--list: List all of the test suites (optionally constrained by test-type)
|
||||
--out=file-name: Set the test status output file to ''file-name''
|
||||
--suite=suite-name: Run the test suite named ''suite-name''
|
||||
--verbose: Turn on messages in the run test suites
|
||||
Usage: /home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build/utils/ns3-dev-test-runner-debug [OPTIONS]
|
||||
|
||||
Options:
|
||||
--help : print these options
|
||||
--print-test-name-list : print the list of names of tests available
|
||||
--list : an alias for --print-test-name-list
|
||||
--print-test-types : print the type of tests along with their names
|
||||
--print-test-type-list : print the list of types of tests available
|
||||
--print-temp-dir : print name of temporary directory before running
|
||||
the tests
|
||||
--test-type=TYPE : process only tests of type TYPE
|
||||
--test-name=NAME : process only test whose name matches NAME
|
||||
--suite=NAME : an alias (here for compatibility reasons only)
|
||||
for --test-name=NAME
|
||||
--assert-on-failure : when a test fails, crash immediately (useful
|
||||
when running under a debugger
|
||||
--stop-on-failure : when a test fails, stop immediately
|
||||
--fullness=FULLNESS : choose the duration of tests to run: QUICK,
|
||||
EXTENSIVE, or TAKES_FOREVER, where EXTENSIVE
|
||||
includes QUICK and TAKES_FOREVER includes
|
||||
QUICK and EXTENSIVE (only QUICK tests are
|
||||
run by default)
|
||||
--verbose : print details of test execution
|
||||
--xml : format test run output as xml
|
||||
--tempdir=DIR : set temp dir for tests to store output files
|
||||
--datadir=DIR : set data dir for tests to read reference files
|
||||
--out=FILE : send test result to FILE instead of standard output
|
||||
--append=FILE : append test result to FILE instead of standard output
|
||||
|
||||
|
||||
There are a number of things available to you which will be familiar to you if
|
||||
you have looked at ``test.py``. This should be expected since the test-
|
||||
@@ -539,7 +592,7 @@ the examples are really not |ns3| tests. ``test.py`` runs them
|
||||
as if they were to present a unified testing environment, but they are really
|
||||
completely different and not to be found here.
|
||||
|
||||
The first new option that appears here, but not in test.py is the ``--assert``
|
||||
The first new option that appears here, but not in test.py is the ``--assert-on-failure``
|
||||
option. This option is useful when debugging a test case when running under a
|
||||
debugger like ``gdb``. When selected, this option tells the underlying
|
||||
test case to cause a segmentation violation if an error is detected. This has
|
||||
@@ -550,36 +603,23 @@ option something like,
|
||||
::
|
||||
|
||||
$ ./waf shell
|
||||
$ cd build/debug/utils
|
||||
$ gdb test-runner
|
||||
$ run --suite=global-value --assert
|
||||
$ cd build/utils
|
||||
$ gdb ns3-dev-test-runner-debug
|
||||
$ run --suite=global-value --assert-on-failure
|
||||
|
||||
If an error is then found in the global-value test suite, a segfault would be
|
||||
generated and the (source level) debugger would stop at the ``NS_TEST_ASSERT_MSG``
|
||||
that detected the error.
|
||||
|
||||
Another new option that appears here is the ``--basedir`` option. It turns out
|
||||
that some tests may need to reference the source directory of the |ns3|
|
||||
distribution to find local data, so a base directory is always required to run
|
||||
a test.
|
||||
To run one of the tests directly from the test-runner
|
||||
using ``waf``, you will need to specify the test suite to run.
|
||||
So you could use the shell and do::
|
||||
|
||||
If you run a test from test.py, the Python program will provide the basedir
|
||||
option for you. To run one of the tests directly from the test-runner
|
||||
using ``waf``, you will need to specify the test suite to run along with
|
||||
the base directory. So you could use the shell and do::
|
||||
$ ./waf --run "test-runner --suite=pcap-file"
|
||||
|
||||
$ ./waf --run "test-runner --basedir=`pwd` --suite=pcap-file-object"
|
||||
|ns3| logging is available when you run it this way, such as:
|
||||
|
||||
Note the ''backward'' quotation marks on the ``pwd`` command.
|
||||
|
||||
If you are running the test suite out of a debugger, it can be quite painful
|
||||
to remember and constantly type the absolute path of the distribution base
|
||||
directory.
|
||||
Because of this, if you omit the basedir, the test-runner will try to figure one
|
||||
out for you. It begins in the current working directory and walks up the
|
||||
directory tree looking for a directory file with files named ``VERSION`` and
|
||||
``LICENSE.`` If it finds one, it assumes that must be the basedir and provides
|
||||
it for you.
|
||||
$ NS_LOG="Packet" ./waf --run "test-runner --suite=pcap-file"
|
||||
|
||||
Test output
|
||||
+++++++++++
|
||||
@@ -588,7 +628,7 @@ Many test suites need to write temporary files (such as pcap files)
|
||||
in the process of running the tests. The tests then need a temporary directory
|
||||
to write to. The Python test utility (test.py) will provide a temporary file
|
||||
automatically, but if run stand-alone this temporary directory must be provided.
|
||||
Just as in the basedir case, it can be annoying to continually have to provide
|
||||
It can be annoying to continually have to provide
|
||||
a ``--tempdir``, so the test runner will figure one out for you if you don't
|
||||
provide one. It first looks for environment variables named ``TMP`` and
|
||||
``TEMP`` and uses those. If neither ``TMP`` nor ``TEMP`` are defined
|
||||
@@ -620,63 +660,15 @@ and test output can be found in the ``testpy-output/`` directory.
|
||||
Reporting of test failures
|
||||
++++++++++++++++++++++++++
|
||||
|
||||
When you run a test suite using the test-runner it will run the test quietly
|
||||
by default. The only indication that you will get that the test passed is
|
||||
the *absence* of a message from ``waf`` saying that the program
|
||||
returned something other than a zero exit code. To get some output from the
|
||||
test, you need to specify an output file to which the tests will write their
|
||||
XML status using the ``--out`` option. You need to be careful interpreting
|
||||
the results because the test suites will *append* results onto this file.
|
||||
When you run a test suite using the test-runner it will run the test
|
||||
and report PASS or FAIL.
|
||||
To run more quietly, you need to specify an output file to which the tests will write their status using the ``--out`` option.
|
||||
Try,
|
||||
|
||||
::
|
||||
|
||||
$ ./waf --run "test-runner --basedir=`pwd` --suite=pcap-file-object --out=myfile.xml"
|
||||
$ ./waf --run "test-runner --suite=pcap-file --out=myfile.txt"
|
||||
|
||||
If you look at the file ``myfile.xml`` you should see something like,
|
||||
|
||||
.. sourcecode:: xml
|
||||
|
||||
<TestSuite>
|
||||
<SuiteName>pcap-file-object</SuiteName>
|
||||
<TestCase>
|
||||
<CaseName>Check to see that PcapFile::Open with mode ''w'' works</CaseName>
|
||||
<CaseResult>PASS</CaseResult>
|
||||
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
|
||||
</TestCase>
|
||||
<TestCase>
|
||||
<CaseName>Check to see that PcapFile::Open with mode ''r'' works</CaseName>
|
||||
<CaseResult>PASS</CaseResult>
|
||||
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
|
||||
</TestCase>
|
||||
<TestCase>
|
||||
<CaseName>Check to see that PcapFile::Open with mode ''a'' works</CaseName>
|
||||
<CaseResult>PASS</CaseResult>
|
||||
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
|
||||
</TestCase>
|
||||
<TestCase>
|
||||
<CaseName>Check to see that PcapFileHeader is managed correctly</CaseName>
|
||||
<CaseResult>PASS</CaseResult>
|
||||
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
|
||||
</TestCase>
|
||||
<TestCase>
|
||||
<CaseName>Check to see that PcapRecordHeader is managed correctly</CaseName>
|
||||
<CaseResult>PASS</CaseResult>
|
||||
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
|
||||
</TestCase>
|
||||
<TestCase>
|
||||
<CaseName>Check to see that PcapFile can read out a known good pcap file</CaseName>
|
||||
<CaseResult>PASS</CaseResult>
|
||||
<CaseTime>real 0.00 user 0.00 system 0.00</CaseTime>
|
||||
</TestCase>
|
||||
<SuiteResult>PASS</SuiteResult>
|
||||
<SuiteTime>real 0.00 user 0.00 system 0.00</SuiteTime>
|
||||
</TestSuite>
|
||||
|
||||
If you are familiar with XML this should be fairly self-explanatory. It is
|
||||
also not a complete XML file since test suites are designed to have their
|
||||
output appended to a master XML status file as described in the ``test.py``
|
||||
section.
|
||||
|
||||
Debugging test suite failures
|
||||
+++++++++++++++++++++++++++++
|
||||
@@ -702,8 +694,8 @@ arguments as needed, but basedir is the minimum needed)::
|
||||
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
|
||||
and "show warranty" for details.
|
||||
This GDB was configured as "x86_64-linux-gnu"...
|
||||
(gdb) r --basedir=`pwd`
|
||||
Starting program: <..>/build/debug/utils/test-runner --basedir=`pwd`
|
||||
(gdb) r --suite=
|
||||
Starting program: <..>/build/utils/ns3-dev-test-runner-debug --suite=ns3-wifi-interference
|
||||
[Thread debugging using libthread_db enabled]
|
||||
assert failed. file=../src/core/model/type-id.cc, line=138, cond="uid <= m_information.size () && uid != 0"
|
||||
...
|
||||
@@ -713,7 +705,7 @@ such as::
|
||||
|
||||
VALGR: TestSuite devices-mesh-dot11s-regression
|
||||
|
||||
$ ./waf --command-template="valgrind %s --basedir=`pwd` --suite=devices-mesh-dot11s-regression" --run test-runner
|
||||
$ ./waf --command-template="valgrind %s --suite=devices-mesh-dot11s-regression" --run test-runner
|
||||
|
||||
Class TestRunner
|
||||
****************
|
||||
@@ -761,14 +753,21 @@ as a ''unit'' test with the display name, ``my-test-suite-name``.
|
||||
MyTestSuite::MyTestSuite ()
|
||||
: TestSuite ("my-test-suite-name", UNIT)
|
||||
{
|
||||
AddTestCase (new MyTestCase);
|
||||
AddTestCase (new MyTestCase, TestCase::QUICK);
|
||||
}
|
||||
|
||||
MyTestSuite myTestSuite;
|
||||
static MyTestSuite myTestSuite;
|
||||
|
||||
The base class takes care of all of the registration and reporting required to
|
||||
be a good citizen in the test framework.
|
||||
|
||||
Avoid putting initialization logic into the test suite or test case
|
||||
constructors. This is
|
||||
because an instance of the test suite is created at run time
|
||||
(due to the static variable above) regardless of whether the test is being
|
||||
run or not. Instead, the TestCase provides a virtual ``DoSetup`` method
|
||||
that can be specialized to perform setup before ``DoRun`` is called.
|
||||
|
||||
Test Case
|
||||
*********
|
||||
|
||||
@@ -778,13 +777,15 @@ Mixtures of these models may be used.
|
||||
|
||||
In order to create a new test case in the system, all one has to do is to inherit
|
||||
from the ``TestCase`` base class, override the constructor to give the test
|
||||
case a name and override the ``DoRun`` method to run the test.
|
||||
case a name and override the ``DoRun`` method to run the test. Optionally,
|
||||
override also the ``DoSetup`` method.
|
||||
|
||||
.. sourcecode:: cpp
|
||||
|
||||
class MyTestCase : public TestCase
|
||||
{
|
||||
MyTestCase ();
|
||||
virtual void DoSetup (void);
|
||||
virtual void DoRun (void);
|
||||
};
|
||||
|
||||
|
||||
@@ -3,16 +3,11 @@
|
||||
Overview
|
||||
--------
|
||||
|
||||
This document is concerned with the testing and validation of |ns3| software.
|
||||
This chapter is concerned with the testing and validation of |ns3| software.
|
||||
|
||||
This document provides
|
||||
This chapter provides
|
||||
|
||||
* background about terminology and software testing (Chapter 2);
|
||||
* a description of the ns-3 testing framework (Chapter 3);
|
||||
* a guide to model developers or new model contributors for how to write tests (Chapter 4);
|
||||
* background about terminology and software testing
|
||||
* a description of the ns-3 testing framework
|
||||
* a guide to model developers or new model contributors for how to write tests
|
||||
|
||||
In brief, the first three chapters should be read by ns developers and
|
||||
contributors who need to understand how to contribute test code and
|
||||
validated programs, and
|
||||
the remainder of the document provides space for people to report on what
|
||||
aspects of selected models have been validated.
|
||||
|
||||
@@ -244,7 +244,7 @@ provided.
|
||||
The first thing to do is to read the path backward. The last segment of the path
|
||||
must be an ``Attribute`` of an ``Object``. In fact, if you had a pointer to the
|
||||
``Object`` that has the "CongestionWindow" ``Attribute`` handy (call it
|
||||
``theObject``), you could write this just like the previous example:::
|
||||
``theObject``), you could write this just like the previous example::
|
||||
|
||||
void CwndTracer (uint32_t oldval, uint32_t newval) {}
|
||||
|
||||
@@ -314,7 +314,7 @@ different trace events and writing them to files. In previous sections,
|
||||
primarily "Building Topologies," we have seen several varieties of the trace
|
||||
helper methods designed for use inside other (device) helpers.
|
||||
|
||||
Perhaps you will recall seeing some of these variations:::
|
||||
Perhaps you will recall seeing some of these variations::
|
||||
|
||||
pointToPoint.EnablePcapAll ("second");
|
||||
pointToPoint.EnablePcap ("second", p2pNodes.Get (0)->GetId (), 0);
|
||||
@@ -509,7 +509,7 @@ enable pcap tracing on a single device.
|
||||
|
||||
For example, in order to arrange for a device helper to create a single
|
||||
promiscuous pcap capture file of a specific name (``my-pcap-file.pcap``) on a
|
||||
given device, one could:::
|
||||
given device, one could::
|
||||
|
||||
Ptr<NetDevice> nd;
|
||||
...
|
||||
@@ -600,7 +600,7 @@ suffix ".tr" instead of ".pcap".
|
||||
|
||||
If you want to enable ascii tracing on more than one net device and have all
|
||||
traces sent to a single file, you can do that as well by using an object to
|
||||
refer to a single file:::
|
||||
refer to a single file::
|
||||
|
||||
Ptr<NetDevice> nd1;
|
||||
Ptr<NetDevice> nd2;
|
||||
@@ -632,7 +632,7 @@ belong to exactly one ``Node``. For example,::
|
||||
This would result in two files named ``prefix-client-eth0.tr`` and
|
||||
``prefix-server-eth0.tr`` with traces for each device in the respective trace
|
||||
file. Since all of the EnableAscii functions are overloaded to take a stream
|
||||
wrapper, you can use that form as well:::
|
||||
wrapper, you can use that form as well::
|
||||
|
||||
Names::Add ("client" ...);
|
||||
Names::Add ("client/eth0" ...);
|
||||
@@ -660,7 +660,7 @@ since the found net device must belong to exactly one ``Node``. For example,::
|
||||
|
||||
This would result in a number of ascii trace files being created, each of which
|
||||
follows the <prefix>-<node id>-<device id>.tr convention. Combining all of the
|
||||
traces into a single file is accomplished similarly to the examples above:::
|
||||
traces into a single file is accomplished similarly to the examples above::
|
||||
|
||||
NetDeviceContainer d = ...;
|
||||
...
|
||||
@@ -768,7 +768,7 @@ and ``NetDevice``- centric versions of the device versions. Instead of
|
||||
``Node`` and ``NetDevice`` pair constraints, we use protocol and interface
|
||||
constraints.
|
||||
|
||||
Note that just like in the device version, there are six methods:::
|
||||
Note that just like in the device version, there are six methods::
|
||||
|
||||
void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface);
|
||||
void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface);
|
||||
@@ -948,7 +948,7 @@ suffix ".tr" instead of ".pcap".
|
||||
If you want to enable ascii tracing on more than one interface and have all
|
||||
traces sent to a single file, you can do that as well by using an object to
|
||||
refer to a single file. We have already something similar to this in the "cwnd"
|
||||
example above:::
|
||||
example above::
|
||||
|
||||
Ptr<Ipv4> protocol1 = node1->GetObject<Ipv4> ();
|
||||
Ptr<Ipv4> protocol2 = node2->GetObject<Ipv4> ();
|
||||
@@ -978,7 +978,7 @@ between protocol instances and nodes, For example,::
|
||||
This would result in two files named "prefix-nnode1Ipv4-i1.tr" and
|
||||
"prefix-nnode2Ipv4-i1.tr" with traces for each interface in the respective
|
||||
trace file. Since all of the EnableAscii functions are overloaded to take a
|
||||
stream wrapper, you can use that form as well:::
|
||||
stream wrapper, you can use that form as well::
|
||||
|
||||
Names::Add ("node1Ipv4" ...);
|
||||
Names::Add ("node2Ipv4" ...);
|
||||
@@ -1011,7 +1011,7 @@ one-to-one correspondence between each protocol and its node. For example,::
|
||||
|
||||
This would result in a number of ascii trace files being created, each of which
|
||||
follows the <prefix>-n<node id>-i<interface>.tr convention. Combining all of the
|
||||
traces into a single file is accomplished similarly to the examples above:::
|
||||
traces into a single file is accomplished similarly to the examples above::
|
||||
|
||||
NodeContainer nodes;
|
||||
...
|
||||
|
||||
@@ -8,7 +8,7 @@ This chapter posts some information about possibly common errors in building
|
||||
or running |ns3| programs.
|
||||
|
||||
Please note that the wiki
|
||||
(`<http://www.nsnam.org/wiki/index.php/Troubleshooting>`_) may have contributed
|
||||
(`<http://www.nsnam.org/wiki/Troubleshooting>`_) may have contributed
|
||||
items.
|
||||
|
||||
Build errors
|
||||
@@ -21,7 +21,7 @@ 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:::
|
||||
Here is an example of what might occur::
|
||||
|
||||
$ ./waf --run tcp-point-to-point
|
||||
Entering directory '/home/tomh/ns-3-nsc/build'
|
||||
|
||||
+148
-41
@@ -38,7 +38,7 @@ SOURCES = \
|
||||
$(SRC)/energy/doc/energy.rst \
|
||||
$(SRC)/fd-net-device/doc/fd-net-device.rst \
|
||||
$(SRC)/tap-bridge/doc/tap.rst \
|
||||
$(SRC)/mesh/doc/mesh.rst \
|
||||
$(SRC)/mesh/doc/source/mesh.rst \
|
||||
$(SRC)/lte/doc/source/lte.rst \
|
||||
$(SRC)/lte/doc/source/lte-user.rst \
|
||||
$(SRC)/lte/doc/source/lte-design.rst \
|
||||
@@ -57,18 +57,33 @@ SOURCES = \
|
||||
$(SRC)/internet/doc/ipv6.rst \
|
||||
$(SRC)/internet/doc/routing-overview.rst \
|
||||
$(SRC)/internet/doc/tcp.rst \
|
||||
$(SRC)/internet/doc/codel.rst \
|
||||
$(SRC)/mobility/doc/mobility.rst \
|
||||
$(SRC)/olsr/doc/olsr.rst \
|
||||
$(SRC)/openflow/doc/openflow-switch.rst \
|
||||
$(SRC)/point-to-point/doc/point-to-point.rst \
|
||||
$(SRC)/wifi/doc/wifi.rst \
|
||||
$(SRC)/wifi/doc/source/wifi.rst \
|
||||
$(SRC)/wifi/doc/source/wifi-design.rst \
|
||||
$(SRC)/wifi/doc/source/wifi-user.rst \
|
||||
$(SRC)/wifi/doc/source/wifi-testing.rst \
|
||||
$(SRC)/wifi/doc/source/wifi-references.rst \
|
||||
$(SRC)/wimax/doc/wimax.rst \
|
||||
$(SRC)/uan/doc/uan.rst \
|
||||
$(SRC)/topology-read/doc/topology.rst \
|
||||
$(SRC)/spectrum/doc/spectrum.rst \
|
||||
$(SRC)/stats/doc/statistics.rst \
|
||||
$(SRC)/stats/doc/adaptor.rst \
|
||||
$(SRC)/stats/doc/aggregator.rst \
|
||||
$(SRC)/stats/doc/collector.rst \
|
||||
$(SRC)/stats/doc/data-collection-helpers.rst \
|
||||
$(SRC)/stats/doc/data-collection-overview.rst \
|
||||
$(SRC)/stats/doc/data-collection.rst \
|
||||
$(SRC)/stats/doc/probe.rst \
|
||||
$(SRC)/stats/doc/scope-and-limitations.rst \
|
||||
$(SRC)/netanim/doc/animation.rst \
|
||||
$(SRC)/flow-monitor/doc/flow-monitor.rst \
|
||||
$(SRC)/wave/doc/wave.rst \
|
||||
$(SRC)/sixlowpan/doc/sixlowpan.rst \
|
||||
$(SRC)/lr-wpan/doc/lr-wpan.rst \
|
||||
|
||||
# list all model library figure files that need to be copied to
|
||||
# $SOURCETEMP/figures. For each figure to be included in all
|
||||
@@ -88,8 +103,8 @@ SOURCEFIGS = \
|
||||
$(SRC)/internet/doc/internet-node-recv.dia \
|
||||
$(SRC)/internet/doc/routing.dia \
|
||||
$(SRC)/internet/doc/routing-specialization.dia \
|
||||
$(SRC)/wifi/doc/WifiArchitecture.dia \
|
||||
$(SRC)/wifi/doc/snir.dia \
|
||||
$(SRC)/wifi/doc/source/figures/WifiArchitecture.dia \
|
||||
$(SRC)/wifi/doc/source/figures/snir.dia \
|
||||
$(SRC)/wimax/doc/WimaxArchitecture.dia \
|
||||
$(SRC)/lte/doc/source/figures/epc-ctrl-arch.dia \
|
||||
$(SRC)/lte/doc/source/figures/epc-data-flow-dl.dia \
|
||||
@@ -106,12 +121,20 @@ SOURCEFIGS = \
|
||||
$(SRC)/lte/doc/source/figures/lte-arch-ue-ctrl.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-enb-phy.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-ue-phy.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-x2-handover-seq-diagram.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-e2e-data-protocol-stack.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-interference-test-scenario.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-subframe-structure.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-x2-interface.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-harq-architecture.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-harq-processes-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/ue-meas-consumer.dia \
|
||||
$(SRC)/lte/doc/source/figures/ue-meas-piecewise-motion.dia \
|
||||
$(SRC)/lte/doc/source/figures/ue-meas-piecewise-a1.dia \
|
||||
$(SRC)/lte/doc/source/figures/ue-meas-piecewise-a1-hys.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-cell-selection-timeline.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-cell-selection-scenario.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-handover-target-scenario.dia \
|
||||
$(SRC)/lte/doc/source/figures/lena-dual-stripe.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-mcs-index.eps \
|
||||
$(SRC)/lte/doc/source/figures/lenaThrTestCase1.eps \
|
||||
@@ -123,13 +146,13 @@ SOURCEFIGS = \
|
||||
$(SRC)/lte/doc/source/figures/epcSimulationTime.eps \
|
||||
$(SRC)/lte/doc/source/figures/epcEutranRunningTime.eps \
|
||||
$(SRC)/lte/doc/source/figures/profiling-memory.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-x2-handover-seq-diagram.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-x2-entity-saps.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-x2-entity-saps.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-strongest-cell-handover-algorithm.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-phy-interference.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-phy-interference.png \
|
||||
$(SRC)/lte/doc/source/figures/helpers.pdf \
|
||||
@@ -150,14 +173,30 @@ SOURCEFIGS = \
|
||||
$(SRC)/lte/doc/source/figures/lte-enb-rrc-states.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-ue-rrc-states.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-ue-rrc-states.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-handover-algorithm.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-handover-algorithm.png \
|
||||
$(SRC)/lte/doc/source/figures/fading_pedestrian.pdf \
|
||||
$(SRC)/lte/doc/source/figures/fading_pedestrian.png \
|
||||
$(SRC)/lte/doc/source/figures/fading_vehicular.pdf \
|
||||
$(SRC)/lte/doc/source/figures/fading_vehicular.png \
|
||||
$(SRC)/lte/doc/source/figures/fading_urban_3kmph.pdf \
|
||||
$(SRC)/lte/doc/source/figures/fading_urban_3kmph.png \
|
||||
$(SRC)/lte/doc/source/figures/fr-enhanced-fractional-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-full-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-hard-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-soft-fractional-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v1.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v2.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-strict-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/ffr-distributed-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/MCS_1_4.pdf \
|
||||
$(SRC)/lte/doc/source/figures/MCS_1_4.png \
|
||||
$(SRC)/lte/doc/source/figures/MCS_5_8.pdf \
|
||||
@@ -182,31 +221,48 @@ SOURCEFIGS = \
|
||||
$(SRC)/lte/doc/source/figures/MCS_16_test.pdf \
|
||||
$(SRC)/lte/doc/source/figures/miesm_scheme.pdf \
|
||||
$(SRC)/lte/doc/source/figures/miesm_scheme.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-dl-power-control.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-ffr-scheduling.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-legacy-handover-algorithm.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-legacy-handover-algorithm.png \
|
||||
$(SRC)/uan/doc/auvmobility-classes.dia \
|
||||
$(SRC)/stats/doc/Stat-framework-arch.png \
|
||||
$(SRC)/stats/doc/Wifi-default.png \
|
||||
$(SRC)/netanim/doc/figures/Dumbbell.png \
|
||||
$(SRC)/netanim/doc/figures/Dumbbell.pdf \
|
||||
$(SRC)/stats/doc/dcf-overview.dia \
|
||||
$(SRC)/stats/doc/dcf-overview-with-aggregation.dia \
|
||||
$(SRC)/stats/doc/file-example.png \
|
||||
$(SRC)/stats/doc/gnuplot-aggregator.png \
|
||||
$(SRC)/stats/doc/gnuplot-example.png \
|
||||
$(SRC)/stats/doc/gnuplot-helper-example.png \
|
||||
$(SRC)/stats/doc/seventh-packet-byte-count.png \
|
||||
$(SRC)/netanim/doc/figures/PacketStatistics.png \
|
||||
$(SRC)/netanim/doc/figures/PacketStatistics.pdf \
|
||||
$(SRC)/netanim/doc/figures/FastForward.png \
|
||||
$(SRC)/netanim/doc/figures/FastForward.pdf \
|
||||
$(SRC)/netanim/doc/figures/Wireless.png \
|
||||
$(SRC)/netanim/doc/figures/Wireless.pdf \
|
||||
$(SRC)/netanim/doc/figures/Precision.png \
|
||||
$(SRC)/netanim/doc/figures/Precision.pdf \
|
||||
$(SRC)/netanim/doc/figures/Persist.png \
|
||||
$(SRC)/netanim/doc/figures/Persist.pdf \
|
||||
$(SRC)/netanim/doc/figures/SimTime.png \
|
||||
$(SRC)/netanim/doc/figures/SimTime.pdf \
|
||||
$(SRC)/netanim/doc/figures/NetAnim_3_105.png \
|
||||
$(SRC)/netanim/doc/figures/NetAnim_3_105.pdf \
|
||||
$(SRC)/netanim/doc/figures/Trajectory.png \
|
||||
$(SRC)/netanim/doc/figures/Trajectory.pdf \
|
||||
$(SRC)/netanim/doc/figures/UpdateRateInterval.png \
|
||||
$(SRC)/netanim/doc/figures/UpdateRateInterval.pdf \
|
||||
$(SRC)/netanim/doc/figures/WithoutPrecision.png \
|
||||
$(SRC)/netanim/doc/figures/WithoutPrecision.pdf \
|
||||
$(SRC)/netanim/doc/figures/WithPrecision.png \
|
||||
$(SRC)/netanim/doc/figures/WithPrecision.pdf \
|
||||
$(SRC)/netanim/doc/figures/NodeCountersChart.png \
|
||||
$(SRC)/netanim/doc/figures/NodeCountersChart.pdf \
|
||||
$(SRC)/netanim/doc/figures/NodeCountersTable.png \
|
||||
$(SRC)/netanim/doc/figures/NodeCountersTable.pdf \
|
||||
$(SRC)/netanim/doc/figures/RoutingTables.png \
|
||||
$(SRC)/netanim/doc/figures/RoutingTables.pdf \
|
||||
$(SRC)/netanim/doc/figures/PacketTimeline.png \
|
||||
$(SRC)/netanim/doc/figures/PacketTimeline.pdf \
|
||||
$(SRC)/spectrum/doc/spectrum-channel-phy-interface.png \
|
||||
$(SRC)/spectrum/doc/spectrum-channel-phy-interface.pdf \
|
||||
$(SRC)/spectrum/doc/spectrum-analyzer-example.eps \
|
||||
$(SRC)/spectrum/doc/spectrum-tv-rand-geo-points.eps \
|
||||
$(SRC)/spectrum/doc/spectrum-tv-8vsb.png \
|
||||
$(SRC)/spectrum/doc/spectrum-tv-cofdm.png \
|
||||
$(SRC)/lr-wpan/doc/lr-wpan-arch.dia \
|
||||
$(SRC)/lr-wpan/doc/lr-wpan-data-example.dia \
|
||||
$(SRC)/lr-wpan/doc/lr-wpan-primitives.dia \
|
||||
$(SRC)/lr-wpan/doc/802-15-4-ber.eps \
|
||||
$(SRC)/lr-wpan/doc/802-15-4-per-sens.eps \
|
||||
$(SRC)/lr-wpan/doc/802-15-4-psr-distance.eps
|
||||
|
||||
# specify figures from which .png and .pdf figures need to be
|
||||
# generated (all dia and eps figures)
|
||||
@@ -225,6 +281,8 @@ IMAGES_EPS = \
|
||||
$(FIGURES)/WifiArchitecture.eps \
|
||||
$(FIGURES)/snir.eps \
|
||||
$(FIGURES)/WimaxArchitecture.eps \
|
||||
$(FIGURES)/dcf-overview.eps \
|
||||
$(FIGURES)/dcf-overview-with-aggregation.eps \
|
||||
$(FIGURES)/epc-ctrl-arch.eps \
|
||||
$(FIGURES)/epc-data-flow-dl.eps \
|
||||
$(FIGURES)/epc-data-flow-ul.eps \
|
||||
@@ -234,6 +292,16 @@ IMAGES_EPS = \
|
||||
$(FIGURES)/eutran-profiling-scenario.eps \
|
||||
$(FIGURES)/ff-example.eps \
|
||||
$(FIGURES)/ff-mac-saps.eps \
|
||||
$(FIGURES)/lte-dl-power-control.eps \
|
||||
$(FIGURES)/lte-ffr-scheduling.eps \
|
||||
$(FIGURES)/fr-enhanced-fractional-frequency-reuse-scheme.eps \
|
||||
$(FIGURES)/fr-full-frequency-reuse-scheme.eps \
|
||||
$(FIGURES)/fr-hard-frequency-reuse-scheme.eps \
|
||||
$(FIGURES)/fr-soft-fractional-frequency-reuse-scheme.eps \
|
||||
$(FIGURES)/fr-soft-frequency-reuse-scheme-v1.eps \
|
||||
$(FIGURES)/fr-soft-frequency-reuse-scheme-v2.eps \
|
||||
$(FIGURES)/fr-strict-frequency-reuse-scheme.eps \
|
||||
$(FIGURES)/ffr-distributed-scheme.eps \
|
||||
$(FIGURES)/lte-arch-enb-data.eps \
|
||||
$(FIGURES)/lte-arch-enb-ctrl.eps \
|
||||
$(FIGURES)/lte-arch-ue-data.eps \
|
||||
@@ -246,6 +314,13 @@ IMAGES_EPS = \
|
||||
$(FIGURES)/lte-epc-x2-interface.eps \
|
||||
$(FIGURES)/lte-harq-architecture.eps \
|
||||
$(FIGURES)/lte-harq-processes-scheme.eps \
|
||||
$(FIGURES)/ue-meas-consumer.eps \
|
||||
$(FIGURES)/ue-meas-piecewise-motion.eps \
|
||||
$(FIGURES)/ue-meas-piecewise-a1.eps \
|
||||
$(FIGURES)/ue-meas-piecewise-a1-hys.eps \
|
||||
$(FIGURES)/lte-cell-selection-timeline.eps \
|
||||
$(FIGURES)/lte-cell-selection-scenario.eps \
|
||||
$(FIGURES)/lte-handover-target-scenario.eps \
|
||||
$(FIGURES)/lena-dual-stripe.eps \
|
||||
$(FIGURES)/lte-mcs-index.eps \
|
||||
$(FIGURES)/lenaThrTestCase1.eps \
|
||||
@@ -264,7 +339,16 @@ IMAGES_EPS = \
|
||||
$(FIGURES)/lte-rlc-data-retx-ul.eps \
|
||||
$(FIGURES)/lte-epc-x2-handover-seq-diagram.eps \
|
||||
$(FIGURES)/lte-epc-x2-entity-saps.eps \
|
||||
$(FIGURES)/lte-strongest-cell-handover-algorithm.eps \
|
||||
$(FIGURES)/auvmobility-classes.eps \
|
||||
$(FIGURES)/spectrum-analyzer-example.eps \
|
||||
$(FIGURES)/spectrum-tv-rand-geo-points.eps \
|
||||
$(FIGURES)/lr-wpan-primitives.eps \
|
||||
$(FIGURES)/lr-wpan-data-example.eps \
|
||||
$(FIGURES)/lr-wpan-arch.eps \
|
||||
$(FIGURES)/802-15-4-ber.eps \
|
||||
$(FIGURES)/802-15-4-per-sens.eps \
|
||||
$(FIGURES)/802-15-4-psr-distance.eps
|
||||
|
||||
# rescale pdf figures as necessary
|
||||
$(FIGURES)/testbed.pdf_width = 5in
|
||||
@@ -287,6 +371,16 @@ $(FIGURES)/lte-arch-data-rrc-pdcp-rlc.pdf_width = 3in
|
||||
$(FIGURES)/lte-epc-e2e-data-protocol-stack.pdf_width = 15cm
|
||||
$(FIGURES)/ff-mac-saps.pdf_width = 5in
|
||||
$(FIGURES)/ff-example.pdf_width = 5in
|
||||
$(FIGURES)/lte-dl-power-control.pdf_width = 8cm
|
||||
$(FIGURES)/lte-ffr-scheduling.pdf_width = 8cm
|
||||
$(FIGURES)/fr-enhanced-fractional-frequency-reuse-scheme.pdf_width = 8cm
|
||||
$(FIGURES)/fr-full-frequency-reuse-scheme.pdf_width = 8cm
|
||||
$(FIGURES)/fr-hard-frequency-reuse-scheme.pdf_width = 8cm
|
||||
$(FIGURES)/fr-soft-fractional-frequency-reuse-scheme.pdf_width = 8cm
|
||||
$(FIGURES)/fr-soft-frequency-reuse-scheme-v1.pdf_width = 8cm
|
||||
$(FIGURES)/fr-soft-frequency-reuse-scheme-v2.pdf_width = 8cm
|
||||
$(FIGURES)/fr-strict-frequency-reuse-scheme.pdf_width = 8cm
|
||||
$(FIGURES)/ffr-distributed-scheme.pdf_width = 8cm
|
||||
$(FIGURES)/lte-arch-enb-data.pdf_width = 6cm
|
||||
$(FIGURES)/lte-arch-enb-ctrl.pdf_width = 10cm
|
||||
$(FIGURES)/lte-arch-ue-data.pdf_width = 6cm
|
||||
@@ -294,15 +388,19 @@ $(FIGURES)/lte-arch-ue-ctrl.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-implementation-model.pdf_width = 20in
|
||||
$(FIGURES)/lte-rlc-data-txon-dl.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-data-txon-ul.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-data-retx-dl.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-data-retx-ul.pdf_width = 10cm
|
||||
$(FIGURES)/lte-epc-x2-entity-saps.pdf_width = 12cm
|
||||
$(FIGURES)/lte-phy-interference.pdf_width = 12cm
|
||||
$(FIGURES)/lte-subframe-structure.pdf_width = 2in
|
||||
$(FIGURES)/mac-random-access-contention.pdf_width = 10cm
|
||||
$(FIGURES)/mac-random-access-noncontention.pdf_width = 15cm
|
||||
$(FIGURES)/lte-ue-rrc-states.pdf_width = 7cm
|
||||
$(FIGURES)/lte-handover-algorithm.pdf_width = 10cm
|
||||
$(FIGURES)/helpers.pdf_width = 8cm
|
||||
$(FIGURES)/auvmobility-classes.pdf_width = 10cm
|
||||
$(FIGURES)/spectrum-analyzer-example.pdf_width = 15cm
|
||||
$(FIGURES)/spectrum-tv-rand-geo-points.pdf_width = 8cm
|
||||
$(FIGURES)/lr-wpan-primitives.pdf_width = 3in
|
||||
$(FIGURES)/lr-wpan-arch.pdf_width = 2in
|
||||
|
||||
IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
|
||||
IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf}
|
||||
@@ -311,11 +409,21 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
|
||||
|
||||
RESCALE = ../../utils/rescale-pdf.sh
|
||||
|
||||
%.eps : %.dia; $(DIA) -t eps $< -e $@
|
||||
%.png : %.dia; $(DIA) -t png $< -e $@
|
||||
%.png : %.eps; $(CONVERT) $< $@
|
||||
%.eps : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t eps $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t png $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.eps
|
||||
@echo convert $(notdir $<)
|
||||
@$(CONVERT) $< $@ >/dev/null
|
||||
|
||||
%.pdf : %.eps
|
||||
$(EPSTOPDF) $< -o=$@
|
||||
@echo epstopdf $(notdir $<)
|
||||
@$(EPSTOPDF) $< -o=$@ >/dev/null
|
||||
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
|
||||
# You can set these variables from the command line.
|
||||
@@ -353,11 +461,10 @@ help:
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
copy-sources: $(SOURCES)
|
||||
@rm -rf $(SOURCETEMP)
|
||||
@mkdir -p $(SOURCETEMP)
|
||||
@mkdir -p $(FIGURES)
|
||||
@cp -r $(SOURCES) $(SOURCETEMP)
|
||||
@cp -r $(SOURCEFIGS) $(FIGURES)
|
||||
@cp -r -p $(SOURCES) $(SOURCETEMP)
|
||||
@cp -r -p $(SOURCEFIGS) $(FIGURES)
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
@@ -18,8 +18,7 @@ any combination of simulated or emulated devices.
|
||||
|
||||
**Note:** Prior to ns-3.17, the emulation capability was provided by a
|
||||
special device called an ``Emu`` NetDevice; the ``Emu`` NetDevice has
|
||||
been superseded by the ``FdNetDevice``, and will be deprecated and removed
|
||||
in future revisions of |ns3|.
|
||||
been replaced by the ``FdNetDevice``.
|
||||
|
||||
One of the use-cases we want to support is that of a testbed. A concrete example
|
||||
of an environment of this kind is the ORBIT testbed. ORBIT is a laboratory
|
||||
|
||||
@@ -8,13 +8,13 @@ available in five forms:
|
||||
|
||||
* `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentation of the public APIs of the simulator
|
||||
* Tutorial, Manual, and Model Library *(this document)* for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki>`_
|
||||
|
||||
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
|
||||
``doc/models`` directory of ns-3's source code.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:maxdepth: 1
|
||||
|
||||
organization
|
||||
animation
|
||||
@@ -26,12 +26,14 @@ This document is written in `reStructuredText <http://docutils.sourceforge.net/r
|
||||
buildings
|
||||
click
|
||||
csma
|
||||
data-collection
|
||||
dsdv
|
||||
dsr
|
||||
emulation-overview
|
||||
energy
|
||||
flow-monitor
|
||||
internet-models
|
||||
lr-wpan
|
||||
lte
|
||||
mesh
|
||||
distributed
|
||||
@@ -41,8 +43,10 @@ This document is written in `reStructuredText <http://docutils.sourceforge.net/r
|
||||
openflow-switch
|
||||
point-to-point
|
||||
propagation
|
||||
statistics
|
||||
spectrum
|
||||
sixlowpan
|
||||
topology
|
||||
uan
|
||||
wave
|
||||
wifi
|
||||
wimax
|
||||
|
||||
@@ -8,3 +8,4 @@ Internet Models
|
||||
ipv6
|
||||
routing-overview
|
||||
tcp
|
||||
codel
|
||||
|
||||
@@ -34,7 +34,13 @@ Finally, additional documentation about various aspects of |ns3| may
|
||||
exist on the `project wiki <http://www.nsnam.org/wiki>`_.
|
||||
|
||||
A sample outline of how to write model library documentation can be
|
||||
found in :mod:`src/template/doc`.
|
||||
found by executing the ``create-module.py`` program and looking at the
|
||||
template created in the file ``new-module/doc/new-module.rst``.
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ cd src
|
||||
$ ./create-module.py new-module
|
||||
|
||||
The remainder of this document is organized alphabetically by module name.
|
||||
|
||||
|
||||
+25
-16
@@ -1,33 +1,42 @@
|
||||
/**
|
||||
* @anchor modules_anchor
|
||||
*
|
||||
* @defgroup constructs Introspected Lists
|
||||
* \brief These are lists of useful items found by examining the type system.
|
||||
*
|
||||
* @defgroup constants Constants
|
||||
* @brief Constants you can change
|
||||
*
|
||||
* @defgroup utils Utils
|
||||
* @brief The utils directory is for various programs and scripts related
|
||||
* to code coverage, test suites, style checking, and benchmarking.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @defgroup core Core
|
||||
* \brief The "core" 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:
|
||||
* - 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
|
||||
* - a simulator class used to create, schedule and cancel events:
|
||||
* ns3::Simulator
|
||||
* - 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
|
||||
* - 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 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 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.
|
||||
*
|
||||
* - 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.
|
||||
*/
|
||||
/**
|
||||
* @ingroup core
|
||||
* @defgroup debugging Debugging tools
|
||||
*
|
||||
* @brief Assertions, breakpoints, logging, and abnormal program termination
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
# to force us into the public case.)
|
||||
#
|
||||
# The approach to identify cases 1 & 2 is to test:
|
||||
# a. We're on nsnam.org (actually, nsnam.ece.gatech.edu), and
|
||||
# a. We're on nsnam.org (actually, nsnam-www.coe-hosted.gatech.edu), and
|
||||
# b. We're in the tmp build directory, /tmp/daily-nsnam/
|
||||
# (This is the directory used by the update-* scripts
|
||||
# run by cron jobs.)
|
||||
@@ -71,6 +71,7 @@ EOF
|
||||
|
||||
# script arguments
|
||||
say
|
||||
say using doxygen: $(which doxygen) $(doxygen --version)
|
||||
public=0
|
||||
nsnam=0
|
||||
daily=0
|
||||
@@ -91,9 +92,9 @@ while getopts :pndth option ; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Hostname, fully qualified, e.g. nsnam.ece.gatech.edu
|
||||
# Hostname, fully qualified, e.g. nsnam-www.coe-hosted.gatech.edu
|
||||
HOST=`hostname`
|
||||
NSNAM="nsnam.ece.gatech.edu"
|
||||
NSNAM="nsnam-www.coe-hosted.gatech.edu"
|
||||
|
||||
# Build directory
|
||||
DAILY="^/tmp/daily-nsnam/"
|
||||
@@ -151,7 +152,7 @@ elif [ $tag -eq 1 ]; then
|
||||
else
|
||||
version=`hg log -r tip --template '{node|short}'`
|
||||
# Check for uncommitted changes
|
||||
hg summary | grep -q 'commit: (clean)'
|
||||
hg summary | grep 'commit:' | grep -q '(clean)'
|
||||
if [ ! $? ] ; then
|
||||
say "beyond latest tag, last commit: $version, dirty"
|
||||
dirty="(+)"
|
||||
@@ -212,4 +213,4 @@ cd - 2>&1 >/dev/null
|
||||
say
|
||||
say "outf = $outf:"
|
||||
cat -n $outf
|
||||
say Done.
|
||||
say Done.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<!-- ns-3 doxygen header, based on
|
||||
HTML header for doxygen 1.8.3.1
|
||||
Verified compatible with 1.8.6
|
||||
-->
|
||||
<!-- start footer part -->
|
||||
<!--BEGIN GENERATE_TREEVIEW-->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
<!-- ns-3 doxygen header, based on
|
||||
HTML header for doxygen 1.8.3.1
|
||||
Verified compatible with 1.8.6
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"></meta>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"></meta>
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"></link>
|
||||
<script type="text/javascript" src="$relpath$jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath$dynsections.js"></script>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"></link>
|
||||
<link href="$relpath$ns3_stylesheet.css" rel="stylesheet" type="text/css"></link>
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
<link href="$relpath$favicon.ico" rel="shortcut icon" type="image/ico"></link>
|
||||
<script type="text/javascript" src="$relpath$drop-down-menu.js"></script>
|
||||
<script type="text/javascript" src="$relpath$ns3_version.js"></script>
|
||||
@@ -99,7 +104,7 @@ $mathjax
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<script type="text/javascript">ns3_write_links()</script>
|
||||
<script type="text/javascript">ns3_write_links();</script>
|
||||
</div>
|
||||
<!--END TITLEAREA-->
|
||||
<!-- end header part -->
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -190,7 +190,7 @@ div.sphinxsidebar a {
|
||||
|
||||
#ns3-menu .menu div {
|
||||
background: #94A901;
|
||||
background-size: 100%; 100%
|
||||
background-size: 100%;
|
||||
color:#ffffff;
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
|
||||
@@ -144,6 +144,9 @@ preparing the documentation
|
||||
|
||||
2. Check if these new files are available on the website
|
||||
|
||||
3. In ns-3-dev, edit the tutorial "Getting Started" page to
|
||||
update the release version numbers.
|
||||
|
||||
preparing the Wordpress-based main website
|
||||
------------------------------------------
|
||||
|
||||
|
||||
@@ -27,9 +27,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
%.eps : %.dia; $(DIA) -t eps $< -e $@
|
||||
%.png : %.dia; $(DIA) -t png $< -e $@
|
||||
%.pdf : %.eps; $(EPSTOPDF) $< -o=$@
|
||||
%.eps : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t eps $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t png $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.eps
|
||||
@echo convert $(notdir $<)
|
||||
@$(CONVERT) $< $@ >/dev/null
|
||||
|
||||
%.pdf : %.eps
|
||||
@echo epstopdf $(notdir $<)
|
||||
@$(EPSTOPDF) $< -o=$@ >/dev/null
|
||||
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
|
||||
@@ -30,9 +30,9 @@ Baixando o ns-3
|
||||
present on your system before proceeding. |ns3| provides a wiki
|
||||
for your reading pleasure that includes pages with many useful hints and tips.
|
||||
One such page is the "Installation" page,
|
||||
http://www.nsnam.org/wiki/index.php/Installation.
|
||||
http://www.nsnam.org/wiki/Installation.
|
||||
|
||||
O |ns3|, como um todo, é bastante complexo e possui várias dependências. Isto também é verdade para as ferramentas que fornecem suporte ao |ns3| (exemplos, `"GNU toolchain"`, Mercurial e um editor para a programação), desta forma é necessário assegurar que várias bibliotecas estejam presentes no sistema. O |ns3| fornece um Wiki com várias dicas sobre o sistema. Uma das páginas do Wiki é a página de instalação (`"Installation"`) que está disponível em: http://www.nsnam.org/wiki/index.php/Installation.
|
||||
O |ns3|, como um todo, é bastante complexo e possui várias dependências. Isto também é verdade para as ferramentas que fornecem suporte ao |ns3| (exemplos, `"GNU toolchain"`, Mercurial e um editor para a programação), desta forma é necessário assegurar que várias bibliotecas estejam presentes no sistema. O |ns3| fornece um Wiki com várias dicas sobre o sistema. Uma das páginas do Wiki é a página de instalação (`"Installation"`) que está disponível em: http://www.nsnam.org/wiki/Installation.
|
||||
|
||||
..
|
||||
The "Prerequisites" section of this wiki page explains which packages are
|
||||
@@ -740,7 +740,7 @@ Agora, ao executar o programa ``hello-simulator`` devemos ter a seguinte a sa
|
||||
..
|
||||
If you want to run programs under another tool such as gdb or valgrind,
|
||||
see this `wiki entry
|
||||
<http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool>`_.
|
||||
<http://www.nsnam.org/wiki/User_FAQ#How_to_run_NS-3_programs_under_another_tool>`_.
|
||||
|
||||
Se o leitor for executar seus programas sob outras ferramentas, tais como Gdb ou Valgrind, é recomendável que leia a seguinte `entrada no Wiki <http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool>`_.
|
||||
Se o leitor for executar seus programas sob outras ferramentas, tais como Gdb ou Valgrind, é recomendável que leia a seguinte `entrada no Wiki <http://www.nsnam.org/wiki/User_FAQ#How_to_run_NS-3_programs_under_another_tool>`_.
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Este
|
||||
|
||||
* Tutorial *(este documento)*, manual, modelos de bibliotecas para a `última release <http://www.nsnam.org/documentation/latest/>`_ e `árvore de desenvolvimento <http://www.nsnam.org/ns-3-dev/documentation/>`_;
|
||||
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_.
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/Main_Page>`_.
|
||||
|
||||
..
|
||||
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
|
||||
|
||||
@@ -132,15 +132,15 @@ O |ns3|
|
||||
|
||||
* Licença de código aberto compatível com GNU GPLv2;
|
||||
|
||||
* `Wiki <http://www.nsnam.org/wiki/index.php>`_;
|
||||
* `Wiki <http://www.nsnam.org/wiki>`_;
|
||||
|
||||
..
|
||||
* `Contributed Code
|
||||
<http://www.nsnam.org/wiki/index.php/Contributed_Code>`_ page, similar to ns-2's popular Contributed Code
|
||||
<http://www.nsnam.org/wiki/Contributed_Code>`_ page, similar to ns-2's popular Contributed Code
|
||||
`page
|
||||
<http://nsnam.isi.edu/nsnam/index.php/Contributed_Code>`_
|
||||
|
||||
* Página para `contribuição com o código <http://www.nsnam.org/wiki/index.php/Contributed_Code>`_, similar a página de contribuição do `ns-2 <http://nsnam.isi.edu/nsnam/index.php/Contributed_Code>`_;
|
||||
* Página para `contribuição com o código <http://www.nsnam.org/wiki/Contributed_Code>`_, similar a página de contribuição do `ns-2 <http://nsnam.isi.edu/nsnam/index.php/Contributed_Code>`_;
|
||||
|
||||
..
|
||||
* Open `bug tracker
|
||||
|
||||
+16
-3
@@ -27,9 +27,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
%.eps : %.dia; $(DIA) -t eps $< -e $@
|
||||
%.png : %.dia; $(DIA) -t png $< -e $@
|
||||
%.pdf : %.eps; $(EPSTOPDF) $< -o=$@
|
||||
%.eps : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t eps $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t png $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.eps
|
||||
@echo convert $(notdir $<)
|
||||
@$(CONVERT) $< $@ >/dev/null
|
||||
|
||||
%.pdf : %.eps
|
||||
@echo epstopdf $(notdir $<)
|
||||
@$(EPSTOPDF) $< -o=$@ >/dev/null
|
||||
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 7.1 KiB |
@@ -1,6 +1,8 @@
|
||||
.. include:: replace.txt
|
||||
.. highlight:: cpp
|
||||
|
||||
.. _BuildingTopologies:
|
||||
|
||||
Building Topologies
|
||||
-------------------
|
||||
|
||||
@@ -22,7 +24,7 @@ point-to-point topologies, we will see equivalent CSMA topology helpers in
|
||||
this section. The appearance and operation of these helpers should look
|
||||
quite familiar to you.
|
||||
|
||||
We provide an example script in our examples/tutorial} directory. This script
|
||||
We provide an example script in our ``examples/tutorial`` directory. This script
|
||||
builds on the ``first.cc`` script and adds a CSMA network to the
|
||||
point-to-point simulation we've already considered. Go ahead and open
|
||||
``examples/tutorial/second.cc`` in your favorite editor. You will have already seen
|
||||
@@ -413,7 +415,7 @@ You should see the contents of the pcap file displayed:
|
||||
|
||||
reading from file second-0-0.pcap, link-type PPP (PPP)
|
||||
2.000000 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.007602 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
2.017607 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
|
||||
The first line of the dump indicates that the link type is PPP (point-to-point)
|
||||
which we expect. You then see the echo packet leaving node zero via the
|
||||
@@ -433,7 +435,7 @@ link:
|
||||
|
||||
reading from file second-1-0.pcap, link-type PPP (PPP)
|
||||
2.003686 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
|
||||
Here we see that the link type is also PPP as we would expect. You see the
|
||||
packet from IP address 10.1.1.1 (that was sent at 2.000000 seconds) headed
|
||||
@@ -453,12 +455,12 @@ You should now see the promiscuous dump of node two, device zero:
|
||||
.. sourcecode:: text
|
||||
|
||||
reading from file second-2-0.pcap, link-type EN10MB (Ethernet)
|
||||
2.003696 arp who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
|
||||
2.003707 arp reply 10.1.2.4 is-at 00:00:00:00:00:06
|
||||
2.003801 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4
|
||||
2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
|
||||
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
2.007698 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
|
||||
2.007710 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
|
||||
2.007803 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.013815 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
|
||||
2.013828 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
|
||||
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
|
||||
As you can see, the link type is now "Ethernet". Something new has appeared,
|
||||
though. The bus network needs ``ARP``, the Address Resolution Protocol.
|
||||
@@ -473,15 +475,15 @@ This exchange is seen in the following lines,
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
2.003696 arp who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
|
||||
2.003707 arp reply 10.1.2.4 is-at 00:00:00:00:00:06
|
||||
2.007698 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
|
||||
2.007710 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
|
||||
|
||||
Then node one, device one goes ahead and sends the echo packet to the UDP echo
|
||||
server at IP address 10.1.2.4.
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
2.003801 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.007803 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
|
||||
The server receives the echo request and turns the packet around trying to send
|
||||
it back to the source. The server knows that this address is on another network
|
||||
@@ -492,14 +494,14 @@ just like the first CSMA node had to do.
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4
|
||||
2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
|
||||
2.013815 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
|
||||
2.013828 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
|
||||
|
||||
The server then sends the echo back to the forwarding node.
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
|
||||
Looking back at the rightmost node of the point-to-point link,
|
||||
|
||||
@@ -514,7 +516,7 @@ the last line of the trace dump.
|
||||
|
||||
reading from file second-1-0.pcap, link-type PPP (PPP)
|
||||
2.003686 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
2.013921 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
|
||||
Lastly, you can look back at the node that originated the echo
|
||||
|
||||
@@ -522,13 +524,13 @@ Lastly, you can look back at the node that originated the echo
|
||||
|
||||
$ tcpdump -nn -tt -r second-0-0.pcap
|
||||
|
||||
and see that the echoed packet arrives back at the source at 2.007602 seconds,
|
||||
and see that the echoed packet arrives back at the source at 2.017607 seconds,
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
reading from file second-0-0.pcap, link-type PPP (PPP)
|
||||
2.000000 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.007602 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
2.017607 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
|
||||
Finally, recall that we added the ability to control the number of CSMA devices
|
||||
in the simulation by command line argument. You can change this argument in
|
||||
@@ -547,9 +549,10 @@ You should now see,
|
||||
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
|
||||
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
|
||||
'build' finished successfully (0.405s)
|
||||
Sent 1024 bytes to 10.1.2.5
|
||||
Received 1024 bytes from 10.1.1.1
|
||||
Received 1024 bytes from 10.1.2.5
|
||||
At time 2s client sent 1024 bytes to 10.1.2.5 port 9
|
||||
At time 2.0118s server received 1024 bytes from 10.1.1.1 port 49153
|
||||
At time 2.0118s server sent 1024 bytes to 10.1.1.1 port 49153
|
||||
At time 2.02461s client received 1024 bytes from 10.1.2.5 port 9
|
||||
|
||||
Notice that the echo server has now been relocated to the last of the CSMA
|
||||
nodes, which is 10.1.2.5 instead of the default case, 10.1.2.4.
|
||||
@@ -621,9 +624,10 @@ you will see the following output:
|
||||
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
|
||||
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
|
||||
'build' finished successfully (0.407s)
|
||||
Sent 1024 bytes to 10.1.2.101
|
||||
Received 1024 bytes from 10.1.1.1
|
||||
Received 1024 bytes from 10.1.2.101
|
||||
At time 2s client sent 1024 bytes to 10.1.2.101 port 9
|
||||
At time 2.0068s server received 1024 bytes from 10.1.1.1 port 49153
|
||||
At time 2.0068s server sent 1024 bytes to 10.1.1.1 port 49153
|
||||
At time 2.01761s client received 1024 bytes from 10.1.2.101 port 9
|
||||
|
||||
Note that the echo server is now located at 10.1.2.101 which corresponds to
|
||||
having 100 "extra" CSMA nodes with the echo server on the last one. If you
|
||||
@@ -655,8 +659,8 @@ entire CSMA network.
|
||||
.. sourcecode:: text
|
||||
|
||||
reading from file second-100-0.pcap, link-type EN10MB (Ethernet)
|
||||
2.003696 arp who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
|
||||
2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101
|
||||
2.006698 ARP, Request who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
|
||||
2.013815 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101, length 50
|
||||
|
||||
Now take a look at the ``tcpdump`` for ``second-101-0.pcap``.
|
||||
|
||||
@@ -669,12 +673,12 @@ You can now see that node 101 is really the participant in the echo exchange.
|
||||
.. sourcecode:: text
|
||||
|
||||
reading from file second-101-0.pcap, link-type EN10MB (Ethernet)
|
||||
2.003696 arp who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
|
||||
2.003696 arp reply 10.1.2.101 is-at 00:00:00:00:00:67
|
||||
2.003801 IP 10.1.1.1.49153 > 10.1.2.101.9: UDP, length 1024
|
||||
2.003801 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101
|
||||
2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
|
||||
2.003822 IP 10.1.2.101.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
2.006698 ARP, Request who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
|
||||
2.006698 ARP, Reply 10.1.2.101 is-at 00:00:00:00:00:67, length 50
|
||||
2.006803 IP 10.1.1.1.49153 > 10.1.2.101.9: UDP, length 1024
|
||||
2.013803 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101, length 50
|
||||
2.013828 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
|
||||
2.013828 IP 10.1.2.101.9 > 10.1.1.1.49153: UDP, length 1024
|
||||
|
||||
Models, Attributes and Reality
|
||||
******************************
|
||||
@@ -880,7 +884,7 @@ that we will connect via the point-to-point link.
|
||||
Next, we see an old friend. We instantiate a ``PointToPointHelper`` and
|
||||
set the associated default ``Attributes`` so that we create a five megabit
|
||||
per second transmitter on devices created using the helper and a two millisecond
|
||||
delay on channels created by the helper. We then ``Intall`` the devices
|
||||
delay on channels created by the helper. We then ``Install`` the devices
|
||||
on the nodes and the channel between them.
|
||||
|
||||
::
|
||||
@@ -1183,7 +1187,7 @@ repository you would type,
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ cp examples/third.cc scratch/mythird.cc
|
||||
$ cp examples/tutorial/third.cc scratch/mythird.cc
|
||||
$ ./waf
|
||||
$ ./waf --run scratch/mythird
|
||||
|
||||
@@ -1195,9 +1199,10 @@ Again, since we have set up the UDP echo applications just as we did in the
|
||||
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
|
||||
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
|
||||
'build' finished successfully (0.407s)
|
||||
Sent 1024 bytes to 10.1.2.4
|
||||
Received 1024 bytes from 10.1.3.3
|
||||
Received 1024 bytes from 10.1.2.4
|
||||
At time 2s client sent 1024 bytes to 10.1.2.4 port 9
|
||||
At time 2.01796s server received 1024 bytes from 10.1.3.3 port 49153
|
||||
At time 2.01796s server sent 1024 bytes to 10.1.3.3 port 49153
|
||||
At time 2.03364s client received 1024 bytes from 10.1.2.4 port 9
|
||||
|
||||
Recall that the first message, ``Sent 1024 bytes to 10.1.2.4``," is the
|
||||
UDP echo client sending a packet to the server. In this case, the client
|
||||
@@ -1235,19 +1240,18 @@ You should see some wifi-looking contents you haven't seen here before:
|
||||
|
||||
reading from file third-0-1.pcap, link-type IEEE802_11 (802.11)
|
||||
0.000025 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
|
||||
0.000263 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
|
||||
0.000279 Acknowledgment RA:00:00:00:00:00:09
|
||||
0.000552 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
|
||||
0.000568 Acknowledgment RA:00:00:00:00:00:07
|
||||
0.000664 Assoc Response AID(0) :: Succesful
|
||||
0.001001 Assoc Response AID(0) :: Succesful
|
||||
0.001145 Acknowledgment RA:00:00:00:00:00:0a
|
||||
0.001233 Assoc Response AID(0) :: Succesful
|
||||
0.001377 Acknowledgment RA:00:00:00:00:00:0a
|
||||
0.001597 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
|
||||
0.001613 Acknowledgment RA:00:00:00:00:00:08
|
||||
0.001691 Assoc Response AID(0) :: Succesful
|
||||
0.001835 Acknowledgment RA:00:00:00:00:00:0a
|
||||
0.000308 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
|
||||
0.000324 Acknowledgment RA:00:00:00:00:00:08
|
||||
0.000402 Assoc Response AID(0) :: Successful
|
||||
0.000546 Acknowledgment RA:00:00:00:00:00:0a
|
||||
0.000721 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
|
||||
0.000737 Acknowledgment RA:00:00:00:00:00:07
|
||||
0.000824 Assoc Response AID(0) :: Successful
|
||||
0.000968 Acknowledgment RA:00:00:00:00:00:0a
|
||||
0.001134 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
|
||||
0.001150 Acknowledgment RA:00:00:00:00:00:09
|
||||
0.001273 Assoc Response AID(0) :: Successful
|
||||
0.001417 Acknowledgment RA:00:00:00:00:00:0a
|
||||
0.102400 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
|
||||
0.204800 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
|
||||
0.307200 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
|
||||
@@ -1257,7 +1261,7 @@ probably understand what is going on and find the IP echo request and response
|
||||
packets in this trace. We leave it as an exercise to completely parse the
|
||||
trace dump.
|
||||
|
||||
Now, look at the pcap file of the right side of the point-to-point link,
|
||||
Now, look at the pcap file of the left side of the point-to-point link,
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
@@ -1268,8 +1272,8 @@ Again, you should see some familiar looking contents:
|
||||
.. sourcecode:: text
|
||||
|
||||
reading from file third-0-0.pcap, link-type PPP (PPP)
|
||||
2.002160 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.009767 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
|
||||
2.008151 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.026758 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
|
||||
|
||||
This is the echo packet going from left to right (from Wifi to CSMA) and back
|
||||
again across the point-to-point link.
|
||||
@@ -1285,8 +1289,8 @@ Again, you should see some familiar looking contents:
|
||||
.. sourcecode:: text
|
||||
|
||||
reading from file third-1-0.pcap, link-type PPP (PPP)
|
||||
2.005846 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
|
||||
2.011837 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
|
||||
|
||||
This is also the echo packet going from left to right (from Wifi to CSMA) and
|
||||
back again across the point-to-point link with slightly different timings
|
||||
@@ -1304,12 +1308,12 @@ You should see some familiar looking contents:
|
||||
.. sourcecode:: text
|
||||
|
||||
reading from file third-1-1.pcap, link-type EN10MB (Ethernet)
|
||||
2.005846 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
|
||||
2.005870 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
|
||||
2.005870 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.005975 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
|
||||
2.005975 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
|
||||
2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
|
||||
2.017837 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
|
||||
2.017861 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
|
||||
2.017861 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
|
||||
2.022966 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
|
||||
2.022966 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
|
||||
2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
|
||||
|
||||
This should be easily understood. If you've forgotten, go back and look at
|
||||
the discussion in ``second.cc``. This is the same sequence.
|
||||
@@ -1385,37 +1389,39 @@ they happen.
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
Build finished successfully (00:00:01)
|
||||
'build' finished successfully (5.989s)
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10, y = 0
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.41539, y = -0.811313
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.46199, y = -1.11303
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.52738, y = -1.46869
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.67099, y = -1.98503
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 5.6835, y = -2.14268
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.70932, y = -1.91689
|
||||
Sent 1024 bytes to 10.1.2.4
|
||||
Received 1024 bytes from 10.1.3.3
|
||||
Received 1024 bytes from 10.1.2.4
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 5.53175, y = -2.48576
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.58021, y = -2.17821
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.18915, y = -1.25785
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.7572, y = -0.434856
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.62404, y = 0.556238
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 4.74127, y = 1.54934
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 5.73934, y = 1.48729
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.18521, y = 0.59219
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.58121, y = 1.51044
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.27897, y = 2.22677
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.42888, y = 1.70014
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.40519, y = 1.91654
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.51981, y = 1.45166
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.34588, y = 2.01523
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.81046, y = 2.90077
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.89186, y = 3.29596
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.46617, y = 2.47732
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.05492, y = 1.56579
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.00393, y = 1.25054
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.00968, y = 1.35768
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.33503, y = 2.30328
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.18682, y = 3.29223
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.96865, y = 2.66873
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.3841, y = 0.923277
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.2049, y = 1.90708
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.8136, y = 1.11368
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.8452, y = 2.11318
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.9797, y = 3.10409
|
||||
At time 2s client sent 1024 bytes to 10.1.2.4 port 9
|
||||
At time 2.01796s server received 1024 bytes from 10.1.3.3 port 49153
|
||||
At time 2.01796s server sent 1024 bytes to 10.1.3.3 port 49153
|
||||
At time 2.03364s client received 1024 bytes from 10.1.2.4 port 9
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.3273, y = 4.04175
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.013, y = 4.76955
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.4317, y = 5.67771
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.4607, y = 5.91681
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.0155, y = 6.74878
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.0076, y = 6.62336
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.6285, y = 5.698
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.32, y = 4.97559
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.1134, y = 3.99715
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.8359, y = 4.68851
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 13.5953, y = 3.71789
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 12.7595, y = 4.26688
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.7629, y = 4.34913
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 11.2292, y = 5.19485
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 10.2344, y = 5.09394
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.3601, y = 4.60846
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.40025, y = 4.32795
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.14292, y = 4.99761
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 9.08299, y = 5.99581
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.26068, y = 5.42677
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 8.35917, y = 6.42191
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 7.66805, y = 7.14466
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.71414, y = 6.84456
|
||||
/NodeList/7/$ns3::MobilityModel/CourseChange x = 6.42489, y = 7.80181
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ access* communication medium. This gives us Ethernet-like functionality.
|
||||
|
||||
Net Device
|
||||
++++++++++
|
||||
It used to be the case that if you wanted to connect a computers to a network,
|
||||
It used to be the case that if you wanted to connect a computer to a network,
|
||||
you had to buy a specific kind of network cable and a hardware device called
|
||||
(in PC terminology) a *peripheral card* that needed to be installed in
|
||||
your computer. If the peripheral card implemented some networking function,
|
||||
@@ -743,6 +743,69 @@ took care of the hard part for you. The remaining lines of our first
|
||||
return 0;
|
||||
}
|
||||
|
||||
When the simulator will stop?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|ns3| is a Discrete Event (DE) simulator. In such a simulator, each event is
|
||||
associated with its execution time, and the simulation proceeds by executing
|
||||
events in the temporal order of simulation time. Events may cause future
|
||||
events to be scheduled (for example, a timer may reschedule itself to
|
||||
expire at the next interval).
|
||||
|
||||
The initial events are usually triggered by each object, e.g., IPv6 will
|
||||
schedule Router Advertisements, Neighbor Solicitations, etc.,
|
||||
an Application schedule the first packet sending event, etc.
|
||||
|
||||
When an event is processed, it may generate zero, one or more events.
|
||||
As a simulation executes, events are consumed, but more events may (or may
|
||||
not) be generated.
|
||||
The simulation will stop automatically when no further events are in the
|
||||
event queue, or when a special Stop event is found. The Stop event is
|
||||
created through the
|
||||
``Simulator::Stop (stopTime);`` function.
|
||||
|
||||
There is a typical case where ``Simulator::Stop`` is absolutely necessary
|
||||
to stop the simulation: when there is a self-sustaining event.
|
||||
Self-sustaining (or recurring) events are events that always reschedule
|
||||
themselves. As a consequence, they always keep the event queue non-empty.
|
||||
|
||||
There are many protocols and modules containing recurring events, e.g.:
|
||||
|
||||
* FlowMonitor - periodic check for lost packets
|
||||
* RIPng - periodic broadcast of routing tables update
|
||||
* etc.
|
||||
|
||||
In these cases, ``Simulator::Stop`` is necessary to gracefully stop the
|
||||
simulation. In addition, when |ns3| is in emulation mode, the
|
||||
``RealtimeSimulator`` is used to keep the simulation clock aligned with
|
||||
the machine clock, and ``Simulator::Stop`` is necessary to stop the
|
||||
process.
|
||||
|
||||
Many of the simulation programs in the tutorial do not explicitly call
|
||||
``Simulator::Stop``, since the event queue will automatically run out
|
||||
of events. However, these programs will also accept a call to
|
||||
``Simulator::Stop``. For example, the following additional statement
|
||||
in the first example program will schedule an explicit stop at 11 seconds:
|
||||
|
||||
::
|
||||
|
||||
+ Simulator::Stop (Seconds (11.0));
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
The above wil not actually change the behavior of this program, since
|
||||
this particular simulation naturally ends after 10 seconds. But if you
|
||||
were to change the stop time in the above statement from 11 seconds to 1
|
||||
second, you would notice that the simulation stops before any output is
|
||||
printed to the screen (since the output occurs around time 2 seconds of
|
||||
simulation time).
|
||||
|
||||
It is important to call ``Simulator::Stop`` *before* calling
|
||||
``Simulator::Run``; otherwise, ``Simulator::Run`` may never return control
|
||||
to the main program to execute the stop!
|
||||
|
||||
Building Your Script
|
||||
++++++++++++++++++++
|
||||
We have made it trivial to build your simple scripts. All you have to do is
|
||||
|
||||
@@ -103,19 +103,19 @@ some of the new lines of this diff:
|
||||
|
||||
::
|
||||
|
||||
+ std::string probeName;
|
||||
+ std::string probeTrace;
|
||||
+ std::string probeType;
|
||||
+ std::string tracePath;
|
||||
+ if (useV6 == false)
|
||||
+ {
|
||||
...
|
||||
+ probeName = "ns3::Ipv4PacketProbe";
|
||||
+ probeTrace = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
|
||||
+ probeType = "ns3::Ipv4PacketProbe";
|
||||
+ tracePath = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
...
|
||||
+ probeName = "ns3::Ipv6PacketProbe";
|
||||
+ probeTrace = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
|
||||
+ probeType = "ns3::Ipv6PacketProbe";
|
||||
+ tracePath = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
|
||||
+ }
|
||||
...
|
||||
+ // Use GnuplotHelper to plot the packet byte count over time
|
||||
@@ -129,12 +129,12 @@ some of the new lines of this diff:
|
||||
+ "Time (Seconds)",
|
||||
+ "Packet Byte Count");
|
||||
+
|
||||
+ // Specify the probe type, probe path (in configuration namespace), and
|
||||
+ // Specify the probe type, trace source path (in configuration namespace), and
|
||||
+ // probe output trace source ("OutputBytes") to plot. The fourth argument
|
||||
+ // specifies the name of the data series label on the plot. The last
|
||||
+ // argument formats the plot by specifying where the key should be placed.
|
||||
+ plotHelper.PlotProbe (probeName,
|
||||
+ probeTrace,
|
||||
+ plotHelper.PlotProbe (probeType,
|
||||
+ tracePath,
|
||||
+ "OutputBytes",
|
||||
+ "Packet Byte Count",
|
||||
+ GnuplotAggregator::KEY_BELOW);
|
||||
@@ -151,8 +151,8 @@ some of the new lines of this diff:
|
||||
+
|
||||
+ // Specify the probe type, probe path (in configuration namespace), and
|
||||
+ // probe output trace source ("OutputBytes") to write.
|
||||
+ fileHelper.WriteProbe (probeName,
|
||||
+ probeTrace,
|
||||
+ fileHelper.WriteProbe (probeType,
|
||||
+ tracePath,
|
||||
+ "OutputBytes");
|
||||
+
|
||||
Simulator::Stop (Seconds (20));
|
||||
@@ -161,7 +161,7 @@ some of the new lines of this diff:
|
||||
|
||||
|
||||
The careful reader will have noticed, when testing the IPv6 command
|
||||
line attribute, that ``seventh.cc`` had created a number of new output files:
|
||||
line attribute above, that ``seventh.cc`` had created a number of new output files:
|
||||
|
||||
::
|
||||
|
||||
@@ -178,6 +178,8 @@ by hooking the data collection components to |ns3| trace sources, and
|
||||
marshaling the data into a formatted ``gnuplot`` and into a formatted
|
||||
text file. In the next sections, we'll review each of these.
|
||||
|
||||
.. _GnuPlotHelper:
|
||||
|
||||
GnuplotHelper
|
||||
*************
|
||||
|
||||
@@ -257,26 +259,26 @@ variables for later use:
|
||||
|
||||
::
|
||||
|
||||
+ std::string probeName;
|
||||
+ std::string probeTrace;
|
||||
+ probeName = "ns3::Ipv6PacketProbe";
|
||||
+ probeTrace = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
|
||||
+ std::string probeType;
|
||||
+ std::string tracePath;
|
||||
+ probeType = "ns3::Ipv6PacketProbe";
|
||||
+ tracePath = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
|
||||
|
||||
We use them here:
|
||||
|
||||
::
|
||||
|
||||
+ // Specify the probe type, probe path (in configuration namespace), and
|
||||
+ // Specify the probe type, trace source path (in configuration namespace), and
|
||||
+ // probe output trace source ("OutputBytes") to plot. The fourth argument
|
||||
+ // specifies the name of the data series label on the plot. The last
|
||||
+ // argument formats the plot by specifying where the key should be placed.
|
||||
+ plotHelper.PlotProbe (probeName,
|
||||
+ probeTrace,
|
||||
+ plotHelper.PlotProbe (probeType,
|
||||
+ tracePath,
|
||||
+ "OutputBytes",
|
||||
+ "Packet Byte Count",
|
||||
+ GnuplotAggregator::KEY_BELOW);
|
||||
|
||||
The first two arguments are the name of the probe type and the probe trace.
|
||||
The first two arguments are the name of the probe type and the trace source path.
|
||||
These two are probably the hardest to determine when you try to use
|
||||
this framework to plot other traces. The probe trace here is the ``Tx``
|
||||
trace source of class ``Ipv6L3Protocol``. When we examine this class
|
||||
@@ -319,6 +321,7 @@ the data out of the probed Packet object:
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::Ipv6PacketProbe")
|
||||
.SetParent<Probe> ()
|
||||
.SetGroupName ("Stats")
|
||||
.AddConstructor<Ipv6PacketProbe> ()
|
||||
.AddTraceSource ( "Output",
|
||||
"The packet plus its IPv6 object and interface that serve as the output for this probe",
|
||||
@@ -359,6 +362,8 @@ The following traced values are supported with Probes as of this writing:
|
||||
+------------------+-------------------+------------------------------------+
|
||||
| bool | BooleanProbe | stats/model/uinteger-16-probe.h |
|
||||
+------------------+-------------------+------------------------------------+
|
||||
| ns3::Time | TimeProbe | stats/model/time-probe.h |
|
||||
+------------------+-------------------+------------------------------------+
|
||||
|
||||
The following TraceSource types are supported by Probes as of this writing:
|
||||
|
||||
@@ -417,17 +422,17 @@ FORMATTED is specified) with a format string such as follows:
|
||||
+ // Set the labels for this formatted output file.
|
||||
+ fileHelper.Set2dFormat ("Time (Seconds) = %.3e\tPacket Byte Count = %.0f");
|
||||
|
||||
Finally, the probe of interest must be hooked. Again, the probeName and
|
||||
probeTrace variables in this example are used, and the probe's output
|
||||
Finally, the trace source of interest must be hooked. Again, the probeType and
|
||||
tracePath variables in this example are used, and the probe's output
|
||||
trace source "OutputBytes" is hooked:
|
||||
|
||||
::
|
||||
|
||||
+
|
||||
+ // Specify the probe type, probe path (in configuration namespace), and
|
||||
+ // Specify the probe type, trace source path (in configuration namespace), and
|
||||
+ // probe output trace source ("OutputBytes") to write.
|
||||
+ fileHelper.WriteProbe (probeName,
|
||||
+ probeTrace,
|
||||
+ fileHelper.WriteProbe (probeType,
|
||||
+ tracePath,
|
||||
+ "OutputBytes");
|
||||
+
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ from the main web site. The second is to fetch and build development
|
||||
copies of |ns3|. We'll walk through both examples since the tools
|
||||
involved are slightly different.
|
||||
|
||||
Downloading ns-3
|
||||
****************
|
||||
Downloading |ns3|
|
||||
*****************
|
||||
|
||||
The |ns3| system as a whole is a fairly complex system and has a
|
||||
number of dependencies on other components. Along with the systems you will
|
||||
@@ -43,7 +43,7 @@ editor) you will need to ensure that a number of additional libraries are
|
||||
present on your system before proceeding. |ns3| provides a wiki
|
||||
page that includes pages with many useful hints and tips.
|
||||
One such page is the "Installation" page,
|
||||
http://www.nsnam.org/wiki/index.php/Installation.
|
||||
http://www.nsnam.org/wiki/Installation.
|
||||
|
||||
The "Prerequisites" section of this wiki page explains which packages are
|
||||
required to support common |ns3| options, and also provides the
|
||||
@@ -62,7 +62,7 @@ and running on the target system.
|
||||
|
||||
The |ns3| code is available in Mercurial repositories on the server
|
||||
http://code.nsnam.org. You can also download a tarball release at
|
||||
http://www.nsnam.org/releases/, or you can work with repositories
|
||||
http://www.nsnam.org/release/, or you can work with repositories
|
||||
using Mercurial. We recommend using Mercurial unless there's a good reason
|
||||
not to. See the end of this section for instructions on how to get a tarball
|
||||
release.
|
||||
@@ -72,8 +72,14 @@ The simplest way to get started using Mercurial repositories is to use the
|
||||
downloading and building of various subsystems of |ns3| for you. We
|
||||
recommend that you begin your |ns3| work in this environment.
|
||||
|
||||
Downloading ns-3 Using a Tarball
|
||||
++++++++++++++++++++++++++++++++
|
||||
One practice is to create a directory called ``workspace`` in one's home
|
||||
directory under which one can keep local Mercurial repositories.
|
||||
Any directory name will do, but we'll assume that ``workspace`` is used
|
||||
herein (note: ``repos`` may also be used in some documentation as
|
||||
an example directory name).
|
||||
|
||||
Downloading |ns3| Using a Tarball
|
||||
+++++++++++++++++++++++++++++++++
|
||||
|
||||
A tarball is a particular format of software archive where multiple
|
||||
files are bundled together and the archive possibly compressed.
|
||||
@@ -85,43 +91,43 @@ Let's assume that you, as a user, wish to build |ns3| in a local
|
||||
directory called ``workspace``.
|
||||
If you adopt the ``workspace`` directory approach, you can
|
||||
get a copy of a release by typing the following into your Linux shell
|
||||
(substitute the appropriate version numbers, of course):
|
||||
|
||||
::
|
||||
(substitute the appropriate version numbers, of course)::
|
||||
|
||||
$ cd
|
||||
$ mkdir workspace
|
||||
$ cd workspace
|
||||
$ wget http://www.nsnam.org/releases/ns-allinone-3.17.tar.bz2
|
||||
$ tar xjf ns-allinone-3.17.tar.bz2
|
||||
$ wget http://www.nsnam.org/release/ns-allinone-3.23.tar.bz2
|
||||
$ tar xjf ns-allinone-3.23.tar.bz2
|
||||
|
||||
If you change into the directory ``ns-allinone-3.17`` you should see a
|
||||
number of files:
|
||||
If you change into the directory ``ns-allinone-3.23`` you should see a
|
||||
number of files::
|
||||
|
||||
::
|
||||
$ ls
|
||||
bake constants.py ns-3.23 README
|
||||
build.py netanim-3.106 pybindgen-0.17.0.886 util.py
|
||||
|
||||
bake constants.py ns-3.17 README
|
||||
build.py netanim-3.103 pybindgen-0.16.0.825 util.py
|
||||
You are now ready to build the base |ns3| distribution.
|
||||
|
||||
You are now ready to build the |ns3| distribution.
|
||||
|
||||
Downloading ns-3 Using Bake
|
||||
Downloading |ns3| Using Bake
|
||||
++++++++++++++++++++++++++++
|
||||
|
||||
Bake is a tool for distributed integration and building,
|
||||
developed for the |ns3| project. First of all, Bake is
|
||||
developed in Python, and should be fetched from the project's
|
||||
master code repositories using a tool called Mercurial, so to
|
||||
run Bake one must have Python and mercurial on one's machine.
|
||||
developed for the |ns3| project. Bake can be used to fetch development
|
||||
versions of the |ns3| software, and to download and build extensions to the
|
||||
base |ns3| distribution, such as the Direct Code Execution environment,
|
||||
Network Simulation Cradle, ability to create new Python bindings, and
|
||||
others.
|
||||
|
||||
One practice is to create a directory called ``workspace`` in one's home
|
||||
directory under which one can keep local Mercurial repositories.
|
||||
Any directory name will do, but we'll assume that ``workspace`` is used
|
||||
herein (note: ``repos`` may also be used in some documentation as
|
||||
an example directory name). You can get a copy of ``bake`` by typing the
|
||||
following into your Linux shell (assuming you have installed Mercurial):
|
||||
In recent |ns3| releases, Bake has been included in the release
|
||||
tarball. The configuration file included in the released version
|
||||
will allow one to download any software that was current at the
|
||||
time of the release. That is, for example, the version of Bake that
|
||||
is distributed with the ``ns-3.21`` release can be used to fetch components
|
||||
for that |ns3| release or earlier, but can't be used to fetch components
|
||||
for later releases (unless the ``bakeconf.xml`` file is updated).
|
||||
|
||||
::
|
||||
You can also get the most recent copy of ``bake`` by typing the
|
||||
following into your Linux shell (assuming you have installed Mercurial)::
|
||||
|
||||
$ cd
|
||||
$ mkdir workspace
|
||||
@@ -133,20 +139,20 @@ following displayed,
|
||||
|
||||
::
|
||||
|
||||
...
|
||||
destination directory: bake
|
||||
requesting all changes
|
||||
adding changesets
|
||||
adding manifests
|
||||
adding file changes
|
||||
added 252 changesets with 661 changes to 62 files
|
||||
added 339 changesets with 796 changes to 63 files
|
||||
updating to branch default
|
||||
45 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
|
||||
After the clone command completes, you should have a directory called
|
||||
``bake``, the contents of which should look something like the following:
|
||||
|
||||
::
|
||||
``bake``, the contents of which should look something like the following::
|
||||
|
||||
$ ls
|
||||
bake bakeconf.xml doc generate-binary.py TODO
|
||||
bake.py examples test
|
||||
|
||||
@@ -157,10 +163,10 @@ distribution of your choice.
|
||||
|
||||
There are a few configuration targets available:
|
||||
|
||||
1. ``ns-3.17``: the module corresponding to the release; it will download
|
||||
1. ``ns-3.23``: the module corresponding to the release; it will download
|
||||
components similar to the release tarball.
|
||||
2. ``ns-3-dev``: a similar module but using the development code tree
|
||||
3. ``ns-allinone-3.17``: the module that includes other optional features
|
||||
3. ``ns-allinone-3.23``: the module that includes other optional features
|
||||
such as click routing, openflow for |ns3|, and the Network Simulation
|
||||
Cradle
|
||||
4. ``ns-3-allinone``: similar to the released version of the allinone
|
||||
@@ -178,7 +184,7 @@ code either by inspection of the repository list or by going to the
|
||||
`"ns-3 Releases"
|
||||
<http://www.nsnam.org/releases>`_
|
||||
web page and clicking on the latest release link. We'll proceed in
|
||||
this tutorial example with ``ns-3.17``.
|
||||
this tutorial example with ``ns-3.23``.
|
||||
|
||||
We are now going to use the bake tool to pull down the various pieces of
|
||||
|ns3| you will be using. First, we'll say a word about running bake.
|
||||
@@ -187,28 +193,27 @@ bake works by downloading source packages into a source directory,
|
||||
and installing libraries into a build directory. bake can be run
|
||||
by referencing the binary, but if one chooses to run bake from
|
||||
outside of the directory it was downloaded into, it is advisable
|
||||
to put bake into your path, such as follows (Linux bash shell example):
|
||||
to put bake into your path, such as follows (Linux bash shell example).
|
||||
First, change into the 'bake' directory, and then set the following
|
||||
environment variables
|
||||
|
||||
::
|
||||
|
||||
$ export BAKE_HOME=`pwd`/bake
|
||||
$ export PATH=$PATH:$BAKE_HOME
|
||||
$ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
|
||||
$ export BAKE_HOME=`pwd`
|
||||
$ export PATH=$PATH:$BAKE_HOME:$BAKE_HOME/build/bin
|
||||
$ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME:$BAKE_HOME/build/lib
|
||||
|
||||
However, setting environment variables is not strictly necessary to
|
||||
complete this tutorial, so we'll call bake directly by specifying the path
|
||||
to it in our shell commands.
|
||||
This will put the bake.py program into the shell's path, and will allow
|
||||
other programs to find executables and libraries created by bake. Although
|
||||
several bake use cases do not require setting PATH and PYTHONPATH as above,
|
||||
full builds of ns-3-allinone (with the optional packages) typically do.
|
||||
|
||||
Step into the workspace directory and type the following into your shell:
|
||||
Step into the workspace directory and type the following into your shell::
|
||||
|
||||
::
|
||||
|
||||
$ ./bake.py configure -e ns-3.17
|
||||
$ ./bake.py configure -e ns-3.23
|
||||
|
||||
Next, we'l ask bake to check whether we have enough tools to download
|
||||
various components. Type:
|
||||
|
||||
::
|
||||
various components. Type::
|
||||
|
||||
$ ./bake.py check
|
||||
|
||||
@@ -238,41 +243,38 @@ You should see something like the following,
|
||||
|
||||
In particular, download tools such as Mercurial, CVS, GIT, and Bazaar
|
||||
are our principal concerns at this point, since they allow us to fetch
|
||||
the code. Please install missing tools at this stage if you are able to.
|
||||
the code. Please install missing tools at this stage, in the usual
|
||||
way for your system (if you are able to), or contact your system
|
||||
administrator as needed to install these tools.
|
||||
|
||||
Next, try to download the software:
|
||||
Next, try to download the software::
|
||||
|
||||
::
|
||||
$ ./bake.py download
|
||||
|
||||
./bake.py download
|
||||
|
||||
should yield something like:
|
||||
|
||||
::
|
||||
should yield something like::
|
||||
|
||||
>> Searching for system dependency pygoocanvas - OK
|
||||
>> Searching for system dependency python-dev - OK
|
||||
>> Searching for system dependency pygraphviz - OK
|
||||
>> Downloading pybindgen-0.16.0.825 - OK
|
||||
>> Downloading pybindgen-0.17.0.886 - OK
|
||||
>> Searching for system dependency g++ - OK
|
||||
>> Searching for system dependency qt4 - OK
|
||||
>> Downloading netanim-3.103 - OK
|
||||
>> Downloading ns-3.17 - OK
|
||||
>> Downloading netanim-3.106 - OK
|
||||
>> Downloading ns-3.23 - OK
|
||||
|
||||
The above suggests that three sources have been downloaded. Check the
|
||||
``source`` directory now and type ``ls``; one should see:
|
||||
``source`` directory now and type ``ls``; one should see::
|
||||
|
||||
::
|
||||
|
||||
netanim-3.103 ns-3.17 pybindgen-0.16.0.825
|
||||
$ ls
|
||||
netanim-3.106 ns-3.23 pybindgen-0.17.0.886
|
||||
|
||||
You are now ready to build the |ns3| distribution.
|
||||
|
||||
Building ns-3
|
||||
*************
|
||||
Building |ns3|
|
||||
**************
|
||||
|
||||
Building with build.py
|
||||
++++++++++++++++++++++
|
||||
Building with ``build.py``
|
||||
++++++++++++++++++++++++++
|
||||
When working from a released tarball, the first time you build the
|
||||
|ns3| project you can build using a convenience program found in the
|
||||
``allinone`` directory. This program is called ``build.py``. This
|
||||
@@ -283,10 +285,8 @@ native |ns3| build system, Waf, to be introduced later in this tutorial.
|
||||
|
||||
If you downloaded
|
||||
using a tarball you should have a directory called something like
|
||||
``ns-allinone-3.17`` under your ``~/workspace`` directory.
|
||||
Type the following:
|
||||
|
||||
::
|
||||
``ns-allinone-3.23`` under your ``~/workspace`` directory.
|
||||
Type the following::
|
||||
|
||||
$ ./build.py --enable-examples --enable-tests
|
||||
|
||||
@@ -299,43 +299,39 @@ are not necessary for your work, if you wish.
|
||||
|
||||
You will see lots of typical compiler output messages displayed as the build
|
||||
script builds the various pieces you downloaded. Eventually you should see the
|
||||
following magic words:
|
||||
following::
|
||||
|
||||
::
|
||||
|
||||
Waf: Leaving directory `/path/to/workspace/ns-allinone-3.17/ns-3.17/build'
|
||||
Waf: Leaving directory `/path/to/workspace/ns-allinone-3.23/ns-3.23/build'
|
||||
'build' finished successfully (6m25.032s)
|
||||
|
||||
Modules built:
|
||||
antenna aodv applications
|
||||
bridge buildings config-store
|
||||
core csma csma-layout
|
||||
dsdv dsr emu
|
||||
energy fd-net-device flow-monitor
|
||||
internet lte mesh
|
||||
dsdv dsr energy
|
||||
fd-net-device flow-monitor internet
|
||||
lr-wpan lte mesh
|
||||
mobility mpi netanim (no Python)
|
||||
network nix-vector-routing olsr
|
||||
point-to-point point-to-point-layout propagation
|
||||
spectrum stats tap-bridge
|
||||
test (no Python) tools topology-read
|
||||
uan virtual-net-device wifi
|
||||
wimax
|
||||
|
||||
sixlowpan spectrum stats
|
||||
tap-bridge test (no Python) topology-read
|
||||
uan virtual-net-device wave
|
||||
wifi wimax
|
||||
|
||||
Modules not built (see ns-3 tutorial for explanation):
|
||||
brite click openflow
|
||||
visualizer
|
||||
|
||||
Leaving directory `./ns-3.17'
|
||||
Leaving directory `./ns-3.23'
|
||||
|
||||
Regarding the portion about modules not built:
|
||||
|
||||
::
|
||||
Regarding the portion about modules not built::
|
||||
|
||||
Modules not built (see ns-3 tutorial for explanation):
|
||||
brite click openflow
|
||||
visualizer
|
||||
|
||||
This just means that some ns-3 modules that have dependencies on
|
||||
This just means that some |ns3| modules that have dependencies on
|
||||
outside libraries may not have been built, or that the configuration
|
||||
specifically asked not to build them. It does not mean that the
|
||||
simulator did not build successfully or that it will provide wrong
|
||||
@@ -351,20 +347,16 @@ may continue to use it to build |ns3|. Type
|
||||
|
||||
$ ./bake.py build
|
||||
|
||||
and you should see something like:
|
||||
and you should see something like::
|
||||
|
||||
::
|
||||
|
||||
>> Building pybindgen-0.16.0.825 - OK
|
||||
>> Building netanim-3.103 - OK
|
||||
>> Building ns-3.17 - OK
|
||||
>> Building pybindgen-0.17.0.886 - OK
|
||||
>> Building netanim-3.106 - OK
|
||||
>> Building ns-3.23 - OK
|
||||
|
||||
*Hint: you can also perform both steps, download and build by calling 'bake.py deploy'.*
|
||||
|
||||
If there happens to be a failure, please have a look at what the following
|
||||
command tells you; it may give a hint as to a missing dependency:
|
||||
|
||||
::
|
||||
command tells you; it may give a hint as to a missing dependency::
|
||||
|
||||
$ ./bake.py show
|
||||
|
||||
@@ -390,83 +382,96 @@ build the optimized version of the code. By default you have configured
|
||||
your project to build the debug version. Let's tell the project to
|
||||
make an optimized build. To explain to Waf that it should do optimized
|
||||
builds that include the examples and tests, you will need to execute the
|
||||
following commands,
|
||||
|
||||
::
|
||||
following commands::
|
||||
|
||||
$ ./waf clean
|
||||
$ ./waf -d optimized --enable-examples --enable-tests configure
|
||||
$ ./waf --build-profile=optimized --enable-examples --enable-tests configure
|
||||
|
||||
This runs Waf out of the local directory (which is provided as a convenience
|
||||
for you). The first command to clean out the previous build is not
|
||||
typically strictly necessary but is good practice; it will remove the
|
||||
typically strictly necessary but is good practice (but see `Build Profiles`_,
|
||||
below); it will remove the
|
||||
previously built libraries and object files found in directory ``build/``.
|
||||
When the project is reconfigured and the build system checks for various
|
||||
dependencies, you should see
|
||||
output that looks similar to the following,
|
||||
output that looks similar to the following::
|
||||
|
||||
::
|
||||
|
||||
Checking for program g++ : ok /usr/bin/g++
|
||||
Checking for program cpp : ok /usr/bin/cpp
|
||||
Checking for program ar : ok /usr/bin/ar
|
||||
Checking for program ranlib : ok /usr/bin/ranlib
|
||||
Checking for g++ : ok
|
||||
Checking for program pkg-config : ok /usr/bin/pkg-config
|
||||
Checking for -Wno-error=deprecated-declarations support : yes
|
||||
Checking for -Wl,--soname=foo support : yes
|
||||
Checking for header stdlib.h : ok
|
||||
Checking for header signal.h : ok
|
||||
Checking for header pthread.h : ok
|
||||
Checking for high precision time implementation : 128-bit integer
|
||||
Checking for header stdint.h : ok
|
||||
Checking for header inttypes.h : ok
|
||||
Checking for header sys/inttypes.h : not found
|
||||
Checking for library rt : ok
|
||||
Checking for header netpacket/packet.h : ok
|
||||
Checking for pkg-config flags for GSL : ok
|
||||
Checking for header linux/if_tun.h : ok
|
||||
Checking for pkg-config flags for GTK_CONFIG_STORE : ok
|
||||
Checking for pkg-config flags for LIBXML2 : ok
|
||||
Checking for library sqlite3 : ok
|
||||
Checking for NSC location : ok ../nsc (guessed)
|
||||
Checking for library dl : ok
|
||||
Checking for NSC supported architecture x86_64 : ok
|
||||
Checking for program python : ok /usr/bin/python
|
||||
Checking for Python version >= 2.3 : ok 2.5.2
|
||||
Checking for library python2.5 : ok
|
||||
Checking for program python2.5-config : ok /usr/bin/python2.5-config
|
||||
Checking for header Python.h : ok
|
||||
Checking for -fvisibility=hidden support : yes
|
||||
Checking for pybindgen location : ok ../pybindgen (guessed)
|
||||
Checking for Python module pybindgen : ok
|
||||
Checking for pybindgen version : ok 0.10.0.640
|
||||
Checking for Python module pygccxml : ok
|
||||
Checking for pygccxml version : ok 0.9.5
|
||||
Checking for program gccxml : ok /usr/local/bin/gccxml
|
||||
Checking for gccxml version : ok 0.9.0
|
||||
Checking for program sudo : ok /usr/bin/sudo
|
||||
Checking for program hg : ok /usr/bin/hg
|
||||
Checking for program valgrind : ok /usr/bin/valgrind
|
||||
Setting top to : .
|
||||
Setting out to : build
|
||||
Checking for 'gcc' (c compiler) : /usr/bin/gcc
|
||||
Checking for cc version : 4.2.1
|
||||
Checking for 'g++' (c++ compiler) : /usr/bin/g++
|
||||
Checking boost includes : 1_46_1
|
||||
Checking boost libs : ok
|
||||
Checking for boost linkage : ok
|
||||
Checking for click location : not found
|
||||
Checking for program pkg-config : /sw/bin/pkg-config
|
||||
Checking for 'gtk+-2.0' >= 2.12 : yes
|
||||
Checking for 'libxml-2.0' >= 2.7 : yes
|
||||
Checking for type uint128_t : not found
|
||||
Checking for type __uint128_t : yes
|
||||
Checking high precision implementation : 128-bit integer (default)
|
||||
Checking for header stdint.h : yes
|
||||
Checking for header inttypes.h : yes
|
||||
Checking for header sys/inttypes.h : not found
|
||||
Checking for header sys/types.h : yes
|
||||
Checking for header sys/stat.h : yes
|
||||
Checking for header dirent.h : yes
|
||||
Checking for header stdlib.h : yes
|
||||
Checking for header signal.h : yes
|
||||
Checking for header pthread.h : yes
|
||||
Checking for header stdint.h : yes
|
||||
Checking for header inttypes.h : yes
|
||||
Checking for header sys/inttypes.h : not found
|
||||
Checking for library rt : not found
|
||||
Checking for header netpacket/packet.h : not found
|
||||
Checking for header sys/ioctl.h : yes
|
||||
Checking for header net/if.h : not found
|
||||
Checking for header net/ethernet.h : yes
|
||||
Checking for header linux/if_tun.h : not found
|
||||
Checking for header netpacket/packet.h : not found
|
||||
Checking for NSC location : not found
|
||||
Checking for 'mpic++' : yes
|
||||
Checking for 'sqlite3' : yes
|
||||
Checking for header linux/if_tun.h : not found
|
||||
Checking for program sudo : /usr/bin/sudo
|
||||
Checking for program valgrind : /sw/bin/valgrind
|
||||
Checking for 'gsl' : yes
|
||||
Checking for compilation flag -Wno-error=deprecated-d... support : ok
|
||||
Checking for compilation flag -Wno-error=deprecated-d... support : ok
|
||||
Checking for compilation flag -fstrict-aliasing... support : ok
|
||||
Checking for compilation flag -fstrict-aliasing... support : ok
|
||||
Checking for compilation flag -Wstrict-aliasing... support : ok
|
||||
Checking for compilation flag -Wstrict-aliasing... support : ok
|
||||
Checking for program doxygen : /usr/local/bin/doxygen
|
||||
---- Summary of optional NS-3 features:
|
||||
Threading Primitives : enabled
|
||||
Real Time Simulator : enabled
|
||||
Emulated Net Device : enabled
|
||||
GNU Scientific Library (GSL) : enabled
|
||||
Tap Bridge : enabled
|
||||
Build profile : debug
|
||||
Build directory : build
|
||||
Python Bindings : enabled
|
||||
BRITE Integration : not enabled (BRITE not enabled (see option --with-brite))
|
||||
NS-3 Click Integration : not enabled (nsclick not enabled (see option --with-nsclick))
|
||||
GtkConfigStore : enabled
|
||||
XmlIo : enabled
|
||||
Threading Primitives : enabled
|
||||
Real Time Simulator : enabled (librt is not available)
|
||||
Emulated Net Device : enabled (<netpacket/packet.h> include not detected)
|
||||
File descriptor NetDevice : enabled
|
||||
Tap FdNetDevice : not enabled (needs linux/if_tun.h)
|
||||
Emulation FdNetDevice : not enabled (needs netpacket/packet.h)
|
||||
PlanetLab FdNetDevice : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
|
||||
Network Simulation Cradle : not enabled (NSC not found (see option --with-nsc))
|
||||
MPI Support : enabled
|
||||
NS-3 OpenFlow Integration : not enabled (Required boost libraries not found, missing: system, signals, filesystem)
|
||||
SQlite stats data output : enabled
|
||||
Network Simulation Cradle : enabled
|
||||
Python Bindings : enabled
|
||||
Python API Scanning Support : enabled
|
||||
Tap Bridge : not enabled (<linux/if_tun.h> include not detected)
|
||||
PyViz visualizer : enabled
|
||||
Use sudo to set suid bit : not enabled (option --enable-sudo not selected)
|
||||
Build tests : enabled
|
||||
Build examples : enabled
|
||||
Static build : not enabled (option --enable-static not selected)
|
||||
'configure' finished successfully (2.870s)
|
||||
GNU Scientific Library (GSL) : enabled
|
||||
'configure' finished successfully (1.944s)
|
||||
|
||||
Note the last part of the above output. Some ns-3 options are not enabled by
|
||||
Note the last part of the above output. Some |ns3| options are not enabled by
|
||||
default or require support from the underlying system to work properly.
|
||||
For instance, to enable XmlTo, the library libxml-2.0 must be found on the
|
||||
system. If this library were not found, the corresponding |ns3| feature
|
||||
@@ -479,7 +484,7 @@ Now go ahead and switch back to the debug build that includes the examples and t
|
||||
::
|
||||
|
||||
$ ./waf clean
|
||||
$ ./waf -d debug --enable-examples --enable-tests configure
|
||||
$ ./waf --build-profile=debug --enable-examples --enable-tests configure
|
||||
|
||||
The build system is now configured and you can build the debug versions of
|
||||
the |ns3| programs by simply typing
|
||||
@@ -491,73 +496,245 @@ the |ns3| programs by simply typing
|
||||
Okay, sorry, I made you build the |ns3| part of the system twice,
|
||||
but now you know how to change the configuration and build optimized code.
|
||||
|
||||
The build.py script discussed above supports also the ``--enable-examples``
|
||||
and ``enable-tests`` arguments, but in general, does not directly support
|
||||
other waf options; for example, this will not work:
|
||||
|
||||
::
|
||||
|
||||
$ ./build.py --disable-python
|
||||
|
||||
will result in
|
||||
|
||||
::
|
||||
|
||||
build.py: error: no such option: --disable-python
|
||||
|
||||
However, the special operator ``--`` can be used to pass additional
|
||||
options through to waf, so instead of the above, the following will work:
|
||||
|
||||
::
|
||||
|
||||
$ ./build.py -- --disable-python
|
||||
|
||||
as it generates the underlying command ``./waf configure --disable-python``.
|
||||
|
||||
Here are a few more introductory tips about Waf.
|
||||
Some waf commands are meaningful during the build phase and some commands are valid
|
||||
in the configuration phase. For example, if you wanted to use the emulation
|
||||
|
||||
Configure vs. Build
|
||||
===================
|
||||
|
||||
Some Waf commands are only meaningful during the configure phase and some commands are valid
|
||||
in the build phase. For example, if you wanted to use the emulation
|
||||
features of |ns3|, you might want to enable setting the suid bit using
|
||||
sudo as described above. This turns out to be a configuration-time command, and so
|
||||
you could reconfigure using the following command that also includes the examples and tests
|
||||
you could reconfigure using the following command that also includes the examples and tests.
|
||||
|
||||
::
|
||||
|
||||
$ ./waf configure -d debug --enable-sudo --enable-examples --enable-tests
|
||||
$ ./waf configure --enable-sudo --enable-examples --enable-tests
|
||||
|
||||
If you do this, waf will have run sudo to change the socket creator programs of the
|
||||
emulation code to run as root. There are many other configure- and build-time options
|
||||
available in waf. To explore these options, type:
|
||||
If you do this, Waf will have run sudo to change the socket creator programs of the
|
||||
emulation code to run as root.
|
||||
|
||||
::
|
||||
There are many other configure- and build-time options
|
||||
available in Waf. To explore these options, type::
|
||||
|
||||
$ ./waf --help
|
||||
|
||||
We'll use some of the testing-related commands in the next section.
|
||||
|
||||
Finally, as an aside, it is possible to specify that waf builds the
|
||||
project in
|
||||
a directory different than the default ``build/`` directory by passing
|
||||
the ``-o`` option to configure; e.g.
|
||||
Build Profiles
|
||||
==============
|
||||
|
||||
We already saw how you can configure Waf for ``debug`` or ``optimized`` builds::
|
||||
|
||||
$ ./waf --build-profile=debug
|
||||
|
||||
There is also an intermediate build profile, ``release``. ``-d`` is a
|
||||
synonym for ``--build-profile``.
|
||||
|
||||
The build profile controls the use of logging, assertions, and compiler optimization:
|
||||
|
||||
+--------------------+---------------------------------+-----------------------------------------------------------------+
|
||||
| Feature | Build Profile |
|
||||
+ +---------------------------------+-------------------------------+---------------------------------+
|
||||
| | ``debug`` | ``release`` | ``optimized`` |
|
||||
+====================+=================================+===============================+=================================+
|
||||
| Enabled Features | | ``NS3_BUILD_PROFILE_DEBUG`` | ``NS3_BUILD_PROFILE_RELEASE`` | ``NS3_BUILD_PROFILE_OPTIMIZED`` |
|
||||
| | | ``NS_LOG...`` | | |
|
||||
| | | ``NS_ASSERT...`` | | |
|
||||
+--------------------+---------------------------------+-------------------------------+---------------------------------+
|
||||
| Code Wrapper Macro | ``NS_BUILD_DEBUG(code)`` | ``NS_BUILD_RELEASE(code)`` | ``NS_BUILD_OPTIMIZED(code)`` |
|
||||
+--------------------+---------------------------------+-------------------------------+---------------------------------+
|
||||
| Compiler Flags | ``-O0 -ggdb -g3`` | ``-O3 -g0`` | ``-O3 -g`` |
|
||||
| | | ``-fomit-frame-pointer`` | ``-fstrict-overflow`` |
|
||||
| | | | ``-march=native`` |
|
||||
+--------------------+---------------------------------+-------------------------------+---------------------------------+
|
||||
|
||||
As you can see, logging and assertions are only available in debug builds.
|
||||
Recommended practice is to develop your scenario in debug mode, then
|
||||
conduct repetitive runs (for statistics or changing parameters) in
|
||||
optimized build profile.
|
||||
|
||||
If you have code that should only run in specific build profiles,
|
||||
use the indicated Code Wrapper macro:
|
||||
|
||||
.. sourcecode:: cpp
|
||||
|
||||
NS_BUILD_DEBUG (std::cout << "Part of an output line..." << std::flush; timer.Start ());
|
||||
DoLongInvolvedComputation ();
|
||||
NS_BUILD_DEBUG (timer.Stop (); std::cout << "Done: " << timer << std::endl;)
|
||||
|
||||
By default Waf puts the build artifacts in the ``build`` directory.
|
||||
You can specify a different output directory with the ``--out``
|
||||
option, e.g.
|
||||
|
||||
::
|
||||
|
||||
$ ./waf configure -d debug -o build/debug --enable-examples --enable-tests
|
||||
$ ./waf configure --out=foo
|
||||
|
||||
This allows users to work with multiple builds rather than always
|
||||
overwriting the last build.
|
||||
Combining this with build profiles lets you switch between the different
|
||||
compile options in a clean way::
|
||||
|
||||
In the examples above, waf uses GCC C++ compiler, command ``g++``, for
|
||||
building ns-3. However, it's possible to change C++ compiler used by waf.
|
||||
Say one wants to use Clang C++ compiler, command ``clang++``; it's done by
|
||||
$ ./waf configure --build-profile=debug --out=build/debug
|
||||
$ ./waf build
|
||||
...
|
||||
$ ./waf configure --build-profile=optimized --out=build/optimized
|
||||
$ ./waf build
|
||||
...
|
||||
|
||||
This allows you to work with multiple builds rather than always
|
||||
overwriting the last build. When you switch, Waf will only compile
|
||||
what it has to, instead of recompiling everything.
|
||||
|
||||
When you do switch build profiles like this, you have to be careful
|
||||
to give the same configuration parameters each time. It may be convenient
|
||||
to define some environment variables to help you avoid mistakes::
|
||||
|
||||
$ export NS3CONFIG="--enable-examples --enable-tests"
|
||||
$ export NS3DEBUG="--build-profile=debug --out=build/debug"
|
||||
$ export NS3OPT=="--build-profile=optimized --out=build/optimized"
|
||||
|
||||
$ ./waf configure $NS3CONFIG $NS3DEBUG
|
||||
$ ./waf build
|
||||
...
|
||||
$ ./waf configure $NS3CONFIG $NS3OPT
|
||||
$ ./waf build
|
||||
|
||||
Compilers and Flags
|
||||
===================
|
||||
|
||||
In the examples above, Waf uses the GCC C++ compiler, ``g++``, for
|
||||
building |ns3|. However, it's possible to change the C++ compiler used by Waf
|
||||
by defining the ``CXX`` environment variable.
|
||||
For example, to use the Clang C++ compiler, ``clang++``,
|
||||
|
||||
::
|
||||
|
||||
$ CXX="clang++" ./waf configure
|
||||
$ ./waf build
|
||||
|
||||
One can also set up waf to do distributed compilation with ``distcc`` in
|
||||
a similar way:
|
||||
|
||||
::
|
||||
One can also set up Waf to do distributed compilation with ``distcc`` in
|
||||
a similar way::
|
||||
|
||||
$ CXX="distcc g++" ./waf configure
|
||||
$ ./waf build
|
||||
|
||||
More info on distcc and distributed compilation can be found on it's
|
||||
More info on ``distcc`` and distributed compilation can be found on it's
|
||||
`project page
|
||||
<http://code.google.com/p/distcc/>`_
|
||||
under Documentation section.
|
||||
|
||||
Testing ns-3
|
||||
************
|
||||
To add compiler flags, use the ``CXXFLAGS_EXTRA`` environment variable when
|
||||
you configure |ns3|.
|
||||
|
||||
You can run the unit tests of the |ns3| distribution by running the
|
||||
"./test.py -c core" script,
|
||||
Install
|
||||
=======
|
||||
|
||||
Waf may be used to install libraries in various places on the system.
|
||||
The default location where libraries and executables are built is
|
||||
in the ``build`` directory, and because Waf knows the location of these
|
||||
libraries and executables, it is not necessary to install the libraries
|
||||
elsewhere.
|
||||
|
||||
If users choose to install things outside of the build directory, users
|
||||
may issue the ``./waf install`` command. By default, the prefix for
|
||||
installation is ``/usr/local``, so ``./waf install`` will install programs
|
||||
into ``/usr/local/bin``, libraries into ``/usr/local/lib``, and headers
|
||||
into ``/usr/local/include``. Superuser privileges are typically needed
|
||||
to install to the default prefix, so the typical command would be
|
||||
``sudo ./waf install``. When running programs with Waf, Waf will
|
||||
first prefer to use shared libraries in the build directory, then
|
||||
will look for libraries in the library path configured in the local
|
||||
environment. So when installing libraries to the system, it is good
|
||||
practice to check that the intended libraries are being used.
|
||||
|
||||
Users may choose to install to a different prefix by passing the ``--prefix``
|
||||
option at configure time, such as:
|
||||
|
||||
::
|
||||
|
||||
./waf configure --prefix=/opt/local
|
||||
|
||||
If later after the build the user issues the ``./waf install`` command, the
|
||||
prefix ``/opt/local`` will be used.
|
||||
|
||||
The ``./waf clean`` command should be used prior to reconfiguring
|
||||
the project if Waf will be used to install things at a different prefix.
|
||||
|
||||
In summary, it is not necessary to call ``./waf install`` to use |ns3|.
|
||||
Most users will not need this command since Waf will pick up the
|
||||
current libraries from the ``build`` directory, but some users may find
|
||||
it useful if their use case involves working with programs outside
|
||||
of the |ns3| directory.
|
||||
|
||||
One Waf
|
||||
=======
|
||||
|
||||
There is only one Waf script, at the top level of the |ns3| source tree.
|
||||
As you work, you may find yourself spending a lot of time in ``scratch/``,
|
||||
or deep in ``src/...``, and needing to invoke Waf. You could just
|
||||
remember where you are, and invoke Waf like this::
|
||||
|
||||
$ ../../../waf ...
|
||||
|
||||
but that gets tedious, and error prone, and there are better solutions.
|
||||
|
||||
If you have the full |ns3| repository this little gem is a start::
|
||||
|
||||
$ cd $(hg root) && ./waf ...
|
||||
|
||||
Even better is to define this as a shell function::
|
||||
|
||||
$ function waff { cd $(hg root) && ./waf $* ; }
|
||||
|
||||
$ waff build
|
||||
|
||||
If you only have the tarball, an environment variable can help::
|
||||
|
||||
$ export NS3DIR="$PWD"
|
||||
$ function waff { cd $NS3DIR && ./waf $* ; }
|
||||
|
||||
$ cd scratch
|
||||
$ waff build
|
||||
|
||||
It might be tempting in a module directory to add a trivial ``waf``
|
||||
script along the lines of ``exec ../../waf``. Please don't. It's
|
||||
confusing to new-comers, and when done poorly it leads to subtle build
|
||||
errors. The solutions above are the way to go.
|
||||
|
||||
|
||||
Testing |ns3|
|
||||
*************
|
||||
|
||||
You can run the unit tests of the |ns3| distribution by running the
|
||||
``./test.py -c core`` script::
|
||||
|
||||
$ ./test.py -c core
|
||||
|
||||
These tests are run in parallel by waf. You should eventually
|
||||
see a report saying that,
|
||||
These tests are run in parallel by Waf. You should eventually
|
||||
see a report saying that
|
||||
|
||||
::
|
||||
|
||||
@@ -565,9 +742,8 @@ see a report saying that,
|
||||
|
||||
This is the important message.
|
||||
|
||||
You will also see output from the test runner and the output will actually look something like,
|
||||
|
||||
::
|
||||
You will also see the summary output from Waf and the test runner
|
||||
executing each test, which will actually look something like::
|
||||
|
||||
Waf: Entering directory `/path/to/workspace/ns-3-allinone/ns-3-dev/build'
|
||||
Waf: Leaving directory `/path/to/workspace/ns-3-allinone/ns-3-dev/build'
|
||||
@@ -590,34 +766,26 @@ You will also see output from the test runner and the output will actually look
|
||||
|
||||
PASS: TestSuite ns3-wifi-interference
|
||||
PASS: TestSuite histogram
|
||||
PASS: TestSuite sample
|
||||
PASS: TestSuite ipv4-address-helper
|
||||
PASS: TestSuite devices-wifi
|
||||
PASS: TestSuite propagation-loss-model
|
||||
|
||||
...
|
||||
|
||||
PASS: TestSuite attributes
|
||||
PASS: TestSuite config
|
||||
PASS: TestSuite global-value
|
||||
PASS: TestSuite command-line
|
||||
PASS: TestSuite basic-random-number
|
||||
PASS: TestSuite object
|
||||
PASS: TestSuite random-number-generators
|
||||
92 of 92 tests passed (92 passed, 0 failed, 0 crashed, 0 valgrind errors)
|
||||
|
||||
This command is typically run by users to quickly verify that an
|
||||
|ns3| distribution has built correctly.
|
||||
|ns3| distribution has built correctly. (Note the order of the ``PASS: ...``
|
||||
lines can vary, which is okay. What's important is that the summary line at
|
||||
the end report that all tests passed; none failed or crashed.)
|
||||
|
||||
Running a Script
|
||||
****************
|
||||
|
||||
We typically run scripts under the control of Waf. This allows the build
|
||||
system to ensure that the shared library paths are set correctly and that
|
||||
the libraries are available at run time. To run a program, simply use the
|
||||
``--run`` option in Waf. Let's run the |ns3| equivalent of the
|
||||
ubiquitous hello world program by typing the following:
|
||||
|
||||
::
|
||||
ubiquitous hello world program by typing the following::
|
||||
|
||||
$ ./waf --run hello-simulator
|
||||
|
||||
@@ -629,28 +797,26 @@ produces the following output.
|
||||
|
||||
Hello Simulator
|
||||
|
||||
*Congratulations. You are now an ns-3 user.*
|
||||
Congratulations! You are now an ns-3 user!
|
||||
|
||||
*What do I do if I don't see the output?*
|
||||
**What do I do if I don't see the output?**
|
||||
|
||||
If you see ``waf`` messages indicating that the build was
|
||||
If you see Waf messages indicating that the build was
|
||||
completed successfully, but do not see the "Hello Simulator" output,
|
||||
chances are that you have switched your build mode to "optimized" in
|
||||
the "Building with Waf" section, but have missed the change back to
|
||||
"debug" mode. All of the console output used in this tutorial uses a
|
||||
chances are that you have switched your build mode to ``optimized`` in
|
||||
the `Building with Waf`_ section, but have missed the change back to
|
||||
``debug`` mode. All of the console output used in this tutorial uses a
|
||||
special |ns3| logging component that is useful for printing
|
||||
user messages to the console. Output from this component is
|
||||
automatically disabled when you compile optimized code -- it is
|
||||
"optimized out." If you don't see the "Hello Simulator" output,
|
||||
type the following,
|
||||
type the following::
|
||||
|
||||
::
|
||||
$ ./waf configure --build-profile=debug --enable-examples --enable-tests
|
||||
|
||||
$ ./waf configure -d debug --enable-examples --enable-tests
|
||||
|
||||
to tell ``waf`` to build the debug versions of the |ns3|
|
||||
to tell Waf to build the debug versions of the |ns3|
|
||||
programs that includes the examples and tests. You must still build
|
||||
the actual debug version of the code by typing,
|
||||
the actual debug version of the code by typing
|
||||
|
||||
::
|
||||
|
||||
@@ -659,7 +825,82 @@ the actual debug version of the code by typing,
|
||||
Now, if you run the ``hello-simulator`` program, you should see the
|
||||
expected output.
|
||||
|
||||
If you want to run programs under another tool such as gdb or valgrind,
|
||||
see this `wiki entry
|
||||
<http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool>`_.
|
||||
Program Arguments
|
||||
+++++++++++++++++
|
||||
|
||||
To feed command line arguments to an |ns3| program use this pattern::
|
||||
|
||||
$ ./waf --run <ns3-program> --command-template="%s <args>"
|
||||
|
||||
Substitute your program name for ``<ns3-program>``, and the arguments
|
||||
for ``<args>``. The ``--command-template`` argument to Waf is
|
||||
basically a recipe for constructing the actual command line Waf should use
|
||||
to execute the program. Waf checks that the build is complete,
|
||||
sets the shared library paths, then invokes the executable
|
||||
using the provided command line template,
|
||||
inserting the program name for the ``%s`` placeholder.
|
||||
(I admit this is a bit awkward, but that's the way it is. Patches welcome!)
|
||||
|
||||
Another particularly useful example is to run a test suite by itself.
|
||||
Let's assume that a ``mytest`` test suite exists (it doesn't).
|
||||
Above, we used the ``./test.py`` script to run a whole slew of
|
||||
tests in parallel, by repeatedly invoking the real testing program,
|
||||
``test-runner``. To invoke ``test-runner`` directly for a single test::
|
||||
|
||||
$ ./waf --run test-runner --command-template="%s --suite=mytest --verbose"
|
||||
|
||||
This passes the arguments to the ``test-runner`` program.
|
||||
Since ``mytest`` does not exist, an error message will be generated.
|
||||
To print the available ``test-runner`` options::
|
||||
|
||||
$ ./waf --run test-runner --command-template="%s --help"
|
||||
|
||||
Debugging
|
||||
+++++++++
|
||||
|
||||
To run |ns3| programs under the control of another utility, such as
|
||||
a debugger (*e.g.* ``gdb``) or memory checker (*e.g.* ``valgrind``),
|
||||
you use a similar ``--command-template="..."`` form.
|
||||
|
||||
For example, to run your |ns3| program ``hello-simulator`` with the arguments
|
||||
``<args>`` under the ``gdb`` debugger::
|
||||
|
||||
$ ./waf --run=hello-simulator --command-template="gdb %s --args <args>"
|
||||
|
||||
Notice that the |ns3| program name goes with the ``--run`` argument,
|
||||
and the control utility (here ``gdb``) is the first token
|
||||
in the ``--commmand-template`` argument. The ``--args`` tells ``gdb``
|
||||
that the remainder of the command line belongs to the "inferior" program.
|
||||
(Some ``gdb``'s don't understand the ``--args`` feature. In this case,
|
||||
omit the program arguments from the ``--command-template``,
|
||||
and use the ``gdb`` command ``set args``.)
|
||||
|
||||
We can combine this recipe and the previous one to run a test under the
|
||||
debugger::
|
||||
|
||||
$ ./waf --run test-runner --command-template="gdb %s --args --suite=mytest --verbose"
|
||||
|
||||
Working Directory
|
||||
+++++++++++++++++
|
||||
|
||||
Waf needs to run from its location at the top of the |ns3| tree.
|
||||
This becomes the working directory where output files will be written.
|
||||
But what if you want to keep those ouf to the |ns3| source tree? Use
|
||||
the ``--cwd`` argument::
|
||||
|
||||
$ ./waf --cwd=...
|
||||
|
||||
It may be more convenient to start with your working directory where
|
||||
you want the output files, in which case a little indirection can help::
|
||||
|
||||
$ function waff {
|
||||
CWD="$PWD"
|
||||
cd $NS3DIR >/dev/null
|
||||
./waf --cwd="$CWD" $*
|
||||
cd - >/dev/null
|
||||
}
|
||||
|
||||
This embellishment of the previous version saves the current working directory,
|
||||
``cd``'s to the Waf directory, then instructs Waf to change the working
|
||||
directory *back* to the saved current working directory before running the
|
||||
program.
|
||||
|
||||
@@ -8,7 +8,7 @@ available in five forms:
|
||||
|
||||
* `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentation of the public APIs of the simulator
|
||||
* Tutorial *(this document)*, Manual, and Model Library for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/Main_Page>`_
|
||||
|
||||
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
|
||||
``doc/tutorial`` directory of ns-3's source code.
|
||||
|
||||
@@ -135,9 +135,9 @@ contribute to |ns3| like they have for |ns2|:
|
||||
|
||||
* Open source licensing based on GNU GPLv2 compatibility
|
||||
* `wiki
|
||||
<http://www.nsnam.org/wiki/index.php>`_
|
||||
<http://www.nsnam.org/wiki>`_
|
||||
* `Contributed Code
|
||||
<http://www.nsnam.org/wiki/index.php/Contributed_Code>`_ page, similar to |ns2|'s popular Contributed Code
|
||||
<http://www.nsnam.org/wiki/Contributed_Code>`_ page, similar to |ns2|'s popular Contributed Code
|
||||
`page
|
||||
<http://nsnam.isi.edu/nsnam/index.php/Contributed_Code>`_
|
||||
* Open `bug tracker
|
||||
|
||||
+1962
-1824
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,8 @@
|
||||
Tweaking
|
||||
--------
|
||||
|
||||
.. _UsingLogging:
|
||||
|
||||
Using the Logging Module
|
||||
************************
|
||||
|
||||
@@ -412,6 +414,8 @@ message,
|
||||
Using Command Line Arguments
|
||||
****************************
|
||||
|
||||
.. _Attribute:
|
||||
|
||||
Overriding Default Attributes
|
||||
+++++++++++++++++++++++++++++
|
||||
Another way you can change how |ns3| scripts behave without editing
|
||||
@@ -628,6 +632,46 @@ end up looking something like,
|
||||
--ns3::PointToPointChannel::Delay=2ms
|
||||
--ns3::UdpEchoClient::MaxPackets=2"
|
||||
|
||||
A natural question to arise at this point is how to learn about the existence
|
||||
of all of these attributes. Again, the command line help facility has
|
||||
a feature for this. If we ask for command line help we should see:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ ./waf --run "scratch/myfirst --PrintHelp"
|
||||
myfirst [Program Arguments] [General Arguments]
|
||||
|
||||
General Arguments:
|
||||
--PrintGlobals: Print the list of globals.
|
||||
--PrintGroups: Print the list of groups.
|
||||
--PrintGroup=[group]: Print all TypeIds of group.
|
||||
--PrintTypeIds: Print all TypeIds.
|
||||
--PrintAttributes=[typeid]: Print all attributes of typeid.
|
||||
--PrintHelp: Print this help message.
|
||||
|
||||
If you select the "PrintGroups" argument, you should see a list of all
|
||||
registered TypeId groups. The group names are aligned with the module names
|
||||
in the source directory (although with a leading capital letter). Printing
|
||||
out all of the information at once would be too much, so a further filter
|
||||
is available to print information on a per-group basis. So, focusing
|
||||
again on the point-to-point module:
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
./waf --run "scratch/myfirst --PrintGroup=PointToPoint"
|
||||
TypeIds in group PointToPoint:
|
||||
ns3::PointToPointChannel
|
||||
ns3::PointToPointNetDevice
|
||||
ns3::PointToPointRemoteChannel
|
||||
ns3::PppHeader
|
||||
|
||||
and from here, one can find the possible TypeId names to search for
|
||||
attributes, such as in the ``--PrintAttributes=ns3::PointToPointChannel``
|
||||
example shown above.
|
||||
|
||||
Another way to find out about attributes is through the ns-3 Doxygen; there
|
||||
is a page that lists out all of the registered attributes in the simulator.
|
||||
|
||||
Hooking Your Own Values
|
||||
+++++++++++++++++++++++
|
||||
You can also add your own hooks to the command line system. This is done
|
||||
@@ -722,6 +766,8 @@ they will automatically be available for setting by your users through the
|
||||
command line system. If you are a script author, you can add new variables to
|
||||
your scripts and hook them into the command line system quite painlessly.
|
||||
|
||||
.. _UsingTracingSystem:
|
||||
|
||||
Using the Tracing System
|
||||
************************
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("EnergyExample");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("EnergyExample");
|
||||
|
||||
static inline std::string
|
||||
PrintReceivedPacket (Address& from)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014 Wireless Communications and Networking Group (WCNG),
|
||||
* University of Rochester, Rochester, NY, USA.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Cristiano Tapparello <cristiano.tapparello@rochester.edu>
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* This example extends the energy model example by connecting a basic energy
|
||||
* harvester to the nodes.
|
||||
*
|
||||
* The example considers a simple communication link between a source and a
|
||||
* destination node, where the source node sends a packet to the destination
|
||||
* every 1 second. Each node is powered by a BasiEnergySource, which is recharged
|
||||
* by a BasicEnergyHarvester, and the WiFi radio consumes energy for the transmission/
|
||||
* reception of the packets.
|
||||
*
|
||||
* For the receiver node, the example prints the energy consumption of the WiFi radio,
|
||||
* the power harvested by the energy harvester and the residual energy in the
|
||||
* energy source.
|
||||
*
|
||||
* The nodes initial energy is set to 1.0 J, the transmission and reception entail a
|
||||
* current consumption of 0.0174 A and 0.0197 A, respectively (default values in
|
||||
* WifiRadioEnergyModel). The energy harvester provides an amount of power that varies
|
||||
* according to a random variable uniformly distributed in [0 0.1] W, and is updated
|
||||
* every 1 s. The energy source voltage is 3 V (default value in BasicEnergySource) and
|
||||
* the residual energy level is updated every 1 second (default value).
|
||||
*
|
||||
* The simulation start at time 0 and it is hard stopped at time 10 seconds. Given the
|
||||
* packet size and the distance between the nodes, each transmission lasts 0.0023s.
|
||||
* As a result, the destination node receives 10 messages.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/network-module.h"
|
||||
#include "ns3/mobility-module.h"
|
||||
#include "ns3/config-store-module.h"
|
||||
#include "ns3/wifi-module.h"
|
||||
#include "ns3/energy-module.h"
|
||||
#include "ns3/internet-module.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("EnergyWithHarvestingExample");
|
||||
|
||||
static inline std::string
|
||||
PrintReceivedPacket (Address& from)
|
||||
{
|
||||
InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (from);
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << "--\nReceived one packet! Socket: " << iaddr.GetIpv4 ()
|
||||
<< " port: " << iaddr.GetPort ()
|
||||
<< " at time = " << Simulator::Now ().GetSeconds ()
|
||||
<< "\n--";
|
||||
|
||||
return oss.str ();
|
||||
}
|
||||
|
||||
/**
|
||||
* \param socket Pointer to socket.
|
||||
*
|
||||
* Packet receiving sink.
|
||||
*/
|
||||
void
|
||||
ReceivePacket (Ptr<Socket> socket)
|
||||
{
|
||||
Ptr<Packet> packet;
|
||||
Address from;
|
||||
while ((packet = socket->RecvFrom (from)))
|
||||
{
|
||||
if (packet->GetSize () > 0)
|
||||
{
|
||||
NS_LOG_UNCOND (PrintReceivedPacket (from));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \param socket Pointer to socket.
|
||||
* \param pktSize Packet size.
|
||||
* \param n Pointer to node.
|
||||
* \param pktCount Number of packets to generate.
|
||||
* \param pktInterval Packet sending interval.
|
||||
*
|
||||
* Traffic generator.
|
||||
*/
|
||||
static void
|
||||
GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, Ptr<Node> n,
|
||||
uint32_t pktCount, Time pktInterval)
|
||||
{
|
||||
if (pktCount > 0)
|
||||
{
|
||||
socket->Send (Create<Packet> (pktSize));
|
||||
Simulator::Schedule (pktInterval, &GenerateTraffic, socket, pktSize, n,
|
||||
pktCount - 1, pktInterval);
|
||||
}
|
||||
else
|
||||
{
|
||||
socket->Close ();
|
||||
}
|
||||
}
|
||||
|
||||
/// Trace function for remaining energy at node.
|
||||
void
|
||||
RemainingEnergy (double oldValue, double remainingEnergy)
|
||||
{
|
||||
std::cout << Simulator::Now ().GetSeconds ()
|
||||
<< "s Current remaining energy = " << remainingEnergy << "J" << std::endl;
|
||||
}
|
||||
|
||||
/// Trace function for total energy consumption at node.
|
||||
void
|
||||
TotalEnergy (double oldValue, double totalEnergy)
|
||||
{
|
||||
std::cout << Simulator::Now ().GetSeconds ()
|
||||
<< "s Total energy consumed by radio = " << totalEnergy << "J" << std::endl;
|
||||
}
|
||||
|
||||
/// Trace function for the power harvested by the energy harvester.
|
||||
void
|
||||
HarvestedPower (double oldValue, double harvestedPower)
|
||||
{
|
||||
std::cout << Simulator::Now ().GetSeconds ()
|
||||
<< "s Current harvested power = " << harvestedPower << " W" << std::endl;
|
||||
}
|
||||
|
||||
/// Trace function for the total energy harvested by the node.
|
||||
void
|
||||
TotalEnergyHarvested (double oldValue, double TotalEnergyHarvested)
|
||||
{
|
||||
std::cout << Simulator::Now ().GetSeconds ()
|
||||
<< "s Total energy harvested by harvester = "
|
||||
<< TotalEnergyHarvested << " J" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
/*
|
||||
LogComponentEnable ("EnergySource", LOG_LEVEL_DEBUG);
|
||||
LogComponentEnable ("BasicEnergySource", LOG_LEVEL_DEBUG);
|
||||
LogComponentEnable ("DeviceEnergyModel", LOG_LEVEL_DEBUG);
|
||||
LogComponentEnable ("WifiRadioEnergyModel", LOG_LEVEL_DEBUG);
|
||||
LogComponentEnable ("EnergyHarvester", LOG_LEVEL_DEBUG);
|
||||
LogComponentEnable ("BasicEnergyHarvester", LOG_LEVEL_DEBUG);
|
||||
*/
|
||||
|
||||
std::string phyMode ("DsssRate1Mbps");
|
||||
double Prss = -80; // dBm
|
||||
uint32_t PpacketSize = 200; // bytes
|
||||
bool verbose = false;
|
||||
|
||||
// simulation parameters
|
||||
uint32_t numPackets = 10000; // number of packets to send
|
||||
double interval = 1; // seconds
|
||||
double startTime = 0.0; // seconds
|
||||
double distanceToRx = 100.0; // meters
|
||||
/*
|
||||
* This is a magic number used to set the transmit power, based on other
|
||||
* configuration.
|
||||
*/
|
||||
double offset = 81;
|
||||
|
||||
// Energy Harvester variables
|
||||
double harvestingUpdateInterval = 1; // seconds
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("phyMode", "Wifi Phy mode", phyMode);
|
||||
cmd.AddValue ("Prss", "Intended primary RSS (dBm)", Prss);
|
||||
cmd.AddValue ("PpacketSize", "size of application packet sent", PpacketSize);
|
||||
cmd.AddValue ("numPackets", "Total number of packets to send", numPackets);
|
||||
cmd.AddValue ("startTime", "Simulation start time", startTime);
|
||||
cmd.AddValue ("distanceToRx", "X-Axis distance between nodes", distanceToRx);
|
||||
cmd.AddValue ("verbose", "Turn on all device log components", verbose);
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
// Convert to time object
|
||||
Time interPacketInterval = Seconds (interval);
|
||||
|
||||
// disable fragmentation for frames below 2200 bytes
|
||||
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold",
|
||||
StringValue ("2200"));
|
||||
// turn off RTS/CTS for frames below 2200 bytes
|
||||
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold",
|
||||
StringValue ("2200"));
|
||||
// Fix non-unicast data rate to be the same as that of unicast
|
||||
Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",
|
||||
StringValue (phyMode));
|
||||
|
||||
NodeContainer c;
|
||||
c.Create (2); // create 2 nodes
|
||||
NodeContainer networkNodes;
|
||||
networkNodes.Add (c.Get (0));
|
||||
networkNodes.Add (c.Get (1));
|
||||
|
||||
// The below set of helpers will help us to put together the wifi NICs we want
|
||||
WifiHelper wifi;
|
||||
if (verbose)
|
||||
{
|
||||
wifi.EnableLogComponents ();
|
||||
}
|
||||
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
|
||||
|
||||
/** Wifi PHY **/
|
||||
/***************************************************************************/
|
||||
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
|
||||
wifiPhy.Set ("RxGain", DoubleValue (-10));
|
||||
wifiPhy.Set ("TxGain", DoubleValue (offset + Prss));
|
||||
wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0));
|
||||
/***************************************************************************/
|
||||
|
||||
/** wifi channel **/
|
||||
YansWifiChannelHelper wifiChannel;
|
||||
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
|
||||
wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
|
||||
// create wifi channel
|
||||
Ptr<YansWifiChannel> wifiChannelPtr = wifiChannel.Create ();
|
||||
wifiPhy.SetChannel (wifiChannelPtr);
|
||||
|
||||
/** MAC layer **/
|
||||
// Add a non-QoS upper MAC, and disable rate control
|
||||
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
|
||||
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",
|
||||
StringValue (phyMode), "ControlMode",
|
||||
StringValue (phyMode));
|
||||
// Set it to ad-hoc mode
|
||||
wifiMac.SetType ("ns3::AdhocWifiMac");
|
||||
|
||||
/** install PHY + MAC **/
|
||||
NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, networkNodes);
|
||||
|
||||
/** mobility **/
|
||||
MobilityHelper mobility;
|
||||
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
|
||||
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
|
||||
positionAlloc->Add (Vector (2 * distanceToRx, 0.0, 0.0));
|
||||
mobility.SetPositionAllocator (positionAlloc);
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
mobility.Install (c);
|
||||
|
||||
/** Energy Model **/
|
||||
/***************************************************************************/
|
||||
/* energy source */
|
||||
BasicEnergySourceHelper basicSourceHelper;
|
||||
// configure energy source
|
||||
basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (1.0));
|
||||
// install source
|
||||
EnergySourceContainer sources = basicSourceHelper.Install (c);
|
||||
/* device energy model */
|
||||
WifiRadioEnergyModelHelper radioEnergyHelper;
|
||||
// configure radio energy model
|
||||
radioEnergyHelper.Set ("TxCurrentA", DoubleValue (0.0174));
|
||||
radioEnergyHelper.Set ("RxCurrentA", DoubleValue (0.0197));
|
||||
// install device model
|
||||
DeviceEnergyModelContainer deviceModels = radioEnergyHelper.Install (devices, sources);
|
||||
|
||||
/* energy harvester */
|
||||
BasicEnergyHarvesterHelper basicHarvesterHelper;
|
||||
// configure energy harvester
|
||||
basicHarvesterHelper.Set ("PeriodicHarvestedPowerUpdateInterval", TimeValue (Seconds (harvestingUpdateInterval)));
|
||||
basicHarvesterHelper.Set ("HarvestablePower", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=0.1]"));
|
||||
// install harvester on all energy sources
|
||||
EnergyHarvesterContainer harvesters = basicHarvesterHelper.Install (sources);
|
||||
/***************************************************************************/
|
||||
|
||||
/** Internet stack **/
|
||||
InternetStackHelper internet;
|
||||
internet.Install (networkNodes);
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (devices);
|
||||
|
||||
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
|
||||
Ptr<Socket> recvSink = Socket::CreateSocket (networkNodes.Get (1), tid); // node 1, Destination
|
||||
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
|
||||
recvSink->Bind (local);
|
||||
recvSink->SetRecvCallback (MakeCallback (&ReceivePacket));
|
||||
|
||||
Ptr<Socket> source = Socket::CreateSocket (networkNodes.Get (0), tid); // node 0, Source
|
||||
InetSocketAddress remote = InetSocketAddress (Ipv4Address::GetBroadcast (), 80);
|
||||
source->SetAllowBroadcast (true);
|
||||
source->Connect (remote);
|
||||
|
||||
/** connect trace sources **/
|
||||
/***************************************************************************/
|
||||
// all traces are connected to node 1 (Destination)
|
||||
// energy source
|
||||
Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource> (sources.Get (1));
|
||||
basicSourcePtr->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy));
|
||||
// device energy model
|
||||
Ptr<DeviceEnergyModel> basicRadioModelPtr =
|
||||
basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
|
||||
NS_ASSERT (basicRadioModelPtr != 0);
|
||||
basicRadioModelPtr->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy));
|
||||
// energy harvester
|
||||
Ptr<BasicEnergyHarvester> basicHarvesterPtr = DynamicCast<BasicEnergyHarvester> (harvesters.Get (1));
|
||||
basicHarvesterPtr->TraceConnectWithoutContext ("HarvestedPower", MakeCallback (&HarvestedPower));
|
||||
basicHarvesterPtr->TraceConnectWithoutContext ("TotalEnergyHarvested", MakeCallback (&TotalEnergyHarvested));
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/** simulation setup **/
|
||||
// start traffic
|
||||
Simulator::Schedule (Seconds (startTime), &GenerateTraffic, source, PpacketSize,
|
||||
networkNodes.Get (0), numPackets, interPacketInterval);
|
||||
|
||||
Simulator::Stop (Seconds (10.0));
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -3,3 +3,5 @@
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('energy-model-example', ['core', 'mobility', 'wifi', 'energy', 'internet'])
|
||||
obj.source = 'energy-model-example.cc'
|
||||
obj = bld.create_ns3_program('energy-model-with-harvesting-example', ['core', 'mobility', 'wifi', 'energy', 'internet'])
|
||||
obj.source = 'energy-model-with-harvesting-example.cc'
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -41,7 +41,6 @@ using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("FragmentationIpv6Example");
|
||||
|
||||
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
bool verbose = false;
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "ns3/csma-module.h"
|
||||
#include "ns3/applications-module.h"
|
||||
#include "ns3/ipv6-header.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("LooseRoutingIpv6Example");
|
||||
|
||||
@@ -132,7 +132,6 @@ int main (int argc, char** argv)
|
||||
tmp2.Add (d1.Get (1)); /* R */
|
||||
Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
|
||||
iicr1.SetForwarding (0, true);
|
||||
iicr1.SetDefaultRouteInAllNodes (0);
|
||||
iic1.Add (iicr1);
|
||||
|
||||
/* add another IPv6 address for second prefix advertised on first subnet */
|
||||
@@ -145,7 +144,6 @@ int main (int argc, char** argv)
|
||||
tmp3.Add (d2.Get (0)); /* R */
|
||||
Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
|
||||
iicr2.SetForwarding (0, true);
|
||||
iicr2.SetDefaultRouteInAllNodes (0);
|
||||
|
||||
NetDeviceContainer tmp4;
|
||||
tmp4.Add (d2.Get (1)); /* n1 */
|
||||
|
||||
@@ -97,7 +97,6 @@ int main (int argc, char** argv)
|
||||
tmp2.Add (d1.Get (1)); /* R */
|
||||
Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
|
||||
iicr1.SetForwarding (0, true);
|
||||
iicr1.SetDefaultRouteInAllNodes (0);
|
||||
iic1.Add (iicr1);
|
||||
|
||||
/* second subnet R - n1 */
|
||||
@@ -106,7 +105,6 @@ int main (int argc, char** argv)
|
||||
tmp3.Add (d2.Get (0)); /* R */
|
||||
Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
|
||||
iicr2.SetForwarding (0, true);
|
||||
iicr2.SetDefaultRouteInAllNodes (0);
|
||||
|
||||
NetDeviceContainer tmp4;
|
||||
tmp4.Add (d2.Get (1)); /* n1 */
|
||||
@@ -115,10 +113,15 @@ int main (int argc, char** argv)
|
||||
|
||||
/* radvd configuration */
|
||||
RadvdHelper radvdHelper;
|
||||
|
||||
/* R interface (n0 - R) */
|
||||
radvdHelper.AddAnnouncedPrefix(iic1.GetInterfaceIndex (1), Ipv6Address("2001:1::0"), 64);
|
||||
/* n0 will receive unsolicited (periodic) RA */
|
||||
radvdHelper.AddAnnouncedPrefix (iic1.GetInterfaceIndex (1), Ipv6Address("2001:1::0"), 64);
|
||||
|
||||
/* R interface (R - n1) */
|
||||
/* n1 will have to use RS, as RA are not sent automatically */
|
||||
radvdHelper.AddAnnouncedPrefix(iic2.GetInterfaceIndex (1), Ipv6Address("2001:2::0"), 64);
|
||||
radvdHelper.GetRadvdInterface (iic2.GetInterfaceIndex (1))->SetSendAdvert (false);
|
||||
|
||||
ApplicationContainer radvdApps = radvdHelper.Install (r);
|
||||
radvdApps.Start (Seconds (1.0));
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#include "ns3/node.h"
|
||||
#include "ns3/mac48-address.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TestIpv6");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TestIpv6");
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -1,13 +1,13 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('icmpv6-redirect', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('icmpv6-redirect', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'icmpv6-redirect.cc'
|
||||
|
||||
obj = bld.create_ns3_program('ping6', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('ping6', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'ping6.cc'
|
||||
|
||||
obj = bld.create_ns3_program('radvd', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('radvd', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'radvd.cc'
|
||||
|
||||
obj = bld.create_ns3_program('radvd-two-prefix', ['csma', 'internet', 'applications'])
|
||||
@@ -16,12 +16,15 @@ def build(bld):
|
||||
obj = bld.create_ns3_program('test-ipv6', ['point-to-point', 'internet'])
|
||||
obj.source = 'test-ipv6.cc'
|
||||
|
||||
obj = bld.create_ns3_program('fragmentation-ipv6', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('fragmentation-ipv6', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'fragmentation-ipv6.cc'
|
||||
|
||||
obj = bld.create_ns3_program('fragmentation-ipv6-two-MTU', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('fragmentation-ipv6-two-MTU', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'fragmentation-ipv6-two-MTU.cc'
|
||||
|
||||
obj = bld.create_ns3_program('loose-routing-ipv6', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('loose-routing-ipv6', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'loose-routing-ipv6.cc'
|
||||
|
||||
obj = bld.create_ns3_program('wsn-ping6', ['lr-wpan', 'internet', 'sixlowpan', 'mobility', 'applications'])
|
||||
obj.source = 'wsn-ping6.cc'
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014 Universita' di Firenze
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
|
||||
*/
|
||||
|
||||
// Network topology
|
||||
//
|
||||
// n0 n1
|
||||
// | |
|
||||
// =================
|
||||
// WSN (802.15.4)
|
||||
//
|
||||
// - ICMPv6 echo request flows from n0 to n1 and back with ICMPv6 echo reply
|
||||
// - DropTail queues
|
||||
// - Tracing of queues and packet receptions to file "wsn-ping6.tr"
|
||||
//
|
||||
// This example is based on the "ping6.cc" example.
|
||||
|
||||
#include <fstream>
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/internet-module.h"
|
||||
#include "ns3/sixlowpan-module.h"
|
||||
#include "ns3/lr-wpan-module.h"
|
||||
#include "ns3/applications-module.h"
|
||||
#include "ns3/mobility-module.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Ping6WsnExample");
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
bool verbose = false;
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("verbose", "turn on log components", verbose);
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
LogComponentEnable ("Ping6WsnExample", LOG_LEVEL_INFO);
|
||||
LogComponentEnable ("Ipv6EndPointDemux", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Ipv6ListRouting", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("NdiscCache", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("SixLowPanNetDevice", LOG_LEVEL_ALL);
|
||||
}
|
||||
|
||||
NS_LOG_INFO ("Create nodes.");
|
||||
NodeContainer nodes;
|
||||
nodes.Create (2);
|
||||
|
||||
// Set seed for random numbers
|
||||
SeedManager::SetSeed (167);
|
||||
|
||||
// Install mobility
|
||||
MobilityHelper mobility;
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
|
||||
Ptr<ListPositionAllocator> nodesPositionAlloc = CreateObject<ListPositionAllocator> ();
|
||||
nodesPositionAlloc->Add (Vector (0.0, 0.0, 0.0));
|
||||
nodesPositionAlloc->Add (Vector (50.0, 0.0, 0.0));
|
||||
mobility.SetPositionAllocator (nodesPositionAlloc);
|
||||
mobility.Install (nodes);
|
||||
|
||||
NS_LOG_INFO ("Create channels.");
|
||||
LrWpanHelper lrWpanHelper;
|
||||
// Add and install the LrWpanNetDevice for each node
|
||||
// lrWpanHelper.EnableLogComponents();
|
||||
NetDeviceContainer devContainer = lrWpanHelper.Install(nodes);
|
||||
lrWpanHelper.AssociateToPan (devContainer, 10);
|
||||
|
||||
std::cout << "Created " << devContainer.GetN() << " devices" << std::endl;
|
||||
std::cout << "There are " << nodes.GetN() << " nodes" << std::endl;
|
||||
|
||||
/* Install IPv4/IPv6 stack */
|
||||
NS_LOG_INFO ("Install Internet stack.");
|
||||
InternetStackHelper internetv6;
|
||||
internetv6.SetIpv4StackInstall (false);
|
||||
internetv6.Install (nodes);
|
||||
|
||||
// Install 6LowPan layer
|
||||
NS_LOG_INFO ("Install 6LoWPAN.");
|
||||
SixLowPanHelper sixlowpan;
|
||||
NetDeviceContainer six1 = sixlowpan.Install (devContainer);
|
||||
|
||||
NS_LOG_INFO ("Assign addresses.");
|
||||
Ipv6AddressHelper ipv6;
|
||||
ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer i = ipv6.Assign (six1);
|
||||
|
||||
NS_LOG_INFO ("Create Applications.");
|
||||
|
||||
/* Create a Ping6 application to send ICMPv6 echo request from node zero to
|
||||
* all-nodes (ff02::1).
|
||||
*/
|
||||
uint32_t packetSize = 10;
|
||||
uint32_t maxPacketCount = 5;
|
||||
Time interPacketInterval = Seconds (1.);
|
||||
Ping6Helper ping6;
|
||||
|
||||
ping6.SetLocal (i.GetAddress (0, 1));
|
||||
ping6.SetRemote (i.GetAddress (1, 1));
|
||||
// ping6.SetRemote (Ipv6Address::GetAllNodesMulticast ());
|
||||
|
||||
ping6.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
|
||||
ping6.SetAttribute ("Interval", TimeValue (interPacketInterval));
|
||||
ping6.SetAttribute ("PacketSize", UintegerValue (packetSize));
|
||||
ApplicationContainer apps = ping6.Install (nodes.Get (0));
|
||||
apps.Start (Seconds (2.0));
|
||||
apps.Stop (Seconds (10.0));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
lrWpanHelper.EnableAsciiAll (ascii.CreateFileStream ("ping6wsn.tr"));
|
||||
lrWpanHelper.EnablePcapAll (std::string ("ping6wsn"), true);
|
||||
|
||||
NS_LOG_INFO ("Run Simulation.");
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
NS_LOG_INFO ("Done.");
|
||||
}
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -1,5 +1,5 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('object-names', ['core', 'csma', 'internet'])
|
||||
obj = bld.create_ns3_program('object-names', ['core', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'object-names.cc'
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -1,7 +1,8 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet'])
|
||||
obj.source = 'realtime-udp-echo.cc'
|
||||
if bld.env["ENABLE_REAL_TIME"]:
|
||||
obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'realtime-udp-echo.cc'
|
||||
|
||||
bld.register_ns3_script('realtime-udp-echo.py', ['csma', 'internet', 'applications'])
|
||||
bld.register_ns3_script('realtime-udp-echo.py', ['csma', 'internet', 'applications'])
|
||||
|
||||
@@ -343,7 +343,7 @@ RoutingExperiment::Run (int nSinks, double txp, std::string CSVfileName)
|
||||
onoff1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
|
||||
onoff1.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
|
||||
|
||||
for (int i = 0; i <= nSinks - 1; i++)
|
||||
for (int i = 0; i < nSinks; i++)
|
||||
{
|
||||
Ptr<Socket> sink = SetupPacketReceive (adhocInterfaces.GetAddress (i), adhocNodes.Get (i));
|
||||
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2014 Universita' di Firenze, Italy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
|
||||
*/
|
||||
|
||||
// Network topology
|
||||
//
|
||||
// SRC
|
||||
// |<=== source network
|
||||
// A-----B
|
||||
// \ / \ all networks have cost 1, except
|
||||
// \ / | for the direct link from C to D, which
|
||||
// C / has cost 10
|
||||
// | /
|
||||
// |/
|
||||
// D
|
||||
// |<=== target network
|
||||
// DST
|
||||
//
|
||||
//
|
||||
// A, B, C and D are RIPng routers.
|
||||
// A and D are configured with static addresses.
|
||||
// SRC and DST will exchange packets.
|
||||
//
|
||||
// After about 3 seconds, the topology is built, and Echo Reply will be received.
|
||||
// After 40 seconds, the link between B and D will break, causing a route failure.
|
||||
// After 44 seconds from the failure, the routers will recovery from the failure.
|
||||
// Split Horizoning should affect the recovery time, but it is not. See the manual
|
||||
// for an explanation of this effect.
|
||||
//
|
||||
// If "showPings" is enabled, the user will see:
|
||||
// 1) if the ping has been acknowledged
|
||||
// 2) if a Destination Unreachable has been received by the sender
|
||||
// 3) nothing, when the Echo Request has been received by the destination but
|
||||
// the Echo Reply is unable to reach the sender.
|
||||
// Examining the .pcap files with Wireshark can confirm this effect.
|
||||
|
||||
|
||||
#include <fstream>
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/internet-module.h"
|
||||
#include "ns3/csma-module.h"
|
||||
#include "ns3/applications-module.h"
|
||||
#include "ns3/ipv6-static-routing-helper.h"
|
||||
#include "ns3/ipv6-routing-table-entry.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("RipNgSimpleRouting");
|
||||
|
||||
void TearDownLink (Ptr<Node> nodeA, Ptr<Node> nodeB, uint32_t interfaceA, uint32_t interfaceB)
|
||||
{
|
||||
nodeA->GetObject<Ipv6> ()->SetDown (interfaceA);
|
||||
nodeB->GetObject<Ipv6> ()->SetDown (interfaceB);
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
bool verbose = false;
|
||||
bool printRoutingTables = false;
|
||||
bool showPings = false;
|
||||
std::string SplitHorizon ("PoisonReverse");
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("verbose", "turn on log components", verbose);
|
||||
cmd.AddValue ("printRoutingTables", "Print routing tables at 30, 60 and 90 seconds", printRoutingTables);
|
||||
cmd.AddValue ("showPings", "Show Ping6 reception", showPings);
|
||||
cmd.AddValue ("splitHorizonStrategy", "Split Horizon strategy to use (NoSplitHorizon, SplitHorizon, PoisonReverse)", SplitHorizon);
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
LogComponentEnable ("RipNgSimpleRouting", LOG_LEVEL_INFO);
|
||||
LogComponentEnable ("RipNg", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_INFO);
|
||||
LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("NdiscCache", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL);
|
||||
}
|
||||
|
||||
if (showPings)
|
||||
{
|
||||
LogComponentEnable ("Ping6Application", LOG_LEVEL_INFO);
|
||||
}
|
||||
|
||||
if (SplitHorizon == "NoSplitHorizon")
|
||||
{
|
||||
Config::SetDefault ("ns3::RipNg::SplitHorizon", EnumValue (RipNg::NO_SPLIT_HORIZON));
|
||||
}
|
||||
else if (SplitHorizon == "SplitHorizon")
|
||||
{
|
||||
Config::SetDefault ("ns3::RipNg::SplitHorizon", EnumValue (RipNg::SPLIT_HORIZON));
|
||||
}
|
||||
else
|
||||
{
|
||||
Config::SetDefault ("ns3::RipNg::SplitHorizon", EnumValue (RipNg::POISON_REVERSE));
|
||||
}
|
||||
|
||||
NS_LOG_INFO ("Create nodes.");
|
||||
Ptr<Node> src = CreateObject<Node> ();
|
||||
Names::Add ("SrcNode", src);
|
||||
Ptr<Node> dst = CreateObject<Node> ();
|
||||
Names::Add ("DstNode", dst);
|
||||
Ptr<Node> a = CreateObject<Node> ();
|
||||
Names::Add ("RouterA", a);
|
||||
Ptr<Node> b = CreateObject<Node> ();
|
||||
Names::Add ("RouterB", b);
|
||||
Ptr<Node> c = CreateObject<Node> ();
|
||||
Names::Add ("RouterC", c);
|
||||
Ptr<Node> d = CreateObject<Node> ();
|
||||
Names::Add ("RouterD", d);
|
||||
NodeContainer net1 (src, a);
|
||||
NodeContainer net2 (a, b);
|
||||
NodeContainer net3 (a, c);
|
||||
NodeContainer net4 (b, c);
|
||||
NodeContainer net5 (c, d);
|
||||
NodeContainer net6 (b, d);
|
||||
NodeContainer net7 (d, dst);
|
||||
NodeContainer routers (a, b, c, d);
|
||||
NodeContainer nodes (src, dst);
|
||||
|
||||
|
||||
NS_LOG_INFO ("Create channels.");
|
||||
CsmaHelper csma;
|
||||
csma.SetChannelAttribute ("DataRate", DataRateValue (5000000));
|
||||
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
|
||||
NetDeviceContainer ndc1 = csma.Install (net1);
|
||||
NetDeviceContainer ndc2 = csma.Install (net2);
|
||||
NetDeviceContainer ndc3 = csma.Install (net3);
|
||||
NetDeviceContainer ndc4 = csma.Install (net4);
|
||||
NetDeviceContainer ndc5 = csma.Install (net5);
|
||||
NetDeviceContainer ndc6 = csma.Install (net6);
|
||||
NetDeviceContainer ndc7 = csma.Install (net7);
|
||||
|
||||
NS_LOG_INFO ("Create IPv6 and routing");
|
||||
RipNgHelper ripNgRouting;
|
||||
|
||||
// Rule of thumb:
|
||||
// Interfaces are added sequentially, starting from 0
|
||||
// However, interface 0 is always the loopback...
|
||||
ripNgRouting.ExcludeInterface (a, 1);
|
||||
ripNgRouting.ExcludeInterface (d, 3);
|
||||
|
||||
ripNgRouting.SetInterfaceMetric (c, 3, 10);
|
||||
ripNgRouting.SetInterfaceMetric (d, 1, 10);
|
||||
|
||||
Ipv6ListRoutingHelper listRH;
|
||||
listRH.Add (ripNgRouting, 0);
|
||||
|
||||
InternetStackHelper internetv6;
|
||||
internetv6.SetIpv4StackInstall (false);
|
||||
internetv6.SetRoutingHelper (listRH);
|
||||
internetv6.Install (routers);
|
||||
|
||||
InternetStackHelper internetv6Nodes;
|
||||
internetv6Nodes.SetIpv4StackInstall (false);
|
||||
internetv6Nodes.Install (nodes);
|
||||
|
||||
// Assign addresses.
|
||||
// The source and destination networks have global addresses
|
||||
// The "core" network just needs link-local addresses for routing.
|
||||
// We assign global addresses to the routers as well to receive
|
||||
// ICMPv6 errors.
|
||||
NS_LOG_INFO ("Assign IPv6 Addresses.");
|
||||
Ipv6AddressHelper ipv6;
|
||||
|
||||
ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer iic1 = ipv6.Assign (ndc1);
|
||||
iic1.SetForwarding (1, true);
|
||||
iic1.SetDefaultRouteInAllNodes (1);
|
||||
|
||||
ipv6.SetBase (Ipv6Address ("2001:0:1::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer iic2 = ipv6.Assign (ndc2);
|
||||
iic2.SetForwarding (0, true);
|
||||
iic2.SetForwarding (1, true);
|
||||
|
||||
ipv6.SetBase (Ipv6Address ("2001:0:2::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer iic3 = ipv6.Assign (ndc3);
|
||||
iic3.SetForwarding (0, true);
|
||||
iic3.SetForwarding (1, true);
|
||||
|
||||
ipv6.SetBase (Ipv6Address ("2001:0:3::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer iic4 = ipv6.Assign (ndc4);
|
||||
iic4.SetForwarding (0, true);
|
||||
iic4.SetForwarding (1, true);
|
||||
|
||||
ipv6.SetBase (Ipv6Address ("2001:0:4::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer iic5 = ipv6.Assign (ndc5);
|
||||
iic5.SetForwarding (0, true);
|
||||
iic5.SetForwarding (1, true);
|
||||
|
||||
ipv6.SetBase (Ipv6Address ("2001:0:5::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer iic6 = ipv6.Assign (ndc6);
|
||||
iic6.SetForwarding (0, true);
|
||||
iic6.SetForwarding (1, true);
|
||||
|
||||
ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
|
||||
Ipv6InterfaceContainer iic7 = ipv6.Assign (ndc7);
|
||||
iic7.SetForwarding (0, true);
|
||||
iic7.SetDefaultRouteInAllNodes (0);
|
||||
|
||||
if (printRoutingTables)
|
||||
{
|
||||
RipNgHelper routingHelper;
|
||||
|
||||
Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper> (&std::cout);
|
||||
|
||||
routingHelper.PrintRoutingTableAt (Seconds (30.0), a, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (30.0), b, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (30.0), c, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (30.0), d, routingStream);
|
||||
|
||||
routingHelper.PrintRoutingTableAt (Seconds (60.0), a, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (60.0), b, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (60.0), c, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (60.0), d, routingStream);
|
||||
|
||||
routingHelper.PrintRoutingTableAt (Seconds (90.0), a, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (90.0), b, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (90.0), c, routingStream);
|
||||
routingHelper.PrintRoutingTableAt (Seconds (90.0), d, routingStream);
|
||||
}
|
||||
|
||||
NS_LOG_INFO ("Create Applications.");
|
||||
uint32_t packetSize = 1024;
|
||||
uint32_t maxPacketCount = 100;
|
||||
Time interPacketInterval = Seconds (1.0);
|
||||
Ping6Helper ping6;
|
||||
|
||||
ping6.SetLocal (iic1.GetAddress (0, 1));
|
||||
ping6.SetRemote (iic7.GetAddress (1, 1));
|
||||
ping6.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
|
||||
ping6.SetAttribute ("Interval", TimeValue (interPacketInterval));
|
||||
ping6.SetAttribute ("PacketSize", UintegerValue (packetSize));
|
||||
ApplicationContainer apps = ping6.Install (src);
|
||||
apps.Start (Seconds (1.0));
|
||||
apps.Stop (Seconds (110.0));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll (ascii.CreateFileStream ("ripng-simple-routing.tr"));
|
||||
csma.EnablePcapAll ("ripng-simple-routing", true);
|
||||
|
||||
Simulator::Schedule (Seconds (40), &TearDownLink, b, d, 3, 2);
|
||||
|
||||
/* Now, do the actual simulation. */
|
||||
NS_LOG_INFO ("Run Simulation.");
|
||||
Simulator::Stop (Seconds (120));
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
NS_LOG_INFO ("Done.");
|
||||
}
|
||||
|
||||
@@ -149,11 +149,10 @@ main (int argc, char *argv[])
|
||||
p2p.EnablePcapAll ("simple-global-routing");
|
||||
|
||||
// Flow Monitor
|
||||
Ptr<FlowMonitor> flowmon;
|
||||
FlowMonitorHelper flowmonHelper;
|
||||
if (enableFlowMonitor)
|
||||
{
|
||||
flowmon = flowmonHelper.InstallAll ();
|
||||
flowmonHelper.InstallAll ();
|
||||
}
|
||||
|
||||
NS_LOG_INFO ("Run Simulation.");
|
||||
@@ -163,7 +162,7 @@ main (int argc, char *argv[])
|
||||
|
||||
if (enableFlowMonitor)
|
||||
{
|
||||
flowmon->SerializeToXmlFile ("simple-global-routing.flowmon", false, false);
|
||||
flowmonHelper.SerializeToXmlFile ("simple-global-routing.flowmon", false, false);
|
||||
}
|
||||
|
||||
Simulator::Destroy ();
|
||||
|
||||
@@ -70,12 +70,14 @@ def main(argv):
|
||||
# Create networks and assign IPv6 Addresses
|
||||
print "Addressing"
|
||||
ipv6 = ns.internet.Ipv6AddressHelper();
|
||||
ipv6.NewNetwork(ns.network.Ipv6Address("2001:1::"), ns.network.Ipv6Prefix(64));
|
||||
ipv6.SetBase(ns.network.Ipv6Address("2001:1::"), ns.network.Ipv6Prefix(64));
|
||||
i1 = ipv6.Assign(d1);
|
||||
i1.SetRouter(1, True);
|
||||
ipv6.NewNetwork(ns.network.Ipv6Address("2001:2::"), ns.network.Ipv6Prefix(64));
|
||||
i1.SetForwarding(1, True);
|
||||
i1.SetDefaultRouteInAllNodes(1);
|
||||
ipv6.SetBase(ns.network.Ipv6Address("2001:2::"), ns.network.Ipv6Prefix(64));
|
||||
i2 = ipv6.Assign(d2);
|
||||
i2.SetRouter(0, True);
|
||||
i2.SetForwarding(0, True);
|
||||
i2.SetDefaultRouteInAllNodes(0);
|
||||
|
||||
# Create a Ping6 application to send ICMPv6 echo request from n0 to n1 via r
|
||||
print "Application"
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('dynamic-global-routing',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'dynamic-global-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program('static-routing-slash32',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'static-routing-slash32.cc'
|
||||
|
||||
obj = bld.create_ns3_program('global-routing-slash32',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'global-routing-slash32.cc'
|
||||
|
||||
obj = bld.create_ns3_program('global-injection-slash32',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'global-injection-slash32.cc'
|
||||
|
||||
obj = bld.create_ns3_program('simple-global-routing',
|
||||
@@ -25,16 +25,20 @@ def build(bld):
|
||||
['point-to-point', 'internet', 'applications'])
|
||||
obj.source = 'simple-alternate-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program( 'mixed-global-routing',
|
||||
['point-to-point', 'internet', 'csma'])
|
||||
obj = bld.create_ns3_program('mixed-global-routing',
|
||||
['point-to-point', 'internet', 'csma', 'applications'])
|
||||
obj.source = 'mixed-global-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program('simple-routing-ping6',
|
||||
['csma', 'internet'])
|
||||
['csma', 'internet', 'applications'])
|
||||
obj.source = 'simple-routing-ping6.cc'
|
||||
|
||||
obj = bld.create_ns3_program('manet-routing-compare',
|
||||
['wifi', 'dsr', 'dsdv', 'aodv', 'olsr', 'internet', 'applications'])
|
||||
obj.source = 'manet-routing-compare.cc'
|
||||
|
||||
obj = bld.create_ns3_program('ripng-simple-network',
|
||||
['csma', 'internet', 'applications'])
|
||||
obj.source = 'ripng-simple-network.cc'
|
||||
|
||||
bld.register_ns3_script('simple-routing-ping6.py', ['csma', 'internet', 'applications'])
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -4,7 +4,7 @@ def build(bld):
|
||||
obj = bld.create_ns3_program('socket-bound-static-routing', ['network', 'csma', 'point-to-point', 'internet'])
|
||||
obj.source = 'socket-bound-static-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program('socket-bound-tcp-static-routing', ['network', 'csma', 'point-to-point', 'internet'])
|
||||
obj = bld.create_ns3_program('socket-bound-tcp-static-routing', ['network', 'csma', 'point-to-point', 'internet', 'applications'])
|
||||
obj.source = 'socket-bound-tcp-static-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program('socket-options-ipv4', ['network', 'csma', 'point-to-point', 'internet'])
|
||||
|
||||
@@ -13,7 +13,7 @@ output from this example.
|
||||
More information on the statistics package and this example is
|
||||
available online on the ns-3 wiki at:
|
||||
|
||||
http://www.nsnam.org/wiki/index.php/Statistical_Framework_for_Network_Simulation
|
||||
http://www.nsnam.org/wiki/Statistical_Framework_for_Network_Simulation
|
||||
|
||||
*** Using ns-3 with the OMNeT++ analysis tool ***
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@ Sender::GetTypeId (void)
|
||||
MakePointerAccessor (&Sender::m_interval),
|
||||
MakePointerChecker <RandomVariableStream>())
|
||||
.AddTraceSource ("Tx", "A new packet is created and is sent",
|
||||
MakeTraceSourceAccessor (&Sender::m_txTrace))
|
||||
MakeTraceSourceAccessor (&Sender::m_txTrace),
|
||||
"ns3::Packet::TracedCallback")
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,8 @@ CMD="select exp.input,avg(100-((rx.value*100)/tx.value)) \
|
||||
order by abs(exp.input) ASC;"
|
||||
|
||||
sqlite3 -noheader data.db "$CMD" > wifi-default.data
|
||||
sed -i "s/|/ /" wifi-default.data
|
||||
sed -i.bak "s/|/ /" wifi-default.data
|
||||
rm wifi-default.data.bak
|
||||
gnuplot wifi-example.gnuplot
|
||||
|
||||
echo "Done; data in wifi-default.data, plot in wifi-default.eps"
|
||||
|
||||
@@ -49,9 +49,6 @@ using namespace std;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WiFiDistanceExperiment");
|
||||
|
||||
|
||||
|
||||
|
||||
void TxCallback (Ptr<CounterCalculator<uint32_t> > datac,
|
||||
std::string path, Ptr<const Packet> packet) {
|
||||
NS_LOG_INFO ("Sent frame counted in " <<
|
||||
|
||||
@@ -44,7 +44,6 @@ using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TcpLargeTransfer");
|
||||
|
||||
|
||||
// The number of bytes to send in this simulation.
|
||||
static const uint32_t totalTxBytes = 2000000;
|
||||
static uint32_t currentTxBytes = 0;
|
||||
|
||||
+211
-180
@@ -1,180 +1,211 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2012 NICT
|
||||
*
|
||||
* 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: Hajime Tazaki <tazaki@nict.go.jp>
|
||||
*
|
||||
* This code is a modified version of the code used for the the experiments in the paper
|
||||
* "DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism"
|
||||
* by Hajime Tazaki, Frederic Urbani and Thierry Turlett presented at WNS3 2013
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/network-module.h"
|
||||
#include "ns3/internet-module.h"
|
||||
#include "ns3/point-to-point-module.h"
|
||||
#include "ns3/applications-module.h"
|
||||
#include "ns3/flow-monitor-module.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TcpNscComparison");
|
||||
|
||||
std::string m_stack = "nsc-linux";
|
||||
std::string sock_factory;
|
||||
int m_seed = 1;
|
||||
double startTime = 4.0;
|
||||
double stopTime = 20.0;
|
||||
uint32_t m_nNodes = 2;
|
||||
bool enablePcap = false;
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
//ensure the ns3 TCP default values match what nsc is using
|
||||
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1448));
|
||||
Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("stack", "choose network stack", m_stack);
|
||||
cmd.AddValue ("seed", "randomize seed", m_seed);
|
||||
cmd.AddValue ("nNodes", "the number of nodes in left side", m_nNodes);
|
||||
cmd.AddValue ("stopTime", "duration", stopTime);
|
||||
cmd.AddValue ("enablePcap", "pcap", enablePcap);
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
SeedManager::SetSeed (m_seed);
|
||||
|
||||
NodeContainer lefts, routers, rights, nodes;
|
||||
lefts.Create (m_nNodes);
|
||||
routers.Create (2);
|
||||
rights.Create (m_nNodes);
|
||||
nodes = NodeContainer (lefts, routers, rights);
|
||||
|
||||
InternetStackHelper internetStack;
|
||||
|
||||
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
|
||||
if (m_stack == "ns3")
|
||||
{
|
||||
sock_factory = "ns3::TcpSocketFactory";
|
||||
internetStack.Install (nodes);
|
||||
}
|
||||
else if (m_stack == "nsc-linux")
|
||||
{
|
||||
internetStack.Install (routers);
|
||||
sock_factory = "ns3::TcpSocketFactory";
|
||||
internetStack.SetTcp ("ns3::NscTcpL4Protocol",
|
||||
"Library", StringValue ("liblinux2.6.26.so"));
|
||||
internetStack.Install (lefts);
|
||||
internetStack.Install (rights);
|
||||
|
||||
//these are not implemented in ns3 tcp so disable for comparison
|
||||
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", StringValue ("0"));
|
||||
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
|
||||
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
|
||||
}
|
||||
|
||||
PointToPointHelper pointToPoint;
|
||||
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
|
||||
pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
|
||||
|
||||
Ipv4AddressHelper address;
|
||||
Ipv4InterfaceContainer interfaces;
|
||||
|
||||
NetDeviceContainer dev0, dev1, dev2;
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "10.0." << i << ".0";
|
||||
address.SetBase (oss.str ().c_str (), "255.255.255.0");
|
||||
dev0 = pointToPoint.Install (NodeContainer (lefts.Get (i), routers.Get (0)));
|
||||
address.Assign (dev0);
|
||||
}
|
||||
|
||||
// bottle neck link
|
||||
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("2Mbps"));
|
||||
pointToPoint.SetChannelAttribute ("Delay", StringValue ("100ms"));
|
||||
dev1 = pointToPoint.Install (NodeContainer (routers.Get (0), routers.Get (1)));
|
||||
|
||||
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
|
||||
pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
|
||||
// for right links
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "10.2." << i << ".0";
|
||||
address.SetBase (oss.str ().c_str (), "255.255.255.0");
|
||||
dev2 = pointToPoint.Install (NodeContainer (routers.Get (1), rights.Get (i)));
|
||||
address.Assign (dev2);
|
||||
}
|
||||
|
||||
// bottle neck link
|
||||
Ptr<RateErrorModel> em1 =
|
||||
CreateObjectWithAttributes<RateErrorModel> (
|
||||
"ErrorRate", DoubleValue (0.05),
|
||||
"ErrorUnit", EnumValue (RateErrorModel::ERROR_UNIT_PACKET)
|
||||
);
|
||||
dev1.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em1));
|
||||
|
||||
address.SetBase ("10.1.0.0", "255.255.255.0");
|
||||
address.Assign (dev1);
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
|
||||
|
||||
ApplicationContainer apps;
|
||||
|
||||
OnOffHelper onoff = OnOffHelper (sock_factory,
|
||||
InetSocketAddress (Ipv4Address ("10.2.0.2"), 2000));
|
||||
onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
|
||||
onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
|
||||
|
||||
// Flow 1 - n
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "10.2." << i << ".2";
|
||||
onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (Ipv4Address (oss.str ().c_str ()), 2000)));
|
||||
onoff.SetAttribute ("PacketSize", StringValue ("1024"));
|
||||
onoff.SetAttribute ("DataRate", StringValue ("1Mbps"));
|
||||
onoff.SetAttribute ("StartTime", TimeValue (Seconds (startTime)));
|
||||
apps = onoff.Install (lefts.Get (i));
|
||||
}
|
||||
|
||||
PacketSinkHelper sink = PacketSinkHelper (sock_factory,
|
||||
InetSocketAddress (Ipv4Address::GetAny (), 2000));
|
||||
apps = sink.Install (rights);
|
||||
apps.Start (Seconds (3.9999));
|
||||
|
||||
pointToPoint.EnablePcapAll ("nsc.pcap");
|
||||
|
||||
Simulator::Stop (Seconds (stopTime));
|
||||
Simulator::Run ();
|
||||
|
||||
Ptr<PacketSink> pktsink;
|
||||
std::cout << "Total ";
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
pktsink = apps.Get (i)->GetObject<PacketSink> ();
|
||||
std::cout << "Rx(" << i << ") = " << pktsink->GetTotalRx () <<
|
||||
" bytes (" << pktsink->GetTotalRx () * 8 / (stopTime - startTime) << " bps), ";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
Simulator::Destroy ();
|
||||
return 0;
|
||||
}
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2012 NICT
|
||||
*
|
||||
* 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: Hajime Tazaki <tazaki@nict.go.jp>
|
||||
*
|
||||
* This code is a modified version of the code used for the the experiments in the paper
|
||||
* "DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism"
|
||||
* by Hajime Tazaki, Frederic Urbani and Thierry Turlett presented at WNS3 2013
|
||||
*
|
||||
* By default, TCP timestamps, window scale, and SACK are disabled because
|
||||
* they were not supported in ns-3 at the time of this paper. TCP timestamp
|
||||
* and window scale can be enabled by command line arguments.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/network-module.h"
|
||||
#include "ns3/internet-module.h"
|
||||
#include "ns3/point-to-point-module.h"
|
||||
#include "ns3/applications-module.h"
|
||||
#include "ns3/flow-monitor-module.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TcpNscComparison");
|
||||
|
||||
std::string m_stack = "nsc-linux";
|
||||
std::string sock_factory;
|
||||
uint32_t m_seed = 1;
|
||||
double startTime = 4.0;
|
||||
double stopTime = 20.0;
|
||||
uint32_t m_nNodes = 2;
|
||||
bool enablePcap = false;
|
||||
bool enableTimestamps = false;
|
||||
bool enableWindowScale = false;
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
//ensure the ns3 TCP default values match what nsc is using
|
||||
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1448));
|
||||
Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("stack", "choose network stack", m_stack);
|
||||
cmd.AddValue ("seed", "randomize seed", m_seed);
|
||||
cmd.AddValue ("nNodes", "the number of source and sink nodes", m_nNodes);
|
||||
cmd.AddValue ("stopTime", "duration", stopTime);
|
||||
cmd.AddValue ("enablePcap", "pcap", enablePcap);
|
||||
cmd.AddValue ("enableTimestamps", "use TCP Timestamps option", enableTimestamps);
|
||||
cmd.AddValue ("enableWindowScale", "use TCP Window Scale option", enableWindowScale);
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
SeedManager::SetSeed (m_seed);
|
||||
|
||||
if (m_stack != "nsc-linux" && m_stack != "ns3")
|
||||
{
|
||||
NS_FATAL_ERROR ("Error, stack named " << m_stack << " is not supported");
|
||||
}
|
||||
|
||||
NodeContainer lefts, routers, rights, nodes;
|
||||
lefts.Create (m_nNodes);
|
||||
routers.Create (2);
|
||||
rights.Create (m_nNodes);
|
||||
nodes = NodeContainer (lefts, routers, rights);
|
||||
|
||||
InternetStackHelper internetStack;
|
||||
|
||||
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
|
||||
if (m_stack == "ns3")
|
||||
{
|
||||
sock_factory = "ns3::TcpSocketFactory";
|
||||
if (enableTimestamps == false)
|
||||
{
|
||||
Config::SetDefault ("ns3::TcpSocketBase::WindowScaling", BooleanValue (false));
|
||||
}
|
||||
if (enableWindowScale == false)
|
||||
{
|
||||
Config::SetDefault ("ns3::TcpSocketBase::Timestamp", BooleanValue (false));
|
||||
}
|
||||
internetStack.Install (nodes);
|
||||
}
|
||||
else if (m_stack == "nsc-linux")
|
||||
{
|
||||
internetStack.Install (routers);
|
||||
sock_factory = "ns3::TcpSocketFactory";
|
||||
internetStack.SetTcp ("ns3::NscTcpL4Protocol",
|
||||
"Library", StringValue ("liblinux2.6.26.so"));
|
||||
internetStack.Install (lefts);
|
||||
internetStack.Install (rights);
|
||||
|
||||
// at the time this program was written, these were not implemented
|
||||
// in ns3 tcp, so disable for comparison
|
||||
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", StringValue ("0"));
|
||||
if (enableTimestamps == false)
|
||||
{
|
||||
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
|
||||
}
|
||||
if (enableWindowScale == false)
|
||||
{
|
||||
Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
|
||||
}
|
||||
}
|
||||
|
||||
PointToPointHelper pointToPoint;
|
||||
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
|
||||
pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
|
||||
|
||||
Ipv4AddressHelper address;
|
||||
Ipv4InterfaceContainer interfaces;
|
||||
|
||||
NetDeviceContainer dev0, dev1, dev2;
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "10.0." << i << ".0";
|
||||
address.SetBase (oss.str ().c_str (), "255.255.255.0");
|
||||
dev0 = pointToPoint.Install (NodeContainer (lefts.Get (i), routers.Get (0)));
|
||||
address.Assign (dev0);
|
||||
}
|
||||
|
||||
// bottle neck link
|
||||
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("2Mbps"));
|
||||
pointToPoint.SetChannelAttribute ("Delay", StringValue ("100ms"));
|
||||
dev1 = pointToPoint.Install (NodeContainer (routers.Get (0), routers.Get (1)));
|
||||
|
||||
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
|
||||
pointToPoint.SetChannelAttribute ("Delay", StringValue ("1ns"));
|
||||
// for right links
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "10.2." << i << ".0";
|
||||
address.SetBase (oss.str ().c_str (), "255.255.255.0");
|
||||
dev2 = pointToPoint.Install (NodeContainer (routers.Get (1), rights.Get (i)));
|
||||
address.Assign (dev2);
|
||||
}
|
||||
|
||||
// bottle neck link
|
||||
Ptr<RateErrorModel> em1 =
|
||||
CreateObjectWithAttributes<RateErrorModel> (
|
||||
"ErrorRate", DoubleValue (0.05),
|
||||
"ErrorUnit", EnumValue (RateErrorModel::ERROR_UNIT_PACKET)
|
||||
);
|
||||
dev1.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em1));
|
||||
|
||||
address.SetBase ("10.1.0.0", "255.255.255.0");
|
||||
address.Assign (dev1);
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
|
||||
|
||||
ApplicationContainer apps;
|
||||
|
||||
OnOffHelper onoff = OnOffHelper (sock_factory,
|
||||
InetSocketAddress (Ipv4Address ("10.2.0.2"), 2000));
|
||||
onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
|
||||
onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
|
||||
|
||||
// Flow 1 - n
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "10.2." << i << ".2";
|
||||
onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (Ipv4Address (oss.str ().c_str ()), 2000)));
|
||||
onoff.SetAttribute ("PacketSize", StringValue ("1024"));
|
||||
onoff.SetAttribute ("DataRate", StringValue ("1Mbps"));
|
||||
onoff.SetAttribute ("StartTime", TimeValue (Seconds (startTime)));
|
||||
apps = onoff.Install (lefts.Get (i));
|
||||
}
|
||||
|
||||
PacketSinkHelper sink = PacketSinkHelper (sock_factory,
|
||||
InetSocketAddress (Ipv4Address::GetAny (), 2000));
|
||||
apps = sink.Install (rights);
|
||||
apps.Start (Seconds (3.9999));
|
||||
|
||||
if (enablePcap)
|
||||
{
|
||||
pointToPoint.EnablePcapAll ("nsc.pcap");
|
||||
}
|
||||
|
||||
Simulator::Stop (Seconds (stopTime));
|
||||
Simulator::Run ();
|
||||
|
||||
Ptr<PacketSink> pktsink;
|
||||
std::cout << "Total ";
|
||||
for (uint32_t i = 0; i < m_nNodes; i++)
|
||||
{
|
||||
pktsink = apps.Get (i)->GetObject<PacketSink> ();
|
||||
std::cout << "Rx(" << i << ") = " << pktsink->GetTotalRx () <<
|
||||
" bytes (" << pktsink->GetTotalRx () * 8 / (stopTime - startTime) << " bps), ";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
Simulator::Destroy ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 ResiliNets, ITTC, University of Kansas
|
||||
* Copyright (c) 2013 ResiliNets, ITTC, University of Kansas
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
@@ -54,92 +54,105 @@ using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TcpVariantsComparison");
|
||||
|
||||
double old_time = 0.0;
|
||||
EventId output;
|
||||
Time current = Time::FromInteger(3, Time::S); //Only record cwnd and ssthresh values every 3 seconds
|
||||
bool first = true;
|
||||
bool firstCwnd = true;
|
||||
bool firstSshThr = true;
|
||||
bool firstRtt = true;
|
||||
bool firstRto = true;
|
||||
Ptr<OutputStreamWrapper> cWndStream;
|
||||
Ptr<OutputStreamWrapper> ssThreshStream;
|
||||
Ptr<OutputStreamWrapper> rttStream;
|
||||
Ptr<OutputStreamWrapper> rtoStream;
|
||||
uint32_t cWndValue;
|
||||
uint32_t ssThreshValue;
|
||||
|
||||
|
||||
static void
|
||||
OutputTrace ()
|
||||
CwndTracer (uint32_t oldval, uint32_t newval)
|
||||
{
|
||||
// *stream->GetStream() << newtime << " " << newval << std::endl;
|
||||
// old_time = newval;
|
||||
}
|
||||
|
||||
static void
|
||||
CwndTracer (Ptr<OutputStreamWrapper>stream, uint32_t oldval, uint32_t newval)
|
||||
{
|
||||
double new_time = Simulator::Now().GetSeconds();
|
||||
if (old_time == 0 && first)
|
||||
{
|
||||
double mycurrent = current.GetSeconds();
|
||||
*stream->GetStream() << new_time << " " << mycurrent << " " << newval << std::endl;
|
||||
first = false;
|
||||
output = Simulator::Schedule(current,&OutputTrace);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (output.IsExpired())
|
||||
if (firstCwnd)
|
||||
{
|
||||
*stream->GetStream() << new_time << " " << newval << std::endl;
|
||||
output.Cancel();
|
||||
output = Simulator::Schedule(current,&OutputTrace);
|
||||
*cWndStream->GetStream () << "0.0 " << oldval << std::endl;
|
||||
firstCwnd = false;
|
||||
}
|
||||
*cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
|
||||
cWndValue = newval;
|
||||
|
||||
if (!firstSshThr)
|
||||
{
|
||||
*ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << ssThreshValue << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
SsThreshTracer (Ptr<OutputStreamWrapper>stream, uint32_t oldval, uint32_t newval)
|
||||
SsThreshTracer (uint32_t oldval, uint32_t newval)
|
||||
{
|
||||
double new_time = Simulator::Now().GetSeconds();
|
||||
if (old_time == 0 && first)
|
||||
{
|
||||
double mycurrent = current.GetSeconds();
|
||||
*stream->GetStream() << new_time << " " << mycurrent << " " << newval << std::endl;
|
||||
first = false;
|
||||
output = Simulator::Schedule(current,&OutputTrace);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (output.IsExpired())
|
||||
if (firstSshThr)
|
||||
{
|
||||
*stream->GetStream() << new_time << " " << newval << std::endl;
|
||||
output.Cancel();
|
||||
output = Simulator::Schedule(current,&OutputTrace);
|
||||
*ssThreshStream->GetStream () << "0.0 " << oldval << std::endl;
|
||||
firstSshThr = false;
|
||||
}
|
||||
*ssThreshStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval << std::endl;
|
||||
ssThreshValue = newval;
|
||||
|
||||
if (!firstCwnd)
|
||||
{
|
||||
*cWndStream->GetStream () << Simulator::Now ().GetSeconds () << " " << cWndValue << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
RttTracer (Time oldval, Time newval)
|
||||
{
|
||||
if (firstRtt)
|
||||
{
|
||||
*rttStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
|
||||
firstRtt = false;
|
||||
}
|
||||
*rttStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
|
||||
}
|
||||
|
||||
static void
|
||||
RtoTracer (Time oldval, Time newval)
|
||||
{
|
||||
if (firstRto)
|
||||
{
|
||||
*rtoStream->GetStream () << "0.0 " << oldval.GetSeconds () << std::endl;
|
||||
firstRto = false;
|
||||
}
|
||||
*rtoStream->GetStream () << Simulator::Now ().GetSeconds () << " " << newval.GetSeconds () << std::endl;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
TraceCwnd (std::string cwnd_tr_file_name)
|
||||
{
|
||||
AsciiTraceHelper ascii;
|
||||
if (cwnd_tr_file_name.compare("") == 0)
|
||||
{
|
||||
NS_LOG_DEBUG ("No trace file for cwnd provided");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream(cwnd_tr_file_name.c_str());
|
||||
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",MakeBoundCallback (&CwndTracer, stream));
|
||||
}
|
||||
cWndStream = ascii.CreateFileStream (cwnd_tr_file_name.c_str ());
|
||||
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", MakeCallback (&CwndTracer));
|
||||
}
|
||||
|
||||
static void
|
||||
TraceSsThresh(std::string ssthresh_tr_file_name)
|
||||
TraceSsThresh (std::string ssthresh_tr_file_name)
|
||||
{
|
||||
AsciiTraceHelper ascii;
|
||||
if (ssthresh_tr_file_name.compare("") == 0)
|
||||
{
|
||||
NS_LOG_DEBUG ("No trace file for ssthresh provided");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream(ssthresh_tr_file_name.c_str());
|
||||
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold",MakeBoundCallback (&SsThreshTracer, stream));
|
||||
}
|
||||
ssThreshStream = ascii.CreateFileStream (ssthresh_tr_file_name.c_str ());
|
||||
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/SlowStartThreshold", MakeCallback (&SsThreshTracer));
|
||||
}
|
||||
|
||||
static void
|
||||
TraceRtt (std::string rtt_tr_file_name)
|
||||
{
|
||||
AsciiTraceHelper ascii;
|
||||
rttStream = ascii.CreateFileStream (rtt_tr_file_name.c_str ());
|
||||
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTT", MakeCallback (&RttTracer));
|
||||
}
|
||||
|
||||
static void
|
||||
TraceRto (std::string rto_tr_file_name)
|
||||
{
|
||||
AsciiTraceHelper ascii;
|
||||
rtoStream = ascii.CreateFileStream (rto_tr_file_name.c_str ());
|
||||
Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/RTO", MakeCallback (&RtoTracer));
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
@@ -153,6 +166,8 @@ int main (int argc, char *argv[])
|
||||
std::string tr_file_name = "";
|
||||
std::string cwnd_tr_file_name = "";
|
||||
std::string ssthresh_tr_file_name = "";
|
||||
std::string rtt_tr_file_name = "";
|
||||
std::string rto_tr_file_name = "";
|
||||
double data_mbytes = 0;
|
||||
uint32_t mtu_bytes = 400;
|
||||
uint16_t num_flows = 1;
|
||||
@@ -162,25 +177,27 @@ int main (int argc, char *argv[])
|
||||
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue("transport_prot", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot);
|
||||
cmd.AddValue("error_p", "Packet error rate", error_p);
|
||||
cmd.AddValue("bandwidth", "Bottleneck bandwidth", bandwidth);
|
||||
cmd.AddValue("access_bandwidth", "Access link bandwidth", access_bandwidth);
|
||||
cmd.AddValue("delay", "Access link delay", access_delay);
|
||||
cmd.AddValue("tracing", "Flag to enable/disable tracing", tracing);
|
||||
cmd.AddValue("tr_name", "Name of output trace file", tr_file_name);
|
||||
cmd.AddValue("cwnd_tr_name", "Name of output trace file", cwnd_tr_file_name);
|
||||
cmd.AddValue("ssthresh_tr_name", "Name of output trace file", ssthresh_tr_file_name);
|
||||
cmd.AddValue("data", "Number of Megabytes of data to transmit", data_mbytes);
|
||||
cmd.AddValue("mtu", "Size of IP packets to send in bytes", mtu_bytes);
|
||||
cmd.AddValue("num_flows", "Number of flows", num_flows);
|
||||
cmd.AddValue("duration", "Time to allow flows to run in seconds", duration);
|
||||
cmd.AddValue("run", "Run index (for setting repeatable seeds)", run);
|
||||
cmd.AddValue("flow_monitor", "Enable flow monitor", flow_monitor);
|
||||
cmd.AddValue ("transport_prot", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot);
|
||||
cmd.AddValue ("error_p", "Packet error rate", error_p);
|
||||
cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth);
|
||||
cmd.AddValue ("access_bandwidth", "Access link bandwidth", access_bandwidth);
|
||||
cmd.AddValue ("delay", "Access link delay", access_delay);
|
||||
cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing);
|
||||
cmd.AddValue ("tr_name", "Name of output trace file", tr_file_name);
|
||||
cmd.AddValue ("cwnd_tr_name", "Name of output trace file", cwnd_tr_file_name);
|
||||
cmd.AddValue ("ssthresh_tr_name", "Name of output trace file", ssthresh_tr_file_name);
|
||||
cmd.AddValue ("rtt_tr_name", "Name of output trace file", rtt_tr_file_name);
|
||||
cmd.AddValue ("rto_tr_name", "Name of output trace file", rto_tr_file_name);
|
||||
cmd.AddValue ("data", "Number of Megabytes of data to transmit", data_mbytes);
|
||||
cmd.AddValue ("mtu", "Size of IP packets to send in bytes", mtu_bytes);
|
||||
cmd.AddValue ("num_flows", "Number of flows", num_flows);
|
||||
cmd.AddValue ("duration", "Time to allow flows to run in seconds", duration);
|
||||
cmd.AddValue ("run", "Run index (for setting repeatable seeds)", run);
|
||||
cmd.AddValue ("flow_monitor", "Enable flow monitor", flow_monitor);
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
SeedManager::SetSeed(1);
|
||||
SeedManager::SetRun(run);
|
||||
SeedManager::SetSeed (1);
|
||||
SeedManager::SetRun (run);
|
||||
|
||||
// User may find it convenient to enable logging
|
||||
//LogComponentEnable("TcpVariantsComparison", LOG_LEVEL_ALL);
|
||||
@@ -188,12 +205,12 @@ int main (int argc, char *argv[])
|
||||
//LogComponentEnable("DropTailQueue", LOG_LEVEL_ALL);
|
||||
|
||||
// Calculate the ADU size
|
||||
Header* temp_header = new Ipv4Header();
|
||||
uint32_t ip_header = temp_header->GetSerializedSize();
|
||||
Header* temp_header = new Ipv4Header ();
|
||||
uint32_t ip_header = temp_header->GetSerializedSize ();
|
||||
NS_LOG_LOGIC ("IP Header size is: " << ip_header);
|
||||
delete temp_header;
|
||||
temp_header = new TcpHeader();
|
||||
uint32_t tcp_header = temp_header->GetSerializedSize();
|
||||
temp_header = new TcpHeader ();
|
||||
uint32_t tcp_header = temp_header->GetSerializedSize ();
|
||||
NS_LOG_LOGIC ("TCP Header size is: " << tcp_header);
|
||||
delete temp_header;
|
||||
uint32_t tcp_adu_size = mtu_bytes - (ip_header + tcp_header);
|
||||
@@ -204,22 +221,28 @@ int main (int argc, char *argv[])
|
||||
float stop_time = start_time + duration;
|
||||
|
||||
// Select TCP variant
|
||||
if (transport_prot.compare("TcpTahoe") == 0)
|
||||
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpTahoe::GetTypeId()));
|
||||
else if (transport_prot.compare("TcpReno") == 0)
|
||||
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpReno::GetTypeId()));
|
||||
else if (transport_prot.compare("TcpNewReno") == 0)
|
||||
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId()));
|
||||
else if (transport_prot.compare("TcpWestwood") == 0)
|
||||
{// the default protocol type in ns3::TcpWestwood is WESTWOOD
|
||||
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId()));
|
||||
Config::SetDefault("ns3::TcpWestwood::FilterType", EnumValue(TcpWestwood::TUSTIN));
|
||||
}
|
||||
else if (transport_prot.compare("TcpWestwoodPlus") == 0)
|
||||
if (transport_prot.compare ("TcpTahoe") == 0)
|
||||
{
|
||||
Config::SetDefault("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId()));
|
||||
Config::SetDefault("ns3::TcpWestwood::ProtocolType", EnumValue(TcpWestwood::WESTWOODPLUS));
|
||||
Config::SetDefault("ns3::TcpWestwood::FilterType", EnumValue(TcpWestwood::TUSTIN));
|
||||
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpTahoe::GetTypeId ()));
|
||||
}
|
||||
else if (transport_prot.compare ("TcpReno") == 0)
|
||||
{
|
||||
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpReno::GetTypeId ()));
|
||||
}
|
||||
else if (transport_prot.compare ("TcpNewReno") == 0)
|
||||
{
|
||||
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId ()));
|
||||
}
|
||||
else if (transport_prot.compare ("TcpWestwood") == 0)
|
||||
{ // the default protocol type in ns3::TcpWestwood is WESTWOOD
|
||||
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
|
||||
Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
|
||||
}
|
||||
else if (transport_prot.compare ("TcpWestwoodPlus") == 0)
|
||||
{
|
||||
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
|
||||
Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS));
|
||||
Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -231,18 +254,18 @@ int main (int argc, char *argv[])
|
||||
NodeContainer gateways;
|
||||
gateways.Create (1);
|
||||
NodeContainer sources;
|
||||
sources.Create(num_flows);
|
||||
sources.Create (num_flows);
|
||||
NodeContainer sinks;
|
||||
sinks.Create(num_flows);
|
||||
sinks.Create (num_flows);
|
||||
|
||||
// Configure the error model
|
||||
// Here we use RateErrorModel with packet error rate
|
||||
Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable>();
|
||||
Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> ();
|
||||
uv->SetStream (50);
|
||||
RateErrorModel error_model;
|
||||
error_model.SetRandomVariable(uv);
|
||||
error_model.SetUnit(RateErrorModel::ERROR_UNIT_PACKET);
|
||||
error_model.SetRate(error_p);
|
||||
error_model.SetRandomVariable (uv);
|
||||
error_model.SetUnit (RateErrorModel::ERROR_UNIT_PACKET);
|
||||
error_model.SetRate (error_p);
|
||||
|
||||
PointToPointHelper UnReLink;
|
||||
UnReLink.SetDeviceAttribute ("DataRate", StringValue (bandwidth));
|
||||
@@ -262,16 +285,16 @@ int main (int argc, char *argv[])
|
||||
LocalLink.SetDeviceAttribute ("DataRate", StringValue (access_bandwidth));
|
||||
LocalLink.SetChannelAttribute ("Delay", StringValue (access_delay));
|
||||
Ipv4InterfaceContainer sink_interfaces;
|
||||
for (int i=0; i<num_flows; i++)
|
||||
for (int i = 0; i < num_flows; i++)
|
||||
{
|
||||
NetDeviceContainer devices;
|
||||
devices = LocalLink.Install(sources.Get(i), gateways.Get(0));
|
||||
address.NewNetwork();
|
||||
devices = LocalLink.Install (sources.Get (i), gateways.Get (0));
|
||||
address.NewNetwork ();
|
||||
Ipv4InterfaceContainer interfaces = address.Assign (devices);
|
||||
devices = UnReLink.Install(gateways.Get(0), sinks.Get(i));
|
||||
address.NewNetwork();
|
||||
devices = UnReLink.Install (gateways.Get (0), sinks.Get (i));
|
||||
address.NewNetwork ();
|
||||
interfaces = address.Assign (devices);
|
||||
sink_interfaces.Add(interfaces.Get(1));
|
||||
sink_interfaces.Add (interfaces.Get (1));
|
||||
}
|
||||
|
||||
NS_LOG_INFO ("Initialize Global Routing.");
|
||||
@@ -281,29 +304,29 @@ int main (int argc, char *argv[])
|
||||
Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
|
||||
PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
|
||||
|
||||
for(uint16_t i=0; i<sources.GetN(); i++)
|
||||
for (uint16_t i = 0; i < sources.GetN (); i++)
|
||||
{
|
||||
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress(i, 0), port));
|
||||
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port));
|
||||
|
||||
if (transport_prot.compare("TcpTahoe") == 0
|
||||
|| transport_prot.compare("TcpReno") == 0
|
||||
|| transport_prot.compare("TcpNewReno") == 0
|
||||
|| transport_prot.compare("TcpWestwood") == 0
|
||||
|| transport_prot.compare("TcpWestwoodPlus") == 0)
|
||||
if (transport_prot.compare ("TcpTahoe") == 0
|
||||
|| transport_prot.compare ("TcpReno") == 0
|
||||
|| transport_prot.compare ("TcpNewReno") == 0
|
||||
|| transport_prot.compare ("TcpWestwood") == 0
|
||||
|| transport_prot.compare ("TcpWestwoodPlus") == 0)
|
||||
{
|
||||
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size));
|
||||
BulkSendHelper ftp("ns3::TcpSocketFactory", Address());
|
||||
BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ());
|
||||
ftp.SetAttribute ("Remote", remoteAddress);
|
||||
ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size));
|
||||
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes*1000000)));
|
||||
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000)));
|
||||
|
||||
ApplicationContainer sourceApp = ftp.Install (sources.Get(i));
|
||||
sourceApp.Start (Seconds (start_time*i));
|
||||
ApplicationContainer sourceApp = ftp.Install (sources.Get (i));
|
||||
sourceApp.Start (Seconds (start_time * i));
|
||||
sourceApp.Stop (Seconds (stop_time - 3));
|
||||
|
||||
sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
|
||||
ApplicationContainer sinkApp = sinkHelper.Install (sinks);
|
||||
sinkApp.Start (Seconds (start_time*i));
|
||||
sinkApp.Start (Seconds (start_time * i));
|
||||
sinkApp.Stop (Seconds (stop_time));
|
||||
}
|
||||
else
|
||||
@@ -316,42 +339,53 @@ int main (int argc, char *argv[])
|
||||
// Set up tracing if enabled
|
||||
if (tracing)
|
||||
{
|
||||
std::ofstream ascii;
|
||||
Ptr<OutputStreamWrapper> ascii_wrap;
|
||||
if (tr_file_name.compare("") == 0)
|
||||
if (tr_file_name.compare ("") != 0)
|
||||
{
|
||||
NS_LOG_DEBUG ("No trace file provided");
|
||||
exit (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ascii.open (tr_file_name.c_str());
|
||||
ascii_wrap = new OutputStreamWrapper(tr_file_name.c_str(), std::ios::out);
|
||||
std::ofstream ascii;
|
||||
Ptr<OutputStreamWrapper> ascii_wrap;
|
||||
ascii.open (tr_file_name.c_str ());
|
||||
ascii_wrap = new OutputStreamWrapper (tr_file_name.c_str (), std::ios::out);
|
||||
stack.EnableAsciiIpv4All (ascii_wrap);
|
||||
}
|
||||
|
||||
stack.EnableAsciiIpv4All (ascii_wrap);
|
||||
if (cwnd_tr_file_name.compare ("") != 0)
|
||||
{
|
||||
Simulator::Schedule (Seconds (0.00001), &TraceCwnd, cwnd_tr_file_name);
|
||||
}
|
||||
|
||||
if (ssthresh_tr_file_name.compare ("") != 0)
|
||||
{
|
||||
Simulator::Schedule (Seconds (0.00001), &TraceSsThresh, ssthresh_tr_file_name);
|
||||
}
|
||||
|
||||
if (rtt_tr_file_name.compare ("") != 0)
|
||||
{
|
||||
Simulator::Schedule (Seconds (0.00001), &TraceRtt, rtt_tr_file_name);
|
||||
}
|
||||
|
||||
if (rto_tr_file_name.compare ("") != 0)
|
||||
{
|
||||
Simulator::Schedule (Seconds (0.00001), &TraceRto, rto_tr_file_name);
|
||||
}
|
||||
|
||||
Simulator::Schedule(Seconds(0.00001), &TraceCwnd, cwnd_tr_file_name);
|
||||
Simulator::Schedule(Seconds(0.00001), &TraceSsThresh, ssthresh_tr_file_name);
|
||||
}
|
||||
|
||||
UnReLink.EnablePcapAll("TcpVariantsComparison", true);
|
||||
LocalLink.EnablePcapAll("TcpVariantsComparison", true);
|
||||
UnReLink.EnablePcapAll ("TcpVariantsComparison", true);
|
||||
LocalLink.EnablePcapAll ("TcpVariantsComparison", true);
|
||||
|
||||
// Flow monitor
|
||||
Ptr<FlowMonitor> flowMonitor;
|
||||
FlowMonitorHelper flowHelper;
|
||||
if (flow_monitor)
|
||||
{
|
||||
flowMonitor = flowHelper.InstallAll();
|
||||
flowHelper.InstallAll ();
|
||||
}
|
||||
|
||||
Simulator::Stop (Seconds(stop_time));
|
||||
Simulator::Stop (Seconds (stop_time));
|
||||
Simulator::Run ();
|
||||
|
||||
if (flow_monitor)
|
||||
{
|
||||
flowMonitor->SerializeToXmlFile("TcpVariantsComparison.flowmonitor", true, true);
|
||||
flowHelper.SerializeToXmlFile ("TcpVariantsComparison.flowmonitor", true, true);
|
||||
}
|
||||
|
||||
Simulator::Destroy ();
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -35,9 +35,10 @@ stack = ns.internet.InternetStackHelper()
|
||||
stack.Install(nodes)
|
||||
|
||||
address = ns.internet.Ipv4AddressHelper()
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.1.0"), ns.network.Ipv4Mask("255.255.255.0"))
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.1.0"),
|
||||
ns.network.Ipv4Mask("255.255.255.0"))
|
||||
|
||||
interfaces = address.Assign (devices);
|
||||
interfaces = address.Assign(devices)
|
||||
|
||||
echoServer = ns.applications.UdpEchoServerHelper(9)
|
||||
|
||||
@@ -47,7 +48,7 @@ serverApps.Stop(ns.core.Seconds(10.0))
|
||||
|
||||
echoClient = ns.applications.UdpEchoClientHelper(interfaces.GetAddress(1), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds (1.0)))
|
||||
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds(1.0)))
|
||||
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(nodes.Get(0))
|
||||
|
||||
@@ -26,14 +26,20 @@ using namespace ns3;
|
||||
class MyObject : public Object
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Register this type.
|
||||
* \return The TypeId.
|
||||
*/
|
||||
static TypeId GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("MyObject")
|
||||
.SetParent (Object::GetTypeId ())
|
||||
.SetParent<Object> ()
|
||||
.SetGroupName ("Tutorial")
|
||||
.AddConstructor<MyObject> ()
|
||||
.AddTraceSource ("MyInteger",
|
||||
"An integer value to trace.",
|
||||
MakeTraceSourceAccessor (&MyObject::m_myInt))
|
||||
MakeTraceSourceAccessor (&MyObject::m_myInt),
|
||||
"ns3::TracedValue::Int32Callback")
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
#include "ns3/core-module.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("HelloSimulator");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("HelloSimulator");
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
# -*- Mode: Python; -*-
|
||||
# /*
|
||||
# * This program is free software; you can redistribute it and/or modify
|
||||
# * it under the terms of the GNU General Public License version 2 as
|
||||
# * published by the Free Software Foundation;
|
||||
# *
|
||||
# * This program is distributed in the hope that it will be useful,
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# * GNU General Public License for more details.
|
||||
# *
|
||||
# * You should have received a copy of the GNU General Public License
|
||||
# * along with this program; if not, write to the Free Software
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# *
|
||||
# * Ported to Python by Mohit P. Tahiliani
|
||||
# */
|
||||
|
||||
import ns.core
|
||||
import ns.network
|
||||
import ns.csma
|
||||
import ns.internet
|
||||
import ns.point_to_point
|
||||
import ns.applications
|
||||
import sys
|
||||
|
||||
# // Default Network Topology
|
||||
# //
|
||||
# // 10.1.1.0
|
||||
# // n0 -------------- n1 n2 n3 n4
|
||||
# // point-to-point | | | |
|
||||
# // ================
|
||||
# // LAN 10.1.2.0
|
||||
|
||||
cmd = ns.core.CommandLine()
|
||||
cmd.nCsma = 3
|
||||
cmd.verbose = "True"
|
||||
cmd.AddValue("nCsma", "Number of \"extra\" CSMA nodes/devices")
|
||||
cmd.AddValue("verbose", "Tell echo applications to log if true")
|
||||
cmd.Parse(sys.argv)
|
||||
|
||||
nCsma = int(cmd.nCsma)
|
||||
verbose = cmd.verbose
|
||||
|
||||
if verbose == "True":
|
||||
ns.core.LogComponentEnable("UdpEchoClientApplication", ns.core.LOG_LEVEL_INFO)
|
||||
ns.core.LogComponentEnable("UdpEchoServerApplication", ns.core.LOG_LEVEL_INFO)
|
||||
nCsma = 1 if int(nCsma) == 0 else int(nCsma)
|
||||
|
||||
p2pNodes = ns.network.NodeContainer()
|
||||
p2pNodes.Create(2)
|
||||
|
||||
csmaNodes = ns.network.NodeContainer()
|
||||
csmaNodes.Add(p2pNodes.Get(1))
|
||||
csmaNodes.Create(nCsma)
|
||||
|
||||
pointToPoint = ns.point_to_point.PointToPointHelper()
|
||||
pointToPoint.SetDeviceAttribute("DataRate", ns.core.StringValue("5Mbps"))
|
||||
pointToPoint.SetChannelAttribute("Delay", ns.core.StringValue("2ms"))
|
||||
|
||||
p2pDevices = pointToPoint.Install(p2pNodes)
|
||||
|
||||
csma = ns.csma.CsmaHelper()
|
||||
csma.SetChannelAttribute("DataRate", ns.core.StringValue("100Mbps"))
|
||||
csma.SetChannelAttribute("Delay", ns.core.TimeValue(ns.core.NanoSeconds(6560)))
|
||||
|
||||
csmaDevices = csma.Install(csmaNodes)
|
||||
|
||||
stack = ns.internet.InternetStackHelper()
|
||||
stack.Install(p2pNodes.Get(0))
|
||||
stack.Install(csmaNodes)
|
||||
|
||||
address = ns.internet.Ipv4AddressHelper()
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.1.0"), ns.network.Ipv4Mask("255.255.255.0"))
|
||||
p2pInterfaces = address.Assign(p2pDevices)
|
||||
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.2.0"), ns.network.Ipv4Mask("255.255.255.0"))
|
||||
csmaInterfaces = address.Assign(csmaDevices)
|
||||
|
||||
echoServer = ns.applications.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(csmaNodes.Get(nCsma))
|
||||
serverApps.Start(ns.core.Seconds(1.0))
|
||||
serverApps.Stop(ns.core.Seconds(10.0))
|
||||
|
||||
echoClient = ns.applications.UdpEchoClientHelper(csmaInterfaces.GetAddress(nCsma), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds (1.0)))
|
||||
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(p2pNodes.Get(0))
|
||||
clientApps.Start(ns.core.Seconds(2.0))
|
||||
clientApps.Stop(ns.core.Seconds(10.0))
|
||||
|
||||
ns.internet.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
|
||||
|
||||
pointToPoint.EnablePcapAll("second")
|
||||
csma.EnablePcap ("second", csmaDevices.Get (1), True)
|
||||
|
||||
ns.core.Simulator.Run()
|
||||
ns.core.Simulator.Destroy()
|
||||
|
||||
@@ -66,6 +66,11 @@ public:
|
||||
MyApp ();
|
||||
virtual ~MyApp ();
|
||||
|
||||
/**
|
||||
* Register this type.
|
||||
* \return The TypeId.
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate);
|
||||
|
||||
private:
|
||||
@@ -102,6 +107,17 @@ MyApp::~MyApp ()
|
||||
m_socket = 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
TypeId MyApp::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("MyApp")
|
||||
.SetParent<Application> ()
|
||||
.SetGroupName ("Tutorial")
|
||||
.AddConstructor<MyApp> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
void
|
||||
MyApp::Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
|
||||
{
|
||||
@@ -210,8 +226,8 @@ main (int argc, char *argv[])
|
||||
uint16_t sinkPort = 8080;
|
||||
Address sinkAddress;
|
||||
Address anyAddress;
|
||||
std::string probeName;
|
||||
std::string probeTrace;
|
||||
std::string probeType;
|
||||
std::string tracePath;
|
||||
if (useV6 == false)
|
||||
{
|
||||
Ipv4AddressHelper address;
|
||||
@@ -219,8 +235,8 @@ main (int argc, char *argv[])
|
||||
Ipv4InterfaceContainer interfaces = address.Assign (devices);
|
||||
sinkAddress = InetSocketAddress (interfaces.GetAddress (1), sinkPort);
|
||||
anyAddress = InetSocketAddress (Ipv4Address::GetAny (), sinkPort);
|
||||
probeName = "ns3::Ipv4PacketProbe";
|
||||
probeTrace = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
|
||||
probeType = "ns3::Ipv4PacketProbe";
|
||||
tracePath = "/NodeList/*/$ns3::Ipv4L3Protocol/Tx";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -229,8 +245,8 @@ main (int argc, char *argv[])
|
||||
Ipv6InterfaceContainer interfaces = address.Assign (devices);
|
||||
sinkAddress = Inet6SocketAddress (interfaces.GetAddress (1,1), sinkPort);
|
||||
anyAddress = Inet6SocketAddress (Ipv6Address::GetAny (), sinkPort);
|
||||
probeName = "ns3::Ipv6PacketProbe";
|
||||
probeTrace = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
|
||||
probeType = "ns3::Ipv6PacketProbe";
|
||||
tracePath = "/NodeList/*/$ns3::Ipv6L3Protocol/Tx";
|
||||
}
|
||||
|
||||
PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", anyAddress);
|
||||
@@ -265,12 +281,12 @@ main (int argc, char *argv[])
|
||||
"Time (Seconds)",
|
||||
"Packet Byte Count");
|
||||
|
||||
// Specify the probe type, probe path (in configuration namespace), and
|
||||
// Specify the probe type, trace source path (in configuration namespace), and
|
||||
// probe output trace source ("OutputBytes") to plot. The fourth argument
|
||||
// specifies the name of the data series label on the plot. The last
|
||||
// argument formats the plot by specifying where the key should be placed.
|
||||
plotHelper.PlotProbe (probeName,
|
||||
probeTrace,
|
||||
plotHelper.PlotProbe (probeType,
|
||||
tracePath,
|
||||
"OutputBytes",
|
||||
"Packet Byte Count",
|
||||
GnuplotAggregator::KEY_BELOW);
|
||||
@@ -285,10 +301,10 @@ main (int argc, char *argv[])
|
||||
// Set the labels for this formatted output file.
|
||||
fileHelper.Set2dFormat ("Time (Seconds) = %.3e\tPacket Byte Count = %.0f");
|
||||
|
||||
// Specify the probe type, probe path (in configuration namespace), and
|
||||
// Specify the probe type, trace source path (in configuration namespace), and
|
||||
// probe output trace source ("OutputBytes") to write.
|
||||
fileHelper.WriteProbe (probeName,
|
||||
probeTrace,
|
||||
fileHelper.WriteProbe (probeType,
|
||||
tracePath,
|
||||
"OutputBytes");
|
||||
|
||||
Simulator::Stop (Seconds (20));
|
||||
|
||||
@@ -65,6 +65,11 @@ public:
|
||||
MyApp ();
|
||||
virtual ~MyApp ();
|
||||
|
||||
/**
|
||||
* Register this type.
|
||||
* \return The TypeId.
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate);
|
||||
|
||||
private:
|
||||
@@ -101,6 +106,17 @@ MyApp::~MyApp ()
|
||||
m_socket = 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
TypeId MyApp::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("MyApp")
|
||||
.SetParent<Application> ()
|
||||
.SetGroupName ("Tutorial")
|
||||
.AddConstructor<MyApp> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
void
|
||||
MyApp::Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
// Default Network Topology
|
||||
//
|
||||
// Number of wifi or csma nodes can be increased up to 250
|
||||
// |
|
||||
// Rank 0 | Rank 1
|
||||
// -------------------------|----------------------------
|
||||
// Wifi 10.1.3.0
|
||||
// AP
|
||||
// * * * *
|
||||
@@ -44,19 +48,23 @@ main (int argc, char *argv[])
|
||||
bool verbose = true;
|
||||
uint32_t nCsma = 3;
|
||||
uint32_t nWifi = 3;
|
||||
bool tracing = false;
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
|
||||
cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
|
||||
cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
|
||||
cmd.AddValue ("tracing", "Enable pcap tracing", tracing);
|
||||
|
||||
cmd.Parse (argc,argv);
|
||||
|
||||
if (nWifi > 18)
|
||||
// Check for valid number of csma or wifi nodes
|
||||
// 250 should be enough, otherwise IP addresses
|
||||
// soon become an issue
|
||||
if (nWifi > 250 || nCsma > 250)
|
||||
{
|
||||
std::cout << "Number of wifi nodes " << nWifi <<
|
||||
" specified exceeds the mobility bounding box" << std::endl;
|
||||
exit (1);
|
||||
std::cout << "Too many wifi or csma nodes, no more than 250 each." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
@@ -169,9 +177,12 @@ main (int argc, char *argv[])
|
||||
|
||||
Simulator::Stop (Seconds (10.0));
|
||||
|
||||
pointToPoint.EnablePcapAll ("third");
|
||||
phy.EnablePcap ("third", apDevices.Get (0));
|
||||
csma.EnablePcap ("third", csmaDevices.Get (0), true);
|
||||
if (tracing == true)
|
||||
{
|
||||
pointToPoint.EnablePcapAll ("third");
|
||||
phy.EnablePcap ("third", apDevices.Get (0));
|
||||
csma.EnablePcap ("third", csmaDevices.Get (0), true);
|
||||
}
|
||||
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
# -*- Mode: Python; -*-
|
||||
# /*
|
||||
# * This program is free software; you can redistribute it and/or modify
|
||||
# * it under the terms of the GNU General Public License version 2 as
|
||||
# * published by the Free Software Foundation;
|
||||
# *
|
||||
# * This program is distributed in the hope that it will be useful,
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# * GNU General Public License for more details.
|
||||
# *
|
||||
# * You should have received a copy of the GNU General Public License
|
||||
# * along with this program; if not, write to the Free Software
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# *
|
||||
# * Ported to Python by Mohit P. Tahiliani
|
||||
# */
|
||||
|
||||
import ns.core
|
||||
import ns.network
|
||||
import ns.point_to_point
|
||||
import ns.applications
|
||||
import ns.wifi
|
||||
import ns.mobility
|
||||
import ns.csma
|
||||
import ns.internet
|
||||
import sys
|
||||
|
||||
# // Default Network Topology
|
||||
# //
|
||||
# // Wifi 10.1.3.0
|
||||
# // AP
|
||||
# // * * * *
|
||||
# // | | | | 10.1.1.0
|
||||
# // n5 n6 n7 n0 -------------- n1 n2 n3 n4
|
||||
# // point-to-point | | | |
|
||||
# // ================
|
||||
# // LAN 10.1.2.0
|
||||
|
||||
cmd = ns.core.CommandLine()
|
||||
cmd.nCsma = 3
|
||||
cmd.verbose = "True"
|
||||
cmd.nWifi = 3
|
||||
cmd.AddValue("nCsma", "Number of \"extra\" CSMA nodes/devices")
|
||||
cmd.AddValue("nWifi", "Number of wifi STA devices")
|
||||
cmd.AddValue("verbose", "Tell echo applications to log if true")
|
||||
|
||||
cmd.Parse(sys.argv)
|
||||
|
||||
nCsma = int(cmd.nCsma)
|
||||
verbose = cmd.verbose
|
||||
nWifi = int(cmd.nWifi)
|
||||
|
||||
if nWifi > 18:
|
||||
print "Number of wifi nodes "+ str(nWifi)+ " specified exceeds the mobility bounding box"
|
||||
sys.exit(1)
|
||||
|
||||
if verbose == "True":
|
||||
ns.core.LogComponentEnable("UdpEchoClientApplication", ns.core.LOG_LEVEL_INFO)
|
||||
ns.core.LogComponentEnable("UdpEchoServerApplication", ns.core.LOG_LEVEL_INFO)
|
||||
|
||||
p2pNodes = ns.network.NodeContainer()
|
||||
p2pNodes.Create(2)
|
||||
|
||||
pointToPoint = ns.point_to_point.PointToPointHelper()
|
||||
pointToPoint.SetDeviceAttribute("DataRate", ns.core.StringValue("5Mbps"))
|
||||
pointToPoint.SetChannelAttribute("Delay", ns.core.StringValue("2ms"))
|
||||
|
||||
p2pDevices = pointToPoint.Install(p2pNodes)
|
||||
|
||||
csmaNodes = ns.network.NodeContainer()
|
||||
csmaNodes.Add(p2pNodes.Get(1))
|
||||
csmaNodes.Create(nCsma)
|
||||
|
||||
csma = ns.csma.CsmaHelper()
|
||||
csma.SetChannelAttribute("DataRate", ns.core.StringValue("100Mbps"))
|
||||
csma.SetChannelAttribute("Delay", ns.core.TimeValue(ns.core.NanoSeconds(6560)))
|
||||
|
||||
csmaDevices = csma.Install(csmaNodes)
|
||||
|
||||
wifiStaNodes = ns.network.NodeContainer()
|
||||
wifiStaNodes.Create(nWifi)
|
||||
wifiApNode = p2pNodes.Get(0)
|
||||
|
||||
channel = ns.wifi.YansWifiChannelHelper.Default()
|
||||
phy = ns.wifi.YansWifiPhyHelper.Default()
|
||||
phy.SetChannel(channel.Create())
|
||||
|
||||
wifi = ns.wifi.WifiHelper.Default()
|
||||
wifi.SetRemoteStationManager("ns3::AarfWifiManager")
|
||||
|
||||
mac = ns.wifi.NqosWifiMacHelper.Default()
|
||||
ssid = ns.wifi.Ssid ("ns-3-ssid")
|
||||
|
||||
mac.SetType ("ns3::StaWifiMac", "Ssid", ns.wifi.SsidValue(ssid), "ActiveProbing", ns.core.BooleanValue(False))
|
||||
staDevices = wifi.Install(phy, mac, wifiStaNodes)
|
||||
|
||||
mac.SetType("ns3::ApWifiMac","Ssid", ns.wifi.SsidValue (ssid))
|
||||
apDevices = wifi.Install(phy, mac, wifiApNode)
|
||||
|
||||
mobility = ns.mobility.MobilityHelper()
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator", "MinX", ns.core.DoubleValue(0.0),
|
||||
"MinY", ns.core.DoubleValue (0.0), "DeltaX", ns.core.DoubleValue(5.0), "DeltaY", ns.core.DoubleValue(10.0),
|
||||
"GridWidth", ns.core.UintegerValue(3), "LayoutType", ns.core.StringValue("RowFirst"))
|
||||
|
||||
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", "Bounds", ns.mobility.RectangleValue(ns.mobility.Rectangle (-50, 50, -50, 50)))
|
||||
mobility.Install(wifiStaNodes)
|
||||
|
||||
mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel")
|
||||
mobility.Install(wifiApNode)
|
||||
|
||||
stack = ns.internet.InternetStackHelper()
|
||||
stack.Install(csmaNodes)
|
||||
stack.Install(wifiApNode)
|
||||
stack.Install(wifiStaNodes)
|
||||
|
||||
address = ns.internet.Ipv4AddressHelper()
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.1.0"), ns.network.Ipv4Mask("255.255.255.0"))
|
||||
p2pInterfaces = address.Assign(p2pDevices)
|
||||
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.2.0"), ns.network.Ipv4Mask("255.255.255.0"))
|
||||
csmaInterfaces = address.Assign(csmaDevices)
|
||||
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.3.0"), ns.network.Ipv4Mask("255.255.255.0"))
|
||||
address.Assign(staDevices)
|
||||
address.Assign(apDevices)
|
||||
|
||||
echoServer = ns.applications.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(csmaNodes.Get(nCsma))
|
||||
serverApps.Start(ns.core.Seconds(1.0))
|
||||
serverApps.Stop(ns.core.Seconds(10.0))
|
||||
|
||||
echoClient = ns.applications.UdpEchoClientHelper(csmaInterfaces.GetAddress(nCsma), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds (1.0)))
|
||||
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(wifiStaNodes.Get (nWifi - 1))
|
||||
clientApps.Start(ns.core.Seconds(2.0))
|
||||
clientApps.Stop(ns.core.Seconds(10.0))
|
||||
|
||||
ns.internet.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
|
||||
|
||||
ns.core.Simulator.Stop(ns.core.Seconds(10.0))
|
||||
|
||||
pointToPoint.EnablePcapAll ("third")
|
||||
phy.EnablePcap ("third", apDevices.Get (0))
|
||||
csma.EnablePcap ("third", csmaDevices.Get (0), True)
|
||||
|
||||
ns.core.Simulator.Run()
|
||||
ns.core.Simulator.Destroy()
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
@@ -12,9 +12,13 @@ def build(bld):
|
||||
obj = bld.create_ns3_program('second', ['core', 'point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'second.cc'
|
||||
|
||||
obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet'])
|
||||
bld.register_ns3_script('second.py', ['core', 'point-to-point', 'csma', 'internet', 'applications'])
|
||||
|
||||
obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications'])
|
||||
obj.source = 'third.cc'
|
||||
|
||||
bld.register_ns3_script('third.py', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications'])
|
||||
|
||||
obj = bld.create_ns3_program('fourth', ['core'])
|
||||
obj.source = 'fourth.cc'
|
||||
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
exec "`dirname "$0"`"/../../waf "$@"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user