08s Week06 2 Lab Manet
08s Week06 2 Lab Manet
Ns-
Ns-2 Laboratory #8
Prof. Chansu Yu
http://academic.csuohio.edu/yuc/
[email protected]
1
ns2 Instructions
Get, read, and run the tcl script (dsdv-test.tcl)
The topology - 3 nodes over 500x400 m2 area (where are they?)
The mobility model pre-defined (what is it?)
Determine the performance metrics using the trace file dsdv-
test.tr
To get the number of packets sent
grep "^s.*\-Nl AGT.*\-It tcp.*" dsdv-test.tr | wc -l
To get the actual number of packets received
grep "^r.*\-Nl AGT.*\-It tcp.*" dsdv-test.tr | wc -l
To get the total number of routing packets sent
grep "^\(s\|f\).*\-Nl RTR.*\-It message.*" dsdv-test.tr | wc -l
2
NS2 Instructions
Get the tcl script compare.tcl
This script takes 4 command line arguments - scenario file, traffic file, output
trace file and routing protocol (1 = DSR and 2 = AODV). Script usage is :
$ ns compare.tcl -scen {scen} -tfc {tfc} -tr {tr} -rpr {rpr}
NS2 Instructions
With five mobility and four traffic files, we have 20 simulation
scenarios.
For each of DSR and AODV, we will use a script file (run-dsr.sh and
run-adov.sh) to ruin them all. You can run these scripts as follows.
$ chmod +x run-aodv.sh
$ chmod +x run-dsr.sh
$ ./run-aodv.sh
$ ./run-dsr.sh
The above scripts will create 3 files each. The files have a suffix recv,
sent, route_pkts, to mean received, sent and routing packets. Each line
in the file is "Pause Time", "CBR Load", "Extracted Number".
Handin
Plot each performance metric for both DSR and AODV versus pause-times,
for each CBR Load.
State if any peculiar behavior is observed. Give a brief report as to the
interpretation of the graphs.
6
[email protected]
3
Reactive MANET Routing Protocols
- DSR and AODV (Lab Report)
Try the whole experiment with seed = 2 in the
run-aodv.sh and run-dsr.sh, in the "ns
cbrgen.tcl..." command. And make the plots
again. Does the behavior change markedly?
dsragent.cc
/*************** selectors ******************/
bool dsragent_snoop_forwarded_errors = true; // give errors we forward to our cache?
bool dsragent_snoop_source_routes = true; // should we snoop on any source routes we see?
bool dsragent_reply_only_to_first_rtreq = false; // should we only respond to the first route request we receive from
// a host?
bool dsragent_propagate_last_error = true; // should we take the data from the last route error
msg sent to us // and propagate it around on the next
propagating route request we do? // this is aka grat route error
propagation
bool dsragent_send_grat_replies = true; // should we send gratuitous replies to effect route
shortening?
bool dsragent_salvage_with_cache = true; // should we consult our cache for a route if we get a
xmitfailure // and salvage the packet using the route
if possible
bool dsragent_use_tap = true; // should we listen to a promiscuous tap?
bool dsragent_reply_from_cache_on_propagating = true; // should we consult the route cache before
propagating rt req's and // answer if possible?
bool dsragent_ring_zero_search = true; // should we send a non-propagating route request as
the first action // in each route discovery action?
// NOTE: to completely turn off replying
from cache, you should // set both
dsragent_ring_zero_search and //
dsragent_reply_from_cache_on_propagating to false
bool dsragent_dont_salvage_bad_replies = true; // if we have an xmit failure on a packet, and the packet contains a
// route reply, should we scan the reply to see if
contains the dead link? // if it does, we won't salvage
the packet unless there's something aside // from a reply
in it (in which case we salvage, but cut out the rt reply)
bool dsragent_require_bi_routes = true; // do we need to have bidirectional source routes?
code that assume
8 // [XXX this flag doesn't control all the behaviors and
// bidirectional links -dam 5/14/98]
[email protected]
4
How To Obtain #RREQ/RREP
DSR Trace %d [%d %d] [%d %d %d %d->%d] [%d %d %d %d-
>%d]