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

The Remarkable Journey of a Single Web Request (FullStack)

The Remarkable Journey of a Single Web Request (FullStack)

How far would you have to travel to deliver just one request to a server when you type in their web address? You'll explore the journey a single request takes from the browser address bar, to the server, and back. You’ll discover just how many services, protocols, and systems are involved in delivering those oh so cute cat videos to your browser each day.

Aaron Kalin

October 26, 2015
Tweet

More Decks by Aaron Kalin

Other Decks in Technology

Transcript

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

    bbc.co.uk. A IN Local Cache
  2. ! DNS " Internet # Server $ Browser % Router

    bbc.co.uk. A IN Local Cache
  3. ! DNS " Internet # Server $ Browser " ISP

    % Router bbc.co.uk. A IN Local Cache
  4. ! DNS " Internet # Server $ Browser " ISP

    % Router bbc.co.uk. A IN Local Cache
  5. ! DNS " Internet # Server $ Browser " ISP

    % Router bbc.co.uk. A IN Local Cache Registry
  6. ! DNS " Internet # Server $ Browser " ISP

    % Router bbc.co.uk. A IN Local Cache Registry
  7. ! DNS " Internet # Server $ Browser " ISP

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

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

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

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

    % Router & Registrar Local Cache Registry Nameserver
  12. ! DNS " Internet # Server $ Browser bbc.co.uk. 3600

    IN A 212.58.246.104 " ISP % Router & Registrar Local Cache Registry Nameserver
  13. ! DNS " Internet # Server $ Browser bbc.co.uk. (Query)

    3600 (TTL) IN (Class) A (Record) 212.58.246.104 (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 ( (

    " Internet Server ) Browser
  28. ! DNS " Internet # Server $ Browser ( (

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

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

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

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

    HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US 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 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: bbc.co.uk Request & Request Headers
  35. ! DNS " Internet # Server $ Browser GET /

    HTTP/1.1 Accept: text/html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US Connection: keep-alive Host: bbc.co.uk 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
  36. ! DNS " Internet # Server $ Browser HTTP/1.1 200

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

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

    OK Server: nginx Mon, 26 Oct 2015 08:02:19 GMT Response & Response Headers
  39. ! DNS " Internet # Server $ Browser HTTP/1.1 200

    OK Server: nginx Mon, 26 Oct 2015 08:02:19 GMT Content-Type: text/html; charset=utf-8 Response & Response Headers
  40. ! DNS " Internet # Server $ Browser HTTP/1.1 200

    OK Server: nginx Mon, 26 Oct 2015 08:02:19 GMT Content-Type: text/html; charset=utf-8 Content-Encoding: gzip Response & Response Headers
  41. ! DNS " Internet # Server $ Browser HTTP/1.1 200

    OK Server: nginx Mon, 26 Oct 2015 08:02:19 GMT Content-Type: text/html; charset=utf-8 Content-Encoding: gzip Connection: keep-alive Response & Response Headers
  42. ! DNS " Internet # Server $ Browser HTTP/1.1 200

    OK Server: nginx Mon, 26 Oct 2015 08:02:19 GMT Content-Type: text/html; charset=utf-8 Content-Encoding: gzip Connection: keep-alive Status: 200 OK 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/remarkable-fullstack Icons FontAwesome *