Help Page for WAN & LAN Project Spring'04
Before you question anything, make sure you have read documents listed below.
Now I assume that you understand what you need to do in general. This page will help you build a simulation model using ns. (Note: for any other simulators, you might send question to me directly)
First, you need to know what ns provide you. Read the document below.
- WAN:
NS diffserv module by Nortel,
diffserv chapter
in NS manual, and source codes at
$ns_root/ns-2.27/diffserv
Note that the NS diffserv module by Nortel is an original design document in
2000. The current modules used in the ns may be different. Check examples in
$ns_root/ns-2.27/tcl/ex/diffserv for
the current implementation. More examples: token bucket in file
$ns_root/ns-2.27/tcl/ex/test-tbf.tcl, and some
more in $ns_root/ns-2.27/tcl/test/test-suit-diffserv.tcl
Next, draw the picture of the network topology you want to simulate. Draw the
components and connect them together. Put all the agents you need on each node.
Now, you have everything you need. Start writing scripts.
Testing
- Begin by simulating a simple thing first.
- Start from the network that have all the nodes and agents without your
designed modules (diffserve, and csma for congestion control)
- Don't forget to trace and animate the simulation. (put all your trace
files in /tmp directory, so they can be written).
- See the trace file and the animation, and try to understand it. Ask yourself
whether they make sense.
- Make sure you understand how to generate the
traffic!
- How can you translate the load of the system to the rate of the agent(s)
you want to generate?
- What is the rate of the generated traffic for 0.1 load of 10 Mb/s link?
- Once you know the rate of the traffic that your agent(s) need to generate,
how can you translate that rate to the implementation? TCP agent rate? UDP
agent rate?
- If you can understand the above questions, you can
start the next step. Otherwise click here to
learn how to do it.
If you come this far, you are ready to do what the project ask you to do.
Building
- Put your modules in the edge router. Start by putting a simple module piece by piece, not all at one, if possible.
- Again trace and animate to make sure your simulation is right.
Running Simulations
- Plan your runs.
- Different scenarios?
- Which parameters?
- Which stats you need to collect?
- How those stats can be collected and computed? (I recommend awk, some
examples can be found
here)
- How many run?
- Add parameters or scripts to automate your simulation
- Don't forget to put "nice" before "ns" command in your script (ie.
$nice
ns parameters)
- If you want to run your script after you log out, you can do it by running
command:
$nohup
nice ns parameters >/dev/null &
Writing the Report
- Plan what you want to show and how you can present it effectively
- Generate graphs, tables, etc. (gnuplot or matlab are good)
- Write up your report. (Note: only good points need to be shown. Don't
write anything that are in the project description. It will weaken the strong
points of your report).
For those of you, who want to modify c code, this is the procedure.
- run script "mknslink" in ns directory (this will create the source tree
which link to the ns directory, and create a copy of ns in your directory)
After this process, you should have myns
directory which contains all directories linked to the source tree. Check the
ns in myns/ns-2.27/
directory whether it is your ( you can check by ls -l)
- make a directory in the source directory ("myns/ns-2.27") and create files
(.cc and .h) as you want in
that directory
- modify the Makefile: add your objects to
OBJ_CC variable ie. the source
file is ns-2.27/myobj/test.cc --> add "myobj/test.o"
to that variable
- remake as you wish (type make in the
ns-2.27) directory
- setup your variable PATH to include your ns
in the path instead of the default one
(Note that for the instruction how to build c++ objects, read the manual of
ns: creating a new agent
or from Marc tutorial:
creating a new protocol)
(For telecom students, this process has not worked yet. I am working on it. I
will let you know when I finish.)
Send me question!