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

Web 200: Anatomy of a Request

John Britton
December 09, 2012

Web 200: Anatomy of a Request

What happens when you press "Go" in your browser?

John Britton

December 09, 2012
Tweet

More Decks by John Britton

Other Decks in Technology

Transcript

  1. Major players • HTTP • URI • Browser • Web

    server • DNS • Operating system • Interface • Network • Router ! ! • ... among others
  2. OSI Model • 7 Layers • We won’t cover everything

    • Really boring • Required if you want some bogus certificates • Actually a useful concept
  3. Client server model • Web page is a document •

    User inputs http://example.com • The client (browser) makes a GET request • The server sends a response • The browser renders the page
  4. HTTP: methods / verbs • GET • POST • PUT

    • DELETE • more: HEAD, PATCH, TRACE, OPTIONS, CONNECT
  5. HTTP: responses • 1xx - informational • 2xx - success

    • 3xx - redirect • 4xx - error • 5xx - server error
  6. Two types of webapp • Static • Receive a request

    • Find a file on disk • Respond with contents of the file • Dynamic • Receive a request • Run application logic • Return a dynamically generated response
  7. No cache - worst case • 13 Root nameservers •

    TLD nameserver • Authoritative nameserver • A record • IP address
  8. Why 255? • 0 - 255 • binary, 8 bits

    • 00000000 - 11111111 • 00000000.00000000.00000000.00000000 • 11111111.11111111.11111111.11111111
  9. Network addresses • a.b.c.d/n (n = network mask / subnet)

    • Private (non routable) networks • 10.0.0.0/8 • 172.16.0.0/12 • 192.168.0.0/16
  10. Special addresses • 192.268.1.0/24 - network with subnet • 192.168.1.0

    - network address • 192.168.1.255 - broadcast address
  11. Network settings • Auto-configured via DHCP • IP: 192.168.1.101 •

    Subnet Mask: 255.255.255.0 (/24) • Router: 192.168.1.1 • DNS Servers: 192.168.1.1
  12. Network protocols • Transport - chunks of data • TCP

    • UDP • Routing - • RIP • OSPF
  13. Transport • OS segments data, packages it up into packets

    • TCP • Reliable - resend on transmission failure • UDP • Unreliable - send once
  14. Routing • Routers connect networks, handle packets and don’t care

    what’s inside • RIP • Distance vector (hop count) • OSPF • Open shortest path first (link weight)