Escolar Documentos
Profissional Documentos
Cultura Documentos
ak
iy
ar
I ss
at
w
Part I: NS2
NS2 Basics
er
Te
by
ed
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 1
Pr
ul
ak
Part I: Outline
iy
ar
• The
Th BBasics
i
ss
– Simulation of computer networks
tworks
I
– Tcl/OTcl Tutorial
at
w
• NS2 Fundamentals
er
– An introduction to NS2
–
–
Linkage Between
Random Number
e O
en
Te
OTcl and C++ in NS2
umber Generators
by
– riven Sim
Event Driven Simulation in NS2
– NS2 Main n Network
N Components
ed
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 2
Pr
ul
ak
iy
ar
I ss
at
w
Simulation of Com
Computer
omp
om Networks
er
Te
by
ed
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 3
Pr
ul
ak
iy
Outline
ar
ss
• Computer Networks
I
• A Study of Computer
er Ne
Networks
at
w
• Time-Dependent
p Simulation
Simu
er
• Example
Te
by
ed
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 4
Pr
ul
ak
iy
Computer Networks
ks
ar
ss
• Computer + Networking
I
at
w
er
Te Networking
by
ed
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 5
Pr
ul
ak
iy
Computer Networks
ks
ar
ss
• Generally, there are so many tasks
I
• Layering Concept: Separate
epar
para
at
functionality
w
er
– OSI M
Model
d l -T
TCP/IP Model
M d l
Application
Presentation Te Application
by
Session
ed
T
Transport
port T
Transport
Network
etwork Network
ar
Data
ata Link Data Link
ep
Textbook:
k: T Physical
Ph
T. Issariyakul Physical
and E. Hossain, Introduction to Network Simulator NS2, Springer 2008. 6
Pr
ul
ak
iy
A Study of Computer Networks
twork
ar
ss
• Suppose you devise a great
g eat pprotocol.
I
How do you show thatt it’s
it s great?
at
w
– Experiment: Put all rou routers together
er
and
d llett people
l use
sse them
tth
– Mathematic mode
a graph h theory
heory
h Te
model: Model routers using
by
– Simulation: Use p
tion: U programming
g g (e.g.,
( g C++
ed
or NS2)
S2) tto represent routers
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 7
Pr
ul
ak
iy
A Study of Computer Networks
twork
ar
ss
Pros Co
Cons
I
at
w
Experiment Realistic Expensive/
er
Sometime not
Te
possible
Mathematic
M h i Insight
I ight
h N d to make
Need k
by
Model assumptions
ed
Simulation •Eas
•Easy (Cheap) Not much insight,
•Used for verification sometimes need to
ar
make
k assumption
ti
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 8
Pr
ul
ak
iy
Time-Dependent Simulation
ulatio
ar
ss
• Most commonly-used
y
I
at
• Simulation proceeds
ds ch
chronologically.
w
er
• Two
T main
i types:
t es
– Time-Driven Sim
– Event-Driven
Simulation
riven Simulation
Te
by
ed
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 9
Pr
ul
ak
iy
Time-Driven Simulation
tion
ar
ss
• Observe the system at a fixed interva
interval.
I
val is assumed to
• Event occurs within an interval
at
occur at the end of the interval
erval
w
• Suppose an interval = ' secon
seconds. Then the
er
simulation proceedss as fol
follows:
by
– a,b,c,d are
eeevents
ent
ed
– a is
i assume
ume to occurred
d at t= 2'
2
– b,c are ass
assume to occurred at t=( 5' )
ar
• The
e simu
simulation finishes at a pre-specified
pre specified time
time.
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 10
Pr
ul
ak
E nt D i n Simulation
Event-Driven Sim l tion
n
riy
sa
• Observe
b every event.
Is
w
• Each event provide a reference
ence to the next event (e.g.,
er
using pointer)
a
Next_event
Te b
Next_event
c
Next_event
by
ed
• Simulation
n finis
finishes
– At a pre-s
pre-specified time
ar
– When
hen there
th
t is no more event
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 11
Pr
ul
ak
iy
Example: Queuing System
ystem
ar
ss
by
ed
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 12
Pr
ul
ak
riy
Example: Queuing System
ystem
sa
Is
r
ee
a
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 13
Pr
ul
ak
riy
Example: Queuing System
ystem
sa
Is
e
Te
a
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 14
Pr
ul
ak
iy
Example: Queuing System
ystem
ar
ss
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008. 15
P
ul
ak
iy
Summary
ar
ss
• Computer Networks = Computer
puter + Networking
I
• A Study of Computer Networks
twor
wor
at
– Experimental
w
er
– Mathematical Model
Te
– Simulation
• Time-Dependent
Tim D p d ntt Simulation
Sim l ti
by
– Time-Driven
en Simu
Simulation
ed
– Event-Driven
E D
Driven Simulation
l
• Example:
ple: A queuing system
ar
ep
Textbook: Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
k: T. Issariyaku 16
Pr