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

Evolution of HTTP

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Buzzvil Buzzvil
February 20, 2019
570

Evolution of HTTP

Avatar for Buzzvil

Buzzvil

February 20, 2019
Tweet

Transcript

  1. Once Upon a Time TCP/IP Protocol Server Client URI HTML

    URI: Uniform Resource Identifier HTML: HyperText Markup Language
  2. Once Upon a Time TCP/IP Protocol Server Client URI HTML

    HTTP URI: Uniform Resource Identifier HTML: Hypertext Markup Language HTTP: Hypertext Transfer Protocol
  3. Once Upon a Time TCP/IP Protocol Server Client URI HTML

    HTTP Sir Tim Berners-Lee the father of the World Wide Web URI: Uniform Resource Identifier HTML: Hypertext Markup Language HTTP: Hypertext Transfer Protocol
  4. HTTP/0.9 (1991) • The initial version of HTTP • Use

    80 port • No version number (later been called 0.9) • Only one method (GET) • No HTTP headers / No error code • Response only contains the HTML file
  5. HTTP/0.9 (1991) • The initial version of HTTP • Use

    80 port • No version number (later been called 0.9) • Only one method (GET) • No HTTP headers / No error code • Response only contains the HTML file
  6. HTTP/0.9 (1991) • The initial version of HTTP • Use

    80 port • No version number (later been called 0.9) • Only one method (GET) • No HTTP headers / No error code • Response only contains the HTML file
  7. HTTP/1.0 (1996) • Version information is now sent • Status

    code, HTTP headers, new methods (POST, HEAD) have been introduced
  8. HTTP/1.0 (1996) • Version information is now sent • Status

    code, HTTP headers, new methods (POST, HEAD) have been introduced
  9. HTTP/1.0 (1996) • Version information is now sent • Status

    code, HTTP headers, new methods (POST, HEAD) have been introduced
  10. HTTP/1.1 (1997) • The first standard • Still in common

    use • Performance optimizations • A persistent connection (keep-alive) • Chunked responses • compression • Cache control • Feature enhancement • Content negotiation (lang, encoding..) • Server collocation (Host header) • New methods • PUT, DELETE, TRACE, OPTIONS
  11. HTTP/1.1 (1997) • The first standard • Still in common

    use • Performance optimizations • A persistent connection (keep-alive) • Chunked responses • compression • Cache control • Feature enhancement • Content negotiation (lang, encoding..) • Server collocation (Host header) • New methods • PUT, DELETE, TRACE, OPTIONS
  12. Thanks to Keep-Alive header • Pipelining • Send successive request

    without waiting for the answer over persistent connection • Idempotent methods only (GET, HEAD, PUT, DELETE) • Multiple Connections • Open multiple connections to same host to speed up retrieval of large numbers of objects • Maximum 6 connection for one origin to avoid DoS
  13. HTTP/1.1 is Slow • Latency sensitive • Head-of-line blocking •

    Repetitive and redundant Http request headers • Security makes slower
  14. Security is too Slow • HTTPS (HTTP over SSL, HTTP

    over TLS, HTTP Secure) • Use 443 port TCP/IP HTTP Server Client
  15. Security is too Slow • HTTPS (HTTP over SSL, HTTP

    over TLS, HTTP Secure) • Use 443 port TCP/IP TLS Server Client HTTP
  16. Inlining - Data URI Scheme • Write the image resource

    in Base64 encoded string to reduce # of request
  17. Domain Sharding • Web browser allows several parallel connections for

    one domain • Split resources over several domains
  18. HTTP/2 (2015) • A protocol for low-latency transport of content

    over the World Wide Web • Changes • Textual protocols à binary protocols • Head-of-line blocking à multiplexed and prioritized streams • Concurrent multiple TCP connections à one TCP connection • Redundant HTTP Headers -> Header compression with HPACK • Security -> All browers support HTTP/2 only on TLS • Server Push
  19. Based on the Experimental SPDY Protocol • SPDY: A deprecated

    network protocol developed at for transporting web content TCP/IP TLS HTTP/1.1 TCP/IP TLS SPDY HTTP HTTP/1.1 Stack SPDY Stack TCP/IP TLS HTTP/2 HTTP/2 Stack
  20. Multiplexed and Prioritized Streams on single TCP con. • Frames

    can be interleaved • All stream(sequence of frames)s are sent over single TCP connection • Streams have dependencies and weights to calculate the priorities • DATA frames are subject to per-stream and connection flow control
  21. HTTP/2 and TLS • TLS is optional, but major implementations

    are force TLS • Mozilla Firefox and Google Chrome • Why? • To protect user’s privacy • To avoid the tyranny of the middleboxes • They are upgraded much slower than edges TCP/IP TLS HTTP/2 HTTP/2 Stack
  22. TCP is too Old • Introduced in 1974 (45 years

    old) • Designed to operate in wired network WaveLan (1986) Wi-Fi (1997) become popular 2010~
  23. QUIC • An experimental transport layer network protocol introduced by

    in 2012 • TCP + TLS + HTTP/2 over UDP • Flow Control • Error Control • Congestion Control • In-order delivery per stream
  24. QUIC • An experimental transport layer network protocol introduced by

    in 2012 • TCP + TLS + HTTP/2 over UDP • Flow Control • Error Control • Congestion Control • In-order delivery per stream • To Prevent Ossification (경직화)
  25. QUIC • An experimental transport layer network protocol introduced by

    in 2012 • TCP + TLS + HTTP/2 over UDP • Flow Control • Error Control • Congestion Control • In-order delivery per stream • HTTP • Binary Protocol • Multiplexed Streams • Prioritized Streams • One TCP Connection • Header Compression • HPACK à QPACK • Server Push • To Prevent Ossification (골화)
  26. Why UDP? • Middleboxes allow TCP and UDP only •

    TCP has HOL • To move the transport layer from kernel mode to user mode • make development faster • make adoption and spread faster
  27. Implementations • IETF QUIC • C • AppleQUIC, f5, lsquic,

    ngtcp2, ngx_quic, pandora, picoquic, quant, quicly, Winquic • C++ • ats, lsquic, mozquic, mvfst • ETC • Java: kwik, go: minq, quic-go, rust: quiche, quicr, quinn, TypeScript: QUICker • Google QUIC • goquic, libquic, lsquic, quic-go, stellite, caddyserver • https://github.com/quicwg/base-drafts/wiki/Implementations
  28. HTTP/3 Challenges • 3-7% something of all QUIC attempts fail

    • Clients need fall back algorithms • CPU intensive (2x ~ 3x) • Lack of APIs of TLS library (OpenSSL) • ARQ limitation • Automatic Repeat Request à Forward error correction may help
  29. Summary • HTTP/0.9 • the first version with one method

    GET in ASCII over TCP • HTTP/1.0 • Many extensions are adopted • One request per one connection • HTTP/1.1 • The first standard version • Persistent connection improved performance, but brought HTTP HOL • Many workarounds have been made over 18 years • HTTP/2 • Binary multiplexed over TCP resolves HTTP HOL ß SPDY • HTTP/3 • Binary over multiplexed QUIC resolve TCP HOL ß QUIC
  30. Advertisement • #dev-news • To share news related to dev,

    IT, tech etc. without interrupting your works
  31. References • https://http2.github.io/faq • http://www.httpvshttps.com/ • https://css-tricks.com/http2-real-world-performance-test-analysis/ • http://americanopeople.tistory.com/115 •

    https://hpbn.co/http1x/#concatenation-and-spriting • https://daniel.haxx.se/http2/ • https://daniel.haxx.se/http3-explained/ • https://developer.mozilla.org/en- US/docs/Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP • https://youtu.be/21eFwbb48sE
  32. References • https://stackoverflow.com/questions/393407/why-http-protocol-is- designed-in-plain-text-way • http://faculty.georgetown.edu/irvinem/theory/Berners-Lee-HTTP- proposal.pdf • http://info.cern.ch/hypertext/WWW/TheProject.html •

    HTTP/1.1: https://tools.ietf.org/html/rfc2068 • HTTP Over TLS: https://tools.ietf.org/html/rfc2818 • https://johngrib.github.io/wiki/why-http-80-https-443/ • https://httparchive.org/reports/state-of-the-web#h2 • https://medium.com/@DarkDrag0nite/how-http-2-reduces-server-cpu- and-bandwidth-10dbb8458feb
  33. References • https://medium.com/platform-engineer/evolution-of-http-69cfe6531ba0 • https://www.popit.kr/%EB%82%98%EB%A7%8C- %EB%AA%A8%EB%A5%B4%EA%B3%A0-%EC%9E%88%EB%8D%98- http2/ • https://cs291.com/slides/2017/14_http2_quic •

    https://learning.linkedin.com/blog/tech-tips/why-encrypting-your- website-is-now-something-you-need-to-do • https://d2.naver.com/helloworld/140351 • https://developers.google.com/web/fundamentals/performance/http2/?h l=ko • https://royal.pingdom.com/http2-new-protocol/
  34. References • https://docs.google.com/presentation/d/1r7QXGYOLCh4fcUq0jDdDwKJW NqWK1o4xMtYpKZCJYjM/present?slide=id.p19 • https://hpbn.co/http1x/ • Jeffrey Erman, et

    al., Towards a SPDY’ier Mobile Web?, 2013 • https://cloudplatform.googleblog.com/2018/06/Introducing-QUIC- support-for-HTTPS-load-balancing.html • https://deview.kr/2016/schedule#session/178 • https://www.youtube.com/watch?v=3c3Rt6QbHDw • https://www.slideshare.net/shigeki_ohtsu/quic-overview • https://daniel.haxx.se/blog/2019/01/21/quic-and-missing-apis/ • New applications above QUIC
  35. References • HTTP/3 is the next coming HTTP version •

    https://blog.erratasec.com/2018/11/some-notes-about-http3.html • https://blog.codavel.com/2018/09/17/quic-vs-tcptls-and-why-quic-is- not-the-next-big-thing • QUIC: in Theory and Practice - Robin Marx | DeltaV 2018 • https://blog.codavel.com/2018/09/17/quic-vs-tcptls-and-why-quic-is- not-the-next-big-thing • https://github.com/quicwg • https://github.com/quicwg/base-drafts/wiki/Implementations