Network simulator 2

13

description

Network simulator 2 : Object-oriented, discrete event driven network simulator It was normally used in wired & wireless protocol Written in C++ and OTcl

Transcript of Network simulator 2

Page 1: Network simulator 2
Page 2: Network simulator 2

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

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

ns Architecture

Tcl

OTcl

TclCL

ns-2

Even

t S

ched

ule

r

Network Components

C/C++

Page 5: Network simulator 2

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

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

Ns – structure

Types

1. Event Schedular2. Turn on Tracing3. Network Topology4.Transport Connection5. Generate Traffic6.Start Simulation

Page 8: Network simulator 2

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

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

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

Trace AnalysisTrace packets on individual linkTracefile format:

Page 12: Network simulator 2

NAM ns has a companion network animator called nam

hence, has been called the nsnam project

Page 13: Network simulator 2

Xgraph One part of the ns-allinone package is 'xgraph', a

plotting program which can be used to create graphic representations of simulation results.