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

The Remarkable Journey Of A Single Web Request

Aaron Kalin
September 19, 2015

The Remarkable Journey Of A Single Web Request

How far would you have to travel to deliver just one request to a server when you type in their web address? Have you wondered why the web address you typed in takes a little time to load up that cute cat video? We’ll explore the journey a single request takes from the browser address bar, to the server, and back. You’ll see just how many services, protocols, and systems are involved in delivering those oh so cute cat videos to your browser each day.

Aaron Kalin

September 19, 2015
Tweet

More Decks by Aaron Kalin

Other Decks in Technology

Transcript

  1. # DNS $ Internet " Server ! Browser % Router

    rubygems.org. A IN Local Cache
  2. # DNS $ Internet " Server ! Browser % Router

    rubygems.org. A IN Local Cache
  3. # DNS $ Internet " Server ! Browser $ ISP

    % Router rubygems.org. A IN Local Cache
  4. # DNS $ Internet " Server ! Browser $ ISP

    % Router rubygems.org. A IN Local Cache
  5. # DNS $ Internet " Server ! Browser $ ISP

    % Router rubygems.org. A IN Local Cache Registry
  6. # DNS $ Internet " Server ! Browser $ ISP

    % Router rubygems.org. A IN Local Cache Registry
  7. # DNS $ Internet " Server ! Browser $ ISP

    % Router & Registrar rubygems.org. A IN Local Cache Registry
  8. # DNS $ Internet " Server ! Browser $ ISP

    % Router & Registrar rubygems.org. A IN Local Cache Registry
  9. # DNS $ Internet " Server ! Browser $ ISP

    % Router & Registrar rubygems.org. A IN Local Cache Registry Nameserver
  10. # DNS $ Internet " Server ! Browser $ ISP

    % Router & Registrar rubygems.org. A IN Local Cache Registry Nameserver
  11. # DNS $ Internet " Server ! Browser $ ISP

    % Router & Registrar Local Cache Registry Nameserver
  12. # DNS $ Internet " Server ! Browser rubygems.org. 3600

    IN A 54.186.104.15 $ ISP % Router & Registrar Local Cache Registry Nameserver
  13. # DNS $ Internet " Server ! Browser rubygems.org. (Query)

    3600 (TTL) IN (Class) A (Record) 54.186.104.15 (Value)
  14. # DNS $ Internet " Server ! Browser Speed! No

    “guarantee” of delivery User Datagram Protocol
  15. # DNS $ Internet " Server ! Browser Speed! No

    “guarantee” of delivery Commonly used in video games and DNS queries User Datagram Protocol
  16. # DNS $ Internet " Server ! Browser Transmission Control

    Protocol Slower than UDP “Handshake” overhead
  17. # DNS $ Internet " Server ! Browser Transmission Control

    Protocol Slower than UDP “Handshake” overhead Uses “Flow Control” to guarantee delivery
  18. # DNS $ Internet " Server ! Browser 54.186.104.15 )

    Computer % Router Open a socket
  19. # DNS $ Internet " Server ! Browser 54.186.104.15 )

    Computer % Router Open a socket
  20. # DNS $ Internet " Server ! Browser Border Gateway

    Protocol Lets ISPs share their network routes
  21. # DNS $ Internet " Server ! Browser Border Gateway

    Protocol Lets ISPs share their network routes Lets the router figure out the next destination to hand off the packet
  22. # DNS $ Internet " Server ! Browser % Router

    % Router 54.186.104.0/24 54.186.104.15
  23. # DNS $ Internet " Server ! Browser % Router

    % Router 54.186.104.0/24 54.186.104.15 54.186.104.0 - 54.186.104.255
  24. # DNS $ Internet " Server ! Browser % Router

    % Router 54.186.104.15 54.186.104.0 - 54.186.104.255
  25. # DNS $ Internet " Server ! Browser % Router

    % Router 54.186.104.15 54.186.104.0 - 54.186.104.255
  26. # DNS $ Internet " Server ! Browser % Router

    % Router 54.186.104.15 54.186.104.0 - 54.186.104.255 Server
  27. # DNS $ Internet " Server ! Browser ) Computer

    ( ( $ Internet GET / HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US Connection: keep-alive DNT: 1 Server
  28. # DNS $ Internet " Server ! Browser GET /

    HTTP/1.1 Request & Request Headers
  29. # DNS $ Internet " Server ! Browser GET /

    HTTP/1.1 Accept: text/html Request & Request Headers
  30. # DNS $ Internet " Server ! Browser GET /

    HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Request & Request Headers
  31. # DNS $ Internet " Server ! Browser GET /

    HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US Request & Request Headers
  32. # DNS $ Internet " Server ! Browser GET /

    HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US Connection: keep-alive Request & Request Headers
  33. # DNS $ Internet " Server ! Browser GET /

    HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US Connection: keep-alive Host: rubygems.org Request & Request Headers
  34. # DNS $ Internet " Server ! Browser GET /

    HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US Connection: keep-alive Host: rubygems.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 Request & Request Headers
  35. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Response & Response Headers
  36. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Server: nginx Response & Response Headers
  37. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Server: nginx Date: Thu, 07 Aug 2014 05:00:03 GMT Response & Response Headers
  38. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Server: nginx Date: Thu, 07 Aug 2014 05:00:03 GMT Content-Type: text/html; charset=utf-8 Response & Response Headers
  39. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Server: nginx Date: Thu, 07 Aug 2014 05:00:03 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Response & Response Headers
  40. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Server: nginx Date: Thu, 07 Aug 2014 05:00:03 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: close Response & Response Headers
  41. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Server: nginx Date: Thu, 07 Aug 2014 05:00:03 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: close Status: 200 OK Response & Response Headers
  42. # DNS $ Internet " Server ! Browser HTTP/1.1 200

    OK Server: nginx Date: Thu, 07 Aug 2014 05:00:03 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: close Status: 200 OK Strict-Transport-Security: max-age=631138519 Response & Response Headers
  43. # DNS $ Internet " Server ! Browser Rinse &

    Repeat Download the HTML document and begin parsing for information
  44. # DNS $ Internet " Server ! Browser Rinse &

    Repeat Download the HTML document and begin parsing for information Create new connections (or use existing) to keep fetching stylesheets, javascript, images, video, music, etc.
  45. Resources & Credits TCP/IP Illustrated Volume 1 http://amzn.to/X3vOag Color Palette

    http://goo.gl/iOuuP9 Like my driving? http://bit.do/packet-adventure-rate Icons FontAwesome *