NS2 Tutorial From Internet
NS2 Tutorial From Internet
Motivation: Overview:
Learn fundamentals of fundamentals of discrete
evaluating network event simulation
performance via ns-2 simulation
simulation
observer
program boundary
advantages:
– sometimes cheaper
– find bugs (in design) in advance
– generality: over analytic/numerical techniques
– detail: can simulate system details at arbitrary level
drawbacks:
– caution: does model reflect reality
– large scale systems: lots of resources to simulate
(especially accurately simulate)
– may be slow (computationally expensive – 1 min real
time could be hours of simulated time)
– art: determining right level of model complexity
– statistical uncertainty in results
5 *Jim Kurose, University of Massachu
sets, Amherst
The evaluation spectrum*
Numerical models
Simulation
Emulation
Prototype
Operational system
What is it?
How do I get it?
How do I use it?
How do I add to it?
Documentation
Bug-Fixing
Network Simulator
A package of tools that simulates behavior of
networks
– Create Network Topologies
– Log events that happen under any load
– Analyze events to understand the network
behavior
5Mbps, 300Kbps,
10ms 100ms
n1 n5
n3
500Kbps,
50ms
n4
n2
2Mbps, n6
300Kbps,
20ms
100ms
Nodes
– Set properties like queue length, location
– Protocols, routing algorithms
Links
– Set types of link – Simplex, duplex, wireless,
satellite
– Set bandwidth, latency etc.
Done through tcl Scripts
13 Vacha Dave, University of Texas at A
ustin
Observing Network Behavior
time
NAM:
– Network Animator
– A visual aid showing how packets flow along the
network
We’ll see a demo..
What is it?
How do I get it?
How do I use it?
How do I add to it?
Documentation
Bug-Fixing
What is it?
How do I get it?
How do I use it?
How do I add to it?
Documentation
Bug-Fixing
Bandwidth:1Mbps
Latency: 10ms
n1 n2
exit 0
22 } Vacha Dave, University of Texas at A
ustin
Creating the topology (Contd)
#create two nodes
set n0 [$ns node]
set n1 [$ns node]
udp
null
cbr
node
agent
Packet Size: 500 bytes
rate: 800Kbps source
link
cbr traffic
Taken from NS by
Example by Jae Chung
and
Mark Claypool
What is it?
How do I get it?
How do I use it?
How do I add to it?
Documentation
Bug-Fixing
What is it?
How do I get it?
How do I use it?
How do I add to it?
Documentation
Bug-Fixing
NS2 Manual
– Information about Otcl interpreter, C++ class
hierarchy, parameters for various protocols
– http://www.isi.edu/nsnam/ns/doc/index.html
– Very detailed, useful when looking for something
specific, like:
What are the shadowing models available for wireless?
How do I select them?
How do I make my routing strategy to be Distance
Vector routing?
Tcl Tutorial
– http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
Tcl Manual
– All commands and their explanation
– http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm
What is it?
How do I get it?
How do I use it?
How do I add to it?
Documentation
Bug-Fixing