Tutorials |||| Installing and Using ns-2 | Installing Rapid in ns-2 | Using Tmix in ns-2
Rapid Research Group @ CS @ UNC-CH
Initial draft: February 2011
Last updated: 17 March 2013
This guide is dedicated (but not limited in its utility) to UNC-CH people who are interested in using ns-2 to simulate and test Rapid packet-scale congestion control. For general information about how to install ns-2, see the ns-2 website.
Update: Bryan Ward has created a patch which will automagically do all of this installation stuff for you! The patch was created with ns-2.34 in mind. I have not tested it out using any other version of ns.
While you can use your current installation of ns, we recommend
starting with a fresh copy. To do this, download the all-in-one build
of the latest update of ns from the ns website. As of this
writing, the current version is 2.34. Untar this file into a
directory called ns-allinone-2.34/
.
Copy the files rapid-sink.cc
,
rapid-sink.h
, tcp-rapid.cc
, and
tcp-rapid.h
into the folder
ns-allinone-2.34/ns-2.34/tcp/
. Internally, you can find
copies of these files on the rapid.cs.unc.edu
machine in
the /playpen/lovewell/ns/rapid/
directory.
ns-allinone-2.34/ns-2.34/tcl/lib/ns-default.tcl
Add the following lines of code to this file:
ns-allinone-2.34/ns-2.34/Makefile.in
Add the following lines to OBJ_CC
:
ns-allinone-2.34/ns-2.34/common/packet.h
Add the following to the list after the comment "Used by
wireless routing code to attach routing agent"
:
ns-allinone-2.34/ns-2.34/common/agent.cc
Change the line "oldValueList_(NULL), app_(0),
et_(0)"
to "oldValueList_(NULL), app_(0), et_(0),
closed(false)"
.
Add the line "closed = true;"
to the method
Agent::close()
.
ns-allinone-2.34/ns-2.34/common/agent.h
Declare "bool closed;"
after the declaration of
"Application *app_;"
.
ns-allinone-2.34/ns-2.34/tcp/tcp-session.cc
Add "#include "tcp-rapid.h""
to the includes
section after initial comment.
Add the following two functions after the function "void
SessionBurstSndTimer: ..."
:
Add the following lines to the end of
TcpSessionAgent::cancel_timers()"
:
Change the line:
to:
ns-allinone-2.34/ns-2.34/tcp/tcp-session.h
Add the following declarations after the declaration of
"class SessionBurstSndTimer..."
:
Then, add the following declarations under
"protected"
just below "SessionBurstSndTimer
burstsnd_timer_;"
:
Remove the ns-allinone-2.34/ns-2.34/gen/
directory
and all of its contents, if it exists.
Run ./configure
in the
ns-allinone-2.34/ns-2.34/
directory, and run
./install
from the ns-allinone-2.34/
directory.
You should now have a working copy of Rapid!