A Simple QoS Packet Scheduler for Network Routers Su Wen Presenting the paper in SIGCOM 2001 “SRR: An O(1) Time Complexity Packet Scheduler for Flows in Multi-Service Packet Networks” 10/20/2019
Quality of Service Current Internet Service QoS Best effort Packet scheduling: FIFO QoS Demanded by new network services multimedia, audio/video Meets requirement in bandwidth, delay, jitter Current Internet IP architecture is best-effort. it’s possible packet will be duplicated in the network or lost. The packet may arrive at the receiver out of order. Generally, to get better than best effort service, the end system must implement mechanisms to provide the service to applications. TCP is such an example. It’s a protocol running on end systems in the network to provide reliable data delivery to end-system applications. 10/20/2019
QoS Approaches Integrated Services Differentiated Services Provide service guarantees to individual flows in the network GPS - Generalized Processor Sharing Weighted Fair Queuing Differentiated Services Provide some service guarantees to different classes of traffic in the network Example: hierarchical link-sharing audio, video, telnet, ftp, mail 10/20/2019
Bandwidth Sharing GPS - generalized processor sharing server r flows ideal model: each flow gets its fair share of BW Si(t1, t2) / Sj(t1, t2) = wi/wj ri/r = wi/jwj . r GPS Scheduler server flows wi - weight of flow i Si (t1, t2) - amount of traffic served for flow I during time t1 to t2 ri - service rate of flow i r - service rate of the server GPS is idealized and cannot be implemented because is assumes that 1. Server transmits more than one flow simultaneously 2. Traffic is infinitely divisible The GPS server is work conserving and operates at fixed rate r Time-stamp based: calculate the time the packet should be served, order the packet in the queue. Really, calculate the finish time, packet with smallest finish time is served next. The time stamp is calculated for each pkt arrival and inserted in the queue according to the time stamp Round-robin: precalculate the order of service, serve the flow queue for the time proportional to the weight 10/20/2019
Bandwidth Sharing Implementations Weighted Fair Sharing An approximation/implementation of GPS Each flow has separate queues Two approaches: time-stamp based: e.g. virtual clock round robin GPS is idealized and cannot be implemented because is assumes that 1. Server transmits more than one flow simultaneously 2. Traffic is infinitely divisible The GPS server is work conserving and operates at fixed rate r Time-stamp based: calculate the time the packet should be served, order the packet in the queue. Really, calculate the finish time, packet with smallest finish time is served next. The time stamp is calculated for each pkt arrival and inserted in the queue according to the time stamp Round-robin: precalculate the order of service, serve the flow queue for the time proportional to the weight 10/20/2019
Implementation Characteristics Time Stamp based: Fairly good fairness and delay bound Time complexity: O(logN) - O(N) Round Robin based: DRR, CORR Time complexity: O(1) Short term unfairness bursty output WFFQ, Start-time FQ, FFQ, SPFQ, time-shift 10/20/2019
SRR - Smoothed Round Robin Good short term and long term fairness emulate GPS work conserving forwards packets as long as there are active flows O(1) time complexity one lookup to decide what to send Better scalability Simplicity 10/20/2019
Data Structures Weight Matrix (WM) WSS - Weight Spread Sequence number of rows = N - number of flows number of columns = k = log2wmax + 1 # of binary digits needed to represent the max normalized weight WM size depends on # of flows and BW granularity WSS - Weight Spread Sequence WSS of order k (Sk) is a sequence of integers from 1 to k recursively defined S1 = 1 Sk = Sk-1, k, Sk-1 10/20/2019
Weight Matrix Four flow f1 - f4, each with different BW requirement: r1 = 64kbps, r2 = 128kbps, r3 = 320kbps, r4 = 192kbps w1 = 1 -> {0 0 1} w2 = 2 -> {0 1 0} w3 = 5 -> {1 0 1} w4 = 3 -> {0 1 1} col1 col2 col3 row1 0 0 1 row2 0 1 0 row3 1 0 1 row4 0 1 1 10/20/2019
Weight Spread Sequence Rule: S1 = 1 Sk = Sk-1, k, Sk-1 To find WSS of order 3 - S3 S2, 3, S2 S1, 2, S1, 3, S1, 2, S1 1, 2, 1, 3, 1, 2, 1 N - number of flows wi - normalized weight of flow i k - log2wmax + 1 10/20/2019
Scheduling Algorithm Generate a Service Queue: for each value i in the WSS if jth row of column i of WM has value 1 add flow j to the queue Serve the flow indicated in the service queue in a round robin fashion Serve_flow(): deficitj += Lmax while (Lj <= deficitj) { send pktj deficitj -= Lj } deficiti - bytes need to be served of flow i Li - length of packet of flow i Lmax - length of maximum packet size f1: {0 0 1} f2: {0 1 0} f3: {1 0 1} f4: {0 1 1} S3: 1, 2, 1, 3, 1, 2, 1 Flow Service Queue: f3, f2, f4, f3 f1, f3, f4, f3, f2, f4, f3 10/20/2019
Fairness Long Term Short Term Si(0, t) / Sj(0, t) = wi/wj Si(0, t)/wi - Sj(0, t)/wj = 0 Short Term Si(0, t)/wi - Sj(0, t)/wj < (k+2)Lmax/2*min(wi,wj) Si(t1, t2) - amount of traffic served for flow i during time t1 to t2 wi - normalized weight of flow i k - log2wmax + 1, the order of WSS 10/20/2019
Delay Df - maximum delay for flow f Df < 2*Lmax/wf + 2*(N-1)*Lmax/ i wi Inverse proportional to the weight of the flow Proportional to total number of flows Not strictly rate proportional, but better than DRR simulation result shows so 10/20/2019
Scalability Space requirement Time complexity N x k At 1kbps granularity, k=16 can accommodate rates up to 64Mbps At 1Mbps granularity, k=16 can accommodate rates up to 64Gbps Time complexity O(1) to choose packets for transmission O(k) to add or delete a flow 10/20/2019
SRR Problems add_flow() and delete_flow() operations SRR scheduler is called during busy period packets are back-logged add_flow() is called when new flow arrives delete_flow() is called when queue of the flow is empty If a flow is not back logged, add_flow() and may be called for every packet quite expensive: O(k) Solution: delay the deletion of a flow not strictly O(1) any more 10/20/2019
Conclusion SRR is simple Scalable Good performance even I can understand! Scalable time and space Good performance fairness delay 10/20/2019
Questions? How did he come up with the algorithm? 10/20/2019