programmable calendar queues for high-speed packet …• queues scheduled using priority or round...

20
Programmable Calendar Queues for High-speed Packet Scheduling Naveen Kr. Sharma 1 , Chenxingyu Zhao 1 , Ming Liu 1 , Pravein G Kannan 2 , Changhoon Kim 3 , Arvind Krishnamurthy 1 and Anirudh Sivaraman 4

Upload: others

Post on 16-Apr-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Programmable Calendar Queues forHigh-speed Packet Scheduling

Naveen Kr. Sharma1, Chenxingyu Zhao1, Ming Liu1, Pravein G Kannan2,

Changhoon Kim3, Arvind Krishnamurthy1 and Anirudh Sivaraman4

Page 2: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Packet Scheduling

• Many scheduling algorithms require ordering packet at switches

• Enables rich application guarantees such as WFQ, EDF or SRPT

• Generally implemented using a priority queue with static priorities

• Packet’s priority (rank) is computed by the ingress pipeline

• The priority does not change until the packet is transmitted

• However, static priorities are insufficient for several algorithms

Page 3: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Static Priority Limitations

Least Slack Time First

• Each packet has slack denoting time until delivery

• Enqueue packet with rank = current_time + slack

• Ranks increase over time, eventually exhausting priorities

• Other algorithms, WFQ, EDF, LBF have this property as well

0

1

2

3

4

5

N

PriorityLevels

• Need a mechanism that supports “dynamic priorities”

• Implementable at high-speeds (preferably a bolt-on)

1T = 0

2T = 1

1T = 3

3

5

Page 4: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Calendar Queues (CQs)

• Proposed by Brown’88 for processing events in discrete event simulator

• Bucketed priority queue with O(1) insert and deletes

• Analogous to a desk calendar, consisting of multiple days

• Events are scheduled by specifying a future day

• Dequeued from the current day in sorted order

• Once events are exhausted for a day, move onto next day – priority escalation

• Make the previous day available to reuse at lowest priority – priority reuse

Page 5: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Our Contribution: Programmable Calendar Queues

Combine calendar queues abstraction with programmable pipelines

to realize scheduling algorithms at line-rate on today’s hardware

• Calendar Queues provide dynamic priorities

• Programmable pipelines maintain scheduling algorithm state

Page 6: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Outline

• Background

• Programmable Calendar Queue (PCQs)

• Realizing scheduling algorithms on PCQs

• Implementing PCQs in hardware

• Case Study : Coflow Scheduling

• Case Study : Weighted Fair Queuing

Page 7: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Reconfigurable Switches

Traffic Manager (TM)Ingress Pipeline Egress Pipeline

Multiple FIFO queues

• Packets processed by ingress pipeline before being buffered in the TM

• Multiple queues attached to an egress port, configured using the switch CPU

• Queues scheduled using priority or round robin, with support for pausing

Page 8: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

• Calendar Queue with programmable and stateful rank computation

• Customizable and configurable day duration and rotation policy

• Each day is mapped to a FIFO queue

• Packet ranks are bucketed into days

• Earliest day has highest deque priority

• Move to next day periodically

• Reuse the queue for future day

Programmable Calendar Queues (PCQs)

Day 1

Day 2

Day 3 ...

Day N

Day N+1

52 01

10 1518

25

[0, 10)

[10, 20)

[20, 30)

DequeOrder

FIFO queues

Page 9: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Realizing Algorithms using PCQs

• Calculate which day to enqueue arriving packets – Rank Compute

• How far into the future to schedule the packet

• Decide when to move onto next day – Queue Rotation

• When the current queue is empty – Logical Calendar Queue

• Periodically based on wall clock time – Physical Calendar Queue

• Update algorithm state and enqueing behavior – State Update

• Ensures algorithm invariants are maintained on rotation

Page 10: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Example using PCQs: Fair Queueing

• Emulate bit-by-bit round robin fair queueing

• Each round corresponds to a day in the CQ

• Rank Computation• Rank = bytes sent by flow / round size

• Queue Rotation• Whenever the current queue is empty

• State Update• Increment round number by 1

Flow 1

Flow 2

Flow K

Ideal per-flow queues

A

B

D

C

3 2 1 0

AD

BC

Day 1

Day 2

Day N

Calendar Queues

......

}

RoundSize

Page 11: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

5 0

10 15

25

• Bucket packet deadlines into queues based on day duration

• Keep track of drift to maintain correct dequeue order

• Rank Computation• Rank = deadline + drift / bucket size

• Rotation• Current queue is empty

• State Update• Adjust drift based on time spent

Example using PCQs: Earliest Deadline First

Day 1

Day 2

Day 3

...

Day N

[0us, 10us)

[10us, 20us)

[20us, 30us)

Calendar Queues

[-5us, 5us)

[15us, 25us)

Page 12: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Implementing PCQs in hardware

• Mutable switch state and recirculation of special packets

• Ability to change queue priority and status

Traffic Manager Egress PipelineIngress Pipeline

headQ = 1

tailQ = N

headQ = 1/ 2/ 2

/ 1

MarkerPacket

Day 1

Day 2

Day 3

Day N

Hi

Lo

Day N+1

P

P

P

Page 13: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Hardware Feasibility

• Most efficient implementation requires data plane support for

modifying queue priority and status

• Expected in next generation of programmable switches

• Limited version already available for PFC mechanism

• Less responsive version can be realized using control plane

• Our prototype uses switch CPU to update queue priorities

Page 14: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

More details in the paper

• Approximations in PCQs

• Hierarchical Calendar Queues

• Expressiveness and Limitations of PCQs

• Hardware Prototype Results

Page 15: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Case Study: Coflow Scheduling

• Many applications optimize the performance of collection of flows

• Ordering coflows smallest to largest gives close to optimal results

• We implement such a scheme using LSTF scheduling on PCQs

• Slack is set to the expected finish time of the largest sub-flow

• At any hop, packet with the shortest slack is sent out first

Page 16: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Coflow Testbed Setup

• 3-level fat-tree testbed with coflow and background traffic

• Each switch port implements a PCQ with 32 FIFO queues

• Compared with DCTCP over droptail and fair-queueing

• Measure and report the Coflow Completion Time (CCT)

Page 17: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Coflow Scheduling Evaluation

0

400

800

1200

10 20 30 40 50 60 70 80 90

Network Load (%)

Average CCT

0

1000

2000

3000

10 20 30 40 50 60 70 80 90

Network Load (%)

99th %tile CCT

Droptail

Fair Queue

Ideal SRPT

SRPT w CQs

CCTinμs

Page 18: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Case Study: Burst-friendly Fair Queueing

• Emulate a bit-by-bit round robin scheme at coarse granularity

• Desirable to permit a burst of packets for better tail latency

• Sacrifices fairness at short timescales but maintains it at long timescale

Ideal Fair Queueing

Bursty Fair Queueing

1 2 3 4 5 6 7 8 9Round Number

Page 19: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Burst-friendly Fair Queueing Evaluation

0

40

80

120

160

10 20 30 40 50 60 70 80 90

Network Load (%)

99.9th %tile FCT for short flows

Ideal FQ

FQ w/ CQs

Bursty FQ 8

Bursty FQ 16

0

15

30

45

60

10 20 30 40 50 60 70 80 90

Network Load (%)

Average Coflow Completion Time

FCTinμs

Page 20: Programmable Calendar Queues for High-speed Packet …• Queues scheduled using priority or round robin, with support for pausing •Calendar Queue with programmable and stateful

Summary

• Static priority mechanisms insufficient for class of scheduling algorithms

• Calendar Queue based approach is a better fit

• Can be implemented on today’s multi-pipeline, high speed switches

• Inherently scalable to higher bandwidth and number of flows

• With a programmable pipeline, can implement a variety of algorithms