Quality of Service for Packet Networks

Real-Time and Embedded Systems (M) Lecture 17 Copyright © 2005 University of Glasgow • • • Lecture Outline •

Resource reservation protocols Queuing disciplines Best effort enhanced versus services Material corresponds to parts ofchapters 7and 11ofLiu’s book – – –

RSVP RSVP Weighted roundrobin Weighted fair queuing and variants

Copyright © 2005 University of Glasgow output link iscritical forreal time traffic Choice of queued fortransmission if output link busy Switches are Links have constant Model Networks of Packet Switched job algorithm Host Host output buffered Host Host propagation delay with packets onthe Packet switched network with n ≥ 0switches Shared buffer input 1 4 3 2 Host Host Host Host 1 4 3 2 queues Output Copyright © 2005 University of Glasgow • • Service Enhanced Best Effort versus •

and don Uncontrolled best effort networksare inexpensive, but don Best effort networksusea single output queue foreach link better suited to real-time traffic Enhanced service packet networks provide this control, and are provide rate guarantees orcontrol the jitter – – –

in FIFO order in FIFO affect some policy, rather than scheduled fortransmission to Packets in the output queues are with RED FIFO with droptailFIFO ’ t control the output queuing Shared buffer input 1 4 3 2 1 4 3 2 ’ queues Output t Copyright © 2005 University of Glasgow • • Service? toHow Enhanced Implement

Implies the network must implement: To schedule packets according to some policy, the policy must be admission control to ensure that policy constraints can be met communicated to the network, and the network must perform – – –

A signallingA protocol Admission control packetA scheduling algorithm • • • •

To communicate the stream characteristics to the network To determine if the signalled can flows be supported To manage the output queues To prioritise certain classes oftraffic – –

Required performance specificationFlow Copyright © 2005 University of Glasgow • • Services for Enhanced Disciplines Service •

Used toUsed control jitter and packet rate The combination ofscheduling algorithm and acceptance test isa Algorithms can be service discipline – – – –

exceed their rate if there isspare capacity exceedflows their rate Rate allocating algorithms give each flowan allocated rate, but let flows Rate controlled algorithms give each flowan allocated rate, and never let Ensure Ensure receive flows their • • • •

inter-packet spacing – when forwarding traffic Some algorithms perform explicit jitter control, preserving the traffic pattern – Partly asa side-effect ofrate control servicedFlows regularly, to avoid starvation Rates controlled to allocate capacity toproportionally, flows according to policy timing isolation

rate allocating between flows proportional fair share or rate controlled of capacity

Copyright © 2005 University of Glasgow • Algorithms Priority Queuing

Two priority queuing algorithms are widely implemented: – –

Weighted roundrobin (WRR) Weighted fair queuing (WFQ) •

Frame based WFQ [See also lecture 8]

Copyright © 2005 University of Glasgow • • Queuing Fair Weighted • •

Definitions: “ Define the cause requested bandwidth to exceed the available bandwidth thatAssumed an acceptance test rejects connections that would – – – – Packet-by-packet generalized processor-sharing algorithm

established flows proportional fair share oflink capacity; isolates timing between flows Total bandwidth allocated to all Each flow, packetA switch hasseveral inputs, feeding to an output link shared by rateA allocating service discipline; provides each flowwith at least its “ finish number i , isallocated a fraction ” , fn n i , to represent job completion times connections is ũ i ofthe link €

U = ∑ i = n 1 u ˜ i

where

U ” ≤

1 n

Copyright © 2005 University of Glasgow • • • Packet Scheduling Queuing: Fair Weighted

Entry at queue head indicates ofSFN queue the to FIFO service Output buffersconceptually comprise twosetsofqueues: Each link ofthe packet switch isoutput buffered – –

destined foran Set of A priorityA ordered shortest finishqueue number (SFN) queues foreach setA ofFIFO ofthe output link n flows flows and they have packets waiting All queues apart from are ready backlogged

for transmission i=n i= i= i= 3 2 1 because … i =2 n flows flows from head ofqueue Packet being transmitted Each backlogged queue has an entry finish number i fn =3 4

fn fn 1 i queue in the

fn 3

Copyright © 2005 University of Glasgow • • Packet Scheduling Queuing: Fair Weighted •

When a packet completes transmission, it isremoved from the a packetAs becomes ready queue, onaits FIFO finish becomes ready ona backlogged queue Key isthe calculation ofthe finish number foreach packet asit queueshead and ofthe SFN FIFO number is calculated, andqueue the isupdated SFN – – –

queue begins transmission finish number ofthe newly ready packet of the newly ready packet wouldplace it at the head queue ofthe SFN The packet from the queue referenced bythe entry at the head ofthe SFN queueIf the isstill FIFO backlogged, queue the isupdated SFN with the Currently transmitting packet never pre-empted, even if the finish number Copyright © 2005 University of Glasgow • Numbers Finish Queuing: Fair Weighted •

Define: Computing the finish number whenthe link becomes active: – – – – – –

job, adjusted bythe fraction ofthe link used Intuition: finish number ofthe first packet set to transmission delay forthe packetA oflength The link isidle: The current time, The finish number of the link, The total bandwidth of all backlogged flows, • • •

Insert entry ( Set Compute t -1 = t

U b = fn FN i U , t , and the previous time, i b e ) inqueue the SFN =0, + arrives and starts a link interval busy onlink ũ i U and b =0, fn i t = FN -1 =0 and all fn

i + e / ũ i

t fn - 1 i , when =0 U b

FN and U b updated i

Copyright © 2005 University of Glasgow • Numbers Finish Queuing: Fair Weighted

Computing subsequent finish numbers during link interval busy – – –

be transmitted Intuition: finish number When the transmission ofa packet onflow If a packet arrives ona previously idle flow, • • • • • •

If the connection becomes idle If the connection remains backlogged Set Insert entry ( Compute Increment – – – –

t -1 Set Increment Insert entry ( Compute = t t -1 and increment fn = FN i =max( t fn and decrement fn by( FN i , i = fn i ) inqueue the SFN by( i fn t , - i i FN t ) inqueue the SFN +e/ -1 t - )/ t fn , -1 U ũ fn )/ U i i b represents deadline when a packet onflow where U

i b ) + U = b

b = U e / b U ũ e + isthe length of the newly ready packet i b

– ũ i ũ

i

i completes i

i will Copyright © 2005 University of Glasgow • • Properties Queuing: Fair Weighted

Can control latency and jitter, can isolate traffic flows Complex algorithm to calculate finish number, and determine the transmission order ofpacket –what isthe benefit? – –

Guaranteed network capacity onper-hopBounds and end-to-end latency fortraffic Copyright © 2005 University of Glasgow • Per-Hop Latency Queuing: Fair Weighted • •

Delay between time a packet becomes ready (whenit reaches the independent of other traffic onthe output link Because ofthe rate control behaviour this ofWFQ, boundis where: It hasbeen proved that completes is head queue ofthe ofit FIFO – – –

Second term: blocking due to nonpre-emptive schedule First term: time taken to transmit largest packet Blocking time due to the algorithm WFQ itself, ignoring queuing delay

ũ e i i isthe fraction ofthe link assigned to this flow isthe normalised maximum packet length, latency , L i L i < e ’ i / s connection)s and whentransmission ũ i +1 Copyright © 2005 University of Glasgow • • Total Queuing: Fair Per-Hop Delay Weighted • •

To predict queuing delay, youneed toarrival know pattern Total per-hop delay, Can be proven that is allocated a sufficient fraction arrivalsAssume fit a ( sum oflatency, calculated previously, and queuing delay – – –

the flow, unbounded even if allocated bandwidth, Latency term + Matches periodic, and many sporadic, isochronousflows From queuing theory, it can that be shown the queuing delay can be u i , if there isnoconstraint onthe arrival pattern Leak rate E i to represent queuing delay W W i (1) =( u i i (1), fora packet oflength , E i ) leaky bucket constraint and the flow E i Capacity + ũ e i

)/ ≥

ũ u ũ i i +1 i ofthe link , equals the actual bandwidth of e isequal to the

Copyright © 2005 University of Glasgow • • Delay End-to-End of WFQ

Assume aAssume homogeneous network: per-hopIf weknow delay, can wemodel end-to-end delay? – – – –

fraction All links have the same capacity, and the connection isallocated the same Intermediate switches perform but WFQ, notraffic shaping Traffic isinitially shaped to match a ( connectionA ũ i = u i i ofbandwidth with rate u i traverses ρ u switches i , E i ) leaky bucket Copyright © 2005 University of Glasgow End-to-End Delay of WFQ Delay End-to-End of WFQ • • •

Same asper-hop delay, but adjusted forthe number of hops Can derive when to non pre-emption at each hop is slowestdeparture rate at switch Making case worst assumptions, maximum arrival rate at switch

Rate W i ( ρ ρ )

= E i u ~ + i ρ e + ρ … n -1; 1 unit ofdelay added due ũ i Fastest departure rate (other idle) flows = u i

at switch Slowest departure rate (other active) flows Slowest departure rate Time Time n ρ

n

Copyright © 2005 University of Glasgow • • Delay End-to-End of WFQ • •

For switchFor Generalise: output links may have different transmission rates Can that, also show maximum jitter is thatCan show – – – –

packets at each hop sharing the output link with connection As before,As but adjusted fornonpre-emption delays of variable rate/size Let flow Assume flow Assume e max ( i , j traversed byflow j ) denote time taken to transmit largest packet ofall flows i i W isallocated satisfies a leaky bucket ( i ( ρ ) = E i λ + u i i ρ = e λ + i i

∑ j ρ = 1 e max λ i

( i , i , E E λ j i ) at the first hop ) i i + ∑ j ρ = i e max ( i , j ) Copyright © 2005 University of Glasgow • • Queuing Fair Weighted •

Per-hop delay and end-to-end delay fora flowcan be bounded, if dynamicA priority scheduling algorithms to ensure: but can guarantee throughput, latency and jitter Compared to an uncontrolled packet network iscomplex, WFQ the traffic pattern ofthe flowisknown – – – –

timing ofmessage delivery Simplifies applications running onanetwork, WFQ since they can predict Independent ofthe other in flows the network Packets are scheduled fairly, and starvation isavoided Each flow i gets at least a fraction u i ofthe link bandwidth Copyright © 2005 University of Glasgow • • • WFQ Frame-based Priority Scheduling: • • •

Would prefer calculations O(1) per packet Significant impediment to high performance implementation Weighted fair queuing can require O( Book explains the algorithm… Trade-off some fairness for reduced complexity Frame-based approximates WFQ WFQ packet, where – – –

departure, use an approximation updated at most once per packet departure The frame size isthe interval between recalculations Instead ofrecalculating the link finish number oneach packet arrival and One calculation foreach packet arrival and departure in the case worst n isthe number offlows n ) scheduling events per Copyright © 2005 University of Glasgow • Scheduling •

In weight A – – – – –

weighted robin round round robin round is, every back ofthe queue Length ofthe roundequals jobA with weight There are If it doesn The job at the head ofthe queue executes forone time slice wt i

round destined foran n ’ Set of jobsin the queue, each job gets one slice every t complete within the time slice, it ispre-empted and put at the output link scheduling, jobsare placed queue in a FIFO ) n flows flows wt i executes for schedule extends this, to give each job ∑ i = n 1 i=n wt i= i= i= 3 2 1 i wt i … time slices each round i from queue wt sent in turn i

packets n time slots(that

i a Copyright © 2005 University of Glasgow • Guarantees Throughput Scheduling: WRR • •

Assume constantAssume bit rate, periodic, flows: A designA parameter is then Each round,if more than – – – – – – – –

Provided that: Each flowisguaranteed a share At all times Rate allocating: may sendmore, if nothing else to transmit Each flowisguaranteed Maximum acceptable end-to-end delay Size ofeach message Minimum inter-arrival time ofmessages • • wt

wt RL i packets are transmitted i ≥ < e p i min /( p

i ∑ / i RL = n 1 wt ) i

(with appropriate rounding) ≤ e RL i RL

wt the maximum number ofslotsper round wt i slotseach round i packets are backlogged onqueue wt i / RL ofthe link capacity D p i

i

M i =( p i , e i , D i ) i , Copyright © 2005 University of Glasgow • • • Delay End-to-End Bounds Scheduling: WRR • •

for messages ofsize At each subsequent switch, each roundofpackets arriving issent Implies delay through first switch =( takeMessages at most Can also that be shown jitter can be bounded by switches can be bounded by: Therefore, end-to-end delay forconnection in the next round –

Implies one rounddelay at each hop

jitter < W e i ≤ ( i with inter-arrival time of e i / e wt i p / wt i – i rounds to rounds complete i + e i +( r –1) r –1)( RL e

i / RL wt –1) i ) RL i passingthrough

p i

r

Copyright © 2005 University of Glasgow WRR Scheduling: Connection Establishment Scheduling: WRR • • •

Too costly to change the roundlength each time a new flowis Why usea fixed roundlength With a fixed established – – – – –

new flow If all accept, hops the flowisestablished If the sumofexisting weights < At each hop,the scheduler computes the weight, parametersPass ( Would require adjusting weights forall pre-existing flows RL , connection establishment becomes: p i , e i , D i ) to each hoprouter RL RL - ? wt i the flowisaccepted at that hop wt i , required to supportthe Copyright © 2005 University of Glasgow • • Weighted Round Robin Scheduling • •

WRR scheduling isefficient to implement, since the scheduling areFlows guaranteed capacity can be bounded Since the scheduler israte allocating, jitter isnot controlled but End-to-end delay can be bounded decision isO(1) –

Simply pick wt i packets from the next queue Copyright © 2005 University of Glasgow • • Reservation ProtocolsResource • •

In a real packet network,must hosts inform the routers ofthe flow Throughout the discussionofqueuing algorithms, we have Several to issues consider: Implies a characteristics and required rate switch assumed that the required rate allocation, – – – – –

Relation to routing and admission control Dynamic membership Heterogeneity ofdestinations Multicast communication Scalability and router state resource reservation protocol isneeded ũ i , is known at, isknown each Copyright © 2005 University of Glasgow • • RSVP Case Study: • •

Basic operation: standardA resource reservation protocol in the isRSVP widely usedin the public Internet Widely supported and available if you control the network, but not Characteristics: – – – –

Receiver driven reservations supportmulticast Soft state, forgraceful failure Receivers send Sources sendperiodic • • • •

reservation forthe flowdescribed bythe path messages Reservations refreshed periodically byreceivers May senda reject message to the receiver, if acceptance test fails Cause intermediate routers to perform acceptance test and setup a resource Create path state in intermediate routers reservation path messages, describing the flow messages back towardsthe source Copyright © 2005 University of Glasgow • • Summary • • • •

What isneeded to supportenhanced services Why enhanced service isneeded Resume with a tutorial on15th March, onreal-time networking lecturesNo next week -time toon programming work assignment Brief pointer to RSVP Two approaches to implementing priority queuing – – – – –

WRR WFQ Signalling protocol Acceptance test Queue discipline