Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

Similar documents
Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network

CSE 461 Connections. David Wetherall

CSEP 561 Connections. David Wetherall

CSEP 561 Connections. David Wetherall

CSE/EE 461 Lecture 14. Connections. Last Time. This Time. We began on the Transport layer. Focus How do we send information reliably?

CSE 461 The Transport Layer

CSE 461 Module 11. Connections

CSE/EE 461 Lecture 12 TCP. A brief Internet history...

Transport Layer (TCP/UDP)

User Datagram Protocol

Application Service Models

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

CSCI-1680 Transport Layer I Rodrigo Fonseca

CSCI-1680 Transport Layer I Rodrigo Fonseca

Lecture 22: TCP & NAT. CSE 123: Computer Networks Alex C. Snoeren

Internet Protocols Fall Outline

End-to-End Protocols. End-to-End Protocols

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 5 - Part 2

SWITCHING, FORWARDING, AND ROUTING

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management

Reliable Byte-Stream (TCP)

Internet transport protocols

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

TCP Overview. Connection-oriented Byte-stream

TCP Adaptive Retransmission Algorithm - Original TCP. TCP Adaptive Retransmission Algorithm Jacobson

Overview. Internetworking and Reliable Transmission. CSE 561 Lecture 3, Spring David Wetherall. Internetworking. Reliable Transmission

Operating Systems and Networks. Network Lecture 8: Transport Layer. Adrian Perrig Network Security Group ETH Zürich

EE 122: Transport Protocols: UDP and TCP

Operating Systems and Networks. Network Lecture 8: Transport Layer. Where we are in the Course. Recall. Transport Layer Services.

ECE 650 Systems Programming & Engineering. Spring 2018

Introduc)on to Computer Networks

Transport Layer Marcos Vieira

TSIN02 - Internetworking

End-to-End Protocols: UDP and TCP. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

Introduc)on to Computer Networks

TCP. TCP: Overview. TCP Segment Structure. Maximum Segment Size (MSS) Computer Networks 10/19/2009. CSC 257/457 - Fall

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

EEC-682/782 Computer Networks I

Chapter 5 End-to-End Protocols

Lecture 3: The Transport Layer: UDP and TCP

Outline Computer Networking. Functionality Split. Transport Protocols

TCP & UDP. Transport Layer. Transport. Network. Functions. End-to-end Reliable Byte Stream. Unreliable End-to-end. C.K. Kim

Problem. Chapter Outline. Chapter Goal. End-to-end Protocols. End-to-end Protocols. Chapter 5. End-to-End Protocols

TSIN02 - Internetworking

EE 122: Transport Protocols. Kevin Lai October 16, 2002

Transport Protocols. Raj Jain. Washington University in St. Louis

Transport Layer: Outline

QUIZ: Longest Matching Prefix

UNIT IV TRANSPORT LAYER

TSIN02 - Internetworking

05 Transmission Control Protocol (TCP)

Fundamentals of Computer Networks ECE 478/578. Transport Layer. End- to- End Protocols 4/16/13. Spring Application. Application.

TSIN02 - Internetworking

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

UNIT V. Computer Networks [10MCA32] 1

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018

6. The Transport Layer and protocols

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Computer Networks. Transmission Control Protocol. Jianping Pan Spring /3/17 CSC361 1

ECE 435 Network Engineering Lecture 9

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

Computer Network Programming. The Transport Layer. Dr. Sam Hsu Computer Science & Engineering Florida Atlantic University

CS457 Transport Protocols. CS 457 Fall 2014

TCP : Fundamentals of Computer Networks Bill Nace

CS 356: Computer Network Architectures. Lecture 17: End-to-end Protocols and Lab 3 Chapter 5.1, 5.2. Xiaowei Yang

OSI Transport Layer. objectives

CS 716: Introduction to communication networks th class; 7 th Oct Instructor: Sridhar Iyer IIT Bombay

Lenuta Alboaie Computer Networks

COMPUTER NETWORKS CS CS 55201

COMPUTER NETWORKS CS CS 55201

Networking Technologies and Applications

Functionality Split Computer Networking. Transport Protocols. Overview. Multiplexing & Demultiplexing

Page 1. Goals for Today" Placing Network Functionality" Basic Observation" CS162 Operating Systems and Systems Programming Lecture 15

Transport Protocols. CSCI 363 Computer Networks Department of Computer Science

TCP: Transmission Control Protocol UDP: User Datagram Protocol TCP - 1

ITS323: Introduction to Data Communications

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Transport: How Applications Communicate

TCP Basics : Computer Networking. Overview. What s Different From Link Layers? Introduction to TCP. TCP reliability Assigned reading

CS4700/CS5700 Fundamentals of Computer Networks

CSE/EE 461. Sliding Windows and ARQ. Last Time. This Time. We finished up the Network layer Internetworks (IP) Routing (DV/RIP, LS/OSPF)

Computer Networks and Data Systems

Internet and Intranet Protocols and Applications

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

Unit 2.

Transport Protocols & TCP TCP

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

ECE 435 Network Engineering Lecture 15

ECE 435 Network Engineering Lecture 9

Reliable Transport I: Concepts and TCP Protocol

TCP: Transmission Control Protocol RFC 793,1122,1223. Prof. Lin Weiguo Copyleft 2009~2017, School of Computing, CUC

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

Transport Layer (TCP/UDP)

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

UDP, TCP, IP multicast

CSC 401 Data and Computer Communications Networks

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

Computer Networking Introduction

Transcription:

CSE 123b Communications Software Spring 2002 Lecture 4: Connections and Flow Control Stefan Savage Last Class We talked about how to implement a reliable channel in the transport layer Approaches ARQ (Automatic Repeat request), Sliding window» Good RTT estimates» Packet sequencing as an indicator of loss (Fast Retransmit) FEC (Forward Error Correction)» Redundant data encoding» Appropriate for asymmetric channels, multicast, or high delay high loss channels Some slides courtesy David Wetherall May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 2 Today Finish basic transport protocol issues in context of User gram Protocol (UDP) Transmission Control Protocol () Connection-oriented vs connection-less transport Naming Connection setup Connection teardown Flow control How do we manage buffering at the endpoints? Naming Processes/Services Process here is an abstract term for your Web browser (HTTP), Email servers (SMTP), hostname translation (DNS), RealAudio player (RTSP/RDT), etc. How do we identify for remote communication? Process id or memory address are OS-specific and transient So and UDP use Ports 16-bit integers representing mailboxes that processes rent Identify process uniquely as (IP address, protocol, port) May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 3 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 4 Picking Port Numbers We still have the problem of allocating port numbers What port should a Web server use on host X? To what port should you send to contact that Web server? Servers typically bind to well-known port numbers e.g., HTTP 80, SMTP 25, DNS 53, look in /etc/services Ports below 1024 traditionally reserved for well-known services Clients use OS-assigned temporary (ephemeral) ports Above 1024, recycled by OS when client finished Transmission Control Protocol () Reliable bi-directional bytestream between processes Message boundaries are not preserved Connection-oriented Conversation between two endpoints with beginning and end Flow control (later) Prevents sender from over-running receiver buffers Congestion control (next class) Prevents sender from over-running network buffers May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 5 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 6

May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 7 Delivery Header Format Ports plus IP addresses identify a connection Application process Application process Write bytes Read bytes Send buffer Receive buffer Transmit segments Segment Segment Segment May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 8 Header Format Sequence, Ack numbers used for the sliding window How big a window? Flow control/congestion control determine Header Format Flags may be URG,, PSH, RST, SYN, FIN May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 9 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 10 Connection Establishment Both sender and receiver must be ready before we start to transfer the data Sender and receiver need to agree on a set of parameters Most important: sequence number space in each direction Lots of other parameters: e.g., the Maximum Segment Size This is signaling It sets up state at the endpoints Similar to dialing in the telephone network Handshake protocols: setup state between two oblivious endpoints Two-way way handshake? SYN, = x SYN, = y, What s wrong here? May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 11 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 12

May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 13 Two-way way handshake? Old SYN, = x New SYN, = q, SYN, = y, Delayed old SYN Rejected Three-Way Handshake Opens both directions for transfer SYN, = x SYN +, = y, = x + 1, = y + 1 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 14 Some Comments We could abbreviate this setup, but it was chosen to be robust, especially against delayed duplicates Three-way handshake from Tomlinson 1975 Choice of changing initial sequence numbers (ISNs) minimizes the chance of hosts that crash getting confused by a previous incarnation of a connection How to choose ISNs? Maximize period between reuse Minimize ability to guess (why?) May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 15 State Transitions LISTEN SYN/SYN + Send/ SYN SYN/SYN + SYN_RCVD SYN_SENT SYN + / FIN_WAIT_1 Passive open Close Close /FIN ESTABLISHED Close /FIN FIN/ FIN/ Close Active open/syn CLOSE_WAIT Close /FIN FIN_WAIT_2 CLOSING LAST_ Timeout after two segment lifetimes FIN/ TIME_WAIT May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 16 Again, with States SYN_SENT SYN, = x LISTEN Connection Teardown Orderly release by sender and receiver when done Delivers all pending data and hangs up Cleans up state in sender and receiver ESTABLISHED SYN +, = y, = x + 1 SYN_RCVD provides a symmetric close both sides shutdown independently, = y + 1 ESTABLISHED May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 17 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 18

May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 19 Connection Teardown The TIME_WAIT State Web server FIN_WAIT_1 FIN Web browser We wait 2MSL (two times the maximum segment lifetime of 60 seconds) before completing the close Why? FIN_WAIT_2 TIME_WAIT FIN CLOSE_WAIT LAST_ might have been lost and so FIN will be resent Could interfere with a subsequent connection Real life: Abortive close Don t wait for 2*MSL, simply send Reset packet (RST) Why? Frees up resources on heavily loaded servers May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 20 Flow Control Sender must transmit data no faster than it can be consumed by the receiver Receiver might be a slow machine App might consume data slowly Implement by adjusting the size of the sliding window used at the sender based on receiver feedback about available buffer space This is the purpose of the Advertised Window field Header Format Advertised window is used for flow control May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 21 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 22 Sender and Receiver Buffering Example Exchange of Packets Sending application LastByteWritten LastByteAcked LastByteSent Receiving application LastByteRead NextByteExpected LastByteRcvd T=1 T=2 T=3 Stall due to T=4 flow control here T=5 SEQ=1 =2; WIN=3 SEQ=2 =3; WIN=2 SEQ=3 SEQ=4 =4; WIN=1 Receiver has buffer of size 4 and application doesn t read = available buffer = buffer in use T=6 =5; WIN=0 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 23 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 24

May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 25 Example Buffer at Sender Lots of icky details T=1 T=2 T=3 T=4 T=5 =acked =sent =advertised Window probes Silly Window Syndrome Nagel s algorithm PAWS Etc Steven s books /IP Illustrated (vol 1,2) is a great source of information on this T=6 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 26 Example Icky Detail: Advertised Window Deadlock If the receiving process does not empty the buffer (e.g., not scheduled), then the sender fills up the receiver s buffer Advertised Window is 0 Effective Window goes to 0 when all data is ed Problem: When can the sender start sending again? No timeouts because all data is ed No packets from receiver with a new Advertised Window because receiver isn t running Solution: Ping with a segment of 1 byte of data Eventually receiver responds with a new Advert. Window Misc Header fields Header length allows for variable length header with options for extensions such as timestamps, selective acknowledgements, etc. protects header and data Urgent pointer/data not used in practice May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 27 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 28 applications HTTP/WWW FTP SMTP, POP, IMAP (E-mail) Why is well suited to these applications? User gram Protocol (UDP) Provides unreliable message delivery between processes Source port filled in by OS as message is sent Destination port identifies UDP delivery queue at endpoint Connectionless (no state about who talks to whom) 0 16 31 Length May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 29 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 30

May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 31 UDP Delivery UDP Ports Application process Application process Application process Kernel boundary UDP includes optional protection against errors intended as an end-to-end check on delivery So it covers data, UDP header, and IP pseudoheader Message Queues 0 16 31 Length DeMux Packets arrive May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 32 Applications for UDP Streaming media DNS (Domain Name Service) NTP (Network Time Protocol) Why is UDP appropriate for these? Homework Problems from Peterson & Davies: 1.7, 1.13 (a-d), 2.21, 2.23 (a), 4.5, 5.6 Extra Credit: 5.17 Next class: Congestion Control No new reading, make sure you re caught up May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 33 May 8, 2002 CSE 221 -- Lecture 5 Congestion Control 34