Transport Layer3-1 Transport Layer Ram Dantu (compiled from various text books)
Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.
-
Upload
corey-wilkinson -
Category
Documents
-
view
212 -
download
0
Transcript of Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.
![Page 1: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/1.jpg)
Use of Mobility models in ns-2
Karthik DantuShyam Kapadia
![Page 2: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/2.jpg)
Random Waypointsetdest –n <num nodes> –p <pause time> –s
<speed> –t <Time> –x <x> –y <y> Parameters
Number of nodes (N) Pause Time (P) Max speed (S) Simulation Time (T) Max X (X) Max Y(Y)
Eg: ./setdest -n 10 -p 4 -s 5 -t 10 -x 500 -y 500 > scen-10-4-500
![Page 3: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/3.jpg)
Traffic generation User cbrgen.tcl
Syntax: ns cbrgen.tcl [-type cbr|tcp] [-nn nodes] –seed [seed] [-mc connections] [-rate rate]
Eg: ns cbrgen.tcl -type cbr -nn 3 -seed 43578 -mc 2 -rate 10.0 > cbr-3-2-10
Similarly TCP traffic can be generated
![Page 4: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/4.jpg)
Pre-generated Scenarios ~ns/ns-2.1b8a/tcl/mobility/sceneScen-1500x300-60-0-20-2
Area – 1500x300 Nodes – 60 Pause time – 0.0 Max speed – 20.00 Time 900s
Other files Scen-670X670-50-600-20-0, Scen-670X670-
50-600-20-1, Scen-670X670-50-600-20-2
![Page 5: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/5.jpg)
Pre-generated traffic patterns ~ns/ns-2.1b8a/tcl/mobility/scenecbr-50-10-4-512
Nodes – 50 Max. Connections – 10 Seed – 95813843.243 Send Interval – 4.0
Other Examplescbr-10-1-10-20, cbr-50-20-4-512, cbr-3-
test
![Page 6: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/6.jpg)
Usage in ns scripts Mobility model and traffic pattern
files are input to the ns scriptEg: .. From wireless-test.tcl
set opt(cp) "../mobility/scene/cbr-3-test"set opt(sc) "../mobility/scene/scen-3-test”……Source $opt(cp)Source $opt(sc)
![Page 7: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/7.jpg)
Viewing traces Trace file – Needs to be parsed Use awk or perl script athttp://nile.wpi.edu/NS/Example/columnr 160.093884945 _9_ RTR --- 1 tcp 1492 [a2 4 6 800] -------
[655 36:0 16777984:0 31 16777984:0] [1 0] 2 0Eg: cat out.tr | grep “RTR” | awk ‘{print $2}’ > rtr-time.trGives trace of times of RTR packets.Revised Trace Format s -t 0.267662078 -Hs 0 -Hd -1 -Ni 0 -Nx 5.00 -Ny 2.00 -Nz
0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.255 -Id -1.255 -It message -Il 32 -If 0 -Ii 0 -Iv 32
- detailed explanation in NS Manual Chapter 16
![Page 8: Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.](https://reader036.fdocuments.us/reader036/viewer/2022081908/5697c00f1a28abf838cca8bf/html5/thumbnails/8.jpg)
Visualization Using nam
Enable tracing1. $ns_ namtrace-all-wireless <namtrace>
<x> <y>2. $mobilenode namattach <namtracefd>
$ns_ node-config - agentTrace ON - routerTrace ON - macTrace ON