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

Post on 21-Dec-2015

218 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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.

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

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 simulatorset ns [new Simulator]

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

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

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

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# # 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"

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"

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

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

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"

...

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/

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"…….

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]

18

Energy Extension Energy-aware nodes:$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

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

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

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)

top related