Quick primer on http2

18
Quick primer on http2 Cyrus Dasadia @ExtremeUnix

Transcript of Quick primer on http2

Quick primer on http2

Cyrus Dasadia @ExtremeUnix

HTTP 1.1 est. 1999

- Piggybacks on TCP

- No efficient reusability

- Head-of-line blocking Problem

Enter HTTP/2 (httpbis)- Started off from SPDY/3 draft

- HTTPbis working on draft-17

- Will not have any minor versions

- No change in http(s) URI pattern

How does it look?

Handshake

How does it look?

It’s all binary, love.

Seriously, how does it look?

Frames:

image: tools.ietf.org/html/draft-ietf-httpbis-http2-17

FramesBasic protocol unit of HTTP/2 is Frame● HEADERS● DATA● SETTINGS● PUSH_PROMISE● GOAWAY● ...few more

Header Frames- Request Pseudo-headers :method, :scheme, :

authority, :path

- Response Pseudo-headers :status

- Cookie header field uses semicolon “;”

- Header compression (HPACK)

Header FramesComparing HTTP/1.1 response with HTTP/2:

image: tools.ietf.org/html/draft-ietf-httpbis-http2-17

Streams- One TCP connection to rule them all!

- Concurrent, bi-directional and unilateral

- Streams can be prioritized and re-prioritized

- Stream can have dependency hierarchy

- Flow control avoids interference

Streams

Streams

Simple Prioritization Stream Hierarchy

image: tools.ietf.org/html/draft-ietf-httpbis-http2-17

PUSH_PROMISE

Current state:

- Google, Twitter, are on http2

- Facebook, HN are on SPDY

- cURL, ATS, Nghttp2

- Firefox, Chrome

Will it help me?

- No more than one connection per client

- Connection reusability by multiplexing

- TLS with a reduced hop

Will it help me?DIY http2 CDN?

P.S. Keep an eye out for RFC-7540

Thank you!

References:

http://tools.ietf.org/html/draft-ietf-httpbis-http2-17http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-12http://chimera.labs.oreilly.com/books/1230000000545/ch12.htmlhttp://daniel.haxx.se/http2/https://github.com/http2/http2-spec/wiki/Implementationshttp://tools.ietf.org/rfc/rfc7540http://tools.ietf.org/rfc/rfc7541https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=51810161http://wiki.squid-cache.org/Features/HTTP2http://nginx.com/blog/how-nginx-plans-to-support-http2/https://github.com/tatsuhiro-t/nghttp2