1 day 3 outline multicast example (from day 2) wireless ad hoc routing other (mobile ip, satellite...

21
1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite Other (Mobile IP, Satellite networking) networking) Misc. utilities Misc. utilities Assignment available today at 6p.m. Assignment available today at 6p.m. http://students.washington.edu/abouzeid Due Friday April 19, 2001 in class. Due Friday April 19, 2001 in class.

Post on 21-Dec-2015

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

1

Day 3 Outline Multicast example (from Day 2) Wireless

Ad hoc routing Other (Mobile IP, Satellite networking)Other (Mobile IP, Satellite networking)

Misc. utilitiesMisc. utilities Assignment available today at 6p.m. Assignment available today at 6p.m.

http://students.washington.edu/abouzeid Due Friday April 19, 2001 in class.Due Friday April 19, 2001 in class.

Page 2: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

2

G2t=1.2

G2t=1.4

G1G2

t=1.5

Example: Multicast Routing Dynamic group membership

n0 n1

n2

n3

1.5Mb, 10ms

1.5Mb, 10ms

G1

t=1.3

G2

1.5Mb, 10ms

Page 3: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

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

Page 4: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

4

Ex1 – Step 1# Define Global Variables# create simulatorset ns [new Simulator]

# create a topology in a 670m x 670m areaset topo [new Topography] $topo load_flatgrid 670 670

Page 5: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

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 670 670

Page 6: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

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

Page 7: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

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

Page 8: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

8

Ex1 – Step 5# Create mobile nodes

for {set i 0} {$i < 3} {incr i} {

set node($i) [$ns node]# disable random motion

$node(0) random-motion 0

}

Page 9: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

9

Ex1 – Step 6# # 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 25.0 20.0 15.0"

$ns_ at 10.0 "$node_(0) setdest 20.0 18.0 1.0"

$ns_ at 100.0 "$node_(1) setdest 490.0 480.0 15.0"

Page 10: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

10

Ex1 – Step 7# Create some trafficset 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"

Page 11: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

11

An Example – Step 8# Define node initial position in namfor {set i 0} {$i < 3 } { incr i} {

$ns initial_node_position $node($i) 20}

# Tell ns/nam the simulation stop time $ns at 200.0 “$ns nam-end-wireless 200.0”$ns at 200.0 “$ns halt”

# Start your simulation $ns run

Page 12: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

12

Ex2 – Scenario Generation In the previous example (Ex1), we

generated manual traffic and mobility movement.

Need to automatically generate Traffic Scenario Mobility Scenario

Page 13: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

13

Ex2: Movement

Mobile Movement Generatorsetdest -n <num_of_nodes> -p setdest -n <num_of_nodes> -p pausetime -s <maxspeed> -t pausetime -s <maxspeed> -t <simtime> -x <maxx> -y <maxy><simtime> -x <maxx> -y <maxy>

Random movement $node start$node start Source: ns-2/indep-utils/cmu-ns-2/indep-utils/cmu-scen-gen/setdest/scen-gen/setdest/

Page 14: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

14

Ex2: A Movement File$node_(2) set Z_ 0.000000000000$node_(2) set Y_ 199.373306816804$node_(2) set X_ 591.256560093833$node_(1) set Z_ 0.000000000000$node_(1) set Y_ 345.357731779204$node_(1) set X_ 257.046298323157$node_(0) set Z_ 0.000000000000$node_(0) set Y_ 239.438009831261$node_(0) set X_ 83.364418416244$ns_ at 50.000000000000 "$node_(2) setdest 369.463244915743

170.519203111152 3.371785899154"

...

Page 15: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

15

Ex2: Traffic Generating traffic pattern files

CBR traffic

ns cbrgen.tcl [-type cbf|tcp] [-nn ns cbrgen.tcl [-type cbf|tcp] [-nn nodes] [-seed seed] [-mc connections] nodes] [-seed seed] [-mc connections] [-rate rate][-rate rate]

TCP traffic

ns tcpgen.tcl [-nn nodes] [-seed seed]ns tcpgen.tcl [-nn nodes] [-seed seed] Source: ns-2/indep-utils/cmu-scen-gen/ns-2/indep-utils/cmu-scen-gen/

Page 16: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

16

Ex2: A Traffic Fileset 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 127.93667922166023 "$cbr_(0) start"…….

Page 17: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

17

Ex2 – Steps 6 and 7Replace Ex1 steps6 and 7 by

# Define node movement model source [movement-scenario-files]

# Define traffic modelsource [traffic-scenario-files]

Page 18: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

18

Energy Extension Energy-aware nodes:$ns_ node-config \

–energyModel EnergyModel

-initialEnergy 100.0

-txPower 0.6

-rxPower 0.2

Page 19: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

19

Ns Also Supports Satellite Networks (GEO and LEO) MobileIP Emulation

Page 20: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

20

Utilities Tcl debugger

http://expect.nist.gov/tcl-debug/ Topology generation

http://www.isi.edu/nsnam/ns/ns-topogen.html

Page 21: 1 Day 3 Outline Multicast example (from Day 2) Wireless Ad hoc routing Other (Mobile IP, Satellite networking) Other (Mobile IP, Satellite networking)

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)