Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HTTP 1990 -2030

HTTP 1990 -2030

The history and future of HTTP.

xiaody

May 07, 2015
Tweet

Other Decks in Programming

Transcript

  1. http/0.9 http/1.x http/2 http/3 Epilogue Timeline 1990 2030 1990 h0.9

    1995 h1.0 1997 h1.1 2009 spdy 2012 h2-0 2015 h2 2025 h3 2 / 38
  2. http/0.9 http/1.x http/2 http/3 Epilogue http/0.9 1990 ▶ "Hello world"

    of the protocol ▶ One line request ▶ `GET` only ▶ No versioning or headers or status codes 3 / 38
  3. http/0.9 http/1.x http/2 http/3 Epilogue Listing 1: http/0.9 request and

    response 1 GET http://info.cern.ch/hypertext/WWW/Protocols/HTTP/AsImplemented.html 2 3 <HEADER> 4 <TITLE>The World Wide Web project</TITLE> 5 <NEXTID N="55"> 6 </HEADER> 7 <BODY> 8 <H1>World Wide Web</H1> 4 / 38
  4. http/0.9 http/1.x http/2 http/3 Epilogue http/0.9+ 1992 ▶ Methods: GET

    HEAD PUT DELETE POST etc. ▶ Headers: accept referer UA x-modify-x ▶ Status Codes: 2xx 3xx 4xx 5xx 5 / 38
  5. http/0.9 http/1.x http/2 http/3 Epilogue http/1.0 1995 HTTP Working Group

    Informational RFC (rfc1945) Includes many ”common usage” in the wild 6 / 38
  6. http/0.9 http/1.x http/2 http/3 Epilogue http/1.1 1996-1997 The standard (rfc2068)

    1. Persistent Connections and Pipelining 2. method: OPTIONS 3. headers: upgrade 4. headers: cache-control, vary 7 / 38
  7. http/0.9 http/1.x http/2 http/3 Epilogue ”For all our tests, a

    pipelined HTTP/1.1 implementation outperformed HTTP/1.0, even when the HTTP/1.0 implementation used multiple connections in parallel, under all network environments tested. The savings were at least a factor of two, and sometimes as much as a factor of ten, in terms of packets transmitted. Elapsed time improvement is less dramatic, and strongly depends on your network connection.” — Network performance effects of HTTP/1.1, CSS1, and PNG; 1997 9 / 38
  8. http/0.9 http/1.x http/2 http/3 Epilogue Figure 4: Growth of web

    page size and number of objects 1995 - 2014 12 / 38
  9. http/0.9 http/1.x http/2 http/3 Epilogue Frontend hacks HTTP requests are

    limited and expensive Figure 5: Browser vendor boffins 13 / 38
  10. http/0.9 http/1.x http/2 http/3 Epilogue The well known best practices

    hacks: ▶ domain sharding ▶ image spriting ▶ resource inlining ▶ css/js concatenation ▶ cookieless domains 16 / 38
  11. http/0.9 http/1.x http/2 http/3 Epilogue http/2 2012 draft0: zero-edit copy

    of spdy/3 2015 published Main targets: ▶ improving its use of TCP ▶ full multiplexing ▶ less latency sensitive ▶ keep all existing interfaces 18 / 38
  12. http/0.9 http/1.x http/2 http/3 Epilogue technical features ▶ A new

    framing layer ▶ Binary ▶ Multiplexed streams over one TCP connection ▶ Priorities and dependencies ▶ Header compression ▶ Server push 19 / 38
  13. http/0.9 http/1.x http/2 http/3 Epilogue 1. frame: The smallest unit

    of communication within an HTTP/2 connection, consisting of a header and a variable-length sequence of octets structured according to the frame type. 2. stream: A bi-directional flow of frames within the HTTP/2 connection. 3. connection: A transport-layer connection between two endpoints. 21 / 38
  14. http/0.9 http/1.x http/2 http/3 Epilogue frame format Similar, but simpler

    than TCP and WebSocket +-----------------------------------------------+ | Length (24) | +---------------+---------------+---------------+ | Type (8) | Flags (8) | +-+-------------+---------------+-------------------------------+ |R| Stream Identifier (31) | +=+=============================================================+ | Frame Payload (0...) ... +---------------------------------------------------------------+ 22 / 38
  15. http/0.9 http/1.x http/2 http/3 Epilogue stream states +--------+ send PP

    | | recv PP ,--------| idle |--------. / | | \ v +--------+ v +----------+ | +----------+ | | | send H / | | ,------| reserved | | recv H | reserved |------. | | (local) | | | (remote) | | | +----------+ v +----------+ | | | +--------+ | | | | recv ES | | send ES | | | send H | ,-------| open |-------. | recv H | | | / | | \ | | | v v +--------+ v v | | +----------+ | +----------+ | | | half | | | half | | | | closed | | send R / | closed | | | | (remote) | | recv R | (local) | | | +----------+ | +----------+ | | | | | | | | send ES / | recv ES / | | | | send R / v send R / | | | | recv R +--------+ recv R | | | send R / `----------->| |<-----------' send R / | | recv R | closed | recv R | `----------------------->| |<----------------------' +--------+ 23 / 38
  16. http/0.9 http/1.x http/2 http/3 Epilogue stream priority and dependencies A

    client can assign a priority for a new stream by including prioritization information in the HEADERS frame that opens the stream. The purpose of prioritization is to allow an endpoint to express how it would prefer its peer allocate resources when managing concurrent streams. Each stream can be given an explicit dependency on another stream. Including a dependency expresses a preference to allocate resources to the identified stream rather than to the dependent stream. 24 / 38
  17. http/0.9 http/1.x http/2 http/3 Epilogue HPACK - Header Compression for

    HTTP/2 HTTP headers are verbose. Compress them. Figure 9: HPACK compression 25 / 38
  18. http/0.9 http/1.x http/2 http/3 Epilogue criticisms ”HTTP/2.0 is not a

    technical masterpiece. It has layering violations, inconsistencies, needless complexity, bad compromises, misses a lot of ripe opportunities, etc. I would flunk students in my (hypothetical) protocol design class if they submitted it.” — HTTP/2.0 - The IETF is Phoning It In; Poul-Henning Kamp 27 / 38
  19. http/0.9 http/1.x http/2 http/3 Epilogue ”Seriously, that’s your argument? Layers

    are not holy untouchable pillars of a global religion and if we’ve crossed into a few gray areas when making http2 it has been in the interest of making a good and effective protocol within the given constraints.” — http2 explained; Daniel Stenberg 28 / 38
  20. http/0.9 http/1.x http/2 http/3 Epilogue encryption Optional by the standard

    But Chrome and Firefox require TLS Let’s Encrypt 29 / 38
  21. http/0.9 http/1.x http/2 http/3 Epilogue is http/2 really faster? Yes

    Figure 11: Google sites load perf on spdy 1 1Chromium blog: Making the web faster with SPDY and HTTP/2 30 / 38
  22. http/0.9 http/1.x http/2 http/3 Epilogue Figure 12: Twitter cocoaspdy raw

    requests 2 2Twitter engineering blog: CocoaSPDY: SPDY for iOS / OS X 31 / 38
  23. http/0.9 http/1.x http/2 http/3 Epilogue undo the old hacks ▶

    domain sharding ▶ image spriting or iconfont ▶ css/js concatenation ▶ resource inlining ▶ cookieless domains 32 / 38
  24. http/0.9 http/1.x http/2 http/3 Epilogue beyond http/2 Get rid of

    TCP: ▶ head-of-line blocking ▶ unfavorable congestion avoidance handling ▶ mobile weakness ▶ TLS delays 33 / 38
  25. http/0.9 http/1.x http/2 http/3 Epilogue http/3 2025 Officially based on

    QUIC 3 ▶ reduced head-of-line blocking ▶ low latency ▶ improved support for mobile ▶ controllable congestion avoidance ▶ privacy assurances ▶ HTTP 1st-party-only cookies & client cookies, etc. 3Quick UDP Internet Connections 34 / 38
  26. http/0.9 http/1.x http/2 http/3 Epilogue By the end of 2030,

    30% HTTP traffic is in HTTP/3 35 / 38
  27. http/0.9 http/1.x http/2 http/3 Epilogue Epilogue The old HTTP is

    dead 4 ▶ its based on TCP QUIC/UDP ▶ its ascii binary ▶ its cleartext encryted ▶ its expensive cheap 4kind like the ship of Theseus 36 / 38
  28. http/0.9 http/1.x http/2 http/3 Epilogue Long live the HTTP: ▶

    methods ▶ headers ▶ status codes ▶ URL ▶ RESTful 37 / 38
  29. http/0.9 http/1.x http/2 http/3 Epilogue Thanks5 [email protected] 5the story after

    2015 is all but fiction (i.e., the http/3 part) 38 / 38