sp-pifo: approximating push-in first-out behaviors using strict … · 2020. 5. 10. · sp-pifo...

Post on 16-Mar-2021

4 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Approximating Push-In First-Out Behaviors

Albert Gran Alcoz,

Alexander Dietmüller,

Laurent Vanbever

SP-PIFO

1

4 5 4 4 3

1 2 1

sp-pifo.ethz.ch

SP-PIFO:

NSDI ’20

February, 25 2020

1

Using Strict-Priority Queues

2

[SIGCOMM ’92]

Minimize tail packet delays

[SIGCOMM ’13, NSDI ’15]

Minimize flow completion times

[ToN ’93, NSDI ’18]

Enforce max-min fairness

3

“You can’t have everything you want,

but you can have anything you want”

Flexibility

Customized algorithms

Generality

Universal packet scheduler

[NSDI ’16]

Is there a universal packet scheduler?

4

Generality

Universal packet scheduler

Programmable

scheduling

but you can have anything you want”

“You can’t have everything you want,

[NSDI ’16]

Is there a universal packet scheduler?

5

[SIGCOMM ’16]

PIFO abstraction for programmable scheduling

Assumes monotonic increase of ranks within flows

Supports ~1k flows and ~10 Gbps

Requires new ASIC implementation, which might take years

Deployability

Scalability

Flexibility

Implementing PIFO queues in hardware

is difficult

on existing devices?

Can we approximate PIFO queues…

at scale, and

at line rate,

6

Introducing…

SP-PIFO

7

A deployable, scalable and flexible

PIFO approximation

PIFO queues can be used as an abstraction

to make scheduling programmable

The PIFO queue Allows packets to be pushed into arbitrary locations

Only drains packets from the head

8

Packet ranks

PIFO Queue

4 145 32Input sequence Output sequence

PIFO queues can be used as an abstraction

to make scheduling programmable

The PIFO queue Allows packets to be pushed into arbitrary locations

Only drains packets from the head

9

Packet ranks

PIFO Queue

4 145 3Input sequence Output sequence

2

PIFO queues can be used as an abstraction

to make scheduling programmable

The PIFO queue Allows packets to be pushed into arbitrary locations

Only drains packets from the head

10

Packet ranks

PIFO Queue

4 145 3 2Input sequence Output sequence

PIFO queues can be used as an abstraction

to make scheduling programmable

The PIFO queue Allows packets to be pushed into arbitrary locations

Only drains packets from the head

11

Packet ranks

PIFO Queue

Input sequence

5 4 4 3 2 1Output sequence

2

Programmable scheduler

12

PIFO queues can be used as an abstraction

to make scheduling programmable

Rank computation (programmable)

PIFO queue (fixed logic)

Rank Computation

p.rank = f.size

f = flow(p)

Input sequence

PIFO Queue

1445 3

Programmable scheduler

13

PIFO queues can be used as an abstraction

to make scheduling programmable

Rank computation (programmable)

PIFO queue (fixed logic)

Rank Computation

p.rank = f.size

f = flow(p)

Input sequence

PIFO Queue

1445 32

445 3

Programmable scheduler

14

PIFO queues can be used as an abstraction

to make scheduling programmable

Rank computation (programmable)

PIFO queue (fixed logic)

Rank Computation

p.rank = f.size

f = flow(p)

Input sequence

PIFO Queue

12

15

SP-PIFO approximates PIFO behaviors using Strict-Priority queues

and a dynamic mapping strategy

Adaptation StrategyStrict-Priority Queues

12445

3

Rank Computation

p.rank = f.size

f = flow(p)

Programmable scheduler

Rank computation (programmable)

Adaptation strategy + strict-priority queues (fixed logic)

16

Ideal case Perfect PIFO if number of queues >= number of ranks

SP-PIFO approximates PIFO behaviors using Strict-Priority queues

and a dynamic mapping strategy

Strict-Priority Queues

12345

23

5

1

44

17

Ideal case Perfect PIFO if number of queues >= number of ranks

SP-PIFO approximates PIFO behaviors using Strict-Priority queues

and a dynamic mapping strategy

Output sequence

Strict-Priority Queues

12345

5 4 4 3 2 1

18

Strict-Priority Queues

In practice Number of queues < number of ranks

SP-PIFO approximates PIFO behaviors using Strict-Priority queues

and a dynamic mapping strategy

Problem Output sequence can have scheduling errors

42 3 1

Problem Output sequence can have scheduling errors

19

Low-ranked packets drained after high-ranked packets

suboptimal output

In practice Number of queues < number of ranks

SP-PIFO approximates PIFO behaviors using Strict-Priority queues

and a dynamic mapping strategy

Strict-Priority Queues

4 12 3

Problem Output sequence can have scheduling errors

20

In practice Number of queues < number of ranks

SP-PIFO approximates PIFO behaviors using Strict-Priority queues

and a dynamic mapping strategy

Design mapping strategies that

minimize scheduling errors

Opportunity

21

SP-PIFO defines mapping through ‘queue bounds'

Queue bounds scanned bottom-upMapping

Packet enqueued if rank >= queue bound

Strict-Priority Queues

134 2Input sequence Output sequence

?

22

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

14

134 2Input sequence Output sequence

Mapping Queue bounds scanned bottom-up

Packet enqueued if rank >= queue bound

23

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

14

34 12Input sequence Output sequence

Mapping Queue bounds scanned bottom-up

Packet enqueued if rank >= queue bound

Input sequence Output sequence

34 2

24

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

14

1

Is rank >= queue bound ?

Input sequence Output sequence

34 2

25

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

14

1

26

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

114

Input sequence Output sequence

Mapping

34 2

Queue bounds scanned bottom-up

Packet enqueued if rank >= queue bound

27

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

114

4 2 3suboptimal output

Input sequence Output sequence

Mapping Queue bounds scanned bottom-up

Packet enqueued if rank >= queue bound

28

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

114

4 2 3suboptimal output

13Strategy B

134 2

Input sequence Output sequence

Mapping Queue bounds scanned bottom-up

Packet enqueued if rank >= queue bound

29

SP-PIFO defines mapping through ‘queue bounds'

Strategy A

Input sequence Output sequence

114

4 2 3suboptimal output

13Strategy B

134 2optimal output

Mapping Queue bounds scanned bottom-up

Packet enqueued if rank >= queue bound

30

How can we design a mapping strategy

that minimizes scheduling errors?

1 Adaptation design

How does it work

2 Implementation

How can it be deployed

3 Evaluation

How well does it perform

31

Approximating Push-In First-Out Behaviors SP-PIFO:

Using Strict-Priority Queues

1 Adaptation design

How does it work

32

Approximating Push-In First-Out Behaviors SP-PIFO:

Using Strict-Priority Queues

2 Implementation

How can it be deployed

3 Evaluation

How well does it perform

33

Problem formulation

q* = argmin E [ U(q, r) ]q ∈ Q r ∼ R

Objective Find optimal queue bounds q*

That minimize the expected loss U for all ranks

Unpifoness (U) quantifies the scheduling errors

34

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 42

Strict-Priority Queues

Input sequence Output sequence

03

0

Initialization

Queue bounds set to zero

Zero traffic knowledge

35

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

03

0

Rank >= queue bound ?

Initialization

Queue bounds set to zero

Zero traffic knowledge

4

36

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

0

0

Initialization

Queue bounds set to zero

Zero traffic knowledge

Rank >= queue bound ?

43

37

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

0

0 43

Initialization

Queue bounds set to zero

Zero traffic knowledge

38

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

0

043

scheduling error

Initialization

Queue bounds set to zero

Zero traffic knowledge

39

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

0

00 4

Initialization

Queue bounds set to zero

Zero traffic knowledge

Rank >= queue bound ?

3

40

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

0

03

0 4Push-up 4

41

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

03

44

42

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

0

00 44

After enqueue, queue bound set to

the rank of the packet enqueued

Push-up

(future low-rank packets to

higher-priority queues)

Rank >= queue bound ?

3

43

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

0

0

3

0 44

Push-up 3

After enqueue, queue bound set to

the rank of the packet enqueued

Push-up

(future low-rank packets to

higher-priority queues)

44

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1 2

Strict-Priority Queues

Input sequence Output sequence

3

0

3

0 44

45

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1

Strict-Priority Queues

Input sequence Output sequence

3

0

3

0 44

!

Output sequence

After enqueue, queue bound set to

the rank of the packet enqueued

Push-up

(future low-rank packets to

higher-priority queues)

2

46

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1

Strict-Priority Queues

Input sequence Output sequence

3

00 44

Output sequence

2 3

Error cost = (queue bound - rank) = 1

2

47

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1

Strict-Priority Queues

Input sequence Output sequence

00 4

Output sequence

3Push-down 3 3

4

For all queue bounds:

decrease error cost (1)

2

2

48

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1

Strict-Priority Queues

Input sequence Output sequence

00 4

Output sequence

Push-down 32 3

4

2

For all queue bounds:

decrease error cost (1)

2

49

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

1

Strict-Priority Queues

Input sequence Output sequence

00 4

Output sequence

32 3

3Push-down

2

For all queue bounds:

decrease error cost (1)

50

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

Strict-Priority Queues

Input sequence Output sequence

00 4

Output sequence

32 3

3

2

After potential error detected,

all queue bounds decreased the error cost

Push-down

(future high-rank packets to

lower-priority queues)

3

51

SP-PIFO adapts the mapping of packet ranks

to strict-priority queues

Objective Find optimal queue bounds q*

That minimize the expected loss U for all ranks

Strict-Priority Queues

00 4

3 32

3

2

3Push-up Push-down

Low-rank packets High-rank packets

Result Packet-level adaptation of q

2 Implementation

How can it be deployed

3 Evaluation

How well does it perform

52

Approximating Push-In First-Out Behaviors SP-PIFO:

Using Strict-Priority Queues

1 Adaptation design

How does it work

53

SP-PIFO has been fully implemented on

existing programmable hardware

Parser Traffic ManagerIngress pipeline

Priority Queues

Queue Bound n

Registers

Queue Bound n-1 Queue Bound 1

Metadata

Queue ID

Queue Bound 1 - Rank

2 Implementation

How can it be deployed

3 Evaluation

How well does it perform

54

Approximating Push-In First-Out Behaviors SP-PIFO:

Using Strict-Priority Queues

1 Adaptation design

How does it work

How well does SP-PIFO approximate

well-known scheduling objectives under

realistic traffic workloads?

Max-min fairness

Minimizing Flow Completion Time

pFabric* (8 queues)

Start-Time Fair Queuing (32 queues)

Ranks based on a fluid model

Ranks are set to the remaining flow size

55

Evaluation

* without starvation prevention

Scheduling objectives

Question

56

We generate traffic following pFabricRealistic workloads web-search workload

Methodology

We use a leaf-spine topology with 144 servers,Topology

links of 1Gbps and 4Gbps

Packet-level simulator

We integrated SP-PIFO in Netbench

[SIGCOMM 2017]

50

57

SP-PIFO closely approximates pFabric,

minimizing FCTs for both small and big flows

Load

Small flows <100KB Big flows ≥1MB

0

100

200

300

400

500

0.2 0.3 0.4 0.5 0.6 0.7 0.8

Flow

Com

plet

ion

Tim

e (m

s)

Load

PIFOSP-PIFODCTCP

TCP

0

10

20

30

40

50

0.2 0.3 0.4 0.5 0.6 0.7 0.8

Flow

Com

plet

ion

Tim

e (m

s)

Load

PIFOSP-PIFODCTCP

TCP

0.2 0.3 0.4 0.5 0.6 0.7 0.80

10

20

30

40

Load

0.2 0.3 0.4 0.5 0.6 0.7 0.8

500

0

100

200

300

400

99th percentile FCT (ms) Average FCT (ms)

0

10

20

30

40

50

0.2 0.3 0.4 0.5 0.6 0.7 0.8

Flow

Com

plet

ion

Tim

e (m

s)

Load

PIFOSP-PIFODCTCP

TCP

58

SP-PIFO closely approximates state-of-the-art

fair-queuing algorithms

101

103

105

107

�2M 0.2M-1M 80K 50K 30K 20K 10K

Flow

Com

plet

ion

Tim

e (m

s)

Flow Size

PIFOAFQ

SP-PIFODCTCP

TCP

0

2

4

6

8

10

0.2 0.3 0.4 0.5 0.6 0.7 0.8

Flow

Com

plet

ion

Tim

e (m

s)

Load

PIFOAFQ

SP-PIFODCTCP

TCP

Flow size

All flows @ Load 0.7

Average FCT (ms)

2

4

6

8

10

0.2 0.3 0.4 0.5 0.6 0.7 0.8

Load

≥2M

10

105

107

103

0≤1M 80K 50K 30K 20K 10K

Small flows <100KB

Average FCT (ms)

0

59

SP-PIFO characterization, comparison with gradient

Check our website!

Limitations and future improvements

sp-pifo.ethz.ch

All the code is availableAll our experiments are reproducible

Hardware evaluation on Barefoot Tofino

60

SP-PIFO approximates the behavior of PIFO queues

Making scheduling programmable, today!SP-PIFO:

at line rate, at scale and on existing devices

It adapts the mapping between packet ranks and

strict-priority queues to minimize the scheduling errors

It reacts per-packet to traffic variations,

without traffic knowledge required

sp-pifo.ethz.ch

Albert Gran Alcoz Alexander Dietmüller Laurent Vanbever

61

Approximating Push-In First-Out Behaviors SP-PIFO:

Using Strict-Priority Queues

top related