high-throughput publish/subscribe in the forwarding plane · high-throughput publish/subscribe in...

34
High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster, Xiaozhou Li, Milad Sharif, Robert Soulé Università della Svizzera italiana (USI) and Barefoot Networks 1

Upload: others

Post on 19-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

High-Throughput Publish/Subscribe in the Forwarding Plane

Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster, Xiaozhou Li, Milad Sharif, Robert Soulé Università della Svizzera italiana (USI) and Barefoot Networks

1

Page 2: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Publish/Subscribe Is Critical to Distributed Applications

2

Page 3: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Publish/Subscribe Is Critical to Distributed Applications

3

Page 4: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Publish/Subscribe Is Critical to Distributed Applications

4

Page 5: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Publish/Subscribe Is Critical to Distributed Applications

5

Page 6: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Publish/Subscribe Is Critical to Distributed Applications

6

Page 7: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Publish/Subscribe Is Critical to Distributed Applications

7

Page 8: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Motivating Example:ITCH Market Feed

8

End-Points filter based on trading strategy:stock == MSFT

21 NASDAQ publishes feed:

Ether/IP/UDPMOLD

GOOGLMSFTORCL

Page 9: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Motivating Example:ITCH Market Feed

8

End-Points filter based on trading strategy:stock == MSFT

21 NASDAQ publishes feed:

High volume, High tail latency

Ether/IP/UDPMOLD

GOOGLMSFTORCL

Page 10: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

In-software Processing: Multicast + Kernel Bypass

Unnecessary congestion in the network

Burden of filtering on hosts leads to queuing

Highlights need for “in network” solution

9

Nasdaq 9/30/17, 0.5% GOOGL

Page 11: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Challenges

Different applications have different message formats

Filter content based on expressive conditions

Deep packets and multiple messages per packet

10

Page 12: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Camus: Dataplane Pub/Sub

11

Controller

P4 Compiler

Camus CompilerFilters (subscriptions)

Control plane rules

P4 program

P4 header spec

P4 parser spec

Page 13: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Publisher Interface

A publisher simply composes and sends packets

Camus generates application-specific parsing logic

Parsing logic is static, installed once with Camus

12

Page 14: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Subscriber Interface

Filters are boolean formulas of atomic predicates and an action

stock == GOOGL : fwd(1)

A forwarding action may be unicast or multicast:

stock == GOOGL : fwd(1,2,3)

Rules may be stateful or compute a function:

stock == GOOGL ∧ avg(price) > 50 : fwd(1)

13

Page 15: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Static Pipeline

14

header_type itch_add_order_t { fields { stock_locate: 16; /* … */ shares: 32; stock: 64; price: 32; }}header itch_add_order_t add_order;@pragma query_field(add_order.shares)@pragma query_field(add_order.price)@pragma query_field_exact(add_order.stock)@pragma query_counter(my_counter, 100, 1024)

Page 16: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Static Pipeline

14

header_type itch_add_order_t { fields { stock_locate: 16; /* … */ shares: 32; stock: 64; price: 32; }}header itch_add_order_t add_order;@pragma query_field(add_order.shares)@pragma query_field(add_order.price)@pragma query_field_exact(add_order.stock)@pragma query_counter(my_counter, 100, 1024)

P4 header formessage format

Page 17: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Static Pipeline

14

header_type itch_add_order_t { fields { stock_locate: 16; /* … */ shares: 32; stock: 64; price: 32; }}header itch_add_order_t add_order;@pragma query_field(add_order.shares)@pragma query_field(add_order.price)@pragma query_field_exact(add_order.stock)@pragma query_counter(my_counter, 100, 1024)

P4 header formessage format

Pragmas for pipeline and

state

Page 18: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:Representing Rules with BDDs

15

shares==2 : fwd(1)price>1 ∧ shares==2 : fwd(2)

Page 19: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:Representing Rules with BDDs

15

price > 1

shares = 2

[1, 2][] [1]

truefalse

truefalseshares = 2

shares==2 : fwd(1)price>1 ∧ shares==2 : fwd(2)

Page 20: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:BDD Reductions

16

share<5

share<8 share>6

share<5

share<8 share>6

share=5

ticker=GOOGL

share<7

share=9 share=8

(i) Remove isomorphic(Standard)

(iii) Remove implicit(Domain-specific)

(ii) Remove redundant (Standard)

Page 21: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:BDDs to Forwarding Table (1/4)

17

price > 1

[]

shares = 5

[2]

price = 3

shares = 5

[3] [1,3] [1,2,3]

Page 22: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:BDDs to Forwarding Table (1/4)

Partition into sub-graphs by field

18

price > 1

[]

shares = 5

[2]

price = 3

shares = 5

price fields

shares fields

[3]leaves [1,3] [1,2,3]

Page 23: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:BDDs to Forwarding Table (2/4)

19

price > 1

[]

shares = 5

[2]

price = 3

shares = 5

price fields

shares fields

[3]leaves [1,3] [1,2,3]

Identify entry and exit node sets

price entry nodeAssign an ID

1

2 3

Page 24: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:BDDs to Forwarding Table (3/4)

20

price > 1

[]

shares = 5

[2]

price = 3

shares = 5

[3] [1,3] [1,2,3]

1

2 3

For each path, the tuple (entry ID, match, exit ID) corresponds to an entry in its field’s table

State Match Next state

1 * 2

1 =3 3

1 >1 6

State Match Next state

2 * 4

2 =5 5

3 * 7

3 =5 8

5 6 7 84

Page 25: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiling Dynamic Filters:BDDs to Forwarding Table (4/4)

21

price table

State Match Next state

1 * 2

1 =3 3

1 >1 6

shares table

State Match Next state

2 * 4

2 =5 5

3 * 7

3 =5 8

State Actions

4 []

5 [2]

6 [3]

7 [1,3]

8 [1,2,3]

Encode BDD as finite state machinein the forwarding tables

Page 26: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Multiple Messages Per Packet

22

Parsing deep: recirculate packet and advance index

Routing multiple messages: prune unwanted messages at egress

Page 27: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Evaluation

23

Page 28: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Compiler Efficiency

Used synthetic workload generator to create queries of the form:

stock = S ∧ price > P: fwd(H)

Can fit O(100K) queries in switch memory!

Compiling 100K subscriptions required 21,401 table entries and 198 multicast groups

24

Page 29: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Experiment:In-Network ITCH Filtering

25

Publisher sends feed (add order)

Switch filters for: stock = “GOOGL”

Client calculates latency

1

23

Machine has 2 x 25 GB/s NICs

Forward: switch forwards packets; queries evaluated in software

Filter: switch evaluates queries

Page 30: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Workloads

26

Workload Messages per packet % GOOGL

Synthetic 1-12 (Zipf dist.) 1%

Synthetic (worst case) Exactly 12 100%

Nasdaq sample 08302017 Exactly 1 0.1%

Page 31: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Synthetic WorkloadCDF of Latency

27

1% GOOGL, 1-12 messages / packet

With Camus, 99% finish under 20us Without Camus, 99% finish under 500us

Page 32: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Worst-Case WorkloadCDF of Latency

28

100% GOOGL, 12 messages / packet

Page 33: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

NASDAQ Workload (8/30/17) CDF of Latency

29

0.1% GOOGL, 1 messages / packet

With Camus, 100% finish under 100us Without Camus, 84% finish under 100us

Page 34: High-Throughput Publish/Subscribe in the Forwarding Plane · High-Throughput Publish/Subscribe in the Forwarding Plane Theo Jepsen, Masoud Moushref, Antonio Carzaniga, Nate Foster,

Conclusion

30

Camus is a pub/sub service implemented on programmable network ASICs

Uses a novel BDD-based algorithm to translate predicates into P4 tables that can support O(100K) expressions

Increases system flexibility and reduces latency for clients

http://inf.usi.ch/phd/jepsen/