Documente Academic
Documente Profesional
Documente Cultură
Sankar.P, AP\ECE
27-1-2012
Network Simulation
Motivation: Learn fundamentals of evaluating network performance via simulation
27-1-2012
What is simulation?
system boundary exogenous inputs to system (the environment) system under study (has deterministic rules governing its behavior) real life
observer
Program boundary
simulated life
3
observer
Why Simulation?
real-system not available, is complex/costly or dangerous (eg: space simulations, flight simulations) quickly evaluate design alternatives (eg: different system configurations) evaluate complex functions for which closed form formulas or numerical techniques not available
27-1-2012 Jerusalem College of Engineering 4
Simulation: advantages/drawbacks*
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
27-1-2012 Jerusalem College of Engineering 5
100K lines of C++ 70K lines of OTcl 30K lines of test suite 20K lines of documentation
Jerusalem College of Engineering 6
What is NS2
Discrete event 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
27-1-2012
C++
OTcl
27-1-2012
Using NS2
Problem
Result analysis
Simulation model
Modify ns
27-1-2012
11
NS2 environment
27-1-2012
12
Simulation setup
Create event scheduler (Calendar scheduling ). Turn on tracing. Create network. Setup routing and Insert errors. Create transport connection. Create traffic. Transmit application level data. Trace out the simulated output using trace file and nam view.
27-1-2012 Jerusalem College of Engineering 13
Simulation Configurations
Copy the implemented algorithms in to queue folder in NS2 (nsallinone2.29/ns2.29/queue). Change the default settings of the file nsdefault.tcl (nsallinone2.29/ns2.29/tcl/lib/ ns-default.tcl). Change the settings in the Makefile.in for creating object files. Configure the network using ./configure.
27-1-2012
14
Cont..
Make the new environment for simulation. Write the tcl code for create the network topology and simulation Create traffic and analyze the network using trace and verify the packet flow using network animator.
27-1-2012
15
Wired Network
27-1-2012
16
Coding(Cont)
27-1-2012
17
Coding(Cont)
27-1-2012
18
Coding(Cont)
27-1-2012
19
Network Created
27-1-2012
20
OUTPUT (FLOW 1)
27-1-2012
21
Output(Flow 2)
27-1-2012
22
Output (congestion)
27-1-2012
23
27-1-2012
24
+ 1 0 2 cbr 210 ------- 0 0.0 3.1 0 0 - 1 0 2 cbr 210 ------- 0 0.0 3.1 0 0 r 1.00234 0 2 cbr 210 ------- 0 0.0 3.1 0 0
27-1-2012
25
27-1-2012
26
Inserting Errors
Creating Error Module
set loss_module [new ErrorModel] $loss_module set rate_ 0.01 $loss_module unit pkt $loss_module ranvar [new RandomVariable/Uniform] $loss_module drop-target [new Agent/Null]
Inserting Error Module
27-1-2012
27
Network Dynamics
Link failures Hooks in routing module to reflect routing changes Four models $ns rtmodel Trace <config_file> $n0 $n1 config_file> $ns rtmodel Exponential {<params>} $n0 $n1 {<params>} $ns rtmodel Deterministic {<params>} $n0 {<params>} $n1 $ns rtmodel-at <time> up|down $n0 $n1 rtmodelParameter list [<start>] <up_interval> up_interval> <down_interval> down_interval> [<finish>]
27-1-2012
28
Wireless network
27-1-2012
29
27-1-2012
30
Cont
27-1-2012
31
Cont
27-1-2012
32
27-1-2012
33
27-1-2012
34
27-1-2012
35
Setting up variables
27-1-2012
36
Cont
27-1-2012
37
27-1-2012
38
Configuring Movement
27-1-2012
39
27-1-2012
40
27-1-2012
41
Trace File
27-1-2012
42
27-1-2012
43
Cont
27-1-2012
44
Cont
27-1-2012
45
Support Materials
Wireless support in ns continuously evolving Many other contributed models (not integrated into ns distribution) include: Mobiwan, GPRS, Bluehoc and blueware, CIMS etc Available from ns contributed code page at http://www.isi.edu/nsnam/ns/nscontri buted.html Marc Greis Tutorial
27-1-2012 Jerusalem College of Engineering 46
Thank You
27-1-2012
47