url to html

168
URL to HTML a minute in the life of a webpage François Marier @fmarier mozilla

Upload: francois-marier

Post on 23-Aug-2014

124 views

Category:

Internet


0 download

DESCRIPTION

What happens in between the time you type a URL in your browser and the time you see the fully rendered page.

TRANSCRIPT

Page 1: URL to HTML

URL to HTMLa minute in the life of a webpage

François Marier @fmarier mozilla

Page 2: URL to HTML

mozilla newmarket

Page 3: URL to HTML

8 engineers

Page 4: URL to HTML

8 engineers

1 designer

Page 5: URL to HTML

8 engineers

1 designer

1 manager

Page 6: URL to HTML

video & mediamarketplacecloud servicescrash investigation

Page 7: URL to HTML

video & mediamarketplacecloud servicescrash investigation

Page 8: URL to HTML

video & mediamarketplacecloud servicescrash investigation

Page 9: URL to HTML

video & mediamarketplacecloud servicescrash investigation

Page 10: URL to HTML

> 1,000 employees world-wide

Page 11: URL to HTML

</ >

Page 12: URL to HTML
Page 13: URL to HTML

1. Learn HTML

2. ?

3. Profit !

Page 14: URL to HTML
Page 15: URL to HTML
Page 16: URL to HTML

abstractions

Page 17: URL to HTML

asbtractionconstruct used to understand acomplicated topic at a high level

Page 18: URL to HTML

asbtractionextra layer added to avoid writingthe same code over and over

Page 19: URL to HTML

drawSquare()

Page 20: URL to HTML

drawLine()

Page 21: URL to HTML

drawLine()

Page 22: URL to HTML

drawLine()

Page 23: URL to HTML

drawLine()

Page 24: URL to HTML
Page 25: URL to HTML

drawSquare()

Page 26: URL to HTML
Page 27: URL to HTML

if you don't understand thelayers below, you won't know whatto do when the abstraction breaks

Page 28: URL to HTML

masteryrequires a high-level understandingof the rest of the stack

Page 29: URL to HTML

web performance

Page 30: URL to HTML

web performancehow bytes make it to the user

Page 31: URL to HTML

web performancehow bytes make it to the userhow the browser renders the page

Page 32: URL to HTML

URL

DNS

IP

TCP

HTTP / TLS

HTML

Page 33: URL to HTML

URL

DNS

IP

TCP

HTTP / TLS

HTML

Page 34: URL to HTML

URLuniform ressource locator

Page 35: URL to HTML

http://www.example.com

Page 36: URL to HTML

http://www.example.com

Page 37: URL to HTML

http://www.example.com/articles/

Page 38: URL to HTML

http://www.example.com /articles/tutorial.cgi

Page 39: URL to HTML

http://www.example.com/articles/tutorial.cgi?showsolutions=0&topic=web

Page 40: URL to HTML

http://www.example.com/articles/tutorial.cgi?showsolutions=0&topic=web#part5

Page 41: URL to HTML

http://www.example.com:80 /articles/tutorial.cgi?showsolutions=0&topic=web#part5

Page 42: URL to HTML

http://username:[email protected]:80 /articles/tutorial.cgi?showsolutions=0&topic=web#part5

Page 43: URL to HTML

DNSdomain name system

Page 44: URL to HTML

$ cat /etc/resolv.conf

nameserver 208.67.222.222nameserver 208.67.220.220

Page 45: URL to HTML
Page 46: URL to HTML

www.cs.auckland.ac.nz

Page 47: URL to HTML

www.cs.auckland.ac.nz

130.216.158.22

Page 48: URL to HTML
Page 49: URL to HTML

$ dig nz NS @199.7.83.42

Page 50: URL to HTML

$ dig nz NS @199.7.83.42

; <<>> DiG 9.8.1-P1 <<>> nz NS @199.7.83.42;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41219;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 7, ADDITIONAL: 12;; WARNING: recursion requested but not available

;; QUESTION SECTION:;nz. IN NS

;; AUTHORITY SECTION:nz. 172800 IN NS ns1.dns.net.nz.nz. 172800 IN NS ns2.dns.net.nz.nz. 172800 IN NS ns3.dns.net.nz.nz. 172800 IN NS ns4.dns.net.nz.nz. 172800 IN NS ns5.dns.net.nz.nz. 172800 IN NS ns6.dns.net.nz.nz. 172800 IN NS ns7.dns.net.nz.

;; ADDITIONAL SECTION:ns1.dns.net.nz. 172800 IN A 202.46.190.130ns2.dns.net.nz. 172800 IN A 202.46.187.130ns3.dns.net.nz. 172800 IN A 202.46.188.130ns4.dns.net.nz. 172800 IN A 202.46.189.130ns5.dns.net.nz. 172800 IN A 156.154.100.14ns6.dns.net.nz. 172800 IN A 156.154.101.14ns7.dns.net.nz. 172800 IN A 194.146.106.54ns1.dns.net.nz. 172800 IN AAAA 2001:dce:2000:2::130ns2.dns.net.nz. 172800 IN AAAA 2001:dce:7000:2::130ns5.dns.net.nz. 172800 IN AAAA 2001:502:ad09::14ns6.dns.net.nz. 172800 IN AAAA 2001:502:2eda::14ns7.dns.net.nz. 172800 IN AAAA 2001:67c:1010:13::53

;; Query time: 20 msec;; SERVER: 199.7.83.42#53(199.7.83.42);; WHEN: Thu May 22 15:27:37 2014;; MSG SIZE rcvd: 406

Page 51: URL to HTML

$ dig ac.nz NS @ns1.dns.net.nz

Page 52: URL to HTML

$ dig ac.nz NS @ns1.dns.net.nz

; <<>> DiG 9.8.1-P1 <<>> ac.nz NS @ns1.dns.net.nz;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39124;; flags: qr aa rd; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 12;; WARNING: recursion requested but not available

;; QUESTION SECTION:;ac.nz. IN NS

;; ANSWER SECTION:ac.nz. 86400IN NS ns7.dns.net.nz.ac.nz. 86400IN NS ns4.dns.net.nz.ac.nz. 86400IN NS ns2.dns.net.nz.ac.nz. 86400IN NS ns1.dns.net.nz.ac.nz. 86400IN NS ns6.dns.net.nz.ac.nz. 86400IN NS ns3.dns.net.nz.ac.nz. 86400IN NS ns5.dns.net.nz.

;; ADDITIONAL SECTION:ns1.dns.net.nz. 86400IN A 202.46.190.130ns1.dns.net.nz. 86400IN AAAA 2001:dce:2000:2::130ns2.dns.net.nz. 86400IN A 202.46.187.130ns2.dns.net.nz. 86400IN AAAA 2001:dce:7000:2::130ns3.dns.net.nz. 86400IN A 202.46.188.130ns4.dns.net.nz. 86400IN A 202.46.189.130ns5.dns.net.nz. 86400IN A 156.154.100.14ns5.dns.net.nz. 86400IN AAAA 2001:502:ad09::14ns6.dns.net.nz. 86400IN A 156.154.101.14ns6.dns.net.nz. 86400IN AAAA 2001:502:2eda::14ns7.dns.net.nz. 86400IN A 194.146.106.54ns7.dns.net.nz. 86400IN AAAA 2001:67c:1010:13::53

;; Query time: 14 msec;; SERVER: 202.46.190.130#53(202.46.190.130);; WHEN: Thu May 22 15:29:03 2014;; MSG SIZE rcvd: 409

Page 53: URL to HTML

$ dig auckland.ac.nz NS @ns1.dns.net.nz

Page 54: URL to HTML

$ dig auckland.ac.nz NS @ns1.dns.net.nz

; <<>> DiG 9.8.1-P1 <<>> auckland.ac.nz NS @ns1.dns.net.nz;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59814;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 3, ADDITIONAL: 2;; WARNING: recursion requested but not available

;; QUESTION SECTION:;auckland.ac.nz. IN NS

;; AUTHORITY SECTION:auckland.ac.nz. 86400IN NS pubsec.domainz.net.nz.auckland.ac.nz. 86400IN NS dns1.auckland.ac.nz.auckland.ac.nz. 86400IN NS dns2.auckland.ac.nz.

;; ADDITIONAL SECTION:dns1.auckland.ac.nz.86400IN A 130.216.1.2dns2.auckland.ac.nz.86400IN A 130.216.1.1

;; Query time: 14 msec;; SERVER: 202.46.190.130#53(202.46.190.130);; WHEN: Thu May 22 15:35:28 2014;; MSG SIZE rcvd: 135

Page 55: URL to HTML

$ dig cs.auckland.ac.nz NS @dns1.auckland.ac.nz

Page 56: URL to HTML

$ dig cs.auckland.ac.nz NS @dns1.auckland.ac.nz

; <<>> DiG 9.8.1-P1 <<>> cs.auckland.ac.nz NS @dns1.auckland.ac.nz;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4856;; flags: qr aa rd; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 6;; WARNING: recursion requested but not available

;; QUESTION SECTION:;cs.auckland.ac.nz. IN NS

;; ANSWER SECTION:cs.auckland.ac.nz. 10800 IN NS dns2.auckland.ac.nz.cs.auckland.ac.nz. 10800 IN NS kronos2.cs.auckland.ac.nz.cs.auckland.ac.nz. 10800 IN NS dns1.auckland.ac.nz.cs.auckland.ac.nz. 10800 IN NS kronos1.cs.auckland.ac.nz.

;; ADDITIONAL SECTION:dns1.auckland.ac.nz.1800 IN A 130.216.1.2dns2.auckland.ac.nz.1800 IN A 130.216.1.1kronos1.cs.auckland.ac.nz. 10800 IN A 130.216.35.35kronos1.cs.auckland.ac.nz. 10800 IN AAAA 2001:df0:0:2003::35kronos2.cs.auckland.ac.nz. 10800 IN A 130.216.35.135kronos2.cs.auckland.ac.nz. 10800 IN AAAA 2001:df0:0:2003::135

;; Query time: 2 msec;; SERVER: 130.216.1.2#53(130.216.1.2);; WHEN: Thu May 22 15:37:50 2014;; MSG SIZE rcvd: 237

Page 57: URL to HTML

$ dig www.cs.auckland.ac.nz @kronos1.cs.auckland.ac.nz

Page 58: URL to HTML

$ dig www.cs.auckland.ac.nz @kronos1.cs.auckland.ac.nz

; <<>> DiG 9.8.1-P1 <<>> www.cs.auckland.ac.nz A @kronos1.cs.auckland.ac.nz;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17586;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 6;; WARNING: recursion requested but not available

;; QUESTION SECTION:;www.cs.auckland.ac.nz. IN A

;; ANSWER SECTION:www.cs.auckland.ac.nz. 10800 IN A 130.216.158.22

;; AUTHORITY SECTION:cs.auckland.ac.nz. 10800IN NS kronos2.cs.auckland.ac.nz.cs.auckland.ac.nz. 10800IN NS dns2.auckland.ac.nz.cs.auckland.ac.nz. 10800IN NS dns1.auckland.ac.nz.cs.auckland.ac.nz. 10800IN NS kronos1.cs.auckland.ac.nz.

;; ADDITIONAL SECTION:dns1.auckland.ac.nz.1800 IN A 130.216.1.2dns2.auckland.ac.nz.1800 IN A 130.216.1.1kronos1.cs.auckland.ac.nz. 10800 IN A 130.216.35.35kronos1.cs.auckland.ac.nz. 10800 IN AAAA 2001:df0:0:2003::35kronos2.cs.auckland.ac.nz. 10800 IN A 130.216.35.135kronos2.cs.auckland.ac.nz. 10800 IN AAAA 2001:df0:0:2003::135

;; Query time: 2 msec;; SERVER: 130.216.35.35#53(130.216.35.35);; WHEN: Thu May 22 15:42:38 2014;; MSG SIZE rcvd: 257

Page 59: URL to HTML

l.root-servers.net

ns1.dns.net.nz

ns1.dns.net.nz

dns1.auckland.ac.nz

kronos1.cs.auckland.ac.nz

Page 60: URL to HTML

l.root-servers.net

ns1.dns.net.nz

ns1.dns.net.nz

dns1.auckland.ac.nz

kronos1.cs.auckland.ac.nz

Page 61: URL to HTML

l.root-servers.net

ns1.dns.net.nz

ns1.dns.net.nz

dns1.auckland.ac.nz

kronos1.cs.auckland.ac.nz

Page 62: URL to HTML

l.root-servers.net

ns1.dns.net.nz

ns1.dns.net.nz

dns1.auckland.ac.nz

kronos1.cs.auckland.ac.nz

Page 63: URL to HTML

l.root-servers.net

ns1.dns.net.nz

ns1.dns.net.nz

dns1.auckland.ac.nz

kronos1.cs.auckland.ac.nz

Page 64: URL to HTML

IPinternet protocol

Page 65: URL to HTML

www.bbc.co.uk

212.58.246.94

Page 66: URL to HTML
Page 67: URL to HTML

$ mtr 212.58.246.94

1. 192.168.1.1 2. llu.bng1.tvc.orcon.net.nz 3. xe-3-3-0.cre1.sky.orcon.net.nz 4. 121.98.9.137 5. ae1-0.cre2.nct.odyssey.net.nz 6. ORCON-INTER.bar1.SanFrancisco1.Level3.net 7. xe-5-0-0.bar1.SanFrancisco1.Level3.net 8. ae-0-11.bar2.SanFrancisco1.Level3.net 9. ae-6-6.ebr2.SanJose1.Level3.net10. ae-62-62.csw1.SanJose1.Level3.net11. ae-61-61.ebr1.SanJose1.Level3.net12. ae-2-2.ebr2.NewYork1.Level3.net13. ae-62-62.csw1.NewYork1.Level3.net14. ae-61-61.ebr1.NewYork1.Level3.net15. ae-43-43.ebr2.London1.Level3.net16. ae-57-222.csw2.London1.Level3.net17. ae-229-3605.edge4.London1.Level3.net18. BBC-TECHNOL.edge4.London1.Level3.net19. ???20. ???21. ae0.er01.cwwtf.bbc.co.uk22. 132.185.255.16523. bbc-vip015.cwwtf.bbc.co.uk

Page 68: URL to HTML

$ mtr 212.58.246.94

1. 192.168.1.1 2. llu.bng1.tvc.orcon.net.nz 3. xe-3-3-0.cre1.sky.orcon.net.nz 4. 121.98.9.137 5. ae1-0.cre2.nct.odyssey.net.nz 6. ORCON-INTER.bar1.SanFrancisco1.Level3.net 7. xe-5-0-0.bar1.SanFrancisco1.Level3.net 8. ae-0-11.bar2.SanFrancisco1.Level3.net 9. ae-6-6.ebr2.SanJose1.Level3.net10. ae-62-62.csw1.SanJose1.Level3.net11. ae-61-61.ebr1.SanJose1.Level3.net12. ae-2-2.ebr2.NewYork1.Level3.net13. ae-62-62.csw1.NewYork1.Level3.net14. ae-61-61.ebr1.NewYork1.Level3.net15. ae-43-43.ebr2.London1.Level3.net16. ae-57-222.csw2.London1.Level3.net17. ae-229-3605.edge4.London1.Level3.net18. BBC-TECHNOL.edge4.London1.Level3.net19. ???20. ???21. ae0.er01.cwwtf.bbc.co.uk22. 132.185.255.16523. bbc-vip015.cwwtf.bbc.co.uk

Page 69: URL to HTML

$ mtr 212.58.246.94

1. 192.168.1.1 2. llu.bng1.tvc.orcon.net.nz 3. xe-3-3-0.cre1.sky.orcon.net.nz 4. 121.98.9.137 5. ae1-0.cre2.nct.odyssey.net.nz 6. ORCON-INTER.bar1.SanFrancisco1.Level3.net 7. xe-5-0-0.bar1.SanFrancisco1.Level3.net 8. ae-0-11.bar2.SanFrancisco1.Level3.net 9. ae-6-6.ebr2.SanJose1.Level3.net10. ae-62-62.csw1.SanJose1.Level3.net11. ae-61-61.ebr1.SanJose1.Level3.net12. ae-2-2.ebr2.NewYork1.Level3.net13. ae-62-62.csw1.NewYork1.Level3.net14. ae-61-61.ebr1.NewYork1.Level3.net15. ae-43-43.ebr2.London1.Level3.net16. ae-57-222.csw2.London1.Level3.net17. ae-229-3605.edge4.London1.Level3.net18. BBC-TECHNOL.edge4.London1.Level3.net19. ???20. ???21. ae0.er01.cwwtf.bbc.co.uk22. 132.185.255.16523. bbc-vip015.cwwtf.bbc.co.uk

Page 70: URL to HTML

$ mtr 212.58.246.94

1. 192.168.1.1 2. llu.bng1.tvc.orcon.net.nz 3. xe-3-3-0.cre1.sky.orcon.net.nz 4. 121.98.9.137 5. ae1-0.cre2.nct.odyssey.net.nz 6. ORCON-INTER.bar1.SanFrancisco1.Level3.net 7. xe-5-0-0.bar1.SanFrancisco1.Level3.net 8. ae-0-11.bar2.SanFrancisco1.Level3.net 9. ae-6-6.ebr2.SanJose1.Level3.net10. ae-62-62.csw1.SanJose1.Level3.net11. ae-61-61.ebr1.SanJose1.Level3.net12. ae-2-2.ebr2.NewYork1.Level3.net13. ae-62-62.csw1.NewYork1.Level3.net14. ae-61-61.ebr1.NewYork1.Level3.net15. ae-43-43.ebr2.London1.Level3.net16. ae-57-222.csw2.London1.Level3.net17. ae-229-3605.edge4.London1.Level3.net18. BBC-TECHNOL.edge4.London1.Level3.net19. ???20. ???21. ae0.er01.cwwtf.bbc.co.uk22. 132.185.255.16523. bbc-vip015.cwwtf.bbc.co.uk

Page 71: URL to HTML

$ mtr 212.58.246.94

1. 192.168.1.1 2. llu.bng1.tvc.orcon.net.nz 3. xe-3-3-0.cre1.sky.orcon.net.nz 4. 121.98.9.137 5. ae1-0.cre2.nct.odyssey.net.nz 6. ORCON-INTER.bar1.SanFrancisco1.Level3.net 7. xe-5-0-0.bar1.SanFrancisco1.Level3.net 8. ae-0-11.bar2.SanFrancisco1.Level3.net 9. ae-6-6.ebr2.SanJose1.Level3.net10. ae-62-62.csw1.SanJose1.Level3.net11. ae-61-61.ebr1.SanJose1.Level3.net12. ae-2-2.ebr2.NewYork1.Level3.net13. ae-62-62.csw1.NewYork1.Level3.net14. ae-61-61.ebr1.NewYork1.Level3.net15. ae-43-43.ebr2.London1.Level3.net16. ae-57-222.csw2.London1.Level3.net17. ae-229-3605.edge4.London1.Level3.net18. BBC-TECHNOL.edge4.London1.Level3.net19. ???20. ???21. ae0.er01.cwwtf.bbc.co.uk22. 132.185.255.16523. bbc-vip015.cwwtf.bbc.co.uk

Page 72: URL to HTML

$ mtr 212.58.246.94

1. 192.168.1.1 2. llu.bng1.tvc.orcon.net.nz 3. xe-3-3-0.cre1.sky.orcon.net.nz 4. 121.98.9.137 5. ae1-0.cre2.nct.odyssey.net.nz 6. ORCON-INTER.bar1.SanFrancisco1.Level3.net 7. xe-5-0-0.bar1.SanFrancisco1.Level3.net 8. ae-0-11.bar2.SanFrancisco1.Level3.net 9. ae-6-6.ebr2.SanJose1.Level3.net10. ae-62-62.csw1.SanJose1.Level3.net11. ae-61-61.ebr1.SanJose1.Level3.net12. ae-2-2.ebr2.NewYork1.Level3.net13. ae-62-62.csw1.NewYork1.Level3.net14. ae-61-61.ebr1.NewYork1.Level3.net15. ae-43-43.ebr2.London1.Level3.net16. ae-57-222.csw2.London1.Level3.net17. ae-229-3605.edge4.London1.Level3.net18. BBC-TECHNOL.edge4.London1.Level3.net19. ???20. ???21. ae0.er01.cwwtf.bbc.co.uk22. 132.185.255.16523. bbc-vip015.cwwtf.bbc.co.uk

Page 73: URL to HTML

$ mtr 212.58.246.94

1. 192.168.1.1 2. llu.bng1.tvc.orcon.net.nz 3. xe-3-3-0.cre1.sky.orcon.net.nz 4. 121.98.9.137 5. ae1-0.cre2.nct.odyssey.net.nz 6. ORCON-INTER.bar1.SanFrancisco1.Level3.net 7. xe-5-0-0.bar1.SanFrancisco1.Level3.net 8. ae-0-11.bar2.SanFrancisco1.Level3.net 9. ae-6-6.ebr2.SanJose1.Level3.net10. ae-62-62.csw1.SanJose1.Level3.net11. ae-61-61.ebr1.SanJose1.Level3.net12. ae-2-2.ebr2.NewYork1.Level3.net13. ae-62-62.csw1.NewYork1.Level3.net14. ae-61-61.ebr1.NewYork1.Level3.net15. ae-43-43.ebr2.London1.Level3.net16. ae-57-222.csw2.London1.Level3.net17. ae-229-3605.edge4.London1.Level3.net18. BBC-TECHNOL.edge4.London1.Level3.net19. ???20. ???21. ae0.er01.cwwtf.bbc.co.uk22. 132.185.255.16523. bbc-vip015.cwwtf.bbc.co.uk

Page 74: URL to HTML

130.216.158.22

212.58.246.94

Page 75: URL to HTML

130.216.158.22

212.58.246.94

router drops packetspackets arrive in wrong order

Page 76: URL to HTML

130.216.158.22

212.58.246.94

router drops packets

cable is cutpackets arrive in wrong order

Page 77: URL to HTML

130.216.158.22

212.58.246.94

router drops packets

cable is cut

packets arrive in wrong order

Page 78: URL to HTML

ideal network actual network

Page 79: URL to HTML

TCPtransmission control protocol

Page 80: URL to HTML

guarantees in-orderdelivery of packets

Page 81: URL to HTML

abstraction of a reliable point-to-pointconnection with built-in re-try logic

Page 82: URL to HTML

applications have a lotless errors to deal with

Page 83: URL to HTML

UDPuser datagram protocol

Page 84: URL to HTML
Page 85: URL to HTML

TCP UDP

Page 86: URL to HTML

reminder: abstractions are leaky

Page 87: URL to HTML

3-way handshakeestablishing a new connection

Page 88: URL to HTML

hi

Page 89: URL to HTML

how are you?

Page 90: URL to HTML

good, you?

Page 91: URL to HTML

client server

Page 92: URL to HTML

clientSYNx=42

server

Page 93: URL to HTML

clientSYNx=42

SYN+ACK

y=10,x=43

server

Page 94: URL to HTML

clientSYNx=42

SYN+ACK

y=10,x=43

ACKy=11

server

Page 95: URL to HTML

HTTPhypertext transfer protocol

Page 96: URL to HTML

http://www.example.com

Page 97: URL to HTML

http://www.example.com

Page 98: URL to HTML

clear text protocol

Page 99: URL to HTML

client

request

server

Page 100: URL to HTML

client

request

response

server

Page 101: URL to HTML

Host: www.example.com User-Agent: Mozilla/5.0 (rv:29.0) Firefox/29.0DNT: 1

Page 102: URL to HTML

Host: www.example.com User-Agent: Mozilla/5.0 (rv:29.0) Firefox/29.0DNT: 1

<request body goes in here>

Page 103: URL to HTML

Content-Type: text/htmlDate: Thu, 22 May 2014 05:34:47 GMTLast-Modified: Fri, 09 Aug 2013 23:54:35 GMTContent-Length: 1270

<!doctype html><html><head> <title>Example Domain</title></head><body><div> <h1>Example Domain</h1> <p>This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.</p></div></body></html>

Page 104: URL to HTML

200 OK

Page 105: URL to HTML

404 Not Found

Page 106: URL to HTML
Page 107: URL to HTML

$ curl http://www.example.com

<!doctype html><html><head> <title>Example Domain</title></head>

<body><div> <h1>Example Domain</h1> <p>This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.</p></div></body></html>

Page 108: URL to HTML

$ curl --head http://www.example.com

HTTP/1.1 200 OKAccept-Ranges: bytesCache-Control: max-age=604800Content-Type: text/htmlDate: Thu, 22 May 2014 05:42:26 GMTEtag: "359670651"Expires: Thu, 29 May 2014 05:42:26 GMTLast-Modified: Fri, 09 Aug 2013 23:54:35 GMTServer: ECS (cpm/F858)X-Cache: HITx-ec-custom-error: 1Content-Length: 1270

Page 109: URL to HTML

verbs(fancy word for commands)

Page 110: URL to HTML

GET

Page 111: URL to HTML

POST

Page 112: URL to HTML

GET /article/43228

Page 113: URL to HTML

GET /article/43228GET /article/43228

Page 114: URL to HTML

GET /article/43228

POST /article/delete/last

Page 115: URL to HTML

GET /article/43228

POST /article/delete/lastPOST /article/delete/last

Page 116: URL to HTML

GET /article/43228

POST /item/20/buyPOST /item/20/buy

$$$$$$

Page 117: URL to HTML
Page 118: URL to HTML

TLStransport layer security

Page 119: URL to HTML

SSLsecure sockets layer

Page 120: URL to HTML

HTTPShypertext transfer protocol secure

Page 121: URL to HTML

secure(sometimes)

Page 122: URL to HTML

client server(pk, sk)

Page 123: URL to HTML

clienthello!

server(pk, sk)

Page 124: URL to HTML

clienthello!

hello!pubkey

server(pk, sk)

Page 125: URL to HTML

clienthello!

hello!pubkey

server(pk, sk)

session key

Page 126: URL to HTML

clienthello!

hello!pubkey

i'm done!encryptpk(session key)

server(pk, sk)

session key

Page 127: URL to HTML

clienthello!

hello!pubkey

i'm done!encryptpk(session key)

server(pk, sk)

session key

session key

Page 128: URL to HTML

man-in-the-middle

Page 129: URL to HTML

client server(pk, sk)

Page 130: URL to HTML

client server(pk, sk)

NSA(pk, sk)

Page 131: URL to HTML

clienthello!

server(pk, sk)

NSA(pk, sk)

Page 132: URL to HTML

clienthello!

server(pk, sk)

NSA(pk, sk)

hello!

Page 133: URL to HTML

clienthello!

hello!pubkey

server(pk, sk)

NSA(pk, sk)

hello!

Page 134: URL to HTML

clienthello!

hello!pubkey

server(pk, sk)

NSA(pk, sk)

hello!

hello!pubkey

Page 135: URL to HTML

clienthello!

hello!pubkey

server(pk, sk)

key

NSA(pk, sk)

hello!

hello!pubkey

Page 136: URL to HTML

clienthello!

hello!pubkey

i'm done!encrypt(key)

server(pk, sk)

key

NSA(pk, sk)

hello!

hello!pubkey

Page 137: URL to HTML

clienthello!

hello!pubkey

i'm done!encrypt(key)

server(pk, sk)

key

NSA(pk, sk)

hello!

hello!pubkey

key

Page 138: URL to HTML

clienthello!

hello!pubkey

i'm done!encrypt(key)

server(pk, sk)

key

NSA(pk, sk)

hello!

hello!pubkey

i'm done!encrypt(key)key

Page 139: URL to HTML

clienthello!

hello!pubkey

i'm done!encrypt(key)

server(pk, sk)

key

NSA(pk, sk)

hello!

hello!pubkey

i'm done!encrypt(key)keykey

Page 140: URL to HTML

clienthello!

hello!pubkey

i'm done!encrypt(key)

server(pk, sk)

key

NSA(pk, sk)

hello!

hello!pubkey

i'm done!encrypt(key)keykey

Page 141: URL to HTML

authentication(of the server)

Page 142: URL to HTML

clienthello!

hello!pubkey

server(pk, sk)

session key

Page 143: URL to HTML

clienthello!

hello!

signed pubkey

server(pk, sk)

session key

verifysignature

Page 144: URL to HTML

clienthello!

hello!

signed pubkey

server(pk, sk)

session key

verifysignature

i'm done!encryptpk(session key) session key

Page 145: URL to HTML

clienthello!

hello!signed pubkey

server(pk, sk)

NSA(pk, sk)

hello!

hello!signed pubkeykey

Page 146: URL to HTML

clienthello!

hello!signed pubkey

server(pk, sk)

NSA(pk, sk)

hello!

hello!signed pubkeykey

abort!

Page 147: URL to HTML

how can you tell you'retalking to the right person?

(and not to the NSA)

Page 148: URL to HTML

trusted third-partycertificate authority

Page 149: URL to HTML

trusted third-partycertificate authority

Page 150: URL to HTML
Page 151: URL to HTML

EFF has foundmore than

650certificate

authoritiesin the wild

Page 152: URL to HTML
Page 153: URL to HTML

*.google.com

Page 154: URL to HTML

*.google.com

Page 155: URL to HTML

*.google.com

Page 156: URL to HTML

*.google.com 7 different domains

Page 157: URL to HTML

*.google.com 7 different domains

Page 158: URL to HTML

$100

Page 159: URL to HTML

$1,000

$100

Page 160: URL to HTML

$1,000$1,000

$100

Page 161: URL to HTML

HTMLhypertext markup language

Page 162: URL to HTML

parsing

Page 163: URL to HTML

.png

.jpg .js .css

Page 164: URL to HTML
Page 165: URL to HTML
Page 166: URL to HTML

resolve all hostnames

establish TCP connections

negotiate TLS session

URL

DNS

IP

TCP

HTTP / TLS

HTML

Page 167: URL to HTML

@fmarier [email protected]

questions?

Page 168: URL to HTML

Copyright © 2014 Francois Marier <[email protected]>This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

leaky pipe: https://www.flickr.com/photos/ifl/3920636654leaky pipe with elephant: https://www.flickr.com/photos/rcrhee/10785374875sky tower: https://www.flickr.com/photos/elisfanclub/6120863439golden gate: https://www.flickr.com/photos/jeffgunn/6663212147san jose: https://www.flickr.com/photos/the_tahoe_guy/3183673224statue of liberty: https://www.flickr.com/photos/suewaters/7574642942big ben: https://www.flickr.com/photos/timmorris/3103896345bbc house: https://www.flickr.com/photos/redvers/532073098fingers crossed: https://www.flickr.com/photos/bearpark/6861722073prince charles : http://en.wikipedia.org/wiki/File:Prince_Charles_2012.jpgsouthern cross cable: https://en.wikipedia.org/wiki/File:Southern_Cross_Cable_route.svg

image credits