Compare commits
431 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| a790246c4b | |||
| c1b266efad | |||
| cd94f509c3 | |||
| 8de030d7fb | |||
| d32f30ed8a | |||
| dc2307c5ae | |||
| 692bf472e6 | |||
| 4cb9c7b916 | |||
| 4cd32401ec | |||
| 0976e2d58a | |||
| a47df0d6a3 | |||
| 4e9c93545f | |||
| 5b9e3507b7 | |||
| 8bdfaee6e9 | |||
| 81b4f79c43 | |||
| 9878843ed3 | |||
| 3f609f8e31 | |||
| 6930a5263f | |||
| 3395e180e1 | |||
| f140db6a63 | |||
| 37ed3b545b | |||
| d4f2adc449 | |||
| d6edb8dcbd | |||
| 9489036c50 | |||
| 3ca7f202b4 | |||
| 8855ecbf5b | |||
| c961293eed | |||
| 497cb5cd28 | |||
| 5601229646 | |||
| 92fc236e1c | |||
| 8434fca41f | |||
| 891e8de991 | |||
| 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 | |||
| fcda743c44 | |||
| f0a030b94b | |||
| 455db9e086 | |||
| 013d328e7d | |||
| b703ac7f27 | |||
| d767aaddd2 | |||
| dd7996b57d | |||
| 3f92b8e1c5 | |||
| 6254c4b242 | |||
| 2aebf37542 | |||
| 9e5633feff | |||
| 792c339edc | |||
| 06777c4102 | |||
| bdad6336fe | |||
| 9346f805f2 | |||
| b2dc58dcb9 | |||
| 6313928fbc | |||
| a4d68196e7 | |||
| 132655443b | |||
| c10b5622a0 | |||
| d471d382ac | |||
| 899626019f | |||
| bd3ba18da4 | |||
| a49957015e | |||
| 4943ed3c70 | |||
| d9b1ff4d71 | |||
| 1ba5df7bc3 | |||
| 6603ec2fb3 | |||
| cedd6d624b | |||
| 0bb6e095b3 | |||
| 94cd3d8542 | |||
| d00ccf814c | |||
| 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 | |||
| 0950f7f943 | |||
| b6d33fd296 | |||
| 1857322c43 | |||
| 208fdf2681 | |||
| 65d1ba667b | |||
| ae9fbb2eaa | |||
| b489a41127 | |||
| 9d2770100d | |||
| 287bda5b7e | |||
| 98945439e1 | |||
| 3ae1348425 | |||
| a0fefe1074 | |||
| 5072f3a3c6 | |||
| 68a33cd7ba | |||
| f6fc901227 | |||
| 74f0cf7073 | |||
| a9ef49d196 | |||
| a64d69ce19 | |||
| 07357e4048 | |||
| 4c20e1b099 | |||
| 153479dac9 | |||
| 16e4f9b004 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| 5a1d345b0e | |||
| 11f6f2330f | |||
| 2b751f4a2e | |||
| fb295e22c9 | |||
| a4ac0f8915 | |||
| 8d895fc3c3 | |||
| e9dc5fbd4c | |||
| 8f70c1a43f | |||
| f74b34aac2 | |||
| 1acbf3eb64 | |||
| 9a66307754 | |||
| d7bd267c7e | |||
| a15640d10e | |||
| b314b544e5 | |||
| 1c8972af9d | |||
| ae5d2c7131 | |||
| 058c71d944 | |||
| c75d24d0d3 | |||
| f30b671683 | |||
| 3588837aa6 | |||
| f7e18f35b4 | |||
| af31d858d2 | |||
| 16187bdb69 | |||
| f7769e0ea0 | |||
| 2834944fc2 | |||
| 2f07ece0bb | |||
| 9d815d019d |
@@ -67,3 +67,5 @@ ae540de68a2534213342c5e0b12afb47d7518a90 ns-3.14
|
||||
b4a70b99171ade6e9628a87780994238950a1df1 ns-3.17
|
||||
cfbc9491d7e7c9d346cc042fd35b8afb8836e81f ns-3.18
|
||||
322102df792e2be6c74df74f776b3470fb1db795 ns-3.19
|
||||
da0eb48df23f96335f32a37f047a6bc27e197c8d ns-3.20
|
||||
fa4be182ef17746cea50e89af557c79a28b76533 ns-3.21
|
||||
|
||||
@@ -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,12 +12,12 @@ Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu)
|
||||
Raj Bhattacharjea (raj.b@gatech.edu)
|
||||
Timo Bingmann (timo.bingmann@student.kit.edu)
|
||||
Julien Boite (juboite@gmail.com)
|
||||
Biljana Bojovic <bbojovic@cttc.es>
|
||||
Biljana Bojovic (bbojovic@cttc.es)
|
||||
Elena Borovkova (borokovaes@iitp.ru)
|
||||
Pavel Boyko (boyko@iitp.ru)
|
||||
Dan Broyles (muxman@sbcglobal.net)
|
||||
Jonathan Brugge (j.d.brugge@student.utwente.nl)
|
||||
Junling Bu <linlinjavaer@gmail.com>
|
||||
Junling Bu (linlinjavaer@gmail.com)
|
||||
Elena Buchatskaia (borovkovaes@iitp.ru)
|
||||
Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com)
|
||||
Scott Carpenter (scarpen@ncsu.edu)
|
||||
@@ -31,18 +32,19 @@ Luca Costantino (luca.costantino@gmail.com)
|
||||
Alexander D'souza (moijes12@gmail.com)
|
||||
Sébastien Deronne (sebastien.deronne@gmail.com)
|
||||
Craig Dowell (craigdo@ee.washington.edu)
|
||||
Gilaras Drakeson <gilaras@gmail.com>
|
||||
Christian Facchini <c.facchini@gmail.com>
|
||||
Gilaras Drakeson (gilaras@gmail.com)
|
||||
Christian Facchini (c.facchini@gmail.com)
|
||||
Denis Fakhriev (fakhriev@iitp.ru)
|
||||
Jahanzeb Farooq (Jahanzeb.Farooq@inria.fr, Jahanzeb.Farooq@gmail.com)
|
||||
Luca Favatella <slackydeb@gmail.com>
|
||||
Margherita Filippetti <morag87@gmail.com>
|
||||
Luca Favatella (slackydeb@gmail.com)
|
||||
Margherita Filippetti (morag87@gmail.com)
|
||||
Pedro Fortuna (pedro.fortuna@inescporto.pt)
|
||||
Juliana Freitag Borin (juliana.freitag@gmail.com)
|
||||
Piotr Gawlowicz (gawlowicz.p@gmail.com)
|
||||
Eric Gamess (egamess@gmail.com)
|
||||
Yida Gao <yidapb@gmail.com>
|
||||
Yida Gao (yidapb@gmail.com)
|
||||
Thomas Geithner (thomas.geithner@dai-labor.de)
|
||||
Ashim Ghosh <ashim.atiit@gmail.com>
|
||||
Ashim Ghosh (ashim.atiit@gmail.com)
|
||||
Martin Giachino (martin.giachino@gmail.com,giachino@fing.edu.uy)
|
||||
Tom Goff (tgoff@tgoff.net)
|
||||
Juan C. Granda (jcgranda@uniovi.es)
|
||||
@@ -53,9 +55,10 @@ Daniel Halperin (daniel@halper.in)
|
||||
Bruno Haick (bghaick@hotmail.com)
|
||||
Frank Helbert (frank@ime.usp.br)
|
||||
Tom Henderson (tomhend@u.washington.edu)
|
||||
Budiarto Herman <budiarto.herman@magister.fi>
|
||||
Tom Hewer <tomhewer@mac.com>
|
||||
Kim Højgaard-Hansen <kimrhh@gmail.com>
|
||||
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)
|
||||
@@ -67,7 +70,7 @@ Sam Jansen (sam.jansen@gmail.com)
|
||||
Liu Jian (liujatp@gmail.com)
|
||||
Piotr Jurkiewicz (piotr.jerzy.jurkiewicz@gmail.com)
|
||||
Evgeny Kalishenko (ydginster@gmail.com)
|
||||
Konstantinos Katsaros <dinos.katsaros@gmail.com>
|
||||
Konstantinos Katsaros (dinos.katsaros@gmail.com)
|
||||
Morteza Kheirkhah (m.kheirkhah@sussex.ac.uk)
|
||||
Flavio Kobuta (flaviokubota@gmail.com)
|
||||
Joe Kopena (tjkopena@cs.drexel.edu)
|
||||
@@ -75,11 +78,11 @@ Christopher Kosecki (christopher.l.kosecki.ctr@mail.mil)
|
||||
Aleksey Kovalenko (kovalenko@iitp.ru)
|
||||
Mathieu Lacage (mathieu.lacage@inria.fr)
|
||||
Emmanuelle Laprise (emmmanuelle.laprise@bluekazoo.ca)
|
||||
Kristijan Lenković <k.lenkovic@me.com>
|
||||
Kristijan Lenković (k.lenkovic@me.com)
|
||||
Daniel Lertpratchya (nikkipui@gmail.com)
|
||||
Björn Lichtblau (lichtbla@informatik.hu-berlin.de)
|
||||
Timo Lindhorst <tlnd@online.de>
|
||||
Erwan Livolant <erwan.livolant@inria.fr>
|
||||
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)
|
||||
@@ -88,26 +91,29 @@ Rubén Martínez (rmartinez@deic.uab.cat)
|
||||
Fabian Mauchle (f1mauchl@hsr.ch)
|
||||
Andrey Mazo (mazo@iitp.ru)
|
||||
Jonathan McCrohan (jmccroha@tcd.ie)
|
||||
Andrew McGregor (andrewmcgr@gmail.com)
|
||||
Vedran Miletić (rivanvx@gmail.com)
|
||||
Jens Mittag <jens.mittag@kit.edu>
|
||||
Jens Mittag (jens.mittag@kit.edu)
|
||||
Marco Miozzo (mmiozzo@cttc.es)
|
||||
Faker Moatamri (faker.moatamri@inria.fr)
|
||||
Edvin Močibob <edvin.mocibob@gmail.com>
|
||||
Edvin Močibob (edvin.mocibob@gmail.com)
|
||||
Mike Moreton (mjvm_ns@hotmail.com)
|
||||
Michele Muccio <michelemuccio@virgilio.it>
|
||||
Michele Muccio (michelemuccio@virgilio.it)
|
||||
Sidharth Nabar (snabar@uw.edu)
|
||||
Hemanth Narra (hemanth@ittc.ku.edu)
|
||||
Andreas Nilsson <andrnils@gmail.com>
|
||||
Roman Naumann (naumann@informatik.hu-berlin.de)
|
||||
Andreas Nilsson (andrnils@gmail.com)
|
||||
Jaume Nin (jnin@cttc.es)
|
||||
Michael Nowatkowski (nowatkom@gmail.com)
|
||||
Anh Nguyen <annguyen@ittc.ku.edu>
|
||||
Anh Nguyen (annguyen@ittc.ku.edu)
|
||||
Duy Nguyen (duy@soe.ucsc.edu)
|
||||
Lluís Parcerisa <parcerisa@gmail.com>
|
||||
Lluís Parcerisa (parcerisa@gmail.com)
|
||||
Natale Patriciello (natale.patriciello@gmail.com)
|
||||
Tommaso Pecorella (tommaso.pecorella@unifi.it)
|
||||
Vikas Pushkar (vikaskupushkar@gmail.com)
|
||||
Josh Pelkey (jpelkey@gatech.edu)
|
||||
Per <per_e_lists@rocketmail.com>
|
||||
Fernando Pereira <ferdonfeup@gmail.com>
|
||||
Per (per_e_lists@rocketmail.com)
|
||||
Fernando Pereira (ferdonfeup@gmail.com)
|
||||
Colin Perkins (csp@csperkins.org)
|
||||
Giuseppe Piro (g.piro@poliba.it)
|
||||
Yana Podkosova (yanapdk@rambler.ru)
|
||||
@@ -117,30 +123,33 @@ Bruno Ranieri (Yrrsinn@googlemail.com)
|
||||
Ken Renard (kenneth.renard@arl.army.mil)
|
||||
Manuel Requena (mrequena@cttc.es)
|
||||
George F. Riley (riley@ece.gatech.edu)
|
||||
Juergen Rinas <jrinas@gmx.de>
|
||||
Juergen Rinas (jrinas@gmx.de)
|
||||
Sebastian Rohde (sebastian.rohde@tu-dortmund.de)
|
||||
Karsten Roscher <sfx@rocktale.de>
|
||||
Karsten Roscher (sfx@rocktale.de)
|
||||
Bill Roome (wdr@bell-labs.com)
|
||||
David <david.rua@gmail.com>
|
||||
David (david.rua@gmail.com)
|
||||
Andrea Sacco (andrea.sacco85@gmail.com)
|
||||
Lynne Salameh (l.salameh@cs.ucl.ac.uk)
|
||||
Providence Salumu Munga (Providence.Salumu@gmail.com, Providence.Salumu_Munga@it-sudparis.eu)
|
||||
Francisco Javier Sánchez-Roselly <fnavarro@ujaen.es>
|
||||
l.salameh@cs.ucl.ac.uk
|
||||
Francisco Javier Sánchez-Roselly (fnavarro@ujaen.es)
|
||||
Florian Schmidt (Florian.Schmidt@cs.rwth-aachen.de)
|
||||
Guillaume Seguin (guillaume.seguin@inria.fr)
|
||||
Tomasz Seweryn (tomasz.seweryn7@gmail.com)
|
||||
Dmitrii Shakshin (d.shakshin@gmail.com)
|
||||
Kulin Shah (m.kulin@gmail.com)
|
||||
Guowang Shi <shiguowang2007@gmail.com>
|
||||
Guowang Shi (shiguowang2007@gmail.com)
|
||||
Phillip Sitbon (phillip.sitbon@gmail.com)
|
||||
Anirudh Sivaraman (sk.anirudh@gmail.com)
|
||||
Steven Smith <smith84@llnl.gov>
|
||||
Andrew Stanton <acstanton515@gmail.com>
|
||||
Steven Smith (smith84@llnl.gov)
|
||||
Andrew Stanton (acstanton515@gmail.com)
|
||||
Ewgenij Starostin (estar@cs.tu-berlin.de)
|
||||
YunQiang Su (wzssyqa@gmail.com)
|
||||
Brian Swenson (bswenson3@gatech.edu)
|
||||
Lalith Suresh (suresh.lalith@gmail.com)
|
||||
Dave Taht (dave.taht@bufferbloat.net)
|
||||
Marcos Talau (talau@users.sourceforge.net)
|
||||
Adrian S. W. Tam (adrian.sw.tam@gmail.com)
|
||||
Cristiano Tapparello (cristiano.tapparello@rochester.edu)
|
||||
Hajime Tazaki (tazaki@sfc.wide.ad.jp)
|
||||
Wilson Thong (wilsonwk@ee.cityu.edu.hk)
|
||||
Mauro Tortonesi (mauro.tortonesi@unife.it)
|
||||
|
||||
+134
@@ -50,6 +50,136 @@ the cracks, unfortunately. If you, as a user, can suggest improvements
|
||||
to this file based on your experience, please contribute a patch or drop
|
||||
us a note on ns-developers mailing list.</p>
|
||||
|
||||
<hr>
|
||||
<h1>Changes from ns-3.21 to ns-3.22</h1>
|
||||
<h2>New API:</h2>
|
||||
<ul>
|
||||
<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>
|
||||
</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 we have deprecated the three
|
||||
argument version of AddTraceSource.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to build system:</h2>
|
||||
<ul>
|
||||
<li> waf was upgraded to version 1.7.16
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changed behavior:</h2>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
@@ -204,6 +334,10 @@ failure. </li>
|
||||
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>
|
||||
|
||||
+138
@@ -16,6 +16,144 @@ Availability
|
||||
------------
|
||||
This release is not yet available.
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
- It is now possible to print the Neighbor Cache (ARP and NDISC) by using
|
||||
the RoutingProtocolHelper
|
||||
- The PrintRoutingTable... and PrintNeighborCache... are now static funtions
|
||||
i.e., it's not anymore needed to instantiate an helper just to use them.
|
||||
- A new TimeProbe class has been added to hook the data collection framework
|
||||
to traced values emitting Time objects
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1551 - NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
|
||||
- Bug 1726 - WiFi Minstrel rate control algorithm doesn't save state
|
||||
- Bug 1758 - Yans and Nist error rate models for 5/6 code rate 802.11n HT
|
||||
- Bug 1791 - TCP Endpoint never deallocates when closing
|
||||
- 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 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 1996 - RSRQ calculation: misleading variable names
|
||||
- Bug 1997 - Fix PlotProbe() documentation and usage for GnuplotHelper and FileHelper
|
||||
- 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
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
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
|
||||
|
||||
@@ -103,7 +103,7 @@ def main(argv):
|
||||
module_customization.post_register_types(root_module)
|
||||
|
||||
# register Callback<...> type handlers
|
||||
ns3modulegen_core_customizations.generate_callback_classes(root_module.after_forward_declarations,
|
||||
ns3modulegen_core_customizations.register_callback_classes(root_module.after_forward_declarations,
|
||||
callback_classes)
|
||||
|
||||
# -----------
|
||||
@@ -114,20 +114,18 @@ def main(argv):
|
||||
|
||||
ns3modulegen_core_customizations.Object_customizations(root_module)
|
||||
ns3modulegen_core_customizations.Attribute_customizations(root_module)
|
||||
|
||||
ns3modulegen_core_customizations.generate_callback_classes(root_module,
|
||||
callback_classes)
|
||||
|
||||
# -----------
|
||||
module_apidefs.register_functions(root_module)
|
||||
|
||||
|
||||
if hasattr(module_customization, 'post_register_functions'):
|
||||
module_customization.post_register_functions(root_module)
|
||||
|
||||
|
||||
# -----------
|
||||
root_module.generate(out)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
main(sys.argv)
|
||||
|
||||
|
||||
|
||||
@@ -112,7 +112,73 @@ class CallbackImplProxyMethod(typehandlers.ReverseWrapperBase):
|
||||
|
||||
|
||||
|
||||
def generate_callback_classes(out, callbacks):
|
||||
def register_callback_classes(out, callbacks):
|
||||
for callback_impl_num, template_parameters in enumerate(callbacks):
|
||||
cls_name = "ns3::Callback< %s >" % ', '.join(template_parameters)
|
||||
#print >> sys.stderr, "***** trying to register callback: %r" % cls_name
|
||||
class_name = "PythonCallbackImpl%i" % callback_impl_num
|
||||
|
||||
class PythonCallbackParameter(Parameter):
|
||||
"Class handlers"
|
||||
CTYPES = [cls_name]
|
||||
print("***** registering callback handler: %r (%r)" % (ctypeparser.normalize_type_string(cls_name), cls_name), file=sys.stderr)
|
||||
DIRECTIONS = [Parameter.DIRECTION_IN]
|
||||
PYTHON_CALLBACK_IMPL_NAME = class_name
|
||||
TEMPLATE_ARGS = template_parameters
|
||||
DISABLED = False
|
||||
|
||||
def convert_python_to_c(self, wrapper):
|
||||
"parses python args to get C++ value"
|
||||
assert isinstance(wrapper, typehandlers.ForwardWrapperBase)
|
||||
|
||||
if self.DISABLED:
|
||||
raise CodeGenerationError("wrapper could not be generated")
|
||||
|
||||
if self.default_value is None:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name)
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name)
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
callback_impl = wrapper.declarations.declare_variable(
|
||||
'ns3::Ptr<%s>' % self.PYTHON_CALLBACK_IMPL_NAME,
|
||||
'%s_cb_impl' % self.name)
|
||||
wrapper.before_call.write_code("%s = ns3::Create<%s> (%s);"
|
||||
% (callback_impl, self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
wrapper.call_params.append(
|
||||
'ns3::Callback<%s> (%s)' % (', '.join(self.TEMPLATE_ARGS), callback_impl))
|
||||
else:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name, 'NULL')
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name, optional=True)
|
||||
value = wrapper.declarations.declare_variable(
|
||||
'ns3::Callback<%s>' % ', '.join(self.TEMPLATE_ARGS),
|
||||
self.name+'_value',
|
||||
self.default_value)
|
||||
|
||||
wrapper.before_call.write_code("if (%s) {" % (py_callback,))
|
||||
wrapper.before_call.indent()
|
||||
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
|
||||
wrapper.before_call.write_code("%s = ns3::Callback<%s> (ns3::Create<%s> (%s));"
|
||||
% (value, ', '.join(self.TEMPLATE_ARGS),
|
||||
self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
|
||||
wrapper.before_call.unindent()
|
||||
wrapper.before_call.write_code("}") # closes: if (py_callback) {
|
||||
|
||||
wrapper.call_params.append(value)
|
||||
|
||||
|
||||
def convert_c_to_python(self, wrapper):
|
||||
raise typehandlers.NotSupportedError("Reverse wrappers for ns3::Callback<...> types "
|
||||
"(python using callbacks defined in C++) not implemented.")
|
||||
|
||||
|
||||
def generate_callback_classes(module, callbacks):
|
||||
out = module.after_forward_declarations
|
||||
for callback_impl_num, template_parameters in enumerate(callbacks):
|
||||
sink = MemoryCodeSink()
|
||||
cls_name = "ns3::Callback< %s >" % ', '.join(template_parameters)
|
||||
@@ -181,68 +247,23 @@ public:
|
||||
Warning)
|
||||
ok = False
|
||||
if not ok:
|
||||
try:
|
||||
typehandlers.return_type_matcher.lookup(cls_name)[0].DISABLED = True
|
||||
except typehandlers.TypeLookupError:
|
||||
pass
|
||||
try:
|
||||
typehandlers.param_type_matcher.lookup(cls_name)[0].DISABLED = True
|
||||
except typehandlers.TypeLookupError:
|
||||
pass
|
||||
continue
|
||||
|
||||
wrapper = CallbackImplProxyMethod(return_type, arguments)
|
||||
wrapper.generate(sink, 'operator()', decl_modifiers=[])
|
||||
|
||||
|
||||
sink.unindent()
|
||||
sink.writeln('};\n')
|
||||
print("Flushing to ", out, file=sys.stderr)
|
||||
sink.flush_to(out)
|
||||
|
||||
class PythonCallbackParameter(Parameter):
|
||||
"Class handlers"
|
||||
CTYPES = [cls_name]
|
||||
print("***** registering callback handler: %r" % ctypeparser.normalize_type_string(cls_name), file=sys.stderr)
|
||||
DIRECTIONS = [Parameter.DIRECTION_IN]
|
||||
PYTHON_CALLBACK_IMPL_NAME = class_name
|
||||
TEMPLATE_ARGS = template_parameters
|
||||
|
||||
def convert_python_to_c(self, wrapper):
|
||||
"parses python args to get C++ value"
|
||||
assert isinstance(wrapper, typehandlers.ForwardWrapperBase)
|
||||
|
||||
if self.default_value is None:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name)
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name)
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
callback_impl = wrapper.declarations.declare_variable(
|
||||
'ns3::Ptr<%s>' % self.PYTHON_CALLBACK_IMPL_NAME,
|
||||
'%s_cb_impl' % self.name)
|
||||
wrapper.before_call.write_code("%s = ns3::Create<%s> (%s);"
|
||||
% (callback_impl, self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
wrapper.call_params.append(
|
||||
'ns3::Callback<%s> (%s)' % (', '.join(self.TEMPLATE_ARGS), callback_impl))
|
||||
else:
|
||||
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name, 'NULL')
|
||||
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name, optional=True)
|
||||
value = wrapper.declarations.declare_variable(
|
||||
'ns3::Callback<%s>' % ', '.join(self.TEMPLATE_ARGS),
|
||||
self.name+'_value',
|
||||
self.default_value)
|
||||
|
||||
wrapper.before_call.write_code("if (%s) {" % (py_callback,))
|
||||
wrapper.before_call.indent()
|
||||
|
||||
wrapper.before_call.write_error_check(
|
||||
'!PyCallable_Check(%s)' % py_callback,
|
||||
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
|
||||
|
||||
wrapper.before_call.write_code("%s = ns3::Callback<%s> (ns3::Create<%s> (%s));"
|
||||
% (value, ', '.join(self.TEMPLATE_ARGS),
|
||||
self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
|
||||
|
||||
wrapper.before_call.unindent()
|
||||
wrapper.before_call.write_code("}") # closes: if (py_callback) {
|
||||
|
||||
wrapper.call_params.append(value)
|
||||
|
||||
|
||||
def convert_c_to_python(self, wrapper):
|
||||
raise typehandlers.NotSupportedError("Reverse wrappers for ns3::Callback<...> types "
|
||||
"(python using callbacks defined in C++) not implemented.")
|
||||
|
||||
|
||||
# def write_preamble(out):
|
||||
@@ -374,7 +395,7 @@ def add_std_ofstream(module):
|
||||
ofstream.add_constructor([Parameter.new("const char *", 'filename'),
|
||||
Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")])
|
||||
ofstream.add_method('close', None, [])
|
||||
|
||||
|
||||
add_std_ios_openmode(module)
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from waflib.Errors import WafError
|
||||
# after = TaskGen.after
|
||||
|
||||
## https://launchpad.net/pybindgen/
|
||||
REQUIRED_PYBINDGEN_VERSION = (0, 17, 0, 868)
|
||||
REQUIRED_PYBINDGEN_VERSION = (0, 17, 0, 886)
|
||||
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
|
||||
|
||||
RUN_ME=-3
|
||||
@@ -255,6 +255,8 @@ int main ()
|
||||
"import pygccxml; print pygccxml.__version__"],
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
pygccxml_version_str = out.strip()
|
||||
# Bug 2013: pygccxml versions > 1.0.0 prepend a 'v' to version number
|
||||
pygccxml_version_str = pygccxml_version_str.lstrip('v')
|
||||
pygccxml_version = tuple([int(x) for x in pygccxml_version_str.split('.')])
|
||||
conf.msg('Checking for pygccxml version', pygccxml_version_str)
|
||||
if not (pygccxml_version >= REQUIRED_PYGCCXML_VERSION):
|
||||
@@ -265,7 +267,7 @@ int main ()
|
||||
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
|
||||
"pygccxml too old")
|
||||
return
|
||||
|
||||
|
||||
|
||||
## Check gccxml version
|
||||
try:
|
||||
@@ -409,7 +411,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")
|
||||
|
||||
+15
-22
@@ -344,22 +344,6 @@ INLINE_SIMPLE_STRUCTS = NO
|
||||
|
||||
TYPEDEF_HIDES_STRUCT = YES
|
||||
|
||||
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
|
||||
# determine which symbols to keep in memory and which to flush to disk.
|
||||
# When the cache is full, less often used symbols will be written to disk.
|
||||
# For small to medium size projects (<1000 input files) the default value is
|
||||
# probably good enough. For larger projects a too small cache size can cause
|
||||
# doxygen to be busy swapping symbols to and from disk most of the time
|
||||
# causing a significant performance penalty.
|
||||
# If the system has enough physical memory increasing the cache will improve the
|
||||
# performance by keeping more symbols in memory. Note that the value works on
|
||||
# a logarithmic scale so increasing the size by one will roughly double the
|
||||
# memory usage. The cache size is given by this formula:
|
||||
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols.
|
||||
|
||||
SYMBOL_CACHE_SIZE = 1
|
||||
|
||||
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
|
||||
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
|
||||
# their name and scope. Since this can be an expensive process and often the
|
||||
@@ -746,7 +730,7 @@ EXCLUDE_PATTERNS = */.hg/* \
|
||||
# wildcard * is used, a substring. Examples: ANamespace, AClass,
|
||||
# AClass::ANamespace, ANamespace::*Test
|
||||
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXCLUDE_SYMBOLS = main
|
||||
|
||||
# The EXAMPLE_PATH tag can be used to specify one or more files or
|
||||
# directories that contain example code fragments that are included (see
|
||||
@@ -763,7 +747,6 @@ EXAMPLE_PATH = src/aodv/examples \
|
||||
src/csma-layout/examples \
|
||||
src/dsdv/examples \
|
||||
src/dsr/examples \
|
||||
src/emu/examples \
|
||||
src/energy/examples \
|
||||
src/fd-net-device/examples \
|
||||
src/flow-monitor/examples \
|
||||
@@ -1675,7 +1658,8 @@ PREDEFINED = \
|
||||
NS3_LOG_ENABLE \
|
||||
NS_LOG_COMPONENT_DEFINE()=1 \
|
||||
NS_LOG_COMPONENT_DEFINE_MASK()=1 \
|
||||
NS_OBJECT_ENSURE_REGISTERED()=1 \
|
||||
NS_OBJECT_ENSURE_REGISTERED()=1 \
|
||||
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
||||
@@ -1683,9 +1667,18 @@ PREDEFINED = \
|
||||
# Use the PREDEFINED tag if you want to use a different macro definition that
|
||||
# overrules the definition found in the source code.
|
||||
|
||||
EXPAND_AS_DEFINED = ATTRIBUTE_VALUE_DEFINE \
|
||||
EXPAND_AS_DEFINED = ATTRIBUTE_ACCESSOR_DEFINE \
|
||||
ATTRIBUTE_CHECKER_DEFINE \
|
||||
ATTRIBUTE_CHECKER_IMPLEMENT \
|
||||
ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME \
|
||||
ATTRIBUTE_CONVERTER_DEFINE \
|
||||
ATTRIBUTE_HELPER_CPP \
|
||||
ATTRIBUTE_HELPER_HEADER \
|
||||
ATTRIBUTE_VALUE_DEFINE \
|
||||
ATTRIBUTE_VALUE_DEFINE_WITH_NAME \
|
||||
ATTRIBUTE_HELPER_HEADER_2
|
||||
ATTRIBUTE_VALUE_IMPLEMENT \
|
||||
ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME \
|
||||
|
||||
|
||||
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
||||
# doxygen's preprocessor will remove all references to function-like macros
|
||||
@@ -1784,7 +1777,7 @@ DOT_NUM_THREADS = 0
|
||||
# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
|
||||
# directory containing the font.
|
||||
|
||||
DOT_FONTNAME = FreeSans
|
||||
DOT_FONTNAME = Helvetica
|
||||
|
||||
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
|
||||
# The default size is 10pt.
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
me=$(basename $0)
|
||||
DIR="$(dirname $0)"
|
||||
ROOT="$(hg root)"
|
||||
# Trick to get the absolute physical path, since doxygen prefixes errors that way
|
||||
ROOT=$(cd "$DIR/.."; pwd -P)
|
||||
|
||||
# Known log files
|
||||
STANDARDLOGFILE=doxygen.log
|
||||
@@ -13,6 +14,9 @@ WARNINGSLOGFILE=doxygen.warnings.log
|
||||
# Default choice: generate it
|
||||
LOG="$DIR/$WARNINGSLOGFILE"
|
||||
|
||||
# Verbose log
|
||||
VERBLOG="$DIR/doxygen.verbose.log"
|
||||
|
||||
|
||||
# Options ------------------------------
|
||||
#
|
||||
@@ -21,7 +25,7 @@ function usage
|
||||
{
|
||||
cat <<-EOF
|
||||
|
||||
Usage: $me [-eth] [-f <log-file> | -l | -s] [-m <module> | -F <regex>]
|
||||
Usage: $me [-ethv] [-f <log-file> | -l | -s] [-m <module> | -F <regex>]
|
||||
|
||||
Run doxygen to generate all errors; report error counts
|
||||
by module and file.
|
||||
@@ -50,12 +54,50 @@ function usage
|
||||
-s Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
|
||||
-l Skip doxygen run; use the normal doxygen log doc/$STANDARDLOGFILE
|
||||
|
||||
-v Show the doxygen run output
|
||||
-h Print this usage message
|
||||
|
||||
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 ------------------
|
||||
#
|
||||
|
||||
@@ -73,7 +115,10 @@ filter_test=0
|
||||
filter_module=""
|
||||
filter_regex=""
|
||||
|
||||
while getopts :etm:F:lF:sh option ; do
|
||||
echo
|
||||
echo "$me:"
|
||||
|
||||
while getopts :etm:F:lF:svh option ; do
|
||||
|
||||
case $option in
|
||||
|
||||
@@ -95,9 +140,16 @@ while getopts :etm:F:lF:sh option ; do
|
||||
logfilearg="$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
|
||||
|
||||
@@ -128,7 +180,9 @@ if [ $SKIPDOXY -eq 1 ]; then
|
||||
else
|
||||
|
||||
# Run introspection, which may require a build
|
||||
(cd "$ROOT" && ./waf --run print-introspected-doxygen >doc/introspected-doxygen.h)
|
||||
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"
|
||||
|
||||
# Modify doxygen.conf to generate all the warnings
|
||||
# (We also suppress dot graphs, so shorten the run time.)
|
||||
@@ -137,20 +191,14 @@ else
|
||||
|
||||
sed -i.bak -E '/^EXTRACT_ALL |^HAVE_DOT |^WARNINGS /s/YES/no/' $conf
|
||||
|
||||
echo
|
||||
echo -n "Rebuilding doxygen docs with full errors..."
|
||||
(cd "$ROOT" && ./waf --doxygen >/dev/null 2>&1)
|
||||
verbose -n "Rebuilding doxygen (v$(doxygen --version)) docs with full errors..."
|
||||
(cd "$ROOT" && ./waf --doxygen >&6 2>&6 )
|
||||
status=$?
|
||||
|
||||
rm -f $conf
|
||||
mv -f $conf.bak $conf
|
||||
|
||||
if [ $status -eq 0 ]; then
|
||||
echo "Done."
|
||||
else
|
||||
echo "FAILED."
|
||||
exit 1
|
||||
fi
|
||||
status_report $status "Doxygen run"
|
||||
|
||||
cp -f "$DIR/$STANDARDLOGFILE" "$DIR/$WARNINGSLOGFILE"
|
||||
|
||||
@@ -162,7 +210,7 @@ fi
|
||||
# Filter regular expression for -m and -F
|
||||
filter_inRE=""
|
||||
if [ "$filter_module" != "" ] ; then
|
||||
filter_inRE="src/$filter_module"
|
||||
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}src/$filter_module"
|
||||
fi
|
||||
if [ "$filter_regex" != "" ] ; then
|
||||
filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_regex"
|
||||
@@ -171,7 +219,7 @@ fi
|
||||
# Filter regular expression for -e and -t
|
||||
filter_outRE=""
|
||||
if [ $filter_examples -eq 1 ]; then
|
||||
filter_outRE="/examples/"
|
||||
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/examples/"
|
||||
fi
|
||||
if [ $filter_test -eq 1 ]; then
|
||||
filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/test/"
|
||||
@@ -199,9 +247,14 @@ function filter_log
|
||||
flog=$( echo "$flog" | grep -v "$filter_outRE" )
|
||||
fi
|
||||
|
||||
flog=$( \
|
||||
echo "$flog" | \
|
||||
sort -t ':' -k1,1 -k2,2n | \
|
||||
uniq \
|
||||
)
|
||||
|
||||
echo "$flog"
|
||||
}
|
||||
|
||||
|
||||
# Analyze the log ----------------------
|
||||
#
|
||||
@@ -266,9 +319,9 @@ filecount=$( \
|
||||
# Filtered in warnings
|
||||
filterin=
|
||||
if [ "${filter_inRE:-}" != "" ] ; then
|
||||
filterin=$( \
|
||||
filter_log | \
|
||||
sed "s|$ROOT/||g" \
|
||||
filterin=$( \
|
||||
filter_log | \
|
||||
sed "s|$ROOT/||g" \
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
+1
-2
@@ -13,8 +13,7 @@
|
||||
*
|
||||
* \section install-sec Building the Documentation
|
||||
*
|
||||
* ns-3 requires Doxygen version 1.5.4 or greater to fully build all items,
|
||||
* although earlier versions of Doxygen will mostly work.
|
||||
* ns-3 requires Doxygen version 1.8.3.1 or greater.
|
||||
*
|
||||
* Type "./waf --doxygen" or "./waf --doxygen-no-build" to build the
|
||||
* documentation. The doc/ directory contains
|
||||
|
||||
+16
-7
@@ -90,13 +90,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
|
||||
|
||||
RESCALE = ../../utils/rescale-pdf.sh
|
||||
|
||||
%.eps : %.dia; $(DIA) -t eps $< -e $@
|
||||
%.png : %.dia; $(DIA) -t png $< -e $@
|
||||
%.png : %.eps; $(CONVERT) $< $@
|
||||
%.pdf : %.eps;
|
||||
$(EPSTOPDF) $< -o=$@
|
||||
if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
%.eps : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t eps $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t png $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.eps
|
||||
@echo convert $(notdir $<)
|
||||
@$(CONVERT) $< $@ >/dev/null
|
||||
|
||||
%.pdf : %.eps
|
||||
@echo epstopdf $(notdir $<)
|
||||
@$(EPSTOPDF) $< -o=$@ >/dev/null
|
||||
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
@@ -135,7 +144,7 @@ help:
|
||||
copy-sources: $(SOURCES)
|
||||
@rm -rf $(SOURCETEMP)
|
||||
@mkdir -p $(SOURCETEMP)
|
||||
@mkdir -p $(FIGURES)
|
||||
@mkdir -p $(FIGURES)
|
||||
@cp -r $(SOURCES) $(SOURCETEMP)
|
||||
@cp -r $(SOURCEFIGS) $(FIGURES)
|
||||
|
||||
|
||||
+468
-276
File diff suppressed because it is too large
Load Diff
@@ -476,7 +476,7 @@ urgent in a single module:
|
||||
src/mesh/helper/dot11s/dot11s-installer.h:72: warning: Member m_root (variable) of class ns3::Dot11sStack is not documented.
|
||||
src/mesh/helper/dot11s/dot11s-installer.h:35: warning: return type of member ns3::Dot11sStack::GetTypeId is not documented
|
||||
src/mesh/helper/dot11s/dot11s-installer.h:56: warning: return type of member ns3::Dot11sStack::InstallStack is not documented
|
||||
src/mesh/helper/flame/flame-installer.h:40: warning: Member GetTypeId() (function) of class ns3::FlameStack is not documented.
|
||||
src/mesh/helper/flame/lfame-installer.h:40: warning: Member GetTypeId() (function) of class ns3::FlameStack is not documented.
|
||||
src/mesh/helper/flame/flame-installer.h:60: warning: return type of member ns3::FlameStack::InstallStack is not documented
|
||||
src/mesh/helper/mesh-helper.h:213: warning: Member m_nInterfaces (variable) of class ns3::MeshHelper is not documented.
|
||||
src/mesh/helper/mesh-helper.h:214: warning: Member m_spreadChannelPolicy (variable) of class ns3::MeshHelper is not documented.
|
||||
@@ -519,6 +519,16 @@ usage for |ns3|.
|
||||
*/
|
||||
class Foo
|
||||
|
||||
* 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.
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ available in five forms:
|
||||
* Tutorial, Manual *(this document)*, and Model Library for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
|
||||
* `ns-3 wiki <http://www.nsnam.org/wiki/Main_Page>`_
|
||||
|
||||
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
|
||||
``doc/manual`` directory of ns-3's source code.
|
||||
Contents
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
@@ -34,3 +34,10 @@ This document is written in `reStructuredText <http://docutils.sourceforge.net/r
|
||||
python
|
||||
tests
|
||||
support
|
||||
|
||||
Source
|
||||
------
|
||||
|
||||
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
|
||||
``doc/manual`` directory of ns-3's source code.
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ How to add logging to your code
|
||||
Adding logging to your code is very simple:
|
||||
|
||||
1. Invoke the ``NS_LOG_COMPONENT_DEFINE (...);`` macro
|
||||
outside of ``namespace ns3``.
|
||||
inside of ``namespace ns3``.
|
||||
|
||||
Create a unique string identifier (usually based on the name of the file
|
||||
and/or class defined within the file) and register it with a macro call
|
||||
@@ -328,9 +328,9 @@ Adding logging to your code is very simple:
|
||||
|
||||
::
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Ipv4L3Protocol");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Ipv4L3Protocol");
|
||||
...
|
||||
|
||||
This registers ``Ipv4L3Protocol`` as a log component.
|
||||
|
||||
+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
|
||||
|
||||
@@ -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
|
||||
************************************
|
||||
|
||||
|
||||
+63
-12
@@ -34,7 +34,6 @@ SOURCES = \
|
||||
$(SRC)/csma/doc/csma.rst \
|
||||
$(SRC)/dsdv/doc/dsdv.rst \
|
||||
$(SRC)/dsr/doc/dsr.rst \
|
||||
$(SRC)/emu/doc/emu.rst \
|
||||
$(SRC)/mpi/doc/distributed.rst \
|
||||
$(SRC)/energy/doc/energy.rst \
|
||||
$(SRC)/fd-net-device/doc/fd-net-device.rst \
|
||||
@@ -58,6 +57,7 @@ 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 \
|
||||
@@ -75,7 +75,6 @@ SOURCES = \
|
||||
$(SRC)/stats/doc/data-collection.rst \
|
||||
$(SRC)/stats/doc/probe.rst \
|
||||
$(SRC)/stats/doc/scope-and-limitations.rst \
|
||||
$(SRC)/stats/doc/statistics.rst \
|
||||
$(SRC)/netanim/doc/animation.rst \
|
||||
$(SRC)/flow-monitor/doc/flow-monitor.rst \
|
||||
$(SRC)/wave/doc/wave.rst \
|
||||
@@ -143,12 +142,12 @@ SOURCEFIGS = \
|
||||
$(SRC)/lte/doc/source/figures/epcSimulationTime.eps \
|
||||
$(SRC)/lte/doc/source/figures/epcEutranRunningTime.eps \
|
||||
$(SRC)/lte/doc/source/figures/profiling-memory.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-x2-entity-saps.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-epc-x2-entity-saps.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-strongest-cell-handover-algorithm.eps \
|
||||
$(SRC)/lte/doc/source/figures/lte-phy-interference.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-phy-interference.png \
|
||||
@@ -176,6 +175,24 @@ SOURCEFIGS = \
|
||||
$(SRC)/lte/doc/source/figures/fading_vehicular.png \
|
||||
$(SRC)/lte/doc/source/figures/fading_urban_3kmph.pdf \
|
||||
$(SRC)/lte/doc/source/figures/fading_urban_3kmph.png \
|
||||
$(SRC)/lte/doc/source/figures/fr-enhanced-fractional-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-full-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-hard-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-soft-fractional-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v1.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-soft-frequency-reuse-scheme-v2.dia \
|
||||
$(SRC)/lte/doc/source/figures/fr-strict-frequency-reuse-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/ffr-distributed-scheme.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-soft-1-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-ffr-soft-2-spectrum-trace.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-1-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-2-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-fr-hard-3-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/MCS_1_4.pdf \
|
||||
$(SRC)/lte/doc/source/figures/MCS_1_4.png \
|
||||
$(SRC)/lte/doc/source/figures/MCS_5_8.pdf \
|
||||
@@ -200,6 +217,8 @@ SOURCEFIGS = \
|
||||
$(SRC)/lte/doc/source/figures/MCS_16_test.pdf \
|
||||
$(SRC)/lte/doc/source/figures/miesm_scheme.pdf \
|
||||
$(SRC)/lte/doc/source/figures/miesm_scheme.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-dl-power-control.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-ffr-scheduling.dia \
|
||||
$(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.pdf \
|
||||
$(SRC)/lte/doc/source/figures/lte-handover-campaign-rem.png \
|
||||
$(SRC)/lte/doc/source/figures/lte-legacy-handover-algorithm.pdf \
|
||||
@@ -266,6 +285,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 \
|
||||
@@ -334,6 +363,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
|
||||
@@ -341,7 +380,9 @@ $(FIGURES)/lte-arch-ue-ctrl.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-implementation-model.pdf_width = 20in
|
||||
$(FIGURES)/lte-rlc-data-txon-dl.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-data-txon-ul.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-data-retx-dl.pdf_width = 10cm
|
||||
$(FIGURES)/lte-rlc-data-retx-ul.pdf_width = 10cm
|
||||
$(FIGURES)/lte-epc-x2-entity-saps.pdf_width = 12cm
|
||||
$(FIGURES)/lte-phy-interference.pdf_width = 12cm
|
||||
$(FIGURES)/lte-subframe-structure.pdf_width = 2in
|
||||
$(FIGURES)/mac-random-access-contention.pdf_width = 10cm
|
||||
@@ -359,11 +400,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.
|
||||
|
||||
@@ -18,8 +18,7 @@ any combination of simulated or emulated devices.
|
||||
|
||||
**Note:** Prior to ns-3.17, the emulation capability was provided by a
|
||||
special device called an ``Emu`` NetDevice; the ``Emu`` NetDevice has
|
||||
been superseded by the ``FdNetDevice``, and will be deprecated and removed
|
||||
in future revisions of |ns3|.
|
||||
been replaced by the ``FdNetDevice``.
|
||||
|
||||
One of the use-cases we want to support is that of a testbed. A concrete example
|
||||
of an environment of this kind is the ORBIT testbed. ORBIT is a laboratory
|
||||
@@ -83,6 +82,5 @@ simulated |ns3| networks.
|
||||
|
||||
.. toctree::
|
||||
|
||||
emu
|
||||
fd-net-device
|
||||
tap
|
||||
|
||||
@@ -8,3 +8,4 @@ Internet Models
|
||||
ipv6
|
||||
routing-overview
|
||||
tcp
|
||||
codel
|
||||
|
||||
@@ -27,9 +27,22 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
%.eps : %.dia; $(DIA) -t eps $< -e $@
|
||||
%.png : %.dia; $(DIA) -t png $< -e $@
|
||||
%.pdf : %.eps; $(EPSTOPDF) $< -o=$@
|
||||
%.eps : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t eps $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.dia
|
||||
@echo dia $(notdir $<)
|
||||
@$(DIA) -t png $< -e $@ >/dev/null
|
||||
|
||||
%.png : %.eps
|
||||
@echo convert $(notdir $<)
|
||||
@$(CONVERT) $< $@ >/dev/null
|
||||
|
||||
%.pdf : %.eps
|
||||
@echo epstopdf $(notdir $<)
|
||||
@$(EPSTOPDF) $< -o=$@ >/dev/null
|
||||
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
|
||||
+16
-3
@@ -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
|
||||
-------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -528,7 +530,7 @@ and see that the echoed packet arrives back at the source at 2.007602 seconds,
|
||||
|
||||
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
|
||||
******************************
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -359,6 +361,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 +421,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");
|
||||
+
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -90,7 +90,7 @@ get a copy of a release by typing the following into your Linux shell
|
||||
$ cd
|
||||
$ mkdir workspace
|
||||
$ cd workspace
|
||||
$ wget http://www.nsnam.org/releases/ns-allinone-3.20.tar.bz2
|
||||
$ wget http://www.nsnam.org/release/ns-allinone-3.20.tar.bz2
|
||||
$ tar xjf ns-allinone-3.20.tar.bz2
|
||||
|
||||
If you change into the directory ``ns-allinone-3.20`` you should see a
|
||||
@@ -182,15 +182,20 @@ bake works by downloading source packages into a source directory,
|
||||
and installing libraries into a build directory. bake can be run
|
||||
by referencing the binary, but if one chooses to run bake from
|
||||
outside of the directory it was downloaded into, it is advisable
|
||||
to put bake into your path, such as follows (Linux bash shell example)::
|
||||
to put bake into your path, such as follows (Linux bash shell example).
|
||||
First, change into the 'bake' directory, and then set the following
|
||||
environment variables
|
||||
|
||||
$ export BAKE_HOME=`pwd`/bake
|
||||
$ export PATH=$PATH:$BAKE_HOME
|
||||
$ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
|
||||
::
|
||||
|
||||
However, setting environment variables is not strictly necessary to
|
||||
complete this tutorial, so we'll call bake directly by specifying the path
|
||||
to it in our shell commands.
|
||||
$ export BAKE_HOME=`pwd`
|
||||
$ export PATH=$PATH:$BAKE_HOME:$BAKE_HOME/build/bin
|
||||
$ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME:$BAKE_HOME/build/lib
|
||||
|
||||
This will put the bake.py program into the shell's path, and will allow
|
||||
other programs to find executables and libraries created by bake. Although
|
||||
several bake use cases do not require setting PATH and PYTHONPATH as above,
|
||||
full builds of ns-3-allinone (with the optional packages) typically do.
|
||||
|
||||
Step into the workspace directory and type the following into your shell::
|
||||
|
||||
@@ -478,6 +483,29 @@ the |ns3| programs by simply typing
|
||||
Okay, sorry, I made you build the |ns3| part of the system twice,
|
||||
but now you know how to change the configuration and build optimized code.
|
||||
|
||||
The build.py script discussed above supports also the ``--enable-examples``
|
||||
and ``enable-tests`` arguments, but in general, does not directly support
|
||||
other waf options; for example, this will not work:
|
||||
|
||||
::
|
||||
|
||||
$ ./build.py --disable-python
|
||||
|
||||
will result in
|
||||
|
||||
::
|
||||
|
||||
build.py: error: no such option: --disable-python
|
||||
|
||||
However, the special operator ``--`` can be used to pass additional
|
||||
options through to waf, so instead of the above, the following will work:
|
||||
|
||||
::
|
||||
|
||||
$ ./build.py -- --disable-python
|
||||
|
||||
as it generates the underlying command ``./waf configure --disable-python``.
|
||||
|
||||
Here are a few more introductory tips about Waf.
|
||||
|
||||
Configure vs. Build
|
||||
@@ -573,6 +601,46 @@ More info on ``distcc`` and distributed compilation can be found on it's
|
||||
<http://code.google.com/p/distcc/>`_
|
||||
under Documentation section.
|
||||
|
||||
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
|
||||
=======
|
||||
|
||||
@@ -725,17 +793,19 @@ using the provided command line template,
|
||||
inserting the program name for the ``%s`` placeholder.
|
||||
(I admit this is a bit awkward, but that's the way it is. Patches welcome!)
|
||||
|
||||
Another particularly useful example is to run the ``mytest`` test suite
|
||||
by itself. Above, we used the ``./test.py`` script to run a whole slew of
|
||||
Another particularly useful example is to run a test suite by itself.
|
||||
Let's assume that a ``mytest`` test suite exists (it doesn't).
|
||||
Above, we used the ``./test.py`` script to run a whole slew of
|
||||
tests in parallel, by repeatedly invoking the real testing program,
|
||||
``test-runner``. To invoke ``test-runner`` directly for a single test::
|
||||
|
||||
$ ./waf --run test-runner --command-template="% --suite=mytest --verbose"
|
||||
$ ./waf --run test-runner --command-template="%s --suite=mytest --verbose"
|
||||
|
||||
This passes the arguments to the ``test-runner`` program. To print the
|
||||
available ``test-runner`` options::
|
||||
This passes the arguments to the ``test-runner`` program.
|
||||
Since ``mytest`` does not exist, an error message will be generated.
|
||||
To print the available ``test-runner`` options::
|
||||
|
||||
$ ./waf --run test-runner --command-template="% --help"
|
||||
$ ./waf --run test-runner --command-template="%s --help"
|
||||
|
||||
Debugging
|
||||
+++++++++
|
||||
@@ -744,7 +814,7 @@ To run |ns3| programs under the control of another utility, such as
|
||||
a debugger (*e.g.* ``gdb``) or memory checker (*e.g.* ``valgrind``),
|
||||
you use a similar ``--command-template="..."`` form.
|
||||
|
||||
For example, to run your |ns3| program ``mysim`` with the arguments
|
||||
For example, to run your |ns3| program ``hello-simulator`` with the arguments
|
||||
``<args>`` under the ``gdb`` debugger::
|
||||
|
||||
$ ./waf --run=hello-simulator --command-template="gdb %s --args <args>"
|
||||
|
||||
+1961
-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
|
||||
@@ -722,6 +726,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;
|
||||
}
|
||||
@@ -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'
|
||||
@@ -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");
|
||||
|
||||
@@ -115,10 +115,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[])
|
||||
{
|
||||
|
||||
@@ -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,15 +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'])
|
||||
obj = bld.create_ns3_program('wsn-ping6', ['lr-wpan', 'internet', 'sixlowpan', 'mobility', 'applications'])
|
||||
obj.source = 'wsn-ping6.cc'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet'])
|
||||
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'])
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('dynamic-global-routing',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'dynamic-global-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program('static-routing-slash32',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'static-routing-slash32.cc'
|
||||
|
||||
obj = bld.create_ns3_program('global-routing-slash32',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'global-routing-slash32.cc'
|
||||
|
||||
obj = bld.create_ns3_program('global-injection-slash32',
|
||||
['point-to-point', 'csma', 'internet'])
|
||||
['point-to-point', 'csma', 'internet', 'applications'])
|
||||
obj.source = 'global-injection-slash32.cc'
|
||||
|
||||
obj = bld.create_ns3_program('simple-global-routing',
|
||||
@@ -25,12 +25,12 @@ def build(bld):
|
||||
['point-to-point', 'internet', 'applications'])
|
||||
obj.source = 'simple-alternate-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program( 'mixed-global-routing',
|
||||
['point-to-point', 'internet', 'csma'])
|
||||
obj = bld.create_ns3_program('mixed-global-routing',
|
||||
['point-to-point', 'internet', 'csma', 'applications'])
|
||||
obj.source = 'mixed-global-routing.cc'
|
||||
|
||||
obj = bld.create_ns3_program('simple-routing-ping6',
|
||||
['csma', 'internet'])
|
||||
['csma', 'internet', 'applications'])
|
||||
obj.source = 'simple-routing-ping6.cc'
|
||||
|
||||
obj = bld.create_ns3_program('manet-routing-compare',
|
||||
|
||||
@@ -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'])
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,63 @@ 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;
|
||||
Ptr<OutputStreamWrapper> cWndStream;
|
||||
Ptr<OutputStreamWrapper> ssThreshStream;
|
||||
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
|
||||
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));
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
@@ -162,25 +133,25 @@ 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 ("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 +159,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 +175,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 +208,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 +239,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 +258,29 @@ int main (int argc, char *argv[])
|
||||
Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
|
||||
PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
|
||||
|
||||
for(uint16_t i=0; i<sources.GetN(); i++)
|
||||
for (uint16_t i = 0; i < sources.GetN (); i++)
|
||||
{
|
||||
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress(i, 0), port));
|
||||
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port));
|
||||
|
||||
if (transport_prot.compare("TcpTahoe") == 0
|
||||
|| transport_prot.compare("TcpReno") == 0
|
||||
|| transport_prot.compare("TcpNewReno") == 0
|
||||
|| transport_prot.compare("TcpWestwood") == 0
|
||||
|| transport_prot.compare("TcpWestwoodPlus") == 0)
|
||||
if (transport_prot.compare ("TcpTahoe") == 0
|
||||
|| transport_prot.compare ("TcpReno") == 0
|
||||
|| transport_prot.compare ("TcpNewReno") == 0
|
||||
|| transport_prot.compare ("TcpWestwood") == 0
|
||||
|| transport_prot.compare ("TcpWestwoodPlus") == 0)
|
||||
{
|
||||
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size));
|
||||
BulkSendHelper ftp("ns3::TcpSocketFactory", Address());
|
||||
BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ());
|
||||
ftp.SetAttribute ("Remote", remoteAddress);
|
||||
ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size));
|
||||
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes*1000000)));
|
||||
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000)));
|
||||
|
||||
ApplicationContainer sourceApp = ftp.Install (sources.Get(i));
|
||||
sourceApp.Start (Seconds (start_time*i));
|
||||
ApplicationContainer sourceApp = ftp.Install (sources.Get (i));
|
||||
sourceApp.Start (Seconds (start_time * i));
|
||||
sourceApp.Stop (Seconds (stop_time - 3));
|
||||
|
||||
sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ()));
|
||||
ApplicationContainer sinkApp = sinkHelper.Install (sinks);
|
||||
sinkApp.Start (Seconds (start_time*i));
|
||||
sinkApp.Start (Seconds (start_time * i));
|
||||
sinkApp.Stop (Seconds (stop_time));
|
||||
}
|
||||
else
|
||||
@@ -316,41 +293,43 @@ 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);
|
||||
}
|
||||
|
||||
Simulator::Schedule(Seconds(0.00001), &TraceCwnd, cwnd_tr_file_name);
|
||||
Simulator::Schedule(Seconds(0.00001), &TraceSsThresh, ssthresh_tr_file_name);
|
||||
}
|
||||
|
||||
UnReLink.EnablePcapAll("TcpVariantsComparison", true);
|
||||
LocalLink.EnablePcapAll("TcpVariantsComparison", true);
|
||||
UnReLink.EnablePcapAll ("TcpVariantsComparison", true);
|
||||
LocalLink.EnablePcapAll ("TcpVariantsComparison", true);
|
||||
|
||||
// Flow monitor
|
||||
FlowMonitorHelper flowHelper;
|
||||
if (flow_monitor)
|
||||
{
|
||||
flowHelper.InstallAll();
|
||||
flowHelper.InstallAll ();
|
||||
}
|
||||
|
||||
Simulator::Stop (Seconds(stop_time));
|
||||
Simulator::Stop (Seconds (stop_time));
|
||||
Simulator::Run ();
|
||||
|
||||
if (flow_monitor)
|
||||
{
|
||||
flowHelper.SerializeToXmlFile("TcpVariantsComparison.flowmonitor", true, true);
|
||||
flowHelper.SerializeToXmlFile ("TcpVariantsComparison.flowmonitor", true, true);
|
||||
}
|
||||
|
||||
Simulator::Destroy ();
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -33,7 +33,8 @@ public:
|
||||
.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[])
|
||||
{
|
||||
|
||||
@@ -210,8 +210,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 +219,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 +229,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 +265,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 +285,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));
|
||||
|
||||
@@ -12,7 +12,7 @@ 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'])
|
||||
obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications'])
|
||||
obj.source = 'third.cc'
|
||||
|
||||
obj = bld.create_ns3_program('fourth', ['core'])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'udp-client-server.cc'
|
||||
|
||||
obj = bld.create_ns3_program('udp-trace-client-server', ['csma', 'internet', 'applications'])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('udp-echo', ['csma', 'internet'])
|
||||
obj = bld.create_ns3_program('udp-echo', ['csma', 'internet', 'applications'])
|
||||
obj.source = 'udp-echo.cc'
|
||||
|
||||
@@ -205,8 +205,8 @@ int main (int argc, char *argv[])
|
||||
sink1App.Stop (Seconds (t));
|
||||
|
||||
OnOffHelper onoff ("ns3::TcpSocketFactory",Ipv4Address::GetAny ());
|
||||
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable(30)));//in seconds
|
||||
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable(0)));
|
||||
onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=30.0]")); //in seconds
|
||||
onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
|
||||
onoff.SetAttribute ("PacketSize", UintegerValue (1500-30));//1024
|
||||
onoff.SetAttribute ("DataRate", DataRateValue (100000000));//51200
|
||||
ApplicationContainer apps;
|
||||
|
||||
@@ -64,10 +64,10 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("multirate");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("multirate");
|
||||
|
||||
class Experiment
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Authors: Sébastien Deronne <sebastien.deronne@gmail.com>
|
||||
*/
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/yans-error-rate-model.h"
|
||||
#include "ns3/nist-error-rate-model.h"
|
||||
#include "ns3/gnuplot.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
uint32_t FrameSize = 2000;
|
||||
std::ofstream yansfile ("yans-frame-success-rate-n.plt");
|
||||
std::ofstream nistfile ("nist-frame-success-rate-n.plt");
|
||||
std::vector <std::string> modes;
|
||||
|
||||
modes.push_back ("OfdmRate6_5MbpsBW20MHz");
|
||||
modes.push_back ("OfdmRate13MbpsBW20MHz");
|
||||
modes.push_back ("OfdmRate19_5MbpsBW20MHz");
|
||||
modes.push_back ("OfdmRate26MbpsBW20MHz");
|
||||
modes.push_back ("OfdmRate39MbpsBW20MHz");
|
||||
modes.push_back ("OfdmRate52MbpsBW20MHz");
|
||||
modes.push_back ("OfdmRate58_5MbpsBW20MHz");
|
||||
modes.push_back ("OfdmRate65MbpsBW20MHz");
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("FrameSize", "The frame size", FrameSize);
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
Gnuplot yansplot = Gnuplot ("yans-frame-success-rate-n.eps");
|
||||
Gnuplot nistplot = Gnuplot ("nist-frame-success-rate-n.eps");
|
||||
|
||||
Ptr <YansErrorRateModel> yans = CreateObject<YansErrorRateModel> ();
|
||||
Ptr <NistErrorRateModel> nist = CreateObject<NistErrorRateModel> ();
|
||||
|
||||
for (uint32_t i = 0; i < modes.size (); i++)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset yansdataset (modes[i]);
|
||||
Gnuplot2dDataset nistdataset (modes[i]);
|
||||
|
||||
for (double snr = -5.0; snr <= 30.0; snr += 0.1)
|
||||
{
|
||||
double ps = yans->GetChunkSuccessRate (WifiMode (modes[i]), std::pow (10.0,snr / 10.0), FrameSize * 8);
|
||||
yansdataset.Add (snr, ps);
|
||||
ps = nist->GetChunkSuccessRate (WifiMode (modes[i]), std::pow (10.0,snr / 10.0), FrameSize * 8);
|
||||
nistdataset.Add (snr, ps);
|
||||
}
|
||||
|
||||
yansplot.AddDataset (yansdataset);
|
||||
nistplot.AddDataset (nistdataset);
|
||||
}
|
||||
|
||||
yansplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\"");
|
||||
yansplot.SetLegend ("SNR(dB)", "Frame Success Rate");
|
||||
yansplot.SetExtra ("set xrange [-5:30]\n\
|
||||
set yrange [0:1.2]\n\
|
||||
set style line 1 linewidth 5\n\
|
||||
set style line 2 linewidth 5\n\
|
||||
set style line 3 linewidth 5\n\
|
||||
set style line 4 linewidth 5\n\
|
||||
set style line 5 linewidth 5\n\
|
||||
set style line 6 linewidth 5\n\
|
||||
set style line 7 linewidth 5\n\
|
||||
set style line 8 linewidth 5\n\
|
||||
set style increment user" );
|
||||
yansplot.GenerateOutput (yansfile);
|
||||
yansfile.close ();
|
||||
|
||||
nistplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\"");
|
||||
nistplot.SetLegend ("SNR(dB)", "Frame Success Rate");
|
||||
nistplot.SetExtra ("set xrange [-5:30]\n\
|
||||
set yrange [0:1.2]\n\
|
||||
set style line 1 linewidth 5\n\
|
||||
set style line 2 linewidth 5\n\
|
||||
set style line 3 linewidth 5\n\
|
||||
set style line 4 linewidth 5\n\
|
||||
set style line 5 linewidth 5\n\
|
||||
set style line 6 linewidth 5\n\
|
||||
set style line 7 linewidth 5\n\
|
||||
set style line 8 linewidth 5\n\
|
||||
set style increment user" );
|
||||
|
||||
nistplot.GenerateOutput (nistfile);
|
||||
nistfile.close ();
|
||||
}
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Main");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Main");
|
||||
|
||||
class Experiment
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Main");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Main");
|
||||
|
||||
class Experiment
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -149,7 +149,7 @@ void experiment (bool enableCtsRts)
|
||||
// 10. Print per flow statistics
|
||||
monitor->CheckForLostPackets ();
|
||||
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
|
||||
std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
|
||||
FlowMonitor::FlowStatsContainer stats = monitor->GetFlowStats ();
|
||||
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin (); i != stats.end (); ++i)
|
||||
{
|
||||
// first 2 FlowIds are for ECHO apps, we don't want to display them
|
||||
|
||||
@@ -84,13 +84,16 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhocGrid");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhocGrid");
|
||||
|
||||
void ReceivePacket (Ptr<Socket> socket)
|
||||
{
|
||||
NS_LOG_UNCOND ("Received one packet!");
|
||||
while (socket->Recv ())
|
||||
{
|
||||
NS_LOG_UNCOND ("Received one packet!");
|
||||
}
|
||||
}
|
||||
|
||||
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
|
||||
@@ -224,6 +227,8 @@ int main (int argc, char *argv[])
|
||||
// Trace routing tables
|
||||
Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper> ("wifi-simple-adhoc-grid.routes", std::ios::out);
|
||||
olsr.PrintRoutingTableAllEvery (Seconds (2), routingStream);
|
||||
Ptr<OutputStreamWrapper> neighborStream = Create<OutputStreamWrapper> ("wifi-simple-adhoc-grid.neighbors", std::ios::out);
|
||||
olsr.PrintNeighborCacheAllEvery (Seconds (2), neighborStream);
|
||||
|
||||
// To do-- enable an IP-level trace that shows forwarding events only
|
||||
}
|
||||
@@ -235,7 +240,7 @@ int main (int argc, char *argv[])
|
||||
// Output what we are doing
|
||||
NS_LOG_UNCOND ("Testing from node " << sourceNode << " to " << sinkNode << " with grid distance " << distance);
|
||||
|
||||
Simulator::Stop (Seconds (32.0));
|
||||
Simulator::Stop (Seconds (33.0));
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
|
||||
|
||||
@@ -63,13 +63,16 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhoc");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleAdhoc");
|
||||
|
||||
void ReceivePacket (Ptr<Socket> socket)
|
||||
{
|
||||
NS_LOG_UNCOND ("Received one packet!");
|
||||
while (socket->Recv ())
|
||||
{
|
||||
NS_LOG_UNCOND ("Received one packet!");
|
||||
}
|
||||
}
|
||||
|
||||
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
|
||||
|
||||
@@ -64,13 +64,16 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInfra");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInfra");
|
||||
|
||||
void ReceivePacket (Ptr<Socket> socket)
|
||||
{
|
||||
NS_LOG_UNCOND ("Received one packet!");
|
||||
while (socket->Recv ())
|
||||
{
|
||||
NS_LOG_UNCOND ("Received one packet!");
|
||||
}
|
||||
}
|
||||
|
||||
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
|
||||
|
||||
@@ -92,18 +92,23 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInterference");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSimpleInterference");
|
||||
|
||||
static inline std::string PrintReceivedPacket (Ptr<Socket> socket)
|
||||
{
|
||||
Address addr;
|
||||
socket->GetSockName (addr);
|
||||
InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ();
|
||||
|
||||
while (socket->Recv ())
|
||||
{
|
||||
socket->GetSockName (addr);
|
||||
InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
|
||||
|
||||
oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ();
|
||||
}
|
||||
|
||||
return oss.str ();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2009 The Boeing Company
|
||||
* 2014 Universita' degli Studi di Napoli "Federico II"
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// This script configures two nodes on an 802.11b physical layer, with
|
||||
// 802.11b NICs in adhoc mode. One of the nodes generates on-off traffic
|
||||
// destined to the other node.
|
||||
//
|
||||
// The purpose is to test the energy depletion on the nodes and the
|
||||
// activation of the callback that puts a node in the sleep state when
|
||||
// its energy is depleted. Furthermore, this script can be used to test
|
||||
// the available policies for updating the transmit current based on
|
||||
// the nominal tx power used to transmit each frame.
|
||||
//
|
||||
// There are a number of command-line options available to control
|
||||
// the default behavior. The list of available command-line options
|
||||
// can be listed with the following command:
|
||||
// ./waf --run "wifi-sleep --help"
|
||||
//
|
||||
// Note that all ns-3 attributes (not just the ones exposed in the below
|
||||
// script) can be changed at command line; see the documentation.
|
||||
//
|
||||
// This script can also be helpful to put the Wifi layer into verbose
|
||||
// logging mode; this command will turn on all wifi logging:
|
||||
//
|
||||
// ./waf --run "wifi-sleep --verbose=1"
|
||||
//
|
||||
// When you are done, you will notice four trace files in your directory:
|
||||
// two for the remaining energy on each node and two for the state transitions
|
||||
// of each node.
|
||||
//
|
||||
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/network-module.h"
|
||||
#include "ns3/mobility-module.h"
|
||||
#include "ns3/config-store-module.h"
|
||||
#include "ns3/wifi-module.h"
|
||||
#include "ns3/internet-module.h"
|
||||
#include "ns3/applications-module.h"
|
||||
#include "ns3/energy-module.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("WifiSleep");
|
||||
|
||||
template <int node>
|
||||
void RemainingEnergyTrace (double oldValue, double newValue)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "energy_" << node << ".log";
|
||||
|
||||
static std::fstream f (ss.str().c_str(), std::ios::out);
|
||||
|
||||
f << Simulator::Now().GetSeconds() << " remaining energy=" << newValue << std::endl;
|
||||
}
|
||||
|
||||
template <int node>
|
||||
void PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "state_" << node << ".log";
|
||||
|
||||
static std::fstream f (ss.str().c_str(), std::ios::out);
|
||||
|
||||
f << Simulator::Now().GetSeconds() << " state=" << state << " start=" << start << " duration=" << duration << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
std::string dataRate = "1Mbps";
|
||||
uint32_t packetSize = 1000; // bytes
|
||||
double duration = 10.0; // seconds
|
||||
double initialEnergy = 7.5; // joule
|
||||
double voltage = 3.0; // volts
|
||||
double txPowerStart = 0.0; // dbm
|
||||
double txPowerEnd = 15.0; // dbm
|
||||
uint32_t nTxPowerLevels = 16;
|
||||
uint32_t txPowerLevel = 0;
|
||||
double idleCurrent = 0.273; // Ampere
|
||||
double txCurrent = 0.380; // Ampere
|
||||
bool verbose = false;
|
||||
|
||||
|
||||
CommandLine cmd;
|
||||
|
||||
cmd.AddValue ("dataRate", "Data rate", dataRate);
|
||||
cmd.AddValue ("packetSize", "size of application packet sent", packetSize);
|
||||
cmd.AddValue ("duration", "duration (seconds) of the experiment", duration);
|
||||
cmd.AddValue ("initialEnergy", "Initial Energy (Joule) of each node", initialEnergy);
|
||||
cmd.AddValue ("voltage", "Supply voltage (Joule)", voltage);
|
||||
cmd.AddValue ("txPowerStart", "Minimum available transmission level (dbm)", txPowerStart);
|
||||
cmd.AddValue ("txPowerEnd", "Maximum available transmission level (dbm)", txPowerEnd);
|
||||
cmd.AddValue ("nTxPowerLevels", "Number of transmission power levels available between txPowerStart and txPowerEnd included", nTxPowerLevels);
|
||||
cmd.AddValue ("txPowerLevel", "Transmission power level", txPowerLevel);
|
||||
cmd.AddValue ("idleCurrent", "The radio Idle current in Ampere", idleCurrent);
|
||||
cmd.AddValue ("txCurrent", "The radio Tx current in Ampere", txCurrent);
|
||||
cmd.AddValue ("verbose", "turn on all WifiNetDevice log components", verbose);
|
||||
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
|
||||
NodeContainer c;
|
||||
c.Create (2);
|
||||
|
||||
// The below set of helpers will help us to put together the wifi NICs we want
|
||||
WifiHelper wifi;
|
||||
if (verbose)
|
||||
{
|
||||
wifi.EnableLogComponents (); // Turn on all Wifi logging
|
||||
}
|
||||
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
|
||||
|
||||
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
|
||||
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
|
||||
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
|
||||
|
||||
wifiPhy.Set ("TxPowerStart", DoubleValue (txPowerStart));
|
||||
wifiPhy.Set ("TxPowerEnd", DoubleValue (txPowerEnd));
|
||||
wifiPhy.Set ("TxPowerLevels", UintegerValue (nTxPowerLevels));
|
||||
|
||||
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
|
||||
wifiPhy.SetChannel (wifiChannel.Create ());
|
||||
|
||||
// Add a non-QoS upper mac, and set the selected tx power level
|
||||
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
|
||||
wifi.SetRemoteStationManager ("ns3::ArfWifiManager", "DefaultTxPowerLevel", UintegerValue (txPowerLevel));
|
||||
// Set it to adhoc mode
|
||||
wifiMac.SetType ("ns3::AdhocWifiMac");
|
||||
NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c);
|
||||
|
||||
MobilityHelper mobility;
|
||||
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
|
||||
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
|
||||
positionAlloc->Add (Vector (10.0, 0.0, 0.0));
|
||||
mobility.SetPositionAllocator (positionAlloc);
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
mobility.Install (c);
|
||||
|
||||
InternetStackHelper internet;
|
||||
internet.Install (c);
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (devices);
|
||||
|
||||
ApplicationContainer apps;
|
||||
|
||||
std::string transportProto = std::string("ns3::UdpSocketFactory");
|
||||
OnOffHelper onOff(transportProto, InetSocketAddress (Ipv4Address ("10.1.1.2"), 9000));
|
||||
|
||||
onOff.SetAttribute ("DataRate", DataRateValue (DataRate (dataRate)));
|
||||
onOff.SetAttribute ("PacketSize", UintegerValue (packetSize));
|
||||
onOff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.001]"));
|
||||
|
||||
apps = onOff.Install (c.Get (0));
|
||||
|
||||
apps.Start (Seconds (0.01));
|
||||
apps.Stop (Seconds (duration));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
PacketSinkHelper sink (transportProto, InetSocketAddress (Ipv4Address::GetAny (), 9001));
|
||||
apps = sink.Install (c.Get (1));
|
||||
apps.Start (Seconds (0.01));
|
||||
apps.Stop (Seconds (duration));
|
||||
|
||||
// Energy sources
|
||||
EnergySourceContainer eSources;
|
||||
BasicEnergySourceHelper basicSourceHelper;
|
||||
WifiRadioEnergyModelHelper radioEnergyHelper;
|
||||
|
||||
basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (initialEnergy));
|
||||
basicSourceHelper.Set ("BasicEnergySupplyVoltageV", DoubleValue (voltage));
|
||||
|
||||
radioEnergyHelper.Set ("IdleCurrentA", DoubleValue (idleCurrent));
|
||||
radioEnergyHelper.Set ("TxCurrentA", DoubleValue (txCurrent));
|
||||
|
||||
// compute the efficiency of the power amplifier (eta) assuming that the provided value for tx current
|
||||
// corresponds to the minimum tx power level
|
||||
double eta = WifiTxCurrentModel::DbmToW (txPowerStart) / ((txCurrent - idleCurrent) * voltage);
|
||||
|
||||
radioEnergyHelper.SetTxCurrentModel ("ns3::LinearWifiTxCurrentModel",
|
||||
"Voltage", DoubleValue (voltage),
|
||||
"IdleCurrent", DoubleValue (idleCurrent),
|
||||
"Eta", DoubleValue (eta));
|
||||
|
||||
// install an energy source on each node
|
||||
for (NodeContainer::Iterator n = c.Begin(); n != c.End(); n++)
|
||||
{
|
||||
eSources.Add (basicSourceHelper.Install (*n));
|
||||
|
||||
Ptr<WifiNetDevice> wnd;
|
||||
|
||||
for (uint32_t i = 0; i < (*n)->GetNDevices (); ++i)
|
||||
{
|
||||
wnd = (*n)->GetDevice (i)->GetObject<WifiNetDevice> ();
|
||||
// if it is a WifiNetDevice
|
||||
if (wnd != 0)
|
||||
{
|
||||
// this device draws power from the last created energy source
|
||||
radioEnergyHelper.Install (wnd, eSources.Get (eSources.GetN()-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tracing
|
||||
eSources.Get (0)->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback(&RemainingEnergyTrace<0>));
|
||||
eSources.Get (1)->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback(&RemainingEnergyTrace<1>));
|
||||
|
||||
Config::Connect ("/NodeList/0/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace<0>));
|
||||
Config::Connect ("/NodeList/1/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace<1>));
|
||||
|
||||
// wifiPhy.EnablePcap ("wifi-sleep", devices);
|
||||
|
||||
Simulator::Stop (Seconds(duration+1));
|
||||
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -46,8 +46,14 @@ def build(bld):
|
||||
obj = bld.create_ns3_program('ofdm-validation', ['core', 'mobility', 'wifi', 'config-store', 'stats'])
|
||||
obj.source = 'ofdm-validation.cc'
|
||||
|
||||
obj = bld.create_ns3_program('ofdm-ht-validation', ['core', 'mobility', 'wifi', 'config-store', 'stats'])
|
||||
obj.source = 'ofdm-ht-validation.cc'
|
||||
|
||||
obj = bld.create_ns3_program('wifi-hidden-terminal', ['internet', 'mobility', 'wifi', 'applications', 'propagation', 'flow-monitor'])
|
||||
obj.source = 'wifi-hidden-terminal.cc'
|
||||
|
||||
obj = bld.create_ns3_program('ht-wifi-network', ['core','internet', 'mobility', 'wifi', 'applications', 'propagation'])
|
||||
obj.source = 'ht-wifi-network.cc'
|
||||
|
||||
obj = bld.create_ns3_program('wifi-sleep', ['core', 'network', 'internet', 'mobility', 'wifi', 'applications', 'energy', 'config-store'])
|
||||
obj.source = 'wifi-sleep.cc'
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
#include "ns3/core-module.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
#include "ns3/core-module.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
@@ -325,10 +325,10 @@ def register_Ns3ObjectBase_methods(root_module, cls):
|
||||
'void',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & attribute) const [member function]
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & value) const [member function]
|
||||
cls.add_method('GetAttributeFailSafe',
|
||||
'bool',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'attribute')],
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function]
|
||||
cls.add_method('GetInstanceTypeId',
|
||||
@@ -422,7 +422,12 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')])
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')],
|
||||
deprecated=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor, std::string callback) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor'), param('std::string', 'callback')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(uint32_t i) const [member function]
|
||||
cls.add_method('GetAttribute',
|
||||
'ns3::TypeId::AttributeInformation',
|
||||
@@ -473,6 +478,11 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
'uint32_t',
|
||||
[],
|
||||
is_static=True)
|
||||
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetSize() const [member function]
|
||||
cls.add_method('GetSize',
|
||||
'std::size_t',
|
||||
[],
|
||||
is_const=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(uint32_t i) const [member function]
|
||||
cls.add_method('GetTraceSource',
|
||||
'ns3::TypeId::TraceSourceInformation',
|
||||
@@ -549,6 +559,10 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
cls.add_method('SetParent',
|
||||
'ns3::TypeId',
|
||||
[param('ns3::TypeId', 'tid')])
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetSize(std::size_t size) [member function]
|
||||
cls.add_method('SetSize',
|
||||
'ns3::TypeId',
|
||||
[param('std::size_t', 'size')])
|
||||
## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t tid) [member function]
|
||||
cls.add_method('SetUid',
|
||||
'void',
|
||||
@@ -583,6 +597,8 @@ def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable]
|
||||
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::callback [variable]
|
||||
cls.add_instance_attribute('callback', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable]
|
||||
cls.add_instance_attribute('help', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable]
|
||||
|
||||
@@ -325,10 +325,10 @@ def register_Ns3ObjectBase_methods(root_module, cls):
|
||||
'void',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & attribute) const [member function]
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & value) const [member function]
|
||||
cls.add_method('GetAttributeFailSafe',
|
||||
'bool',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'attribute')],
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function]
|
||||
cls.add_method('GetInstanceTypeId',
|
||||
@@ -422,7 +422,12 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')])
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')],
|
||||
deprecated=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor, std::string callback) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor'), param('std::string', 'callback')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(uint32_t i) const [member function]
|
||||
cls.add_method('GetAttribute',
|
||||
'ns3::TypeId::AttributeInformation',
|
||||
@@ -473,6 +478,11 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
'uint32_t',
|
||||
[],
|
||||
is_static=True)
|
||||
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetSize() const [member function]
|
||||
cls.add_method('GetSize',
|
||||
'std::size_t',
|
||||
[],
|
||||
is_const=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(uint32_t i) const [member function]
|
||||
cls.add_method('GetTraceSource',
|
||||
'ns3::TypeId::TraceSourceInformation',
|
||||
@@ -549,6 +559,10 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
cls.add_method('SetParent',
|
||||
'ns3::TypeId',
|
||||
[param('ns3::TypeId', 'tid')])
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetSize(std::size_t size) [member function]
|
||||
cls.add_method('SetSize',
|
||||
'ns3::TypeId',
|
||||
[param('std::size_t', 'size')])
|
||||
## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t tid) [member function]
|
||||
cls.add_method('SetUid',
|
||||
'void',
|
||||
@@ -583,6 +597,8 @@ def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable]
|
||||
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::callback [variable]
|
||||
cls.add_instance_attribute('callback', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable]
|
||||
cls.add_instance_attribute('help', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable]
|
||||
|
||||
@@ -24,10 +24,9 @@
|
||||
#include "angles.h"
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Angles");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Angles");
|
||||
|
||||
double DegreesToRadians (double degrees)
|
||||
{
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#include "antenna-model.h"
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AntennaModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AntennaModel");
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (AntennaModel);
|
||||
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
#include "cosine-antenna-model.h"
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("CosineAntennaModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("CosineAntennaModel");
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (CosineAntennaModel);
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
#include "isotropic-antenna-model.h"
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("IsotropicAntennaModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("IsotropicAntennaModel");
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (IsotropicAntennaModel);
|
||||
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
#include "parabolic-antenna-model.h"
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ParabolicAntennaModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ParabolicAntennaModel");
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (ParabolicAntennaModel);
|
||||
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
#include <sstream>
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TestCosineAntennaModel");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TestCosineAntennaModel");
|
||||
|
||||
enum CosineAntennaModelGainTestCondition {
|
||||
EQUAL = 0,
|
||||
LESSTHAN = 1
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
#include <sstream>
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TestParabolicAntennaModel");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TestParabolicAntennaModel");
|
||||
|
||||
enum ParabolicAntennaModelGainTestCondition {
|
||||
EQUAL = 0,
|
||||
LESSTHAN = 1
|
||||
|
||||
@@ -1553,26 +1553,46 @@ def register_Ns3Ipv4RoutingHelper_methods(root_module, cls):
|
||||
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_pure_virtual=True, is_const=True, is_virtual=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheAllAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheAllEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableAllAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableAllEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
is_static=True)
|
||||
return
|
||||
|
||||
def register_Ns3Ipv6Address_methods(root_module, cls):
|
||||
@@ -1978,10 +1998,10 @@ def register_Ns3ObjectBase_methods(root_module, cls):
|
||||
'void',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & attribute) const [member function]
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & value) const [member function]
|
||||
cls.add_method('GetAttributeFailSafe',
|
||||
'bool',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'attribute')],
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function]
|
||||
cls.add_method('GetInstanceTypeId',
|
||||
@@ -2569,7 +2589,12 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')])
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')],
|
||||
deprecated=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor, std::string callback) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor'), param('std::string', 'callback')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(uint32_t i) const [member function]
|
||||
cls.add_method('GetAttribute',
|
||||
'ns3::TypeId::AttributeInformation',
|
||||
@@ -2620,6 +2645,11 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
'uint32_t',
|
||||
[],
|
||||
is_static=True)
|
||||
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetSize() const [member function]
|
||||
cls.add_method('GetSize',
|
||||
'std::size_t',
|
||||
[],
|
||||
is_const=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(uint32_t i) const [member function]
|
||||
cls.add_method('GetTraceSource',
|
||||
'ns3::TypeId::TraceSourceInformation',
|
||||
@@ -2696,6 +2726,10 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
cls.add_method('SetParent',
|
||||
'ns3::TypeId',
|
||||
[param('ns3::TypeId', 'tid')])
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetSize(std::size_t size) [member function]
|
||||
cls.add_method('SetSize',
|
||||
'ns3::TypeId',
|
||||
[param('std::size_t', 'size')])
|
||||
## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t tid) [member function]
|
||||
cls.add_method('SetUid',
|
||||
'void',
|
||||
@@ -2730,6 +2764,8 @@ def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable]
|
||||
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::callback [variable]
|
||||
cls.add_instance_attribute('callback', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable]
|
||||
cls.add_instance_attribute('help', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable]
|
||||
@@ -3998,10 +4034,10 @@ def register_Ns3Time_methods(root_module, cls):
|
||||
cls.add_constructor([param('long unsigned int', 'v')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor]
|
||||
cls.add_constructor([param('long long unsigned int', 'v')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor]
|
||||
cls.add_constructor([param('ns3::int64x64_t const &', 'v')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor]
|
||||
cls.add_constructor([param('std::string const &', 's')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor]
|
||||
cls.add_constructor([param('ns3::int64x64_t const &', 'value')])
|
||||
## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function]
|
||||
cls.add_method('As',
|
||||
'ns3::TimeWithUnit',
|
||||
@@ -4012,25 +4048,25 @@ def register_Ns3Time_methods(root_module, cls):
|
||||
'int',
|
||||
[param('ns3::Time const &', 'o')],
|
||||
is_const=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function]
|
||||
cls.add_method('From',
|
||||
'ns3::Time',
|
||||
[param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function]
|
||||
cls.add_method('From',
|
||||
'ns3::Time',
|
||||
[param('ns3::int64x64_t const &', 'value')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function]
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function]
|
||||
cls.add_method('From',
|
||||
'ns3::Time',
|
||||
[param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function]
|
||||
cls.add_method('FromDouble',
|
||||
'ns3::Time',
|
||||
[param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('double', 'value'), param('ns3::Time::Unit', 'unit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function]
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function]
|
||||
cls.add_method('FromInteger',
|
||||
'ns3::Time',
|
||||
[param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function]
|
||||
cls.add_method('GetDays',
|
||||
@@ -4147,20 +4183,20 @@ def register_Ns3Time_methods(root_module, cls):
|
||||
'bool',
|
||||
[],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function]
|
||||
## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function]
|
||||
cls.add_method('To',
|
||||
'ns3::int64x64_t',
|
||||
[param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('ns3::Time::Unit', 'unit')],
|
||||
is_const=True)
|
||||
## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function]
|
||||
## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function]
|
||||
cls.add_method('ToDouble',
|
||||
'double',
|
||||
[param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('ns3::Time::Unit', 'unit')],
|
||||
is_const=True)
|
||||
## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function]
|
||||
## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function]
|
||||
cls.add_method('ToInteger',
|
||||
'int64_t',
|
||||
[param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('ns3::Time::Unit', 'unit')],
|
||||
is_const=True)
|
||||
return
|
||||
|
||||
@@ -4891,6 +4927,10 @@ def register_Ns3ArpCache_methods(root_module, cls):
|
||||
cls.add_method('Lookup',
|
||||
'ns3::ArpCache::Entry *',
|
||||
[param('ns3::Ipv4Address', 'destination')])
|
||||
## arp-cache.h (module 'internet'): void ns3::ArpCache::PrintArpCache(ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintArpCache',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')])
|
||||
## arp-cache.h (module 'internet'): void ns3::ArpCache::SetAliveTimeout(ns3::Time aliveTimeout) [member function]
|
||||
cls.add_method('SetAliveTimeout',
|
||||
'void',
|
||||
@@ -5249,14 +5289,14 @@ def register_Ns3EnumChecker_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::EnumChecker const &', 'arg0')])
|
||||
## enum.h (module 'core'): ns3::EnumChecker::EnumChecker() [constructor]
|
||||
cls.add_constructor([])
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::Add(int v, std::string name) [member function]
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::Add(int value, std::string name) [member function]
|
||||
cls.add_method('Add',
|
||||
'void',
|
||||
[param('int', 'v'), param('std::string', 'name')])
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::AddDefault(int v, std::string name) [member function]
|
||||
[param('int', 'value'), param('std::string', 'name')])
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::AddDefault(int value, std::string name) [member function]
|
||||
cls.add_method('AddDefault',
|
||||
'void',
|
||||
[param('int', 'v'), param('std::string', 'name')])
|
||||
[param('int', 'value'), param('std::string', 'name')])
|
||||
## enum.h (module 'core'): bool ns3::EnumChecker::Check(ns3::AttributeValue const & value) const [member function]
|
||||
cls.add_method('Check',
|
||||
'bool',
|
||||
@@ -5294,8 +5334,8 @@ def register_Ns3EnumValue_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::EnumValue const &', 'arg0')])
|
||||
## enum.h (module 'core'): ns3::EnumValue::EnumValue() [constructor]
|
||||
cls.add_constructor([])
|
||||
## enum.h (module 'core'): ns3::EnumValue::EnumValue(int v) [constructor]
|
||||
cls.add_constructor([param('int', 'v')])
|
||||
## enum.h (module 'core'): ns3::EnumValue::EnumValue(int value) [constructor]
|
||||
cls.add_constructor([param('int', 'value')])
|
||||
## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumValue::Copy() const [member function]
|
||||
cls.add_method('Copy',
|
||||
'ns3::Ptr< ns3::AttributeValue >',
|
||||
@@ -5316,10 +5356,10 @@ def register_Ns3EnumValue_methods(root_module, cls):
|
||||
'std::string',
|
||||
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
|
||||
is_const=True, is_virtual=True)
|
||||
## enum.h (module 'core'): void ns3::EnumValue::Set(int v) [member function]
|
||||
## enum.h (module 'core'): void ns3::EnumValue::Set(int value) [member function]
|
||||
cls.add_method('Set',
|
||||
'void',
|
||||
[param('int', 'v')])
|
||||
[param('int', 'value')])
|
||||
return
|
||||
|
||||
def register_Ns3ErlangRandomVariable_methods(root_module, cls):
|
||||
@@ -6048,11 +6088,6 @@ def register_Ns3Ipv4MulticastRoute_methods(root_module, cls):
|
||||
'ns3::Ipv4Address',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-route.h (module 'internet'): uint32_t ns3::Ipv4MulticastRoute::GetOutputTtl(uint32_t oif) [member function]
|
||||
cls.add_method('GetOutputTtl',
|
||||
'uint32_t',
|
||||
[param('uint32_t', 'oif')],
|
||||
deprecated=True)
|
||||
## ipv4-route.h (module 'internet'): std::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int> > > ns3::Ipv4MulticastRoute::GetOutputTtlMap() const [member function]
|
||||
cls.add_method('GetOutputTtlMap',
|
||||
'std::map< unsigned int, unsigned int >',
|
||||
@@ -6804,11 +6839,6 @@ def register_Ns3Packet_methods(root_module, cls):
|
||||
'uint64_t',
|
||||
[],
|
||||
is_const=True)
|
||||
## packet.h (module 'network'): uint8_t const * ns3::Packet::PeekData() const [member function]
|
||||
cls.add_method('PeekData',
|
||||
'uint8_t const *',
|
||||
[],
|
||||
deprecated=True, is_const=True)
|
||||
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function]
|
||||
cls.add_method('PeekHeader',
|
||||
'uint32_t',
|
||||
@@ -6879,6 +6909,11 @@ def register_Ns3Packet_methods(root_module, cls):
|
||||
cls.add_method('SetNixVector',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::NixVector >', 'nixVector')])
|
||||
## packet.h (module 'network'): std::string ns3::Packet::ToString() const [member function]
|
||||
cls.add_method('ToString',
|
||||
'std::string',
|
||||
[],
|
||||
is_const=True)
|
||||
return
|
||||
|
||||
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
|
||||
|
||||
@@ -1553,26 +1553,46 @@ def register_Ns3Ipv4RoutingHelper_methods(root_module, cls):
|
||||
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
|
||||
[param('ns3::Ptr< ns3::Node >', 'node')],
|
||||
is_pure_virtual=True, is_const=True, is_virtual=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheAllAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheAllEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintNeighborCacheEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableAllAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableAllEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableAt',
|
||||
'void',
|
||||
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): void ns3::Ipv4RoutingHelper::PrintRoutingTableEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
|
||||
is_static=True)
|
||||
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintRoutingTableEvery',
|
||||
'void',
|
||||
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
|
||||
is_const=True)
|
||||
is_static=True)
|
||||
return
|
||||
|
||||
def register_Ns3Ipv6Address_methods(root_module, cls):
|
||||
@@ -1978,10 +1998,10 @@ def register_Ns3ObjectBase_methods(root_module, cls):
|
||||
'void',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & attribute) const [member function]
|
||||
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & value) const [member function]
|
||||
cls.add_method('GetAttributeFailSafe',
|
||||
'bool',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'attribute')],
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
|
||||
is_const=True)
|
||||
## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function]
|
||||
cls.add_method('GetInstanceTypeId',
|
||||
@@ -2569,7 +2589,12 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')])
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')],
|
||||
deprecated=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor, std::string callback) [member function]
|
||||
cls.add_method('AddTraceSource',
|
||||
'ns3::TypeId',
|
||||
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor'), param('std::string', 'callback')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(uint32_t i) const [member function]
|
||||
cls.add_method('GetAttribute',
|
||||
'ns3::TypeId::AttributeInformation',
|
||||
@@ -2620,6 +2645,11 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
'uint32_t',
|
||||
[],
|
||||
is_static=True)
|
||||
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetSize() const [member function]
|
||||
cls.add_method('GetSize',
|
||||
'std::size_t',
|
||||
[],
|
||||
is_const=True)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(uint32_t i) const [member function]
|
||||
cls.add_method('GetTraceSource',
|
||||
'ns3::TypeId::TraceSourceInformation',
|
||||
@@ -2696,6 +2726,10 @@ def register_Ns3TypeId_methods(root_module, cls):
|
||||
cls.add_method('SetParent',
|
||||
'ns3::TypeId',
|
||||
[param('ns3::TypeId', 'tid')])
|
||||
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetSize(std::size_t size) [member function]
|
||||
cls.add_method('SetSize',
|
||||
'ns3::TypeId',
|
||||
[param('std::size_t', 'size')])
|
||||
## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t tid) [member function]
|
||||
cls.add_method('SetUid',
|
||||
'void',
|
||||
@@ -2730,6 +2764,8 @@ def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')])
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable]
|
||||
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::callback [variable]
|
||||
cls.add_instance_attribute('callback', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable]
|
||||
cls.add_instance_attribute('help', 'std::string', is_const=False)
|
||||
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable]
|
||||
@@ -3998,10 +4034,10 @@ def register_Ns3Time_methods(root_module, cls):
|
||||
cls.add_constructor([param('long unsigned int', 'v')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor]
|
||||
cls.add_constructor([param('long long unsigned int', 'v')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor]
|
||||
cls.add_constructor([param('ns3::int64x64_t const &', 'v')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor]
|
||||
cls.add_constructor([param('std::string const &', 's')])
|
||||
## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor]
|
||||
cls.add_constructor([param('ns3::int64x64_t const &', 'value')])
|
||||
## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function]
|
||||
cls.add_method('As',
|
||||
'ns3::TimeWithUnit',
|
||||
@@ -4012,25 +4048,25 @@ def register_Ns3Time_methods(root_module, cls):
|
||||
'int',
|
||||
[param('ns3::Time const &', 'o')],
|
||||
is_const=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function]
|
||||
cls.add_method('From',
|
||||
'ns3::Time',
|
||||
[param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function]
|
||||
cls.add_method('From',
|
||||
'ns3::Time',
|
||||
[param('ns3::int64x64_t const &', 'value')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function]
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function]
|
||||
cls.add_method('From',
|
||||
'ns3::Time',
|
||||
[param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function]
|
||||
cls.add_method('FromDouble',
|
||||
'ns3::Time',
|
||||
[param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('double', 'value'), param('ns3::Time::Unit', 'unit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function]
|
||||
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function]
|
||||
cls.add_method('FromInteger',
|
||||
'ns3::Time',
|
||||
[param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function]
|
||||
cls.add_method('GetDays',
|
||||
@@ -4147,20 +4183,20 @@ def register_Ns3Time_methods(root_module, cls):
|
||||
'bool',
|
||||
[],
|
||||
is_static=True)
|
||||
## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function]
|
||||
## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function]
|
||||
cls.add_method('To',
|
||||
'ns3::int64x64_t',
|
||||
[param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('ns3::Time::Unit', 'unit')],
|
||||
is_const=True)
|
||||
## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function]
|
||||
## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function]
|
||||
cls.add_method('ToDouble',
|
||||
'double',
|
||||
[param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('ns3::Time::Unit', 'unit')],
|
||||
is_const=True)
|
||||
## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function]
|
||||
## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function]
|
||||
cls.add_method('ToInteger',
|
||||
'int64_t',
|
||||
[param('ns3::Time::Unit', 'timeUnit')],
|
||||
[param('ns3::Time::Unit', 'unit')],
|
||||
is_const=True)
|
||||
return
|
||||
|
||||
@@ -4891,6 +4927,10 @@ def register_Ns3ArpCache_methods(root_module, cls):
|
||||
cls.add_method('Lookup',
|
||||
'ns3::ArpCache::Entry *',
|
||||
[param('ns3::Ipv4Address', 'destination')])
|
||||
## arp-cache.h (module 'internet'): void ns3::ArpCache::PrintArpCache(ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
|
||||
cls.add_method('PrintArpCache',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')])
|
||||
## arp-cache.h (module 'internet'): void ns3::ArpCache::SetAliveTimeout(ns3::Time aliveTimeout) [member function]
|
||||
cls.add_method('SetAliveTimeout',
|
||||
'void',
|
||||
@@ -5249,14 +5289,14 @@ def register_Ns3EnumChecker_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::EnumChecker const &', 'arg0')])
|
||||
## enum.h (module 'core'): ns3::EnumChecker::EnumChecker() [constructor]
|
||||
cls.add_constructor([])
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::Add(int v, std::string name) [member function]
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::Add(int value, std::string name) [member function]
|
||||
cls.add_method('Add',
|
||||
'void',
|
||||
[param('int', 'v'), param('std::string', 'name')])
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::AddDefault(int v, std::string name) [member function]
|
||||
[param('int', 'value'), param('std::string', 'name')])
|
||||
## enum.h (module 'core'): void ns3::EnumChecker::AddDefault(int value, std::string name) [member function]
|
||||
cls.add_method('AddDefault',
|
||||
'void',
|
||||
[param('int', 'v'), param('std::string', 'name')])
|
||||
[param('int', 'value'), param('std::string', 'name')])
|
||||
## enum.h (module 'core'): bool ns3::EnumChecker::Check(ns3::AttributeValue const & value) const [member function]
|
||||
cls.add_method('Check',
|
||||
'bool',
|
||||
@@ -5294,8 +5334,8 @@ def register_Ns3EnumValue_methods(root_module, cls):
|
||||
cls.add_constructor([param('ns3::EnumValue const &', 'arg0')])
|
||||
## enum.h (module 'core'): ns3::EnumValue::EnumValue() [constructor]
|
||||
cls.add_constructor([])
|
||||
## enum.h (module 'core'): ns3::EnumValue::EnumValue(int v) [constructor]
|
||||
cls.add_constructor([param('int', 'v')])
|
||||
## enum.h (module 'core'): ns3::EnumValue::EnumValue(int value) [constructor]
|
||||
cls.add_constructor([param('int', 'value')])
|
||||
## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumValue::Copy() const [member function]
|
||||
cls.add_method('Copy',
|
||||
'ns3::Ptr< ns3::AttributeValue >',
|
||||
@@ -5316,10 +5356,10 @@ def register_Ns3EnumValue_methods(root_module, cls):
|
||||
'std::string',
|
||||
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
|
||||
is_const=True, is_virtual=True)
|
||||
## enum.h (module 'core'): void ns3::EnumValue::Set(int v) [member function]
|
||||
## enum.h (module 'core'): void ns3::EnumValue::Set(int value) [member function]
|
||||
cls.add_method('Set',
|
||||
'void',
|
||||
[param('int', 'v')])
|
||||
[param('int', 'value')])
|
||||
return
|
||||
|
||||
def register_Ns3ErlangRandomVariable_methods(root_module, cls):
|
||||
@@ -6048,11 +6088,6 @@ def register_Ns3Ipv4MulticastRoute_methods(root_module, cls):
|
||||
'ns3::Ipv4Address',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-route.h (module 'internet'): uint32_t ns3::Ipv4MulticastRoute::GetOutputTtl(uint32_t oif) [member function]
|
||||
cls.add_method('GetOutputTtl',
|
||||
'uint32_t',
|
||||
[param('uint32_t', 'oif')],
|
||||
deprecated=True)
|
||||
## ipv4-route.h (module 'internet'): std::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int> > > ns3::Ipv4MulticastRoute::GetOutputTtlMap() const [member function]
|
||||
cls.add_method('GetOutputTtlMap',
|
||||
'std::map< unsigned int, unsigned int >',
|
||||
@@ -6804,11 +6839,6 @@ def register_Ns3Packet_methods(root_module, cls):
|
||||
'uint64_t',
|
||||
[],
|
||||
is_const=True)
|
||||
## packet.h (module 'network'): uint8_t const * ns3::Packet::PeekData() const [member function]
|
||||
cls.add_method('PeekData',
|
||||
'uint8_t const *',
|
||||
[],
|
||||
deprecated=True, is_const=True)
|
||||
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function]
|
||||
cls.add_method('PeekHeader',
|
||||
'uint32_t',
|
||||
@@ -6879,6 +6909,11 @@ def register_Ns3Packet_methods(root_module, cls):
|
||||
cls.add_method('SetNixVector',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::NixVector >', 'nixVector')])
|
||||
## packet.h (module 'network'): std::string ns3::Packet::ToString() const [member function]
|
||||
cls.add_method('ToString',
|
||||
'std::string',
|
||||
[],
|
||||
is_const=True)
|
||||
return
|
||||
|
||||
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
|
||||
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
void Report (std::ostream & os);
|
||||
|
||||
private:
|
||||
///\name parameters
|
||||
//\{
|
||||
|
||||
// parameters
|
||||
/// Number of nodes
|
||||
uint32_t size;
|
||||
/// Distance between nodes, meters
|
||||
@@ -66,14 +66,11 @@ private:
|
||||
bool pcap;
|
||||
/// Print routes if true
|
||||
bool printRoutes;
|
||||
//\}
|
||||
|
||||
///\name network
|
||||
//\{
|
||||
// network
|
||||
NodeContainer nodes;
|
||||
NetDeviceContainer devices;
|
||||
Ipv4InterfaceContainer interfaces;
|
||||
//\}
|
||||
|
||||
private:
|
||||
void CreateNodes ();
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('aodv',
|
||||
['wifi', 'internet', 'aodv'])
|
||||
['wifi', 'internet', 'aodv', 'applications'])
|
||||
obj.source = 'aodv.cc'
|
||||
|
||||
@@ -30,10 +30,12 @@
|
||||
#include "ns3/log.h"
|
||||
#include <algorithm>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvNeighbors");
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvNeighbors");
|
||||
|
||||
namespace aodv
|
||||
{
|
||||
Neighbors::Neighbors (Time delay) :
|
||||
|
||||
@@ -85,11 +85,11 @@ public:
|
||||
/// Get callback to ProcessTxError
|
||||
Callback<void, WifiMacHeader const &> GetTxErrorCallback () const { return m_txErrorCallback; }
|
||||
|
||||
///\name Handle link failure callback
|
||||
//\{
|
||||
/// Handle link failure callback
|
||||
void SetCallback (Callback<void, Ipv4Address> cb) { m_handleLinkFailure = cb; }
|
||||
/// Handle link failure callback
|
||||
Callback<void, Ipv4Address> GetCallback () const { return m_handleLinkFailure; }
|
||||
//\}
|
||||
|
||||
private:
|
||||
/// link failure callback
|
||||
Callback<void, Ipv4Address> m_handleLinkFailure;
|
||||
|
||||
@@ -56,15 +56,13 @@ public:
|
||||
/// c-tor
|
||||
TypeHeader (MessageType t = AODVTYPE_RREQ);
|
||||
|
||||
///\name Header serialization/deserialization
|
||||
//\{
|
||||
// Header serialization/deserialization
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId () const;
|
||||
uint32_t GetSerializedSize () const;
|
||||
void Serialize (Buffer::Iterator start) const;
|
||||
uint32_t Deserialize (Buffer::Iterator start);
|
||||
void Print (std::ostream &os) const;
|
||||
//\}
|
||||
|
||||
/// Return type
|
||||
MessageType Get () const { return m_type; }
|
||||
@@ -108,18 +106,15 @@ public:
|
||||
uint32_t dstSeqNo = 0, Ipv4Address origin = Ipv4Address (),
|
||||
uint32_t originSeqNo = 0);
|
||||
|
||||
///\name Header serialization/deserialization
|
||||
//\{
|
||||
// Header serialization/deserialization
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId () const;
|
||||
uint32_t GetSerializedSize () const;
|
||||
void Serialize (Buffer::Iterator start) const;
|
||||
uint32_t Deserialize (Buffer::Iterator start);
|
||||
void Print (std::ostream &os) const;
|
||||
//\}
|
||||
|
||||
///\name Fields
|
||||
//\{
|
||||
// Fields
|
||||
void SetHopCount (uint8_t count) { m_hopCount = count; }
|
||||
uint8_t GetHopCount () const { return m_hopCount; }
|
||||
void SetId (uint32_t id) { m_requestID = id; }
|
||||
@@ -132,17 +127,14 @@ public:
|
||||
Ipv4Address GetOrigin () const { return m_origin; }
|
||||
void SetOriginSeqno (uint32_t s) { m_originSeqNo = s; }
|
||||
uint32_t GetOriginSeqno () const { return m_originSeqNo; }
|
||||
//\}
|
||||
|
||||
///\name Flags
|
||||
//\{
|
||||
// Flags
|
||||
void SetGratiousRrep (bool f);
|
||||
bool GetGratiousRrep () const;
|
||||
void SetDestinationOnly (bool f);
|
||||
bool GetDestinationOnly () const;
|
||||
void SetUnknownSeqno (bool f);
|
||||
bool GetUnknownSeqno () const;
|
||||
//\}
|
||||
|
||||
bool operator== (RreqHeader const & o) const;
|
||||
private:
|
||||
@@ -184,18 +176,15 @@ public:
|
||||
RrepHeader (uint8_t prefixSize = 0, uint8_t hopCount = 0, Ipv4Address dst =
|
||||
Ipv4Address (), uint32_t dstSeqNo = 0, Ipv4Address origin =
|
||||
Ipv4Address (), Time lifetime = MilliSeconds (0));
|
||||
///\name Header serialization/deserialization
|
||||
//\{
|
||||
// Header serialization/deserialization
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId () const;
|
||||
uint32_t GetSerializedSize () const;
|
||||
void Serialize (Buffer::Iterator start) const;
|
||||
uint32_t Deserialize (Buffer::Iterator start);
|
||||
void Print (std::ostream &os) const;
|
||||
//\}
|
||||
|
||||
///\name Fields
|
||||
//\{
|
||||
// Fields
|
||||
void SetHopCount (uint8_t count) { m_hopCount = count; }
|
||||
uint8_t GetHopCount () const { return m_hopCount; }
|
||||
void SetDst (Ipv4Address a) { m_dst = a; }
|
||||
@@ -206,15 +195,12 @@ public:
|
||||
Ipv4Address GetOrigin () const { return m_origin; }
|
||||
void SetLifeTime (Time t);
|
||||
Time GetLifeTime () const;
|
||||
//\}
|
||||
|
||||
///\name Flags
|
||||
//\{
|
||||
// Flags
|
||||
void SetAckRequired (bool f);
|
||||
bool GetAckRequired () const;
|
||||
void SetPrefixSize (uint8_t sz);
|
||||
uint8_t GetPrefixSize () const;
|
||||
//\}
|
||||
|
||||
/// Configure RREP to be a Hello message
|
||||
void SetHello (Ipv4Address src, uint32_t srcSeqNo, Time lifetime);
|
||||
@@ -249,15 +235,13 @@ public:
|
||||
/// c-tor
|
||||
RrepAckHeader ();
|
||||
|
||||
///\name Header serialization/deserialization
|
||||
//\{
|
||||
// Header serialization/deserialization
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId () const;
|
||||
uint32_t GetSerializedSize () const;
|
||||
void Serialize (Buffer::Iterator start) const;
|
||||
uint32_t Deserialize (Buffer::Iterator start);
|
||||
void Print (std::ostream &os) const;
|
||||
//\}
|
||||
|
||||
bool operator== (RrepAckHeader const & o) const;
|
||||
private:
|
||||
@@ -291,21 +275,17 @@ public:
|
||||
/// c-tor
|
||||
RerrHeader ();
|
||||
|
||||
///\name Header serialization/deserialization
|
||||
//\{
|
||||
// Header serialization/deserialization
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId () const;
|
||||
uint32_t GetSerializedSize () const;
|
||||
void Serialize (Buffer::Iterator i) const;
|
||||
uint32_t Deserialize (Buffer::Iterator start);
|
||||
void Print (std::ostream &os) const;
|
||||
//\}
|
||||
|
||||
///\name No delete flag
|
||||
//\{
|
||||
// No delete flag
|
||||
void SetNoDelete (bool f);
|
||||
bool GetNoDelete () const;
|
||||
//\}
|
||||
|
||||
/**
|
||||
* Add unreachable node address and its sequence number in RERR header
|
||||
|
||||
@@ -42,10 +42,11 @@
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvRoutingProtocol");
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvRoutingProtocol");
|
||||
|
||||
namespace aodv
|
||||
{
|
||||
NS_OBJECT_ENSURE_REGISTERED (RoutingProtocol);
|
||||
@@ -283,6 +284,12 @@ RoutingProtocol::DoDispose ()
|
||||
iter->first->Close ();
|
||||
}
|
||||
m_socketAddresses.clear ();
|
||||
for (std::map<Ptr<Socket>, Ipv4InterfaceAddress>::iterator iter =
|
||||
m_socketSubnetBroadcastAddresses.begin (); iter != m_socketSubnetBroadcastAddresses.end (); iter++)
|
||||
{
|
||||
iter->first->Close ();
|
||||
}
|
||||
m_socketSubnetBroadcastAddresses.clear ();
|
||||
Ipv4RoutingProtocol::DoDispose ();
|
||||
}
|
||||
|
||||
@@ -613,18 +620,34 @@ RoutingProtocol::NotifyInterfaceUp (uint32_t i)
|
||||
UdpSocketFactory::GetTypeId ());
|
||||
NS_ASSERT (socket != 0);
|
||||
socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
|
||||
socket->BindToNetDevice (l3->GetNetDevice (i));
|
||||
socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT));
|
||||
socket->BindToNetDevice (l3->GetNetDevice (i));
|
||||
socket->SetAllowBroadcast (true);
|
||||
socket->SetAttribute ("IpTtl", UintegerValue (1));
|
||||
m_socketAddresses.insert (std::make_pair (socket, iface));
|
||||
|
||||
// create also a subnet broadcast socket
|
||||
socket = Socket::CreateSocket (GetObject<Node> (),
|
||||
UdpSocketFactory::GetTypeId ());
|
||||
NS_ASSERT (socket != 0);
|
||||
socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
|
||||
socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT));
|
||||
socket->BindToNetDevice (l3->GetNetDevice (i));
|
||||
socket->SetAllowBroadcast (true);
|
||||
socket->SetAttribute ("IpTtl", UintegerValue (1));
|
||||
m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface));
|
||||
|
||||
// Add local broadcast record to the routing table
|
||||
Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
|
||||
RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface,
|
||||
/*hops=*/ 1, /*next hop=*/ iface.GetBroadcast (), /*lifetime=*/ Simulator::GetMaximumSimulationTime ());
|
||||
m_routingTable.AddRoute (rt);
|
||||
|
||||
if (l3->GetInterface (i)->GetArpCache ())
|
||||
{
|
||||
m_nb.AddArpCache (l3->GetInterface (i)->GetArpCache ());
|
||||
}
|
||||
|
||||
// Allow neighbor manager use this interface for layer 2 feedback if possible
|
||||
Ptr<WifiNetDevice> wifi = dev->GetObject<WifiNetDevice> ();
|
||||
if (wifi == 0)
|
||||
@@ -634,7 +657,6 @@ RoutingProtocol::NotifyInterfaceUp (uint32_t i)
|
||||
return;
|
||||
|
||||
mac->TraceConnectWithoutContext ("TxErrHeader", m_nb.GetTxErrorCallback ());
|
||||
m_nb.AddArpCache (l3->GetInterface (i)->GetArpCache ());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -662,6 +684,13 @@ RoutingProtocol::NotifyInterfaceDown (uint32_t i)
|
||||
NS_ASSERT (socket);
|
||||
socket->Close ();
|
||||
m_socketAddresses.erase (socket);
|
||||
|
||||
// Close socket
|
||||
socket = FindSubnetBroadcastSocketWithInterfaceAddress (m_ipv4->GetAddress (i, 0));
|
||||
NS_ASSERT (socket);
|
||||
socket->Close ();
|
||||
m_socketSubnetBroadcastAddresses.erase (socket);
|
||||
|
||||
if (m_socketAddresses.empty ())
|
||||
{
|
||||
NS_LOG_LOGIC ("No aodv interfaces");
|
||||
@@ -693,12 +722,22 @@ RoutingProtocol::NotifyAddAddress (uint32_t i, Ipv4InterfaceAddress address)
|
||||
UdpSocketFactory::GetTypeId ());
|
||||
NS_ASSERT (socket != 0);
|
||||
socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv,this));
|
||||
socket->Bind (InetSocketAddress (iface.GetLocal (), AODV_PORT));
|
||||
socket->BindToNetDevice (l3->GetNetDevice (i));
|
||||
// Bind to any IP address so that broadcasts can be received
|
||||
socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT));
|
||||
socket->SetAllowBroadcast (true);
|
||||
m_socketAddresses.insert (std::make_pair (socket, iface));
|
||||
|
||||
// create also a subnet directed broadcast socket
|
||||
socket = Socket::CreateSocket (GetObject<Node> (),
|
||||
UdpSocketFactory::GetTypeId ());
|
||||
NS_ASSERT (socket != 0);
|
||||
socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
|
||||
socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT));
|
||||
socket->BindToNetDevice (l3->GetNetDevice (i));
|
||||
socket->SetAllowBroadcast (true);
|
||||
socket->SetAttribute ("IpTtl", UintegerValue (1));
|
||||
m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface));
|
||||
|
||||
// Add local broadcast record to the routing table
|
||||
Ptr<NetDevice> dev = m_ipv4->GetNetDevice (
|
||||
m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
|
||||
@@ -722,7 +761,16 @@ RoutingProtocol::NotifyRemoveAddress (uint32_t i, Ipv4InterfaceAddress address)
|
||||
if (socket)
|
||||
{
|
||||
m_routingTable.DeleteAllRoutesFromInterface (address);
|
||||
socket->Close ();
|
||||
m_socketAddresses.erase (socket);
|
||||
|
||||
Ptr<Socket> unicastSocket = FindSubnetBroadcastSocketWithInterfaceAddress (address);
|
||||
if (unicastSocket)
|
||||
{
|
||||
unicastSocket->Close ();
|
||||
m_socketAddresses.erase (unicastSocket);
|
||||
}
|
||||
|
||||
Ptr<Ipv4L3Protocol> l3 = m_ipv4->GetObject<Ipv4L3Protocol> ();
|
||||
if (l3->GetNAddresses (i))
|
||||
{
|
||||
@@ -733,10 +781,23 @@ RoutingProtocol::NotifyRemoveAddress (uint32_t i, Ipv4InterfaceAddress address)
|
||||
NS_ASSERT (socket != 0);
|
||||
socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
|
||||
// Bind to any IP address so that broadcasts can be received
|
||||
socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT));
|
||||
socket->Bind (InetSocketAddress (iface.GetLocal (), AODV_PORT));
|
||||
socket->BindToNetDevice (l3->GetNetDevice (i));
|
||||
socket->SetAllowBroadcast (true);
|
||||
socket->SetAttribute ("IpTtl", UintegerValue (1));
|
||||
m_socketAddresses.insert (std::make_pair (socket, iface));
|
||||
|
||||
// create also a unicast socket
|
||||
socket = Socket::CreateSocket (GetObject<Node> (),
|
||||
UdpSocketFactory::GetTypeId ());
|
||||
NS_ASSERT (socket != 0);
|
||||
socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
|
||||
socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT));
|
||||
socket->BindToNetDevice (l3->GetNetDevice (i));
|
||||
socket->SetAllowBroadcast (true);
|
||||
socket->SetAttribute ("IpTtl", UintegerValue (1));
|
||||
m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface));
|
||||
|
||||
// Add local broadcast record to the routing table
|
||||
Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
|
||||
RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface,
|
||||
@@ -937,7 +998,20 @@ RoutingProtocol::RecvAodv (Ptr<Socket> socket)
|
||||
Ptr<Packet> packet = socket->RecvFrom (sourceAddress);
|
||||
InetSocketAddress inetSourceAddr = InetSocketAddress::ConvertFrom (sourceAddress);
|
||||
Ipv4Address sender = inetSourceAddr.GetIpv4 ();
|
||||
Ipv4Address receiver = m_socketAddresses[socket].GetLocal ();
|
||||
Ipv4Address receiver;
|
||||
|
||||
if (m_socketAddresses.find (socket) != m_socketAddresses.end ())
|
||||
{
|
||||
receiver = m_socketAddresses[socket].GetLocal ();
|
||||
}
|
||||
else if(m_socketSubnetBroadcastAddresses.find (socket) != m_socketSubnetBroadcastAddresses.end ())
|
||||
{
|
||||
receiver = m_socketSubnetBroadcastAddresses[socket].GetLocal ();
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_ASSERT_MSG (false, "Received a packet from an unknown socket");
|
||||
}
|
||||
NS_LOG_DEBUG ("AODV node " << this << " received a AODV packet from " << sender << " to " << receiver);
|
||||
|
||||
UpdateRouteToNeighbor (sender, receiver);
|
||||
@@ -1116,6 +1190,8 @@ RoutingProtocol::RecvRequest (Ptr<Packet> p, Ipv4Address receiver, Ipv4Address s
|
||||
toNeighbor.SetFlag (VALID);
|
||||
toNeighbor.SetOutputDevice (m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver)));
|
||||
toNeighbor.SetInterface (m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0));
|
||||
toNeighbor.SetHop (1);
|
||||
toNeighbor.SetNextHop (src);
|
||||
m_routingTable.Update (toNeighbor);
|
||||
}
|
||||
m_nb.Update (src, Time (AllowedHelloLoss * HelloInterval));
|
||||
@@ -1444,6 +1520,8 @@ RoutingProtocol::ProcessHello (RrepHeader const & rrepHeader, Ipv4Address receiv
|
||||
toNeighbor.SetFlag (VALID);
|
||||
toNeighbor.SetOutputDevice (m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver)));
|
||||
toNeighbor.SetInterface (m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0));
|
||||
toNeighbor.SetHop (1);
|
||||
toNeighbor.SetNextHop (rrepHeader.GetDst ());
|
||||
m_routingTable.Update (toNeighbor);
|
||||
}
|
||||
if (EnableHello)
|
||||
@@ -1802,7 +1880,9 @@ RoutingProtocol::SendRerrMessage (Ptr<Packet> packet, std::vector<Ipv4Address> p
|
||||
Ptr<Socket> socket = FindSocketWithInterfaceAddress (*i);
|
||||
NS_ASSERT (socket);
|
||||
NS_LOG_LOGIC ("Broadcast RERR message from interface " << i->GetLocal ());
|
||||
// std::cout << "Broadcast RERR message from interface " << i->GetLocal () << std::endl;
|
||||
// Send to all-hosts broadcast if on /32 addr, subnet-directed otherwise
|
||||
Ptr<Packet> p = packet->Copy ();
|
||||
Ipv4Address destination;
|
||||
if (i->GetMask () == Ipv4Mask::GetOnes ())
|
||||
{
|
||||
@@ -1812,7 +1892,7 @@ RoutingProtocol::SendRerrMessage (Ptr<Packet> packet, std::vector<Ipv4Address> p
|
||||
{
|
||||
destination = i->GetBroadcast ();
|
||||
}
|
||||
Simulator::Schedule (Time (MilliSeconds (m_uniformRandomVariable->GetInteger (0, 10))), &RoutingProtocol::SendTo, this, socket, packet, destination);
|
||||
Simulator::Schedule (Time (MilliSeconds (m_uniformRandomVariable->GetInteger (0, 10))), &RoutingProtocol::SendTo, this, socket, p, destination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1832,5 +1912,21 @@ RoutingProtocol::FindSocketWithInterfaceAddress (Ipv4InterfaceAddress addr ) con
|
||||
return socket;
|
||||
}
|
||||
|
||||
Ptr<Socket>
|
||||
RoutingProtocol::FindSubnetBroadcastSocketWithInterfaceAddress (Ipv4InterfaceAddress addr ) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << addr);
|
||||
for (std::map<Ptr<Socket>, Ipv4InterfaceAddress>::const_iterator j =
|
||||
m_socketSubnetBroadcastAddresses.begin (); j != m_socketSubnetBroadcastAddresses.end (); ++j)
|
||||
{
|
||||
Ptr<Socket> socket = j->first;
|
||||
Ipv4InterfaceAddress iface = j->second;
|
||||
if (iface == addr)
|
||||
return socket;
|
||||
}
|
||||
Ptr<Socket> socket;
|
||||
return socket;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,7 @@ public:
|
||||
virtual ~RoutingProtocol();
|
||||
virtual void DoDispose ();
|
||||
|
||||
///\name From Ipv4RoutingProtocol
|
||||
//\{
|
||||
// Inherited from Ipv4RoutingProtocol
|
||||
Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr);
|
||||
bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev,
|
||||
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
|
||||
@@ -73,10 +72,8 @@ public:
|
||||
virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address);
|
||||
virtual void SetIpv4 (Ptr<Ipv4> ipv4);
|
||||
virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const;
|
||||
//\}
|
||||
|
||||
///\name Handle protocol parameters
|
||||
//\{
|
||||
// Handle protocol parameters
|
||||
Time GetMaxQueueTime () const { return MaxQueueTime; }
|
||||
void SetMaxQueueTime (Time t);
|
||||
uint32_t GetMaxQueueLen () const { return MaxQueueLen; }
|
||||
@@ -89,7 +86,6 @@ public:
|
||||
bool GetHelloEnable () const { return EnableHello; }
|
||||
void SetBroadcastEnable (bool f) { EnableBroadcast = f; }
|
||||
bool GetBroadcastEnable () const { return EnableBroadcast; }
|
||||
//\}
|
||||
|
||||
/**
|
||||
* Assign a fixed random variable stream number to the random variables
|
||||
@@ -102,8 +98,8 @@ public:
|
||||
int64_t AssignStreams (int64_t stream);
|
||||
|
||||
private:
|
||||
///\name Protocol parameters.
|
||||
//\{
|
||||
|
||||
// Protocol parameters.
|
||||
uint32_t RreqRetries; ///< Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route
|
||||
uint16_t RreqRateLimit; ///< Maximum number of RREQ per second.
|
||||
uint16_t RerrRateLimit; ///< Maximum number of REER per second.
|
||||
@@ -140,8 +136,10 @@ private:
|
||||
|
||||
/// IP protocol
|
||||
Ptr<Ipv4> m_ipv4;
|
||||
/// Raw socket per each IP interface, map socket -> iface address (IP + mask)
|
||||
/// Raw unicast socket per each IP interface, map socket -> iface address (IP + mask)
|
||||
std::map< Ptr<Socket>, Ipv4InterfaceAddress > m_socketAddresses;
|
||||
/// Raw subnet directed broadcast socket per each IP interface, map socket -> iface address (IP + mask)
|
||||
std::map< Ptr<Socket>, Ipv4InterfaceAddress > m_socketSubnetBroadcastAddresses;
|
||||
/// Loopback device used to defer RREQ until packet will be fully formed
|
||||
Ptr<NetDevice> m_lo;
|
||||
|
||||
@@ -191,8 +189,10 @@ private:
|
||||
void UpdateRouteToNeighbor (Ipv4Address sender, Ipv4Address receiver);
|
||||
/// Check that packet is send from own interface
|
||||
bool IsMyOwnAddress (Ipv4Address src);
|
||||
/// Find socket with local interface address iface
|
||||
/// Find unicast socket with local interface address iface
|
||||
Ptr<Socket> FindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const;
|
||||
/// Find subnet directed broadcast socket with local interface address iface
|
||||
Ptr<Socket> FindSubnetBroadcastSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const;
|
||||
/// Process hello message
|
||||
void ProcessHello (RrepHeader const & rrepHeader, Ipv4Address receiverIfaceAddr);
|
||||
/// Create loopback route for given header
|
||||
@@ -241,7 +241,7 @@ private:
|
||||
* \param origin - originating node IP address
|
||||
*/
|
||||
void SendRerrWhenNoRouteToForward (Ipv4Address dst, uint32_t dstSeqNo, Ipv4Address origin);
|
||||
//\}
|
||||
/// @}
|
||||
|
||||
void SendTo (Ptr<Socket> socket, Ptr<Packet> packet, Ipv4Address destination);
|
||||
|
||||
|
||||
@@ -32,10 +32,11 @@
|
||||
#include "ns3/socket.h"
|
||||
#include "ns3/log.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvRequestQueue");
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvRequestQueue");
|
||||
|
||||
namespace aodv
|
||||
{
|
||||
uint32_t
|
||||
|
||||
@@ -61,8 +61,8 @@ public:
|
||||
{
|
||||
return ((m_packet == o.m_packet) && (m_header.GetDestination () == o.m_header.GetDestination ()) && (m_expire == o.m_expire));
|
||||
}
|
||||
///\name Fields
|
||||
//\{
|
||||
|
||||
// Fields
|
||||
UnicastForwardCallback GetUnicastForwardCallback () const { return m_ucb; }
|
||||
void SetUnicastForwardCallback (UnicastForwardCallback ucb) { m_ucb = ucb; }
|
||||
ErrorCallback GetErrorCallback () const { return m_ecb; }
|
||||
@@ -73,8 +73,9 @@ public:
|
||||
void SetIpv4Header (Ipv4Header h) { m_header = h; }
|
||||
void SetExpireTime (Time exp) { m_expire = exp + Simulator::Now (); }
|
||||
Time GetExpireTime () const { return m_expire - Simulator::Now (); }
|
||||
//\}
|
||||
|
||||
private:
|
||||
|
||||
/// Data packet
|
||||
Ptr<const Packet> m_packet;
|
||||
/// IP header
|
||||
@@ -110,15 +111,15 @@ public:
|
||||
bool Find (Ipv4Address dst);
|
||||
/// Number of entries
|
||||
uint32_t GetSize ();
|
||||
///\name Fields
|
||||
//\{
|
||||
|
||||
// Fields
|
||||
uint32_t GetMaxQueueLen () const { return m_maxLen; }
|
||||
void SetMaxQueueLen (uint32_t len) { m_maxLen = len; }
|
||||
Time GetQueueTimeout () const { return m_queueTimeout; }
|
||||
void SetQueueTimeout (Time t) { m_queueTimeout = t; }
|
||||
//\}
|
||||
|
||||
private:
|
||||
|
||||
std::vector<QueueEntry> m_queue;
|
||||
/// Remove all expired entries
|
||||
void Purge ();
|
||||
|
||||
@@ -32,10 +32,11 @@
|
||||
#include "ns3/simulator.h"
|
||||
#include "ns3/log.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvRoutingTable");
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AodvRoutingTable");
|
||||
|
||||
namespace aodv
|
||||
{
|
||||
|
||||
|
||||
@@ -101,8 +101,8 @@ public:
|
||||
|
||||
/// Mark entry as "down" (i.e. disable it)
|
||||
void Invalidate (Time badLinkLifetime);
|
||||
///\name Fields
|
||||
//\{
|
||||
|
||||
// Fields
|
||||
Ipv4Address GetDestination () const { return m_ipv4Route->GetDestination (); }
|
||||
Ptr<Ipv4Route> GetRoute () const { return m_ipv4Route; }
|
||||
void SetRoute (Ptr<Ipv4Route> r) { m_ipv4Route = r; }
|
||||
@@ -131,7 +131,6 @@ public:
|
||||
Time GetBlacklistTimeout () const { return m_blackListTimeout; }
|
||||
/// RREP_ACK timer
|
||||
Timer m_ackTimer;
|
||||
//\}
|
||||
|
||||
/**
|
||||
* \brief Compare destination address
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user