cs 43: computer networkschaganti/cs43/f19/... · cs 43: computer networks 11: cdns and transport...
TRANSCRIPT
![Page 1: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/1.jpg)
CS 43: Computer Networks
11: CDNs and Transport LayerOctober 8, 2019
![Page 2: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/2.jpg)
Reading Quiz
Slide 3
![Page 3: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/3.jpg)
Overlay Network
• A network made up of “virtual” or logical links
• Virtual links map to one or more physical links
Slide 7
![Page 4: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/4.jpg)
High-Performance Content Distribution
• Problem: You have a service that supplies lots of data. You want good performance for all users!
(often “lots of data” means media files)
Lecture 13 - Slide 8
![Page 5: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/5.jpg)
Key Components of a CDN
• Distributed servers– Usually located inside of other ISPs– Often located in IXPs (coming up next)
• High-speed network connecting them• Clients (eyeballs)– Can be located anywhere in the world– They want fast web performance
• Glue– Something that binds clients to “nearby” replica
servers
9
![Page 6: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/6.jpg)
CDN Challenges– How do we direct the user to a nearby replica instead
of the centralized source?– How do we determine which replica is the best to
send them to?– Ensure that replicas are always available?
Server
Clients
Backbone ISP
ISP-1 ISP-2
![Page 7: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/7.jpg)
Challenge: Finding the CDN
• Three main options:– Application redirect (e.g., HTTP)– “Anycast” routing– DNS resolution (most popular in practice)
• Example: CNN + Akamai
Lecture 13 - Slide 11
![Page 8: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/8.jpg)
CNN + Akamai
www.cnn.com
Request: cnn.com/articleResponse: HTML with linkto cache.cnn.com media
Content servers: serve media.
Lecture 13 - Slide 12
![Page 9: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/9.jpg)
CNN + Akamai
www.cnn.com
Request: cnn.com/articleResponse: HTML with linkto cache.cnn.com media
Root DNS Servers
com DNS servers org DNS servers edu DNS servers
swarthmore.eduDNS servers
cnn.comDNS servers
pbs.orgDNS servers
Content servers: serve media.
Lecture 13 - Slide 13
![Page 10: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/10.jpg)
CNN + Akamai
www.cnn.com
Request: cnn.com/articleResponse: HTML with linkto cache.cnn.com media
Root DNS Servers
com DNS servers org DNS servers edu DNS servers
swarthmore.eduDNS servers
cnn.comDNS servers
pbs.orgDNS servers
akamai.net DNS servers…
Content servers: serve media.
Akamai’s DNS response directs user to selected server.
Retrieve media file.
Lecture 13 - Slide 14
![Page 11: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/11.jpg)
CNN + Akamai
www.cnn.com
Request: cnn.com/articleResponse: HTML with linkto cache.cnn.com media
Root DNS Servers
com DNS servers org DNS servers edu DNS servers
swarthmore.eduDNS servers
cnn.comDNS servers
pbs.orgDNS servers
akamai.net DNS servers…
Content servers: serve media.
Akamai’s DNS response directs user to selected server.
Retrieve media file.
How to choose?
Lecture 13 - Slide 15
![Page 12: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/12.jpg)
Which metric is most important when choosing a server? (CDN or otherwise)
A. RTT latency
B. Data transfer rate / throughput
C. Hardware ownership
D. Geographic location
E. Some other metic(s) (such as?)
This is the CDN operator’s secret sauce!
Slide 16
![Page 13: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/13.jpg)
Content in today’s Internet
• Most flows are HTTP
– Web is at least 52% of traffic
– Median object size is 2.7K, average is 85K (as of 2007)
• Is the Internet designed for this common case?
– Why?
Slide 17
![Page 14: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/14.jpg)
Why speed matters
• Impact on user experience– Users navigating away from pages– Video startup delay
• 4x increase in abandonmentwith 10s increase in delay
Slide 18
![Page 15: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/15.jpg)
Streaming Media
• Straightforward approach: simple GET
• Challenges:– Dynamic network characteristics– Varying user device capabilities– User mobility
Slide 19
![Page 16: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/16.jpg)
Dynamic Adaptive Streaming over HTTP (DASH)
• Encode several versions of the same media file– low / medium / high / ultra quality
• Break each file into chunks
• Create a “manifest” to map file versions to chunks / video time offset
Slide 20
![Page 17: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/17.jpg)
Dynamic Adaptive Streaming over HTTP (DASH)
• Client requests manifest file, chooses version
• Requests new chunks as it plays existing ones
• Can switch between versions at any time!
Slide 21
![Page 18: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/18.jpg)
Summary
• Peer-to-peer architectures for:– High performance: BitTorrent– Decentralized lookup: DHTs
• CDNs: locating “good” replica for media server
• DASH: streaming despite dynamic conditions
Slide 22
![Page 19: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/19.jpg)
Application Layer
Does whatever an application does!
Slide 23
Chrome Thunderbird SkypeDNS
![Page 20: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/20.jpg)
Slide 24
Transport Layer
![Page 21: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/21.jpg)
Moving down a layer!
Application Layer
Transport: end-to-end connections, reliability
Network: routing
Link (data-link): framing, error detection
Physical: 1’s and 0’s/bits across a medium (copper, the air, fiber)
Slide 25
![Page 22: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/22.jpg)
Recall: Addressing and Encapsulation
Application: HTTP
Transport: TCP
Network: IP data
Link: Ethernet data
data
Slide 26
Human-readable strings: www.example.com
Assigning ports to socket ID
IP addresses (IPv4, IPv6)
(Network dependent) Ethernet: 48-bit MAC address
![Page 23: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/23.jpg)
Message Encapsulation
• Higher layer within lower layer
• Each layer has different concerns, provides abstract services to those above
Application
Transport: TCP
Network: IP data
Link: Ethernet data
data
Slide 27
![Page 24: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/24.jpg)
Transport Layer perspective
Transport: executing within the OS kernel
Network: ours to command!
Slide 28
Application is the boss
![Page 25: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/25.jpg)
Transport Layer perspective
Transport: executing within the OS kernel
What commands can we send to the network layer?
Slide 29
Looked at Application Layer
![Page 26: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/26.jpg)
What services does the network layer provide to the transport layer?
Slide 30
Transport: executing within the OS kernel
What commands can we send to the network layer?
Looked at Application Layer
A. Find paths through the network
B. Reliable transfer, with guaranteed delivery rates
C. Best-effort delivery
![Page 27: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/27.jpg)
send_to_host (data, host) : logical communication between end-hosts
✔ Find paths through the network
✔ Best-effort delivery!
Slide 31
Network Layer API
Source Destination
reliable data transfer
guaranteed delivery (or rate!)
![Page 28: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/28.jpg)
Provides logical communication between processes.
send_data_to_application (data, port, socket)
applicationtransportnetworkdata linkphysical
logical end-end transportapplicationtransportnetworkdata linkphysical
Slide 32
Transport Layer API
![Page 29: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/29.jpg)
Transport Layer: Runs on end systems
Slide 33
HTTP,DNS..
TCP
IP
Ethernetinterface
HTTP,DNS...
TCP
IP
Ethernetinterface
host host
IP
Ethernetinterface
SONETinterface
router
IP
Ethernetinterface
SONETinterface
router
Logical communication between processes
![Page 30: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/30.jpg)
How many of these services might we provide at the transport layer? Which?
• Reliable transfers• Error detection• Error correction• Bandwidth guarantees• Latency guarantees
• Encryption• Message ordering• Link sharing fairness
A. 4 or fewerB. 5C. 6
D. 7E. All 8
Lecture 15 - Slide 34
![Page 31: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/31.jpg)
How many of these services might we provide at the transport layer? Which?
• Reliable transfers (T)• Error detection (U, T)• Error correction (T)• Bandwidth guarantees• Latency guarantees
• Encryption• Message ordering (T)• Link sharing fairness (T)
A. 4 or fewerB. 5C. 6
D. 7E. All 8
Critical question: Can it be done at the end host?
Lecture 15 - Slide 35
![Page 32: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/32.jpg)
TCP sounds great! UDP…meh. Why do we need it?
A. It has good performance characteristics.
B. Sometimes all we need is error detection.
C. We still need to distinguish between sockets.
D. It basically just fills a gap in our layering model.
Lecture 15 - Slide 36
![Page 33: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/33.jpg)
• Nothing comes for free
• Data given by application
• Apply header– Keeps transport state– Attached by sender– Decoded by receiver
Payload Data
Payload DataTCP/UDP
Lecture 15 - Slide 37
Adding Features
![Page 34: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/34.jpg)
• Establishing state (making a connection)– Recall HTTP 1.0 vs. HTTP 1.1– Extra communication round trip
• Delays due to loss / reordering.
• Playing fair might cost you!
Lecture 15 - Slide 38
TCP Overhead
![Page 35: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/35.jpg)
Socket Abstraction
Slide 39
![Page 36: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/36.jpg)
Socket Abstraction
40
socket socketUser process User process
OperatingSystem
OperatingSystemInternet
Applications communicate using �sockets�Stream socket: reliable stream of bytes Message socket: unreliable message delivery
![Page 37: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/37.jpg)
Socket Abstraction
41
socket socketUser process User process
OperatingSystem
OperatingSystemInternet
Applications communicate using �sockets�/mailboxesDifferent mail-delivery service choices: TCP, UDP, ICMP, SCTP
![Page 38: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/38.jpg)
App
TCP
IP
Ethernetinterface
App
TCP
IP
Ethernetinterface
IP IP
Ethernetinterface
Ethernetinterface
SONETinterface
SONETinterface
host host
router router
Addressing Applications using Ports
Lecture 15 - Slide 42
![Page 39: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/39.jpg)
Multiplexing
Lecture 15 - Slide 43
App
Transport
App
TransportTransport
Network Layer
App App
(Simultaneous transmission of two or more signals/messages over a single channel.)
![Page 40: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/40.jpg)
Multiplexing
App
Transport
App
TransportTransport
Network Layer
App App
• The network is a shared resource.– It does NOT care about your applications, sockets, etc.
• Senders mark segments, in header, with identifier (port)
(Simultaneous transmission of two or more signals/messages over a single channel.)
Lecture 15 - Slide 44
![Page 41: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/41.jpg)
Multiplexing
App
Transport
App
TransportTransport
Network Layer
App App
• The network is a shared resource.– It does NOT care about your applications, sockets, etc.
• Senders mark segments, in header, with identifier (port)
(Simultaneous transmission of two or more signals/messages over a single channel.)
Lecture 15 - Slide 45
![Page 42: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/42.jpg)
De-multiplexing
App
Transport
App
TransportTransport
Network Layer
App App
• The network is a shared resource.– It does NOT care about your applications, sockets, etc.
• Receivers check header, deliver data to correct socket.
(Simultaneous transmission of two or more signals/messages over a single channel.)
Lecture 15 - Slide 46
![Page 43: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/43.jpg)
De-multiplexing
App
Transport
App
TransportTransport
Network Layer
App App
• The network is a shared resource.– It does NOT care about your applications, sockets, etc.
• Receivers check header, deliver data to correct socket.
(Simultaneous transmission of two or more signals/messages over a single channel.)
Lecture 15 - Slide 47
![Page 44: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/44.jpg)
De-multiplexing
App
Transport
App
TransportTransport
Network Layer
App App
• The network is a shared resource.
– It does NOT care about your applications, sockets, etc.
• Receivers check header, deliver data to correct socket.
(Simultaneous transmission of two or more signals/messages over a single channel.)
?
Lecture 15 - Slide 48
![Page 45: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/45.jpg)
De-multiplexing
App
Transport
App
TransportTransport
Network Layer
App App
• The network is a shared resource.
– It does NOT care about your applications, sockets, etc.
• Receivers check header, deliver data to correct socket.
(Simultaneous transmission of two or more signals/messages over a single channel.)
?
Lecture 15 - Slide 49
![Page 46: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/46.jpg)
Two Main Transport Layers
• User Datagram Protocol (UDP)– Unreliable, unordered delivery
• Transmission Control Protocol (TCP)– Reliable in-order delivery
50
![Page 47: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/47.jpg)
UDP – User Datagram Protocol
• Unreliable, unordered service• Adds:– multiplexing, – checksum (error detection)
![Page 48: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/48.jpg)
UDP: User Datagram Protocol [RFC 768]
• �No frills,� �Bare bones� Internet transport protocol– RFC 768 (1980)– Length of the document?
Lecture 15 - Slide 52
![Page 49: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/49.jpg)
UDP: User Datagram Protocol [RFC 768]
• �Best effort� service, • UDP segments may be:
– Lost– Delivered out of order (same as underlying network layer)
Lecture 15 - Slide 53
¯\_(�)_/¯
![Page 50: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/50.jpg)
How many of the following steps does UDP implement? (which ones?)
1. exchange an initiate handshake (connection setup) 2. break up packet into segments at the source and number
them3. place segments in order at the destination4. error-checking with checksum
Lecture 15 - Slide 54
A. 1 B. 2C. 3D. 4
![Page 51: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/51.jpg)
UDP Segment
SrcPort DstPort
ChecksumLength
Data
0 16 31
![Page 52: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/52.jpg)
source port # dest port #
applicationdata (variable length)
Urg data pointerFSRPAUhead
lennotused
checksumreceive window
sequence number
acknowledgement number
options (variable length)
Lecture 15 - Slide 56
32 bits
TCP Segment!
![Page 53: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/53.jpg)
UDP Checksum
• Goal: Detect transmission errors (e.g. flipped bits)– Router memory errors– Driver bugs– Electromagnetic interference
Lecture 15 - Slide 57
![Page 54: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/54.jpg)
UDP Checksum
RFC: “Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.”
Lecture 15 - Slide 58
![Page 55: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/55.jpg)
• Treat the entire segment as 16-bit integer values• Add them all together (sum)• Put the 1’s complement in the checksum header field
Lecture 15 - Slide 59
UDP Checksum at the Sender
![Page 56: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/56.jpg)
• In bitwise compliment, all of the bits in a binary number are flipped.
• So 1111000011110000 -> 0000111100001111
Lecture 15 - Slide 60
One’s Compliment
![Page 57: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/57.jpg)
example: add two 16-bit integers
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 01 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 01 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
sumchecksum
wraparound
Note: when adding numbers, a carryout from the most significant bit needs to be added to the result
1
Lecture 15 - Slide 61
Checksum example
![Page 58: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/58.jpg)
• Add all the received data together as 16-bit integers
• Add that to the checksum
• If result is not 1111 1111 1111 1111, there are errors!
Lecture 15 - Slide 62
Receiver
![Page 59: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/59.jpg)
If our checksum addition yields all ones, are we guaranteed to be error-free?
A. Yes
B. No
Lecture 15 - Slide 63
![Page 60: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/60.jpg)
• Latency sensitive– Quick request/response (DNS)– Network management (SNMP, TFTP)– Voice/video chat
• Error correction unnecessary (periodic msgs)
• Communicating with lots of others
Lecture 15 - Slide 64
UDP Applications
![Page 61: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/61.jpg)
A. Sorry, you’re out of luck.
B. Write your own transport protocol.
C. Add in the features you want at the application layer.
What if you want something more reliable than UDP, but faster/not as full featured as TCP?
Lecture 15 - Slide 65
![Page 62: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/62.jpg)
With TCP, send() blocks if buffer full.
Lecture 15 - Slide 66
Recall: TCP send() blocking
![Page 63: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/63.jpg)
With TCP, send() blocks if buffer full.
• Does UDP need to block? Should it?
A. Yes, if buffers are full, it should.B. It doesn’t need to, but it might be useful.C. No, it does not need to and shouldn’t do so.
Lecture 15 - Slide 67
UDP sendto() blocking
![Page 64: CS 43: Computer Networkschaganti/cs43/f19/... · CS 43: Computer Networks 11: CDNs and Transport Layer October 8, 2019. Reading Quiz Slide 3. Overlay Network •A network made up](https://reader033.vdocuments.us/reader033/viewer/2022050609/5fb05c745908ea085d7d198a/html5/thumbnails/64.jpg)
• UDP: No frills transport protocol.
• Simple, 8-byte header with ports, len, cksum
• Checksum protects against most bit flips
Lecture 15 - Slide 68
Summary