Download presentation
Presentation is loading. Please wait.
1
Day 3 Outline Multicast example (from Day 2) Wireless Misc. utilities
Ad hoc routing Other (Mobile IP, Satellite networking) Misc. utilities Assignment available today at 6p.m. Due Friday April 19, 2001 in class.
2
Example: Multicast Routing
Dynamic group membership G2 t=1.2 t=1.3 G2 t=1.4 n2 G1 G2 t=1.5 1.5Mb, 10ms 1.5Mb, 10ms n0 n1 G1 1.5Mb, 10ms G2 n3
3
Ad Hoc Routing Scenario 3 mobile nodes
moving within 670mX670m flat topology using DSDV ad hoc routing protocol Manual Mobility (Ex1) Random Scenario Files (Ex2) TCP and CBR traffic
4
Ex1 – Step 1 # Define Global Variables # create simulator
set ns [new Simulator] # create a topology in a 670m x 670m area set topo [new Topography] $topo load_flatgrid
5
Ex1 – Step 2 # Define standard ns/nam trace # ns trace
set tracefd [open demo.tr w] $ns trace-all $tracefd # nam trace set namtrace [open demo.nam w] $ns namtrace-all-wireless $namtrace
6
Ex1 – Step 3 # Create God (General operations Director) create-god 3 God: store an array of the smallest number of hops required to reach one node to an other Optimal case against which to compare routing protocol performance
7
Ex1 – Step 4 # Define the mobile node components type
$ns node-config \ -addressingType flat -adhocRouting DSDV \ -llType LL \ -macType Mac/802_11 \ -ifqLen 50 \ -ifqType Queue/DropTail/PriQueue \ -antType Antenna/OmniAntenna \ -propType Propagation/TwoRayGround \ -phyType Phy/WirelessPhy \ -channelType Channel/WirelessChannel \ -topoInstance $topo -agentTrace ON \ -routerTrace OFF \ -macTrace OFF
8
Ex1 – Step 5 # Create mobile nodes set node($i) [$ns node]
for {set i 0} {$i < 3} {incr i} { set node($i) [$ns node] # disable random motion $node(0) random-motion 0 }
9
Ex1 – Step 6 $node_(0) set X_ 5.0
# # Provide initial co-ordinates, e.g. $node_(0) set X_ 5.0 $node_(0) set Y_ 2.0 $node_(0) set Z_ 0.0 #produce some node movements, $ns_ at 50.0 "$node_(1) setdest " $ns_ at 10.0 "$node_(0) setdest " $ns_ at "$node_(1) setdest "
10
Ex1 – Step 7 # Create some traffic set tcp [new Agent/TCP]
$tcp set class_ 2 set sink [new Agent/TCPSink] $ns_ attach-agent $node_(0) $tcp $ns_ attach-agent $node_(1) $sink $ns_ connect $tcp $sink set ftp [new Application/FTP] $ftp attach-agent $tcp $ns_ at 10.0 "$ftp start"
11
An Example – Step 8 # Define node initial position in nam
for {set i 0} {$i < 3 } { incr i} { $ns initial_node_position $node($i) 20 } # Tell ns/nam the simulation stop time $ns at “$ns nam-end-wireless 200.0” $ns at “$ns halt” # Start your simulation $ns run
12
Ex2 – Scenario Generation
In the previous example (Ex1), we generated manual traffic and mobility movement. Need to automatically generate Traffic Scenario Mobility Scenario
13
Ex2: Movement Mobile Movement Generator Random movement
setdest -n <num_of_nodes> -p pausetime -s <maxspeed> -t <simtime> -x <maxx> -y <maxy> Random movement $node start Source: ns-2/indep-utils/cmu-scen-gen/setdest/
14
Ex2: A Movement File ... $node_(2) set Z_ 0.000000000000
$node_(2) set Y_ $node_(2) set X_ $node_(1) set Z_ $node_(1) set Y_ $node_(1) set X_ $node_(0) set Z_ $node_(0) set Y_ $node_(0) set X_ $ns_ at "$node_(2) setdest " ...
15
Ex2: Traffic Generating traffic pattern files CBR traffic
ns cbrgen.tcl [-type cbf|tcp] [-nn nodes] [-seed seed] [-mc connections] [-rate rate] TCP traffic ns tcpgen.tcl [-nn nodes] [-seed seed] Source: ns-2/indep-utils/cmu-scen-gen/
16
Ex2: A Traffic File set udp_(0) [new Agent/UDP]
$ns_ attach-agent $node_(0) $udp_(0) set null_(0) [new Agent/Null] $ns_ attach-agent $node_(2) $null_(0) set cbr_(0) [new Application/Traffic/CBR] $cbr_(0) set packetSize_ 512 $cbr_(0) set interval_ 4.0 $cbr_(0) set random_ 1 $cbr_(0) set maxpkts_ 10000 $cbr_(0) attach-agent $udp_(0) $ns_ connect $udp_(0) $null_(0) $ns_ at "$cbr_(0) start" …….
17
Ex2 – Steps 6 and 7 Replace Ex1 steps6 and 7 by
# Define node movement model source [movement-scenario-files] # Define traffic model source [traffic-scenario-files]
18
Energy Extension Energy-aware nodes: -txPower 0.6 -rxPower 0.2
$ns_ node-config \ –energyModel EnergyModel -initialEnergy 100.0 -txPower 0.6 -rxPower 0.2
19
Ns Also Supports Satellite Networks (GEO and LEO) MobileIP Emulation
20
Utilities Tcl debugger Topology generation
Topology generation
21
Tutorial Summary Manual topology generation Routing
Agents (TCP, UDP, etc.) Applications (CBR, FTP, etc.) Error models (packet loss, link failure , etc.) Wireless (ad-hoc networks) Network AniMator (nam)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.