http/2 - for tcp/ip geeks stockholm

42
Daniel Stenberg, May 6 th 2015

Upload: daniel-stenberg

Post on 17-Jul-2015

21.865 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Page 2: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

HTTP Today

HTTP/2 basics

Status

Future

Q&A

Page 3: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Daniel Stenberg

Email: [email protected]: @bagderWeb: daniel.haxx.seBlog: daniel.haxx.se/blog

network hacker at

Page 4: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Please ask!

… just maybe everything isn't crystal clear at once.

Page 5: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Internet Today

HTTP for everythingThe web has changed significantly since 1996

Page 6: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Request and payload growth

in 4 years...

7777

100100

725K725K

1900K1900K

http

arch

ive.

org

Page 7: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Roundtrip Bonanza

Page 8: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

connections per page

38ht

tpar

chiv

e.or

g

Page 9: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Latency adds up

4,000 ms

750 ms

Page load time

Round trip time0 ms 240 ms

Mik

e Be

lshe

Page 10: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Head of line blocking

Page 11: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

HTTP 1.1 workarounds

Page 12: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

SpritingSpriting

Page 13: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Inlining

.icon1 { background: url(data:image/png;base64,<data>) no-repeat;}

.icon2 { background: url(data:image/png;base64,<data>) no-repeat;}

Page 14: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Concatenation

$ cat *.js > single-monster.js

Page 15: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Sharding

Page 16: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Quirky

Annoying for developersAdds layers of toolsHampers cachingDownloads too much

Page 17: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Page 18: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

HTTP/2

Page 19: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

“Just a new framing layer”

maintains HTTP paradigmshttp:// and https:// URLs cannot be changedHTTP/1.1 servers and clients will be around for decadesProxies must be able to convert 1:1Less optional partsNo more minor version!

Page 20: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Binary

•No more telnet tricks•Easier framing•TLS and compression anyway...•Wireshark inspector•A handful set frame types, like HEADERS and DATA

Page 21: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Multiplexed (1/2)

•Multiple streams over a single physical connection•Max number of parallel streams set by peer

Page 22: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Multiplexed (2/2)

Page 23: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Better utilization of bandwidth

Page 24: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Header compression

•HTTP headers are big and are growing•HTTP 1 had no header compression•TCP slow start and initial window size•Headers are notoriously repetitive•Cookies•HPACK•Not a CRIME victim•Padding

Page 25: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Streams

Dynamic priority

Flow controlAA

BB CC

Dependencies

Page 26: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Server push

Give me HTML please!

Here's HTML for you

Here's CSS for you

Page 27: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Stricter TLS

TLS version 1.2+ only

Stricter cipher suite requirements

No renegotiations

Page 28: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

HTTP/2 is not

Mandatory TLSChanging HTTP headers

Page 29: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

How will HTTP/2 affect users?

Faster page loadsMore responsive loadingMore HTTPS

Page 30: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

How will HTTP/2 affect web development?

HTTP/1 work-arounds hurt HTTP/2 perf

Need to do separate tweaks

Optimal HTTP/2 usage will need some time

Page 31: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

ImplementationsNghttp2Http2-katanaNode-http2FirefoxHttp2-perlIij-http2AkamaiChromeOpenLiteSpeed

TwitterWiresharkEricsson MSPHttp2 (Go)Http2-goOkHttpTrusterdHaskell http libSteelApp ADC

Google GFEDeuteriumHyperUndertowF5SasazkaLucidH2OWarp

curlCl-http2NettyJettyMicrosoftHttp-2Protocol::HTTP2mod_h2Nginxwget

https://github.com/http2/http2-spec/wiki/Implementations

Page 32: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Will HTTP/2 get widely deployed?

“Look at IPv6”SPDY proved fast growth can happenMajor browsers are on the trainMany sites already did SPDY - likely to go HTTP/2

Page 33: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Schedule

Firefox 35 – enabled by default January 13th

Chrome 40 – enabled by default January 21st

IESG approved on February 18th

HTTP/2 final RFC in Q2 2015 ?

Page 34: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

HTTP/2 – May 6th 2015

All browser support seen so far only over HTTPS

Firefox: HTTP/2 in 10% of all HTTP responses1

HTTP/2 is used 10 times more than HTTP/1.0

Google: HTTP/2 used in 18% of global traffic2

HTTP/2 is supported by 44% of browsers in use right now

IPv6: 6.6% today, almost 20 years after first RFC3

1. Rough and not statistically sound numbers from Mozilla Telemetry data for Firefox 36.2. Rough and rapidly changing numbers in an evolving climate. Graciously provided by Google.3. https://www.google.com/intl/en/ipv6/statistics.html

Page 35: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Browser support

http://caniuse.com/#feat=http2

Page 36: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

My tealeaves tell me...

http://daniel.haxx.se/blog/2015/03/31/the-state-and-rate-of-http2-adoption/

10% at end of 2015

Page 37: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Future

HTTP/2 lays the foundation for the future

Time to drop legacy HTTP “mistakes”?

HTTP/3 can happen faster

QUIC

The HTTP Workshop (Münster, 27-30 July 2015)

https://httpworkshop.github.io/

Page 38: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Final recap

Binary and multiplexedPrimarily over TLSUsers won't see a 2 anywhereIt's already here

Page 39: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Thank you!

See also http2 explained http://daniel.haxx.se/http2

Page 40: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Doing good is part of our code

Page 41: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

Credits

✗ HTTP and TCP trend numbers from http://httparchive.org

✗ RTT / page load data from Mike Belshe✗ HTTP/2 usage numbers by Google and Firefox Telemetry

✗ Lego pieces borrowed from my kids

Page 42: HTTP/2 - for TCP/IP Geeks Stockholm

Daniel Stenberg, May 6th 2015

License

This presentation and its contents are licensed under the Creative Commons Attribution 4.0 license: http://creativecommons.org/licenses/by/4.0/