research faculty summit 2018 - microsoft.com · • tcp semantics: reliable, in-order,...

22
Systems | Fueling future disruptions Research Faculty Summit 2018

Upload: others

Post on 23-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Systems | Fueling future disruptions

Research Faculty Summit 2018

Page 2: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

High Performance Data Center Communication with FlexNIC

Thomas AndersonWarren Francis and Wilma Kolm Bradley ChairPaul G. Allen School of Computer Science and EngineeringUniversity of Washington

Page 3: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Data Center Application Trends

• Small, frequent remote procedure calls• Median RPC ~ 300 bytes across entire Google DC [Montazeri, SIGCOMM 18]• TCP semantics: reliable, in-order, congestion/flow control• Many to many

• Key-value store, database, distributed analytics …• Pushing performance limits

• More requests, larger data sets, real-time response, …• Scale up to 1000s of machines

• Need predictable tail latency behavior over multiplexed resources• With NVM persistence now almost entirely a networking issue

Page 4: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

...but software packet processing is too slow

• Recv+send TCP stack processing time (2.2 GHz)• Linux: 3.5µs• Kernel bypass: ~1µs

• Single core performance has stalled• Parallelize? Assuming 1µs over 100Gb/s, ignoring Amdahl‘s Law:

• 64B packets => 200 cores• 1KB packets => 14 cores

Page 5: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

What About?

• Kernel bypass? (ex: MTCP)• Kernel overhead only part of the problem• No policy enforcement

• SmartNICs/NIC CPU array? (Cavium, Netronome, …)• Complex assignment of flows to CPU array• Limited per-flow performance• Relatively expensive

• RDMA?• RDMA API fine for some apps, but message passing is a better fit for small RPCs• Hardware bundles (poorly designed) flow/congestion control with API

• TCP Offload Engine?• Need protocol agility

Page 6: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Hardware Assist, OS Feature Set

• Multi-tenant policy compliance• VM/container security and access control• Shared network resource management (flow and congestion control)

• Protocol agility (across lifetime of the hardware)• API agnostic: both RDMA and message passing• Reconfigurable protocols vs. fixed function hardware

• Connection scalability: 100K+ active flows/server• CPU efficiency for common case packet handling

• From NIC through the application and back• Performance predictability, esp tail latency with many flows• Cost-efficient hardware: FPGA or micro-programmed VLSI

Page 7: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Hardware Assist Possible at Several Layers

• Virtual machine layer: Sambhrama• Deliver packets directly to the guest OS• With VM policy enforcement

• Container OS layer: TCP packet handling• Deliver packets directly to the application• With policy enforcement, flow/congestion control, …

• Application-specific processing: Simon Peter

• Network switches: congestion and SLA management

FlexNIC

Approx Fair Queueing

Page 8: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Overarching Lesson

Common case packet handling is systolic (can be pipelined in hardware)On both NICs and switches

Page 9: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

FlexNIC: Reconfigurable Multi-stage Pipelines

• Reconfigurable packet processing pipelines• Protocol agnostic• Tbps implementations for a single pipeline (Barefoot)• Predictable performance

• Stages execute parallel

Prog

ram

mab

le

Pars

er

PacketStream . . .

. . . . . .

. . .

Modified PacketStream

Page 10: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Match+Action Programs

Does not support• Loops• Complex arithmetic• Arbitrary state• Arbitrary # of stages

Supports: • Steer packets• Initiate DMA • Trigger reply packet• Modify/replicate packets• Modest per-flow state

Match:IF udp.port == kvs

Action:core = HASH(kvs.key) % 2DMA hash, kvs TO Cores[core]

Page 11: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

FlexNIC Hardware Model

• Transform packets for efficient processing in SW• DMA directly into and out of application data structures• Send acknowledgements on NIC• Queue manager implements rate limits• Improve locality by steering to cores based on app criteria

RX Pipeline

DB Pipeline

TX Pipeline

DMA Pipeline PCIe DMA

From Network

To Network

From PCIe (Doorbells)

QMan

Page 12: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Complex connection state spread over multiple data structures, multiple queues, pointer chasing, …

Kernel• Open/close connections

Per packet• Socket API, locking• IP routing, ARP• Firewalling, traffic shaping• Generate data segments• Congestion control• Flow control• Process & send ACKs• Re-transmission timeouts

Page 13: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Application• Socket API, locking

Slow Path: Kernel• Open/close connections• IP routing, ARP• Firewalling, traffic shaping• Compute rate• Re-transmission timeouts

Fast Path: FlexNICPer packet: constant time operations• Generate data segments• Apply rate-limit• Congestion statistics• Flow control• Process & send ACKs

Minimal Connection State: 100 bytes

Page 14: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Periodic Congestion Control

• Linux TCP: per-packet congestion window calculation• Ack clocking triggers packet queuing for transmission• Liable to starvation as # of flows increases

• FlexTCP: per-RTT rate limit• FlexNIC: enforce rate-limit, collect CC statistics• Kernel software: Fetch CC statistics, update rate-limit• Congestion statistics: # ACKs, # ECN marks, # drops, RTT estimation

• Not specific to congestion algorithm• Implemented DCTCP, TIMELY, and Reno

Page 15: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

FlexTCP Performance

• Latency: 7.8x better vs Linux• FlexNIC per-flow isolation vs. Linux per-flow starvation

0

2

4

6

8

10

12

14

16

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Thro

ughp

ut [m

Op/

s]

Cores

Linux SoftTCP mTCP FlexTCP

10.7x vs Linux4.1x vs mTCP 7.2x vs Linux

2.2x vs mTCP

Page 16: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Fair Queueing: in-network enforcement

Enforce fair allocation and isolation at switches• Provide an illusion that every flow has its own queue• Proven to have perfect isolation and fairness

+ Simplifies congestion control at the end-host+ Protects against misbehaving traffic+ Enables bounded delay guarantees

However, challenging to realize in high-speed switches.

Page 17: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Sorted packet buffer

D

B

A

Fair Queueing without per-flow queues

• Simulates an ideal round-robin scheme where each active flow transmits a single bit of data every round.

10 9 8 7 6 5 4 3 2 1 0

Flow 1

Flow 2

Flow 3

Flow 4

Ideal fair-queueing

C

Sorted packet buffer

A, 3B, 5 C, 4

E

2

5

3

4

D,2E, 7

“Simulated” fair-queueing (Demers et.al.)

7

0

0

0Store and update per-flow counters

Track global round numberRound Number

FlowCounters

Page 18: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

“Simulated” fair-queueing

7

5

4

2

9 8 7 6 5 4 3 2 1 0

A, 3B, 5 C, 4 D,2E, 7

Our approach: Approximate Fair Queueing

Simulate a bit-by-bit round robin scheme with key approximations

Flow 1

Flow 2

Flow 3

Flow 4

Ideal fair-queueing

A

B

C

D

E 7

2

5

4

ACD

BESorted packet buffer

3 2 1 0

Coarse round numbers Limited # of FIFO queues with rotating priorities to approximate a sorted buffer

Store approximate per-flow counters using a variation of the count-min sketch

Page 19: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Testbed Results

• Compared to TCP, 4x better average FCT, 10x better tail latency

• Compared to DCTCP, 2x better average FCT, 4x better tail latency

1

10

100

NormalizedFlow

CompletionTime

Flow size(in bytes)

TCP DCTCP AFQ

Average

99%tile

Page 20: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Summary

• FlexNIC• Configurable, efficient, policy-compliant NIC packet handling• For VM, container, application• Key idea: common case behavior as match-action, kernel for exception handling

• Approximate fair queueing with switch match-action tables• Configurable, efficient, policy-compliant switch packet handling• Fair queueing provides performance isolation, network SLAs, QoS• Approximate with rotating priority queues, coarse-grained rounds, approx. per-flow counters

Page 21: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •

Thank you

Page 22: Research Faculty Summit 2018 - microsoft.com · • TCP semantics: reliable, in-order, congestion/flow control • Many to many ... • Complex assignment of flows to CPU array •