Download presentation
Presentation is loading. Please wait.
Published byCorey Wilkinson Modified over 9 years ago
1
Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia
2
Random Waypoint setdest –n –p –s –t –x –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
3
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
4
Pre-generated Scenarios ~ns/ns-2.1b8a/tcl/mobility/scene Scen-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
5
Pre-generated traffic patterns ~ns/ns-2.1b8a/tcl/mobility/scene cbr-50-10-4-512 Nodes – 50 Max. Connections – 10 Seed – 95813843.243 Send Interval – 4.0 Other Examples cbr-10-1-10-20, cbr-50-20-4-512, cbr-3-test
6
Usage in ns scripts Mobility model and traffic pattern files are input to the ns script Eg:.. 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)
7
Viewing traces Trace file – Needs to be parsed Use awk or perl script at http://nile.wpi.edu/NS/Example/column r 160.093884945 _9_ RTR --- 1 tcp 1492 [a2 4 6 800] ------- [655 36:0 16777984:0 31 16777984:0] [1 0] 2 0 Eg: cat out.tr | grep “RTR” | awk ‘{print $2}’ > rtr-time.tr Gives 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
8
Visualization Using nam Enable tracing 1. $ns_ namtrace-all-wireless 2. $mobilenode namattach $ns_ node-config - agentTrace ON - routerTrace ON - macTrace ON
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.