network simulator 2

Post on 29-Jun-2015

139 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

What is ns?

Object-oriented, discrete event driven network simulator

It was normally used in wired & wireless protocol Written in C++ and OTcl

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.

ns Architecture

Tcl

OTcl

TclCL

ns-2

Even

t S

ched

ule

r

Network Components

C/C++

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

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

Ns – structure

Types

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

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

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

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

Trace AnalysisTrace packets on individual linkTracefile format:

NAM ns has a companion network animator called nam

hence, has been called the nsnam project

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

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

top related