pluginizing quic - iij innovation institute

40
Pluginizing QUIC Quentin De Coninck, François Michel, Maxime Piraux, Florentin Rochet, Thomas Given-Wilson, Axel Legay, Olivier Pereira, Olivier Bonaventure SIGCOMM 2019 UCLouvain, Belgium 1

Upload: others

Post on 31-Jan-2022

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pluginizing QUIC - IIJ Innovation Institute

Pluginizing QUIC

Quentin De Coninck, François Michel, Maxime Piraux, Florentin Rochet, Thomas Given-Wilson, Axel Legay, Olivier Pereira, Olivier Bonaventure

SIGCOMM 2019UCLouvain, Belgium

1

Page 2: Pluginizing QUIC - IIJ Innovation Institute

QUIC

● Currently under standardization at IETF● Providing TCP/TLS1.3 service atop UDP

○ (Nearly) everything is encrypted○ Reliable, in-order, multistream data transfer

● Frame-based protocol● Large companies are deploying both client and server sides

○ Limited interoperability today

IPTCPTLS

HTTP/2

IPUDPQUIC

HTTP/3

TLS

2

H F F F

Page 3: Pluginizing QUIC - IIJ Innovation Institute

Application Requirements Evolve

Simple reliable file transfer

Mobility, (live) video streaming

Latency critical, partially unreliable

Transport protocols need to adapt! 3

Page 4: Pluginizing QUIC - IIJ Innovation Institute

Negotiating Extensions: The Human Protocol

4

Hello, I speak [French, English, Dutch]

Hi, I understand [Japanese, English]

Ok, let’s speak English!

Require support from both sides: delayed deployment

How could I learn Japanese?

Page 5: Pluginizing QUIC - IIJ Innovation Institute

Adding Monitoring to an Implementation

● High-performance, native server implementation● Client side based on open-source 3rd-party library

5

QUIC lib AB

B

No, thanks.

○ A opens Pull Request to extend the library■ Get monitoring information for some connections

○ But not merged by B

Client AppA

Clients seemto have poorperformance

A

Activate monitoring with specific filters

Page 6: Pluginizing QUIC - IIJ Innovation Institute

What If We Could Have...

6

Personalized Transport FunctionalitiesPer-Connection Deployment

A base, simple implementation enabling

Page 7: Pluginizing QUIC - IIJ Innovation Institute

Agenda

● Motivations● Pluginized QUIC Design● Evaluating PQUIC with Use Cases● Conclusion and Future Works

7

Page 8: Pluginizing QUIC - IIJ Innovation Institute

Pluginized QUIC

● Revisit the structure of protocol implementations● Transport protocol = set of basic functions (protocol operations)

○ Plugin: new set of protocol functions (modified or added)

8

Transport

● Dynamic per-connection customization

RTO Computation

Header Preparation

Add to send buffer

Unreliable Message

Add new functions

Different algorithms

Isolation between

connections

C1

C2

RTO Computation

Header Preparation

Add to send buffer

Unreliable Message

RTO Computation

Header Preparation

Add to send buffer

RTO Computation

Change algorithms

RTO Computation

...

...

...

Page 9: Pluginizing QUIC - IIJ Innovation Institute

Exchanging Plugins: 1st Connection

9

Initial: Client Hello - “Hey, I support multipath”

Initial: Server Hello - “I want to inject monitoring”

Encrypted - PLUGIN_REQUEST(monitoring)

Encrypted - PLUGIN(monitoring)

...

Let’s monitor the client state.

Let’s request monitoring

Bytecode

Page 10: Pluginizing QUIC - IIJ Innovation Institute

Exchanging Plugins: Next Connections

10

Initial: Client Hello - “Hey, I support multipath and monitoring”

Initial: Server Hello - “Let’s use monitoring”

Encrypted - STREAM, STAT(info about RTT, reordering,...)

Encrypted - STREAM

...

Let’s use monitoring

Added by the monitoring

plugin

Page 11: Pluginizing QUIC - IIJ Innovation Institute

Revisiting Protocol Implementation Design

What do we need?

● Running plugins in a safe environment● Identifying protocol operations● Providing an API to the protocol plugins

11

Page 12: Pluginizing QUIC - IIJ Innovation Institute

Running Plugins

● Plugin = set of bytecodes○ 1 bytecode → 1 function○ Hardware/OS independent○ Kept under control

12

0101110010

VirtualMachine

● Rely on a virtual machine○ Isolate bytecode from host implementation

Page 13: Pluginizing QUIC - IIJ Innovation Institute

eBPF Virtual Machine

● Lightweight, integrated in Linux kernel since 2014○ RISC instruction set (~100)

■ ALU, memory and branch purposes

● Bytecode recompiled to native architecture● Verifier to ensure programs safety● Dedicated, isolated stack memory

○ But no persistence

● Rely on a user-space implementation○ With relaxed verifier○ With persistent heap memory

13

0101110010

x86_64

Page 14: Pluginizing QUIC - IIJ Innovation Institute

Identifying Protocol Operations

14

Process incoming packet

Each operation has its ownbuilt-in implementation

Cleartext Encrypted

Flags Connection ID STREAM 4 “Some text”Packet Number ACK 4

Parse packet header

Process ACKframe

Process STREAM

frame

Compute Retransmit

Timer

Page 15: Pluginizing QUIC - IIJ Innovation Institute

Modifying/Adding Protocol Operations

15

Process

incoming

packet

Each operation has its ownbuilt-in implementation

Cleartext Encrypted

Flags Connection ID STREAM 4 “Some text”Packet

NumberACK 4

Parse

packet

header

Process

ACK

frame

Process

STREAM

frame

Compute

Retransmit

Timer

Compute

Retransmit

Timer

0101110010

VM

Cleartext Encrypted

Flags Connection ID STREAM 4 “Some text”Packet

NumberACK 4 STAT (RTT info,...)

Process

STAT

frame

0110010101

VM

Page 16: Pluginizing QUIC - IIJ Innovation Institute

REPLACE

Changing the Retransmission Timer

int process_ack_frame(args) {

// Some processing

ret = compute_retransmission_timer(args);

// Some processing

return val;

}

16

int compute_retransmission_timer(args) {

rto = srtt + 4 * rttvar;

return rto;

}

VMrto = srtt + 3 * min_rtt;

return rto;

Exclusive full-access to connection state

Page 17: Pluginizing QUIC - IIJ Innovation Institute

Inserting Monitoring Plugin

int process_ack_frame(args) {

// Some processing

ret = compute_retransmission_timer(args);

// Some processing

return val;

}

17

int compute_retransmission_timer(args) {

rto = srtt + 4 * rttvar;

return rto;

}

PRE

POST

VM 0110010101

VM 1110010000

Read-only access to

connection state

VM 1111100000

Page 18: Pluginizing QUIC - IIJ Innovation Institute

Linking Plugins to the Core Implementation

18

● Exposing connection fields● Offering persistent heap memory● Retrieving data in plugin memory● Calling other protocol operations VM

1111000001

stack PluginMemory

heap

Get specific plugin data

VM’

1011000101

stack heapCall

PQUIC core

ConnectionState

get() / set()

built_in()

Call

Page 19: Pluginizing QUIC - IIJ Innovation Institute

Communication between Plugin Bytecodes

19

parse_frame[ACK]

built_in()

bbr_congestion_control replace1011000101

VM”

stack heap Plugin BMemory

write_frame[STAT] replace

postcompute_retransmission_timer

heapVM

1111000001

stack

heapVM’

0101110010

stack

Plugin AMemory

Page 20: Pluginizing QUIC - IIJ Innovation Institute

Agenda

● Motivations● Pluginized QUIC Design● Evaluating PQUIC with Use Cases● Conclusion and Future Works

20

Page 21: Pluginizing QUIC - IIJ Innovation Institute

Evaluation Overview

● Implementation based on picoquic○ IETF QUIC in C language

● Evaluation in our lab○ Use NetEm and HTB to configure links

● Experimental design○ 139 points○ Consider median over 9 runs

21

{d, bw}

{d, bw}

Metric Minimum MaximumOne-way delay (ms) 2.5 25

Bandwidth (Mbps) 5 50

https://github.com/private-octopus/picoquic

Page 22: Pluginizing QUIC - IIJ Innovation Institute

Exploring Use Cases

● Monitoring● A QUIC VPN● Multipath● Forward Erasure Correction

22

Plugin Lines of C Code Number of bytecodes

Monitoring 500 14

QUIC VPN 500 11

Multipath 2600 32

Forward Erasure Correction 2500 51

Page 23: Pluginizing QUIC - IIJ Innovation Institute

Exploring Use Cases

● Monitoring● A QUIC VPN● Multipath● Forward Erasure Correction

23

Read paper for other use cases

Plugin Lines of C Code Number of bytecodes

Monitoring 500 14

QUIC VPN 500 11

Multipath 2600 32

Forward Erasure Correction 2500 51

Page 24: Pluginizing QUIC - IIJ Innovation Institute

1st Plugin: QUIC VPN

24

V VQUIC Connection

IP

TCP

DATA

QUIC

IP

IP

TCP

DATA

IP

TCP

DATA

→ But QUIC provides reliable, in-order data delivery

QUIC

VPN Application

DatagramPlugin

send_datagram()

QUIC

IP

IP

TCP

DATA

● Datagram plugin○ Unreliable data delivery○ Application API

■ Protocol operation

Alternative to DTLS, IPsec

Page 25: Pluginizing QUIC - IIJ Innovation Institute

QUIC VPN in Action

25

Compare download time for a single file transfer using TCPCubic over 1 path

Faster in VPN

Plain TCP

Faster

Overhead of ≊7%

Processing time + MTU difference

Page 26: Pluginizing QUIC - IIJ Innovation Institute

2nd Plugin: Multipath QUIC

Implement the IETF Multipath draft

● Link paths to specific networks○ Connection not bound to 4-tuple

● Exchange IP addresses● Create paths over pair of IP addresses

○ Full-mesh

● Schedule packets over paths○ Round-robin fashion

26

MultipathPlugin

Core functionalities

ModularAlgorithms

https://datatracker.ietf.org/doc/draft-deconinck-quic-multipath/

Page 27: Pluginizing QUIC - IIJ Innovation Institute

Multipath QUIC in Action

GET request over a dedicated stream

● Consider 2-path network with symmetric characteristics

27

Aggregate both paths!Equivalent to MPTCP!

Page 28: Pluginizing QUIC - IIJ Innovation Institute

Combining Plugins into a Multipath QUIC VPN

28

QUIC Connection

MultipathPlugin

DatagramPlugin

Page 29: Pluginizing QUIC - IIJ Innovation Institute

Combining Plugins into a Multipath QUIC VPN

29

V VQUIC Connection

MultipathPlugin

DatagramPlugin

Page 30: Pluginizing QUIC - IIJ Innovation Institute

Combining Plugins into a Multipath QUIC VPN

30

V VQUIC Connection

MultipathPlugin

DatagramPlugin

+

Page 31: Pluginizing QUIC - IIJ Innovation Institute

Multipath QUIC VPN in Action

32

Compare download time for a single file transfer using TCPCubic

● 2 symmetric network paths

VPN enables TCP to use both paths!

Page 32: Pluginizing QUIC - IIJ Innovation Institute

Agenda

● Motivations● Pluginized QUIC Design● Evaluating PQUIC with Use Cases● Conclusion and Future Works

33

Page 33: Pluginizing QUIC - IIJ Innovation Institute

Conclusion and Future Works

● PQUIC: Dynamically extends protocol implementations● Common pluginizable client, specialized server implementation

○ Possible through secure plugin exchange

● Four different use-cases fully implemented with plugins○ Monitoring, VPN, Multipath, Forward Erasure Correction

● Future works○ Approach applicable to many other protocols○ How can we have independent, interoperable PQUIC implementations?

■ Specification of the VM, protocol operations, API,...

34

0101110010

https://pquic.org

Page 34: Pluginizing QUIC - IIJ Innovation Institute

Thanks for your attention!

35

https://pquic.org

Page 35: Pluginizing QUIC - IIJ Innovation Institute

● Coarse protocol tuning○ Global parameters (sysctl,...)○ Very specific socket options

● Extension deployment challenges○ Specification process (IETF)○ Implementation puzzle

■ Client waits for server support■ Server waits for client support

○ Middlebox interferences

Extending/Customizing TCP Is Hard

● TCP Option Negotiation

36

SYN [SACK, WSCALE, TSTAMP]

SYN/ACK [SACK, WSCALE]

Page 36: Pluginizing QUIC - IIJ Innovation Institute

Processing New STAT frames

37

Frame Fields (ex. used for RTT estimation)STATType of the frame

=Parameter to a generic protocol operation

int process_frame(args) {

for each frame {

ret = process_frame_param(frame.type, args);

// Some processing

}

return val;

}

int process_stat_frame(args) {

}

PRE

POST

REPLACE

VM// Code processing STAT

return ret;

Page 37: Pluginizing QUIC - IIJ Innovation Institute

Trusting Plugins

38

Client Server

Verifier A Verifier B Verifier C

...Plugin

Repository

Developer

Publish Check own bindings

Lookup for proofPull and build Merkel Tree

Ask plugin and proof from B

Give plugin and B authentication path

Page 38: Pluginizing QUIC - IIJ Innovation Institute

Proof of Consistency

39

H(‘multipath’) = ‘010’011010...

h010 = H(‘multipath’||multipath bytecode)

h01 = H(h010 || h011)

0101110010

0 1

...h011

h0 = H(h00 || h01)

Root = H(h0 || h1)

...h00

0 1

0 1

...h1

Provided Authentication

PathRecomputed

Compare with stored verifier Root

Page 39: Pluginizing QUIC - IIJ Innovation Institute

Plugin Overhead

40

10 Gbps

Plugin Mean GoodputPQUIC, no plugin 1104 Mbps

Monitoring 1037 Mbps

Multipath 1 path 757 Mbps

Monitoring + Multipath 1 path 714 Mbps

Intel Xeon E5-2640 v3

JITed eBPF ~2x slower than native codeGet/set interface ~5x slower than direct access

-7% goodput+8% CPU instructions

Page 40: Pluginizing QUIC - IIJ Innovation Institute

Verifying the Termination of Plugins with T2

41

Plugin Lines of C Code # Bytecodes Proven terminating

Monitoring 500 14 13

VPN 500 11 8

Multipath 2600 32 29

FEC 2500 51 37