Web Requests, Down To The Atom

Christopher Zacharias
Web Requests, Down To The Atom
Chris Zacharias
Web Unleashed 2019
Toronto
Understanding how the Internet fundamentally works is important.
• Identify performance opportunities at every layer.
• Make smarter decisions around compression and optimization.
• Become be er at triaging and debugging network-related issues.
• Recognize potential a ack vectors and vulnerabilities.
• Understand when and where costs occur.
• Communicate be er with other engineers.
Web Requests, Down To The Atom
Web Requests, Down To The Atom
Web Requests, Down To The Atom
A web request begins with a URL.
What is it that I
want to request?
What kind of
request is it?
The URL answers three simple questions.
Where do I send the
request?
The URL answers three simple questions.
What kind of
request is it?
Where do I send the
request?
What is it that I
want to request?
Protocol Network Location Path and Query
GET /examples/treefrog.jpg?w=400 HTTP/1.1
Host: assets.imgix.net
User-Agent: curl/7.54.0
Accept: image/webp,*/*
Accept-Encoding: br,gzip,deflate
The browser builds an HTTP request out of the URL we provide.
Path and Query Protocol
Network Location
An HTTP GET request.
The request is sent out onto the Internet and (hopefully) we get a response.
Request Response
The
Internet
Network
Provider
InternetISPWiFi
The Internet is just a collection of networks that connect clients to servers.
LAN
Network
Provider
InternetISPWiFi
By “hopping" between networks, we can find our way to the right server.
LAN
To perform a request, we need a network connection, an IP address and a port.
The
Internet
35.101.45.27 151.101.146.208DNS
assets.imgix.net?
Port: 41256 Port: 80 (HTTP)
Once we have those things, we can establish a TCP connection.
35.101.45.27 151.101.146.208
Port: 41256 Port: 80 (HTTP)
TCP Handshake
DATA (GET /file.jpg)
DATA (200 OK)
DATA (Response)
ACK
TCP Teardown
Packets are sent between client and server to transfer data.
35.101.45.27 151.101.146.208
Port: 41256 Port: 80 (HTTP)
TCP Handshake
DATA (GET /file.jpg)
DATA (200 OK)
DATA (Response)
ACK
TCP Teardown
The connection is shut down when it is no longer needed.
35.101.45.27 151.101.146.208
Port: 41256 Port: 80 (HTTP)
TCP Handshake
DATA (GET /file.jpg)
DATA (200 OK)
DATA (Response)
ACK
TCP Teardown
To describe the networking stack,
we make use of abstract models.
TCP / IP Model
Application HTTP
Transport TCP
Internet IP
Network Access Ethernet
This is the most common understanding of the network stack.
TCP / IP Model
Application GET, POST…
Transport :8080
Internet 35.64.132.7
Network Access 86:e9:fb:56:33:21
This is the most common understanding of the network stack.
TCP / IP Model
Application Data
Transport Sequences
Internet Packets
Network Access
Frames
Bits
This is the most common understanding of the network stack.
OSI Model TCP / IP Model
Application
Application DataPresentation
Session
Transport Transport Sequences
Network Internet Packets
Data Link
Network Access
Frames
Physical Bits
The OSI model is often used to talk about networking in the abstract.
You may frequently hear about features being “L7”, “L4”, etc.
OSI Model TCP / IP Model
Layer 7 Application
Application DataLayer 6 Presentation
Layer 5 Session
Layer 4 Transport Transport Sequences
Layer 3 Network Internet Packets
Layer 2 Data Link
Network Access
Frames
Layer 1 Physical Bits
Given that the Internet is stateless, we need to
provide a lot of extra information with our request.
The data in a web request is encoded as a stream of bytes.
G E T / e x a m p l e s / t r e e f r o g . j p g ? w = 4 0 0 H T T P / 1 .
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
1 r n H o s t : a s s e t s . i m g i x . n e t r n U s e r - A g e n t : c
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
u r l / 7 . 5 4 . 0 r n A c c e p t : i m a g e / w e b p , * / * r n A c c e
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
p t - E n c o d i n g : b r , g z i p , d e f l a t e r n r n
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
The stream is broken apart into chunks.
G E T / e x a m p l e s / t r
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
t r n U s e r - A g e n t : c
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
/ * r n A c c e p t - E n c o d
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
l a t e r n r n
144 145 146 147 148 149 150 151
e e f r o g . j p g ? w = 4 0 0
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
H T T P / 1 . 1 r n H o s t :
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
a s s e t s . i m g i x . n e
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
u r l / 7 . 5 4 . 0 r n A c c e
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
p t : i m a g e / w e b p , *
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
i n g : b r , g z i p , d e f
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
Those chunks are given IDs to keep them in order.
G E T / e x a m p l e s / t r
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
t r n U s e r - A g e n t : c
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
/ * r n A c c e p t - E n c o d
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
l a t e r n r n
144 145 146 147 148 149 150 151
e e f r o g . j p g ? w = 4 0 0
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
H T T P / 1 . 1 r n H o s t :
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
a s s e t s . i m g i x . n e
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
u r l / 7 . 5 4 . 0 r n A c c e
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
p t : i m a g e / w e b p , *
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
i n g : b r , g z i p , d e f
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
SEQ 0 SEQ 16
SEQ 32 SEQ 48
SEQ 64 SEQ 80
SEQ 96 SEQ 112
SEQ 128 SEQ 144
The chunks need to be packaged for sending across the Internet.
Application
Sequence G E T / e x a m p l e s / t r Data
The TCP headers are added to handle the connection between two hosts.
Application
Sequence G E T / e x a m p l e s / t r
Transport Application
Ports Sequence G E T / e x a m p l e s / t r
Data
Sequence
The IP headers provide the necessary context to navigate the Internet.
Application
Sequence G E T / e x a m p l e s / t r
Transport Application
Ports Sequence G E T / e x a m p l e s / t r
Internet Transport Application
IPs Ports Sequence G E T / e x a m p l e s / t r
Data
Sequence
Packet
Application
Sequence G E T / e x a m p l e s / t r
Transport Application
Ports Sequence G E T / e x a m p l e s / t r
Internet Transport Application
IPs Ports Sequence G E T / e x a m p l e s / t r
Network Internet Transport Application
MAC/LLC IPs Ports Sequence G E T / e x a m p l e s / t r
Data
Sequence
Packet
Frame
The MAC/LLC headers manage how packets navigate the local network.
The MAC/LLC headers manage how packets navigate the local network.
Application
Sequence G E T / e x a m p l e s / t r
Transport Application
Ports Sequence G E T / e x a m p l e s / t r
Internet Transport Application
IPs Ports Sequence G E T / e x a m p l e s / t r
Network Internet Transport Application
MAC/LLC IPs Ports Sequence G E T / e x a m p l e s / t r
Data
Sequence
Packet
Frame
The standard “MTU” or Maximum Transmission Unit is 1526 bytes.
To understand how data is sent over a physical wire,
we are going to work backwards from the atom.
Electrically conductive atoms have a single electron in their outermost shell.
By adding poles with positive and negative charges…
+-
… we cause the atoms nearest to the positive pole to lose an electron.
+-
Atoms missing an electron pull electrons from other atoms.
+-
The negative pole provides electrons to atoms that end up without one.
+-
This creates an electrical current.
+-
In direct current, electrons flow in one direction at a rate known as voltage.
A higher voltage means more electrons are flowing in the current.
The voltage can be made to vary over time.
A measurement of the voltage is taken regularly on a clock cycle.
By thresholding the voltages to discrete values, we can derive bits.
1 1 10 0 0
Numbers, text and other data can be translated into and out of bits.
01011010 = “Z”01011010 = 90
0 1 0 1 1 0 1 0
27 26 25 24 23 22 21 20
20 * 0 = 0
21 * 1 = 2
22 * 0 = 0
23 * 1 = 8
24 * 1 = 16
25 * 0 = 0
26 * 1 = 64
27 * 0 = 0
+ 90
Over 2 TRILLION GIGABYTES of data will be
transmitted over the Internet in 2020.
It will take a lot of electricity to
transit that much data.
https://www.nature.com/articles/d41586-018-06610-y
Carbon emissions due to the
Internet surpassed those of the
airline industry in 2015.
https://www.theguardian.com/environment/2015/sep/25/server-data-centre-emissions-air-travel-web-google-facebook-greenhouse-gas
Do your part. Use fewer bytes.
Web Requests, Down To The Atom
Thank you.
Chris Zacharias
chris@imgix.com
@zacman85
1 of 50

Recommended

013 YES Catalog Web Plus Worksheet 10-11-13 by
013 YES Catalog Web Plus Worksheet 10-11-13013 YES Catalog Web Plus Worksheet 10-11-13
013 YES Catalog Web Plus Worksheet 10-11-13Ben Yager
1.6K views19 slides
LT Distribution at CESC Ltd.pdf by
LT Distribution at CESC Ltd.pdfLT Distribution at CESC Ltd.pdf
LT Distribution at CESC Ltd.pdfTirthamMukherjee
34 views15 slides
Industry’s perspective on the future role of electro-mobility - the view of T... by
Industry’s perspective on the future role of electro-mobility - the view of T...Industry’s perspective on the future role of electro-mobility - the view of T...
Industry’s perspective on the future role of electro-mobility - the view of T...IEA-ETSAP
419 views20 slides
20110114 Next Generation Sequencing Course by
20110114 Next Generation Sequencing Course20110114 Next Generation Sequencing Course
20110114 Next Generation Sequencing CoursePierre Lindenbaum
10.4K views145 slides
Si Intro(100413) by
Si Intro(100413)Si Intro(100413)
Si Intro(100413)imsong
2.4K views54 slides
Hacking the kodak funsaver flash by
Hacking the kodak funsaver flashHacking the kodak funsaver flash
Hacking the kodak funsaver flashMechEProdigy
1.2K views16 slides

More Related Content

Similar to Web Requests, Down To The Atom

Introduction to Java Profiling by
Introduction to Java ProfilingIntroduction to Java Profiling
Introduction to Java ProfilingJerry Yoakum
139 views90 slides
Hacking the kodak funsaver flash by
Hacking the kodak funsaver flashHacking the kodak funsaver flash
Hacking the kodak funsaver flashMechEProdigy
565 views16 slides
Thinh phat 02-01-2014 by
Thinh phat 02-01-2014Thinh phat 02-01-2014
Thinh phat 02-01-2014Peter Tran
498 views28 slides
Thinh phat 02-01-2014 by
Thinh phat 02-01-2014Thinh phat 02-01-2014
Thinh phat 02-01-2014Lãng Quên
346 views28 slides
Jaimin chp-5 - network layer- 2011 batch by
Jaimin   chp-5 - network layer- 2011 batchJaimin   chp-5 - network layer- 2011 batch
Jaimin chp-5 - network layer- 2011 batchJaimin Jani
2.4K views154 slides
21 handling & installation of cables by
21   handling & installation of cables21   handling & installation of cables
21 handling & installation of cablesFelix Maikol
1.5K views19 slides

Similar to Web Requests, Down To The Atom(20)

Introduction to Java Profiling by Jerry Yoakum
Introduction to Java ProfilingIntroduction to Java Profiling
Introduction to Java Profiling
Jerry Yoakum139 views
Hacking the kodak funsaver flash by MechEProdigy
Hacking the kodak funsaver flashHacking the kodak funsaver flash
Hacking the kodak funsaver flash
MechEProdigy565 views
Thinh phat 02-01-2014 by Peter Tran
Thinh phat 02-01-2014Thinh phat 02-01-2014
Thinh phat 02-01-2014
Peter Tran498 views
Thinh phat 02-01-2014 by Lãng Quên
Thinh phat 02-01-2014Thinh phat 02-01-2014
Thinh phat 02-01-2014
Lãng Quên346 views
Jaimin chp-5 - network layer- 2011 batch by Jaimin Jani
Jaimin   chp-5 - network layer- 2011 batchJaimin   chp-5 - network layer- 2011 batch
Jaimin chp-5 - network layer- 2011 batch
Jaimin Jani2.4K views
21 handling & installation of cables by Felix Maikol
21   handling & installation of cables21   handling & installation of cables
21 handling & installation of cables
Felix Maikol1.5K views
7.2.1.8 lab using wireshark to observe the tcp 3-way handshake by gabriel morillo
7.2.1.8 lab   using wireshark to observe the tcp 3-way handshake7.2.1.8 lab   using wireshark to observe the tcp 3-way handshake
7.2.1.8 lab using wireshark to observe the tcp 3-way handshake
gabriel morillo2.8K views
Tutorial ESWC2011 Building Semantic Sensor Web - 04 - Querying_semantic_strea... by Jean-Paul Calbimonte
Tutorial ESWC2011 Building Semantic Sensor Web - 04 - Querying_semantic_strea...Tutorial ESWC2011 Building Semantic Sensor Web - 04 - Querying_semantic_strea...
Tutorial ESWC2011 Building Semantic Sensor Web - 04 - Querying_semantic_strea...
Self Managed and Automatically Reconfigurable Stream Processing - Vasiliki Ka... by Flink Forward
Self Managed and Automatically Reconfigurable Stream Processing - Vasiliki Ka...Self Managed and Automatically Reconfigurable Stream Processing - Vasiliki Ka...
Self Managed and Automatically Reconfigurable Stream Processing - Vasiliki Ka...
Flink Forward369 views
Self-managed and automatically reconfigurable stream processing by Vasia Kalavri
Self-managed and automatically reconfigurable stream processingSelf-managed and automatically reconfigurable stream processing
Self-managed and automatically reconfigurable stream processing
Vasia Kalavri638 views
Ccm mechanical design-presentation by Radi Nasr
Ccm mechanical design-presentationCcm mechanical design-presentation
Ccm mechanical design-presentation
Radi Nasr1.6K views
FAPESP_Beamer by Peter Sels
FAPESP_BeamerFAPESP_Beamer
FAPESP_Beamer
Peter Sels154 views
RefreshDC - The How Of Geo by Andrew Turner
RefreshDC - The How Of GeoRefreshDC - The How Of Geo
RefreshDC - The How Of Geo
Andrew Turner891 views
0244 Panorama I UPS Testing by Joe Tate
0244 Panorama I UPS Testing0244 Panorama I UPS Testing
0244 Panorama I UPS Testing
Joe Tate268 views
Encrypted Traffic Mining by Henry Huang
Encrypted Traffic MiningEncrypted Traffic Mining
Encrypted Traffic Mining
Henry Huang1.1K views
ch03_block_ciphers_nemo (2) (1).ppt by MrsPrabhaBV
ch03_block_ciphers_nemo (2) (1).pptch03_block_ciphers_nemo (2) (1).ppt
ch03_block_ciphers_nemo (2) (1).ppt
MrsPrabhaBV9 views

Recently uploaded

google forms survey (1).pptx by
google forms survey (1).pptxgoogle forms survey (1).pptx
google forms survey (1).pptxMollyBrown86
14 views10 slides
Audience profile.pptx by
Audience profile.pptxAudience profile.pptx
Audience profile.pptxMollyBrown86
12 views2 slides
PORTFOLIO 1 (Bret Michael Pepito).pdf by
PORTFOLIO 1 (Bret Michael Pepito).pdfPORTFOLIO 1 (Bret Michael Pepito).pdf
PORTFOLIO 1 (Bret Michael Pepito).pdfbrejess0410
7 views6 slides
Sustainable Marketing by
Sustainable MarketingSustainable Marketing
Sustainable MarketingTheo van der Zee
10 views50 slides
UiPath Document Understanding_Day 2.pptx by
UiPath Document Understanding_Day 2.pptxUiPath Document Understanding_Day 2.pptx
UiPath Document Understanding_Day 2.pptxRohitRadhakrishnan8
292 views21 slides
Building trust in our information ecosystem: who do we trust in an emergency by
Building trust in our information ecosystem: who do we trust in an emergencyBuilding trust in our information ecosystem: who do we trust in an emergency
Building trust in our information ecosystem: who do we trust in an emergencyTina Purnat
92 views18 slides

Recently uploaded(20)

google forms survey (1).pptx by MollyBrown86
google forms survey (1).pptxgoogle forms survey (1).pptx
google forms survey (1).pptx
MollyBrown8614 views
PORTFOLIO 1 (Bret Michael Pepito).pdf by brejess0410
PORTFOLIO 1 (Bret Michael Pepito).pdfPORTFOLIO 1 (Bret Michael Pepito).pdf
PORTFOLIO 1 (Bret Michael Pepito).pdf
brejess04107 views
Building trust in our information ecosystem: who do we trust in an emergency by Tina Purnat
Building trust in our information ecosystem: who do we trust in an emergencyBuilding trust in our information ecosystem: who do we trust in an emergency
Building trust in our information ecosystem: who do we trust in an emergency
Tina Purnat92 views
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdf by RIPE NCC
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdfOpportunities for Youth in IG - Alena Muravska RIPE NCC.pdf
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdf
RIPE NCC9 views
IETF 118: Starlink Protocol Performance by APNIC
IETF 118: Starlink Protocol PerformanceIETF 118: Starlink Protocol Performance
IETF 118: Starlink Protocol Performance
APNIC186 views
Serverless cloud architecture patterns by Jimmy Dahlqvist
Serverless cloud architecture patternsServerless cloud architecture patterns
Serverless cloud architecture patterns
Jimmy Dahlqvist17 views
IGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdf by RIPE NCC
IGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdfIGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdf
IGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdf
RIPE NCC15 views
We see everywhere that many people are talking about technology.docx by ssuserc5935b
We see everywhere that many people are talking about technology.docxWe see everywhere that many people are talking about technology.docx
We see everywhere that many people are talking about technology.docx
ssuserc5935b6 views
Existing documentaries (1).docx by MollyBrown86
Existing documentaries (1).docxExisting documentaries (1).docx
Existing documentaries (1).docx
MollyBrown8613 views
AI Powered event-driven translation bot by Jimmy Dahlqvist
AI Powered event-driven translation botAI Powered event-driven translation bot
AI Powered event-driven translation bot
Jimmy Dahlqvist16 views

Web Requests, Down To The Atom

  • 1. Web Requests, Down To The Atom Chris Zacharias Web Unleashed 2019 Toronto
  • 2. Understanding how the Internet fundamentally works is important. • Identify performance opportunities at every layer. • Make smarter decisions around compression and optimization. • Become be er at triaging and debugging network-related issues. • Recognize potential a ack vectors and vulnerabilities. • Understand when and where costs occur. • Communicate be er with other engineers.
  • 6. A web request begins with a URL.
  • 7. What is it that I want to request? What kind of request is it? The URL answers three simple questions. Where do I send the request?
  • 8. The URL answers three simple questions. What kind of request is it? Where do I send the request? What is it that I want to request? Protocol Network Location Path and Query
  • 9. GET /examples/treefrog.jpg?w=400 HTTP/1.1 Host: assets.imgix.net User-Agent: curl/7.54.0 Accept: image/webp,*/* Accept-Encoding: br,gzip,deflate The browser builds an HTTP request out of the URL we provide. Path and Query Protocol Network Location An HTTP GET request.
  • 10. The request is sent out onto the Internet and (hopefully) we get a response. Request Response The Internet
  • 11. Network Provider InternetISPWiFi The Internet is just a collection of networks that connect clients to servers. LAN
  • 12. Network Provider InternetISPWiFi By “hopping" between networks, we can find our way to the right server. LAN
  • 13. To perform a request, we need a network connection, an IP address and a port. The Internet 35.101.45.27 151.101.146.208DNS assets.imgix.net? Port: 41256 Port: 80 (HTTP)
  • 14. Once we have those things, we can establish a TCP connection. 35.101.45.27 151.101.146.208 Port: 41256 Port: 80 (HTTP) TCP Handshake DATA (GET /file.jpg) DATA (200 OK) DATA (Response) ACK TCP Teardown
  • 15. Packets are sent between client and server to transfer data. 35.101.45.27 151.101.146.208 Port: 41256 Port: 80 (HTTP) TCP Handshake DATA (GET /file.jpg) DATA (200 OK) DATA (Response) ACK TCP Teardown
  • 16. The connection is shut down when it is no longer needed. 35.101.45.27 151.101.146.208 Port: 41256 Port: 80 (HTTP) TCP Handshake DATA (GET /file.jpg) DATA (200 OK) DATA (Response) ACK TCP Teardown
  • 17. To describe the networking stack, we make use of abstract models.
  • 18. TCP / IP Model Application HTTP Transport TCP Internet IP Network Access Ethernet This is the most common understanding of the network stack.
  • 19. TCP / IP Model Application GET, POST… Transport :8080 Internet 35.64.132.7 Network Access 86:e9:fb:56:33:21 This is the most common understanding of the network stack.
  • 20. TCP / IP Model Application Data Transport Sequences Internet Packets Network Access Frames Bits This is the most common understanding of the network stack.
  • 21. OSI Model TCP / IP Model Application Application DataPresentation Session Transport Transport Sequences Network Internet Packets Data Link Network Access Frames Physical Bits The OSI model is often used to talk about networking in the abstract.
  • 22. You may frequently hear about features being “L7”, “L4”, etc. OSI Model TCP / IP Model Layer 7 Application Application DataLayer 6 Presentation Layer 5 Session Layer 4 Transport Transport Sequences Layer 3 Network Internet Packets Layer 2 Data Link Network Access Frames Layer 1 Physical Bits
  • 23. Given that the Internet is stateless, we need to provide a lot of extra information with our request.
  • 24. The data in a web request is encoded as a stream of bytes. G E T / e x a m p l e s / t r e e f r o g . j p g ? w = 4 0 0 H T T P / 1 . 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 r n H o s t : a s s e t s . i m g i x . n e t r n U s e r - A g e n t : c 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 u r l / 7 . 5 4 . 0 r n A c c e p t : i m a g e / w e b p , * / * r n A c c e 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 p t - E n c o d i n g : b r , g z i p , d e f l a t e r n r n 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
  • 25. The stream is broken apart into chunks. G E T / e x a m p l e s / t r 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 t r n U s e r - A g e n t : c 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 / * r n A c c e p t - E n c o d 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 l a t e r n r n 144 145 146 147 148 149 150 151 e e f r o g . j p g ? w = 4 0 0 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 H T T P / 1 . 1 r n H o s t : 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 a s s e t s . i m g i x . n e 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 u r l / 7 . 5 4 . 0 r n A c c e 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 p t : i m a g e / w e b p , * 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 i n g : b r , g z i p , d e f 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
  • 26. Those chunks are given IDs to keep them in order. G E T / e x a m p l e s / t r 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 t r n U s e r - A g e n t : c 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 / * r n A c c e p t - E n c o d 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 l a t e r n r n 144 145 146 147 148 149 150 151 e e f r o g . j p g ? w = 4 0 0 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 H T T P / 1 . 1 r n H o s t : 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 a s s e t s . i m g i x . n e 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 u r l / 7 . 5 4 . 0 r n A c c e 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 p t : i m a g e / w e b p , * 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 i n g : b r , g z i p , d e f 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 SEQ 0 SEQ 16 SEQ 32 SEQ 48 SEQ 64 SEQ 80 SEQ 96 SEQ 112 SEQ 128 SEQ 144
  • 27. The chunks need to be packaged for sending across the Internet. Application Sequence G E T / e x a m p l e s / t r Data
  • 28. The TCP headers are added to handle the connection between two hosts. Application Sequence G E T / e x a m p l e s / t r Transport Application Ports Sequence G E T / e x a m p l e s / t r Data Sequence
  • 29. The IP headers provide the necessary context to navigate the Internet. Application Sequence G E T / e x a m p l e s / t r Transport Application Ports Sequence G E T / e x a m p l e s / t r Internet Transport Application IPs Ports Sequence G E T / e x a m p l e s / t r Data Sequence Packet
  • 30. Application Sequence G E T / e x a m p l e s / t r Transport Application Ports Sequence G E T / e x a m p l e s / t r Internet Transport Application IPs Ports Sequence G E T / e x a m p l e s / t r Network Internet Transport Application MAC/LLC IPs Ports Sequence G E T / e x a m p l e s / t r Data Sequence Packet Frame The MAC/LLC headers manage how packets navigate the local network.
  • 31. The MAC/LLC headers manage how packets navigate the local network. Application Sequence G E T / e x a m p l e s / t r Transport Application Ports Sequence G E T / e x a m p l e s / t r Internet Transport Application IPs Ports Sequence G E T / e x a m p l e s / t r Network Internet Transport Application MAC/LLC IPs Ports Sequence G E T / e x a m p l e s / t r Data Sequence Packet Frame The standard “MTU” or Maximum Transmission Unit is 1526 bytes.
  • 32. To understand how data is sent over a physical wire, we are going to work backwards from the atom.
  • 33. Electrically conductive atoms have a single electron in their outermost shell.
  • 34. By adding poles with positive and negative charges… +-
  • 35. … we cause the atoms nearest to the positive pole to lose an electron. +-
  • 36. Atoms missing an electron pull electrons from other atoms. +-
  • 37. The negative pole provides electrons to atoms that end up without one. +-
  • 38. This creates an electrical current. +-
  • 39. In direct current, electrons flow in one direction at a rate known as voltage.
  • 40. A higher voltage means more electrons are flowing in the current.
  • 41. The voltage can be made to vary over time.
  • 42. A measurement of the voltage is taken regularly on a clock cycle.
  • 43. By thresholding the voltages to discrete values, we can derive bits. 1 1 10 0 0
  • 44. Numbers, text and other data can be translated into and out of bits. 01011010 = “Z”01011010 = 90 0 1 0 1 1 0 1 0 27 26 25 24 23 22 21 20 20 * 0 = 0 21 * 1 = 2 22 * 0 = 0 23 * 1 = 8 24 * 1 = 16 25 * 0 = 0 26 * 1 = 64 27 * 0 = 0 + 90
  • 45. Over 2 TRILLION GIGABYTES of data will be transmitted over the Internet in 2020.
  • 46. It will take a lot of electricity to transit that much data. https://www.nature.com/articles/d41586-018-06610-y
  • 47. Carbon emissions due to the Internet surpassed those of the airline industry in 2015. https://www.theguardian.com/environment/2015/sep/25/server-data-centre-emissions-air-travel-web-google-facebook-greenhouse-gas
  • 48. Do your part. Use fewer bytes.