Title: CS2005 Networks and Operating Systems Transport Layer II
Authors: J.F Kurose and K.W. Ross
Copyright: ©1996-2016
Understand Key Concepts:
Connection-oriented transport
Transmission Control Protocol (TCP)
TCP Segment Structure
Reliable data transfer
Flow control
Connection management
Congestion control
Transport layer provides logical communication between application processes on different hosts.
Implemented in end systems, not in network routers.
Two key transport protocols in the Internet:
TCP (Transmission Control Protocol)
UDP (User Datagram Protocol)
Services provided by transport layer to applications:
Process-Level Addressing
Multiplexing and Demultiplexing
Integrity Checking and Error Detection
Connection Management (TCP only)
Acknowledgments and Retransmissions
Flow Control
Socket Identification:
UDP socket: identified by a 2-tuple (destination IP address + destination port number).
TCP socket: identified by a 4-tuple (source IP address + source port number + destination IP address + destination port number).
TCP requires a handshake between two processes before data transfer begins.
TCP connection is logical; state resides only in the end systems and not in intermediate routers.
TCP provides:
Full-duplex service: simultaneous data flow in both directions.
Point-to-point connection: between a single sender and a single receiver.
The connection establishment follows a three-way handshake process:
Client sends a TCP segment to establish a connection.
Server responds with a connection acknowledgment segment.
Client acknowledges the server’s connection acknowledgment.
A TCP connection has buffers, variables, and socket connections on both ends without allocation in network elements.
Data stream is passed through TCP’s send buffer, and segments sent to the network layer.
Maximum Segment Size (MSS) is determined by link layer frame size to ensure TCP segments fit into a single frame.
Each data chunk is paired with a TCP header to form TCP segments, which are encapsulated in IP datagrams.
Both sender and receiver maintain their own send and receive buffers.
TCP segment fields: source and destination ports, checksum, sequence number, acknowledgment number, receive window, header length.
The sequence number identifies the byte-stream number of the segment's first byte.
Acknowledgment number represents the next byte the receiver expects.
The TCP header is typically 20 bytes long, allowing for an optional field for maximum segment size and other parameters.
Header flags:
ACK: acknowledgment segment.
SYN: connection initiation.
FIN: connection termination.
CWR, ECE: congestion notification flags.
PSH: push data to the upper layer immediately.
URG: urgent data indication.
Sequence Number Field
First byte's number in the segment.
Acknowledgment Number Field
Indicates the next byte expected from sender.
Example of sequence/acknowledgment with data segments and their corresponding numbers.
Client sends 'C' with seq 42 to server and receives 'C' back.
Client's segments:
Seq 42, ACK 79, payload 'C'.
Seq 43, ACK 80.
Server's segment:
Seq 79, ACK 43, payload 'C'.
TCP ensures data stream integrity; data is uncorrupted, without gaps, duplication, or disorder.
Utilizes timeouts to manage lost segments and utilizes cumulative acknowledgments.
Potential issues with timeout settings affecting retransmissions.
Duplicate ACKs used to identify lost segments before timeouts occur.
Upon receiving three duplicate ACKs, fast retransmit is triggered for the presumed lost packet.
TCP uses flow control to match sending rates with receiving application rates.
Prevents overflow in the receiving buffer by utilizing a variable called the receive window (rwnd).
The receive window's size must always be managed within the limits of the receive buffer size.
Connection establishment involves a three-step handshake:
Client sends SYN segment with chosen initial sequence number.
Server acknowledges with SYN-ACK, allocates buffers, and sets initial sequence.
Client acknowledges server's SYN-ACK.
Either process can terminate a connection. Resources are deallocated upon closure.
Closure process entails following a four-segment exchange using FIN and ACK flags.
Focuses on managing withdrawal from network congestion using a congestion window (cwnd).
Traffic sending rate is adjusted based on perceived congestion.
TCP uses an additive increase/multiplicative decrease method for managing sending rates.
UDP allows application-level control, quick data transmission without connection delays, and lower overhead.
Suitable for real-time applications that can tolerate some data loss.
Comparatively, TCP introduces delays due to connection establishment and tracks connection state, affecting performance with many clients.
Understand Key Concepts from the session about TCP
Topics covering TCP include:
TCP Connection
TCP Segment Structure
Reliable Data Transfer
Flow Control
Connection Management
Congestion Control