Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6....
Transcript of Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6....
![Page 1: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/1.jpg)
CSE 123: Computer NetworksAaron Schulman
Lecture 6:Transport Layer Protocols
![Page 2: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/2.jpg)
Overview
! Process naming/demultiplexing
! User Datagram Protocol (UDP)
! Transport Control Protocol (TCP)u Three-way handshakeu Flow control
2CSE 123 – Lecture 6: Transport Protocols
![Page 3: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/3.jpg)
Today: Transport Layer
3
HTTP
TCP
IP
Ethernetinterface
HTTP
TCP
IP
Ethernetinterface
IP IP
Ethernetinterface
Ethernetinterface
SONETinterface
SONETinterface
host host
router router
Application Layer
Transport Layer
Link Layer
Network Layer
CSE 123 – Lecture 6: Transport Protocols
![Page 4: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/4.jpg)
Transport Layer Tasks
! Define and provide specific delivery semanticsu To which end point (which application/process)?u When?u How?u If?
! Multiplexing different processes on the same links
! Reliability
4CSE 123 – Lecture 6: Transport Protocols
![Page 5: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/5.jpg)
Naming Processes/Services! Process here is an abstract term for your Web browser
(HTTP), Email servers (SMTP), hostname translation (DNS)
! How do we identify for remote communication?u Process id or memory address are OS-specific and transient
! So TCP and UDP use portsu 16-bit integers representing mailboxes that processes “rent”u Identify process uniquely as (IP address, protocol, port)
5CSE 123 – Lecture 6: Transport Protocols
![Page 6: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/6.jpg)
Picking Port Numbers! We still have the problem of allocating port numbers
u What port should a Web server use on host X?u To what port should you send to contact that Web server?
! Servers typically bind to well-known port numbersu e.g., HTTP 80, SMTP 25, DNS 53, … look in /etc/servicesu Ports below 1024 traditionally reserved for well-known
services
! Clients use OS-assigned temporary (ephemeral) portsu Above 1024, recycled by OS when client finished
6CSE 123 – Lecture 6: Transport Protocols
![Page 7: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/7.jpg)
Establishing well-known ports
7CSE 123 – Lecture 6: Transport Protocols
![Page 8: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/8.jpg)
User Datagram Protocol (UDP)! Provides unreliable message delivery between
processesu Source port filled in by OS as message is sentu Destination port identifies UDP delivery queue at endpoint
! Connectionless (no state about who talks to whom)
SrcPort DstPort
Checksum Length
Data
0 16 31
8CSE 123 – Lecture 6: Transport Protocols
![Page 9: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/9.jpg)
Applicationprocess
Applicationprocess
Applicationprocess
Packets arrive
Ports
MessageQueues
DeMux
UDP Delivery
Kernelboundary
9CSE 123 – Lecture 6: Transport Protocols
![Page 10: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/10.jpg)
UDP Checksum! UDP includes optional protection against errors
u Checksum intended as an end-to-end check on deliveryu So it covers data, UDP header, and IP pseudoheader (history)
SrcPort DstPort
Checksum Length
Data
0 16 31
10CSE 123 – Lecture 6: Transport Protocols
![Page 11: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/11.jpg)
Applications for UDP! Streaming media (e.g., live video)
! DNS (Domain Name Service)
! NTP (Network Time Protocol) (synchronizing clocks)
! FPS multi-player video games (e.g., Call of Duty)
! Why might UDP be appropriate for these?
11CSE 123 – Lecture 6: Transport Protocols
![Page 12: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/12.jpg)
Transmission Control Protocol! Reliable bi-directional bytestream between processes
u Uses a sliding window protocol for efficient transfer
! Connection-orientedu Conversation between two endpoints with beginning and end
! Flow control (last lecture)u Prevents sender from over-running receiver buffersu (tell sender how much buffer is left at receiver)
! Congestion control (later in term)u Prevents sender from over-running network capacity
12CSE 123 – Lecture 6: Transport Protocols
![Page 13: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/13.jpg)
TCP Delivery
Application process
Writebytes
TCPSend buffer
Segment Segment SegmentTransmit segments
Application process
Readbytes
TCPReceive buffer
…
… …13CSE 123 – Lecture 6: Transport Protocols
![Page 14: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/14.jpg)
TCP Header Format! Ports plus IP addresses identify a connection (4-tuple)
Options (variable)
Data
Checksum
SrcPort DstPort
HdrLen 0 Flags
UrgPtr
AdvertisedWindow
SequenceNum
Acknowledgment
0 4 10 16 31
14CSE 123 – Lecture 6: Transport Protocols
![Page 15: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/15.jpg)
TCP Header Format! Sequence, Ack numbers used for the sliding window
u How big a window? Flow control/congestion control determine
Options (variable)
Data
Checksum
SrcPort DstPort
HdrLen 0 Flags
UrgPtr
AdvertisedWindow
SequenceNum
Acknowledgment
0 4 10 16 31
15CSE 123 – Lecture 6: Transport Protocols
AdvertisedWindow Flow control –Receiver tells thetransmitter how big itsremaining window is
![Page 16: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/16.jpg)
TCP Header Format! Flags may be ACK, SYN, FIN, URG, PSH, RST
Options (variable)
Data
Checksum
SrcPort DstPort
HdrLen 0 Flags
UrgPtr
AdvertisedWindow
SequenceNum
Acknowledgment
0 4 10 16 31
16CSE 123 – Lecture 6: Transport Protocols
![Page 17: Lecture 6: Transport Layer Protocols · 2020-04-13 · CSE 123 –Lecture 6: Transport Protocols 6. Establishing well-known ports CSE 123 –Lecture 6: Transport Protocols 7. User](https://reader035.fdocuments.in/reader035/viewer/2022062414/5ed836ca0fa3e705ec0e0c2f/html5/thumbnails/17.jpg)
For next time…
! More TCP details
! Read Ch 5.2 in P&D
17CSE 123 – Lecture 6: Transport Protocols