Autumn 2000John Kristoff1 Transport Layer Computer Networks
Autumn 2000John Kristoff2 Where are we?
Autumn 2000John Kristoff3 Recall ÑNetwork Layer ÑProvides host-to-host communication ÑSource and destination addresses identify host interfaces ÑMachine-to-machine networking
Autumn 2000John Kristoff4 Transport Protocols Ñ Provide application-to-application communication Ñ Need extended addressing mechanism to identify applications Ñ Called end-to-end Ñ Optionally provide: ÑReliability ÑFlow Control ÑCongestion Control
Autumn 2000John Kristoff5 Example Transport Layer: Transmission Control Protocol (TCP) Ñ Standardized by IETF as RFC 793 Ñ Most popular layer 4 protocol Ñ Connection-oriented protocol Ñ Conceptually between applications and IP Ñ Full-duplex operation Ñ Byte-stream interface Ñ Of utmost importance for this class! Ñ The book: TCP/IP Illustrated, Volume I - W.R. Stevens Ñ Also see:
Autumn 2000John Kristoff6 TCP Feature Summary Provides a completely reliable (no data duplication or loss), connection-oriented, full-duplex stream transport service that allows two application programs to form a connection, send data in either direction and then terminate the connection.
Autumn 2000John Kristoff7 Relationship Between TCP and Other Protocols Ñ TCP on one computer uses IP to communicate with TCP on another computer
Autumn 2000John Kristoff8 Apparent Contradiction ÑIP offers best-effort (unreliable) delivery ÑTCP uses IP ÑTCP provides completely reliable transfer ÑHow is this possible?
Autumn 2000John Kristoff9 Achieving Reliability ÑReliable connection setup ÑReliable data transmission ÑReliable connection shutdown
Autumn 2000John Kristoff10 Reliable Data Transmission ÑPositive Acknowledgement Ñ Receiver returns short message when data arrives Ñ Call an acknowledgement ÑRetransmission Ñ Sender starts timer whenever message is transmitted Ñ If timer expires before acknowledgement arrives, sender retransmits message
Autumn 2000John Kristoff11 Retransmission Illustrated
Autumn 2000John Kristoff12 How Long Should TCP Wait Before Retransmitting? ÑTime for acknowledgement to arrive depends on ÑDistance to destination ÑCurrent traffic conditions ÑMultiple connections can be open simultaneously ÑTraffic conditions change rapidly
Autumn 2000John Kristoff13 Important Point The delay required for data to reach a destination and an acknowledgement to return depends on traffic in the internet as well as the distance to the destination. Since it allows multiple application programs to communicate with multiple destinations concurrently, TCP must handle a variety of delays that can change rapidly.
Autumn 2000John Kristoff14 Solving the Retransmission Problem ÑKeep estimate of round trip time on each connection ÑUse current estimate to set retransmission timer ÑKnown as adaptive retransmission Key to TCP s success
Autumn 2000John Kristoff15 Adaptive Retransmission Illustrated Ñ Timeout depends on current round-trip estimate
Autumn 2000John Kristoff16 TCP Flow Control ÑReceiver ÑAdvertises available buffer space ÑCalled the window ÑSender ÑCan send up to entire window before ACK arrives ÑAlso called a sliding window protocol
Autumn 2000John Kristoff17 Window Advertisement ÑEach acknowledgement carries new window information ÑCalled window advertisement ÑCan be zero (called closed window) ÑInterpretation: I have received up through X and can take Y more octets
Autumn 2000John Kristoff18 Window Advertisement Illustrated
Autumn 2000John Kristoff19 Another View: Sliding Window Illustrated
Autumn 2000John Kristoff20 Startup and Shutdown ÑConnection Startup ÑMust be reliable ÑConnection Shutdown ÑMust be graceful ÑDifficult
Autumn 2000John Kristoff21 Why Startup/Shutdown is Difficult ÑSegments can be Ñ lost Ñ duplicated Ñ delayed Ñ delivered out of order Ñ either side can crash Ñ either side can reboot Need to avoid duplicate shutdown "message from affecting later connection
Autumn 2000John Kristoff22 TCP s Startup Solution ÑUse three-message exchange ÑKnown as the 3-way handshake ÑNecessary and sufficient for unambiguous, reliable startup ÑSYN messages used for connection establishment
Autumn 2000John Kristoff23 3-Way Handshake Illustrated
Autumn 2000John Kristoff24 TCP s Shutdown Illustrated
Autumn 2000John Kristoff25 Byte Stream Sequencing Ñ Segments are labeled with a sequence number Ñ Protects from out-of-order delivery Ñ 32-bit number Ñ Limited size of byte stream? Ñ Initial Sequence Numbers (ISNs) must be exchanged at TCP connection establishment
Autumn 2000John Kristoff26 More Complete Illustration of the 3-Way Handshake
Autumn 2000John Kristoff27 Application Multiplexing ÑCannot extend IP address ÑNo unused bits ÑCannot use OS dependent quantity ÑProcess ID ÑTask number ÑJob name ÑMust work on all computer systems
Autumn 2000John Kristoff28 Application Multiplexing Illustrated
Autumn 2000John Kristoff29 Protocol Ports Ñ Each application assigned a unique integer Ñ Server Ñ Follows standard Ñ Always uses same port number Ñ Usually uses lower port numbers Ñ Client Ñ Obtains unused port from protocol software Ñ Usually uses higher port numbers
Autumn 2000John Kristoff30 Protocol Port Example Ñ Web server application is assigned port 80 Ñ Web client application obtains port Ñ TCP segment sent from client to server has Ñ source port number Ñ destination port number 80 Ñ When web server responds, TCP segment has Ñ source port number 80 Ñ destination port number 32938
Autumn 2000John Kristoff31 Standard Protocol Ports Ñ See for standard protocol port assignments Ñ See /etc/services in UNIX systems and \winnt\system32\drivers\etc\services in Windows NT
Autumn 2000John Kristoff32 TCP Segment Format
Autumn 2000John Kristoff33 Example Transport Layer: User Datagram Protocol (UDP) ÑUnreliable message delivery ÑConnectionless protocol ÑNo flow control (no window) ÑNo error recovery (no ACKs) ÑProvides application multiplexing ÑError detection optional (checksum field)
Autumn 2000John Kristoff34 UDP Message Format