2. What is ns?
Object-oriented, discrete event driven network
simulator
It was normally used in wired & wireless protocol
Written in C++ and OTcl
3. 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.
5. Simulation Network
Wired Network
Routing: Distance Vector, Link State
Transportation: TCP and UDP
Queuing disciplines: drop-tail
Wireless
Ad-hoc routing and mobile IP: AODV
Sensor-MAC, WiMAX (new)
Power control in wireless networks
6. 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
8. 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
9. Udp agent
Set udp0 [new Agent/Null]
ns attach-agent $n0 $udp0
set 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
10. 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
12. NAM
ns has a companion network animator called nam
hence, has been called the nsnam project
13. Xgraph
One part of the ns-allinone package is 'xgraph', a
plotting program which can be used to create graphic
representations of simulation results.