<Insert Picture Here> Weighted Differential Scheduler Hans Eberle, Wladek Olesinski Oracle Labs Outline • Motivation • Digital Differential Analyzer • Weighted Differential Scheduler (WDS) • Simulation Results • Summary © 2012 Oracle Corporation 2 Motivation • Problem statement • Schedule use of a shared resource among several requesters • Weights determine requesters’ share of the resource • Access to the shared resource in fixed-size time intervals • Goal • Requester’s intervals are spaced apart at equal distances • Reduce forwarding latency and minimize buffer memory capacity • Applications • Packet forwarding in network switches • Process scheduling etc. © 2012 Oracle Corporation 3 Jitter … 0 w0 = 2 0 0 0 … 1 w1 = 3 1 1 1 1 … 0 w0 = 2 0 0 0 0 … 1 w1 = 3 1 1 1 © 2012 Oracle Corporation 0 1 WRR Scheduler WDS Scheduler … 1 1 1 0 0 … 1 0 1 1 0 4 Related Work Smoothed Round Robin (SRR) Low-Jitter Scheduler (LJS) JSRR/JLJS © 2012 Oracle Corporation 5 Digital Differential Analyzer • Used in computer graphics for rasterizing lines, e.g. for interpolating the raster coordinates of the line given a start and end point • Example: Bresenham line drawing algorithm • Avoids drift, i.e. accumulation of rounding errors • Can be implemented with integer additions and subtractions © 2012 Oracle Corporation 6 Bresenham Line Drawing Algorithm (x1,y1) err y (x0,y0) x © 2012 Oracle Corporation func%on DrawLine ((x0,y0),(x1,y1)) x ⇐ x0 y ⇐ y0 err ⇐ 0 deltaerr ⇐ (y1 – y0)/(x1 – x0) while x < x1 do plot(x,y) x ⇐ x + 1 err ⇐ err + deltaerr while err ≥ 0.5 do y ⇐ y + 1 err ⇐ err – 1 end while end while 7 Scheduling Algorithm for Two Flows WDS err ⇐ 0 deltaerr ⇐ w1/w0 loop serve f0 err ⇐ err + deltaerr while err ≥ 0.5 do serve f1 err ⇐ err – 1 end while end loop © 2012 Oracle Corporation Bresenham err ⇐ 0 deltaerr ⇐ (y1 – y0)/(x1 – x0) while x < x1 do plot(x,y); x ⇐ x + 1 err ⇐ err + deltaerr while err ≥ 0.5 do y ⇐ y + 1 err ⇐ err – 1 end while end while 8 Using Integer Arithmetic Only err1 ⇐ 0 deltaerr1 ⇐ w1/w0 | *2w0 loop serve f0 err1 ⇐ err1 + deltaerr1 while err1 ≥ 0.5 do | *2w0 serve f1 err1 ⇐ err1 – 1 | *2w0 end while end loop © 2012 Oracle Corporation err1 ⇐ 0 deltaerr1 ⇐ 2*w1 loop serve f0 err1 ⇐ err1 + deltaerr1 while err1 ≥ w0 do serve f1 err1 ⇐ err1 – 2*w0 end while end loop 9 Scheduling > 2 Flows – Iterative Method • Iteratively merge two flows at the time f0 f1 f2 f3 S1 © 2012 Oracle Corporation S2 S3 10 Scheduling > 2 Flows – Non-Iterative Method err1 ⇐ 0; err2 ⇐ 0 deltaerr1 ⇐ w1/w0; deltaerr2 ⇐ w2/w0 loop serve f0 err1 ⇐ err1 + deltaerr1; err2 ⇐ err2 + deltaerr2 while err1 ≥ 0.5 or err2 ≥ 0.5 do if err1 ≥ 0.5 then serve f1; err1 ⇐ err1 – 1 end if if err2 ≥ 0.5 then serve f2; err2 ⇐ err2 – 1 end if end while end loop © 2012 Oracle Corporation 11 Jitter Calculation Jitter = stdev(Interdeparture Delays) … 0 0 0 0 w0 = 2 w1 = 3 0 … 1 … 1 1 1 1 0 1 1 0 f0 © 2012 Oracle Corporation 1 1 0 0 1 1 0 Scheduler 1 1 f1 0 1 3 2 2 2 1 J0 = 0.5 J1 = 0.47 12 Results: Jitter for 2 Flows 1.8 Algorithms: JLJS/JWDS J 1.7 SRR/JWDS WDS is better than SRR WDS is better than SRR jitter ratio 1.6 • WDS = Weighted Differential Scheduler • LJS = Low Jitter Scheduler • SRR = Smooth Round Robin Scheduler 1.5 1.4 1.3 1.2 WDS is better than LJS WDS is better than LJS 1.1 1 © 2012 Oracle Corporation 10 20 30 40 50 60 70 wmax = w0+w1 80 90 100 13 Results: Jitter for 3 Flows 1.8 • Alg. 4: Increment error 1.6 jitter ratio 1.4 1.2 1 JWDS,alg4/JWDS,iterative JWDS,alg5/JWDS,iterative JWDS,alg7/JWDS,iterative JWDS,alg8/JWDS,iterative 0.8 0.6 2 © 2012 Oracle Corporation 4 6 8 10 12 wmax 14 16 18 20 only when packet from f0 is forwarded • Alg. 5: Increment error when packet from f0 or f1 is forwarded • Alg. 7: Treat flows symmetrically • Alg. 8: Serve flow with biggest error first 14 Summary • Packet scheduling can be described as a Digital Differential Analyzer • WDS has lower jitter than any other known weighted scheduler • WDS requires integer additions/subtractions only • Future work: better understand and improve noniterative WDS versions © 2012 Oracle Corporation 15 [email protected] [email protected] © 2012 Oracle Corporation 16
© Copyright 2026 Paperzz