ns-2 Network Simulator

Download Report

Transcript ns-2 Network Simulator

The ns-2 Network Simulator

Plan:
– Discuss discrete-event network simulation
– Discuss ns-2 simulator in particular
– Demonstration and examples:
Download, installation, and configuration
 Network topology and traffic modeling
 TCP protocol models, and wireless models
 Simulation results
 Automating simulation scripts

1
Performance Evaluation
Analytical
Methods
Simulation
Methods
Experimental
Methods
...
Time-Driven
Sequential
...
ns-2
Event-Driven
Monte Carlo
Parallel
Distributed
...
2
Discrete-Event Simulation (recap)





A system is modeled as a set of entities
that affect each other via events
Each entity can have a set of states
Events happen at specific points in time
and trigger state changes in the system
Very general technique, well-suited to
modeling discrete systems and networks
Simulator has an event list, and
processes events in timestamp order
3
Network Simulation





In networking research, the simulation
is often of the Internet (or part thereof!)
Entities: hosts, routers, links, buffers,…
Messages: packets sent by protocols
Events: state changes of the network as
packets move through the system
A network simulation models the
movement of data and/or control
packets through the network, according
to the protocols being
modeled
4
ns-2




ns-2: one example of network simulator
Originally developed at USC/ISI
Public-domain (free!), with open-source
code contributed by many people
Versions of ns:
– ns: original version of ns
– ns-2: current version, widely used
– ns-3: currently under development/testing
– pdns: parallel/distributed ns execution
5
Basic Information about ns-2






Widely used in networking research
Written mostly in C++
Over 50,000 lines of code
Can download, compile, and install on
most any Linux system (or Windows?)
Also has tcl/tk interface for defining
and manipulating models
Optional network animation tool (nam)
for tracing, playback, and visualization
6
Using ns-2







Download from ns-2 site
Extract and compile
Look at examples provided
Look at documentation available
Look at ns-2 book (U of Manitoba)
Configure some simple experiments
Try some simulation scripts
7
Strengths of ns-2








Everything you need to get started!
Models for hosts, links, routers, buffers
Detailed protocol models for TCP
Usable for configuring topology
Usable for configuring network traffic
Some modeling for wireless, mobility
Tracing and visualization support
Large community of users and
resources available (doc, examples, etc)
8
Weaknesses of ns-2









Too much stuff to get started! (code,doc)
Minimal protocol models for IP
Weak models for wireless, mobility
Few models for application-layer traffic
Minimal validation of any ns-2 models
Extracting results and statistics is hard
Debugging large and complex models
Cryptic error messages and crashes
Compatibility across ns-2 versions
9
Some ns-2 Examples (1 of 2)

Example 1: TCP Throughput Testing
– Simple dumbbell network topology
– One-way TCP traffic
– Bulk data transfer
– Fixed RTT
– Bottleneck link has finite DropTail buffer
– Throughput is primary metric
10
Some ns-2 Examples (2 of 2)

Example 2: Web Proxy Caching
– Hierarchical network topology
– Two-way TCP traffic
– Web-like data transfers (server to clients)
– Heterogeneous RTTs
– DropTail router buffers
– Response time is primary metric
11
Summary






The ns-2 network simulator is a widely
used platform for networking researchers
Large and cumbersome, yet very useful
Good starting point for many projects
Detailed TCP models available
Limited validation of most ns-2 models
Try it if you want!
12