Date post: | 21-Apr-2023 |
Category: |
Documents |
Upload: | khangminh22 |
View: | 0 times |
Download: | 0 times |
CEN445 – Network Protocols and Algorithms
Chapter 5 – Network Layer
5.4 Quality of Service
Dr.MostafaHassanDahshanDepartmentofComputerEngineering
CollegeofComputerandInformationSciencesKingSaudUniversitymdahshan@ksu.edu.sa
http://faculty.ksu.edu.sa/mdahshan
Quality of Service (QoS)
Withgrowthofmultimedianetworking Ad‐hoccongestioncontrolnotenough NeedprotocolstoguaranteeQoS Matchservicelevelwithapplicationsneeds
2
Requirements
Flow:streamofpacketsfromsourcetodest virtualcircuit:flowpacketsusesamepath datagram:mayfollowdifferentpaths
Primaryparametersforflowneeds reliability delay jitter bandwidth
3
Requirements
4
Requirements
Reliability nobitsmaybedeliveredincorrectly achievedusingchecksum,verifiedatdest damagedpacketsarenotACKed;retransmitted importantforemail,filetransfer,web lessimportantforaudio,video
Delay manyapplicationhavelow,mediumrequired real‐timeaudio,video,strictdelayrequired
5
Requirements
Jitter variationindelay problemwithinteractiveapplications
6
Requirements
Bandwidth videoisthemostdemandingapplication Maincategories(asinATM)
constantbitrate:telephony real‐timevariablebitrate:videoconferencing nonreal‐timeVBR:watchingmovieonInternet availablebitrate:filetransfer
7
Techniques for Achieving Good Quality of Service
Overprovisioning Buffering TrafficShaping TheLeakyBucketAlgorithm TheTokenBucketAlgorithm ResourceReservation AdmissionControl ProportionalRouting PacketScheduling
8
Overprovisioning
Providemoreresourcesthanpeakload routercapacity,bufferspace,bandwidth
Expensive Practicalifdesignersknowhowmuchisenough
Usedintelephonesystem
9
Buffering
Bufferflowsatreceiverbeforedelivery Noeffectonbandwidth,reliability Delayisincreasedbutjitterissmoothed Buffereddatacanplayedatuniformintervals
Videosteamingsitesusuallybuffer10sec
10
Buffering
11
Traffic Shaping
Inpreviousexampledatatransmittedwithuniformspacing
Someapplications’dataisnonuniform serverhandlingmultiplestreams allowfastforward,rewindvideostream
Trafficshaping:regulateaveragerate(burstiness)ofdatatransmission
AccordingtoServiceLevelAgreement(SLA)
12
Traffic Shaping
13source: Cisco
Traffic Shaping
TrafficPolicing
Whenratereachesmaxexcesstrafficisdropped
Burstsarepropagated Doesn’tqueuepackets Appliestoinboundtraffic
TrafficShaping
Retainpacketsinqueues,scheduleexcessforlaterretransmission
Smoothedoutputrate Requiresmemorytoqueuepackets
Appliestooutboundtraffic RequiresschedulingfunctionFQ,WFQ,CBWFQ,…
14
The Leaky Bucket Algorithm
15
No matter the rate at which water enters the bucket, the outflow is at a constant rate
The Leaky Bucket Algorithm
Networkinterfacehasfiniteinternalqueue Simplyitisasingleserverqueueingsystemwithconstantservicetime
Smoothbursts,reducecongestionchance Twoapproaches
packet‐counting:forfixed‐sizepackets(ATM) byte‐counting:forvariable‐sizepackets
16
The Leaky Bucket Algorithm
Leakybucketconsistsoffinitequeue Whenpacketarrives
ifthereisaroominqueue,appendpacket else,discardpacket
Ateveryclocktic,onepacketistransmitted
17
The Leaky Bucket Algorithm
Onevariant:byte‐countingleakybucket Forbyte‐countingleakybucket
ateachtic,counterinitializedton whilesizeofnextpacket<counter
transmitpacket counter=counter– sizeofpacket
18
Example
Computersenddata@25MB/s =200Mbps Networkspeedis200Mbps Butrouterscanacceptthisrateonlyforshortintervals,untilbufferfillup
Forlongintervals,theyworkbestat2MB/s Supposedatacomein1MB,40ms burst/s Toreducerateto2MB/s,useleakybucketwithrate =2MB/s&capacityC =1MB
Outputwillbe2MB/sfor500ms =1MB19
Example
20
The Token Bucket Algorithm
Leakybuckethasfixedoutputrate Forsomeapplications,bettertoallowoutputspeedupwhenlargeburstarrives
Tokenbucket leakybucketholdstokens generatedbyaclock1tokenevery sec totransmit1packet,capture&destroy1token canbeusedtoregulatetrafficathosts orsmoothtrafficbetweenrouters
21
The Token Bucket Algorithm
22
Essentiallywhatthetokenbucketdoesis:allowbursts,butuptoaregulatedmaximum
length
The Token Bucket Algorithm
23
Allowsidlehoststosavepermissiontosendlargeburstslater,uptomaxsizeofbucketn leakybucketdoesn’tallowthis
Burstsupton packetscanbesentatonce Throwsawaytokenswhenbucketfillsup Butneverdiscardspackets
leakybucketdiscardswhenbucketfillsup
The Token Bucket Algorithm
Aminorvariant,tokenrepresentsk bytesinsteadof1packet
Packetcanbetransmittedifenoughtokensavailabletocoveritssize
Forpacketcountingtokenbucket every ,counter+=1 whenpacketsent,counter‐=1
Forbytecountingtokenbucket every ,counter+=k whenpacketsent,counter‐=packetsize
24
The Token Bucket Algorithm
25
Output of TB with C of (c) 250 KB
(d) 500 KB
(e) 750 KB
(f) 500 KB feeding a10 MB/s leaky bucket
The Token Bucket Algorithm
Calculatinglengthofmaximumrateburst not1MB/25MB/s.Why? duringburstoutput,moretokensarrive
Definitions S:burstlength(seconds) B:tokencapacity(bytes) :tokenarrivalrate(bytes/s) M:maximumoutputrate(bytes/s)
26
The Token Bucket Algorithm
Wecanseethat outputburstcontainsmaxof bytes numberofbytesinmax‐speedburstoflengthSisMS bytes
Hencewehave:
TogetS:
27
Example
250,000 Bytes 25 10 Bps 2 10 Bps Burstdata=10 Bytes
0.010869 11ms (we’llround tonearestms)
Bytestransmittedinburst= 25 10 0.011 275000 Remainingbyteinburst=10 275000 725000 Timetotransmitremainingbytesusingtokenarrivalrate:
0.3625 363 ms
Totaltimetotransmit1MB=11+363=374ms28
Example
500,000 Bytes 25 10 Bps 2 10 Bps Burstdata=10 B
0.021739 22ms (we’llround tonearestms)
Bytestransmittedinburst= 25 10 0.022 550000 Remainingbyteinburst=10 550000 450000 Timetotransmitremainingbytesusingtokenarrivalrate:
0.225 225 ms
Totaltimetotransmit1MB=22+225=247ms29
The Token Bucket Algorithm
Problem:tokenbucketallowslargebursts Frequentlydesirabletoreducepeakrate Oneway:insertleakybucketafterTB LBrate >TBrate and<maxrateMi.e.
Thisproducessmoothertraffic
30
Example
500,000 Bytes 10 10 Bps 2 10 Bps Burstdata=10 B
0.0625 62.5ms
Bytestransmittedinburst= 10 10 0.0625 625000 Remainingbyteinburst=10 625000 375000 Timetotransmitremainingbytesusingtokenarrivalrate:
0.1875 187.5 ms
Totaltimetotransmit1MB=62.5+187.5=250ms31
Resource Reservation
Needvirtualcircuitofsomethingsimilar Otherwise,hardtoguaranteeanything Oncerouteisfixed,canreserveresources
bandwidth:notoversubscribeoutputlines bufferspace:allocatequeuesp forspecificflow CPUcycles:requiredtoprocesspackets
importanttoensureCPUisnotoverloaded evenwithloadslightlybelowtheoreticalcapacity,queuecanbuildanddelayoccurs
32
Resource Reservation
Assumepacketsarriveatrandom meanarrivalrate= packets/second
AssumeCPUtimerequiredisalsorandom meanprocessingrate= packets/second
Botharrival&service:Poissondistribution Fromqueueingtheory,meanpacketdelayT
⁄
seconds
where isCPUutilization33
Servicetimewithnocompetition
slowdownduetocompetingflows
Example
packets/s packets/s
i.e.meanpacketservicetime=
Then,
Meanpacketdelay
, , .
insteadof ,becauseofqueueingdelay ifthereare30routers,> ofqueueingdelay
34
Admission Control
Nowwe’reatthepointwheretrafficis wellshaped canpotentiallyfollowsingleroute,inwhich capacitycanbereservedonallroutersonpath
Whensuchflowisoffered,admitorreject? currentcapacity? howmanycommitmentsmadeforotherflows?
Comparecurrent(bandwidth,buffer,cycles)withexcesscapacityinthose3dimensions?
35
Admission Control
Decisionisnotthatsimplebecause fewappsknowtheirCPUrequirement,unlikebw
differentwayneededtodescribeflow
someappsmoretolerantinoccasionalmisseddeadlinethanothers
someappsmayhaggleaboutparameters,othersmaynot movieviewercandropfrom30fpsto25fps similarly,pixels/frame,audiobpsmaybeadjustable
36
Admission Control
Manypartiesinvolvedinflownegotiation sender,receiver,allroutersalongpath
Flowsmustbedescribedaccurately specificparametersthatcanbenegotiated calledflowspecification
Senderproducesflowspecification Routerscheckandmodifyasneeded Atotherend,parameterscanbeestablished
37
Admission Control
Parameter Unit Notes
Token bucketrate Bytes/second Max sustainedratesendermaytransmitaveragedoverlonginterval
Token bucketsize Bytes If TBrate=1Mbps,TBsizeis500KB,buckettake4stofill,afterthattokensarelost
Peakdatarate Bytes/second Mustnotexceed,evenforshortintervals
Minimumpacketsize Bytes Importantbecauseprocessingeachpackettakessomefixedtime,nomatterhowshort
Maximum packetsize Bytes Importantduetointernalnetworklimitationsthatmaynotbeexceeded 38
Example
Howarouterturnsaflowspecificationintoasetofspecificresourcereservations? implementationspecific,notstandardized
Supposeroutercanprocess100,000packets/s Offeredflow1MB/s( bytes/s) Min=maxpacketsize=512bytes
Thus,packetrate= =2048packets/s
Routermustreserve2%CPUforthatflow Ifpolicyisnotallocatemorethan50%CPU Routerwith49%willrejectthe2%flow 39
Example
Tighterflowspecificationismoreuseful IfspecstatesitneedsTBrate5MB/sbutpacketsvarybetween50and1500bytes
packetrateformax= packets/s
packetrateformin= packets/s
Routerwillrejectbecauseoflatternumber Ifminpacketsizewas1000,mightaccept
40
Proportional Routing
Mostroutingalgorithmstryfindbestpath Sendalltrafficoverbestpath ToprovidehigherQoS,splittrafficforeachdestinationovermultiplepaths
Routersdon’thavecompleteoverviewofnetworktraffic
Dividetrafficequallyorinproportiontocapacityofoutgoinglinks
41
Packet Scheduling
1flowmayhogcapacity,starveotherflows Processingpacketsinorderofarrivalmeansaggressivesendercancapturemostcapacity
Topreventthis,usepacketscheduling fairqueueing weightedfairqueueing …
42
Packet Scheduling
Fairqueueing(packet‐by‐packetRR) separatequeuesforeachoutputline onequeueforeachflow whenlineisidle,scanqueuesinroundrobin takefirstpacketonnextqueue helpsinpreventingaggressiveflows problem:flowswithlargepacketstakemoreBW
43
Packet Scheduling
Fairqueueing(byte‐by‐byteRR) solvestheproblemwithpacket‐by‐packetRR simulatebyte‐by‐byteround‐robin scanthequeuesrepeatedly,byte‐for‐byte findtickonwhicheachpacketwillbefinished packetsarethensorted sentinorderoftheirfinishing
44
Packet Scheduling
Fairqueueing(byte‐by‐byteRR) calculatingfinishtime forpacketi
:arrivaltime :packetsize
iscalculatedindependentlyforeachqueue
45
Example – Fair Queue
Packet Arrival Queue Length Finish (Calc) Finish Out order
A 0 1 8 Max(0, 0)+8 8 1
B 5 2 6 Max(5, 0)+6 11 2
C 5 3 10 Max(5, 0)+10 15 3
D 8 2 9 Max(8, 11)+9 20 5
E 8 3 8 Max(8, 15)+8 23 6
F 10 1 6 Max(10, 8)+6 16 4
G 11 3 10 Max(11, 23)+10 33 8
H 20 2 8 Max(20, 20)+8 28 7
46
A B C F D E H G
Packet Scheduling
Fairqueueinggivesallflowssamepriority Manytimes,weneedtogivesomeflowsmorebandwidth(e.g.video)
WeightedFairQueueing(WFQ) onequeueforeachflow eachflowhasdifferentweight
where istheweightofthequeueofflowi
47
Example – Weighted Fair Queue
Packet Arrival Queue Length Finish (Calc) Finish Out order
A 0 1 8 Max(0, 0)+8 8 1
B 5 2 6 Max(5, 0)+6 11 3
C 5 3 10 Max(5, 0)+10/2 10 2
D 8 2 9 Max(8, 11)+9 20 7
E 8 3 8 Max(8, 10)+8/2 14 4
F 10 1 6 Max(10, 8)+6 16 5
G 11 3 10 Max(11, 14)+10/2 19 6
H 20 2 8 Max(20, 20)+8 28 8
48
A C B E F G D H
Integrated Services
Flow‐basedalgorithms,integratedservices ResultofalotofIETFeffortstodeviseanarchitectureforstreamingmultimedia
Aimedatbothunicastandmulticasttraffic unicast:singleuserstreamingvideofromsite multicast:collectionofdigitaltelevisionstationsbroadcastingprogramsasstreamsofIPpacketstomanyreceiversatvariouslocations
notsuitablefordynamicgroupmembershipbecausebandwidthisreservedinadvance 49
RSVP – Resource reSerVation Protocol
MainpartofIntServ architecture DescribedinRFCs2205‐2210 Usedformakingreservations Allowsmultiplesenderstotransfertomultiplegroupsofreceivers
Individualreceiverscanswitchchannels Optimizesbandwidthusewhileeliminatingcongestion
50
RSVP – Resource reSerVation Protocol
Multicastroutingusingspanningtrees Eachgroupisassignedgroupaddress Senderputsgroupaddressinitspackets MCroutingalgorithmbuildsSTforgroup RoutingalgorithmnotpartofRSVP
51
RSVP – Resource reSerVation Protocol
52
RSVP – Resource reSerVation Protocol
Toreducecong,anyreceiveringroupcansendareserv messageupthetreetosender
Messageispropagatedusingreversepathforwarding(discussedearlier)
Eachhop,routerreservesnecessaryBW Ifinsufficientbandwidth,reportfailure Whenmessagegetsbacktosource,BWisreservedallthewayfromsendertoreceiver
53
RSVP – Example
54
R3 reserves flow from S1
R3 reserves flow from S2
R5 reserves flow from S1; merged with R3 at H
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Capacityreservedmustbelargeenoughtosatisfythe
greediestreceiver
RSVP – Resource reSerVation Protocol
Receivercanspecifymultiplesources Canspecifyifchoicesarefixedordynamic RouteruseinfofortooptimizeBWplanning
tworeceiversareonlysetuptoshareapathiftheybothagreenottochangesourceslateron
BWreserv isdecoupledfromsourcechoice OnceBWreserved,canswitchsource,keepportionofreservedpathfornewsource
55
Differentiated Services
Flow‐basedprotocols(IntServ)offergoodQoS becauseneededresourcesarereserved
Thehavedownside: requireadvancesetup don’tscalewellforlargenetworkswM’sflows maintainper‐flowstate,vulnerableroutercrash requiresubstantialchangetoroutercode
Thus,notwidelyimplemented
56
Differentiated Services
SimplerapproachtoQoS devisedbyIETF Canbelargelyandeasilyimplemented Class‐based insteadofflow‐based QoS DiffServ orDS,RFCs2474,2475andothers Advantages
noadvancesetup noresourcereservation notime‐consumingend‐to‐endnegotiationperflowasIntServ
57
Differentiated Services
Canbeofferedbysetofroutersforminganadministrativedomain(ISPorTelco)
Admindefinesetofserviceclasses CustomersignsupforDS PacketscarryTypeofService(DSCP)field Betterserviceforsome(premium)classes Trafficinclassmayberequiredtoconformtospecificshape(e.g.LB)
Extrachargeif>Npremiumpackets/month58
Diffserv Architecture
From: Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith Ross,
Addison-Wesley, April 2009. 59
Edge router: per-flow traffic management marks packets as in-profile
and out-profile
Core router: per class traffic management buffering and scheduling based
on marking at edge preference given to in-profile
packets
scheduling
...
r
b
marking
Differentiated Services
Per‐Hop‐Behavior:PHB DefaultPHP:besteffort ExpeditedForwardingPHB
highestpriority reservedBW≥required
AssuredForwardingPHB fourpriorityclasses threediscardprobabilitiesforeachclass
60
Expedited Forwarding
61
Assured Forwarding
62
Sending host or Edge router
1. classify packets
2. Mark packets according to class
3. Pass packets to shaper/filter