1
NS Fundamentals (contd..) Padma Haldar USC/ISI 1 Outline Ns - - PowerPoint PPT Presentation
NS Fundamentals (contd..) Padma Haldar USC/ISI 1 Outline Ns - - PowerPoint PPT Presentation
NS Fundamentals (contd..) Padma Haldar USC/ISI 1 Outline Ns fundamentals Part I (by Chen) NS fundamentals Part II NS Internals 2 Ns Internals Tcl commands translates into series of object creation plumbing of
2
Outline
Ns fundamentals – Part I (by Chen) NS fundamentals –Part II
NS Internals
3
Ns Internals
Tcl commands translates into
series of object creation plumbing of these objects
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] 1
5
Node Addressing
Two basic address styles available: flat and
hierarchical
Default flat address: 32 bits each for node
and port id
Default hier address:
3 levels of hierarchy 10 11 11
- r 1 9 11 11 if mcast specified
Different bit allocation possible for specific
hier addresses
6
Hierarchical Node
n2
Node entry Level 1 Level 2 Level 3 Address classifier 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 1
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.0 Application/FTP
set ftp [new Application/FTP] $ftp attach-agent $tcp $ns at 1.2 “$ftp start” 1
10
Routing
n0 n1
Addr Classifier Port Classifier classifier_ dmux_ entry_ Node entry
1
enqT_ queue_ deqT_ drophead_ drpT_ link_ ttl_ n1 entry _ head_ Agent/TCP agents_ Application/FTP
11
Routing (con’t)
n0 n1
Addr Classifier Port Classifier classifier_ dmux_ entry_
1
Addr Classifier Port Classifier classifier_ dmux_ entry_
1
Link n0-n1 Link n1-n0 Agent/TCP agents_ Application/FTP Agent/TCP
12
Plumbing: Packet Flow
1
n0 n1
Addr Classifier Port Classifier entry_ Agent/TCP Addr Classifier Port Classifier entry_
1
Link n0-n1 Link n1-n0 Agent/TCPSink dst_= 1.0 dst_= 0.0 Application/FTP