Compare commits

...
Author SHA1 Message Date
Alexander Afanasyev 30e6537173 visualizer+ndnSIM: implementing ccnx_pit plugin to show PIT status 2012-07-10 17:38:29 -07:00
Alexander Afanasyev a58b47cd4b visualizer+ndnSIM: repairing ccnx_fib plugin 2012-07-09 15:24:42 -07:00
Alexander Afanasyev 3bc13cdc3a visualizer+ndnSIM: Correcting ccnx_fib plugin 2012-06-19 14:56:40 -07:00
Alexander Afanasyev 56fd0ca78e internet+python: rescanned bindings 2012-06-19 13:28:05 -07:00
Alexander Afanasyev a2fee4b476 topology-read+python: rescanned bindings 2012-06-19 13:28:05 -07:00
Alexander Afanasyev 3f1477b79c core: Give ability to generate subset of documentation by utils/print-introspected-doxygen 2012-06-19 13:28:05 -07:00
Alexander Afanasyev 07ebc66ab1 core: Add disclaimer note in README 2012-06-19 13:28:05 -07:00
Alexander Afanasyev c2abdabd9f internet: Corrections of RttEstimator:
Introducing RTO upper bound
Introducing gain2 for smoothing the variance
Making RTO calculation according to the RFC

For future: may need to calculate RTO as in linux implementation
2012-06-19 13:28:05 -07:00
Alexander Afanasyev 6edb354e20 point-to-point: Making loss (again) independent on packet type 2012-06-19 13:28:05 -07:00
Alexander Afanasyev dbc3ebe4e6 point-to-point: Add experimental support for random losses 2012-06-19 13:28:04 -07:00
Alexander Afanasyev 8fa6f1915e point-to-point, netanim: Adding ChannelID to PointToPointChannel trace 2012-06-19 13:28:04 -07:00
Alexander Afanasyev a0ec21862d network: Adding Read (Buffer::Iterator start, uint32_t size) and PeakU8 methods to ns3::Buffer::Iterator class 2012-06-19 13:26:41 -07:00
Alexander Afanasyev 318214600c internet: A new templated static method Ipv(4|6)RoutingHelper::GetRouting that allows search for any routing protocol
Examples:
Ptr<Ipv4RoutingProtocol> ptr = ...

...

Ptr<Ipv4StaticRouting> sr = Ipv4RoutingHelper::GetRouting<Ipv4StaticRouting> (ptr);
2012-06-19 13:26:41 -07:00
Alexander Afanasyev deb4e08a89 core+openflow: Moving boost-related configuration to main wscript.
There is a problem when two different modules require different boost
libs.  Only requirements of the last module are actually picked up by
the build system.
2012-06-19 13:26:41 -07:00
Alexander Afanasyev 02f4136abc visualizer: Making a periodic topology rescan 2012-06-19 13:26:40 -07:00
Alexander Afanasyev 129267ec79 visualizer: Adding plugin to display a CCNx FIB state 2012-06-19 13:26:40 -07:00
Alexander Afanasyev 5cdc8fd2f1 core: Adding inline specifiers for DoMakeAttributeAccessor (there was a
strange duplicate symbols error using apple compiler...)
2012-06-19 13:26:40 -07:00
Alexander Afanasyev c9f85b4a21 internet: Making rtt-estimator.h of the Internet module accessible to other modules 2012-06-19 13:26:40 -07:00
Alexander Afanasyev cec7dfe293 core: Small extension of Vector class (math operations) 2012-06-19 13:26:40 -07:00
Alexander Afanasyev 53ee92edf7 topology-read: Making default constructor for TopologyReader::Link public.
This is necessary for some STL containers operations.
2012-06-19 13:26:40 -07:00
Alexander Afanasyev 25b0ff7699 topology-read: TopologyReader and derivatives are no longer Objects
To allow smart pointers, TopologyReader is just inherited from
SimpleRefCount<TopologyReader> class
2012-06-19 13:26:40 -07:00
Alexander Afanasyev 2e3ba1f9c1 topology-read: Several extensions of TopologyReader 2012-06-19 13:26:40 -07:00
Ilya Moiseenko 68a117694c point-to-point: Add support of PPP->Ethernet and Ethernet->PPP frame type conversion for CCNx protocol
point-to-point: Adding support for CCNx payload in PppHeader::Print method
2012-06-19 13:26:40 -07:00
Alexander Afanasyev 9a92763c63 Adding .gitignore 2012-06-19 13:26:40 -07:00
John Abraham 80663034e3 NetAnim: Clean up 2012-06-18 06:35:32 -07:00
Andrea Sacco 90d5128cf1 Added UAN Animation example and modified netanim/examples/wscript to include it 2012-06-18 11:32:58 +02:00
Andrea Sacco e074bdd6f3 Modified NetAnim and UAN Phy to trace transmission events 2012-06-18 10:22:59 +02:00
Andrea Sacco 3fcb3c137d UAN module: Added Trace source accessors for TX/RX begin/end/drop events 2012-06-18 10:18:58 +02:00
John Abraham e0918edc18 NetAnim: Add tentative Uan Phy Gen callback 2012-06-15 06:59:19 -07:00
Nicola Baldo 8707b44da8 merge 2012-06-15 13:23:51 +02:00
Nicola Baldo 8b0c038a18 merge 2012-06-15 10:57:22 +02:00
Tom Henderson d9f7e14c5a fix stale documentation 2012-06-11 21:30:04 -07:00
Nicola Baldo b301836c07 added references to LTE simulation scenarios 2012-06-08 18:39:30 +02:00
Nicola Baldo 976d97b4ee clarifications in the LTE PHY error model test doc 2012-06-08 18:19:57 +02:00
Nicola Baldo ab6feba375 merge 2012-06-08 11:12:00 +02:00
Marco Miozzo e7c25f9c3c Update Design Doc of PF scheduler with RBG instead of RB 2012-06-07 12:19:22 +02:00
Marco Miozzo 13674a7bda Bug-fix PF scheduler DoSchedDlTriggerReq achievableRate evaluated per RB instead oof RBG 2012-06-07 11:06:00 +02:00
Tom Henderson 521bc21456 update release notes for ns-3.14.1 2012-06-06 23:33:58 -07:00
Tom Henderson 92244ae188 remove explicit visualizer dependency from examples 2012-06-06 22:07:56 -07:00
Gustavo J. A. M. Carneiro 03f1934de7 Automatically add the visualizer module to programs running with waf --run --vis 2012-06-06 18:42:13 +01:00
Gustavo J. A. M. Carneiro d071049665 Bug 1410 - Assert in DefaultSimulatorImpl breaks Visualizer module 2012-06-06 18:41:58 +01:00
Marco Miozzo 19af32a6e3 Bug-fix: remove redundant queueing of UL-DCI in LteEnbPhy::StartSubFrame 2012-06-06 11:53:53 +02:00
Tom Henderson be602d0271 start new release notes for future releases 2012-06-05 22:46:39 -07:00
Tom Henderson cb8a465692 Added tag ns-3.14 for changeset ae540de68a25 2012-06-05 17:01:14 -07:00
Tom Henderson 3306567d57 add queue documentation 2012-06-05 16:29:04 -07:00
Tom Henderson 2d6ad0b37f formatting DSR documentation 2012-06-05 16:28:00 -07:00
Tom Henderson eeb22f032e update release steps again 2012-06-05 12:12:49 -07:00
Tom Henderson ef64362351 update release steps 2012-06-05 11:52:01 -07:00
Tom Henderson 55b1e38d9b Finalize release notes for ns-3.14 2012-06-05 11:24:59 -07:00
Tom Henderson 4c0a1cc3c1 update CHANGES.html for ns-3.14 2012-06-05 11:24:54 -07:00
Tom Henderson 6ee8f5b891 update AUTHORS 2012-06-05 11:22:58 -07:00
Tom Henderson 83dd97c451 two small tutorial typos 2012-06-04 07:21:57 -07:00
Tom Henderson 18947ae628 extend the sample documentation outline 2012-06-04 07:21:37 -07:00
Tom Henderson f8b97d44a6 Do not overwrite transport protocol downtarget callback in NotifyNewAggregate() 2012-06-01 17:10:36 -07:00
Tom Henderson a9b9e503b9 update logging on the dsr example 2012-06-01 17:09:56 -07:00
Tom Henderson 2e6e133380 update dsr example dependencies 2012-06-01 14:57:36 -07:00
Tom Henderson 002252d0e4 update LTE device names 2012-06-01 11:39:48 -07:00
Tom Henderson 06c6a5275b add bindings for virtual-net-device 2012-06-01 09:41:07 -07:00
Marco Miozzo dd1879c2e0 Update Ul and Dl RlcBufferInfo methods of RR and PF scheduler for considering the minimum RLC overhead when decrementing queues 2011-12-23 11:06:19 +01:00
87 changed files with 8541 additions and 385 deletions

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
*.pyc
.waf*
src/NDNabstraction
build/
doc/html/
doc/latex/
\.rej$
\.orig$
\.o$
~$
^build-dir
^build
^testpy-output
^doc/html
^doc/latex
.lock-wscript
doc/ns3-object.txt
doc/introspected-doxygen.h
.lock-waf_darwin_build
.lock-waf_linux2_build
.lock-waf_cygwin_build
.lock-waf_freebsd7_build
.lock-waf_freebsd8_build
.lock-waf_freebsd9_build
.waf
^doc/introspected-doxygen\.h$
.*\.py[co]$
\.pcap$
\.mob$
\.routes$
^doc/manual/build
^doc/tutorial/build
^doc/testing/build
^doc/models/build
^doc/models/source-temp
^doc/manual/figures/.*eps
^doc/manual/figures/.*pdf
^doc/manual/figures/.*png
^bindings/python/pybindgen/
ms_print.*
massif.*
\.patch$
\.diff$
\.tr$
\#[^\#/]+\#$
.lock-wscript
.lock-wafbuild
+1
View File
@@ -61,3 +61,4 @@ e48ed3aabca6ad71c8c49e4604c0f83345eda6a8 ns-3.11-RC3
19c9e2b33b4a53f200be80cd49810bdfecf76770 ns-3.12-RC1
167fc2274f53d4d89fdd769e4a7683ad7b6b7157 ns-3.12
9007193fbb8d18b69a1feb6aec16501dcf138b6f ns-3.13
ae540de68a2534213342c5e0b12afb47d7518a90 ns-3.14
+11 -10
View File
@@ -1,4 +1,4 @@
Alexander Afanasyev <alexander.afanasyev@ucla.edu>
Alexander Afanasyev (alexander.afanasyev@ucla.edu)
Rohit Agarwal (mindprince@gmail.com)
Kirill Andreev (andreev@iitp.ru)
Dean Armstrong (deanarm@gmail.com)
@@ -8,7 +8,7 @@ Ramon Bauza (monbauza@gmail.com)
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>
Julien Boite (juboite@gmail.com)
Elena Borovkova (borokovaes@iitp.ru)
Pavel Boyko (boyko@iitp.ru)
Dan Broyles (muxman@sbcglobal.net)
@@ -26,18 +26,19 @@ Craig Dowell (craigdo@ee.washington.edu)
Denis Fakhriev (fakhriev@iitp.ru)
Jahanzeb Farooq (Jahanzeb.Farooq@inria.fr, Jahanzeb.Farooq@gmail.com)
Juliana Freitag Borin (juliana.freitag@gmail.com)
Thomas Geithner (thomas.geithner@dai-labor.de)
Martin Giachino (martin.giachino@gmail.com,giachino@fing.edu.uy)
Charline Taibi Guguen (charline.guguen@gmail.com)
Tom Goff (tgoff@tgoff.net)
David Gross (gdavid.devel@gmail.com)
Charline Taibi Guguen (charline.guguen@gmail.com)
Daniel Halperin (daniel@halper.in)
Bruno Haick (bghaick@hotmail.com)
Frank Helbert (frank@ime.usp.br)
Tom Henderson (tomhend@u.washington.edu)
Blake Hurd (naimorai@gmail.com)
ishan <ishan.chhabra@gmail.com>
ishan (ishan.chhabra@gmail.com)
Mohamed Amine Ismail (amine.ismail@inria.fr, iamine@udcast.com)
Atishay Jain <atishayjain25@gmail.com>
Atishay Jain (atishayjain25@gmail.com)
Sascha Alexander Jopen (jopen@informatik.uni-bonn.de)
Sam Jansen (sam.jansen@gmail.com)
Liu Jian (liujatp@gmail.com)
@@ -66,11 +67,11 @@ Duy Nguyen (duy@soe.ucsc.edu)
Tommaso Pecorella (tommaso.pecorella@unifi.it)
Vikas Pushkar (vikaskupushkar@gmail.com)
Josh Pelkey (jpelkey@gatech.edu)
Colin Perkins <csp@csperkins.org>
Colin Perkins (csp@csperkins.org)
Giuseppe Piro (g.piro@poliba.it)
Yana Podkosova (yanapdk@rambler.ru)
Guangyu Pei (guangyu.pei@boeing.com)
Andrea Ranieri <andreran@uno.it>
Andrea Ranieri (andreran@uno.it)
Bruno Ranieri (Yrrsinn@googlemail.com)
Ken Renard (kenneth.renard@arl.army.mil)
Manuel Requena (mrequena@cttc.es)
@@ -83,11 +84,11 @@ Florian Schmidt (Florian.Schmidt@cs.rwth-aachen.de)
Guillaume Seguin (guillaume.seguin@inria.fr)
Kulin Shah (m.kulin@gmail.com)
Phillip Sitbon (phillip.sitbon@gmail.com)
Anirudh Sivaraman <sk.anirudh@gmail.com>
Anirudh Sivaraman (sk.anirudh@gmail.com)
Ewgenij Starostin (estar@cs.tu-berlin.de)
YunQiang Su <wzssyqa@gmail.com>
YunQiang Su (wzssyqa@gmail.com)
Lalith Suresh (suresh.lalith@gmail.com)
Marcos Talau <talau@users.sourceforge.net>
Marcos Talau (talau@users.sourceforge.net)
Adrian S. W. Tam (adrian.sw.tam@gmail.com)
Hajime Tazaki (tazaki@sfc.wide.ad.jp)
Wilson Thong (wilsonwk@ee.cityu.edu.hk)
+24 -1
View File
@@ -44,7 +44,30 @@ 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.13 to ns-3-dev</h1>
<h1>Changes from ns-3.14 to ns-3.15</h1>
<h2>New API:</h2>
<ul>
<li></li>
</ul>
<h2>Changes to existing API:</h2>
<ul>
<li></li>
</ul>
<h2>Changes to build system:</h2>
<ul>
<li></li>
</ul>
<h2>Changed behavior:</h2>
<ul>
<li></li>
</ul>
<hr>
<h1>Changes from ns-3.13 to ns-3.14</h1>
<h2>New API:</h2>
<ul>
+6
View File
@@ -1,3 +1,9 @@
Note:
This is a custom and unsupported fork of NS-3 simulator (http://www.nsnam.org/).
**The code in this repository is frequently rebased on top of the latest ns-3-dev branch**
The Network Simulator, Version 3
--------------------------------
+50 -11
View File
@@ -9,36 +9,73 @@ http://www.nsnam.org including tutorials: http://www.nsnam.org/tutorials.html
Consult the file CHANGES.html for more detailed information about changed
API and behavior across ns-3 releases.
Release 3-dev
============
Availability
------------
This release is not yet available.
Supported platforms
-------------------
New user-visible features
-------------------------
Bugs fixed
----------
Known issues
------------
In general, known issues are tracked on the project tracker available
at http://www.nsnam.org/bugzilla/
Release 3.14.1
==============
Availability
------------
This release is available from:
http://www.nsnam.org/release/ns-allinone-3.14.1.tar.bz2
Bugs fixed
----------
This hotfix release contains a fix for the PyViz visualizer and makes it
easier to add PyViz support to examples; otherwise it is the same as the
ns-3.14 release.
Release 3.14
============
Availability
------------
This release not yet available.
This release is available from:
http://www.nsnam.org/release/ns-allinone-3.14.tar.bz2
Supported platforms
-------------------
ns-3.14 has been tested on the following platforms. Not all features are
available on all platforms; check the Installation page on the project wiki.
- Ubuntu 12.04 (32/64 bit) with g++-4.6.3
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
- Fedora Core 17 (32/64 bit) with g++-4.7.0
- Fedora Core 16 (32/64 bit) with g++-4.6.3
- Fedora Core 15 (64 bit) with g++-4.6.3
- Ubuntu 12.04 (32/64 bit) with g++-4.6.3
- Ubuntu 11.10 (32 bit) with g++-4.6.1
- OS X Lion with g++-4.2.1
- OS X Snow Leopard with g++-4.2.1
- Ubuntu 10.04.4 LTS (64 bit) with g++-4.4.3
- OS X Lion 10.7.4 with g++-4.2.1
- OS X Snow Leopard 10.6.8 with g++-4.2.1
- FreeBSD 8.2 (32 bit) with g++-4.2.1
- Cygwin 1.7.9-1 with g++-4.5.3
New user-visible features
-------------------------
- Transport protocol implementations (TCP, UDP) have been refactored to
support also IPv6 connections. Dual-stacked IPv6 sockets are implemented.
An IPv6 socket can accept an IPv4 connection, returning the senders
An IPv6 socket can accept an IPv4 connection, returning the sender's
address as an IPv4-mapped address (IPV6_V6ONLY socket option is not
implemented).
- The LTE code from the LENA project has been merged, bringin in a
- The LTE code from the LENA project has been merged, bringing in a
significant redesign of the LTE module as well as many new features.
- An antenna module is now included, which includes different
radiation pattern models. See the corresponding new section of the
@@ -50,7 +87,7 @@ New user-visible features
- The Dynamic Source Routing (DSR) MANET routing protocol for IPv4 was added.
- A Random Early Detection (RED) queue model has been added.
- Ipv6RoutingHelper is now in-line with Ipv4RoutingHelper concerning the RT
print functions. Various minor changes made in Ipv6RoutingProtocol and
print functions. Various minor changes were made in Ipv6RoutingProtocol and
derived classes to make this possible.
- New "SendIcmpv6Redirect" attribute (and getter/setter functions) to
Ipv6L3Protocol. The behavior is similar to Linux's conf "send_redirects",
@@ -58,12 +95,12 @@ New user-visible features
- Longer and more descriptive names are used for error units in RateErrorModel
class and queue mode in Queue class. Attributes in those classes are also
changed for consistency. See API documentation for details.
- The netanim animator is now included with the release.
- The netanim animator is now bundled with the release.
Bugs fixed
----------
- bug 631 - RealtimeSimulatorImpl does not handle Ctrl-C with python bindings
- bug 603 - Simulator::Next is useless
- bug 631 - RealtimeSimulatorImpl does not handle Ctrl-C with python bindings
- bug 962 - list of paths to reach objects contains bogus entries
- bug 1000 - Make RealtimeSimulatorImpl last until stop
- bug 1053 - Need better error diagnostics in ns2-mobility-trace example
@@ -103,10 +140,12 @@ Bugs fixed
- bug 1393 - IPv6 Routing Helper RT Print functions
- bug 1395 - AODV DeferredRouteOutputTag missing constructor
- bug 1396 - ARP with hardware addresses longer than 6 bytes
- bug 1399 - TCP not backing off retransmissions properly
- bug 1404 - Bound user input in tutorial third.cc program
- bug 1406 - waf exits with maximum recursion depth exceeded
- bug 1415 - examples-to-run.py doesn't work with command line arguments
- bug 1420 - bug 1420: no python bindings for csma-layout
- bug 1420 - no python bindings for csma-layout
- bug 1441 - IPv4 header length handling
Known issues
------------
+1
View File
@@ -49,6 +49,7 @@ SOURCES = \
$(SRC)/network/doc/packets.rst \
$(SRC)/network/doc/sockets-api.rst \
$(SRC)/network/doc/simple.rst \
$(SRC)/network/doc/queue.rst \
$(SRC)/internet/doc/internet-stack.rst \
$(SRC)/internet/doc/ipv4.rst \
$(SRC)/internet/doc/ipv6.rst \
-1
View File
@@ -40,7 +40,6 @@ This document is written in `reStructuredText <http://docutils.sourceforge.net/r
openflow-switch
point-to-point
propagation
simple
statistics
topology
uan
+1
View File
@@ -7,3 +7,4 @@ Network Module
network-overview
sockets-api
simple
queue
+91 -75
View File
@@ -1,93 +1,89 @@
Steps in doing an ns-3 release
ns-3-dev preparation
--------------------
We typically post release candidates for testing at the following URL:
https://www.nsnam.org/release/ns-allinone-3.X.rcX.tar.bz2
1. check out a clean ns-3-dev somewhere using ns-3-allinone (you will need it)
- hg clone http://code.nsnam.org/ns-3-allinone
- ./download.py
- ./build.py --enable-examples --enable-tests
- try building static, optimized, and debug versions
This overview covers the following release stages:
1) new feature additions and bug fixing
2) preparing release candidates for testing
3) making the actual release
4) maintaining the release
1) new feature additions and bug fixing
---------------------------------------
During the software development phase, it is important for the release
manager to try to maintain the following files with updated information:
- AUTHORS
- RELEASE_NOTES
- CHANGES.html
otherwise, this becomes painful to edit (and things are forgotten)
when the release is imminent.
2) preparing release candidates for testing
-------------------------------------------
This step presumes that you have a reasonably solid ns-3-dev that you
and/or the buildbots have been testing
- building static, optimized, and debug versions
- try Python visualizer (not tested by buildbots)
-- ./waf --pyrun src/flow-monitor/examples/wifi-olsr-flowmon.py --vis
- cd ns-3-dev
- ensure that tests pass (./test.py -g) and make sure that the buildbots
are reporting greens based on the tip of the repository
2. prepare the source files
- revise and check in AUTHORS, if needed
- revise and check in RELEASE_NOTES. Make sure to edit the Availability
section if this is a final release.
- DO NOT change VERSION at this time
are reporting blue based on the tip of the repository
- revise and check in AUTHORS, RELEASE_NOTES, and CHANGES>html
- required versions for related libraries (nsc, netanim, pybindgen)
are correct
- make latexpdf in the doc/manual, doc/models, and doc/tutorial directories
- confirm that Doxygen builds cleanly (./waf doxygen),
and check in any necessary changes. Currently, doxygen does not build
cleanly, we need to fix this over time.
At this point, the ns-3-dev should be ready, except for changing the
name of this repo from "3-dev" to the numbered release. That will come
in subsequent steps.
ns-allinone-3.X.tar.bz2 dry run
-------------------------------
This phase is optional to dry-run a tarball before tagging. You may skip
to the next phase if you are ready to just make the release or release
candidate.
1. check out a clean ns-3-allinone again
- change into the allinone directory
Check out a clean ns-3-dev somewhere using ns-3-allinone
- hg clone http://code.nsnam.org/ns-3-allinone
- ./download.py
- cd ns-3-dev
- change VERSION to the appropriate string, either "3.X" (for a release) or
"3.X.RC1" Do not commit this VERSION change to ns-3-dev. It is used
by dist.py script to name the directory properly.
- cd into allinone directory and type "./dist.py"; you should see something
like this:
- edit VERSION such as "ns-3.14.rc1" (DO NOT commit this change to ns-3-dev)
- cd ..
- ./dist.py
NS-3 version: '3.12'
Adding ns-3-dev as ns-allinone-3.12/ns-3.12
Adding pybindgen as ns-allinone-3.12/pybindgen-0.15.0.795
Adding nsc as ns-allinone-3.12/nsc-0.5.2
Adding the build script files
This should yield a compressed tarfile, such as: ns-allinone-3.14.rc1.tar.bz2
Test this, and when satisfied, upload it to
www.nsnam.org:/var/www/html/releases/ (with apache:apache file ownership)
This will create an ns-allinone-3.X.tar.bz2 tarball
Announce it to ns-developers as:
https://www.nsnam.org/release/ns-allinone-3.14.rc3.tar.bz2
2. test tarball on release platforms
- optimized, debug, and static builds
- ./test.py -g
- make latexpdf in the doc/manual, doc/models, and doc/tutorial directories
- ./waf --doxygen
Iterate the above as needed during the release testing phase.
Note, in the past we have added mercurial tags to ns-3-dev to denote
release candidates, but lately we have not been bothering with this.
If you would like to tag a release candidate, follow these steps
-- hg tag "ns-3.X.rcX" (for the appropriate version numbers)
-- hg push ssh://code@code.nsnam.org/repos/ns-3-dev
3) making the release
---------------------
Follow similar steps for creating the release candidate tarballs, except
we will work off of a release repository.
At this point, you are ready for final packaging and repository/site work
tagging ns-3-dev and creating ns-3.X repositories
-------------------------------------------------
The steps here involve tagging ns-3-dev, copying over ns-3-dev to ns-3.X
on code.nsnam.org, cloning it locally, making changes from "3-dev" to "3.X"
in various places, and checking in those changes to the new ns-3.X repository.
We'll refer to the release number as "X" or "x" below. The steps here
involve tagging ns-3-dev, copying over ns-3-dev to ns-3.X on code.nsnam.org,
cloning it locally, making changes from "3-dev" to "3.X" in various places,
and checking in those changes to the new ns-3.X repository.
1. once you are happy with the tarball, tag ns-3-dev
1. once you are happy with the most recent release candidate tarball and
do not plan to further touch ns-3-dev, tag ns-3-dev
- cd into ns-3-dev
- if release candidate
-- hg tag "ns-3.x-RCy"
-- hg push ssh://code@code.nsnam.org//home/code/repos/ns-3-dev
- else if final release
-- hg tag "ns-3.x"
-- hg push ssh://code@code.nsnam.org//home/code/repos/ns-3-dev
2. copy the tagged ns-3-dev and place it on the repository
- ssh code.nsnam.org; sudo bash; su code;
- if release candidate
-- cp -r /home/code/repos/ns-3-dev /home/code/repos/ns-3.x-RCy
-- cd /home/code/repos/ns-3.x-RCy/.hg and edit the hgrc appropriately:
[paths]
default = /home/code/repos/ns-3.x-RCy
[web]
description = ns-3.x-RCy release
name = ns-3.x-RCy
contact = <ns-developers@isi.edu>
- else if final release
-- cp -r /home/code/repos/ns-3-dev /home/code/repos/ns-3.x
-- cd /home/code/repos/ns-3.x/.hg and edit the hgrc appropriately:
[paths]
@@ -97,21 +93,20 @@ in various places, and checking in those changes to the new ns-3.X repository.
name = ns-3.x
contact = <ns-developers@isi.edu>
3. If this is a final release (not RC)
- move (mv) ns-3.x RCs in /home/code/archived-repos
3. check out a clean version of the new release (ns-3.x)
to a scratch directory on your local machine
- hg clone http://code.nsnam.org/ns-3.x
4. check out a clean version of the new release (ns-3.x) or (ns-3.x-RCy)
to your local machine
- hg clone http://code.nsnam.org/ns-3.x or (-RCy)
5. Update the VERSION for this new release
5. Update the VERSION for this new release, in the ns-3.x directory (i.e.
NOT in ns-3-dev)
- change the string 3-dev in the VERSION file to the real version
(e.g. 3.7 or 3.7-RC1) This must agree with the version name you chose in the clone.
(e.g. 3.14) This must agree with the version name you chose in the clone.
- change the version and release string for the documentation in
doc/manual/source, doc/tutorial/source, and doc/models/source conf.py files
doc/manual/source, doc/tutorial/source, doc/tutorial-pt/source,
and doc/models/source conf.py files
This should hopefully be updated in the future to simply pull from the
VERSION file.
- hg commit -m "update VERSION to ns-3.x" or (-RCy), you get the point
- hg commit -m "update VERSION to ns-3.x"
- hg push ssh://code@code.nsnam.org//home/code/repos/ns-3.x
creating the distribution tarball
@@ -171,7 +166,7 @@ Documentation)
4. The main page http://www.nsnam.org should point to
ns-3.x in the "Download" and "Documentation" boxes
5. Create blog entry to announce release
5. Create a blog entry to announce release
ns-3 wiki edits
---------------
@@ -198,3 +193,24 @@ Announcing
2. announce to ns-developers and ns-3-users, with summary of release notes
4) maintaining the release
--------------------------
First, create skeletal sections in CHANGES.html and RELEASE_NOTES to
start collecting inputs for the ns-3.(x+1) release.
The project may decide to make incremental, bug-fix releases from
time to time, with a minor version number (e.g. ns-3.7.1). To do
this, changesets may be cherry-picked from ns-3-dev and added to
ns-3.x repository. Do not move over changesets that pertain to
adding new features, but documentation fixes and bug fixes are good
changesets to make available in a minor release. The same steps
above for making a release are generally followed, although one
does not need to create a separate repository, but instead just tags
the existing ns-3-dev and ns-3.x repositories with a "ns-3.x.1" type
of tag.
Also, on the main website, make sure that "latest release" points to
the right page. See how it was handled for ns-3.12 (which made
a minor release): https://www.nsnam.org/ns-3.12/
+1 -1
View File
@@ -24,7 +24,7 @@ who want to learn more are encouraged to read the following additional
documentation:
* The |ns3| manual
* The |ns3| model library documentatio
* The |ns3| model library documentation
* The |ns3| Doxygen (API documentation)
* The |ns3| wiki
+1 -1
View File
@@ -9,7 +9,7 @@ Downloading ns-3
The |ns3| system as a whole is a fairly complex system and has a
number of dependencies on other components. Along with the systems you will
most likely deal with every day (the GNU toolchain, Mercurial, you programmer
most likely deal with every day (the GNU toolchain, Mercurial, a text
editor) you will need to ensure that a number of additional libraries are
present on your system before proceeding. |ns3| provides a wiki
for your reading pleasure that includes pages with many useful hints and tips.
+1 -1
View File
@@ -2,7 +2,7 @@
def build(bld):
obj = bld.create_ns3_program('tcp-large-transfer',
['visualizer', 'point-to-point', 'applications', 'internet'])
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-large-transfer.cc'
obj = bld.create_ns3_program('tcp-nsc-lfn',
+7 -7
View File
@@ -8,16 +8,16 @@ def build(bld):
bld.register_ns3_script('mixed-wireless.py', ['core', 'mobility', 'wifi', 'applications', 'point-to-point',
'internet', 'csma', 'olsr'])
obj = bld.create_ns3_program('wifi-adhoc', ['core', 'mobility', 'wifi', 'applications', 'tools', 'visualizer'])
obj = bld.create_ns3_program('wifi-adhoc', ['core', 'mobility', 'wifi', 'applications', 'tools'])
obj.source = 'wifi-adhoc.cc'
obj = bld.create_ns3_program('wifi-clear-channel-cmu', ['internet', 'mobility', 'wifi', 'tools'])
obj.source = 'wifi-clear-channel-cmu.cc'
obj = bld.create_ns3_program('wifi-ap', ['core', 'mobility', 'wifi', 'applications', 'config-store', 'tools', 'visualizer'])
obj = bld.create_ns3_program('wifi-ap', ['core', 'mobility', 'wifi', 'applications', 'config-store', 'tools'])
obj.source = 'wifi-ap.cc'
bld.register_ns3_script('wifi-ap.py', ['core', 'mobility', 'wifi', 'applications', 'config-store', 'tools', 'visualizer'])
bld.register_ns3_script('wifi-ap.py', ['core', 'mobility', 'wifi', 'applications', 'config-store', 'tools'])
obj = bld.create_ns3_program('wifi-wired-bridging', ['internet', 'mobility', 'wifi', 'csma', 'bridge', 'applications'])
obj.source = 'wifi-wired-bridging.cc'
@@ -28,16 +28,16 @@ def build(bld):
obj = bld.create_ns3_program('multirate', ['internet', 'mobility', 'wifi', 'tools', 'flow-monitor', 'olsr', 'applications', 'point-to-point'])
obj.source = 'multirate.cc'
obj = bld.create_ns3_program('wifi-simple-adhoc', ['internet', 'mobility', 'wifi', 'config-store', 'tools', 'visualizer'])
obj = bld.create_ns3_program('wifi-simple-adhoc', ['internet', 'mobility', 'wifi', 'config-store', 'tools'])
obj.source = 'wifi-simple-adhoc.cc'
obj = bld.create_ns3_program('wifi-simple-adhoc-grid', ['internet', 'mobility', 'wifi', 'olsr', 'config-store', 'tools', 'point-to-point', 'visualizer'])
obj = bld.create_ns3_program('wifi-simple-adhoc-grid', ['internet', 'mobility', 'wifi', 'olsr', 'config-store', 'tools', 'point-to-point'])
obj.source = 'wifi-simple-adhoc-grid.cc'
obj = bld.create_ns3_program('wifi-simple-infra', ['internet', 'mobility', 'wifi','config-store', 'visualizer'])
obj = bld.create_ns3_program('wifi-simple-infra', ['internet', 'mobility', 'wifi','config-store'])
obj.source = 'wifi-simple-infra.cc'
obj = bld.create_ns3_program('wifi-simple-interference', ['internet', 'mobility', 'wifi', 'config-store', 'tools', 'visualizer'])
obj = bld.create_ns3_program('wifi-simple-interference', ['internet', 'mobility', 'wifi', 'config-store', 'tools'])
obj.source = 'wifi-simple-interference.cc'
obj = bld.create_ns3_program('wifi-blockack', ['internet', 'mobility', 'wifi', 'applications'])
+6 -6
View File
@@ -199,7 +199,7 @@ private:
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (void (T::*setter)(U),
V (T::*getter)(void) const)
{
@@ -240,7 +240,7 @@ private:
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (V (T::*getter)(void) const,
void (T::*setter)(U))
{
@@ -248,7 +248,7 @@ DoMakeAccessorHelperTwo (V (T::*getter)(void) const,
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (bool (T::*setter)(U),
V (T::*getter)(void) const)
{
@@ -289,7 +289,7 @@ private:
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (bool (T::*getter)(void) const,
void (T::*setter)(U))
{
@@ -297,14 +297,14 @@ DoMakeAccessorHelperTwo (bool (T::*getter)(void) const,
}
template <typename V, typename T1>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1)
{
return DoMakeAccessorHelperOne<V> (a1);
}
template <typename V, typename T1, typename T2>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1, T2 a2)
{
return DoMakeAccessorHelperTwo<V> (a1, a2);
+137
View File
@@ -47,6 +47,68 @@ Vector3D::Vector3D ()
{
}
double
Vector3D::GetLength () const
{
return sqrt (x*x + y*y + z*z);
}
Vector3D&
Vector3D::operator += (const Vector3D &v)
{
x += v.x;
y += v.y;
z += v.z;
return *this;
}
Vector3D&
Vector3D::operator += (double v)
{
x += v;
y += v;
z += v;
return *this;
}
Vector3D
Vector3D::operator + (const Vector3D &v) const
{
return Vector3D (x+v.x, y+v.y, z+v.z);
}
Vector3D
Vector3D::operator + (double v) const
{
return Vector3D (x+v, y+v, z+v);
}
Vector3D
Vector3D::operator * (const Vector3D &v) const
{
return Vector3D (x*v.x, y*v.y, z*v.z);
}
Vector3D
Vector3D::operator * (double v) const
{
return Vector3D (x*v, y*v, z*v);
}
Vector3D
Vector3D::operator - (const Vector3D &v) const
{
return Vector3D (x-v.x, y-v.y, z-v.z);
}
Vector3D
Vector3D::operator / (double div) const
{
return Vector3D (x/div, y/div, z/div);
}
Vector2D::Vector2D (double _x, double _y)
: x (_x),
y (_y)
@@ -59,6 +121,66 @@ Vector2D::Vector2D ()
{
}
double
Vector2D::GetLength () const
{
return sqrt (x*x + y*y);
}
Vector2D&
Vector2D::operator += (const Vector2D &v)
{
x += v.x;
y += v.y;
return *this;
}
Vector2D&
Vector2D::operator += (double v)
{
x += v;
y += v;
return *this;
}
Vector2D
Vector2D::operator + (const Vector2D &v) const
{
return Vector2D (x+v.x, y+v.y);
}
Vector2D
Vector2D::operator + (double v) const
{
return Vector2D (x+v, y+v);
}
Vector2D
Vector2D::operator * (const Vector2D &v) const
{
return Vector2D (x*v.x, y*v.y);
}
Vector2D
Vector2D::operator * (double v) const
{
return Vector2D (x*v, y*v);
}
Vector2D
Vector2D::operator - (const Vector2D &v) const
{
return Vector2D (x-v.x, y-v.y);
}
Vector2D
Vector2D::operator / (double div) const
{
return Vector2D (x/div, y/div);
}
double
CalculateDistance (const Vector3D &a, const Vector3D &b)
{
@@ -77,6 +199,21 @@ CalculateDistance (const Vector2D &a, const Vector2D &b)
return distance;
}
double
ScalarMultiplication (const Vector3D &a, const Vector3D &b)
{
Vector3D tmp = a * b;
return tmp.x + tmp.y + tmp.z;
}
double
ScalarMultiplication (const Vector2D &a, const Vector2D &b)
{
Vector2D tmp = a * b;
return tmp.x + tmp.y;
}
std::ostream &operator << (std::ostream &os, const Vector3D &vector)
{
os << vector.x << ":" << vector.y << ":" << vector.z;
+35
View File
@@ -55,6 +55,17 @@ public:
* z coordinate of vector
*/
double z;
double GetLength () const;
Vector3D& operator += (const Vector3D &);
Vector3D& operator += (double);
Vector3D operator + (const Vector3D &) const;
Vector3D operator + (double) const;
Vector3D operator * (const Vector3D &) const;
Vector3D operator * (double v) const;
Vector3D operator - (const Vector3D &) const;
Vector3D operator / (double) const;
};
/**
@@ -82,6 +93,17 @@ public:
* y coordinate of vector
*/
double y;
double GetLength () const;
Vector2D& operator += (const Vector2D &);
Vector2D& operator += (double);
Vector2D operator + (const Vector2D &) const;
Vector2D operator + (double) const;
Vector2D operator * (const Vector2D &) const;
Vector2D operator * (double v) const;
Vector2D operator - (const Vector2D &) const;
Vector2D operator / (double) const;
};
/**
@@ -98,6 +120,19 @@ double CalculateDistance (const Vector3D &a, const Vector3D &b);
*/
double CalculateDistance (const Vector2D &a, const Vector2D &b);
/**
* \brief Calculate scalar multiplication between two vectors
* \param a one point
* \param b another point
*/
double ScalarMultiplication (const Vector3D &a, const Vector3D &b);
/**
* \brief Calculate scalar multiplication between two vectors
* \param a one point
* \param b another point
*/
double ScalarMultiplication (const Vector2D &a, const Vector2D &b);
/**
* \class ns3::Vector3DValue
* \brief hold objects of type ns3::Vector3D
+26 -6
View File
@@ -230,11 +230,13 @@ Model Description
The source code for the new module lives in the directory ``src/%(MODULE)s``.
Add here a basic description of what is being modeled.
Design
======
Add here an overall description of the software design and how it fits
into the existing ns-3 architecture.
Briefly describe the software design of the model and how it fits into
the existing ns-3 architecture.
Scope and Limitations
=====================
@@ -252,18 +254,31 @@ Usage
*****
This section is principally concerned with the usage of your model, using
the public API.
the public API. Focus first on most common usage patterns, then go
into more advanced topics.
Building New Module
===================
Include this section if there are special build instructions.
Include this subsection only if there are special build instructions or
platform limitations.
Helper
======
Helpers
=======
What helper API will users typically use? Describe it here.
Attributes
==========
What classes hold attributes, and what are the key ones worth mentioning?
Output
======
What kind of data does the model generate? What are the key trace
sources? What kind of logging output can be enabled?
Advanced Usage
==============
@@ -275,6 +290,11 @@ Examples
What examples using this new code are available? Describe them here.
Troubleshooting
===============
Add any tips for avoiding pitfalls, etc.
Validation
**********
+78 -70
View File
@@ -3,8 +3,8 @@
DSR Routing
-----------
Dynamic Source Routing (DSR) protocol is a reactive routing protocol designed specifically for use in multi-hop
wireless ad hoc networks of mobile nodes.
Dynamic Source Routing (DSR) protocol is a reactive routing protocol designed
specifically for use in multi-hop wireless ad hoc networks of mobile nodes.
This model was developed by
`the ResiliNets research group <http://www.ittc.ku.edu/resilinets>`_
@@ -13,83 +13,87 @@ at the University of Kansas.
DSR Routing Overview
********************
This model implements the base specification of the Dynamic Source Routing (DSR)
protocol. Implementation is based on RFC4728.
This model implements the base specification of the Dynamic Source Routing
(DSR) protocol. Implementation is based on RFC4728.
Class dsr::DsrRouting implements all functionality of service packet exchange and inherits IpL4Protocol.
* ``Class dsr::DsrRouting`` implements all functionality of service packet exchange and inherits IpL4Protocol.
* ``Class dsr::DsrOptions`` implements functionality of packet processing and talks to DsrRouting to send/receive packets
* ``Class dsr::DsrFsHeader`` defines the fixed-size header and identifies the up-layer protocol
* ``Class dsr::DsrOptionHeader`` takes care of different dsr options and processes different header according to the specification from the RFC
* ``Class dsr::DsrSendBuffer`` is a buffer to save data packets and route error packets when there is no route to forward the packets
* ``Class dsr::DsrMaintainBuffer`` is a buffer to save data packets for next-hop notification when the data packet has already been sent out of send buffer
* ``Class dsr::RouteCache`` is the essential part to save routes found for data packets. DSR responds to several routes for a single destination
* ``Class dsr::RreqTable`` implements the functions to avoid duplicate route requests and control route request rate for a single destination
Protocol operation depends on many adjustable parameters. We support parameters, with their default values, from RFC and parameters that enable/disable
protocol features or tune for specific simulation scenarios, such as the max
size of the send buffer and its timeout value. The full parameter list is
found in the dsr-routing.cc file.
Class dsr::DsrOptions implements functionality of packet processing and talk to DsrRouting to send/receive packets
DSR discovers routes on-demand. Therefore, our DSR model buffers all packets,
while a route request packet (RREQ) is disseminated. We implement a packet
buffer in dsr-rsendbuff.cc. The packet queue implements garbage collection
of old packets and a queue size limit. When the packet is sent out from the
send buffer, it will be queued in maintenance buffer for next hop
acknowledgment.
Class dsr::DsrFsHeader defines the fixed-size header and identify the up-layer protocol
The Route Cache implementation support garbage collection of old entries
and state machine, as defined in the standard. It implements as a STL
map container. The key is the destination IP address.
Class dsr::DsrOptionHeader takes care of different dsr options and process different header according to specification from rfc
Protocol operation strongly depends on broken link detection mechanism.
We implement the three heuristics recommended.
First, we use layer 2 feedback when possible. A link is considered to be
broken if frame transmission results in a transmission failure for all
retries. This mechanism is meant for active links and works much faster than
in its absence. Layer 2 feedback implementation relies on TxErrHeader trace
source, currently it is supported in AdhocWifiMac only.
Class dsr::DsrSendBuffer is a buffer to save data packet as well as route error packet when there is no route to forward the packet
Second, passive acknowledgment should be used whenever possible. The node
turns on "promiscuous" receive mode, in which it can receive packets not
destined for itself, and when the node assures the delivery of that data
packet to its destination, it cancels the passive acknowledgment timer.
Class dsr::DsrMaintainBuffer is a buffer to save data packet for next-hop notification when the data packet has already sent out of send buffer
Last, we use a network layer acknowledge scheme to notify the receipt of
a packet. Route request packet will not be acknowledged or retransmitted.
Class dsr::RouteCache is the essential part to save routes found for data packet, dsr responds to several routes for a single destination
The following optional protocol optimizations aren't implemented:
Class dsr::RreqTable implements the functionalities to avoid duplicate route requests and control route request rate for a single destination
Protocol operation depends on the many adjustable parameters. We support parameters, with their default values, from
RFC and parameters that enable/disable protocol features or tune for specific simulation scenarios, such as the max size
of send buffer and its timeout value. The full parameter list is in DsrRouting.cc file.
DSR discovers routes totally on demand. Therefore, our DSR model buffers all packets, while a route request packet (RREQ)
is disseminated. We implement a packet buffer in dsr-rsendbuff.cc. The packet queue implements garbage collection of old
packets and a queue size limit. When the packet is sent out from the send buffer, it will be queued in maintenance buffer for
next hop acknowledgment
Route Cache implementation support garbage collection of old entries and state machine, defined in standard.
It implements as a STL map container. The key is the destination IP address.
Protocol operation strongly depends on broken link detection mechanism. We implement all the three heuristics.
First, we use layer 2 feedback when possible. Link considered to be broken, if frame transmission results in a transmission
failure for all retries. This mechanism meant for active links and work much more faster, than first method.
Layer 2 feedback implementation relies on TxErrHeader trace source, currently it is supported in AdhocWifiMac only.
Second, passive acknowledgment should be used whenever possible. The node turns on "promiscuous" receive mode, in which it can receive
packet not destined for itself, and when the node assures the delivery of that data packet to its destination, it cancels the passive
acknowledgment timer.
Last, we use network layer acknowledge scheme to notify the receipt of a packet. Route request packet will not
be acknowledge or retransmitted.
Following optional protocol optimizations aren't implemented:
- Flow state
- First Hop External (F), Last Hop External (L) flags
- Handling unknown DSR options
- Two types of error headers:
* Flow state
* First Hop External (F), Last Hop External (L) flags
* Handling unknown DSR options
* Two types of error headers:
1. flow state not supported option
2. unsupported option (not going to happen in simulation)
DSR operates with direct access to IP header, and operates between network and transport layer.
DSR operates with direct access to IP header, and operates between
network and transport layer.
Implementation changes
- The DsrFsHeader has added 3 fields: message type, source id, destination id, and these changes only for post-processing
- message type is used to identify the data packet from control packet
- source id is used to identify the real source of the data packet since we have to deliver the packet hop-by-hop and the ipv4header
is not carrying the real source and destination ip address as needed
- destination id is for same reason of above
Implementation changes
======================
Changes:
- Route Reply header is not word-aligned in DSR rfc, change it to word-aligned in implementation
- DSR works as a shim header between transport and network protocol, it needs its own forwarding mechanism,
we are changing the packet transmission to hop-by-hop delivery, so we added two fields in dsr fixed header
to notify packet delivery
* The DsrFsHeader has added 3 fields: message type, source id, destination id,
and these changes only for post-processing
** message type is used to identify the data packet from control packet
** source id is used to identify the real source of the data packet since we have to deliver the packet hop-by-hop and the ipv4header is not carrying the real source and destination ip address as needed
** destination id is for same reason of above
* Route Reply header is not word-aligned in DSR rfc, change it to word-aligned in implementation
* DSR works as a shim header between transport and network protocol, it needs its own forwarding mechanism, we are changing the packet transmission to hop-by-hop delivery, so we added two fields in dsr fixed header to notify packet delivery
1. message type to notify the type of this packet: data packet or control one
2. source id to identify the real source address of this packet
3. destination id to identify the real destination
Current Route Cache implementation:
- This implementation used "path cache", which is simple to implement and ensures loop-free
- the path cache has automatic expire policy
- the cache saves multiple route entries for a certain destination and sort the entries based on hop counts
- the MaxEntriesEachDst can be tuned to change the maximum entries saved for a single destination
- when adding mulitiple routes for one destination, the route is compared based on hop-count and expire time, the one with less hop count
or relatively new route is favored
- Future implementation may include "link cache" as another possibility
Current Route Cache implementation
==================================
This implementation used "path cache", which is simple to implement and ensures loop-free paths:
* the path cache has automatic expire policy
* the cache saves multiple route entries for a certain destination and sort the entries based on hop counts
* the MaxEntriesEachDst can be tuned to change the maximum entries saved for a single destination
* when adding mulitiple routes for one destination, the route is compared based on hop-count and expire time, the one with less hop count or relatively new route is favored
* Future implementation may include "link cache" as another possibility
DSR Instructions
****************
@@ -103,14 +107,15 @@ The following should be kept in mind when running DSR as routing protocol:
Helper
******
To have a node run DSR, the easiest way would be to use the ClickInternetStackHelper
class in your simulation script. For instance::
To have a node run DSR, the easiest way would be to use the DsrHelper
and DsrMainHelpers in your simulation script. For instance::
DsrHelper dsr;
DsrMainHelper dsrMain;
dsrMain.Install (dsr, adhocNodes);
The example scripts inside ``src/dsr/examples/`` demonstrate the use of DSR based nodes
The example scripts inside ``src/dsr/examples/`` demonstrate the use of
DSR based nodes
in different scenarios. The helper source can be found inside ``src/dsr/helper/dsr-main-helper.{h,cc}``
and ``src/dsr/helper/dsr-helper.{h,cc}``
@@ -120,10 +125,9 @@ Examples
The example can be found in ``src/dsr/examples/``:
* dsr.cc use DSR as routing protocol within a traditional MANETs environment[3].
DSR is also built in the routing comparison case in ``examples/routing/``:
* manet-routing-compare.cc is a comparison case with built in MANET routing protocols and can generate its own results.
* ``manet-routing-compare.cc`` is a comparison case with built in MANET routing protocols and can generate its own results.
Validation
**********
@@ -133,10 +137,14 @@ This model has been tested as follows:
* Unit tests have been written to verify the internals of DSR. This can be found in ``src/dsr/test/dsr-test-suite.cc``. These tests verify whether the methods inside DSR module which deal with packet buffer, headers work correctly.
* Simulation cases similar to [3] have been tested and have comparable results.
* manet-routing-compare.cc has been used to compare DSR with three of other routing protocols.
A paper was presented on these results at the Workshop on ns-3 in 2011.
References
**********
[1] Link for the original paper: www.monarch.cs.rice.edu/monarch-papers/dsr-chapter00.pdf
[2] Link for RFC 4728: http://www6.ietf.org/rfc/rfc4728.txt
[3] Link for the broch's comparison paper: http://www.monarch.cs.rice.edu/monarch-papers/mobicom98.ps
[1] Link for the `original paper: <http://www.monarch.cs.rice.edu/monarch-papers/dsr-chapter00.pdf>`_
[2] Link for `RFC 4728: <http://www6.ietf.org/rfc/rfc4728.txt>`_
[3] Link for the `Broch's comparison paper: <http://www.monarch.cs.rice.edu/monarch-papers/mobicom98.ps>`_
+2 -1
View File
@@ -50,14 +50,15 @@ main (int argc, char *argv[])
//
#if 0
LogComponentEnable ("Ipv4L3Protocol", LOG_LEVEL_ALL);
LogComponentEnable ("Ipv4L4Protocol", LOG_LEVEL_ALL);
LogComponentEnable ("UdpL4Protocol", LOG_LEVEL_ALL);
LogComponentEnable ("UdpSocketImpl", LOG_LEVEL_ALL);
LogComponentEnable ("NetDevice", LOG_LEVEL_ALL);
LogComponentEnable ("Ipv4EndPointDemux", LOG_LEVEL_ALL);
#endif
#if 0
LogComponentEnable ("DsrOptions", LOG_LEVEL_ALL);
LogComponentEnable ("DsrHelper", LOG_LEVEL_ALL);
LogComponentEnable ("DsrRouting", LOG_LEVEL_ALL);
LogComponentEnable ("DsrOptionHeader", LOG_LEVEL_ALL);
LogComponentEnable ("DsrFsHeader", LOG_LEVEL_ALL);
+1 -1
View File
@@ -1,6 +1,6 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('dsr', ['core', 'simulator', 'node', 'internet-stack'])
obj = bld.create_ns3_program('dsr', ['core', 'network', 'internet', 'applications', 'mobility', 'config-store', 'wifi', 'dsr'])
obj.source = 'dsr.cc'
+157 -2
View File
@@ -200,6 +200,8 @@ def register_types(module):
module.add_class('PcapHelperForIpv6', allow_subclassing=True)
## random-variable.h (module 'core'): ns3::RandomVariable [class]
module.add_class('RandomVariable', import_from_module='ns.core')
## rtt-estimator.h (module 'internet'): ns3::RttHistory [class]
module.add_class('RttHistory')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex [class]
module.add_class('SPFVertex')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::VertexType [enumeration]
@@ -370,6 +372,10 @@ def register_types(module):
module.add_class('ParetoVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable'])
## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class]
module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator [class]
module.add_class('RttEstimator', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation [class]
module.add_class('RttMeanDeviation', parent=root_module['ns3::RttEstimator'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -607,6 +613,9 @@ def register_types(module):
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >', 'ns3::SequenceNumber32')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >*', 'ns3::SequenceNumber32*')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >&', 'ns3::SequenceNumber32&')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >', 'ns3::RttHistory_t')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >*', 'ns3::RttHistory_t*')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >&', 'ns3::RttHistory_t&')
## Register a nested module for the namespace FatalImpl
@@ -689,6 +698,7 @@ def register_methods(root_module):
register_Ns3PcapHelperForIpv4_methods(root_module, root_module['ns3::PcapHelperForIpv4'])
register_Ns3PcapHelperForIpv6_methods(root_module, root_module['ns3::PcapHelperForIpv6'])
register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable'])
register_Ns3RttHistory_methods(root_module, root_module['ns3::RttHistory'])
register_Ns3SPFVertex_methods(root_module, root_module['ns3::SPFVertex'])
register_Ns3SeedManager_methods(root_module, root_module['ns3::SeedManager'])
register_Ns3SequenceNumber32_methods(root_module, root_module['ns3::SequenceNumber32'])
@@ -759,6 +769,8 @@ def register_methods(root_module):
register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
register_Ns3ParetoVariable_methods(root_module, root_module['ns3::ParetoVariable'])
register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper'])
register_Ns3RttEstimator_methods(root_module, root_module['ns3::RttEstimator'])
register_Ns3RttMeanDeviation_methods(root_module, root_module['ns3::RttMeanDeviation'])
register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -1348,6 +1360,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Next',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::PeekU8() [member function]
cls.add_method('PeekU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function]
cls.add_method('Prev',
'void',
@@ -1360,6 +1376,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(ns3::Buffer::Iterator start, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function]
cls.add_method('ReadLsbtohU16',
'uint16_t',
@@ -3981,6 +4001,21 @@ def register_Ns3RandomVariable_methods(root_module, cls):
is_const=True)
return
def register_Ns3RttHistory_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::SequenceNumber32 s, uint32_t c, ns3::Time t) [constructor]
cls.add_constructor([param('ns3::SequenceNumber32', 's'), param('uint32_t', 'c'), param('ns3::Time', 't')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::RttHistory const & h) [copy constructor]
cls.add_constructor([param('ns3::RttHistory const &', 'h')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::count [variable]
cls.add_instance_attribute('count', 'uint32_t', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::retx [variable]
cls.add_instance_attribute('retx', 'bool', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::seq [variable]
cls.add_instance_attribute('seq', 'ns3::SequenceNumber32', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::time [variable]
cls.add_instance_attribute('time', 'ns3::Time', is_const=False)
return
def register_Ns3SPFVertex_methods(root_module, cls):
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::SPFVertex() [constructor]
cls.add_constructor([])
@@ -4677,7 +4712,6 @@ def register_Ns3Empty_methods(root_module, cls):
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right'))
@@ -4730,6 +4764,7 @@ def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
@@ -7187,6 +7222,126 @@ def register_Ns3PcapFileWrapper_methods(root_module, cls):
[])
return
def register_Ns3RttEstimator_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator(ns3::RttEstimator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttEstimator const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::AckSeq(ns3::SequenceNumber32 ackSeq) [member function]
cls.add_method('AckSeq',
'ns3::Time',
[param('ns3::SequenceNumber32', 'ackSeq')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ClearSent() [member function]
cls.add_method('ClearSent',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttEstimator::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetCurrentEstimate() const [member function]
cls.add_method('GetCurrentEstimate',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMaxRto() const [member function]
cls.add_method('GetMaxRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMinRto() const [member function]
cls.add_method('GetMinRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttEstimator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::IncreaseMultiplier() [member function]
cls.add_method('IncreaseMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Measurement(ns3::Time t) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 't')],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ResetMultiplier() [member function]
cls.add_method('ResetMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SentSeq(ns3::SequenceNumber32 seq, uint32_t size) [member function]
cls.add_method('SentSeq',
'void',
[param('ns3::SequenceNumber32', 'seq'), param('uint32_t', 'size')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetCurrentEstimate(ns3::Time estimate) [member function]
cls.add_method('SetCurrentEstimate',
'void',
[param('ns3::Time', 'estimate')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMaxRto(ns3::Time maxRto) [member function]
cls.add_method('SetMaxRto',
'void',
[param('ns3::Time', 'maxRto')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMinRto(ns3::Time minRto) [member function]
cls.add_method('SetMinRto',
'void',
[param('ns3::Time', 'minRto')])
return
def register_Ns3RttMeanDeviation_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation(ns3::RttMeanDeviation const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttMeanDeviation const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttMeanDeviation::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Gain(double g) [member function]
cls.add_method('Gain',
'void',
[param('double', 'g')])
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttMeanDeviation::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Measurement(ns3::Time measure) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 'measure')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttMeanDeviation::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_virtual=True)
return
def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -8007,11 +8162,11 @@ def register_Ns3TcpSocketFactory_methods(root_module, cls):
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
+157 -2
View File
@@ -200,6 +200,8 @@ def register_types(module):
module.add_class('PcapHelperForIpv6', allow_subclassing=True)
## random-variable.h (module 'core'): ns3::RandomVariable [class]
module.add_class('RandomVariable', import_from_module='ns.core')
## rtt-estimator.h (module 'internet'): ns3::RttHistory [class]
module.add_class('RttHistory')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex [class]
module.add_class('SPFVertex')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::VertexType [enumeration]
@@ -370,6 +372,10 @@ def register_types(module):
module.add_class('ParetoVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable'])
## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class]
module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator [class]
module.add_class('RttEstimator', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation [class]
module.add_class('RttMeanDeviation', parent=root_module['ns3::RttEstimator'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -607,6 +613,9 @@ def register_types(module):
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >', 'ns3::SequenceNumber32')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >*', 'ns3::SequenceNumber32*')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >&', 'ns3::SequenceNumber32&')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >', 'ns3::RttHistory_t')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >*', 'ns3::RttHistory_t*')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >&', 'ns3::RttHistory_t&')
## Register a nested module for the namespace FatalImpl
@@ -689,6 +698,7 @@ def register_methods(root_module):
register_Ns3PcapHelperForIpv4_methods(root_module, root_module['ns3::PcapHelperForIpv4'])
register_Ns3PcapHelperForIpv6_methods(root_module, root_module['ns3::PcapHelperForIpv6'])
register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable'])
register_Ns3RttHistory_methods(root_module, root_module['ns3::RttHistory'])
register_Ns3SPFVertex_methods(root_module, root_module['ns3::SPFVertex'])
register_Ns3SeedManager_methods(root_module, root_module['ns3::SeedManager'])
register_Ns3SequenceNumber32_methods(root_module, root_module['ns3::SequenceNumber32'])
@@ -759,6 +769,8 @@ def register_methods(root_module):
register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
register_Ns3ParetoVariable_methods(root_module, root_module['ns3::ParetoVariable'])
register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper'])
register_Ns3RttEstimator_methods(root_module, root_module['ns3::RttEstimator'])
register_Ns3RttMeanDeviation_methods(root_module, root_module['ns3::RttMeanDeviation'])
register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -1348,6 +1360,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Next',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::PeekU8() [member function]
cls.add_method('PeekU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function]
cls.add_method('Prev',
'void',
@@ -1360,6 +1376,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(ns3::Buffer::Iterator start, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function]
cls.add_method('ReadLsbtohU16',
'uint16_t',
@@ -3981,6 +4001,21 @@ def register_Ns3RandomVariable_methods(root_module, cls):
is_const=True)
return
def register_Ns3RttHistory_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::SequenceNumber32 s, uint32_t c, ns3::Time t) [constructor]
cls.add_constructor([param('ns3::SequenceNumber32', 's'), param('uint32_t', 'c'), param('ns3::Time', 't')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::RttHistory const & h) [copy constructor]
cls.add_constructor([param('ns3::RttHistory const &', 'h')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::count [variable]
cls.add_instance_attribute('count', 'uint32_t', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::retx [variable]
cls.add_instance_attribute('retx', 'bool', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::seq [variable]
cls.add_instance_attribute('seq', 'ns3::SequenceNumber32', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::time [variable]
cls.add_instance_attribute('time', 'ns3::Time', is_const=False)
return
def register_Ns3SPFVertex_methods(root_module, cls):
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::SPFVertex() [constructor]
cls.add_constructor([])
@@ -4677,7 +4712,6 @@ def register_Ns3Empty_methods(root_module, cls):
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right'))
@@ -4730,6 +4764,7 @@ def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
@@ -7187,6 +7222,126 @@ def register_Ns3PcapFileWrapper_methods(root_module, cls):
[])
return
def register_Ns3RttEstimator_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator(ns3::RttEstimator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttEstimator const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::AckSeq(ns3::SequenceNumber32 ackSeq) [member function]
cls.add_method('AckSeq',
'ns3::Time',
[param('ns3::SequenceNumber32', 'ackSeq')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ClearSent() [member function]
cls.add_method('ClearSent',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttEstimator::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetCurrentEstimate() const [member function]
cls.add_method('GetCurrentEstimate',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMaxRto() const [member function]
cls.add_method('GetMaxRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMinRto() const [member function]
cls.add_method('GetMinRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttEstimator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::IncreaseMultiplier() [member function]
cls.add_method('IncreaseMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Measurement(ns3::Time t) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 't')],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ResetMultiplier() [member function]
cls.add_method('ResetMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SentSeq(ns3::SequenceNumber32 seq, uint32_t size) [member function]
cls.add_method('SentSeq',
'void',
[param('ns3::SequenceNumber32', 'seq'), param('uint32_t', 'size')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetCurrentEstimate(ns3::Time estimate) [member function]
cls.add_method('SetCurrentEstimate',
'void',
[param('ns3::Time', 'estimate')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMaxRto(ns3::Time maxRto) [member function]
cls.add_method('SetMaxRto',
'void',
[param('ns3::Time', 'maxRto')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMinRto(ns3::Time minRto) [member function]
cls.add_method('SetMinRto',
'void',
[param('ns3::Time', 'minRto')])
return
def register_Ns3RttMeanDeviation_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation(ns3::RttMeanDeviation const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttMeanDeviation const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttMeanDeviation::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Gain(double g) [member function]
cls.add_method('Gain',
'void',
[param('double', 'g')])
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttMeanDeviation::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Measurement(ns3::Time measure) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 'measure')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttMeanDeviation::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_virtual=True)
return
def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -8007,11 +8162,11 @@ def register_Ns3TcpSocketFactory_methods(root_module, cls):
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
+38 -1
View File
@@ -23,6 +23,7 @@
#include "ns3/ptr.h"
#include "ns3/nstime.h"
#include "ns3/output-stream-wrapper.h"
#include "ns3/ipv4-list-routing.h"
namespace ns3 {
@@ -60,7 +61,7 @@ public:
* \returns a newly-created routing protocol
*/
virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const = 0;
/**
* \brief prints the routing tables of all nodes at a particular time.
* \param printTime the time at which the routing table is supposed to be printed.
@@ -107,11 +108,47 @@ public:
*/
void PrintRoutingTableEvery (Time printInterval, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
/**
* @brief Request a specified routing protocol <T> from Ipv4RoutingProtocol protocol
*
* If protocol is Ipv4ListRouting, then protocol will be searched in the list,
* otherwise a simple DynamicCast will be performed
*
* @param protocol Smart pointer to Ipv4RoutingProtocol object
*/
template<class T>
static Ptr<T> GetRouting (Ptr<Ipv4RoutingProtocol> protocol);
private:
void Print (Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
void PrintEvery (Time printInterval, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
};
// This function does a recursive search for a requested routing protocol.
// Strictly speaking this recursion is not necessary, but why not?
template<class T>
Ptr<T> Ipv4RoutingHelper::GetRouting (Ptr<Ipv4RoutingProtocol> protocol)
{
Ptr<T> ret = DynamicCast<T> (protocol);
if (ret == 0)
{
// trying to check if protocol is a list routing
Ptr<Ipv4ListRouting> lrp = DynamicCast<Ipv4ListRouting> (protocol);
if (lrp != 0)
{
for (uint32_t i = 0; i < lrp->GetNRoutingProtocols (); i++)
{
int16_t priority;
ret = GetRouting<T> (lrp->GetRoutingProtocol (i, priority)); // potential recursion, if inside ListRouting is ListRouting
if (ret != 0)
break;
}
}
}
return ret;
}
} // namespace ns3
+37
View File
@@ -24,6 +24,7 @@
#include "ns3/ptr.h"
#include "ns3/nstime.h"
#include "ns3/output-stream-wrapper.h"
#include "ns3/ipv6-list-routing.h"
namespace ns3 {
@@ -110,11 +111,47 @@ public:
*/
void PrintRoutingTableEvery (Time printInterval, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
/**
* @brief Request a specified routing protocol <T> from Ipv4RoutingProtocol protocol
*
* If protocol is Ipv4ListRouting, then protocol will be searched in the list,
* otherwise a simple DynamicCast will be performed
*
* @param protocol Smart pointer to Ipv4RoutingProtocol object
*/
template<class T>
static Ptr<T> GetRouting (Ptr<Ipv6RoutingProtocol> protocol);
private:
void Print (Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
void PrintEvery (Time printInterval, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
};
// This function does a recursive search for a requested routing protocol.
// Strictly speaking this recursion is not necessary, but why not?
template<class T>
Ptr<T> Ipv6RoutingHelper::GetRouting (Ptr<Ipv6RoutingProtocol> protocol)
{
Ptr<T> ret = DynamicCast<T> (protocol);
if (ret == 0)
{
// trying to check if protocol is a list routing
Ptr<Ipv6ListRouting> lrp = DynamicCast<Ipv6ListRouting> (protocol);
if (lrp != 0)
{
for (uint32_t i = 0; i < lrp->GetNRoutingProtocols (); i++)
{
int16_t priority;
ret = GetRouting<T> (lrp->GetRoutingProtocol (i, priority)); // potential recursion, if inside ListRouting is ListRouting
if (ret != 0)
break;
}
}
}
return ret;
}
} // namespace ns3
+1 -1
View File
@@ -57,7 +57,7 @@ Icmpv4L4Protocol::NotifyNewAggregate ()
if (node != 0)
{
Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
if (ipv4 != 0)
if (ipv4 != 0 && m_downTarget.IsNull ())
{
this->SetNode (node);
ipv4->Insert (this);
+1 -1
View File
@@ -112,7 +112,7 @@ void Icmpv6L4Protocol::NotifyNewAggregate ()
if (node != 0)
{
Ptr<Ipv6L3Protocol> ipv6 = this->GetObject<Ipv6L3Protocol> ();
if (ipv6 != 0)
if (ipv6 != 0 && m_downTarget.IsNull ())
{
SetNode (node);
ipv6->Insert (this);
+1 -1
View File
@@ -196,7 +196,7 @@ NscTcpL4Protocol::NotifyNewAggregate ()
if (node != 0)
{
Ptr<Ipv4L3Protocol> ipv4 = this->GetObject<Ipv4L3Protocol> ();
if (ipv4 != 0)
if (ipv4 != 0 && m_downTarget.IsNull ())
{
this->SetNode (node);
ipv4->Insert (this);
+55 -18
View File
@@ -61,6 +61,12 @@ RttEstimator::GetTypeId (void)
MakeTimeAccessor (&RttEstimator::SetMinRto,
&RttEstimator::GetMinRto),
MakeTimeChecker ())
.AddAttribute ("MaxRTO",
"Maximum retransmit timeout value",
TimeValue (Seconds (200.0)),
MakeTimeAccessor (&RttEstimator::SetMaxRto,
&RttEstimator::GetMaxRto),
MakeTimeChecker ())
;
return tid;
}
@@ -76,6 +82,19 @@ RttEstimator::GetMinRto (void) const
{
return m_minRto;
}
void
RttEstimator::SetMaxRto (Time maxRto)
{
NS_LOG_FUNCTION (this << maxRto);
m_maxRto = maxRto;
}
Time
RttEstimator::GetMaxRto (void) const
{
return m_maxRto;
}
void
RttEstimator::SetCurrentEstimate (Time estimate)
{
@@ -123,7 +142,7 @@ RttEstimator::RttEstimator (const RttEstimator& c)
: Object (c), m_next (c.m_next), m_history (c.m_history),
m_maxMultiplier (c.m_maxMultiplier),
m_initialEstimatedRtt (c.m_initialEstimatedRtt),
m_currentEstimatedRtt (c.m_currentEstimatedRtt), m_minRto (c.m_minRto),
m_currentEstimatedRtt (c.m_currentEstimatedRtt), m_minRto (c.m_minRto), m_maxRto (c.m_maxRto),
m_nSamples (c.m_nSamples), m_multiplier (c.m_multiplier)
{
NS_LOG_FUNCTION (this);
@@ -234,10 +253,15 @@ RttMeanDeviation::GetTypeId (void)
.SetParent<RttEstimator> ()
.AddConstructor<RttMeanDeviation> ()
.AddAttribute ("Gain",
"Gain used in estimating the RTT, must be 0 < Gain < 1",
DoubleValue (0.1),
"Gain used in estimating the RTT (smoothed RTT), must be 0 < Gain < 1",
DoubleValue (0.125),
MakeDoubleAccessor (&RttMeanDeviation::m_gain),
MakeDoubleChecker<double> ())
.AddAttribute ("Gain2",
"Gain2 used in estimating the RTT (variance), must be 0 < Gain2 < 1",
DoubleValue (0.25),
MakeDoubleAccessor (&RttMeanDeviation::m_gain2),
MakeDoubleChecker<double> ())
;
return tid;
}
@@ -249,7 +273,7 @@ RttMeanDeviation::RttMeanDeviation() :
}
RttMeanDeviation::RttMeanDeviation (const RttMeanDeviation& c)
: RttEstimator (c), m_gain (c.m_gain), m_variance (c.m_variance)
: RttEstimator (c), m_gain (c.m_gain), m_gain2 (c.m_gain2), m_variance (c.m_variance)
{
NS_LOG_FUNCTION (this);
}
@@ -263,14 +287,15 @@ void RttMeanDeviation::Measurement (Time m)
double gErr = err.ToDouble (Time::S) * m_gain;
m_currentEstimatedRtt += Time::FromDouble (gErr, Time::S);
Time difference = Abs (err) - m_variance;
NS_LOG_DEBUG ("m_variance += " << Time::FromDouble (difference.ToDouble (Time::S) * m_gain, Time::S));
m_variance += Time::FromDouble (difference.ToDouble (Time::S) * m_gain, Time::S);
NS_LOG_DEBUG ("m_variance += " << Time::FromDouble (difference.ToDouble (Time::S) * m_gain2, Time::S));
m_variance += Time::FromDouble (difference.ToDouble (Time::S) * m_gain2, Time::S);
}
else
{ // First sample
m_currentEstimatedRtt = m; // Set estimate to current
//variance = sample / 2; // And variance to current / 2
m_variance = m; // try this
// m_variance = m; // try this why????
m_variance = Seconds (m.ToDouble (Time::S) / 2);
NS_LOG_DEBUG ("(first sample) m_variance += " << m);
}
m_nSamples++;
@@ -279,17 +304,29 @@ void RttMeanDeviation::Measurement (Time m)
Time RttMeanDeviation::RetransmitTimeout ()
{
NS_LOG_FUNCTION (this);
NS_LOG_DEBUG ("RetransmitTimeout: var " << m_variance.GetSeconds () << " est " << m_currentEstimatedRtt.GetSeconds () << " multiplier " << m_multiplier);
// RTO = srtt + 4* rttvar
int64_t temp = m_currentEstimatedRtt.ToInteger (Time::MS) + 4 * m_variance.ToInteger (Time::MS);
if (temp < m_minRto.ToInteger (Time::MS))
{
temp = m_minRto.ToInteger (Time::MS);
}
temp = temp * m_multiplier; // Apply backoff
Time retval = Time::FromInteger (temp, Time::MS);
NS_LOG_DEBUG ("RetransmitTimeout: return " << retval.GetSeconds ());
return (retval);
// If not enough samples, just return 2 times estimate
//if (nSamples < 2) return est * 2;
double retval = std::min (m_maxRto.ToDouble (Time::S),
std::max (m_minRto.ToDouble (Time::S),
m_currentEstimatedRtt.ToDouble (Time::S) + 4 * m_variance.ToDouble (Time::S)));
// NS_LOG_DEBUG ("RetransmitTimeout: var " << var << " est " << m_currentEstimatedRtt.ToDouble (Time::S) << " multiplier " << m_multiplier);
// if (var < (m_currentEstimatedRtt.ToDouble (Time::S) / 4.0) )
// {
// for (uint16_t i = 0; i < 2* m_multiplier; i++)
// {
// retval += m_currentEstimatedRtt;
// }
// }
// else
// {
// int64_t temp = m_currentEstimatedRtt.ToInteger (Time::S) + 4 * m_variance.ToInteger (Time::S);
// retval = Time::FromInteger (temp, Time::S);
// }
NS_LOG_DEBUG ("RetransmitTimeout: return " << retval);
return Seconds (retval);
}
Ptr<RttEstimator> RttMeanDeviation::Copy () const
+14
View File
@@ -124,6 +124,18 @@ public:
*/
Time GetMinRto (void) const;
/**
* \brief Sets the Maximum RTO.
* \param minRto The maximum RTO returned by the estimator.
*/
void SetMaxRto (Time maxRto);
/**
* \brief Get the Maximum RTO.
* \return The maximum RTO returned by the estimator.
*/
Time GetMaxRto (void) const;
/**
* \brief Sets the current RTT estimate (forcefully).
* \param estimate The current RTT estimate.
@@ -145,6 +157,7 @@ private:
protected:
Time m_currentEstimatedRtt; // Current estimate
Time m_minRto; // minimum value of the timeout
Time m_maxRto; // maximum value of the timeout
uint32_t m_nSamples; // Number of samples
uint16_t m_multiplier; // RTO Multiplier
};
@@ -194,6 +207,7 @@ public:
private:
double m_gain; // Filter gain
double m_gain2; // Filter gain
Time m_variance; // Current variance
};
} // namespace ns3
+2 -2
View File
@@ -132,12 +132,12 @@ TcpL4Protocol::NotifyNewAggregate ()
// need to keep track of whether we are connected to an IPv4 or
// IPv6 lower layer and call the appropriate one.
if (ipv4 != 0)
if (ipv4 != 0 && m_downTarget.IsNull ())
{
ipv4->Insert(this);
this->SetDownTarget(MakeCallback(&Ipv4::Send, ipv4));
}
if (ipv6 != 0)
if (ipv6 != 0 && m_downTarget6.IsNull ())
{
ipv6->Insert(this);
this->SetDownTarget6(MakeCallback(&Ipv6L3Protocol::Send, ipv6));
+5 -2
View File
@@ -88,6 +88,7 @@ UdpL4Protocol::SetNode (Ptr<Node> node)
void
UdpL4Protocol::NotifyNewAggregate ()
{
NS_LOG_FUNCTION (this);
Ptr<Node> node = this->GetObject<Node> ();
Ptr<Ipv4> ipv4 = this->GetObject<Ipv4> ();
Ptr<Ipv6L3Protocol> ipv6 = node->GetObject<Ipv6L3Protocol> ();
@@ -108,12 +109,12 @@ UdpL4Protocol::NotifyNewAggregate ()
// need to keep track of whether we are connected to an IPv4 or
// IPv6 lower layer and call the appropriate one.
if (ipv4 != 0)
if (ipv4 != 0 && m_downTarget.IsNull())
{
ipv4->Insert (this);
this->SetDownTarget (MakeCallback (&Ipv4::Send, ipv4));
}
if (ipv6 != 0)
if (ipv6 != 0 && m_downTarget6.IsNull())
{
ipv6->Insert (this);
this->SetDownTarget6 (MakeCallback (&Ipv6L3Protocol::Send, ipv6));
@@ -499,6 +500,7 @@ UdpL4Protocol::Send (Ptr<Packet> packet,
void
UdpL4Protocol::SetDownTarget (IpL4Protocol::DownTargetCallback callback)
{
NS_LOG_FUNCTION (this);
m_downTarget = callback;
}
@@ -511,6 +513,7 @@ UdpL4Protocol::GetDownTarget (void) const
void
UdpL4Protocol::SetDownTarget6 (IpL4Protocol::DownTargetCallback6 callback)
{
NS_LOG_FUNCTION (this);
m_downTarget6 = callback;
}
+1
View File
@@ -280,6 +280,7 @@ def build(bld):
'helper/ipv6-interface-container.h',
'helper/ipv6-routing-helper.h',
'model/ipv6-address-generator.h',
'model/rtt-estimator.h',
]
if bld.env['NSC_ENABLED']:
+4 -4
View File
@@ -596,15 +596,15 @@ usable by user :math:`i` on resource block :math:`k` according to what reported
model (see `Adaptive Modulation and Coding`_); finally, let :math:`S(M, B)` be the TB
size in bits as defined in [TS36213]_ for the case where a number :math:`B` of
resource blocks is used. The achievable rate :math:`R_{i}(k,t)` in bit/s for user :math:`i`
on resource block :math:`k` at subframe :math:`t` is defined as
on resource block group :math:`k` at subframe :math:`t` is defined as
.. math::
R_{i}(k,t) = \frac{S\left( M_{i,k}(t), 1\right)}{\tau}
where :math:`\tau` is the TTI duration.
At the start of each subframe :math:`t`, each RB is assigned to a certain user.
In detail, the index :math:`\widehat{i}_{k}(t)` to which RB :math:`k` is assigned at time
At the start of each subframe :math:`t`, each RBG is assigned to a certain user.
In detail, the index :math:`\widehat{i}_{k}(t)` to which RBG :math:`k` is assigned at time
:math:`t` is determined as
.. math::
@@ -637,7 +637,7 @@ determine the MCS :math:`\widehat{M}_j(t)` actually used by user
\widehat{M}_j(t) = \min_{k: \widehat{i}_{k}(t) = j}{M_{j,k}(t)}
then we determine the total number :math:`\widehat{B}_j(t)` of RBs allocated to user
then we determine the total number :math:`\widehat{B}_j(t)` of RBGs allocated to user
:math:`j`:
.. math::
+4
View File
@@ -21,6 +21,10 @@
.. [R1-081483] 3GPP R1-081483 `Conveying MCS and TB size via PDCCH <http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip>`_
.. [R4-092042] 3GPP R4-092042 "Simulation assumptions and parameters for FDD HeNB RF requirements"
.. [TR36814] 3GPP TR 36.814 "E-UTRA Further advancements for E-UTRA physical layer aspects"
.. [FFAPI] `FemtoForum LTE MAC Scheduler Interface Specification v1.11 <http://www.femtoforum.org/femto/technical.php>`_
.. [ns3tutorial] `The ns-3 Tutorial <http://www.nsnam.org/docs/tutorial/singlehtml/index.html>`_
+2 -2
View File
@@ -368,7 +368,7 @@ Physical Error Model
--------------------
The test suite ``lte-phy-error-model`` generates nine test cases with single eNB and a various number of UEs, all having the same Radio Bearer specification. Each test is designed for evaluating the error rate perceived by a specific TB size in order to verify that it corresponds to the expected values according to the BLER generated for CB size analog to the TB size. This means that, for instance, the test will check that the performance of a TB of :math:`N` bits is analogous to the one of a a CB size of :math:`N` bits by collecting the performance of a user which has been forced the generation of a such TB size according to the distance to eNB. In order to significantly test the BER at MAC level, we modified the Adaptive Modulation and Coding (AMC) module, the ``LteAmc`` class, for making it less robust to channel conditions by adding a configurable BER parameter (called ``Ber`` in the ns3 attribute system) which enable the selection of the desired BER at MAC level when choosing the MCS to be used. In detail, the AMC module has been forced to select the AMC considering a BER of 0.01 (instead of the standard value equal to 0.00005). We note that, these values do not reflect actual BER since they come from an analytical bound which do not consider all the transmission chain aspects; therefore the resulted BER might be different.
The test suite ``lte-test-phy-error-model`` generates nine test cases with single eNB and a various number of UEs, all having the same Radio Bearer specification. Each test is designed for evaluating the error rate perceived by a specific TB size in order to verify that it corresponds to the expected values according to the BLER generated for CB size analog to the TB size. This means that, for instance, the test will check that the performance of a TB of :math:`N` bits is analogous to the one of a a CB size of :math:`N` bits by collecting the performance of a user which has been forced the generation of a such TB size according to the distance to eNB. In order to significantly test the BER at MAC level, we modified the Adaptive Modulation and Coding (AMC) module, the ``LteAmc`` class, for making it less robust to channel conditions by adding a configurable BER parameter (called ``Ber`` in the ns3 attribute system) which enable the selection of the desired BER at MAC level when choosing the MCS to be used. In detail, the AMC module has been forced to select the AMC considering a BER of 0.01 (instead of the standard value equal to 0.00005). We note that, these values do not reflect actual BER since they come from an analytical bound which do not consider all the transmission chain aspects; therefore the resulted BER might be different.
The parameters of the nine test cases are reported in the following:
@@ -403,7 +403,7 @@ The parameters of the nine test cases are reported in the following:
BLER for test 6.
The test verifies that in each case the expected number of packets received correct corresponds to a Bernoulli distribution with a confidence interval of 95%, where the probability of success in each trail is :math:`1-BER` and :math:`n` is the total number of packet sent.
The test verifies that in each case the obtained number of packets received correctly falls within the 95% confidence interval of a Binomial distribution where the parameter :math:`p` is equal to :math:`1-BER`, the parameter :math:`n` is the total number of packets sent and the parameter :math:`k` is the number of packets correctly received.
MIMO Model
+15 -2
View File
@@ -727,13 +727,26 @@ That's all! You can now start your simulation as usual::
Simulator::Run ();
Further Reading
---------------
Examples Programs
-----------------
The directory ``src/lte/examples/`` contains some example simulation programs that
show how to simulate different LTE scenarios.
Reference scenarios
-------------------
There is a vast amount of reference LTE simulation scenarios which can be found in the literature. Here we list some of them:
* The dual stripe model [R4-092042]_, which is partially implemented in the example program ``src/lte/examples/lena-dual-stripe.cc``
* The system simulation scenarios mentioned in section A.2 of [TR36814]_
+1 -1
View File
@@ -447,7 +447,7 @@ LteEnbPhy::StartSubFrame (void)
{
std::map <uint16_t, Ptr<LteUePhy> >::iterator it2;
Ptr<UlDciIdealControlMessage> dci = DynamicCast<UlDciIdealControlMessage> (msg);
QueueUlDci (*dci);
// QueueUlDci (*dci);
it2 = m_ueAttached.find (dci->GetDci ().m_rnti);
if (it2 == m_ueAttached.end ())
+3 -2
View File
@@ -507,7 +507,7 @@ PfFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sched
// no info on this subband -> worst MCS
mcs = 0;
}
achievableRate += ((m_amc->GetTbSizeFromMcs (mcs, 1) / 8) / 0.001); // = TB size / TTI
achievableRate += ((m_amc->GetTbSizeFromMcs (mcs, rbgSize) / 8) / 0.001); // = TB size / TTI
}
double rcqi = achievableRate / (*it).second.lastAveragedThroughput;
@@ -1191,6 +1191,7 @@ PfFfMacScheduler::RefreshUlCqiMaps(void)
void
PfFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size)
{
size = size - 2; // remove the minimum RLC overhead
std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
LteFlowId_t flow (rnti, lcid);
it = m_rlcBufferReq.find (flow);
@@ -1242,7 +1243,7 @@ void
PfFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
{
size = size - 2; // remove the minimum RLC overhead
std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti);
if (it!=m_ceBsrRxed.end ())
{
+2 -1
View File
@@ -972,6 +972,7 @@ RrFfMacScheduler::RefreshUlCqiMaps(void)
void
RrFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size)
{
size = size - 2; // remove the minimum RLC overhead
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
{
@@ -1021,7 +1022,7 @@ void
RrFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
{
size = size - 2; // remove the minimum RLC overhead
std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti);
if (it!=m_ceBsrRxed.end ())
{
+301
View File
@@ -0,0 +1,301 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010 Andrea Sacco
*
* 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: Andrea Sacco <andrea.sacco85@gmail.com>
*/
/**
* \file uan-animation.cc
* \ingroup uan
*
* This example showcases the "CW-MAC" described in System Design Considerations for Undersea Networks
* article in the IEEE Journal on Selected Areas of Communications 2008 by Nathan Parrish, Leonard Tracy
* and Sumit Roy. The MAC protocol is implemented in the class UanMacCw. CW-MAC is similar in nature
* to the IEEE 802.11 DCF with a constant backoff window. It requires two parameters to be set,
* the slot time and the contention window size. The contention window size is the backoff window
* size in slots, and the slot time is the duration of each slot. These parameters should be set
* according to the overall network size, internode spacing and the number of nodes in the network.
*
* This example deploys nodes randomly (according to RNG seed of course) in a finite square region with
* the X and Y coordinates of the nodes distributed uniformly. The CW parameter is varied throughout
* the simulation in order to show the variation in throughput with respect to changes in CW.
*/
#include "uan-animation.h"
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/netanim-module.h"
#include "ns3/mobility-module.h"
#include "ns3/tools-module.h"
#include "ns3/applications-module.h"
#include <fstream>
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("UanCwExample");
NetAnimExperiment::NetAnimExperiment ()
: m_numNodes (15),
m_dataRate (80),
m_depth (70),
m_boundary (500),
m_packetSize (32),
m_bytesTotal (0),
m_cwMin (10),
m_cwMax (400),
m_cwStep (10),
m_avgs (3),
m_slotTime (Seconds (0.2)),
m_simTime (Seconds (1000))
{
}
void
NetAnimExperiment::ResetData ()
{
NS_LOG_DEBUG (Simulator::Now ().GetSeconds () << " Resetting data");
m_throughputs.push_back (m_bytesTotal * 8.0 / m_simTime.GetSeconds ());
m_bytesTotal = 0;
}
void
NetAnimExperiment::IncrementCw (uint32_t cw)
{
NS_ASSERT (m_throughputs.size () == m_avgs);
double avgThroughput = 0.0;
for (uint32_t i=0; i<m_avgs; i++)
{
avgThroughput += m_throughputs[i];
}
avgThroughput /= m_avgs;
m_throughputs.clear ();
Config::Set ("/NodeList/*/DeviceList/*/Mac/CW", UintegerValue (cw + m_cwStep));
SeedManager::SetRun (SeedManager::GetRun () + 1);
NS_LOG_DEBUG ("Average for cw=" << cw << " over " << m_avgs << " runs: " << avgThroughput);
}
void
NetAnimExperiment::UpdatePositions (NodeContainer &nodes)
{
NS_LOG_DEBUG (Simulator::Now ().GetSeconds () << " Updating positions");
NodeContainer::Iterator it = nodes.Begin ();
UniformVariable uv (0, m_boundary);
for (; it != nodes.End (); it++)
{
Ptr<MobilityModel> mp = (*it)->GetObject<MobilityModel> ();
mp->SetPosition (Vector (uv.GetValue (), uv.GetValue (), 70.0));
}
}
void
NetAnimExperiment::ReceivePacket (Ptr<Socket> socket)
{
Ptr<Packet> packet;
while ((packet = socket->Recv ()))
{
m_bytesTotal += packet->GetSize ();
}
packet = 0;
}
void
NetAnimExperiment::Run (UanHelper &uan)
{
uan.SetMac ("ns3::UanMacCw", "CW", UintegerValue (m_cwMin), "SlotTime", TimeValue (m_slotTime));
NodeContainer nc = NodeContainer ();
NodeContainer sink = NodeContainer ();
nc.Create (m_numNodes);
sink.Create (1);
PacketSocketHelper socketHelper;
socketHelper.Install (nc);
socketHelper.Install (sink);
#ifdef UAN_PROP_BH_INSTALLED
Ptr<UanPropModelBh> prop = CreateObjectWithAttributes<UanPropModelBh> ("ConfigFile", StringValue ("exbhconfig.cfg"));
#else
Ptr<UanPropModelIdeal> prop = CreateObjectWithAttributes<UanPropModelIdeal> ();
#endif //UAN_PROP_BH_INSTALLED
Ptr<UanChannel> channel = CreateObjectWithAttributes<UanChannel> ("PropagationModel", PointerValue (prop));
//Create net device and nodes with UanHelper
NetDeviceContainer devices = uan.Install (nc, channel);
NetDeviceContainer sinkdev = uan.Install (sink, channel);
MobilityHelper mobility;
Ptr<ListPositionAllocator> pos = CreateObject<ListPositionAllocator> ();
{
UniformVariable urv (0, m_boundary);
pos->Add (Vector (m_boundary / 2.0, m_boundary / 2.0, m_depth));
double rsum = 0;
double minr = 2 * m_boundary;
for (uint32_t i = 0; i < m_numNodes; i++)
{
double x = urv.GetValue ();
double y = urv.GetValue ();
double newr = sqrt ((x - m_boundary / 2.0) * (x - m_boundary / 2.0)
+ (y - m_boundary / 2.0) * (y - m_boundary / 2.0));
rsum += newr;
minr = std::min (minr, newr);
pos->Add (Vector (x, y, m_depth));
}
NS_LOG_DEBUG ("Mean range from gateway: " << rsum / m_numNodes
<< " min. range " << minr);
mobility.SetPositionAllocator (pos);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (sink);
NS_LOG_DEBUG ("Position of sink: "
<< sink.Get (0)->GetObject<MobilityModel> ()->GetPosition ());
mobility.Install (nc);
PacketSocketAddress socket;
socket.SetSingleDevice (sinkdev.Get (0)->GetIfIndex ());
socket.SetPhysicalAddress (sinkdev.Get (0)->GetAddress ());
socket.SetProtocol (0);
OnOffHelper app ("ns3::PacketSocketFactory", Address (socket));
app.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
app.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
app.SetAttribute ("DataRate", DataRateValue (m_dataRate));
app.SetAttribute ("PacketSize", UintegerValue (m_packetSize));
ApplicationContainer apps = app.Install (nc);
apps.Start (Seconds (0.5));
Time nextEvent = Seconds (0.5);
for (uint32_t cw = m_cwMin; cw <= m_cwMax; cw += m_cwStep)
{
for (uint32_t an = 0; an < m_avgs; an++)
{
nextEvent += m_simTime;
Simulator::Schedule (nextEvent, &NetAnimExperiment::ResetData, this);
Simulator::Schedule (nextEvent, &NetAnimExperiment::UpdatePositions, this, nc);
}
Simulator::Schedule (nextEvent, &NetAnimExperiment::IncrementCw, this, cw);
}
apps.Stop (nextEvent + m_simTime);
Ptr<Node> sinkNode = sink.Get (0);
TypeId psfid = TypeId::LookupByName ("ns3::PacketSocketFactory");
if (sinkNode->GetObject<SocketFactory> (psfid) == 0)
{
Ptr<PacketSocketFactory> psf = CreateObject<PacketSocketFactory> ();
sinkNode->AggregateObject (psf);
}
Ptr<Socket> sinkSocket = Socket::CreateSocket (sinkNode, psfid);
sinkSocket->Bind (socket);
sinkSocket->SetRecvCallback (MakeCallback (&NetAnimExperiment::ReceivePacket, this));
m_bytesTotal = 0;
std::string traceFileName = "uan-animation.xml";
AnimationInterface anim(traceFileName.c_str ());
Simulator::Run ();
sinkNode = 0;
sinkSocket = 0;
pos = 0;
channel = 0;
prop = 0;
for (uint32_t i=0; i < nc.GetN (); i++)
{
nc.Get (i) = 0;
}
for (uint32_t i=0; i < sink.GetN (); i++)
{
sink.Get (i) = 0;
}
for (uint32_t i=0; i < devices.GetN (); i++)
{
devices.Get (i) = 0;
}
for (uint32_t i=0; i < sinkdev.GetN (); i++)
{
sinkdev.Get (i) = 0;
}
Simulator::Destroy ();
}
}
int
main (int argc, char **argv)
{
LogComponentEnable ("UanCwExample", LOG_LEVEL_ALL);
LogComponentEnable ("AnimationInterface", LOG_LEVEL_ALL);
NetAnimExperiment exp;
std::string perModel = "ns3::UanPhyPerGenDefault";
std::string sinrModel = "ns3::UanPhyCalcSinrDefault";
CommandLine cmd;
cmd.AddValue ("NumNodes", "Number of transmitting nodes", exp.m_numNodes);
cmd.AddValue ("Depth", "Depth of transmitting and sink nodes", exp.m_depth);
cmd.AddValue ("RegionSize", "Size of boundary in meters", exp.m_boundary);
cmd.AddValue ("PacketSize", "Generated packet size in bytes", exp.m_packetSize);
cmd.AddValue ("DataRate", "DataRate in bps", exp.m_dataRate);
cmd.AddValue ("CwMin", "Min CW to simulate", exp.m_cwMin);
cmd.AddValue ("CwMax", "Max CW to simulate", exp.m_cwMax);
cmd.AddValue ("SlotTime", "Slot time duration", exp.m_slotTime);
cmd.AddValue ("Averages", "Number of topologies to test for each cw point", exp.m_avgs);
cmd.AddValue ("PerModel", "PER model name", perModel);
cmd.AddValue ("SinrModel", "SINR model name", sinrModel);
cmd.Parse (argc, argv);
ObjectFactory obf;
obf.SetTypeId (perModel);
Ptr<UanPhyPer> per = obf.Create<UanPhyPer> ();
obf.SetTypeId (sinrModel);
Ptr<UanPhyCalcSinr> sinr = obf.Create<UanPhyCalcSinr> ();
UanHelper uan;
UanTxMode mode;
mode = UanTxModeFactory::CreateMode (UanTxMode::FSK, exp.m_dataRate,
exp.m_dataRate, 12000,
exp.m_dataRate, 2,
"Default mode");
UanModesList myModes;
myModes.AppendMode (mode);
uan.SetPhy ("ns3::UanPhyGen",
"PerModel", PointerValue (per),
"SinrModel", PointerValue (sinr),
"SupportedModes", UanModesListValue (myModes));
exp.Run (uan);
per = 0;
sinr = 0;
}
+62
View File
@@ -0,0 +1,62 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010 Andrea Sacco
*
* 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: Andrea Sacco <andrea.sacco85@gmail.com>
*/
#ifndef UAN_CW_EXAMPLE_H
#define UAN_CW_EXAMPLE_H
#include "ns3/network-module.h"
#include "ns3/tools-module.h"
#include "ns3/uan-module.h"
using namespace ns3;
/**
* \class NetAnimExperiment
* \brief Helper class for UAN CW MAC example
*
*/
class NetAnimExperiment
{
public:
void Run (UanHelper &uan);
void ReceivePacket (Ptr<Socket> socket);
void UpdatePositions (NodeContainer &nodes);
void ResetData ();
void IncrementCw (uint32_t cw);
uint32_t m_numNodes;
uint32_t m_dataRate;
double m_depth;
double m_boundary;
uint32_t m_packetSize;
uint32_t m_bytesTotal;
uint32_t m_cwMin;
uint32_t m_cwMax;
uint32_t m_cwStep;
uint32_t m_avgs;
Time m_slotTime;
Time m_simTime;
std::vector<double> m_throughputs;
NetAnimExperiment ();
};
#endif /* UAN_CW_EXAMPLE_H */
+4
View File
@@ -16,3 +16,7 @@ def build(bld):
obj = bld.create_ns3_program('wireless-animation',
['netanim', 'applications', 'point-to-point', 'csma', 'wifi', 'mobility', 'network'])
obj.source = 'wireless-animation.cc'
obj = bld.create_ns3_program('uan-animation',
['netanim', 'internet', 'mobility', 'tools', 'applications', 'uan'])
obj.source = 'uan-animation.cc'
+64 -6
View File
@@ -37,6 +37,8 @@
#include "ns3/constant-position-mobility-model.h"
#include "ns3/lte-ue-phy.h"
#include "ns3/lte-enb-phy.h"
#include "ns3/uan-net-device.h"
#include "ns3/uan-mac.h"
#include <stdio.h>
#include <unistd.h>
@@ -48,8 +50,6 @@
NS_LOG_COMPONENT_DEFINE ("AnimationInterface");
namespace ns3 {
#define PURGE_INTERVAL 5
@@ -161,6 +161,11 @@ bool AnimationInterface::IsInTimeWindow ()
return false;
}
bool AnimationInterface::UanPacketIsPending (uint64_t AnimUid)
{
return (m_pendingUanPackets.find (AnimUid) != m_pendingUanPackets.end ());
}
bool AnimationInterface::WifiPacketIsPending (uint64_t AnimUid)
{
return (m_pendingWifiPackets.find (AnimUid) != m_pendingWifiPackets.end ());
@@ -547,6 +552,10 @@ void AnimationInterface::ConnectCallbacks ()
MakeCallback (&AnimationInterface::CsmaPhyRxEndTrace, this));
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/MacRx",
MakeCallback (&AnimationInterface::CsmaMacRxTrace, this));
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::UanNetDevice/Phy/PhyTxBegin",
MakeCallback (&AnimationInterface::UanPhyGenTxTrace, this));
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::UanNetDevice/Phy/PhyRxBegin",
MakeCallback (&AnimationInterface::UanPhyGenRxTrace, this));
ConnectLte ();
@@ -679,11 +688,13 @@ void AnimationInterface::WriteDummyPacket ()
}
void AnimationInterface::DevTxTrace (std::string context, Ptr<const Packet> p,
void AnimationInterface::DevTxTrace (std::string context,
uint32_t, // channel
Ptr<const Packet> p,
Ptr<NetDevice> tx, Ptr<NetDevice> rx,
Time txTime, Time rxTime)
{
if (!m_started)
if (!m_started || !IsInTimeWindow ())
return;
NS_ASSERT (tx);
NS_ASSERT (rx);
@@ -729,6 +740,12 @@ AnimationInterface::GetNetDeviceFromContext (std::string context)
NS_ASSERT (n);
return n->GetDevice (atoi (elements[3].c_str ()));
}
void AnimationInterface::AddPendingUanPacket (uint64_t AnimUid, AnimPacketInfo &pktinfo)
{
m_pendingUanPackets[AnimUid] = pktinfo;
}
void AnimationInterface::AddPendingWifiPacket (uint64_t AnimUid, AnimPacketInfo &pktinfo)
{
@@ -778,6 +795,47 @@ uint64_t AnimationInterface::GetAnimUidFromPacket (Ptr <const Packet> p)
}
}
void AnimationInterface::UanPhyGenTxTrace (std::string context, Ptr<const Packet> p)
{
if (!m_started || !IsInTimeWindow ())
return;
Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
NS_ASSERT (ndev);
Ptr <Node> n = ndev->GetNode ();
NS_ASSERT (n);
gAnimUid++;
NS_LOG_INFO ("Uan TxBeginTrace for packet:" << gAnimUid);
AnimByteTag tag;
tag.Set (gAnimUid);
p->AddByteTag (tag);
AnimPacketInfo pktinfo (ndev, Simulator::Now (), Simulator::Now (), UpdatePosition (n));
AddPendingUanPacket (gAnimUid, pktinfo);
}
void AnimationInterface::UanPhyGenRxTrace (std::string context, Ptr<const Packet> p)
{
if (!m_started || !IsInTimeWindow ())
return;
Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
NS_ASSERT (ndev);
Ptr <Node> n = ndev->GetNode ();
NS_ASSERT (n);
uint64_t AnimUid = GetAnimUidFromPacket (p);
NS_LOG_INFO ("UanPhyGenRxTrace for packet:" << AnimUid);
if (!UanPacketIsPending (AnimUid))
{
NS_LOG_WARN ("UanPhyGenRxBeginTrace: unknown Uid");
return;
}
m_pendingUanPackets[AnimUid].ProcessRxBegin (ndev, Simulator::Now ());
m_pendingUanPackets[AnimUid].ProcessRxEnd (ndev, Simulator::Now (), UpdatePosition (n));
OutputWirelessPacket (p, m_pendingUanPackets[AnimUid], m_pendingUanPackets[AnimUid].GetRxInfo (ndev));
}
void AnimationInterface::WifiPhyTxBeginTrace (std::string context,
Ptr<const Packet> p)
{
@@ -789,7 +847,7 @@ void AnimationInterface::WifiPhyTxBeginTrace (std::string context,
NS_ASSERT (n);
// Add a new pending wireless
gAnimUid++;
NS_LOG_INFO ("TxBeginTrace for packet:" << gAnimUid);
NS_LOG_INFO ("Wifi TxBeginTrace for packet:" << gAnimUid);
AnimByteTag tag;
tag.Set (gAnimUid);
p->AddByteTag (tag);
@@ -833,7 +891,7 @@ void AnimationInterface::WifiPhyRxBeginTrace (std::string context,
Ptr <Node> n = ndev->GetNode ();
NS_ASSERT (n);
uint64_t AnimUid = GetAnimUidFromPacket (p);
NS_LOG_INFO ("RxBeginTrace for packet:" << AnimUid);
NS_LOG_INFO ("Wifi RxBeginTrace for packet:" << AnimUid);
if (!WifiPacketIsPending (AnimUid))
{
NS_LOG_WARN ("WifiPhyRxBeginTrace: unknown Uid");
+12 -1
View File
@@ -36,6 +36,7 @@
#include "ns3/mac48-address.h"
#include "ns3/lte-ue-net-device.h"
#include "ns3/lte-enb-net-device.h"
#include "ns3/uan-phy-gen.h"
namespace ns3 {
@@ -264,7 +265,8 @@ private:
std::string m_originalFileName;
void DevTxTrace (std::string context,
Ptr<const Packet> p,
uint32_t,
Ptr<const Packet> p,
Ptr<NetDevice> tx,
Ptr<NetDevice> rx,
Time txTime,
@@ -311,6 +313,11 @@ private:
void LteSpectrumPhyRxStart (std::string context,
Ptr<const PacketBurst> pb);
void UanPhyGenTxTrace (std::string context,
Ptr<const Packet>);
void UanPhyGenRxTrace (std::string context,
Ptr<const Packet>);
void MobilityCourseChangeTrace (Ptr <const MobilityModel> mob);
// Write a string to the specified handle;
@@ -337,6 +344,10 @@ private:
void AddPendingCsmaPacket (uint64_t AnimUid, AnimPacketInfo&);
bool CsmaPacketIsPending (uint64_t AnimUid);
std::map<uint64_t, AnimPacketInfo> m_pendingUanPackets;
void AddPendingUanPacket (uint64_t AnimUid, AnimPacketInfo&);
bool UanPacketIsPending (uint64_t AnimUid);
uint64_t GetAnimUidFromPacket (Ptr <const Packet>);
std::map<uint32_t, Vector> m_nodeLocation;
+1 -6
View File
@@ -8,7 +8,7 @@ NETANIM_RELEASE_NAME = "netanim-3.100"
def build (bld) :
bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/netanim-config.h')
module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma', 'lte'])
module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma', 'lte', 'uan'])
module.includes = '.'
module.source = [
'model/animation-interface.cc',
@@ -29,8 +29,3 @@ def build (bld) :
if (bld.env['ENABLE_EXAMPLES']) :
bld.add_subdirs ('examples')
def configure (conf) :
conf.check (header_name='sys/socket.h', define_name='HAVE_SYS_SOCKET_H')
conf.check (header_name='netinet/in.h', define_name='HAVE_NETINET_IN_H')
conf.write_config_header ('ns3/netanim-config.h', top=True)
+165
View File
@@ -0,0 +1,165 @@
Queues
------
.. heading hierarchy:
------------- Chapter
************* Section (#.#)
============= Subsection (#.#.#)
############# Paragraph (no number)
This section documents a few queue objects, typically associated with
NetDevice models, that are maintained as part of the ``network`` module:
* DropTail
* Random Early Detection
Model Description
*****************
The source code for the new module lives in the directory ``src/network/utils``.
ns-3 provides a couple of classic queue models and the ability to
trace certain queue operations such as enqueuing, dequeuing, and dropping.
These may be added to certain NetDevice objects that take a Ptr<Queue>
pointer.
Note that not all device models use these queue models.
In particular, WiFi, WiMax, and LTE use specialized device queues.
The queue models described here are more often used with simpler ns-3
device models such as PointToPoint and Csma.
Design
======
An abstract base class, class Queue, is typically used and subclassed
for specific scheduling and drop policies. Common operations
include:
* ``bool Enqueue (Ptr<Packet> p)``: Enqueue a packet
* ``Ptr<Packet> Dequeue (void)``: Dequeue a packet
* ``uint32_t GetNPackets (void)``: Get the queue depth, in packets
* ``uint32_t GetNBytes (void)``: Get the queue depth, in packets
as well as tracking some statistics on queue operations.
There are three trace sources that may be hooked:
* ``Enqueue``
* ``Dequeue``
* ``Drop``
DropTail
########
This is a basic first-in-first-out (FIFO) queue that performs a tail drop
when the queue is full.
Random Early Detection
######################
Random Early Detection (RED) is a queue variant that aims to provide
early signals to transport protocol congestion control (e.g. TCP) that
congestion is imminent, so that they back off their rate gracefully
rather than with a bunch of tail-drop losses (possibly incurring
TCP timeout). The model in ns-3 is a port of Sally Floyd's ns-2
RED model.
Scope and Limitations
=====================
The RED model just supports default RED. Adaptive RED is not supported.
References
==========
The RED queue aims to be close to the results cited in:
S.Floyd, K.Fall http://icir.org/floyd/papers/redsims.ps
Usage
*****
Helpers
=======
A typical usage pattern is to create a device helper and to configure
the queue type and attributes from the helper, such as this example
from ``src/network/examples/red-tests.cc``:
::
PointToPointHelper p2p;
p2p.SetQueue ("ns3::DropTailQueue");
p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
p2p.SetChannelAttribute ("Delay", StringValue ("2ms"));
NetDeviceContainer devn0n2 = p2p.Install (n0n2);
p2p.SetQueue ("ns3::DropTailQueue");
p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
p2p.SetChannelAttribute ("Delay", StringValue ("3ms"));
NetDeviceContainer devn1n2 = p2p.Install (n1n2);
p2p.SetQueue ("ns3::RedQueue", // only backbone link has RED queue
"LinkBandwidth", StringValue (redLinkDataRate),
"LinkDelay", StringValue (redLinkDelay));
p2p.SetDeviceAttribute ("DataRate", StringValue (redLinkDataRate));
p2p.SetChannelAttribute ("Delay", StringValue (redLinkDelay));
NetDeviceContainer devn2n3 = p2p.Install (n2n3);
Attributes
==========
The RED queue contains a number of attributes that control the RED
policies:
* Mode (bytes or packets)
* MeanPktSize
* IdlePktSize
* Wait (time)
* Gentle mode
* MinTh, MaxTh
* QueueLimit
* Queue weight
* LInterm
* LinkBandwidth
* LinkDelay
Consult the ns-3 documentation for explanation of these attributes.
Output
======
The ns-3 ascii trace helpers used by many of the NetDevices will hook
the Enqueue, Dequeue, and Drop traces of these queues and print out
trace statements, such as the following from ``examples/udp/udp-echo.cc``:
::
+ 2 /NodeList/0/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader
( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1
dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 2 /NodeList/0/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader
( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1
dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
which shows an enqueue "+" and dequeue "-" event at time 2 seconds.
Users are, of course, free to define and hook their own trace sinks to
these trace sources.
Examples
========
The drop-tail queue is used in several examples, such as
``examples/udp/udp-echo.cc``. The RED queue example is found at
``src/network/examples/red-tests.cc``.
Validation
**********
The RED model has been validated and the report is currently stored
at: https://github.com/downloads/talau/ns-3-tcp-red/report-red-ns3.pdf
+36 -1
View File
@@ -248,6 +248,13 @@ public:
*/
void Write (Iterator start, Iterator end);
/**
* \return the byte read in the buffer.
*
* Read data, but do not advance the Iterator read.
*/
inline uint8_t PeekU8 (void);
/**
* \return the byte read in the buffer.
*
@@ -332,11 +339,21 @@ public:
* \param size number of bytes to copy
*
* Copy size bytes of data from the internal buffer to the
* input buffer and avance the Iterator by the number of
* input buffer and advance the Iterator by the number of
* bytes read.
*/
void Read (uint8_t *buffer, uint32_t size);
/**
* \param start start iterator of the buffer to copy data into
* \param size number of bytes to copy
*
* Copy size bytes of data from the internal buffer to the input buffer via
* the provided iterator and advance the Iterator by the number of bytes
* read.
*/
inline void Read (Iterator start, uint32_t size);
/**
* \brief Calculate the checksum.
* \param size size of the buffer.
@@ -813,6 +830,14 @@ Buffer::Iterator::ReadNtohU32 (void)
return retval;
}
uint8_t
Buffer::Iterator::PeekU8 (void)
{
uint8_t ret = ReadU8 ();
Prev ();
return ret;
}
uint8_t
Buffer::Iterator::ReadU8 (void)
{
@@ -851,6 +876,16 @@ Buffer::Iterator::ReadU16 (void)
return data;
}
void
Buffer::Iterator::Read (Buffer::Iterator start, uint32_t size)
{
Buffer::Iterator end = *this;
end.Next (size);
start.Write (*this, end);
}
Buffer::Buffer (Buffer const&o)
: m_data (o.m_data),
m_maxZeroAreaStart (o.m_zeroAreaStart),
+1 -1
View File
@@ -59,7 +59,7 @@ class Packet;
*
* If you want to write a new MAC layer, you need to subclass
* this base class and implement your own version of the
* NetDevice::SendTo method.
* pure virtual methods in this class.
*
* This class was designed to hide as many MAC-level details as
* possible from the perspective of layer 3 to allow a single layer 3
+1 -9
View File
@@ -2,23 +2,15 @@
import os
import Options
import Logs
from waflib.Errors import WafError
def options(opt):
opt.add_option('--with-openflow',
help=('Path to OFSID source for NS-3 OpenFlow Integration support'),
default='', dest='with_openflow')
opt.tool_options('boost', tooldir=["waf-tools"])
def configure(conf):
try:
conf.check_tool('boost')
conf.check_boost(lib='signals filesystem')
if not conf.env.LIB_BOOST:
conf.check_boost(lib='signals filesystem', libpath="/usr/lib64")
except WafError:
conf.env['LIB_BOOST'] = []
if not conf.env.LIB_BOOST:
conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False,
"Required boost libraries not found")
@@ -19,12 +19,16 @@
#include "point-to-point-channel.h"
#include "point-to-point-net-device.h"
#include "ns3/trace-source-accessor.h"
#include "ns3/point-to-point-loss-model.h"
#include "ns3/packet.h"
#include "ns3/simulator.h"
#include "ns3/log.h"
#include "ns3/pointer.h"
NS_LOG_COMPONENT_DEFINE ("PointToPointChannel");
#include "type-tag.h"
namespace ns3 {
NS_OBJECT_ENSURE_REGISTERED (PointToPointChannel);
@@ -39,9 +43,16 @@ PointToPointChannel::GetTypeId (void)
TimeValue (Seconds (0)),
MakeTimeAccessor (&PointToPointChannel::m_delay),
MakeTimeChecker ())
.AddAttribute ("LossModel", "Loss model",
PointerValue (0),
MakePointerAccessor (&PointToPointChannel::m_loss),
MakePointerChecker<PointToPointLossModel> ())
.AddTraceSource ("TxRxPointToPoint",
"Trace source indicating transmission of packet from the PointToPointChannel, used by the Animation interface.",
MakeTraceSourceAccessor (&PointToPointChannel::m_txrxPointToPoint))
.AddTraceSource ("DropPointToPoint",
"Trace source indicating dropping of packets in the PointToPointChannel.",
MakeTraceSourceAccessor (&PointToPointChannel::m_dropPointToPoint))
;
return tid;
}
@@ -58,6 +69,10 @@ PointToPointChannel::PointToPointChannel()
NS_LOG_FUNCTION_NOARGS ();
}
PointToPointChannel::~PointToPointChannel ()
{
}
void
PointToPointChannel::Attach (Ptr<PointToPointNetDevice> device)
{
@@ -93,12 +108,27 @@ PointToPointChannel::TransmitStart (
uint32_t wire = src == m_link[0].m_src ? 0 : 1;
// Ptr<const TypeTag> tag = p->PeekPacketTag<TypeTag> ();
// NS_LOG_DEBUG ("Packet tag is: " << tag);
// if (tag != 0 && tag->GetType () == TypeTag::DATA)
// {
if (m_loss != 0 && m_loss->IsLoss (p))
{
// drop packet
m_dropPointToPoint (GetId (), p, src, m_link[wire].m_dst, txTime, txTime + m_delay);
return false;
}
// }
// continue normal operations
Simulator::ScheduleWithContext (m_link[wire].m_dst->GetNode ()->GetId (),
txTime + m_delay, &PointToPointNetDevice::Receive,
m_link[wire].m_dst, p);
// Call the tx anim callback on the net device
m_txrxPointToPoint (p, src, m_link[wire].m_dst, txTime, txTime + m_delay);
m_txrxPointToPoint (GetId (), p, src, m_link[wire].m_dst, txTime, txTime + m_delay);
return true;
}
@@ -30,6 +30,7 @@ namespace ns3 {
class PointToPointNetDevice;
class Packet;
class PointToPointLossModel;
/**
* \ingroup point-to-point
@@ -57,6 +58,11 @@ public:
*/
PointToPointChannel ();
/**
* \brief Destructor
*/
~PointToPointChannel ();
/**
* \brief Attach a given netdevice to this channel
* \param device pointer to the netdevice to attach to the channel
@@ -128,6 +134,7 @@ private:
Time m_delay;
int32_t m_nDevices;
Ptr<PointToPointLossModel> m_loss;
/**
* The trace source for the packet transmission animation events that the
* device can fire.
@@ -137,13 +144,22 @@ private:
*
* @see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet>, // Packet being transmitted
TracedCallback<uint32_t, // channel ID
Ptr<const Packet>, // Packet being transmitted
Ptr<NetDevice>, // Transmitting NetDevice
Ptr<NetDevice>, // Receiving NetDevice
Time, // Amount of time to transmit the pkt
Time // Last bit receive time (relative to now)
> m_txrxPointToPoint;
TracedCallback<uint32_t, // channel ID
Ptr<const Packet>, // Packet being transmitted
Ptr<NetDevice>, // Transmitting NetDevice
Ptr<NetDevice>, // Receiving NetDevice
Time, // Amount of time to transmit the pkt
Time // Last bit receive time (relative to now)
> m_dropPointToPoint;
enum WireState
{
INITIALIZING,
@@ -0,0 +1,114 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005,2006,2007 INRIA
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "point-to-point-loss-model.h"
#include "ns3/log.h"
#include "ns3/boolean.h"
#include "ns3/double.h"
#include "ns3/pointer.h"
#include "ns3/packet.h"
#include <math.h>
NS_LOG_COMPONENT_DEFINE ("PointToPointLossModel");
namespace ns3 {
// ------------------------------------------------------------------------- //
NS_OBJECT_ENSURE_REGISTERED (PointToPointLossModel);
TypeId
PointToPointLossModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::PointToPointLossModel")
.SetParent<Object> ()
;
return tid;
}
PointToPointLossModel::PointToPointLossModel ()
: m_next (0)
{
}
PointToPointLossModel::~PointToPointLossModel ()
{
}
void
PointToPointLossModel::SetNext (Ptr<PointToPointLossModel> next)
{
m_next = next;
}
bool
PointToPointLossModel::IsLoss (Ptr<const Packet> pkt)
{
bool loss = DoIsLoss (pkt);
if (!loss && m_next != 0)
{
loss = m_next->IsLoss (pkt);
}
return loss;
}
// ------------------------------------------------------------------------- //
NS_OBJECT_ENSURE_REGISTERED (RandomPointToPointLossModel);
TypeId
RandomPointToPointLossModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::RandomPointToPointLossModel")
.SetParent<PointToPointLossModel> ()
.AddConstructor<RandomPointToPointLossModel> ()
.AddAttribute ("Variable", "The random variable used to pick a random los",
RandomVariableValue (UniformVariable ()),
MakeRandomVariableAccessor (&RandomPointToPointLossModel::m_variable),
MakeRandomVariableChecker ())
.AddAttribute ("Probability", "Loss probability",
DoubleValue (-1), // impossible
MakeDoubleAccessor (&RandomPointToPointLossModel::m_probability),
MakeDoubleChecker<double> ())
;
return tid;
}
RandomPointToPointLossModel::RandomPointToPointLossModel ()
: PointToPointLossModel ()
{
}
RandomPointToPointLossModel::~RandomPointToPointLossModel ()
{
}
bool
RandomPointToPointLossModel::DoIsLoss (Ptr<const Packet> pkt)
{
bool loss = (m_variable.GetValue () <= m_probability);
NS_LOG_DEBUG ("Loss: " << loss);
return loss;
}
// ------------------------------------------------------------------------- //
} // namespace ns3
@@ -0,0 +1,101 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005,2006,2007 INRIA
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef POINT_TO_POINT_LOSS_MODEL_H
#define POINT_TO_POINT_LOSS_MODEL_H
#include "ns3/object.h"
#include "ns3/random-variable.h"
#include "ns3/ptr.h"
namespace ns3 {
class Packet;
/**
* \defgroup point-to-point Loss Models
*
*/
/**
* \ingroup point-to-point
*
* \brief Model losses in point-to-point links
*/
class PointToPointLossModel : public Object
{
public:
static TypeId GetTypeId (void);
PointToPointLossModel ();
virtual ~PointToPointLossModel ();
/**
* \brief Enables a chain of loss models to act on the signal
* \param next The next PointToPointLossModel to add to the chain
*/
void
SetNext (Ptr<PointToPointLossModel> next);
/**
* \brief Decide whether or not packet should be lost
*/
bool
IsLoss (Ptr<const Packet> pkt);
private:
PointToPointLossModel (const PointToPointLossModel &o);
PointToPointLossModel &operator = (const PointToPointLossModel &o);
virtual bool
DoIsLoss (Ptr<const Packet> pkt) = 0;
Ptr<PointToPointLossModel> m_next;
};
/**
* \ingroup propagation
*
* \brief The propagation loss follows a random distribution.
*/
class RandomPointToPointLossModel : public PointToPointLossModel
{
public:
static TypeId GetTypeId (void);
RandomPointToPointLossModel ();
virtual ~RandomPointToPointLossModel ();
private:
RandomPointToPointLossModel (const RandomPointToPointLossModel &o);
RandomPointToPointLossModel & operator = (const RandomPointToPointLossModel &o);
virtual bool
DoIsLoss (Ptr<const Packet> pkt);
private:
RandomVariable m_variable;
double m_probability;
};
} // namespace ns3
#endif /* POINT_TO_POINT_LOSS_MODEL_H */
@@ -607,6 +607,7 @@ PointToPointNetDevice::PppToEther (uint16_t proto)
{
case 0x0021: return 0x0800; //IPv4
case 0x0057: return 0x86DD; //IPv6
case 0x0077: return 0x7777; //CCNx
default: NS_ASSERT_MSG (false, "PPP Protocol number not defined!");
}
return 0;
@@ -619,6 +620,7 @@ PointToPointNetDevice::EtherToPpp (uint16_t proto)
{
case 0x0800: return 0x0021; //IPv4
case 0x86DD: return 0x0057; //IPv6
case 0x7777: return 0x0077; //CCNx
default: NS_ASSERT_MSG (false, "PPP Protocol number not defined!");
}
return 0;
+3
View File
@@ -66,6 +66,9 @@ PppHeader::Print (std::ostream &os) const
case 0x0057: /* IPv6 */
proto = "IPv6 (0x0057)";
break;
case 0x0077: /* CCNx */
proto = "CCNx (0x0077)";
break;
default:
NS_ASSERT_MSG (false, "PPP Protocol number not defined!");
}
+92
View File
@@ -0,0 +1,92 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011 University of California, Los Angeles
*
* 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef TYPE_TAG_H
#define TYPE_TAG_H
#include <ns3/tag.h>
#include <ns3/type-id.h>
using namespace ns3;
class TypeTag : public Tag
{
public:
static TypeId GetTypeId (void)
{
static TypeId tid = TypeId ("TypeTag")
.SetParent<Tag> ()
;
return tid;
}
enum Type
{
DATA,
INTEREST,
DATA2,
INTEREST2
};
TypeTag (Type type)
: m_type (type)
{
}
Type GetType () const
{
return m_type;
}
virtual uint32_t GetSerializedSize (void) const
{
return 0;
}
virtual void Serialize (TagBuffer i) const
{
return;
}
virtual void Deserialize (TagBuffer i)
{
return;
}
virtual void Print (std::ostream &os) const
{
switch (m_type)
{
case DATA:
case DATA2:
os << "DATA";
break;
case INTEREST:
case INTEREST2:
os << "INTEREST";
break;
}
}
private:
Type m_type;
};
#endif // TYPE_TAG_H
+2
View File
@@ -7,6 +7,7 @@ def build(bld):
'model/point-to-point-net-device.cc',
'model/point-to-point-channel.cc',
'model/point-to-point-remote-channel.cc',
'model/point-to-point-loss-model.cc',
'model/ppp-header.cc',
'helper/point-to-point-helper.cc',
]
@@ -22,6 +23,7 @@ def build(bld):
'model/point-to-point-net-device.h',
'model/point-to-point-channel.h',
'model/point-to-point-remote-channel.h',
'model/point-to-point-loss-model.h',
'model/ppp-header.h',
'helper/point-to-point-helper.h',
]
@@ -78,6 +78,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::TopologyReader', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TopologyReader>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## nstime.h (module 'core'): ns3::Time [class]
@@ -87,7 +89,7 @@ def register_types(module):
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader [class]
module.add_class('TopologyReader', parent=root_module['ns3::Object'])
module.add_class('TopologyReader', parent=root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link [class]
module.add_class('Link', outer_class=root_module['ns3::TopologyReader'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
@@ -184,6 +186,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TopologyReader_methods(root_module, root_module['ns3::TopologyReader'])
@@ -374,9 +377,9 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
## ipv4-address.h (module 'network'): uint32_t const & ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t',
'uint32_t const &',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
@@ -1381,6 +1384,18 @@ def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > const & o) [copy constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter< ns3::TopologyReader > > const &', 'o')])
## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::Cleanup() [member function]
cls.add_method('Cleanup',
'void',
[],
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1561,11 +1576,6 @@ def register_Ns3TopologyReader_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::TopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## topology-reader.h (module 'topology-read'): std::_List_const_iterator<ns3::TopologyReader::Link> ns3::TopologyReader::LinksBegin() const [member function]
cls.add_method('LinksBegin',
'std::_List_const_iterator< ns3::TopologyReader::Link >',
@@ -1600,6 +1610,8 @@ def register_Ns3TopologyReader_methods(root_module, cls):
def register_Ns3TopologyReaderLink_methods(root_module, cls):
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::TopologyReader::Link const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TopologyReader::Link const &', 'arg0')])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link() [constructor]
cls.add_constructor([])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::Ptr<ns3::Node> fromPtr, std::string const & fromName, ns3::Ptr<ns3::Node> toPtr, std::string const & toName) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'fromPtr'), param('std::string const &', 'fromName'), param('ns3::Ptr< ns3::Node >', 'toPtr'), param('std::string const &', 'toName')])
## topology-reader.h (module 'topology-read'): std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::TopologyReader::Link::AttributesBegin() [member function]
@@ -1620,6 +1632,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'bool',
[param('std::string const &', 'name'), param('std::string &', 'value')],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetFromNetDevice() const [member function]
cls.add_method('GetFromNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetFromNode() const [member function]
cls.add_method('GetFromNode',
'ns3::Ptr< ns3::Node >',
@@ -1630,6 +1647,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetToNetDevice() const [member function]
cls.add_method('GetToNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetToNode() const [member function]
cls.add_method('GetToNode',
'ns3::Ptr< ns3::Node >',
@@ -1644,6 +1666,10 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string const &', 'name'), param('std::string const &', 'value')])
## topology-reader.h (module 'topology-read'): void ns3::TopologyReader::Link::SetNetDevices(ns3::Ptr<ns3::NetDevice> from, ns3::Ptr<ns3::NetDevice> to) [member function]
cls.add_method('SetNetDevices',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'from'), param('ns3::Ptr< ns3::NetDevice >', 'to')])
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
@@ -1834,11 +1860,6 @@ def register_Ns3EmptyAttributeValue_methods(root_module, cls):
return
def register_Ns3InetTopologyReader_methods(root_module, cls):
## inet-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::InetTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## inet-topology-reader.h (module 'topology-read'): ns3::InetTopologyReader::InetTopologyReader() [constructor]
cls.add_constructor([])
## inet-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::InetTopologyReader::Read() [member function]
@@ -2224,11 +2245,6 @@ def register_Ns3Node_methods(root_module, cls):
return
def register_Ns3OrbisTopologyReader_methods(root_module, cls):
## orbis-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::OrbisTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## orbis-topology-reader.h (module 'topology-read'): ns3::OrbisTopologyReader::OrbisTopologyReader() [constructor]
cls.add_constructor([])
## orbis-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::OrbisTopologyReader::Read() [member function]
@@ -2239,11 +2255,6 @@ def register_Ns3OrbisTopologyReader_methods(root_module, cls):
return
def register_Ns3RocketfuelTopologyReader_methods(root_module, cls):
## rocketfuel-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::RocketfuelTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::RocketfuelTopologyReader::RocketfuelTopologyReader() [constructor]
cls.add_constructor([])
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::RocketfuelTopologyReader::Read() [member function]
@@ -78,6 +78,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::TopologyReader', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TopologyReader>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## nstime.h (module 'core'): ns3::Time [class]
@@ -87,7 +89,7 @@ def register_types(module):
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader [class]
module.add_class('TopologyReader', parent=root_module['ns3::Object'])
module.add_class('TopologyReader', parent=root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link [class]
module.add_class('Link', outer_class=root_module['ns3::TopologyReader'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
@@ -184,6 +186,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TopologyReader_methods(root_module, root_module['ns3::TopologyReader'])
@@ -374,9 +377,9 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
## ipv4-address.h (module 'network'): uint32_t const & ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t',
'uint32_t const &',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
@@ -1381,6 +1384,18 @@ def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > const & o) [copy constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter< ns3::TopologyReader > > const &', 'o')])
## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::Cleanup() [member function]
cls.add_method('Cleanup',
'void',
[],
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1561,11 +1576,6 @@ def register_Ns3TopologyReader_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::TopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## topology-reader.h (module 'topology-read'): std::_List_const_iterator<ns3::TopologyReader::Link> ns3::TopologyReader::LinksBegin() const [member function]
cls.add_method('LinksBegin',
'std::_List_const_iterator< ns3::TopologyReader::Link >',
@@ -1600,6 +1610,8 @@ def register_Ns3TopologyReader_methods(root_module, cls):
def register_Ns3TopologyReaderLink_methods(root_module, cls):
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::TopologyReader::Link const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TopologyReader::Link const &', 'arg0')])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link() [constructor]
cls.add_constructor([])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::Ptr<ns3::Node> fromPtr, std::string const & fromName, ns3::Ptr<ns3::Node> toPtr, std::string const & toName) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'fromPtr'), param('std::string const &', 'fromName'), param('ns3::Ptr< ns3::Node >', 'toPtr'), param('std::string const &', 'toName')])
## topology-reader.h (module 'topology-read'): std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::TopologyReader::Link::AttributesBegin() [member function]
@@ -1620,6 +1632,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'bool',
[param('std::string const &', 'name'), param('std::string &', 'value')],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetFromNetDevice() const [member function]
cls.add_method('GetFromNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetFromNode() const [member function]
cls.add_method('GetFromNode',
'ns3::Ptr< ns3::Node >',
@@ -1630,6 +1647,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetToNetDevice() const [member function]
cls.add_method('GetToNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetToNode() const [member function]
cls.add_method('GetToNode',
'ns3::Ptr< ns3::Node >',
@@ -1644,6 +1666,10 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string const &', 'name'), param('std::string const &', 'value')])
## topology-reader.h (module 'topology-read'): void ns3::TopologyReader::Link::SetNetDevices(ns3::Ptr<ns3::NetDevice> from, ns3::Ptr<ns3::NetDevice> to) [member function]
cls.add_method('SetNetDevices',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'from'), param('ns3::Ptr< ns3::NetDevice >', 'to')])
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
@@ -1834,11 +1860,6 @@ def register_Ns3EmptyAttributeValue_methods(root_module, cls):
return
def register_Ns3InetTopologyReader_methods(root_module, cls):
## inet-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::InetTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## inet-topology-reader.h (module 'topology-read'): ns3::InetTopologyReader::InetTopologyReader() [constructor]
cls.add_constructor([])
## inet-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::InetTopologyReader::Read() [member function]
@@ -2224,11 +2245,6 @@ def register_Ns3Node_methods(root_module, cls):
return
def register_Ns3OrbisTopologyReader_methods(root_module, cls):
## orbis-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::OrbisTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## orbis-topology-reader.h (module 'topology-read'): ns3::OrbisTopologyReader::OrbisTopologyReader() [constructor]
cls.add_constructor([])
## orbis-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::OrbisTopologyReader::Read() [member function]
@@ -2239,11 +2255,6 @@ def register_Ns3OrbisTopologyReader_methods(root_module, cls):
return
def register_Ns3RocketfuelTopologyReader_methods(root_module, cls):
## rocketfuel-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::RocketfuelTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::RocketfuelTopologyReader::RocketfuelTopologyReader() [constructor]
cls.add_constructor([])
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::RocketfuelTopologyReader::Read() [member function]
@@ -47,7 +47,6 @@ TopologyReaderHelper::SetFileType (const std::string fileType)
m_fileType = fileType;
}
Ptr<TopologyReader>
TopologyReaderHelper::GetTopologyReader ()
{
@@ -59,17 +58,17 @@ TopologyReaderHelper::GetTopologyReader ()
if (m_fileType == "Orbis")
{
NS_LOG_INFO ("Creating Orbis formatted data input.");
m_inFile = CreateObject<OrbisTopologyReader> ();
m_inFile = Create<OrbisTopologyReader> ();
}
else if (m_fileType == "Inet")
{
NS_LOG_INFO ("Creating Inet formatted data input.");
m_inFile = CreateObject<InetTopologyReader> ();
m_inFile = Create<InetTopologyReader> ();
}
else if (m_fileType == "Rocketfuel")
{
NS_LOG_INFO ("Creating Rocketfuel formatted data input.");
m_inFile = CreateObject<RocketfuelTopologyReader> ();
m_inFile = Create<RocketfuelTopologyReader> ();
}
else
{
@@ -22,11 +22,10 @@
#ifndef TOPOLOGY_READER_HELPER_H
#define TOPOLOGY_READER_HELPER_H
#include "ns3/topology-reader.h"
#include <string>
namespace ns3 {
class TopologyReader;
/**
* \ingroup topology
*
+10 -10
View File
@@ -28,19 +28,19 @@
using namespace std;
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("InetTopologyReader");
NS_OBJECT_ENSURE_REGISTERED (InetTopologyReader);
namespace ns3 {
TypeId InetTopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::InetTopologyReader")
.SetParent<Object> ()
;
return tid;
}
// NS_OBJECT_ENSURE_REGISTERED (InetTopologyReader);
// TypeId InetTopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::InetTopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
InetTopologyReader::InetTopologyReader ()
{
@@ -47,7 +47,7 @@ namespace ns3 {
class InetTopologyReader : public TopologyReader
{
public:
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
InetTopologyReader ();
virtual ~InetTopologyReader ();
@@ -29,19 +29,19 @@
using namespace std;
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("OrbisTopologyReader");
NS_OBJECT_ENSURE_REGISTERED (OrbisTopologyReader);
namespace ns3 {
TypeId OrbisTopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::OrbisTopologyReader")
.SetParent<Object> ()
;
return tid;
}
// NS_OBJECT_ENSURE_REGISTERED (OrbisTopologyReader);
// TypeId OrbisTopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::OrbisTopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
OrbisTopologyReader::OrbisTopologyReader ()
{
@@ -44,7 +44,7 @@ namespace ns3 {
class OrbisTopologyReader : public TopologyReader
{
public:
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
OrbisTopologyReader ();
virtual ~OrbisTopologyReader ();
@@ -28,19 +28,19 @@
#include "ns3/unused.h"
#include "rocketfuel-topology-reader.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("RocketfuelTopologyReader");
NS_OBJECT_ENSURE_REGISTERED (RocketfuelTopologyReader);
namespace ns3 {
TypeId RocketfuelTopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::RocketfuelTopologyReader")
.SetParent<Object> ()
;
return tid;
}
// NS_OBJECT_ENSURE_REGISTERED (RocketfuelTopologyReader);
// TypeId RocketfuelTopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::RocketfuelTopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
RocketfuelTopologyReader::RocketfuelTopologyReader ()
{
@@ -21,7 +21,6 @@
#ifndef ROCKETFUEL_TOPOLOGY_READER_H
#define ROCKETFUEL_TOPOLOGY_READER_H
#include "ns3/nstime.h"
#include "topology-reader.h"
namespace ns3 {
@@ -43,7 +42,7 @@ namespace ns3 {
class RocketfuelTopologyReader : public TopologyReader
{
public:
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
RocketfuelTopologyReader ();
virtual ~RocketfuelTopologyReader ();
+26 -10
View File
@@ -19,24 +19,23 @@
* Author: Valerio Sartini (valesar@gmail.com)
*/
#include "ns3/log.h"
#include "topology-reader.h"
#include "ns3/log.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("TopologyReader");
NS_OBJECT_ENSURE_REGISTERED (TopologyReader);
// NS_OBJECT_ENSURE_REGISTERED (TopologyReader);
TypeId TopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::TopologyReader")
.SetParent<Object> ()
;
return tid;
}
// TypeId TopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::TopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
TopologyReader::TopologyReader ()
{
@@ -106,12 +105,23 @@ TopologyReader::Link::Link ()
{
}
void
TopologyReader::Link::SetNetDevices (Ptr<NetDevice> from, Ptr<NetDevice> to)
{
m_fromNetDevice = from;
m_toNetDevice = to;
}
Ptr<Node> TopologyReader::Link::GetFromNode (void) const
{
return m_fromPtr;
}
Ptr<NetDevice> TopologyReader::Link::GetFromNetDevice (void) const
{
return m_fromNetDevice;
}
std::string
TopologyReader::Link::GetFromNodeName (void) const
{
@@ -124,6 +134,12 @@ TopologyReader::Link::GetToNode (void) const
return m_toPtr;
}
Ptr<NetDevice>
TopologyReader::Link::GetToNetDevice (void) const
{
return m_toNetDevice;
}
std::string
TopologyReader::Link::GetToNodeName (void) const
{
+34 -12
View File
@@ -22,16 +22,16 @@
#ifndef TOPOLOGY_READER_H
#define TOPOLOGY_READER_H
#include <string>
#include <map>
#include <list>
#include "ns3/object.h"
#include "ns3/node-container.h"
#include "ns3/simple-ref-count.h"
namespace ns3 {
class NetDevice;
/**
* \ingroup topology
*
@@ -40,7 +40,7 @@ namespace ns3 {
* This interface perform the shared tasks among all possible input file readers.
* Each different file format is handled by its own topology reader.
*/
class TopologyReader : public Object
class TopologyReader : public SimpleRefCount<TopologyReader>
{
public:
@@ -53,12 +53,14 @@ public:
*/
class Link
{
public:
public:
/**
* \brief Constant iterator to scan the map of link attributes.
*/
typedef std::map<std::string, std::string>::const_iterator ConstAttributesIterator;
Link (); // default constructor
/**
* \brief Constructor
* \param fromPtr Ptr to the node the link is orginating from
@@ -66,13 +68,26 @@ public:
* \param toPtr Ptr to the node the link is directed to
* \param toName name of the node the link is directed to
*/
Link ( Ptr<Node> fromPtr, const std::string &fromName, Ptr<Node> toPtr, const std::string &toName );
Link (Ptr<Node> fromPtr, const std::string &fromName, Ptr<Node> toPtr, const std::string &toName);
/**
* \brief Set netdevices associated with the link
* \param from NetDevice associated with From node
* \param to NetDevice associated with To node
*/
void
SetNetDevices (Ptr<NetDevice> from, Ptr<NetDevice> to);
/**
* \brief Returns a Ptr<Node> to the "from" node of the link
* \return a Ptr<Node> to the "from" node of the link
*/
Ptr<Node> GetFromNode (void) const;
/**
* \brief Returns a Ptr<NetDevice> of the "from" node of the link
* \return a Ptr<NetDevice> of the "from" node of the link
*/
Ptr<NetDevice> GetFromNetDevice (void) const;
/**
* \brief Returns the name of the "from" node of the link
* \return the name of the "from" node of the link
@@ -83,6 +98,11 @@ public:
* \return a Ptr<Node> to the "to" node of the link
*/
Ptr<Node> GetToNode (void) const;
/**
* \brief Returns a Ptr<NetDevice> of the "to" node of the link
* \return a Ptr<NetDevice> of the "to" node of the link
*/
Ptr<NetDevice> GetToNetDevice (void) const;
/**
* \brief Returns the name of the "to" node of the link
* \return the name of the "to" node of the link
@@ -122,12 +142,13 @@ public:
ConstAttributesIterator AttributesEnd (void);
private:
Link ();
std::string m_fromName;
Ptr< Node > m_fromPtr;
std::string m_toName;
Ptr< Node > m_toPtr;
std::map<std::string, std::string> m_linkAttr;
Ptr< NetDevice > m_fromNetDevice;
Ptr< NetDevice > m_toNetDevice;
std::map<std::string, std::string > m_linkAttr;
};
/**
@@ -135,7 +156,7 @@ private:
*/
typedef std::list< Link >::const_iterator ConstLinksIterator;
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
TopologyReader ();
virtual ~TopologyReader ();
@@ -195,13 +216,14 @@ private:
*/
void AddLink (Link link);
protected:
std::string m_fileName;
std::list<Link> m_linksList;
private:
TopologyReader (const TopologyReader&);
TopologyReader& operator= (const TopologyReader&);
std::string m_fileName;
std::list<Link> m_linksList;
// end class TopologyReader
};
+8 -1
View File
@@ -428,7 +428,7 @@ UanPhyGen::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::UanPhyGen")
.SetParent<Object> ()
.SetParent<UanPhy> ()
.AddConstructor<UanPhyGen> ()
.AddAttribute ("CcaThreshold",
"Aggregate energy of incoming signals to move to CCA Busy state dB",
@@ -581,12 +581,14 @@ UanPhyGen::StartRxPacket (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, U
if (m_disabled)
{
NS_LOG_DEBUG ("Energy depleted, node cannot receive any packet. Dropping.");
NotifyRxDrop(pkt); // traced source netanim
return;
}
switch (m_state)
{
case TX:
NotifyRxDrop(pkt); // traced source netanim
NS_ASSERT (false);
break;
case RX:
@@ -595,6 +597,7 @@ UanPhyGen::StartRxPacket (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, U
double newSinrDb = CalculateSinrDb (m_pktRx, m_pktRxArrTime, m_rxRecvPwrDb, m_pktRxMode, m_pktRxPdp);
m_minRxSinrDb = (newSinrDb < m_minRxSinrDb) ? newSinrDb : m_minRxSinrDb;
NS_LOG_DEBUG ("PHY " << m_mac->GetAddress () << ": Starting RX in RX mode. SINR of pktRx = " << m_minRxSinrDb);
NotifyRxBegin(pkt); // traced source netanim
}
break;
@@ -623,6 +626,7 @@ UanPhyGen::StartRxPacket (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, U
{
m_state = RX;
UpdatePowerConsumption (RX);
NotifyRxBegin(pkt); // traced source netanim
m_rxRecvPwrDb = rxPowerDb;
m_minRxSinrDb = newsinr;
m_pktRx = pkt;
@@ -638,6 +642,7 @@ UanPhyGen::StartRxPacket (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, U
break;
case SLEEP:
NS_LOG_DEBUG ("Sleep mode. Dropping packet.");
NotifyRxDrop(pkt); // traced source netanim
break;
}
@@ -661,9 +666,11 @@ UanPhyGen::RxEndEvent (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode)
{
NS_LOG_DEBUG ("Sleep mode or dead. Dropping packet");
m_pktRx = 0;
NotifyRxDrop(pkt); // traced source netanim
return;
}
NotifyRxEnd(pkt); // traced source netanim
if (GetInterferenceDb ( (Ptr<Packet>) 0) > m_ccaThreshDb)
{
m_state = CCABUSY;
-1
View File
@@ -241,7 +241,6 @@ private:
TracedCallback<Ptr<const Packet>, double, UanTxMode > m_rxErrLogger;
TracedCallback<Ptr<const Packet>, double, UanTxMode > m_txLogger;
double CalculateSinrDb (Ptr<Packet> pkt, Time arrTime, double rxPowerDb, UanTxMode mode, UanPdp pdp);
double GetInterferenceDb (Ptr<Packet> pkt);
double DbToKp (double db);
+57 -1
View File
@@ -69,8 +69,64 @@ NS_OBJECT_ENSURE_REGISTERED (UanPhy);
TypeId UanPhy::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::UanPhy")
.SetParent<Object> ();
.SetParent<Object> ()
.AddTraceSource ("PhyTxBegin",
"Trace source indicating a packet has begun transmitting over the channel medium",
MakeTraceSourceAccessor (&UanPhy::m_phyTxBeginTrace))
.AddTraceSource ("PhyTxEnd",
"Trace source indicating a packet has been completely transmitted over the channel.",
MakeTraceSourceAccessor (&UanPhy::m_phyTxEndTrace))
.AddTraceSource ("PhyTxDrop",
"Trace source indicating a packet has been dropped by the device during transmission",
MakeTraceSourceAccessor (&UanPhy::m_phyTxDropTrace))
.AddTraceSource ("PhyRxBegin",
"Trace source indicating a packet has begun being received from the channel medium by the device",
MakeTraceSourceAccessor (&UanPhy::m_phyRxBeginTrace))
.AddTraceSource ("PhyRxEnd",
"Trace source indicating a packet has been completely received from the channel medium by the device",
MakeTraceSourceAccessor (&UanPhy::m_phyRxEndTrace))
.AddTraceSource ("PhyRxDrop",
"Trace source indicating a packet has been dropped by the device during reception",
MakeTraceSourceAccessor (&UanPhy::m_phyRxDropTrace))
;
return tid;
}
void
UanPhy::NotifyTxBegin (Ptr<const Packet> packet)
{
m_phyTxBeginTrace (packet);
}
void
UanPhy::NotifyTxEnd (Ptr<const Packet> packet)
{
m_phyTxEndTrace (packet);
}
void
UanPhy::NotifyTxDrop (Ptr<const Packet> packet)
{
m_phyTxDropTrace (packet);
}
void
UanPhy::NotifyRxBegin (Ptr<const Packet> packet)
{
m_phyRxBeginTrace (packet);
}
void
UanPhy::NotifyRxEnd (Ptr<const Packet> packet)
{
m_phyRxEndTrace (packet);
}
void
UanPhy::NotifyRxDrop (Ptr<const Packet> packet)
{
m_phyRxDropTrace (packet);
}
} // namespace ns3
+85
View File
@@ -382,6 +382,91 @@ public:
virtual void Clear (void) = 0;
virtual void SetSleepMode (bool sleep) = 0;
/**
* Public method used to fire a PhyTxBegin trace. Implemented for encapsulation
* purposes.
*/
void NotifyTxBegin (Ptr<const Packet> packet);
/**
* Public method used to fire a PhyTxEnd trace. Implemented for encapsulation
* purposes.
*/
void NotifyTxEnd (Ptr<const Packet> packet);
/**
* Public method used to fire a PhyTxDrop trace. Implemented for encapsulation
* purposes.
*/
void NotifyTxDrop (Ptr<const Packet> packet);
/**
* Public method used to fire a PhyRxBegin trace. Implemented for encapsulation
* purposes.
*/
void NotifyRxBegin (Ptr<const Packet> packet);
/**
* Public method used to fire a PhyRxEnd trace. Implemented for encapsulation
* purposes.
*/
void NotifyRxEnd (Ptr<const Packet> packet);
/**
* Public method used to fire a PhyRxDrop trace. Implemented for encapsulation
* purposes.
*/
void NotifyRxDrop (Ptr<const Packet> packet);
private:
/**
* The trace source fired when a packet begins the transmission process on
* the medium.
*
* \see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet> > m_phyTxBeginTrace;
/**
* The trace source fired when a packet ends the transmission process on
* the medium.
*
* \see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet> > m_phyTxEndTrace;
/**
* The trace source fired when the phy layer drops a packet as it tries
* to transmit it.
*
* \see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet> > m_phyTxDropTrace;
/**
* The trace source fired when a packet begins the reception process from
* the medium.
*
* \see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet> > m_phyRxBeginTrace;
/**
* The trace source fired when a packet ends the reception process from
* the medium.
*
* \see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet> > m_phyRxEndTrace;
/**
* The trace source fired when the phy layer drops a packet it has received.
*
* \see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet> > m_phyRxDropTrace;
};
}
+3
View File
@@ -158,10 +158,12 @@ UanTransducerHd::Transmit (Ptr<UanPhy> src,
if (m_state == TX)
{
Simulator::Remove (m_endTxEvent);
src->NotifyTxDrop(packet); // traced source netanim
}
else
{
m_state = TX;
src->NotifyTxBegin(packet); // traced source netanim
}
@@ -185,6 +187,7 @@ UanTransducerHd::Transmit (Ptr<UanPhy> src,
m_endTxEvent = Simulator::Schedule (delay, &UanTransducerHd::EndTx, this);
m_endTxTime = Simulator::Now () + delay;
Simulator::Schedule(delay, &UanPhy::NotifyTxEnd, src, packet); // traced source netanim
}
void
@@ -0,0 +1,6 @@
callback_classes = [
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr<ns3::Packet>', 'ns3::Address const&', 'ns3::Address const&', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
]
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+2
View File
@@ -14,3 +14,5 @@ def build(bld):
if bld.env['ENABLE_EXAMPLES']:
bld.add_subdirs('examples')
bld.ns3_python_bindings()
+7 -4
View File
@@ -265,8 +265,11 @@ void
PyViz::CallbackStopSimulation ()
{
NS_LOG_FUNCTION_NOARGS ();
Simulator::Stop (Seconds (0)); // Stop right now
m_stop = true;
if (m_runUntil <= Simulator::Now ())
{
Simulator::Stop (Seconds (0)); // Stop right now
m_stop = true;
}
}
void
@@ -316,9 +319,9 @@ PyViz::SimulatorRunUntil (Time time)
// sure we stop at the right time. Otherwise, simulations with few
// events just appear to "jump" big chunks of time.
NS_LOG_LOGIC ("Schedule dummy callback to be called in " << (time - Simulator::Now ()));
m_runUntil = time;
m_stop = false;
Simulator::Cancel (m_stopCallbackEvent);
m_stopCallbackEvent = Simulator::Schedule (time - Simulator::Now (), &PyViz::CallbackStopSimulation, this);
Simulator::ScheduleWithContext (0xffffffff, time - Simulator::Now (), &PyViz::CallbackStopSimulation, this);
Ptr<SimulatorImpl> impl = Simulator::GetImplementation ();
Ptr<VisualSimulatorImpl> visualImpl = DynamicCast<VisualSimulatorImpl> (impl);
+1 -1
View File
@@ -220,7 +220,7 @@ private:
void DoPause (std::string const &message);
bool m_stop;
EventId m_stopCallbackEvent;
Time m_runUntil;
void CallbackStopSimulation ();
};
+2 -2
View File
@@ -43,8 +43,8 @@ netdevice_traits = {
ns.mesh.MeshPointDevice: NetDeviceTraits(is_virtual=True),
ns.wimax.SubscriberStationNetDevice: NetDeviceTraits(is_wireless=True),
ns.wimax.BaseStationNetDevice: NetDeviceTraits(is_wireless=True),
ns.lte.UeNetDevice: NetDeviceTraits(is_wireless=True),
ns.lte.EnbNetDevice: NetDeviceTraits(is_wireless=True),
ns.lte.LteUeNetDevice: NetDeviceTraits(is_wireless=True),
ns.lte.LteEnbNetDevice: NetDeviceTraits(is_wireless=True),
}
def lookup_netdevice_traits(class_type):
+19 -4
View File
@@ -463,6 +463,8 @@ class Visualizer(gobject.GObject):
self.node_drag_state = None
self.follow_node = None
self.shell_window = None
self._topology_scan_timeout_id = None
self.last_discoverd_node = 0
self.create_gui()
@@ -749,10 +751,13 @@ class Visualizer(gobject.GObject):
self.window.show()
def scan_topology(self):
print "scanning topology: %i nodes..." % (ns.network.NodeList.GetNNodes(),)
if (self.last_discoverd_node >= ns.network.NodeList.GetNNodes()):
return True
print "scanning topology: [%i, %i) nodes..." % (self.last_discoverd_node, ns.network.NodeList.GetNNodes(),)
graph = pygraphviz.AGraph()
seen_nodes = 0
for nodeI in range(ns.network.NodeList.GetNNodes()):
for nodeI in range(self.last_discoverd_node, ns.network.NodeList.GetNNodes()):
seen_nodes += 1
if seen_nodes == 100:
print "scan topology... %i nodes visited (%.1f%%)" % (nodeI, 100*nodeI/ns.network.NodeList.GetNNodes())
@@ -762,6 +767,7 @@ class Visualizer(gobject.GObject):
node_view = self.get_node(nodeI)
mobility = node.GetObject(ns.mobility.MobilityModel.GetTypeId())
# print "Mobility type: " + mobility.GetInstanceTypeId().GetName()
if mobility is not None:
node_view.set_color("red")
pos = mobility.GetPosition()
@@ -808,7 +814,7 @@ class Visualizer(gobject.GObject):
graph.add_edge(node_name, other_node_name)
self.create_link(self.get_node(nodeI), otherNodeView)
print "scanning topology: calling graphviz layout"
# print "scanning topology: calling graphviz layout"
graph.layout(LAYOUT_ALGORITHM)
for node in graph.iternodes():
#print node, "=>", node.attr['pos']
@@ -820,8 +826,11 @@ class Visualizer(gobject.GObject):
obj = self.channels[int(node_id)]
obj.set_position(pos_x, pos_y)
print "scanning topology: all done."
# print "scanning topology: all done."
self.emit("topology-scanned")
self.last_discoverd_node = ns.network.NodeList.GetNNodes();
return True
def get_node(self, index):
try:
@@ -1093,6 +1102,11 @@ class Visualizer(gobject.GObject):
#print "view: done."
return True
def _start_topology_scan(self):
if self._topology_scan_timeout_id is not None:
gobject.source_remove(self._topology_scan_timeout_id)
self._topology_scan_timeout_id = gobject.timeout_add (1000, self.scan_topology, priority=PRIORITY_UPDATE_VIEW)
def _start_update_timer(self):
if self._update_timeout_id is not None:
gobject.source_remove(self._update_timeout_id)
@@ -1171,6 +1185,7 @@ class Visualizer(gobject.GObject):
def start(self):
self.scan_topology()
self._start_topology_scan()
self.window.connect("delete-event", self._quit)
#self._start_update_timer()
gobject.timeout_add(200, self.autoscale_view)
@@ -0,0 +1,90 @@
import gtk
import ns.core
import ns.network
import ns.internet
import ns.ndnSIM
from visualizer.base import InformationWindow
class ShowCcnxFib(InformationWindow):
(
COLUMN_PREFIX,
COLUMN_FACE
) = range(2)
def __init__(self, visualizer, node_index):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.node = ns.network.NodeList.GetNode (node_index)
node_name = ns.core.Names.FindName (self.node)
title = "CCNx FIB for node %i" % node_index
if len(node_name) != 0:
title += " (" + str(node_name) + ")"
self.win.set_title (title)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
self.win.set_default_size(600, 300)
# Dest.
column = gtk.TreeViewColumn('Destination', gtk.CellRendererText(),
text=self.COLUMN_PREFIX)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('faceType[nodeId](routingCost,status,metric)', gtk.CellRendererText(),
text=self.COLUMN_FACE)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
def _response_cb(self, win, response):
self.win.destroy()
self.visualizer.remove_information_window(self)
def update(self):
ccnxFib = ns.ndnSIM.CcnxFib.GetCcnxFib (self.node)
if ccnxFib is None:
return
self.table_model.clear()
item = ccnxFib.Begin ()
while (item != ccnxFib.End ()):
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, str(item.GetPrefix()),
self.COLUMN_FACE, str(item))
item = ccnxFib.Next (item)
def populate_node_menu(viz, node, menu):
menu_item = gtk.MenuItem("Show CCNx FIB")
menu_item.show()
def _show_ccnx_fib(dummy_menu_item):
ShowCcnxFib(viz, node.node_index)
menu_item.connect("activate", _show_ccnx_fib)
menu.add(menu_item)
def register(viz):
viz.connect("populate-node-menu", populate_node_menu)
@@ -0,0 +1,90 @@
import gtk
import ns.core
import ns.network
import ns.internet
import ns.ndnSIM
from visualizer.base import InformationWindow
class ShowCcnxPit(InformationWindow):
(
COLUMN_PREFIX,
COLUMN_FACE
) = range(2)
def __init__(self, visualizer, node_index):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.node = ns.network.NodeList.GetNode (node_index)
node_name = ns.core.Names.FindName (self.node)
title = "CCNx PIT for node %i" % node_index
if len(node_name) != 0:
title += " (" + str(node_name) + ")"
self.win.set_title (title)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
self.win.set_default_size(600, 300)
# Dest.
column = gtk.TreeViewColumn('Prefix', gtk.CellRendererText(),
text=self.COLUMN_PREFIX)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('Info', gtk.CellRendererText(),
text=self.COLUMN_FACE)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
def _response_cb(self, win, response):
self.win.destroy()
self.visualizer.remove_information_window(self)
def update(self):
ccnxPit = ns.ndnSIM.CcnxPit.GetCcnxPit (self.node)
if ccnxPit is None:
return
self.table_model.clear()
item = ccnxPit.Begin ()
while (item != ccnxPit.End ()):
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, str(item.GetPrefix()),
self.COLUMN_FACE, str(item))
item = ccnxPit.Next (item)
def populate_node_menu(viz, node, menu):
menu_item = gtk.MenuItem("Show CCNx PIT")
menu_item.show()
def _show_ccnx_pit(dummy_menu_item):
ShowCcnxPit(viz, node.node_index)
menu_item.connect("activate", _show_ccnx_pit)
menu.add(menu_item)
def register(viz):
viz.connect("populate-node-menu", populate_node_menu)
+34 -2
View File
@@ -313,17 +313,20 @@ PrintHelp (const char *program_name)
<< std::endl
<< "Options:" << std::endl
<< " --help : print these options" << std::endl
<< " --output-text : format output as plain text" << std::endl;
<< " --output-text : format output as plain text" << std::endl
<< " --group <group> : print information only for this group" << std::endl;
}
int main (int argc, char *argv[])
{
bool outputText = false;
char *programName = argv[0];
std::string group = "";
argv++;
argc--;
while (*argv != 0)
while (argc > 0 && *argv != 0)
{
char *arg = *argv;
@@ -336,6 +339,17 @@ int main (int argc, char *argv[])
{
outputText = true;
}
else if (strcmp(arg, "--group") == 0)
{
argv ++;
argc --;
if (argc == 0 || argv == 0)
{
PrintHelp (programName);
return 0;
}
group = *argv;
}
else
{
// un-recognized command-line argument
@@ -343,6 +357,7 @@ int main (int argc, char *argv[])
return 0;
}
argv++;
argc--;
}
if (outputText)
@@ -432,6 +447,11 @@ int main (int argc, char *argv[])
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
// Capitalize all of letters in the name so that it sorts
// correctly in the map.
std::string name = tid.GetName ();
@@ -530,6 +550,12 @@ int main (int argc, char *argv[])
{
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
std::cout << boldStart << tid.GetName () << boldStop << breakHtmlOnly << std::endl
<< listStart << std::endl;
for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
@@ -552,6 +578,12 @@ int main (int argc, char *argv[])
{
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
std::cout << boldStart << tid.GetName () << boldStop << breakHtmlOnly << std::endl
<< listStart << std::endl;
for (uint32_t j = 0; j < tid.GetAttributeN (); ++j)
+12
View File
@@ -125,6 +125,7 @@ def options(opt):
opt.load('compiler_cxx')
opt.load('cflags')
opt.load('gnu_dirs')
opt.tool_options('boost', tooldir=["waf-tools"])
opt.add_option('--cwd',
help=('Set the working directory for a program.'),
@@ -364,6 +365,14 @@ def configure(conf):
conf.report_optional_feature("static", "Static build", False,
"Link flag -Wl,--whole-archive,-Bstatic does not work")
try:
conf.check_tool('boost')
conf.check_boost(lib='signals filesystem iostreams regex')
if not conf.env.LIB_BOOST:
conf.check_boost(lib='signals filesystem iostreams regex', libpath="/usr/lib64")
except WafError:
conf.env['LIB_BOOST'] = []
# Set this so that the lists won't be printed at the end of this
# configure command.
conf.env['PRINT_BUILT_MODULES_AT_END'] = False
@@ -823,6 +832,9 @@ def build(bld):
# nothing more; this greatly speeds up compilation when all you
# want to do is run a test program.
Options.options.targets += ',' + os.path.basename(program_name)
if getattr(Options.options, "visualize", False):
program_obj = wutils.find_program(program_name, bld.env)
program_obj.use.append('ns3-visualizer')
for gen in bld.all_task_gen:
if type(gen).__name__ in ['ns3header_taskgen', 'ns3moduleheader_taskgen']:
gen.post()