@thisNatasha
Down the Line:
evolving HTTP and making things QUIC
Natasha Rooney
on version negotiation,
end-point capabilties,
and successful TLS
handshake.”
@thisNatasha
2 Things
@thisNatasha
Web
HTTP
TLS
TCP
IP
@thisNatasha
Protocols:
a set of instructions
@thisNatasha
@thisNatasha
Some fundamental
limitations
@thisNatasha
300,000,000 m/s
@thisNatasha
300,000,000 m/s
Speed of Light
@thisNatasha
300km, 1ms
@thisNatasha
10ms
@thisNatasha
10ms
5G
@thisNatasha
Only one way!
And as the crow flies...
@thisNatasha@thisNatasha
Hops
@thisNatasha
Not good enough!
@thisNatasha
CDNs, Edge
@thisNatasha
Mobile Network (not wifi) The Internet
@thisNatasha@thisNatasha
Distance
Capped by Speed of Light
@thisNatasha
@thisNatasha
@thisNatasha
@thisNatasha@thisNatasha
Distance
Capped by Speed of Light
Amount of Data
>100 objects per page
800k to 2.5mb data
>50 resources on same domain
@thisNatasha
HTTP/1
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
Request
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
Request
Response
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
Request
Response
Request
@thisNatasha
@thisNatasha
@thisNatasha
Urgh...
@thisNatasha@thisNatasha
Spriting
@thisNatasha@thisNatasha
Inlining
@thisNatasha@thisNatasha
Min
@thisNatasha
@thisNatasha
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
Request
Response
@thisNatasha
Home
Roads
Supermarket
@thisNatasha
Home
Roads
Supermarket
@thisNatasha
Jana Iyengar LinuxConfAU2018
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
TCP Setup
TLS Setup
HTTP Request/Response
@thisNatasha
@thisNatasha
Wasting bytes,
wasting time.
TCP setup, HTTP and TCP headers, waiting on HTTP response
before sending again, not fit for today’s internet!
@thisNatasha
HTTP/2
@thisNatasha
SPDY
@thisNatasha
Home
Roads
Supermarket
@thisNatasha
Home
Roads
Supermarket
@thisNatasha@thisNatasha
SPDY
A Protocol by Google
2009
Header Compression
Parallel Connections
Multiplexing
Priority Marking
Server Push
TLS (to work)
@thisNatasha
@thisNatasha
@thisNatasha
@thisNatasha
@thisNatasha
HTTP/2
@thisNatasha
“Idea was to maintain HTTP
semantics but change how it
is transported.”
Daniel Stenberg
https://daniel.haxx.se/blog/
@thisNatasha
Home
Roads
Supermarket
@thisNatasha
HTTP/2
TLS
TCP
IP
HTTP/2
TLS
TCP
Request
Response
Request
Request
@thisNatasha@thisNatasha
HTTP2
A Protocol by IETF
(SDPY base)
Binary
Header Compression
Multiplexing
Server Push
TLS...
@thisNatasha@thisNatasha
HTTP2
A Protocol by IETF
(SDPY base)
@thisNatasha
@thisNatasha@thisNatasha
Stats
Gimme gimme
35% Requests
70% HTTPS Connections
13% Top 1,000,000 Sites
29% Top 1000 Sites
“90% your site”
@thisNatasha
2% packet loss
HTTP1 is better.
@thisNatasha
Mobile Network (not wifi) The Internet
@thisNatasha
Head of Line Blocking
Problem for HTTP and TCP
@thisNatasha
Web
HTTP
TLS
TCP
IP
@thisNatasha
TCP: In order, reliable protocol.
Image Source: http://ariecazz.blogspot.com/2015/02/protokol-tcp-dan-udp.html
@thisNatasha
Home
Roads
Supermarket
@thisNatasha
HTTP/2
TLS
TCP
IP
HTTP/2
TLS
TCP
@thisNatasha
HTTP/2
TLS
TCP
IP
HTTP/2
TLS
TCP
@thisNatasha
Web
HTTP
TLS
TCP
IP
@thisNatasha
QUIC
@thisNatasha
QUIC
@thisNatasha
3
@thisNatasha@thisNatasha
QUIC
3 goals
Evolution
Performance
Safety
@thisNatasha@thisNatasha
QUIC
3 goals
Evolution
Performance
Safety
@thisNatasha
“We want QUIC to work on
today’s internet”
Jana Iyengar
QUIC Editor, Fastly
@thisNatasha
Ossification
@thisNatasha
Ossification
@thisNatasha
@thisNatasha@thisNatasha
TCP
Suffers from
Head of Line Blocking
UDP
Can work...with help.
Transport Layer
@thisNatasha
TCP: In order, reliable protocol.
Image Source: http://ariecazz.blogspot.com/2015/02/protokol-tcp-dan-udp.html
@thisNatasha
UDP is not a
transport.
UDP is a way to build a transport -
it has no function alone.
@thisNatasha@thisNatasha
3 goals
Evolution
Performance
Safety
@thisNatasha@thisNatasha
TCP
Suffers from
Head of Line Blocking
UDP
Can work...with help.
Transport Layer
@thisNatasha
HTTP/2
TLS 1.2+
TCP
IP
Application
QUIC
UDP
Google CryptoCongestion
Control
@thisNatasha@thisNatasha
QUIC
A Protocol by Google
Goo
@thisNatasha
HTTP/2
TLS 1.2+
TCP
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
@thisNatasha
Streams.
Worked in HTTP2!
@thisNatasha
HTTP/2
QUIC
TLS 1.3
HTTP/2
QUIC
TLS 1.3
TCP Connection
UDP Connection
@thisNatasha
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
HTTP over QUIC
QUIC
UDP
TLS 1.3
@thisNatasha
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
HTTP over QUIC
QUIC
UDP
TLS 1.3
@thisNatasha
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
HTTP over QUIC
QUIC
UDP
TLS 1.3
@thisNatasha
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
HTTP over QUIC
QUIC
UDP
TLS 1.3
Head
of
Line
Blocking!
Multiplexing!
✓
@thisNatasha
Connection
establishment.
Lots of RTTs.
Especially when we encrypt.
@thisNatasha
Round Trips are Evil
Killer for Connection Establishment
@thisNatasha
Urgh...
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
TCP Setup
TLS Setup
HTTP Request/Response
@thisNatasha
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
HTTP over QUIC
QUIC
UDP
TLS 1.3
0RTT: Setup + Data
2RTT: If QUIC version
negotiation needed
1RTT: New Crypto Keys
@thisNatasha
Urgh...
@thisNatasha
@thisNatasha
The Internet
can be
unreliable.
Stuff gets lost.
Networks get blocked.
@thisNatasha
Loss Detection
Congestion
control
OH
NO!
@thisNatasha
ACK Based
- Estimate RTT
- Retransmit when ACK not
received after RTT estimate
threshold
Timer Based
- Aggressive CRYPTO
retransmission
- Tail Loss Probe
- Retransmission timer
Loss Detection
@thisNatasha
TCP-like
(plus ECN)
Congestion Control
@thisNatasha
Slow Start Congestion Avoidance
@thisNatasha
TCP Sawtooth
@thisNatasha@thisNatasha
QUIC
3 goals
Evolution
Performance
Safety
@thisNatasha
HTTP/2
TLS 1.2+
TCP
IP
Application
QUIC
UDP
Google CryptoCongestion
Control
@thisNatasha
HTTP/2
TLS 1.2+
TCP
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
@thisNatasha
Standardised
Researched
0RTT
Why TLS 1.3?
@thisNatasha
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
HTTP over QUIC
QUIC
UDP
TLS 1.3
0RTT: Setup + Data
2RTT: If QUIC version
negotiation needed
1RTT: New Crypto Keys
@thisNatasha
Co-Dependant
Protocols
QUIC
TLS 1.3
@thisNatasha
TLS QuicCo-Dependant
Protocols
QUIC
TLS 1.3
Handshake
Send/Receive
messages
Validate
Version
Reliability
Ordered
Delivery
Record Layer
@thisNatasha
Handshake Flow
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
Key Exchange
Authentication Algorithm Strength Mode
Cipher MAC or PRF
TLS/HandshakeCheatSheet Key Exchange Method: creates the pre master secret.
Premaster secret is combined with PRF to create master
secret
RSA, DHE_RSA,
ECDHE_RSA,
ECDHE_ECDSA
Authentication Method: Uses public key crypto and
certificates public key together. Once certificate is
validated the client can used public key.
RSA or ECDSA
Certs: X.509, ASN.1
DER encoding.
Server
Hello,
Certificate
- Server selects cipher & compression
method
- Server send certificate
- Client authenticates
Key Exchange Pre-master secret exchanged between
client & server, client validates certificate
Master
Secret
Client & Server can compute Master Secret.
MAC Server verifies MAC, returns to client to
verify also.
Finished Handshake complete.
Client Hello Client sends TLS Version, Ciphersuites,
Compression methods
Ciphers, Standards and Terms
Encryption
3DES, AES, ARIA,
CAMELLIA, RC4, and
SEED
[1] Steam: adds MAC [2]
Block: adds IV and
padding after encryption
[3] Encryption (AEAD):
encryption and integrity
validation, using nonce,
no padding, no IV.
Master Secret
Pre-master secret:
combines params to
help client and server
create master secret.
Master Secret: both
server and client create
this from pre-master
secret to symmetrically
encrypt
Integrity Validation
PRF: Pseudorandom
Function. Takes a
secret, a seed, and a
unique label. TLS1.2
suites use PRF based
on HMAC and SHA256
MAC: used for integrity
validation in handshake
and record.
@thisNatasha
QUIC: encrypt everything possible.
Security & Ossification
@thisNatasha
Traffic
Amplification
Address validation
with byte limitation
Spoofing
Path validation
during connection
migration
Passive
Observation
Changing Connection
IDs. Encryption.
Limited data till
sure of encryption
and valid path.
Denial of
Service
Authentication
through encrypted
handshake
Stream
Commitment
Active streams is
limited by the
concurrent stream
limit transport
parameter.
Explicit
Congestion
Notification
Attacks
Ignore duplicate ECN
packets
Downgrade
Three fields that
encode version
information,
included in TLS
handshake also.
Packet
Reflection
Authenticate source
address, strictly
limiting UDP
datagrams in first
flight
Attack Mitigation
@thisNatasha
Status & Stats
@thisNatasha
@thisNatasha
@thisNatasha
@thisNatasha
7% Internet Traffic
35% Google Egress Traffic
@thisNatasha
@thisNatasha
@thisNatasha
Video Rebuffers 15 - 18%
@thisNatasha
Search Latency 3.6 - 8%
@thisNatasha
The Long Tail
@thisNatasha
IP
HTTP over QUIC
QUIC
UDP
TLS 1.3
HTTP over QUIC
QUIC
UDP
TLS 1.3
0RTT: Setup + Data
2RTT: If QUIC version
negotiation needed
1RTT: New Crypto Keys
@thisNatasha
The Long Tail
@thisNatasha
@thisNatasha
@thisNatasha
The Future
@thisNatasha
@thisNatasha@thisNatasha
Quic
What’s next?
Standardised this week?
Spin bit
DNS over QUIC
WebRTC over QUIC
@thisNatasha
How does this affect me?
@thisNatasha
Abstraction
Is a computer scientist’s friend / fiend
@thisNatasha
Layer Violation
@thisNatasha
Web
HTTP
TLS
TCP
IP
@thisNatasha
Co-Dependant
Protocols
QUIC
TLS 1.3
@thisNatasha@thisNatasha
Some things
If you have to do
something...
Manage your resources
logically
Detect on upgrade header
and adapt
Measure
Remember Physics!
@thisNatasha
Thank-you
People: Martin Thomson, Mark Nottingham, Jana Iyengar,
Mike Bishop, Eric Rescola, Ian Swett
@thisNatasha
Extra Slides
@thisNatasha
@thisNatasha
@thisNatasha
7. Application Data HTTP /
IMAP
6. Data Presentation,
Encryption
SSL / TLS
5. Session and connection
management
-
4. Transport of packets and
streams
TCP / UDP
3. Routing and delivery of
datagrams on the Network
IP / IPSec
2. Local Data Connection Ethernet
1. Physical data connection
(cables)
CAT5
OSI Model
@thisNatasha
Handshake Flow
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
Key Exchange
Authentication Algorithm Strength Mode
Cipher MAC or PRF
TLS/HandshakeCheatSheet Key Exchange Method: creates the pre master secret.
Premaster secret is combined with PRF to create master
secret
RSA, DHE_RSA,
ECDHE_RSA,
ECDHE_ECDSA
Authentication Method: Uses public key crypto and
certificates public key together. Once certificate is
validated the client can used public key.
RSA or ECDSA
Certs: X.509, ASN.1
DER encoding.
Server
Hello,
Certificate
- Server selects cipher & compression
method
- Server send certificate
- Client authenticates
Key Exchange Pre-master secret exchanged between
client & server, client validates certificate
Master
Secret
Client & Server can compute Master Secret.
MAC Server verifies MAC, returns to client to
verify also.
Finished Handshake complete.
Client Hello Client sends TLS Version, Ciphersuites,
Compression methods
Ciphers, Standards and Terms
Encryption
3DES, AES, ARIA,
CAMELLIA, RC4, and
SEED
[1] Steam: adds MAC [2]
Block: adds IV and
padding after encryption
[3] Encryption (AEAD):
encryption and integrity
validation, using nonce,
no padding, no IV.
Master Secret
Pre-master secret:
combines params to
help client and server
create master secret.
Master Secret: both
server and client create
this from pre-master
secret to symmetrically
encrypt
Integrity Validation
PRF: Pseudorandom
Function. Takes a
secret, a seed, and a
unique label. TLS1.2
suites use PRF based
on HMAC and SHA256
MAC: used for integrity
validation in handshake
and record.
@thisNatasha
[1] Client Hello
Cli-ant Ser-ver
Server Hello [2]
Certificate [3]
Server Key Exchange [4]
Server Hello Done [5]
[6] Client Key Exchange
[7] (Change Cipher Spec)
[8] Finished
(Change Cipher Spec) [9]
Finished [10]
TLS Handshake
@thisNatasha
Cli-ant Ser-ver
TCP and TLS with Session Tickets
TCP Fast Open Handshake
[1] Client Hello
Server Hello [2]
(Change Cipher Spec) [3]
Finished [4]
[5] (Change Cipher Spec)
[6] Finished
@thisNatasha
TLS Encryption Levels
● CRYPTO frames MAY appear in packets of any encryption level except 0-RTT.
● CONNECTION_CLOSE MAY appear in packets of any encryption level other than 0-RTT.
● APPLICATION_CLOSE MAY appear in packets of any encryption level other than Initial and 0-RTT.
● PADDING frames MAY appear in packets of any encryption level.
● ACK frames MAY appear in packets of any encryption level other than 0-RTT, but can only acknowledge
packets which appeared in that packet number space.
● STREAM frames MUST ONLY appear in the 0-RTT and 1-RTT levels.
● All other frame types MUST only appear at the 1-RTT levels.
@thisNatasha
Cryptographic handshake
● authenticated key exchange, where
○ a server is always authenticated,
○ a client is optionally authenticated,
○ every connection produces distinct and unrelated keys,
○ keying material is usable for packet protection for both 0-RTT and 1-RTT packets, and
○ 1-RTT keys have forward secrecy
●
● authenticated values for the transport parameters of the peer (see Section 7.3)
● authenticated confirmation of version negotiation (see Section 7.3.3)
● authenticated negotiation of an application protocol (TLS uses ALPN [RFC7301]for this purpose)
@thisNatasha
HTTP/1
TLS
TCP
IP
HTTP/1
TLS
TCP
Request
Response
@thisNatasha
@thisNatasha
Transport Overhead

Evolving HTTP and making things QUIC