Helsinki University of Tehnology Departmen t of Eletrial and - - PDF document

helsinki university of te hnology departmen t of ele tri
SMART_READER_LITE
LIVE PREVIEW

Helsinki University of Tehnology Departmen t of Eletrial and - - PDF document

Helsinki University of Tehnology Departmen t of Eletrial and Comm uniation Engineering S-38.180 Qualit y of Servie in In ternet Home assignmen t 1: Sim ulation of Rate Con trol me hanisms Due date: 31.10.2001


slide-1
SLIDE 1 Helsinki University
  • f
Te hnology Departmen t
  • f
Ele tri al and Comm uni ation Engineering S-38.180 Qualit y
  • f
Servi e in In ternet Home assignmen t 1: Sim ulation
  • f
Rate Con trol me hanisms Due date: 31.10.2001 at 1200 hours Deliv ery: P ap er rep
  • rt
to
  • urse
lo k er at G-wing 2nd
  • r
slide-2
SLIDE 2 Con ten ts Con ten ts i 1 In tro du tion 1 1.1 Net w
  • rk
Sim ulator 2 . . . . . . . . . . . . . . . . . . . . . . . 2 2 Sim ulator
  • de
3 2.1 Create top
  • logy
. . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.1 No des . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.2 Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.3 Building Dieren tiated Servi es . . . . . . . . . . . . . 13 2.2 Probing the information . . . . . . . . . . . . . . . . . . . . . 14 2.2.1 Starting ev en t monitoring . . . . . . . . . . . . . . . . 15 2.2.2 T ra e le format . . . . . . . . . . . . . . . . . . . . . 15 2.3 Con trolling sim ulation . . . . . . . . . . . . . . . . . . . . . . 16 3 Exer ise 19 i
slide-3
SLIDE 3 Chapter 1 In tro du tion This is
  • urse
w
  • rk
for
  • urse
S-38.180 Qualit y
  • f
Servi e in In ternet. This exer ise mak es y
  • u
familiar with: 1. ns2. A net w
  • rk
sim ulator whi h is
  • ne
  • f
the most used sim ulation to
  • ls
in a ademi w
  • rld.
2. Rate
  • n
trol me hanisms whi h
  • uld
b e used to mark, limit
  • r
shap e the In ternet tra T
  • l
is installed in to departmen t w
  • rkstation
ro
  • m
in to SUN w
  • rksta-
tions. Y
  • u
need to run it there. Program an b e lo ated from path /pr
  • j/b
  • nes/ns2/.
T
  • b
e able to use it y
  • u
m ust rst run
  • mmand
/pr
  • j/b
  • nes/ns2/ns-al
linone-2.1b8/use, whi h tells y
  • u
the format
  • f
en- vironmen t sp e i use
  • mmand.
T yping the
  • mmand
  • utputted
b y generi use, y
  • u
will set all en vironmen t v ariables required to run ns2. Mak e w
  • rking
dire tory in to y
  • ur
home dire tory and
  • p
y le /pr
  • j/b
  • nes/ns2/ns-al
linone-2.1b8/work/ examp le.t l to it. This le is the
  • re
whi h y
  • u
m ust mo dify during the w
  • rk.
Departmen t has set quotas to w
  • rkstations,
so y
  • u
ha v e to run y
  • ur
sim ula- tions in /tmp dire tory
  • f
w
  • rkstations.
Mak e temp
  • rary
w
  • rking
dire tory under /tmp. Cop y pro essed results to y
  • ur
w
  • rking
dire tory and delete temp
  • rary
w
  • rking
dire tory . 1
slide-4
SLIDE 4 CHAPTER 1. INTR ODUCTION 1.1 Net w
  • rk
Sim ulator 2 T
  • l
used in this exer ise is network simulator 2. It is freely a v ailabale and distributable
  • b
je t
  • rien
ted sim ulator. In glan e, it
  • n
tains k ernel
  • de
dev elop ed in C++. This k ernel
  • de
  • n
tains lass hierar hies for ready made building blo ks. These building blo ks are translated to Ot l to mak e
  • nstru tion
  • f
'qui k and dirt y' sim ulations easier. Y
  • u
ma y w an t to b e ome familiar with the to
  • l
b efore starting y
  • ur
w
  • rk.
ns2 homepage is in h ttp://www.isi.edu/nsnam/ns/index.h tml. Re omendend reading is the tutorial page in h ttp://www.isi.edu/nsnam/ns/tutorial/index.h tml. 2
slide-5
SLIDE 5 Chapter 2 Sim ulator
  • de
This hapter presen t sim ulator
  • de
whi h is used in this exer ise. F
  • llo
wing listing sho ws whole
  • de
as
  • ne
unit. T
  • b
e ome familiar the stru ture
  • f
ns, w e disse t
  • de
in to p ea es and explain what they do in detail. set ns [new Simulator℄ set rate1 2000000 set ir1 1500000 set rate2 2000000 set ir2 1500000 set ir3 1500000 set ir4 1500000 set ir5 1000000 set ir6 1000000 set ir7 1000000 set ir8 1000000 set ir9 set ir10 set testTime 50 set pa ketSize 1000 # Open a file for writing the tra e data set tra e_all [open
  • ut.all
w℄ # Tra e all events for post pro essing with animator (nam)
  • r
with any #
  • ther
software $ns tra e-all $tra e_all 3
slide-6
SLIDE 6 CHAPTER 2. SIMULA TOR CODE # Set up the network topology shown at the top
  • f
this file: set s1 [$ns node℄ set s2 [$ns node℄ set s3 [$ns node℄ set s4 [$ns node℄ set s5 [$ns node℄ set s6 [$ns node℄ set s7 [$ns node℄ set s8 [$ns node℄ set s9 [$ns node℄ set s10 [$ns node℄ set e1 [$ns node℄ set e2 [$ns node℄ set dest [$ns node℄ $ns duplex-link $s1 $e1 10Mb 5ms DropTail $ns duplex-link $s2 $e1 10Mb 5ms DropTail $ns duplex-link $s3 $e1 10Mb 5ms DropTail $ns duplex-link $s4 $e1 10Mb 5ms DropTail $ns duplex-link $s5 $e1 10Mb 5ms DropTail $ns duplex-link $s6 $e1 10Mb 5ms DropTail $ns duplex-link $s7 $e1 10Mb 5ms DropTail $ns duplex-link $s8 $e1 10Mb 5ms DropTail $ns duplex-link $s9 $e1 10Mb 5ms DropTail $ns duplex-link $s10 $e1 10Mb 5ms DropTail $ns simplex-link $e1 $e2 10Mb 5ms dsRED/edge $ns simplex-link $e2 $e1 10Mb 5ms dsRED/edge $ns duplex-link $e2 $dest 10Mb 5ms DropTail $ns duplex-link-op $e1 $e2
  • rient
right $ns duplex-link-op $e2 $dest
  • rient
right set qE1E2 [[$ns link $e1 $e2℄ queue℄ set qE2E1 [[$ns link $e2 $e1℄ queue℄ # Set DS RED parameters from Edge1 to Core: $qE1E2 meanPktSize $pa ketSize $qE1E2 set numQueues_ 2 $qE1E2 setNumPre 2 $qE1E2 addPoli yEntry [$s1 id℄ [$dest id℄ TSW2CM 20 $ ir1 $qE1E2 addPoli yEntry [$s2 id℄ [$dest id℄ TSW2CM 20 $ ir2 $qE1E2 addPoli yEntry [$s3 id℄ [$dest id℄ TSW2CM 10 $ ir3 $qE1E2 addPoli yEntry [$s4 id℄ [$dest id℄ TSW2CM 10 $ ir4 $qE1E2 addPoli yEntry [$s5 id℄ [$dest id℄ TSW2CM 10 $ ir5 $qE1E2 addPoli yEntry [$s6 id℄ [$dest id℄ TSW2CM 10 $ ir6 $qE1E2 addPoli yEntry [$s7 id℄ [$dest id℄ TSW2CM 10 $ ir7 $qE1E2 addPoli yEntry [$s8 id℄ [$dest id℄ TSW2CM 10 $ ir8 4
slide-7
SLIDE 7 $qE1E2 addPoli yEntry [$s9 id℄ [$dest id℄ TSW2CM 10 $ ir9 $qE1E2 addPoli yEntry [$s10 id℄ [$dest id℄ TSW2CM 10 $ ir10 $qE1E2 addPoli erEntry TSW2CM 10 11 $qE1E2 addPoli erEntry TSW2CM 20 21 $qE1E2 addPHBEntry 10 $qE1E2 addPHBEntry 11 1 $qE1E2 addPHBEntry 20 $qE1E2 addPHBEntry 21 1 1 $qE1E2
  • nfigQ
10 40 0.02 $qE1E2
  • nfigQ
1 10 40 0.10 $qE1E2
  • nfigQ
1 1 1 # Set DS RED parameters from Edge2 to Core: $qE2E1 meanPktSize $pa ketSize $qE2E1 set numQueues_ 2 $qE2E1 setNumPre 2 $qE2E1 addPoli yEntry [$dest id℄ [$s1 id℄ TSW2CM 20 $ ir1 $qE2E1 addPoli yEntry [$dest id℄ [$s2 id℄ TSW2CM 20 $ ir2 $qE2E1 addPoli yEntry [$dest id℄ [$s3 id℄ TSW2CM 10 $ ir3 $qE2E1 addPoli yEntry [$dest id℄ [$s4 id℄ TSW2CM 10 $ ir4 $qE2E1 addPoli yEntry [$dest id℄ [$s5 id℄ TSW2CM 10 $ ir5 $qE2E1 addPoli yEntry [$dest id℄ [$s6 id℄ TSW2CM 10 $ ir6 $qE2E1 addPoli yEntry [$dest id℄ [$s7 id℄ TSW2CM 10 $ ir7 $qE2E1 addPoli yEntry [$dest id℄ [$s8 id℄ TSW2CM 10 $ ir8 $qE2E1 addPoli yEntry [$dest id℄ [$s9 id℄ TSW2CM 10 $ ir9 $qE2E1 addPoli yEntry [$dest id℄ [$s10 id℄ TSW2CM 10 $ ir10 $qE2E1 addPoli erEntry TSW2CM 10 11 $qE2E1 addPoli erEntry TSW2CM 20 21 $qE2E1 addPHBEntry 10 $qE2E1 addPHBEntry 11 1 $qE2E1 addPHBEntry 20 $qE2E1 addPHBEntry 21 1 1 $qE2E1
  • nfigQ
10 40 0.02 $qE2E1
  • nfigQ
1 10 40 0.10 $qE2E1
  • nfigQ
1 1 1 # Set up
  • ne
CBR
  • nne tion
between ea h sour e and the destination: set udp1 [new Agent/UDP℄ $ns atta h-agent $s1 $udp1 set br1 [new Appli ation/Traffi /CBR℄ $ br1 atta h-agent $udp1 $ br1 set pa ket_size_ $pa ketSize $udp1 set pa ketSize_ $pa ketSize $ br1 set rate_ $rate1 set null1 [new Agent/Null℄ $ns atta h-agent $dest $null1 $ns
  • nne t
$udp1 $null1 set udp2 [new Agent/UDP℄ 5
slide-8
SLIDE 8 CHAPTER 2. SIMULA TOR CODE $ns atta h-agent $s2 $udp2 set br2 [new Appli ation/Traffi /CBR℄ $ br2 atta h-agent $udp2 $ br2 set pa ket_size_ $pa ketSize $udp2 set pa ketSize_ $pa ketSize $ br2 set rate_ $rate2 set null2 [new Agent/Null℄ $ns atta h-agent $dest $null2 $ns
  • nne t
$udp2 $null2 set t p3 [new Agent/TCP℄ $ns atta h-agent $s3 $t p3 set ftp3 [new Appli ation/FTP℄ $ftp3 atta h-agent $t p3 $t p3 set pa ketSize_ $pa ketSize set sink3 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink3 $ns
  • nne t
$t p3 $sink3 set t p4 [new Agent/TCP℄ $ns atta h-agent $s4 $t p4 set ftp4 [new Appli ation/FTP℄ $ftp4 atta h-agent $t p4 $t p4 set pa ketSize_ $pa ketSize set sink4 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink4 $ns
  • nne t
$t p4 $sink4 set t p5 [new Agent/TCP℄ $ns atta h-agent $s5 $t p5 set ftp5 [new Appli ation/FTP℄ $ftp5 atta h-agent $t p5 $t p5 set pa ketSize_ $pa ketSize set sink5 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink5 $ns
  • nne t
$t p5 $sink5 set t p6 [new Agent/TCP℄ $ns atta h-agent $s6 $t p6 set ftp6 [new Appli ation/FTP℄ $ftp6 atta h-agent $t p6 $t p6 set pa ketSize_ $pa ketSize set sink6 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink6 $ns
  • nne t
$t p6 $sink6 set t p7 [new Agent/TCP℄ $ns atta h-agent $s7 $t p7 6
slide-9
SLIDE 9 set ftp7 [new Appli ation/FTP℄ $ftp7 atta h-agent $t p7 $t p7 set pa ketSize_ $pa ketSize set sink7 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink7 $ns
  • nne t
$t p7 $sink7 set t p8 [new Agent/TCP℄ $ns atta h-agent $s8 $t p8 set ftp8 [new Appli ation/FTP℄ $ftp8 atta h-agent $t p8 $t p8 set pa ketSize_ $pa ketSize set sink8 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink8 $ns
  • nne t
$t p8 $sink8 set t p9 [new Agent/TCP℄ $ns atta h-agent $s9 $t p9 set ftp9 [new Appli ation/FTP℄ $ftp9 atta h-agent $t p9 $t p9 set pa ketSize_ $pa ketSize set sink9 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink9 $ns
  • nne t
$t p9 $sink9 set t p10 [new Agent/TCP℄ $ns atta h-agent $s10 $t p10 set ftp10 [new Appli ation/FTP℄ $ftp10 atta h-agent $t p10 $t p10 set pa ketSize_ $pa ketSize set sink10 [new Agent/TCPSink℄ $ns atta h-agent $dest $sink10 $ns
  • nne t
$t p10 $sink10 pro finish {} { global ns tra e_all lose $tra e_all #Following are awk s ripts to pro ess tra e
  • f
all events. exe awk { { if (($1 == "r") && ($4 == "12")) print $2, $9, $6 } }
  • ut.all
>
  • ut.re
7
slide-10
SLIDE 10 CHAPTER 2. SIMULA TOR CODE exit } $qE1E2 printPoli yTable $qE1E2 printPoli erTable $ns at 0.0 "$ br1 start" $ns at 0.0 "$ br2 start" $ns at 0.0 "$ftp3 start" $ns at 0.0 "$ftp4 start" $ns at 0.0 "$ftp5 start" $ns at 0.0 "$ftp6 start" $ns at 0.0 "$ftp7 start" $ns at 0.0 "$ftp8 start" $ns at 0.0 "$ftp9 start" $ns at 0.0 "$ftp10 start" $ns at 10.0 "$qE1E2 printStats" $ns at 20.0 "$qE1E2 printStats" $ns at 30.0 "$qE1E2 printStats" $ns at 40.0 "$qE1E2 printStats" $ns at $testTime "$ br1 stop" $ns at $testTime "$ br2 stop" $ns at $testTime "$ftp3 stop" $ns at $testTime "$ftp4 stop" $ns at $testTime "$ftp5 stop" $ns at $testTime "$ftp6 stop" $ns at $testTime "$ftp7 stop" $ns at $testTime "$ftp8 stop" $ns at $testTime "$ftp9 stop" $ns at $testTime "$ftp10 stop" $ns at [expr $testTime + 1.0℄ "finish" $ns run 2.1 Create top
  • logy
T
  • p
  • logy
in ns is based
  • n
  • lle tion
  • f
no des and links. T
  • p
  • logy
is ba- si requiremen t for the su esful sim ulation
  • f
parti ular s enario. Therefore top
  • logy
is so alled base requiremen t and
  • mp
  • nen
ts
  • d
top
  • logy
are de- ned in base lev el
  • f
ns. This is easily dete table with the de larations whi h start b y $ns. 8
slide-11
SLIDE 11 2.1. CREA TE TOPOLOGY

E2 E1 S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 Dest

Figure 2.1: T
  • p
  • logy
  • f
sim ulation 2.1.1 No des There is no dieren tiation b et w een end systems and routers in reation
  • f
top
  • logy
, i.e. ea h no de an b e end system and/or router. No de is reated with
  • mmand
set s1 [$ns node℄ s1 is the name for the no de whi h is later
  • n
used as p
  • in
ter to the no de. [$ns node℄ tells to the ns that prop erties
  • f
lass no de should b e assigned to new
  • b
je t named s1. When no de is an end system, w e m ust add proto
  • ls
and tra generation mo dels to it. In
  • ur
exer ise w e ha v e t w
  • t
yp es
  • f
lien ts. 1. T ra sour es T ra sour es use UDP and TCP as their transp
  • rt
proto
  • l.
Proto
  • l
for the end system is reated with
  • mmands
  • -><--
set udp1 [new Agent/UDP℄ $ns atta h-agent $s1 $udp1 set br1 [new Appli ation/Traffi /CBR℄ $ br1 atta h-agent $udp1 $ br1 set pa ket_size_ $pa ketSize $udp1 set pa ketSize_ $pa ketSize $ br1 set rate_ $rate1
  • -><--
  • -><--
set t p10 [new Agent/TCP℄ 9
slide-12
SLIDE 12 CHAPTER 2. SIMULA TOR CODE

Node

entry

Address Classifier

Port

Classifier Agent Agent Agent Link Link Link Only in end system

Figure 2.2: Constru tion
  • f
no de in ns2 $ns atta h-agent $s10 $t p10 set ftp10 [new Appli ation/FTP℄ $ftp10 atta h-agent $t p10 $t p10 set pa ketSize_ $pa ketSize
  • -><--
Where udp1 and t p10 are the names for the proto
  • l
sta ks. These names are used for
  • m
bining righ t no de and sour e mo del to these proto
  • l
sta ks. [new Agent/UDP℄ and [new Agent/TCP℄ are used to tell for ns to
  • m
bine prop erties
  • f
lass UDP and lass TCP to new
  • b
je ts named udp1 and t p10. These lasses inherit all features
  • f
their paren ts, i.e. Agen t. Proto
  • l
sta k is atta hed to parti ular no de with the
  • mmand
$ns atta h-agent $s1 $udp1. Whi h
  • m
bines no de $s1 to proto
  • l
sta k $udp1 and no de $s10 to proto
  • l
sta k $t p10 resp e tiv ely . Sour e t yp e, i.e. tra generation pattern, is set b y dening the lien t. UDP proto
  • l
is atta hed to appli ation whi h generates
  • nstan
t bit rate tra . This is done rst b y dening the appli ation set br1 [new Appli ation/Traffi /CBR℄ and then atta hing the appli ation to the transp
  • rt
proto
  • l
$ br1 atta h-agent $udp1. $ br1 inherits all features
  • f
Appli ation, T ra and CBR. One
  • f
the features is that 10
slide-13
SLIDE 13 2.1. CREA TE TOPOLOGY CBR tra is dened b y rate and pa k et size. These are dened b y $ br1 set rate_ and $ br1 set pa ket_size_. They are
  • nne ted
to lo ally mo diable v ariables lo ated at the b eginning
  • f
t l s ript. TCP proto
  • l
is atta hed to FTP appli ation. Clien t name is ftp10 and its
  • p
eration is dened in lass lass Appli ation/FTP. FTP without an y additional parametrisation is a greedy tra sour e, i.e. it tries to ll the pip e full
  • f
its tra . 2. T ra sinks T ra sinks are p
  • in
ts where the
  • w
  • f
information are terminated. There are sev eral dieren t t yp es
  • f
sinks for dieren t sta ks and proto-
  • l
lev els. W e are not in terested in the
  • p
eration
  • f
TCP and UDP , so w e will terminate information
  • ws
without an y pro essing. W e reate a TCP sink whi h is dened b y lass A gent/TCPSink and name it as sink10. This sink then atta hed to the no de dest. Samew a y w e reate UDP sink whi h is dened b y lass A gent/Nul l and atta h that to same destination no de dest. Clien ts are
  • nne ted
together (after the links are de lared) with the
  • m-
mand
  • -><--
$ns
  • nne t
$udp1 $null1 $ns
  • nne t
$t p10 $sink10
  • -><--
This
  • mmand
  • nne ts
lien ts at the lev el
  • f
transmission proto
  • l
together, i.e. state is established
  • n
the TCP . 2.1.2 Links Links are the
  • ther
part
  • f
top
  • logy
. Be ause no des are univ ersal, i.e. end systems and routers share same
  • nstru tion,
additional me hanisms are im- plemen ted in to the links. Links
  • n
tain queues whi h in real w
  • rld
w
  • uld
ha v e b een implemen ted in routers. Links are reated with
  • mmand
  • -><--
$ns duplex-link $s1 $e1 10Mb 5ms DropTail $ns simplex-link $e1 $e2 10Mb 5ms dsRED/edge
  • -><--
11
slide-14
SLIDE 14 CHAPTER 2. SIMULA TOR CODE

Link

entry

Queue Delay

Error

Figure 2.3: Constru tion
  • f
link in ns2 First parameter, duplex-link in
  • mmand
expresses the t yp e
  • f
link. This t yp e ma y v ary dep ending
  • n
what y
  • u
are doing from simplex, duplex
  • r
some sp e ial link, lik e CBQLink
  • r
In tServLink. W e use in
  • ur
exer ise duplex link to arry the data from sour e to a ess p
  • in
t and simplex links in
  • re
net w
  • rk.
Se ond and third parameters refer from where to where link go es. End p
  • in
ts are no des whi h are atta hed to the link, i.e. example sho ws link going from s1 to e1. Ordering
  • f
end p
  • in
ts do es not a oun t when w e are talking ab
  • ut
duplex links. Ho w ev er, simplex links are dire ted based
  • n
the
  • rder
  • f
end p
  • in
ts. F
  • urth
parameter is the bandwidth (data rate)
  • f
the link. Y
  • u
ma y use qualiers k (kilo) and M (mega) as b (bit) and B (b yte). Fifth parameter is the dela y
  • f
the link this has same idea as bandwidth y
  • u
ma y use m (milli) and u (mikro) as qualiers. Last parameter stands for queue managemen t algorithm used in the queue. V alid argumen ts are DropT ail (FIF O), RED, dsRED/edge, dsRED ore, CBQ, F Q, SF Q and DRR. W e use DropT ail ev erywhere else but at the
  • re
net w
  • rk
to ha v e most straigh t forw ard sim ulation. F
  • r
visualisation in nam ns
  • n
tains p
  • ssibilit
y to adjust top
  • logy
  • n
a w a y y
  • u
w an t. This is done with
  • mmand
$ns duplex-link-op $s1 $e1
  • rient
right-down whi h mak es p
  • ssible
to giv e
  • rien
tational dire tions
  • f
links. Orien tation is in dire tion
  • f
fr
  • m
to to. Distan e b et w een t w
  • no
des
  • mes
from the dela y . All distan es are s aled based
  • n
the shortest distan e. A dditional parameters for the link an b e giv en with same
  • mmand
simplex-link-op. In
  • mmand
12
slide-15
SLIDE 15 2.1. CREA TE TOPOLOGY $ns simplex-link-op $e1 $e2 queuePos 0.5 queue
  • n
link b et w een e1 and e2 is monitored in nam visualisation. 2.1.3 Building Dieren tiated Servi es Dieren tiated Servi es supp
  • rt
in ns2 is based
  • n
the mo died RED queue (one ph ysi al queue
  • n
tains three virtual queues). Dieren t RED parameters are used for dieren t virtual queues, ausing some virtual queue to ha v e lenien t
  • p
eration while
  • ther
are more strained. Base
  • f
the DiServ
  • p
eration is the p
  • li y
whi h is set for the sim ulation. P
  • li y
de lares ho w parti ular
  • nne tion
should b e metered, mark ed
  • r
p
  • li ed
during the sim ulation.
  • -><--
$qE2E1 addPoli yEntry [$dest id℄ [$s1 id℄ TSW2CM 20 $ ir1 $qE2E1 addPoli yEntry [$dest id℄ [$s10 id℄ TSW2CM 10 $ ir10
  • -><--
These p
  • li ies
dene
  • nne tion
whi h is under the
  • n
trol i.e. from $dest to $s1 and $a10. Also the t yp e
  • f
metering and marking is dened TSW2CM whi h stands for Time Sliding Windo w Metering with T w
  • Color
Marking. T w
  • Color
marking means simply in
  • r
  • ut
  • f
prole marking. Last t w
  • lums
in p
  • li y
en try dene the
  • dep
  • in
t in ase if pa k et falls within p
  • li y
and parameter used to set up metering and marking. ns2 has build in supp
  • rt
for follo wing metering and marking
  • m
binations: 1. TSW2CM: Time Sliding Windo w Meter with T w
  • Color
Mark er. TSW2CM is
  • n
trolled with single parameter Committed Information Rate (CIR). CIR is the rate for whi h ISP
  • ers
QoS lev el
  • mmit-
men t. T ra falling
  • ut
  • f
prole is probabilistally mark ed to lo w er pre eden e. 2. TSW3CM: Time Sliding Windo w Meter with Three Color Mark er. TSW3CM is
  • n
trolled with t w
  • parameters
Committed Information Rate (CIR) and P eak Information Rate (PIR). CIR is the rate for whi h ISP
  • ers
QoS lev el
  • mmitmen
t. T ra falling
  • ut
  • f
CIR is proba- bilistally mark ed to medium pre eden e. T ra falling
  • ut
  • f
PIR is probabilistally mark ed to lo w est pre eden e. 13
slide-16
SLIDE 16 CHAPTER 2. SIMULA TOR CODE 3. tok enBu k et: T
  • k
en Bu k et uses CIR and
  • mmitted
burst size (CBS) with t w
  • drop
pre eden es. P a k et is mark ed to lo w er pre eden e if it falls
  • ut
  • f
prole dened b y CIR (tok en generation rate * tok en size) and CBS (size
  • f
the tok en bu k et). 4. srTCM: Single Rate Three Color Mark er uses
  • m
bination
  • f
t w
  • tok
en bu k ets in as ade. T ra is metered b y CIR, CBS and ex ess burst size (EBS). Ex ess burst size is addtional burst lev el dened b y se ond tok en bu k et. T ra falling in rst bu k et is mark ed to highest pre eden e. T ra falling within se ond but not rst tok en bu k et is mark ed for medium drop pre eden e. T ra falling
  • ut
from b
  • th
  • f
the bu k ets is mark ed to lo w est pre eden e. 5. trTCM: T w
  • Rate
Three Color Mark er uses a
  • m
bination
  • f
t w
  • tok
en bu k et in as ade. T ra is metered b y CIR and CBS in rst tok en bu k et, and PIR and p eak burst size (PBS) in se ond tok en bu k et. T ra falling in rst bu k et is mark ed to highest pre eden e. T ra falling within se ond but not rst tok en bu k et is mark ed for medium drop pre eden e. T ra falling
  • ut
from b
  • th
  • f
the bu k ets is mark ed to lo w est pre eden e. Ones the p
  • li y
is dened. P
  • li ers
whi h are atta hed to p
  • li y
need to b e parametrized. P arameters whi h they require are marks whi h are asso iated to their
  • nditioning
a tions.
  • -><--
$qE1E2 addPoli erEntry TSW2CM 10 11 $qE1E2 addPoli erEntry TSW2CM 20 21
  • -><--
After the p
  • li y
is
  • mpletely
established
  • ne
m ust tak e are ab
  • ut
for- w arding
  • f
the mark ed pa k ets. Ea h
  • dep
  • in
t (mark) needs to ha v e as- so iated forw arding treatmen t. F
  • rw
arding treatmen ts are in Dieren tiated Servi es alled p er hop b eha viors (PHB). In ns2 PHB is determined
  • nly
  • n
the lev el
  • f
queue and pre enden e whi h some
  • dep
  • in
t ree ts $qE1E2 addPHBEntry 10 0. RED algorithms
  • p
erating
  • n
the queues need also to b e param trised through $qE1E2
  • nfigQ
1 10 40 0.10 2.2 Probing the information Ev en t monitoring is sp e ial lass
  • f
T l
  • p
eration, where a T ra e lass
  • b
je t is wrapp ed around monitored system. 14
slide-17
SLIDE 17 2.2. PR OBING THE INF ORMA TION 2.2.1 Starting ev en t monitoring Ev en t monitoring means that all ev en ts surrounding some
  • b
je t are re orded in to the tra e le. F
  • r
that w e need to
  • p
en the tra e le and
  • nne t
a handle to that le I/O.
  • -><--
set tra e_all [open
  • ut.all
w℄
  • -><--
After the le is
  • p
ened ev en ts an b e re orded to that. Sim ulator
  • n
tains a sp e ial
  • mmands
to do that. Commands sp e ify the
  • b
je t whi h is tra ed and the handle to the le where ev en ts are re orded. F
  • llo
wing
  • mmand
  • -><--
$ns tra e-all $tra e_all
  • -><--
re ords all ev en ts from the sim ulation to the le p
  • in
ted b y handle $tra e_all. After the sim ulation tra e buer m ust b e leared and the le losed
  • -><--
$ns flush-tra e lose $tra e_all
  • -><--
2.2.2 T ra e le format T ra e me hanism generates a tra e le where ev en ts are stored for p
  • st
pro- essing. T ra e le
  • n
tains information in a form
  • f
white spa e separated table.
  • -><--
r 6.6938 4 5 t p 1000
  • 1
0.0 2.0 657 1301 + 6.6938 5 2 t p 1000
  • 1
0.0 2.0 657 1301
  • 6.6938
5 2 t p 1000
  • 1
0.0 2.0 657 1301 r 6.694155 1 4 t p 1000
  • 2
1.0 3.0 10 1356 + 6.694155 4 5 t p 1000
  • 2
1.0 3.0 10 1356 d 6.694155 4 5 t p 1000
  • 2
1.0 3.0 10 1356 r 6.6946 4 t p 1000
  • 1
0.0 2.0 684 1357
  • -><--
15
slide-18
SLIDE 18 CHAPTER 2. SIMULA TOR CODE First
  • lumn
  • f
table represen ts the t yp e
  • f
ev en t. Ev en t ma y b e re eiv e ('r'), drop ('d'), engue ('+')
  • r
deque ('-'). Se ond
  • lumn
is the sim ulated time when the ev en t
  • ured.
Time is giv en in se onds from the b eginning
  • f
sim ulation. Third and fourth
  • lumns
are sour e and destination no des
  • f
ev en t, i.e. they sho w where the tra ing
  • f
ev en t to
  • k
pla e and
  • n
whi h dire tion. Fifth
  • lumn
expresses the t yp e
  • f
pa k et that w as tra ed. T yp e ma y b e proto
  • l
  • r
a tion, dep ending
  • n
agen t that generated the pa k et. Sixth
  • lumn
indi ates the pa k et size as en o ded in IP header. Sev eth
  • lumn
() represen t ags whi h ma y b e
  • ded
in pa k ets. Eigth
  • lumn
is
  • w
id whi h is used to separate
  • nne tions
in aggregated links and end p
  • in
ts. Nineth and ten th
  • lumns
are sour e and destinations addresses. If sp e ial addressing is used, this sho ws it. Otherwise it is the no de n um b ers in de imal format. Elev en th
  • lumn
is the sequen e n um b er eld. This eld is used for proto
  • ls
and agen ts whi h mak e use
  • f
sequen e n um b ers. T w elvth
  • lumn
is the uniqueue id
  • f
pa k et. Ea h pa k et has uniqueue id throughou the sim ulation. This mak es easy to tra e ev en ts whi h ha v e happ ened to a single pa k et
  • n
a path through the net w
  • rk.
2.3 Con trolling sim ulation Sim ulation is started and stopp ed with
  • mmands
  • -><--
$ns run $ns at [expr $testTime + 1.0℄ "finish"
  • -><--
Finish
  • mmand
s hedules the subroutine nish at the time set b y parameter $testTime. Subroutine nish is used to lose tra e les, to do p
  • st
pro essing
  • f
information (not ne essary) and to plot tra e information (not ne esary). Last
  • mmand
in subroutine is exit whi h is used to terminate the program.
  • -><--
16
slide-19
SLIDE 19 2.3. CONTR OLLING SIMULA TION pro finish {} { global ns tra e_all $ns flush-tra e lose $tra e_all ... exit }
  • -><--
Other ev en ts whi h m ust b e s heduled are lien t start and stop times. These ev en ts
  • n
trol tra generation within the net w
  • rk.
  • -><--
$ns at 0.0 "$ br1 start" $ns at 0.0 "$ br2 start" $ns at 0.0 "$ftp3 start" $ns at 0.0 "$ftp4 start" $ns at 0.0 "$ftp5 start" $ns at 0.0 "$ftp6 start" $ns at 0.0 "$ftp7 start" $ns at 0.0 "$ftp8 start" $ns at 0.0 "$ftp9 start" $ns at 0.0 "$ftp10 start" $ns at $testTime "$ br1 stop" $ns at $testTime "$ br2 stop" $ns at $testTime "$ftp3 stop" $ns at $testTime "$ftp4 stop" $ns at $testTime "$ftp5 stop" $ns at $testTime "$ftp6 stop" $ns at $testTime "$ftp7 stop" $ns at $testTime "$ftp8 stop" $ns at $testTime "$ftp9 stop" $ns at $testTime "$ftp10 stop"
  • -><--
17
slide-20
SLIDE 20 CHAPTER 2. SIMULA TOR CODE 18
slide-21
SLIDE 21 Chapter 3 Exer ise This exer ise is ab
  • ut
  • mparison
  • f
dieren t rate
  • n
trol metho ds in In ter- net. Metho ds whi h are used here are tok en bu k et, time sliding windo w and single rate t w
  • lor
mark er. In v etigate
  • p
eration
  • f
dieren t metering and marking algorithms in net w
  • rk
whi h is used for transmission
  • f
pure TCP , pure UDP and mixed (2-4 UDP lien ts and 6-8 TCP lien ts) tra . Use dieren t
  • m
binations
  • f
rates (all lien ts equal apa it y , some lien ts substan tially higher apa it y and some lien t zero apa it y). See what is the
  • ut ome
  • f
the servi e expressed as re o v ered apa ities. See also ho w rate
  • n
trol me hanisms w
  • rk
when y
  • u
load them with dieren t lev els
  • f
tra load (limit to substan tial
  • v
erload). Due date for the exer ise is 31.10.2001 at 1200 hours. Rep
  • rts
an
  • nly
b e deliv ered to
  • urse
lo k er in G-wing 2nd
  • r.
Other means used in deliv ery are not
  • nsidered.
19