CSE342 - Lab 8: Network simulation
PURPOSE: To use a modern network simulator to test
effects of various network workloads and topologies.
ns2 is a
network simulator used by researchers worldwide to explore and test
new network protocols and their performance. In this lab you will
learn a little about ns by working through an ns
tutorial and testing your intuitions in an exercise. Note that as
a simulator, ns runs a simulation and then produces a log file with
results. Typically, however, one will want to see the results
graphically, and so NAM (Network Animator) is used to show over time
what the simulator has calculated.
In order to run ns/nam locally, you'll have to set some environment
variables and start X-Windows.
For bash users (used at Lehigh by default), you'll need:
export PATH=$PATH:/home/brian/ns-allinone-2.33/bin:/home/brian/ns-allinone-2.33/tcl8.4.18/unix:/home/brian/ns-allinone-2.33/tk8.4.18/unix
export LD_LIBRARY_PATH=/home/brian/ns-allinone-2.33/otcl-1.13:/home/brian/ns-allinone-2.33/lib
export TCL_LIBRARY=/home/brian/ns-allinone-2.33/tcl8.4.18/library
If there are any csh or tcsh shell users, you'll need:
set path = ($path /home/brian/ns-allinone-2.33/bin /home/brian/ns-allinone-2.33/tcl8.4.18/unix /home/brian/ns-allinone-2.33/tk8.4.18/unix)
setenv LD_LIBRARY_PATH /home/brian/ns-allinone-2.33/otcl-1.13:/home/brian/ns-allinone-2.33/lib
setenv TCL_LIBRARY /home/brian/ns-allinone-2.33/tcl8.4.18/library
You should start the ns
tutorial at section I (Introduction), but skip section III.1 (since
it is already installed). In section IV (and beyond), when the
instructions say to run ns, we'll be using the version in
/home/brian/ns-allinone-2.33/bin/ns.
EXERCISES:
- Go through the tutorial sections IV-VI, and VIII, and implement the
sample networks they describe.
- Create a new topology. Node A
wants to send a constant bitrate stream of UDP packets to Node S at
5Mbps. Node A connects to
router B with a 10Mbps ethernet. Router B has two additional
connections: a 10Mbps connection to Node C and a 1.5Mbps connection
to D. C and D both connect to S at 10Mbps. Part way through your
simulation, make link BC fail and show the performance degradation
that results.
- Now, using the DV routing protocol make link BC come up sometime in
your simulation after it had already gone down. Does your simulation
start using link BC again or does it continue using the slower link?
Why or why not?
Last revised 13 October 2009.