project report (mg2)
TRANSCRIPT
-
8/12/2019 Project Report (MG2)
1/85
Chapter One1.1 Project Introduction
Random Early Detection (RED), proposed by Sally Floyd and Van Jacobson in August 199!1", aret#e gate$ays $#ic# are designed %or congestion a&oidance in '*+ !"- '#e gate$ay detects
incipient congestion by computing t#e a&erage .ueue si/e- '#e gate$ay could noti%y connections o%congestion eit#er by dropping pac0ets arri&ing at t#e gate$ay or by setting a bit in pac0et #eaders-#en t#e a&erage .ueue si/e e2ceeds a preset t#res#old, t#e gate$ay drops or marks eac# arri&ing
pac0et $it# a certain probability, $#ere t#e e2act probability is a %unction o% t#e a&erage .ueue si/e-
RED gate$ays 0eep t#e a&erage .ueue si/e lo$ $#ile allo$ing occasional bursts o% pac0ets int#e .ueue- During congestion, t#e probability t#at t#e gate$ay noti%ies a particular connection toreduce its $indo$ is roug#ly proportional to t#e connection3s s#are o% t#e band$idt# t#roug# t#egate$ay- RED gate$ays are designed to accompany a transport4layer congestion control protocolsuc# as '- '#e RED gate$ay #as no bias against bursty tra%%ic and a&oids global sync#roni/ationo% many connections decreasing t#eir $indo$ at t#e same time- Simulations o% a '*+ net$or0 are
used to illustrate t#e per%ormance o% RED gate$ays
RED gate$ays mark a pac0et by dropping it at t#e gate$ay or by setting a bit in t#epac0et #eader, depending on t#e transport protocol- #en t#e a&erage .ueue si/e e2ceeds a ma2imumt#res#old, t#e RED !1" gate$ay mar0s e&ery pac0et t#at arri&es at t#e gate$ay- +% RED gate$aysmar0 pac0ets by dropping t#em, rat#er t#an by setting a bit in t#e pac0et #eader, $#en t#e a&erage.ueue si/e e2ceeds t#e ma2imum t#res#old, t#en t#e RED gate$ay controls t#e a&erage .ueue si/ee&en in t#e absence o% a cooperating transport protocol-
RED gate$ays are intended %or a net$or0 $#ere t#e transport protocol responds to congestionindications %rom t#e net$or0- '#e gate$ay congestion control mec#anism in RED gate$ays
simpli%ies t#e congestion control 5ob re.uired o% t#e transport protocol, and is applicable to transport4layer congestion control mec#anisms ot#er t#an t#e current &ersion o% ', including protocols $it#rate4based rat#er t#an $indo$4based %lo$ control- 6o$e&er, some aspects o% RED gate$ays arespeci%ically targeted to '*+ net$or0s- '#e RED gate$ay is designed %or a net$or0 $#ere a singlemar0ed or dropped pac0et is su%%icient to signal t#e presence o% congestion to t#e transport4layer
protocol-
RED gate$ays can be use%ul in gate$ays $it# a range o% pac0et4sc#eduling and pac0et4dropping algorit#ms- For e2ample, RED congestion control mec#anisms could be implemented ingate$ays $it# drop pre%erence, $#ere pac0ets are mar0ed as eit#er 7essential8 or 7optional8, and7optional8 pac0ets are dropped %irst $#en t#e .ueue e2ceeds a certain si/e- Similarly, %or a gate$ay
$it# separate .ueues %or real time and non4real time tra%%ic, %or e2ample, RED congestion controlmec#anisms could be applied to t#e .ueue %or one o% t#ese tra%%ic classes
#apter discusses t#e be#a&iour o% RED in a #ybrid net$or0- #apter comprises o% t#ecomparison o% per%ormance RED $it# Drop 'ail- #apter analyses t#e per%ormance o% RED $#encombined $it# ' Vegas, ' :e$ Reno, and ' Reno- Appendi2 A gi&es t#e code %or t#esimulation o% ' RE:;- Appendi2 < gi&es t#e code %or t#e simulation o% ' VE=AS- Appendi2 gi&es t#e code %or t#e simulation o% ' :E RE:;- Appendi2 D gi&es t#e code %or t#esimulation o% ' 'A6;E-
1
-
8/12/2019 Project Report (MG2)
2/85
1.2 Objectives
'#e ob5ecti&e o% t#is pro5ect is to study t#e per%ormance o% RED in a #ybrid net$or0 $it# transportlayer protocols suc# as ' and >D !?"- '#is e&aluation #as been done t#eoretically and t#roug#simulations- '#e main goals o% t#e pro5ect are
1- Simulation o% RED in a #ybrid net$or0 using :S!1@"!1"
- ompare t#e simulated grap#ical representations $it# t#eoretical obser&ations a&ailable on t#ebasis o% t#e %ollo$ing parametersB
'#roug#put
'ime Delay
- omparison o% RED $it# ot#er congestion a&oidance algorit#m li0e Drop 'ail!1"-
- Simulation and comparati&e analysis o% combining RED $it# ' Vegas, ' Reno, '
'a#oe!?"!" and ' :e$Reno in a #ybrid net$or0-
?- omparison o% simulated grap#ical representations o% RED in ' $it# ot#er transport4layerprotocols suc# as F'!1C", >D!C", etc- using bot# $ired and $ireless net$or0 connections-
1.3 Work Motivation
ireless communication bet$een mobile users is becoming more popular t#an e&er be%ore-'#is is due to recent tec#nological ad&ances in laptops computers and $ireless communication datade&ices, suc# as $ireless modems and $ireless A:3s- '#is #as led to lo$er prices and #ig#er datarates, $#ic# are t#e t$o main reasons $#y mobile computing continues to en5oy rapid gro$t#-
According to t#e isco V:+ =lobal obile Data 'ra%%ic Forecast!1C", o&erall data tra%%ic is e2pecteddouble e&ery year %rom C on$ards and &ideo $ill be responsible %or t#e gro$t# o% tra%%ic- it#mobile data tra%%ic e2pected to gro$ tremendously, net$or0 congestion #as become an importantissue to be combated by t#e operators-
ireless tec#nology can o%%er businesses more %le2ible and ine2pensi&e $ays to send and recei&edata-
'#e %our 0ey bene%its o% $ireless tec#nology areB
1- Increased efficiency4 impro&ed communications leads to %aster trans%er o% in%ormation
$it#in businesses and bet$een partners*customers-- Rarey out of touchG one doesnHt need to carry cables or adaptors in order to access o%%ice
net$or0s-
- !reater fe"ibiity and #obiity for users4 o%%ice4based $ireless $or0ers can be net$or0ed$it#out sitting at dedicated s-
- Reduced costs4 relati&e to H$iredH, $ireless net$or0s are, in most cases, c#eaper to install andmaintain-
'#e pre&ention o% net$or0 congestion and collapse re.uires t$o ma5or componentsB
1- A mec#anism in routers to reorder or drop pac0ets under o&erload,
2
-
8/12/2019 Project Report (MG2)
3/85
- End4to4end %lo$ control mec#anisms designed into t#e end points $#ic# respond tocongestion and be#a&e appropriately
'#e most common router mec#anisms used to pre&ent congesti&e collapses arefair queuingand ot#erscheduling algorithms, and random early detection, or RED, $#ere pac0ets are randomlydropped proacti&ely triggering t#e end points to slo$ transmission be%ore congestion collapseactually occurs- Fair .ueuing is most use%ul in routers at c#o0e points $it# a small number o%
connections passing t#roug# t#em- arger routers must rely on RED-RED, is today deployed in t#erouters by +S;-
'#is t#esis studies t#e be#a&ior o% RED in a hybrid net$or0 and also compares itsper%ormance $it# ot#er congestion a&oidance sc#emes suc# as Drop 'ail- +t also compares t#eper%ormance o% ' Flo$ ontrol and ' $#en assisted $it# Random Early Detection and e2plainst#e ad&antages o% RED $#en implemented $it# t#e '*+ model-
3
-
8/12/2019 Project Report (MG2)
4/85
Chapter $%o2.1 Overvie% of $CP&IP Con'estion (voidance Methodoo'y
2.1.1Introduction to $CP
The Transmission Control Protocol/Internet Protocol model!"!9"!1"!11"is a description %rame$or0%or computer net$or0 protocols created in t#e 19s by DARA, an agency o% t#e >nited StatesDepartment o% De%ense- +t loosely de%ines a %our4layer model, $it# t#e layers #a&ing names, notnumbers, as %ollo$sB
Application ayer (process4to4process)
'ransport ayer (#ost4to4#ost)
+nternet ayer (internet$or0ing)
in0 ayer
' is a reliable connection oriented protocol t#at allo$s a byte stream originating on onemac#ine to be deli&ered $it#out error on any ot#er mac#ine in t#e internet- +t %ragments t#eincoming byte stream into discrete passages and passes eac# one onto t#e internet layer- At t#edestination t#e recei&ing ' process reassembles t#e recei&ed messages into t#e recei&er $it# moremessages t#at it can #andle- ' #andles %lo$ control $it# t#e combination o% slo$ start algorit#mand congestion a&oidance algorit#m- +t uses t$o $indo$s one ad&ertised by t#e recei&er called t#ead&ertised $indo$ and anot#er congestion $indo$ called cwnd-
Ma"i#u# )e'#ent )i*e in $CP
'#e a2imum segment si/e (SS)!" is t#e largest amount o% data, speci%ied in bytes, t#at ' is$illing to send in a single segment- For best per%ormance, t#e SS s#ould be set small enoug# toa&oid + %ragmentation, $#ic# can lead to e2cessi&e retransmissions i% t#ere is pac0et loss- 'o try toaccomplis# t#is, typically t#e SS is negotiated using t#e SS option $#en t#e ' connection isestablis#ed, in $#ic# case it is determined by t#e ma2imum transmission unit ('>) si/e o% t#e datalin0 layer o% t#e net$or0s to $#ic# t#e sender and recei&er are directly attac#ed- Furt#ermore, 'senders can use at# '> disco&ery to in%er t#e minimum '> along t#e net$or0 pat# bet$een t#esender and recei&er, and use t#is to dynamically ad5ust t#e SS to a&oid + %ragmentation $it#in t#enet$or0-
Strictly spea0ing, t#e SS is not negotiated bet$een t#e originator and t#e recei&er, becauset#at $ould imply t#at bot# originator and recei&er $ill negotiate and agree upon a single, uni%iedSS t#at applies to all communication in bot# directions o% t#e connection- +n %act, t$o completelyindependent &alues o% SS are permitted %or t#e t$o directions o% data %lo$ in a ' connection!1@"- '#is situation may arise, %or e2ample, i% one o% t#e de&ices participating in a connection #as ane2tremely limited amount memory reser&ed (per#aps e&en smaller t#an t#e o&erall disco&ered at#'>) %or processing incoming ' segments-
2.1.2 Con'estion (voidance )che#e of $CP
4
-
8/12/2019 Project Report (MG2)
5/85
'#e ' uses a net$or0 congestion a&oidance algorit#m t#at includes &arious aspects o% an additi&eincrease*multiplicati&e decrease (A+D)!1"!11" sc#eme, $it# ot#er sc#emes suc# as slo$4start inorder to ac#ie&e congestion a&oidance- '#e %our algorit#ms, Slo$ Start, ongestion A&oidance, FastRetransmit and Fast Reco&ery are described belo$-
1. )o% )tart+#en a ' connection %irst begins, t#e Slo$ Start algorit#m initiali/es a congestion$indo$ to one segment, $#ic# is t#e ma2imum segment si/e (SS) initiali/ed by t#e recei&er duringt#e connection establis#ment p#ase- #en ac0no$ledgements are returned by t#e recei&er, t#econgestion $indo$ increases by one segment %or eac# ac0no$ledgement returned- '#us, t#e sendercan transmit t#e minimum o% t#e congestion $indo$ and t#e ad&ertised $indo$ o% t#e recei&er,$#ic# is simply called t#e transmission $indo$-
2. Con'estion (voidanceB During t#e initial data trans%er p#ase o% a ' connection t#e Slo$ Startalgorit#m is used- 6o$e&er, t#ere may be a point during Slo$ Start t#at t#e net$or0 is %orced to dropone or more pac0ets due to o&erload or congestion- +% t#is #appens, ongestion A&oidance is used toslo$ t#e transmission rate- +n t#e ongestion A&oidance algorit#m a retransmission timer e2piring ort#e reception o% duplicate AIs can implicitly signal t#e sender t#at a net$or0 congestion situation is
occurring- '#e sender immediately sets its transmission $indo$ to one #al% o% t#e current $indo$si/e (t#e minimum o% t#e congestion $indo$ and t#e recei&er3s ad&ertised $indo$ si/e), but to atleast t$o segments- +% congestion $as indicated by timeout, t#e congestion $indo$ is reset to onesegment, $#ic# automatically puts t#e Sender into Slo$ Start mode- +% congestion $as indicated byduplicate AIs, t#e Fast Retransmit and Fast Reco&ery algorit#ms are in&o0ed-
3. ,ast Retrans#it+ +% more t#an t$o duplicate AIs are recei&ed by t#e sender, it is a strongindication t#at at least one segment #as been lost- '#e ' sender $ill assume enoug# time #aslapsed %or allsegments to be properly re4ordered by t#e %act t#at t#e recei&er #ad enoug# time to sendt#ree duplicate AIs- #en t#ree or more duplicate AIs are recei&ed, t#e sender does not e&en$ait %or aretransmission timer to e2pire be%ore retransmitting t#e segment- '#is process is called t#e
Fast Retransmit algorit#m- +mmediately %ollo$ing Fast Retransmit is t#e Fast Reco&ery algorit#m-
-. ,ast Recovery+ Since t#e Fast Retransmit algorit#m is used $#en duplicate AIs are beingrecei&ed, t#e' sender #as implicit 0no$ledge t#at t#ere is data still %lo$ing to t#e recei&er- '#ereason is because duplicate AIs can only be generated $#en a segment is recei&ed-'#is is a strongindication t#at serious net$or0 congestion may not e2ist and t#at t#e lostsegment $as a rare e&ent-So instead o% reducing t#e %lo$ o% data abruptly by going allt#e $ay into Slo$ Start, t#e sender onlyenters ongestion A&oidance mode Rat#er t#an start at a $indo$ o% one segment as in Slo$ Startmode, t#e sender resumes transmission $it# a larger $indo$, incrementing as i% in ongestionA&oidance mode-
5
-
8/12/2019 Project Report (MG2)
6/85
Fig -1 ;&er&ie$ o% ongestion ontrol Steps
2.2 $heoretic (naysis of R/
Rando# eary detection(RED), also 0no$n as rando# eary discardor rando# eary dropis anacti&e .ueue management algorit#m- +t is also a congestion a&oidance algorit#m-'#e RED gate$ay calculates t#e a&erage .ueue si/e, using a lo$4pass %ilter $it# an e2ponential
$eig#ted mo&ing a&erage- '#e a&erage .ueue si/e is compared to t$o t#res#olds, a minimumt#res#old and a maximum t#res#old- #en t#e a&erage .ueue si/e is less t#an t#e minimum t#res#old,no pac0ets are mar0ed- #en t#e a&erage .ueue si/e is greater t#an t#e ma2imum t#res#old, e&eryarri&ing pac0et is mar0ed- +% mar0ed pac0ets are in %act dropped, or i% all source nodes arecooperati&e, t#is ensures t#at t#e a&erage .ueue si/e does not signi%icantly e2ceed t#e ma2imumt#res#old-
#en t#e a&erage .ueue si/e is bet$een t#e minimum and t#e ma2imum t#res#old, eac#arri&ing pac0et is mar0ed $it# probabilitypa, $#erepa is a %unction o% t#e a&erage .ueue si/e avg-Eac# time t#at a pac0et is mar0ed, t#e probability t#at a pac0et is mar0ed %rom a particularconnection is roug#ly proportional to t#at connection3s s#are o% t#e band$idt# at t#e gate$ay-
Fig - Random Early Detection gate$ay
6
http://upload.wikimedia.org/wikipedia/commons/f/fd/Random_Early_Detection_algorithm_en.svg -
8/12/2019 Project Report (MG2)
7/85
'#e general RED gate$ay algorit#m is gi&en in Fig --
'#us t#e RED gate$ay #as t$o separate algorit#ms- '#e algorit#m %or computing t#e a&erage.ueue si/e determines t#e degree o% burstiness t#at $ill be allo$ed in t#e gate$ay .ueue- '#ealgorit#m %or calculating t#e pac0et4mar0ing probability determines #o$ %re.uently t#e gate$ay
mar0s pac0ets, gi&en t#e current le&el o% congestion- '#e goal is %or t#e gate$ay to mar0 pac0ets at%airly e&enly4spaced inter&als, in order to a&oid biases and to a&oid global sync#roni/ation, and tomar0 pac0ets su%%iciently %re.uently to control t#e a&erage .ueue si/e- '#e detailed algorit#m %or t#eRED gate$ay is gi&en in Fig --
for each packet arrivalcalculate the average queue size avg
if minthavg < maxth calculate probability pa with probability pa:
mark the arriving packet else if maxth avg
mark the arriving packetFig -B =eneral algorit#m %or RED gate$ays-
'#e gate$ay3s calculations o% t#e a&erage .ueue si/e ta0e into account t#e period $#en t#e.ueue is empty (t#e idle period) by estimating t#e number m o% small pac0ets t#at could #a&e beentransmitted by t#e gate$ay during t#e idle period-
A%ter t#e idle period t#e gate$ay computes t#e a&erage .ueue si/e as i% mpac0ets #ad arri&ed
to an empty .ueue during t#at period-
As avg &aries %rom minthto maxth, t#e pac0et4mar0ing probabilitypb&aries linearly %rom tomaxpB
pb maxp(avgminth)/(maxthminth)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!------------------E. -1
'#e %inal pac0et4mar0ing probabilitypa increases slo$ly as t#e count increases since t#e lastmar0ed pac0etB
pa pb/(1count!pb)--------------------------------------------------------------------------------------------------------E. -
'#e gate$ay mar0s eac# pac0et t#at arri&es at t#e gate$ay $#en t#e a&erage .ueue si/e avge2ceeds maxth- ;ne option %or t#e RED gate$ay is to measure t#e .ueue in bytes rat#er t#an inpac0ets- it# t#is option, t#e a&erage .ueue si/e accurately re%lects t#e a&erage delay at t#e gate$ay-#en t#is option is used, t#e algorit#m $ould be modi%ied to ensure t#at t#e probability t#at a pac0etis mar0ed is proportional to t#e pac0et si/e in bytesB
pb maxp(avgminth)/(maxthminth)----------------------------------------------------------------------------------------E. -pb pbac0etSi/e/a2imumac0etSi/e----------------------------------------------------------------------------------E. -pa pb/(1count !pb)------------------------------------------------------------------------------------------------------------------E. -?
7
-
8/12/2019 Project Report (MG2)
8/85
2.3 Overvie% of Para#eters 0sed to #easure the Perfor#ance
'#e per%ormance o% RED #as been measured using t#e %ollo$ing parametersB
2.3.1 $hrou'hput+ +n communication net$or0s, suc# as Et#ernet or pac0et radio,t#roug#put or net$or0 t#roug#put is t#e a&erage rate o% success%ul message deli&ery o&er acommunication c#annel- '#is data may be deli&ered o&er a p#ysical or logical lin0, or pass t#roug# acertain net$or0 node- '#e t#roug#put is usually measured in bits per second (bit*s or bps), andsometimes in data pac0ets per second or data pac0ets per time slot-
'#e system t#roug#put or aggregate t#roug#put is t#e sum o% t#e data rates t#at are deli&ered to allterminals in a net$or0-
2.3.2 nd to nd /eayB End4to4end delay re%ers to t#e time ta0en %or a pac0et to betransmitted across a net$or0 %rom source to destination-
dend4end :! dtransKdpropKdproc"
$#eredend4end end4to4end delaydtrans transmission delaydprop propagation delaydproc processing delay
: number o% lin0s (:umber o% routers K 1)
2.- $opoo'y 0sed
'#e topology used %or simulation is gi&en in Fig -?- +t consists o% a #ybrid net$or0 $#ic#( i-e- bot#$ired and $ireless nodes)- '#e topology consists o% %our $ireless nodes and t$o $ired nodes- '$oare >D sin0s and ;ne is a ' sin0- ' sin0 is attac#ed to t#e F' 'ra%%ic $#ereas t#e >D isattac#ed to t#e F' tra%%ic- '#e topology consists o% one F' tra%%ic and t$o
-
8/12/2019 Project Report (MG2)
9/85
-
8/12/2019 Project Report (MG2)
10/85
Fig 2.4: Detailed algorithm for RED gateways.
!raph e'end+
in0 bet$een $ired nodes and $ired node and
-
8/12/2019 Project Report (MG2)
11/85
2. )i#uation Resuts and (naysis
e implement t#e algorit#m in :S- Fig -@ s#o$s t#e simulation results %or '#roug#put &s 'ime %orRED in a #ybrid net$or0- '#e red line indicates t#e t#roug#put %or a ' sin0 $#ereas t#e green andt#e blue line indicate t#e grap# %or t#e >D sin0- '#e '#roug#put is measured in bps-
Fig - s#o$s t#e simulation results %or End to End Delay &s 'ime %or RED in a #ybridnet$or0- '#e red line indicates t#e t#roug#put %or a ' sin0 $#ereas t#e green and t#e blue lineindicate t#e grap# %or t#e >D sin0- '#e '#roug#put is measured in ms-
'#e results s#o$ t#at RED is better suited %or a transmission protocol ' rat#er t#an >D-'#is is because t#e RED gate$ay is designed %or a net$or0 $#ere a single mar0ed or dropped pac0etis su%%icient to signal t#e presence o% congestion to t#e transport4layer protocol- #en congestionoccurs in a net$or0, RED noti%ies connections o% congestion eit#er by dropping pac0ets arri&ing att#e gate$ay or by setting a bit in pac0et #eaders- #en t#e .ueue si/e is bet$een t#e minimum andt#e ma2imum t#res#old RED mar0s t#e pac0et $it# a %i2ed probability and $#en it e2ceeds t#e
ma2imum t#res#old it discards t#e pac0et-
' #as its o$n additi&e increase multiplicati&e decrease congestion a&oidance algorit#m in$#ic# one single discarded pac0et is su%%icient to signal t#e connection t#at t#e connection #asoccurred- ' reduces its $indo$ si/e, $#en it recei&es no ac0no$ledgement o% t#e lost pac0et(Re%er to Sec -1-) $#ic# #elps in reducing t#e congestion $#ic# #as occurred in t#e net$or0 and
pre&ents t#e net$or0 %rom collapsing-
From %ig -@, it is e&ident t#at recei&ed pac0et %or ' is greater t#an t#at o% >D- '#eper%ormance o% ' is greater t#an >D- D s#ould be used include &ideo tra%%ic, Domain :ame System (D:S), $#ere .ueries must
be %ast and only consist o% a single re.uest %ollo$ed by a single reply pac0et
+% t#e gate$ay drops a data pac0et %or a ' connection, t#is pac0et drop $ill be detected byt#e source, possibly a%ter a retransmission timer e2pires- +% t#e gate$ay drops an AI pac0et %or a' connection, or a pac0et %rom a non4' connection, t#is pac0et drop could go unnoticed by t#esource- 6o$e&er, e&en %or a congested net$or0 $it# a tra%%ic mi2 dominated by s#ort 'connections or by non4' connections, t#e RED gate$ay still controls t#e a&erage .ueue si/e bydropping all arri&ing pac0ets $#en t#e a&erage .ueue si/e e2ceeds a ma2imum t#res#old-
11
-
8/12/2019 Project Report (MG2)
12/85
Fig -@ '#roug#put &s- 'ime %or RED in a #ybrid net$or0
!raph e'end+
'#roug#put %or ' sin0
'#roug#put %or >D Sin01 '#roug#put %or >D Sin0
-L'#e a&erage .ueuing delay $#en RED is used as a .ueuing algorit#m #as a s#arp pea0 at ?ms
%or t#e ' sin0, at 1 ms %or t#e >D sin01 and at 1ms %or >D sin0 and t#en becomesconstant - '#is is t#e time $#en t#e applications #a&e started running, and t#e end to end delayreac#es its pea0- '#is is because o% an e2ponential increase in t#e tra%%ic $#ic# increases t#et#roug#put to its ma2imum, #ence t#e pac0ets are being dropped $#ic# cause a s#arp rise in t#edelay- '#e tra%%ic t#en decreases causing a decrease in t#e t#roug#put and a constant delay signals t#att#ere is no pac0et loss in t#e net$or0- '#e delay o% t#e $ired lin0 also #as an e%%ect on t#e end to end
delay o% RED-
12
!ime "i#ms$
-
8/12/2019 Project Report (MG2)
13/85
-
8/12/2019 Project Report (MG2)
14/85
Chapter $hree
3.1 Overvie% of /rop $ai
$ai /rop, or Drop 'ail !1", is a simple .ueue management algorit#m used by +nternet routers to
decide $#en to drop pac0ets- +n contrast to t#e more comple2 algorit#ms li0e RED and RED, in'ail Drop all t#e tra%%ic is not di%%erentiated- Eac# pac0et is treated identically- it# tail drop, $#ent#e .ueue is %illed to its ma2imum capacity, t#e ne$ly arri&ing pac0ets are dropped until t#e .ueue#as enoug# room to accept incoming tra%%ic-
'#e name arises %rom t#e e%%ect o% t#e policy on incoming datagrams- ;nce a .ueue #as been%illed, t#e router begins discarding all additional datagrams, t#us dropping t#e tail o% t#e se.uence o%datagrams- '#e loss o% datagrams causes t#e ' sender to enter slo$4start, $#ic# reducest#roug#put in t#at ' session until t#e sender begins to recei&e ac0no$ledgements again andincreases its congestion $indo$- A more se&ere problem occurs $#en datagrams %rom multiple 'connections are dropped, causing global sync#roni/ation, i-e-, all o% t#e in&ol&ed ' senders enter
slo$4start- '#is #appens because, instead o% discarding many segments %rom one connection, t#erouter $ould tend to discard one segment %rom eac# connection-
3.2 )i#uation Resuts and (naysis
Fig -1 s#o$s t#e simulation results %or '#roug#put &s- 'ime %or Drop 'ail in a #ybrid net$or0- '#ered line indicates t#e t#roug#put %or a ' sin0 $#ereas t#e green and t#e blue line indicate t#e grap#%or t#e >D sin0- '#e '#roug#put is measured in bps-
!ime "i# ms$
Fig -1 '#roug#put &s- 'ime %or Drop 'ail in a #ybrid net$or0
!raph e'end+ '#roug#put %or ' sin0 '#roug#put %or >D Sin01
'#roug#put %or >D Sin0
14
-
8/12/2019 Project Report (MG2)
15/85
Fig - End to End Delay &s- 'ime %or Drop 'ail in a #ybrid net$or0
!raph e'end+
End to End Delay %or ' sin0 End to End Delay %or >D Sin01 End to End Delay %or >D Sin0
Fig - s#o$s t#e simulation results %or End to End Delay &s 'ime %or Drop'ail in a #ybridnet$or0- '#e red line indicates t#e t#roug#put %or a ' sin0 $#ereas t#e green and t#e blue lineindicate t#e grap# %or t#e >D sin0- '#e Delay is measured in ms- '#ere is a s#arp pea0 in t#e delay$#en t#e application (F', >D) start running, t#ereby t#e delay becoming constant- '#is is because,
in case o% lig#tly loaded scenarios t#e .ueue si/e oscillates #ea&ily $it# 'D due to globalsync#roni/ation, causing a #ig# standard de&iation o% t#e .ueueing delay- As t#e load increases, t#eglobal sync#roni/ation e%%ect disappearsM t#e Drop 'ail .ueue stays close to t#e total bu%%er si/e andt#us t#e delay &ariation decreases signi%icantly-
'#e delay %or RED is also signi%icantly smaller as compared to Drop 'ail- it# Drop 'ail t#e.ueue con&erge to t#e total bu%%er si/e, $#ile t#e a&erage .ueue si/e stays belo$ maxth$it# RED Gt#us .ueueing delay being signi%icantly smaller $it# RED- 6o$e&er, t#is cannot be considered as anargument against Drop 'ail- '#e selection o% t#e bu%%er si/e al$ays means balancing a trade4o%%
bet$een #ig# .ueueing delay and lo$ lin0 utili/ation-
=reater end4to4end delay in scenario $it# drop tail algorit#m is also a result o% #ea&y load t#at>D tra%%ic creates- Nueue is maintained in almost %ull state and cause bu%%er delay to increase- '#e
15
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
16/85
use o% RED results in 0eeping t#e a&erage .ueue lengt# small and reduces t#e o&erall delay as bu%%erdelay is smaller- '#e only disad&antage o% using RED .ueue management algorit#m in case o% mi2ed' and >D tra%%ic is greater number o% dropped pac0ets- it# only ' %lo$s present, number o%dropped pac0ets is smaller $#en acti&e .ueue management is used- resence o% >D %lo$ causes astate o% #ea&y load in t#e net$or0- As >D %lo$s do not respond to congestion indication, more
pac0ets #a&e to be dropped to 0eep t#e a&erage .ueue lengt# small-
For t#is simple #ybrid net$or0 $it# ' connections $it# large $indo$s and >Dconnections, t#e net%ork po%er(t#e ratio o% t#roug#put to delay) is #ig#er $it# RED gate$ays t#an$it# Drop 'ail gate$ays- '#ere are se&eral reasons %or t#is di%%erence- it# Drop 'ail gate$ays $it#a small ma2imum .ueue, t#e .ueue drops pac0ets $#ile t#e ' connection is in t#e slo$4start p#aseo% rapidly increasing its $indo$, reducing t#roug#put- ;n t#e ot#er #and, $it# Drop 'ail gate$ays$it# a large ma2imum .ueue t#e a&erage delay is unacceptably large- '#e a&erage delay %or Drop 'ail#as a ma2imum pea0 o% ms $#ereas t#e a&erage delay %or RED #as a ma2imum pea0 o% ?ms- +naddition, Drop 'ail gate$ays are more li0ely to drop pac0ets %rom all t#e connections at t#e sametime, resulting in global sync#roni/ation and a %urt#er loss o% t#roug#put-
'#e results do not s#o$ muc# di%%erence bet$een t#e reali/ed t#roug#put $it# RED and Drop
'ail- '#is is because t#e .ueues #ardly e&er drain completely and global sync#ronisation does notcause a t#roug#put decrease in lig#tly loaded scenarios, #ence t#ere is not muc# di%%erence in t#et#roug#put o% RED and Drop 'ail-
3.3 (dvanta'es of R/ over /rop $ai+
1. Appropriate time scalesB in "#$gate$ays t#e time scale %or t#e detection o% congestionroug#ly matc#es t#e time scale re.uired %or connections to respond to congestion- "#$gate$ays donHt noti%y connections to reduce t#eir $indo$s as a result o% transient congestionat t#e gate$ay-
2. No global synchronizationB"#$gate$ays a&oid global sync#roni/ation by mar0ing pac0ets
at as lo$ a rate as possible- '#e rate at $#ic# "#$gate$ays mar0 pac0ets depend on t#e le&elo% congestion--
3. Maximizing global powerB simulation s#o$s t#at global po$er is #ig#er $it# "#$ gatewayst#an $it#$rop Tail gateways-Poweris de%ined as t#e ratio of throughput to delay-
4. FairnessB t#e"#$gate$ay does not discriminate against particular connections or classes o%connectionM t#e %raction o% mar0ed pac0ets %or eac# connection is roug#ly proportional to t#atconnectionHs s#are o% t#e band$idt#- 6o$e&er,"#$gate$ays do not attempt to ensure t#ateac# connection recei&es t#e same %raction o% t#e total t#roug#put, and do not e2plicitlycontrol misbe#a&ing users-
5. Appropriate for a wide range of environmentsB t#e randomi%ed mechanism o% mar0ingpac0ets is appropriate %or net$or0s $it# connections $it# a large range o% roundtrip times andt#roug#put, and %or large range in t#e number o% acti&e connections at one time-
6. Identifying misbehaving usersB RED gate$ays pro&ide an e%%icient mec#anism %or identi%yingconnections t#at use a large s#are o% t#e band$idt# in times o% congestion-
-
8/12/2019 Project Report (MG2)
17/85
Chapter ,our
-.1 Overvie% of $CP #odifications variants4
-.1.1 $CP Reno
'#is Reno!" retains t#e basic principle o% 'a#oe, suc# as slo$ starts and t#e coarse grain re4transmittimer- 6o$e&er it adds some intelligence o&er it so t#at lost pac0ets are detected earlier and t#e
pipeline is not emptied e&ery time a pac0et is lost-Reno re.uires t#at $e recei&e immediate ac0no$ledgement $#ene&er a segment is recei&ed-
'#e logic be#ind t#is is t#at $#ene&er $e recei&e a duplicate ac0no$ledgment, t#en #is duplicateac0no$ledgment could #a&e been recei&ed i% t#e ne2t segment in se.uence e2pected, #as beendelayed in t#e net$or0 and t#e segments reac#ed t#ere out o% order or else t#at t#e pac0et is lost- +%$e recei&e a number o% duplicate ac0no$ledgements t#en t#at means t#at su%%icient time #a&e passedand e&en i% t#e segment #ad ta0en a longer pat#, it s#ould #a&e gotten to t#e recei&er by no$- '#ere isa &ery #ig# probability t#at it $as lost- So Reno suggests an algorit#m called 5,ast Re6$rans#it7.#ene&er $e recei&e duplicate AI3s $e ta0e it as a sign t#at t#e segment $as lost, so $e re4transmit t#e segment $it#out $aiting %or timeout-
'#us $e manage to re4transmit t#e segment $it# t#e pipe almost %ull-
Anot#er modi%ication t#at RE:; ma0es is in t#at a%ter a pac0et loss, it does not reduce t#econgestion $indo$ to 1- Since t#is empties t#e pipe- +t enters into a algorit#m $#ic# $e call 5,ast6Re6 $rans#it7. '#e basic algorit#m is presented as underB
1) Eac# time $e recei&e duplicate AI3s $e ta0e t#at to mean t#at t#e segment $as lost and$e re4transmit t#e segment immediately and enter OFast4Reco&ery3
) Set SSt#res# to #al% t#e current $indo$ si/e and also set D to t#e same &alue-
) For eac# duplicate AI recei&e increase D by one- +% t#e increase D is greater t#ant#e amount o% data in t#e pipe t#en transmit a ne$ segment else $ait-
) +% t#ere are O$3 segments in t#e $indo$ and one is lost, t#en $e $ill recei&e ($41) duplicateAI3s- Since D is reduced to *, t#ere%ore #al% a $indo$ o% data is ac0no$ledged
be%ore $e can send a ne$ segment- ;nce $e retransmit a segment, $e $ould #a&e to $ait %orat least one R'' be%ore $e $ould recei&e a %res# ac0no$ledgement- #ene&er $e recei&e a%res# AI $e reduce t#e :D to SSt#res#- +% $e #ad pre&iously recei&ed ($41) duplicateAI3s t#en at t#is point $e s#ould #a&e e2actly $* segments in t#e pipe $#ic# is e.ual to$#at $e set t#e :D to be at t#e end o% %ast reco&ery- '#us $e don3t empty t#e pipe, $e
5ust reduce t#e %lo$- e continue $it# congestion a&oidance p#ase o% 'a#oe a%ter t#at-
17
-
8/12/2019 Project Report (MG2)
18/85
)i#uation Resuts and (naysis $CP Reno4
a4 $hrou'hput vs $i#e R/4
Fig -1 '#roug#put &s- 'ime %or ' RE:; in a #ybrid net$or0 (using RED)
!raph e'end+
'#roug#put %or ' sin0 '#roug#put %or >D Sin01 '#roug#put %or >D Sin0
18
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
19/85
b4 $hrou'hput vs $i#e /rop $ai4
Fig - '#roug#put &s- 'ime %or ' RE:; in a #ybrid net$or0 (using Drop 'ail)
!raph e'end+
'#roug#put %or ' sin0 '#roug#put %or >D Sin01 '#roug#put %or >D Sin0
19
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
20/85
c4 nd6to6end /eay vs $i#e R/4
Fig - End4to4end Delay &s- 'ime %or ' RE:; in a #ybrid net$or0 (using RED)
!raph e'end+
End to end Delay %or ' sin0 End to end Delay %or >D Sin01 End to end Delay %or >D Sin0
2
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
21/85
d)nd6to6end /eay vs $i#e /rop $ai4
Fig - End4to4end Delay &s- 'ime %or ' RE:; in a #ybrid net$or0 (using Drop 'ail)
!raph e'end+
End to end Delay %or ' sin0 End to end Delay %or >D Sin01 End to end Delay %or >D Sin0
21
!ime "i#ms$
-
8/12/2019 Project Report (MG2)
22/85
-
8/12/2019 Project Report (MG2)
23/85
-
8/12/2019 Project Report (MG2)
24/85
Fig - End4to4end Delay &s- 'ime %or ' VE=AS in a #ybrid net$or0 (using RED)
!raph e'end+
End to end Delay %or ' sin0
End to end Delay %or >D Sin01 End to end Delay %or >D Sin0
24
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
25/85
d) nd6to6end /eay vs $i#e /rop $ai4
Fig -C End4to4end Delay &s- 'ime %or ' VE=AS in a #ybrid net$or0 (using Drop 'ail)
!raph e'end+
End to end Delay %or ' sin0 End to end Delay %or >D Sin01 End to end Delay %or >D Sin0
25
!ime "i#ms$
-
8/12/2019 Project Report (MG2)
26/85
-.1.3 $CP 9e% Reno
' :e$ Reno impro&es retransmission during t#e %ast reco&ery p#ase o% ' Reno- During %astreco&ery, %or e&ery duplicate AI t#at is returned to ' :e$ Reno, a ne$ unsent pac0et %rom t#eend o% t#e congestion $indo$ is sent, to 0eep t#e transmit $indo$ %ull- For e&ery AI t#at ma0es
partial progress in t#e se.uence space, t#e sender assumes t#at t#e AI points to a ne$ #ole, and t#e
ne2t pac0et beyond t#e AIed se.uence number is sent-
-
8/12/2019 Project Report (MG2)
27/85
a4 $hrou'hput vs $i#e R/4
Fig -9 '#roug#put &s- 'ime %or ' :E RE:; in a #ybrid net$or0 (using RED)
!raph e'end+
'#roug#put %or ' sin0
'#roug#put %or >D Sin01 '#roug#put %or >D Sin0
27
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
28/85
b4 $hrou'hput vs $i#e /rop $ai4
Fig -1 '#roug#put &s- 'ime %or ' :E RE:; in a #ybrid net$or0 (using Drop 'ail)
!raph e'end+
'#roug#put %or ' sin0 '#roug#put %or >D Sin01
'#roug#put %or >D Sin0
28
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
29/85
c4 nd6to6end /eay vs $i#e R/4
Fig -11 End4to4end Delay &s- 'ime %or ' :E RE:; in a #ybrid net$or0 (using RED)
!raph e'end+
End to end Delay %or ' sin0 End to end Delay %or >D Sin01
End to end Delay %or >D Sin0
29
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
30/85
d4 nd6to6end /eay vs $i#e /rop $ai4
Fig -1 End4to4end Delay &s- 'ime %or ' :E RE:; in a #ybrid net$or0 (using Drop 'ail)
!raph e'end+
End to end Delay %or ' sin0 End to end Delay %or >D Sin01
End to end Delay %or >D Sin0
3
!ime "i#
ms$
-
8/12/2019 Project Report (MG2)
31/85
-.2 :oint (naysis of a 8ariants
' Vegas detects congestion at an incipient stage based on increasing Round4'rip 'ime(R'') &alues o% t#e pac0ets in t#e connection unli0e ot#er %la&ours li0e Reno, :e$ Reno etc- $#ic#
detect congestion only a%ter it #as actually #appened &ia pac0et drops- '#e algorit#m depends #ea&ilyon accurate calculation o% t#e
-
8/12/2019 Project Report (MG2)
32/85
+n many scenarios, ' :e$ Reno and ' Vegas per%orm similarly-
-
8/12/2019 Project Report (MG2)
33/85
Chapter ,ive
.1 /escription of (naysis toos used
Operatin' )yste#B >buntu 1-
)i#uation $ooB :et$or0 Simulator (:S)
!raphica (naysis $ooB P =rap#
:et$or0 Simulator or :S !"!1@"!11" is a discrete e&ent simulator targeted at net$or0ingresearc#- :s pro&ides substantial support %or simulation o% ', routing, and multicast protocols o&er$ired and $ireless (local and satellite) net$or0s-
:S began as a &ariant o% t#e REA net$or0 simulator in 19C9 and #as e&ol&ed substantially
o&er t#e past %e$ years- +n 199? ns de&elopment $as supported by DARA t#roug# t#e V+:' pro5ectat
Fig ?-1 Discrete E&ent Sc#eduler
33
-
8/12/2019 Project Report (MG2)
34/85
:S #as t$o di%%erent types o% e&ent sc#edulers implemented- '#ese are real4time and non4real4time sc#edulers- For a non4real4time sc#eduler, t#ree implementations (ist, 6eap and alendar)are a&ailable, e&en t#oug# t#ey are all logically per%orm t#e same- '#is is because o% bac0$ardcompatibilityB some early implementation o% net$or0 components added by a user (not t#e originalones included in a pac0age) may use a speci%ic type o% sc#eduler not t#roug# public %unctions but#ac0ing around t#e internals- '#e alendar non4real4time sc#eduler is set as t#e de%ault- '#e real4timesc#eduler is %or emulation, $#ic# allo$ t#e simulator to interact $it# a real net$or0- urrently,emulation is under de&elopment alt#oug# an e2perimental &ersion is a&ailable- '#e %ollo$ing is ane2ample o% selecting a speci%ic e&ent sc#edulerB
. . .
set ns !ne$ Simulator"Qns use4sc#eduler 6eap. . .
Anot#er use o% an e&ent sc#eduler is to sc#edule simulation e&ents, suc# as $#en to start anF' application, $#en to %inis# a simulation, or %or simulation scenario generation prior to a
simulation run- An e&ent sc#eduler ob5ect itsel% #as simulation sc#eduling member %unctions suc# asat time &string&t#at issue a special e&ent called AtE&ent at a speci%ied simulation time- An AtE&entis actually a c#ild class o% E&ent, $#ic# #as an additional &ariable to #old t#e gi&en string-6o$e&er, it is treated t#e same as a normal (pac0et related) e&ent $it#in t#e e&ent sc#eduler- #en asimulation is started, and as t#e sc#eduled time %or an AtE&ent in t#e e&ent .ueue comes, t#e AtE&entis passed to an AtE&ent #andler t#at is created once and #andles all AtE&ents, and t#e ;'clcommand speci%ied by t#estring%ield o% t#e AtE&ent is e2ecuted- '#e %ollo$ing is a simulation e&entsc#eduling line added &ersion o% t#e abo&e e2ample-
.3 9et%ork Co#ponents
'#is section tal0s about t#e :S components, mostly compound net$or0 components- Fig ?-s#o$s a partial ;'cl class #ierarc#y o% :S, $#ic# $ill #elp understanding t#e basic net$or0components--
Fig ?- lass 6ierarc#y (artial)
34
-
8/12/2019 Project Report (MG2)
35/85
'#e root o% t#e #ierarc#y is t#e 'cl;b5ect class t#at is t#e superclass o% all ;'cl library ob5ects(sc#eduler, net$or0 components, timers and t#e ot#er ob5ects including :A related ones)- As anancestor class o% 'cl;b5ect, :s;b5ect class is t#e super class o% all basic net$or0 component ob5ectst#at #andle pac0ets, $#ic# may compose compound net$or0 ob5ects suc# as nodes and lin0s- '#e
basic net$or0 components are %urt#er di&ided into t$o subclasses, onnector and lassi%ier, based ont#e number o% t#e possible output data pat#s- '#e basic net$or0 ob5ects t#at #a&e only one outputdata pat# are under t#e onnector class, and s$itc#ing ob5ects t#at #a&e possible multiple output data
pat#s are under t#e lassi%ier class-
.-9ode and Routin'
A node is a compound ob5ect composed o% a node entry ob5ect and classi%iers as s#o$n in Fig?-- '#ere are t$o types o% nodes in :S- A unicast node #as an address classi%ier t#at does unicastrouting and a port classi%ier- A multicast node, in addition, #as a classi%ier t#at classi%y multicast
pac0ets %rom unicast pac0ets and a multicast classi%ier t#at per%orms multicast routing-
Fig ?- :ode (>nicast and ulticast)
+n :S, >nicast nodes are t#e de%ault nodes- 'o create ulticast nodes t#e user must e2plicitly noti%yin t#e input ;'cl script, rig#t a%ter creating a sc#eduler ob5ect, t#at all t#e nodes t#at $ill be createdare multicast nodes- A%ter speci%ying t#e node type, t#e user can also select a speci%ic routing protocol
ot#er t#an using a de%ault one-
0nicast
4 'nsrtproto type4 typeB Static, Session, DV, cost, multi4pat#
Muticast
4 'nsmulticast (rig#t a%ter set 'ns!ne$ Sc#eduler")4 'nsmrtproto type4 typeB trcast, D, S',
-
8/12/2019 Project Report (MG2)
36/85
Link
A lin0 is anot#er ma5or compound ob5ect in :S- #en a user creates a lin0 using a duple24lin0member %unction o% a Simulator ob5ect, t$o simple2 lin0s in bot# directions are created as s#o$n inFig ?--
Fig ?-- in0
;ne t#ing to note is t#at an output .ueue o% a node is actually implemented as a part o% simple2 lin0ob5ect- ac0ets de.ueued %rom a .ueue are passed to t#e Delay ob5ect t#at simulates t#e lin0 delay,and pac0ets dropped at a .ueue are sent to a :ull Agent and are %reed t#ere- Finally, t#e '' ob5ectcalculates 'ime 'o i&e parameters %or eac# pac0et recei&ed and updates t#e '' %ield o% t#e pac0et-
$racin'
+n :S, net$or0 acti&ities are traced around simple2 lin0s- +% t#e simulator is directed to tracenet$or0 acti&ities (speci%ied using 'nstrace4allfileor 'nsnamtrace4allfile), t#e lin0s created
a%ter t#e command $ill #a&e t#e %ollo$ing trace ob5ects inserted as s#o$n in Fig ?-?- >serscan also speci%ically create a trace ob5ect o% type typebet$een t#e gi&ensrc and dstnodesusing t#e create4trace type file src dstT command-
Fig ?-? +nserting 'race ;b5ects
#en eac# inserted trace ob5ect (i-e- En.', De.', Drp' and Rec&') recei&es a pac0et, it$rites to t#e speci%ied trace %ile $it#out consuming any simulation time, and passes t#e pac0et to t#ene2t net$or0 ob5ect- '#e trace %ormat $ill be e2amined in t#e =eneral Analysis E2ample section-
;ueue Monitor
-
8/12/2019 Project Report (MG2)
37/85
$ant to measure t#e dynamics o% a&erage .ueue si/e and current .ueue si/e o% a speci%ic RED .ueue(i-e- need %or .ueue monitoring)- Nueue monitoring can be ac#ie&ed using .ueue monitor ob5ects andsnoop .ueue ob5ects as s#o$n in Fig ?-@-
Fig ?-@ onitoring Nueue
#en a pac0et arri&es, a snoop .ueue ob5ect noti%ies t#e .ueue monitor ob5ect o% t#is e&ent-
'#e .ueue monitor using t#is in%ormation monitors t#e .ueue- A RED .ueue monitoring e2ample iss#o$n in t#e RED Nueue onitor E2ample section- :ote t#at snoop .ueue ob5ects can be used in
parallel $it# tracing ob5ects e&en t#oug# it is not s#o$n in t#e abo&e Fig ?-@-
37
-
8/12/2019 Project Report (MG2)
38/85
Chapter )i"6.1Project Concusion
'#is pro5ect presents t#e comparati&e analysis o% RED $it# ' in a #ybrid net$or0- +t studiest#e per%ormance o% t#e &ariants o% '(' 'a#oe, ' Vegas, ' Reno) in t#e #ybrid net$or0- +talso analy/es t#e ad&antages o% RED o&er ot#er congestion a&oidance mec#anisms suc# as Drop 'ail-
#apter gi&es an introduction o% t#e ' protocol and t#e RED algorit#m- +t t#en compares t#eper%ormance o% RED $it# ' in a #ybrid net$or0- #apter discuss t#e per%ormance o% Drop 'ailand #ence t#e ad&antages o% Drop 'ail o&er RED- #apter studies t#e comparati&e per%ormance o%t#e ' &ariants (' Vegas, ' :e$ Reno, ' Reno) $#en assisted by RED and Drop 'ail-
#ile t#e principles be#ind RED gate$ays are %airly general, and RED gate$ays can be use%ul incontrolling t#e a&erage .ueue si/e e&en in a net$or0 $#ere t#e transport protocol cannot be trusted to
be cooperati&e, RED gate$ays are intended %or a net$or0 $#ere t#e transport protocols responds tocongestion indication %rom t#e net$or0- '#e gate$ay congestion control mec#anism in REDgate$ays simpli%ies t#e congestion control 5ob re.uired o% t#e transport protocol, and s#ould beapplicable to transport4layer congestion control mec#anisms ot#er t#an t#e current &ersion o% ',including protocols $it# rate4based rat#er t#an $indo$4based %lo$ control-
6o$e&er, some aspects o% RED gate$ays are speci%ically targeted to '*+ net$or0s- '#e REDgate$ay is designed %or a net$or0 $#ere a single mar0ed or dropped pac0et is su%%icient to signal t#e
presence o% congestion to t#e transport4layer protocol- RED also per%orms better $#en ' is t#ecooperating congestion a&oidance mec#anism as compared to >D-
RED gate$ays can be use%ul in gate$ays $it# a range o% pac0et4sc#eduling and pac0et4droppingalgorit#ms- For e2ample, RED congestion control mec#anisms could be implemented in gate$ays$it# drop pre%erence, $#ere pac0ets are mar0ed as eit#er 7essential8 or 7optional8, and 7optional8
pac0ets are dropped %irst $#en t#e .ueue e2ceeds a certain si/e- Similarly %or a gate$ay $it# separate.ueues %or real time and non4real time tra%%ic, %or e2ample, RED congestion control mec#anismscould be applied to t#e .ueue %or one o% t#ese tra%%ic classes-
Random Early Detection gate$ays are an e%%ecti&e mec#anism %or congestion a&oidance at t#egate$ay, in cooperation $it# net$or0 transport protocols- +% RED gate$ays droppac0ets $#en t#ea&erage .ueue si/e e2ceeds t#e ma2imum t#res#old, rat#er t#an simply setting a bit in pac0et #eaders,t#en RED gate$ays control t#e calculated a&erage .ueue si/e- '#is action pro&ides an upper boundon t#e a&erage delay at t#e gate$ay-
'#e probability t#at t#e RED gate$ay c#ooses a particular connection to noti%y duringcongestion is roug#ly proportional to t#at connection3s s#are o% t#e band$idt# at t#e gate$ay- '#isapproac# a&oids a bias against bursty tra%%ic at t#e gate$ay- For RED gate$ays, t#e rate at $#ic# t#egate$ay mar0s pac0ets depends on t#e le&el o% congestion, a&oiding t#e global sync#roni/ation t#atresults %rom many connections decreasing t#eir $indo$s at t#e same time- '#e RED gate$ay is arelati&ely simple gate$ay algorit#m t#at could be implemented in current net$or0s or in #ig#4speednet$or0s o% t#e %uture-
38
-
8/12/2019 Project Report (MG2)
39/85
-
8/12/2019 Project Report (MG2)
40/85
References
!1"- Sally Floyd, Van Jacobson, 7Random Early Detection (RED) gate$ays %or ongestionA&oidance8, I###/(C) Transactions on *etworking, Vol 1,August 199, pp- 9G1-
!"- Vinton =- er%, Robert E- Ia#n, 7A rotocol %or ac0et :et$or0 +ntercommunication8-I###Transactions on Communications, Vol- , :o- ?, ay 19,pp- @4@C-
!"-omer, Douglas E- (@)-Internetworking with TCP/IP+Principles, Protocols, and (rchitecture-(?t# ed-)- Del#iB rentice 6all-
!"- Sally Floyd and Ie&in Fall, 7:S Simulator 'ests %or Random Early Detection (RED) Nueueanagement8-awrence -erkley aboratory, April 199-
!?"-V- Jacobson- ongestion a&oidance and control-Proceedings of .IC0))122, (C), August19CC- An updated &ersion is a&ailable &ia %tpB**%tp-ee-lbl-go&*papers*conga&oid-ps-U-
!@"- S#o#idul +slam, d- :ia/ ors#ed, SI- S#ari%ul +slam ,d- e5ba#ul A/am,An E2perimentalAnalysis o% Random Early Discard (RED) Nueue %or ongestion ontrol8-International 3ournal ofComputer (pplications 45678 9 2227: Volume 1?G :o-, February 11-
!" Jeong#oon o, Ric#ard J- a, Ven0at Anant#aram, and Jean alrand-& Analysis andomparison o% ' Reno and Vegas-$epartment of #lectrical #ngineering and Computer .ciences,
;niversity of California at -erkeley, July 1%199C-
!C" S- Floyd, 7' and E2plicit ongestion :oti%ication8-(C) Computer Communication "eview,(?), ;ctober 199-
!9" Andre$ S 'anenbaum- Computer *etworks(t#ed)-Del#iB rentice 6all!
!1" - Ric#ard Ste&ens (199)- TCP/IP Illustrated,
-
8/12/2019 Project Report (MG2)
41/85
uSeFesX#lenXei
-
8/12/2019 Project Report (MG2)
42/85
(ppendi" (
)i#uation Codes for $CP R9O
1. Code for si#uation of R/ in $CP R9O $hrou'hput4
Y Y De%ine optionsY Nueue*RED set .$eig#t -Nueue*RED set t#res#
Nueue*RED set ma2t#res#
set opt(c#an) #annel*ireless#annel MY c#annel typeset opt(prop) ropagation*'$oRay=round MY radio4propagation modelset opt(neti%) #y*ireless#y MY net$or0 inter%ace typeset opt(mac) ac*C11 MY A typeset opt(i%.) Nueue*RED MY inter%ace .ueue typeset opt(ll) MY lin0 layer typeset opt(ant) Antenna*;mniAntenna MY antenna modelset opt(i%.len) ? MY ma2 pac0et in i%.set opt(nn) MY number o% mobilenodesset opt(ad#ocRouting) DSDV MY routing protocol
set opt(cp) MY connection pattern %ile
set opt(2) @ MY 2 coordinate o% topologyset opt(y) @ MY y coordinate o% topologyset opt(seed) - MY seed %or random number gen-set opt(stop) ? MY time to stop simulation
set opt(%tp14start) ?-
set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes set numbsnodes 1
Y ZZZ '#roug#put 'race ZZZ
set % !open out-tr $"
set %1 !open out1-tr $"set % !open out-tr $"
42
-
8/12/2019 Project Report (MG2)
43/85
Y
Y create simulator instanceset ns !ne$ Simulator"Qns color 1 redQns color blueQns color greenY set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domainAddrarams set clusternum Qclusternumlappend eilastle&el 1 1 1 ? MY number o% nodes in eac# clusterAddrarams set nodesnum Qeilastle&el MY o% eac# domain
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topologyQtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1- --T MY #ierarc#ical addresses %or $ired domain%or set i T Qi [ Qnum$irednodesT incr iT set (Qi) !Qns node !linde2 Qtemp Qi""T
Y con%igure %or base4station node
Qns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \ 4ant'ype Qopt(ant) \ 4prop'ype Qopt(prop) \ 4p#y'ype Qopt(neti%) \ 4c#annel'ype Qopt(c#an) \
4topo+nstance Qtopo \ 4$iredRouting ;: \
4agent'race ;: \ 4router'race ;FF \
43
-
8/12/2019 Project Report (MG2)
44/85
4mac'race ;FF
Ycreate base4station nodeset temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless MY domainset
-
8/12/2019 Project Report (MG2)
45/85
-
8/12/2019 Project Report (MG2)
46/85
Y Reset Variables
Qsin01 set bytes Qsin0 set bytes Qsin0 set bytes
Qns at !e2pr Qno$KQtime" record MY Sc#edule Record a%ter Qtime inter&al sec
TY Start Recording at 'ime
Qns at - recordYStop Simulation at 'ime C sec
Qns at C- stop
Y E2it Simulation at 'ime C-1 sec
Qns at C-1 puts \:S EP+'+:=---\ M Qns #alt
proc stop T global ns trace%d namtrace % %1 %
close Q%close Q%1
close Q%
Ylot Recorded Statistics
e2ec 2grap# out-tr out1-tr out-tr 4geometry C2 X e2ec nam $ireless4out-nam X
Qns %lus#4trace close Qtrace%d close QnamtraceT
puts Starting Simulation---Qns run
46
-
8/12/2019 Project Report (MG2)
47/85
2. Code for si#uation of R/ in $CP R9O nd to end /eay4
Y Y De%ine optionsY
Nueue*RED set .$eig#t -Nueue*RED set t#res# Nueue*RED set ma2t#res#
set opt(c#an) #annel*ireless#annel MY c#annel typeset opt(prop) ropagation*'$oRay=round MY radio4propagation modelset opt(neti%) #y*ireless#y MY net$or0 inter%ace typeset opt(mac) ac*C11 MY A typeset opt(i%.) Nueue*RED MY inter%ace .ueue typeset opt(ll) MY lin0 layer typeset opt(ant) Antenna*;mniAntenna MY antenna model
set opt(i%.len) ? MY ma2 pac0et in i%.set opt(nn) MY number o% mobilenodesset opt(ad#ocRouting) DSDV MY routing protocol
set opt(cp) MY connection pattern %ile
set opt(2) @ MY 2 coordinate o% topologyset opt(y) @ MY y coordinate o% topologyset opt(seed) - MY seed %or random number gen-set opt(stop) ? MY time to stop simulation
set opt(%tp14start) ?-set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes set numbsnodes 1
Y ZZZ ac0et Delay 'race ZZZ
set % !open delay-tr $"set % !open delay1-tr $"set %? !open delay-tr $"
Y
Y create simulator instanceset ns !ne$ Simulator"
47
-
8/12/2019 Project Report (MG2)
48/85
Y set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domainAddrarams set clusternum Qclusternumlappend eilastle&el 1 1 ? MY number o% nodes in eac# clusterAddrarams set nodesnum Qeilastle&el MY o% eac# domain
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topologyQtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1-T MY #ierarc#ical addresses %or $ired domain%or set i T Qi [ Qnum$irednodesT incr iT set (Qi) !Qns node !linde2 Qtemp Qi""T
Y con%igure %or base4station nodeQns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \ 4ant'ype Qopt(ant) \ 4prop'ype Qopt(prop) \ 4p#y'ype Qopt(neti%) \ 4c#annel'ype Qopt(c#an) \
4topo+nstance Qtopo \ 4$iredRouting ;: \
4agent'race ;: \ 4router'race ;FF \ 4mac'race ;FF
Ycreate base4station nodeset temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless MY domainset
-
8/12/2019 Project Report (MG2)
49/85
QD"set sin0 !ne$ Agent*ossonitor"
Qns attac#4agent Qnode(1) Qsin0Qns attac#4agent Q(1) Qagent1Qns connect Qagent1 Qsin0set app1 !ne$ Application*'ra%%ic*
-
8/12/2019 Project Report (MG2)
50/85
-
8/12/2019 Project Report (MG2)
51/85
Y Record ac0et Delay in File
i% Qb$9 ^ Q#oldse. T puts Q% Qno$ !e2pr (Qb$C 4 Q#oldtime)*(Qb$9 4 Q#oldse.)" T else puts Q% Qno$ !e2pr (Qb$9 4 Q#oldse.)" T
i% Qb$11 ^ Q#oldse.1 T puts Q% Qno$ !e2pr (Qb$1 4 Q#oldtime1)*(Qb$11 4 Q#oldse.1)" T else puts Q% Qno$ !e2pr (Qb$11 4 Q#oldse.1)" T
i% Qb$1 ^ Q#oldse. T puts Q%? Qno$ !e2pr (Qb$1 4 Q#oldtime)*(Qb$1 4 Q#oldse.)" T else
puts Q%? Qno$ !e2pr (Qb$1 4 Q#oldse.)" T
Y Reset Variables
set #oldtime Qb$C set #oldse. Qb$9 set #oldtime1 Qb$1 set #oldse.1 Qb$11
set #oldtime Qb$1 set #oldse. Qb$1Qns at !e2pr Qno$KQtime" record MY Sc#edule Record a%ter Qtime inter&al sec
TY Start Recording at 'ime
Qns at - recordYStop Simulation at 'ime C sec
Qns at C- stopY E2it Simulation at 'ime C-1 sec
Qns at C-1 puts \:S EP+'+:=---\ M Qns #alt
proc stop T global ns trace%d namtrace % % %?
close Q% close Q%
close Q%?
51
-
8/12/2019 Project Report (MG2)
52/85
Y lot Recorded Statistics
e2ec 2grap# delay-tr delay1-tr delay-tr 4geometry C2 X
e2ec nam $ireless4out-nam XQns %lus#4trace close Qtrace%d close Qnamtrace
T
puts Starting Simulation---Qns run
(ppendi" =
)i#uation Codes for $CP 8!()
52
-
8/12/2019 Project Report (MG2)
53/85
1- Code for si#uation of R/ in $CP 8!() $hrou'hput4
Y Y De%ine options
Y Nueue*RED set .$eig#t -Nueue*RED set t#res# Nueue*RED set ma2t#res#
set opt(c#an) #annel*ireless#annel MY c#annel typeset opt(prop) ropagation*'$oRay=round MY radio4propagation modelset opt(neti%) #y*ireless#y MY net$or0 inter%ace typeset opt(mac) ac*C11 MY A typeset opt(i%.) Nueue*RED MY inter%ace .ueue typeset opt(ll) MY lin0 layer type
set opt(ant) Antenna*;mniAntenna MY antenna modelset opt(i%.len) ? MY ma2 pac0et in i%.set opt(nn) MY number o% mobilenodesset opt(ad#ocRouting) DSDV MY routing protocol
set opt(cp) MY connection pattern %ile
set opt(2) @ MY 2 coordinate o% topologyset opt(y) @ MY y coordinate o% topologyset opt(seed) - MY seed %or random number gen-set opt(stop) ? MY time to stop simulation
set opt(%tp14start) ?-set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes set numbsnodes 1
Y ZZZ '#roug#put 'race ZZZ
set % !open out-tr $"set %1 !open out1-tr $"set % !open out-tr $"
Y
Y create simulator instance
set ns !ne$ Simulator"Qns color 1 red
53
-
8/12/2019 Project Report (MG2)
54/85
Qns color blueQns color greenY set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domainAddrarams set clusternum Qclusternumlappend eilastle&el 1 1 1 ? MY number o% nodes in eac# clusterAddrarams set nodesnum Qeilastle&el MY o% eac# domain
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topologyQtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1- --T MY #ierarc#ical addresses %or $ired domain%or set i T Qi [ Qnum$irednodesT incr iT set (Qi) !Qns node !linde2 Qtemp Qi""
T
Y con%igure %or base4station nodeQns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \ 4ant'ype Qopt(ant) \ 4prop'ype Qopt(prop) \ 4p#y'ype Qopt(neti%) \
4c#annel'ype Qopt(c#an) \4topo+nstance Qtopo \
4$iredRouting ;: \4agent'race ;: \
4router'race ;FF \ 4mac'race ;FF
Ycreate base4station nodeset temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless MY domainset
-
8/12/2019 Project Report (MG2)
55/85
-
8/12/2019 Project Report (MG2)
56/85
set agent !ne$ Agent*>D"set sin0 !ne$ Agent*ossonitor"Qns attac#4agent Qnode() QagentQns attac#4agent Qnode() Qsin0Qns connect Qagent Qsin0set app !ne$ Application*'ra%%ic*
-
8/12/2019 Project Report (MG2)
57/85
TY Start Recording at 'ime
Qns at - recordYStop Simulation at 'ime C sec
Qns at C- stopY E2it Simulation at 'ime C-1 sec
Qns at C-1 puts \:S EP+'+:=---\ M Qns #alt
proc stop T global ns trace%d namtrace % %1 %
close Q%
close Q%1 close Q%
Ylot Recorded Statistics
e2ec 2grap# out-tr out1-tr out-tr 4geometry C2 X e2ec nam $ireless4out-nam X
Qns %lus#4trace close Qtrace%d close QnamtraceT
puts Starting Simulation---Qns run
- Code for si#uation of R/ in $CP 8!() nd to end /eay4
Y Y De%ine optionsY
Nueue*RED set .$eig#t -Nueue*RED set t#res#
57
-
8/12/2019 Project Report (MG2)
58/85
Nueue*RED set ma2t#res#
set opt(c#an) #annel*ireless#annel MY c#annel typeset opt(prop) ropagation*'$oRay=round MY radio4propagation modelset opt(neti%) #y*ireless#y MY net$or0 inter%ace typeset opt(mac) ac*C11 MY A typeset opt(i%.) Nueue*RED MY inter%ace .ueue typeset opt(ll) MY lin0 layer typeset opt(ant) Antenna*;mniAntenna MY antenna modelset opt(i%.len) ? MY ma2 pac0et in i%.set opt(nn) MY number o% mobilenodesset opt(ad#ocRouting) DSDV MY routing protocol
set opt(cp) MY connection pattern %ile
set opt(2) @ MY 2 coordinate o% topologyset opt(y) @ MY y coordinate o% topology
set opt(seed) - MY seed %or random number gen-set opt(stop) ? MY time to stop simulation
set opt(%tp14start) ?-set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes set numbsnodes 1
Y ZZZ ac0et Delay 'race ZZZ
set % !open delay-tr $"set % !open delay1-tr $"set %? !open delay-tr $"
Y
Y create simulator instanceset ns !ne$ Simulator"
Y set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domainAddrarams set clusternum Qclusternumlappend eilastle&el 1 1 ? MY number o% nodes in eac# cluster
Addrarams set nodesnum Qeilastle&el MY o% eac# domain
58
-
8/12/2019 Project Report (MG2)
59/85
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topologyQtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1-T MY #ierarc#ical addresses %or $ired domain%or set i T Qi [ Qnum$irednodesT incr iT
set (Qi) !Qns node !linde2 Qtemp Qi""T
Y con%igure %or base4station nodeQns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \ 4ant'ype Qopt(ant) \ 4prop'ype Qopt(prop) \
4p#y'ype Qopt(neti%) \ 4c#annel'ype Qopt(c#an) \
4topo+nstance Qtopo \ 4$iredRouting ;: \
4agent'race ;: \ 4router'race ;FF \ 4mac'race ;FF
Ycreate base4station nodeset temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless MY domain
set
-
8/12/2019 Project Report (MG2)
60/85
YQns node4con%ig 4$iredRouting ;FF
%or set 5 T Q5 [ Qopt(nn)T incr 5T set node(Q5) ! Qns node !linde2 Qtemp !e2pr Q5K1"" " Qnode(Q5) base4station !Addrarams addrid \
!Q
-
8/12/2019 Project Report (MG2)
61/85
Y +nitiali/e Flags
set #oldtime set #oldse.
set #oldtime1 set #oldse.1
set #oldtime set #oldse.
set #oldrate1 set #oldrate set #oldrate
Y Function 'o record Statistcis (
-
8/12/2019 Project Report (MG2)
62/85
puts Q% Qno$ !e2pr (Qb$1 4 Q#oldtime1)*(Qb$11 4 Q#oldse.1)" T else puts Q% Qno$ !e2pr (Qb$11 4 Q#oldse.1)" T
i% Qb$1 ^ Q#oldse. T puts Q%? Qno$ !e2pr (Qb$1 4 Q#oldtime)*(Qb$1 4 Q#oldse.)" T else puts Q%? Qno$ !e2pr (Qb$1 4 Q#oldse.)" T
Y Reset Variables
set #oldtime Qb$C set #oldse. Qb$9
set #oldtime1 Qb$1 set #oldse.1 Qb$11 set #oldtime Qb$1 set #oldse. Qb$1Qns at !e2pr Qno$KQtime" record MY Sc#edule Record a%ter Qtime inter&al sec
TY Start Recording at 'ime
Qns at - recordYStop Simulation at 'ime C sec
Qns at C- stopY E2it Simulation at 'ime C-1 sec
Qns at C-1 puts \:S EP+'+:=---\ M Qns #alt
proc stop T global ns trace%d namtrace % % %?
close Q% close Q% close Q%?
Y lot Recorded Statistics
e2ec 2grap# delay-tr delay1-tr delay-tr 4geometry C2 X
e2ec nam $ireless4out-nam X
Qns %lus#4trace close Qtrace%d
62
-
8/12/2019 Project Report (MG2)
63/85
-
8/12/2019 Project Report (MG2)
64/85
Nueue*RED set t#res# Nueue*RED set ma2t#res#
set opt(c#an) #annel*ireless#annel MY c#annel typeset opt(prop) ropagation*'$oRay=round MY radio4propagation modelset opt(neti%) #y*ireless#y MY net$or0 inter%ace typeset opt(mac) ac*C11 MY A typeset opt(i%.) Nueue*RED MY inter%ace .ueue typeset opt(ll) MY lin0 layer typeset opt(ant) Antenna*;mniAntenna MY antenna modelset opt(i%.len) ? MY ma2 pac0et in i%.set opt(nn) MY number o% mobilenodesset opt(ad#ocRouting) DSDV MY routing protocol
set opt(cp) MY connection pattern %ile
set opt(2) @ MY 2 coordinate o% topology
set opt(y) @ MY y coordinate o% topologyset opt(seed) - MY seed %or random number gen-set opt(stop) ? MY time to stop simulation
set opt(%tp14start) ?-set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes set numbsnodes 1
Y ZZZ '#roug#put 'race ZZZ
set % !open out-tr $"set %1 !open out1-tr $"set % !open out-tr $"
Y
Y create simulator instanceset ns !ne$ Simulator"Qns color 1 redQns color blueQns color greenY set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domainAddrarams set clusternum Qclusternum
lappend eilastle&el 1 1 1 ? MY number o% nodes in eac# clusterAddrarams set nodesnum Qeilastle&el MY o% eac# domain
64
-
8/12/2019 Project Report (MG2)
65/85
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topologyQtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1- --T MY #ierarc#ical addresses %or $ired domain
%or set i T Qi [ Qnum$irednodesT incr iT set (Qi) !Qns node !linde2 Qtemp Qi""T
Y con%igure %or base4station nodeQns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \ 4ant'ype Qopt(ant) \
4prop'ype Qopt(prop) \ 4p#y'ype Qopt(neti%) \ 4c#annel'ype Qopt(c#an) \
4topo+nstance Qtopo \ 4$iredRouting ;: \
4agent'race ;: \ 4router'race ;FF \ 4mac'race ;FF
Ycreate base4station nodeset temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless
MY domainset
-
8/12/2019 Project Report (MG2)
66/85
Ycon%igure %or mobilenodesYQns node4con%ig 4$iredRouting ;FF
%or set 5 T Q5 [ Qopt(nn)T incr 5T set node(Q5) ! Qns node !linde2 Qtemp !e2pr Q5K1"" " Qnode(Q5) base4station !Addrarams addrid \
!Q
-
8/12/2019 Project Report (MG2)
67/85
YQapp set inter&al -?Qapp attac#4agent QagentQns at Qopt(app4start) Qapp start
Y +nitiali/e Flags
set #oldrate1 set #oldrate set #oldrate
Y Function 'o record Statistcis (
-
8/12/2019 Project Report (MG2)
68/85
Y E2it Simulation at 'ime C-1 sec
Qns at C-1 puts \:S EP+'+:=---\ M Qns #alt
proc stop T global ns trace%d namtrace % %1 %
close Q%close Q%1
close Q%
Ylot Recorded Statistics
e2ec 2grap# out-tr out1-tr out-tr 4geometry C2 X e2ec nam $ireless4out-nam X
Qns %lus#4trace close Qtrace%d
close QnamtraceT
puts Starting Simulation---Qns run
2. Code for si#uation of R/ in $CP 9W R9O nd to end /eay4
Y Y De%ine optionsY Nueue*RED set .$eig#t -Nueue*RED set t#res# Nueue*RED set ma2t#res#
set opt(c#an) #annel*ireless#annel MY c#annel typeset opt(prop) ropagation*'$oRay=round MY radio4propagation modelset opt(neti%) #y*ireless#y MY net$or0 inter%ace typeset opt(mac) ac*C11 MY A typeset opt(i%.) Nueue*RED MY inter%ace .ueue type
set opt(ll) MY lin0 layer typeset opt(ant) Antenna*;mniAntenna MY antenna model
68
-
8/12/2019 Project Report (MG2)
69/85
set opt(i%.len) ? MY ma2 pac0et in i%.set opt(nn) MY number o% mobilenodesset opt(ad#ocRouting) DSDV MY routing protocol
set opt(cp) MY connection pattern %ile
set opt(2) @ MY 2 coordinate o% topologyset opt(y) @ MY y coordinate o% topologyset opt(seed) - MY seed %or random number gen-set opt(stop) ? MY time to stop simulation
set opt(%tp14start) ?-set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes
set numbsnodes 1
Y ZZZ ac0et Delay 'race ZZZ
set % !open delay-tr $"set % !open delay1-tr $"set %? !open delay-tr $"
Y
Y create simulator instanceset ns !ne$ Simulator"
Y set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domain
Addrarams set clusternum Qclusternumlappend eilastle&el 1 1 ? MY number o% nodes in eac# clusterAddrarams set nodesnum Qeilastle&el MY o% eac# domain
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topology69
-
8/12/2019 Project Report (MG2)
70/85
Qtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1-T MY #ierarc#ical addresses %or $ired domain%or set i T Qi [ Qnum$irednodesT incr iT set (Qi) !Qns node !linde2 Qtemp Qi""T
Y con%igure %or base4station nodeQns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \
4ant'ype Qopt(ant) \ 4prop'ype Qopt(prop) \ 4p#y'ype Qopt(neti%) \ 4c#annel'ype Qopt(c#an) \
4topo+nstance Qtopo \ 4$iredRouting ;: \
4agent'race ;: \ 4router'race ;FF \ 4mac'race ;FF
Ycreate base4station node
set temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless MY domainset
-
8/12/2019 Project Report (MG2)
71/85
Qns duple24lin0 Q() Q
-
8/12/2019 Project Report (MG2)
72/85
set #oldtime set #oldse.
set #oldrate1 set #oldrate set #oldrate
Y Function 'o record Statistcis (
-
8/12/2019 Project Report (MG2)
73/85
T
Y Reset Variables
set #oldtime Qb$C set #oldse. Qb$9 set #oldtime1 Qb$1 set #oldse.1 Qb$11 set #oldtime Qb$1 set #oldse. Qb$1Qns at !e2pr Qno$KQtime" record MY Sc#edule Record a%ter Qtime inter&al sec
TY Start Recording at 'ime
Qns at - recordYStop Simulation at 'ime C sec
Qns at C- stopY E2it Simulation at 'ime C-1 sec
Qns at C-1 puts \:S EP+'+:=---\ M Qns #alt
proc stop T
global ns trace%d namtrace % % %?
close Q% close Q% close Q%?
Y lot Recorded Statistics
e2ec 2grap# delay-tr delay1-tr delay-tr 4geometry C2 X
e2ec nam $ireless4out-nam XQns %lus#4trace close Qtrace%d close Qnamtrace
T
puts Starting Simulation---
Qns run
73
-
8/12/2019 Project Report (MG2)
74/85
-
8/12/2019 Project Report (MG2)
75/85
set opt(i%.len) ? MY ma2 pac0et in i%.set opt(nn) MY number o% mobilenodesset opt(ad#ocRouting) DSDV MY routing protocol
set opt(cp) MY connection pattern %ile
set opt(2) @ MY 2 coordinate o% topologyset opt(y) @ MY y coordinate o% topologyset opt(seed) - MY seed %or random number gen-set opt(stop) ? MY time to stop simulation
set opt(%tp14start) ?-set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes
set numbsnodes 1
Y ZZZ ac0et Delay 'race ZZZ
set % !open delay-tr $"set % !open delay1-tr $"set %? !open delay-tr $"
Y
Y create simulator instanceset ns !ne$ Simulator"
Y set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domain
Addrarams set clusternum Qclusternumlappend eilastle&el 1 1 ? MY number o% nodes in eac# clusterAddrarams set nodesnum Qeilastle&el MY o% eac# domain
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topology75
-
8/12/2019 Project Report (MG2)
76/85
Qtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1-T MY #ierarc#ical addresses %or $ired domain%or set i T Qi [ Qnum$irednodesT incr iT set (Qi) !Qns node !linde2 Qtemp Qi""T
Y con%igure %or base4station nodeQns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \
4ant'ype Qopt(ant) \ 4prop'ype Qopt(prop) \ 4p#y'ype Qopt(neti%) \ 4c#annel'ype Qopt(c#an) \
4topo+nstance Qtopo \ 4$iredRouting ;: \
4agent'race ;: \ 4router'race ;FF \ 4mac'race ;FF
Ycreate base4station node
set temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless MY domainset
-
8/12/2019 Project Report (MG2)
77/85
Qns duple24lin0 Q() Q
-
8/12/2019 Project Report (MG2)
78/85
set #oldtime set #oldse.
set #oldrate1 set #oldrate set #oldrate
Y Function 'o record Statistcis (
-
8/12/2019 Project Report (MG2)
79/85
T
Y Reset Variables
set #oldtime Qb$C set #oldse. Qb$9 set #oldtime1 Qb$1 set #oldse.1 Qb$11 set #oldtime Qb$1 set #oldse. Qb$1Qns at !e2pr Qno$KQtime" record MY Sc#edule Record a%ter Qtime inter&al sec
TY Start Recording at 'ime
Qns at - recordYStop Simulation at 'ime C sec
Qns at C- stopY E2it Simulation at 'ime C-1 sec
Qns at C-1 puts \:S EP+'+:=---\ M Qns #alt
proc stop T
global ns trace%d namtrace % % %?
close Q% close Q% close Q%?
Y lot Recorded Statistics
e2ec 2grap# delay-tr delay1-tr delay-tr 4geometry C2 X
e2ec nam $ireless4out-nam XQns %lus#4trace close Qtrace%d close Qnamtrace
T
puts Starting Simulation---
Qns run
79
-
8/12/2019 Project Report (MG2)
80/85
-
8/12/2019 Project Report (MG2)
81/85
set opt(%tp14start) ?-set opt(app14start) 1-set opt(app4start) 1-
set num$irednodes set numbsnodes 1
Y ZZZ '#roug#put 'race ZZZ
set % !open out-tr $"set %1 !open out1-tr $"set % !open out-tr $"
Y
Y create simulator instanceset ns !ne$ Simulator"Qns color 1 redQns color blueQns color greenY set up %or #ierarc#ical routingQns node4con%ig 4address'ype #ierarc#icalAddrarams set domainnum MY number o% domainslappend clusternum 1 MY number o% clusters in eac# domain
Addrarams set clusternum Qclusternumlappend eilastle&el 1 1 1 ? MY number o% nodes in eac# clusterAddrarams set nodesnum Qeilastle&el MY o% eac# domain
set trace%d !open $ireless4out-tr $"set namtrace !open $ireless4out-nam $"Qns trace4all Qtrace%dQns namtrace4all4$ireless Qnamtrace Qopt(2) Qopt(y)
Y reate topograp#y ob5ectset topo !ne$ 'opograp#y"
Y de%ine topologyQtopo load%latgrid Qopt(2) Qopt(y)
Y create =odcreate4god !e2pr Qopt(nn) K Qnumbsnodes"
Ycreate $ired nodesset temp -- -1- --T MY #ierarc#ical addresses %or $ired domain%or set i T Qi [ Qnum$irednodesT incr iT set (Qi) !Qns node !linde2 Qtemp Qi""
T
81
-
8/12/2019 Project Report (MG2)
82/85
Y con%igure %or base4station nodeQns node4con%ig 4ad#ocRouting Qopt(ad#ocRouting) \ 4ll'ype Qopt(ll) \ 4mac'ype Qopt(mac) \ 4i%.'ype Qopt(i%.) \ 4i%.en Qopt(i%.len) \ 4ant'ype Qopt(ant) \ 4prop'ype Qopt(prop) \ 4p#y'ype Qopt(neti%) \ 4c#annel'ype Qopt(c#an) \
4topo+nstance Qtopo \ 4$iredRouting ;: \
4agent'race ;: \ 4router'race ;FF \ 4mac'race ;FF
Ycreate base4station node
set temp 1-- 1--1 1-- 1-- 1--T MY #ier address to be used %or $ireless MY domainset
-
8/12/2019 Project Report (MG2)
83/85
set sin01 !ne$ Agent*'Sin0"Qns attac#4agent Q() Qsin01Qns attac#4agent Qnode() Qtcp1Qns connect Qtcp1 Qsin01set %tp1 !ne$ Application*F'"Q%tp1 attac#4agent Qtcp1Qns at Qopt(%tp14start) Q%tp1 start
set agent1 !ne$ Agent*>D"set sin0 !ne$ Agent*ossonitor"Qns attac#4agent Qnode(1) Qagent1Qns attac#4agent Q(1) Qsin0Qns connect Qagent1 Qsin0set app1 !ne$ Application*'ra%%ic*
-
8/12/2019 Project Report (MG2)
84/85
-
8/12/2019 Project Report (MG2)
85/85