helsinki university of te hnology departmen t of ele tri
play

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


  1. Helsinki University of Te hnology Departmen t of Ele tri al and Comm uni ation Engineering S-38.180 Qualit y of Servi e in In ternet Home assignmen t 1: Sim ulation of Rate Con trol me hanisms Due date: 31.10.2001 at 1200 hours Deliv ery: P ap er rep ort to ourse lo k er at G-wing 2nd �o or

  2. Con ten ts Con ten ts i 1 In tro du tion 1 1.1 Net w ork Sim ulator 2 . . . . . . . . . . . . . . . . . . . . . . . 2 2 Sim ulator o de 3 2.1 Create top ology . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.1 No des . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.2 Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.3 Building Di�eren 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

  3. Chapter 1 In tro du tion This is ourse w ork for ourse S-38.180 Qualit y of Servi e in In ternet. This exer ise mak es y ou familiar with: 1. ns2. A net w ork sim ulator whi h is one of the most used sim ulation to ols in a ademi w orld. 2. Rate on trol me hanisms whi h ould b e used to mark, limit or shap e the In ternet tra� T o ol is installed in to departmen t w orkstation ro om in to SUN w orksta- tions. Y ou need to run it there. Program an b e lo ated from path /pr oj/b ones/ns2/ . T o b e able to use it y ou m ust �rst run ommand /pr oj/b ones/ns2/ns-al linone-2.1b8/use , whi h tells y ou the format of en- vironmen t sp e i� use ommand. T yping the ommand outputted b y generi use, y ou will set all en vironmen t v ariables required to run ns2 . Mak e w orking dire tory in to y our home dire tory and op y �le /pr oj/b ones/ns2/ns-al linone-2.1b8/work/ examp le.t l to it. This �le is the ore whi h y ou m ust mo dify during the w ork. Departmen t has set quotas to w orkstations, so y ou ha v e to run y our sim ula- tions in /tmp dire tory of w orkstations. Mak e temp orary w orking dire tory under /tmp . Cop y pro essed results to y our w orking dire tory and delete temp orary w orking dire tory . 1

  4. CHAPTER 1. INTR ODUCTION 1.1 Net w ork Sim ulator 2 T o ol used in this exer ise is network simulator 2 . It is freely a v ailabale and distributable ob je t orien ted sim ulator. In glan e, it on tains k ernel o de dev elop ed in C++ . This k ernel o de on tains lass hierar hies for ready made building blo ks. These building blo ks are translated to Ot l to mak e onstru tion of 'qui k and dirt y' sim ulations easier. Y ou ma y w an t to b e ome familiar with the to ol b efore starting y our w ork. 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

  5. Chapter 2 Sim ulator o de This hapter presen t sim ulator o de whi h is used in this exer ise. F ollo wing listing sho ws whole o de as one unit. T o b e ome familiar the stru ture of ns , w e disse t o 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 0 set ir10 0 set testTime 50 set pa ketSize 1000 # Open a file for writing the tra e data set tra e_all [open out.all w℄ # Tra e all events for post pro essing with animator (nam) or with any # other software $ns tra e-all $tra e_all 3

  6. CHAPTER 2. SIMULA TOR CODE # Set up the network topology shown at the top of 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 orient right $ns duplex-link-op $e2 $dest orient 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

  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 0 0 $qE1E2 addPHBEntry 11 0 1 $qE1E2 addPHBEntry 20 0 0 $qE1E2 addPHBEntry 21 1 1 $qE1E2 onfigQ 0 0 10 40 0.02 $qE1E2 onfigQ 0 1 10 40 0.10 $qE1E2 onfigQ 1 1 0 0 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 0 0 $qE2E1 addPHBEntry 11 0 1 $qE2E1 addPHBEntry 20 0 0 $qE2E1 addPHBEntry 21 1 1 $qE2E1 onfigQ 0 0 10 40 0.02 $qE2E1 onfigQ 0 1 10 40 0.10 $qE2E1 onfigQ 1 1 0 0 1 # Set up one CBR onne 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 onne t $udp1 $null1 set udp2 [new Agent/UDP℄ 5

Recommend


More recommend