120 likes | 130 Views
NS Fundamentals (contd..). Padma Haldar USC/ISI. Outline. Ns fundamentals – Part I (by Chen) NS fundamentals –Part II NS Internals . Ns Internals. Tcl commands translates into series of object creation plumbing of these objects
E N D
NS Fundamentals (contd..) Padma Haldar USC/ISI
Outline • Ns fundamentals – Part I (by Chen) • NS fundamentals –Part II • NS Internals
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
n0 n1 Port Classifier Multicast Node dmux_ Addr Classifier classifier_ Node entry Node entry dmux_ entry_ entry_ Multicast Classifier classifier_ multiclassifier_ Network Topology: Node Unicast Node 0 0 1 Set ns_ [new Simulator –multicast on] Set n1 [ns_ node] set n0 [ns_ node]
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 or 1 9 11 11 if mcast specified • Different bit allocation possible for specific hier addresses
Hierarchical Node n2 Address classifier To Port demux Node entry Level 3 Level 2 Level 1 ns_ node-config –addressing hier
n0 n1 duplex link n1 entry_ head_ enqT_ queue_ deqT_ link_ ttl_ drophead_ drpT_ tracing simplex link Network Topology: Link [ns_ duplex-link $n0 $n1 5Mb 2ms drop-tail]
dst_=0.0 dst_=1.0 Agent/TCP Agent/TCPSink agents_ agents_ Transport n0 n1 Port Classifier Port Classifier Addr Classifier Addr Classifier 0 0 0 1 dmux_ dmux_ entry_ entry_ classifier_ classifier_ set tcp [new Agent/TCP] ns_ attach-agent $n0 $tcp set tcpsink [new Agent/TCPSink] ns_ attach-agent $n1 $tcpsink ns_ connect $tcp $tcpsink
Application/FTP dst_=0.0 dst_=1.0 Application: Traffic Generator n0 n1 Port Classifier Port Classifier Agent/TCPSink Addr Classifier Addr Classifier Agent/TCP 0 0 agents_ agents_ 0 1 dmux_ dmux_ entry_ entry_ classifier_ classifier_ set ftp [new Application/FTP] $ftp attach-agent $tcp $ns at 1.2 “$ftp start”
n0 n1 Application/FTP Port Classifier Addr Classifier n1 entry_ 0 Node entry head_ dmux_ enqT_ queue_ deqT_ link_ ttl_ 1 entry_ classifier_ drophead_ drpT_ Routing Agent/TCP 0 agents_
n0 n1 Application/FTP Port Classifier Port Classifier Addr Classifier Addr Classifier 1 0 dmux_ dmux_ 0 1 entry_ entry_ classifier_ classifier_ Link n1-n0 Routing (con’t) Agent/TCP Agent/TCP agents_ Link n0-n1
dst_=0.0 dst_=1.0 0 1 1 0 Plumbing: Packet Flow n0 n1 Application/FTP Port Classifier Port Classifier Agent/TCPSink Addr Classifier Addr Classifier Agent/TCP 0 0 Link n0-n1 entry_ entry_ Link n1-n0