ns fundamentals 2 - isi.edu internals ntclcommands translates into nseries of object creation...

Post on 11-Mar-2018

216 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

NS Fundamentals (contd..)

Padma HaldarUSC/ISI

2

Outline

n Ns fundamentals – Part I (by Chen)n NS fundamentals –Part IIn NS Internals

3

Ns Internals

n Tcl commands translates into n series of object creation n plumbing of these objects

n Step-by-step review of how each network component gets set up in ns

4

Network Topology: Node

n0 n1

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

Node entry

Unicast Node

Multicast Classifier

classifier_

dmux_

entry_

Node entry

Multicast Node

multiclassifier_

set n0 [ns_ node] Set ns_ [new Simulator –multicast on]Set n1 [ns_ node]

0 0

1

5

Node Addressing

n Two basic address styles available: flat and hierarchical

n Default flat address: 32 bits each for node and port id

n Default hier address: n 3 levels of hierarchyn 10 11 11 or 1 9 11 11 if mcast specified

n Different bit allocation possible for specific hier addresses

6

Hierarchical Node

n2

Nodeentry

Level 1Level 2

Level 3

Addressclassifier To Port

demux

ns_ node-config –addressing hier

7

Network Topology: Link

n0 n1

enqT_ queue_ deqT_

drophead_ drpT_

link_ ttl_

n1 entry_head_

tracing simplex link

duplex link

[ns_ duplex-link $n0 $n1 5Mb 2ms drop-tail]

8

Transport

n0 n1

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

Agent/TCP

agents_

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

Agent/TCPSink

agents_

dst_=1.0 dst_=0.0

set tcp [new Agent/TCP]ns_ attach-agent $n0 $tcp

set tcpsink [new Agent/TCPSink]ns_ attach-agent $n1 $tcpsink

ns_ connect $tcp $tcpsink

0

0

1

0

9

Application: Traffic Generator

n0 n1

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

Agent/TCP

agents_

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

Agent/TCPSink

agents_

dst_=1.0 dst_=0.0Application/FTP

set ftp [new Application/FTP]$ftp attach-agent $tcp$ns at 1.2 “$ftp start”

0

0

1

0

10

Routing

n0 n1

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

Node entry 01 enqT_ queue_ deqT_

drophead_ drpT_

link_ ttl_

n1 entry_

head_

0 Agent/TCP

agents_

Application/FTP

11

Routing (con’t)

n0 n1

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

01

Addr Classifier

Port Classifier

classifier_

dmux_

entry_

10

Link n0-n1

Link n1-n0

Agent/TCP

agents_

Application/FTP

Agent/TCP

12

Plumbing: Packet Flow

01

n0 n1

Addr Classifier

Port Classifier

entry_

0 Agent/TCP Addr Classifier

Port Classifier

entry_

10

Link n0-n1

Link n1-n0

0 Agent/TCPSink

dst_=1.0 dst_=0.0Application/FTP

top related