Download - Network simulator 2
![Page 1: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/1.jpg)
![Page 2: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/2.jpg)
What is ns?
Object-oriented, discrete event driven network simulator
It was normally used in wired & wireless protocol Written in C++ and OTcl
![Page 3: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/3.jpg)
ADVANTAGES
1. Debugging of errors makes easy,2. It is cheap doesnot not require any equipment,3. Even an complex scenario can be tested effiently.
![Page 4: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/4.jpg)
ns Architecture
Tcl
OTcl
TclCL
ns-2
Even
t S
ched
ule
r
Network Components
C/C++
![Page 5: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/5.jpg)
Simulation NetworkWired Network
Routing: Distance Vector, Link StateTransportation: TCP and UDPQueuing disciplines: drop-tail
WirelessAd-hoc routing and mobile IP: AODVSensor-MAC, WiMAX (new)Power control in wireless networks
![Page 6: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/6.jpg)
NS2 Functionalities
Traffic models and applications◦ FTP, CBR
Transport protocols◦ Unicast: TCP, UDP
Routing and queuing◦ Wired and ad-hoc routing◦ Queuing protocols: drop-tail, etc
Physical media◦ Wired (point-to-point, LANs), wireless (multiple
propagation models), satellite
![Page 7: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/7.jpg)
Ns – structure
Types
1. Event Schedular2. Turn on Tracing3. Network Topology4.Transport Connection5. Generate Traffic6.Start Simulation
![Page 8: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/8.jpg)
Attaching Transport Agents to Nodes-tcp/udp
TCP :set src [new Agent/TCP/FullTcp]set sink [new Agent/TCP/FullTcp]$ns_ attach-agent $node_(s1) $src$ns_ attach-agent $node_(k1) $sink$ns_ connect $src $sink
![Page 9: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/9.jpg)
Udp agentSet udp0 [new Agent/Null]ns attach-agent $n0 $udp0set cbr0 [new Application/Traffic/CBR]$cbr0 attach-agent $udp0$udp0 set packetSize_ 536 ; #(max=1000)set null0 [new Agent/Null]$ns attach-agent $n1 $null0$ns connect $udp0 $null0
![Page 10: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/10.jpg)
PACKETS
It is the collection of data,whether header is called or not all header files where present in the stack registers.
Cmn header
Ip header
Tcp header
Rtp header
Trace header
Header
data
![Page 11: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/11.jpg)
Trace AnalysisTrace packets on individual linkTracefile format:
![Page 12: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/12.jpg)
NAM ns has a companion network animator called nam
hence, has been called the nsnam project
![Page 13: Network simulator 2](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546cd22daf7959e91e8b6350/html5/thumbnails/13.jpg)
Xgraph One part of the ns-allinone package is 'xgraph', a
plotting program which can be used to create graphic representations of simulation results.