Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web 200: Anatomy of a Request
Search
John Britton
December 09, 2012
Technology
0
160
Web 200: Anatomy of a Request
What happens when you press "Go" in your browser?
John Britton
December 09, 2012
Tweet
Share
More Decks by John Britton
See All by John Britton
Marketing to Developers
johndbritton
8
2k
Stories from the GitHub Classroom: Changing Practice, one Pull Request at a Time
johndbritton
3
600
Ops for Everyone
johndbritton
33
7.8k
GitHub: Distributed, Asynchronous, and Self-directed
johndbritton
4
370
P2PU at Campus Party Mexico 2011
johndbritton
2
240
Other Decks in Technology
See All in Technology
クラウド利用者の「責任」をどう果たす?AWSセキュリティ対策のススメ #AWSSummit
hiashisan
0
270
データベース研修 DB基礎【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
210
エンジニアの生存戦略 〜クラウド潮流の経験から紐解く技術トレンドのメカニズムと乗りこなし方〜
shimy
9
1.9k
シフトレフトで挑む セキュリティの生産性向上
sekido
PRO
0
270
ゆめみのアクセシビリティの現在地と今後
ryokatsuse
3
290
MySQLのロックの種類とその競合
yoku0825
6
1.6k
VPoEの視点から見た、ヘンリーがサーバーサイドKotlinを使う理由 / Why Server-side Kotlin 2024
cho0o0
1
420
頼られるのが大好きな 皆さんへ - 支援相手との期待の合わせ方、突き放し方 -/For_people_who_like_to_be_relied_on
naitosatoshi
1
290
[I/O Extended Android 2024] What`s new in Android 2024
kyeongwan
0
220
ギークの理想が7つ集まるエムスリーで夢を叶えよう - エムスリー株式会社
m3_engineering
1
260
開発と事業を繋ぐ!SREのオブザーバビリティ戦略 ~ Developers Summit 2024 Summer ~
leveragestech
0
620
ここがすごいよ! AWS Systems Manager!
saichan11
0
1.8k
Featured
See All Featured
Scaling GitHub
holman
458
140k
We Have a Design System, Now What?
morganepeng
46
7k
Raft: Consensus for Rubyists
vanstee
134
6.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
25
6.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
16
1.6k
Speed Design
sergeychernyshev
9
270
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.5k
Leading Effective Engineering Teams 2024
addyosmani
3
300
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
Designing Experiences People Love
moore
136
23k
Ruby is Unlike a Banana
tanoku
96
10k
Testing 201, or: Great Expectations
jmmastey
33
6.9k
Transcript
Web 200: Anatomy of a Request @johndbritton
How does this...
[enter]
...become this...
...on the internet?
Internet, how does it work?
• Driving a car • Shipping containers It’s all about
abstraction
Major players • HTTP • URI • Browser • Web
server • DNS • Operating system • Interface • Network • Router ! ! • ... among others
OSI Model • 7 Layers • We won’t cover everything
• Really boring • Required if you want some bogus certificates • Actually a useful concept
HTTP The language browsers speak
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
URI • http://github.com/johndbritton • http - protocol • github.com -
domain • /johndbritton - resource
Request GET /johndbritton
Response <!DOCTYPE html> ...
More Requests GET /style.css GET /jquery.js GET /image.jpg GET /image2.jpg
...
More Responses (you get the idea)
Rendering • HTML - Structure • CSS - Style •
Javascript - Behavior
Telnet, Inspector, JSFiddle Let’s try them out
Browser - ONLY HTTP Doesn’t care about anything else
HTTP: methods / verbs • GET • POST • PUT
• DELETE • more: HEAD, PATCH, TRACE, OPTIONS, CONNECT
HTTP: responses • 1xx - informational • 2xx - success
• 3xx - redirect • 4xx - error • 5xx - server error
The webserver It speaks HTTP too
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
DNS: name resolution Where do requests go?
github.com 207.97.227.239
Lookups are cached for improved performance
Possible cache hits • Local machine • Home router •
ISP • Upstream provider
No cache - worst case • 13 Root nameservers •
TLD nameserver • Authoritative nameserver • A record • IP address
dig github.com ; <<>> DiG 9.8.3-P1 <<>> github.com ... github.com.
2 IN A 207.97.227.239
Making a connection • Resolve name • Open a connection
• Speak HTTP
Network collection of nodes that can communicate directly
Interface connection from node to communication medium
IP address 0.0.0.0 - 255.255.255.255
Why 255? • 0 - 255 • binary, 8 bits
• 00000000 - 11111111 • 00000000.00000000.00000000.00000000 • 11111111.11111111.11111111.11111111
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
Special addresses • 192.268.1.0/24 - network with subnet • 192.168.1.0
- network address • 192.168.1.255 - broadcast address
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
Network hardware • Hub - Dumb • Switch - Smarter
• Router - Smartest
Network protocols • Transport - chunks of data • TCP
• UDP • Routing - • RIP • OSPF
Transport • OS segments data, packages it up into packets
• TCP • Reliable - resend on transmission failure • UDP • Unreliable - send once
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)
whatismyipaddress.com 166.137.88.161 github.com 207.97.227.239
NAT Network address translation
ifconfig 192.168.1.101 whatismyipaddress.com 166.137.88.161 github.com 207.97.227.239
traceroute, nmap, wireshark if we have time