Computer Networking: The Transport Layer
Table of Contents
- Computer Networking: The Transport Layer
- Transport Layer: Services and Introduction
- Transport Layer Multiplexing and Demultiplexing
- UDP: The Connectionless Transport Protocol
- Principles of Reliable Data Transfer Protocols
- TCP: The Internet's Reliable Transport Protocol
- Principles of Network Congestion Control
- TCP Congestion Control: Mechanisms and Evolution
- Transport Layer Evolution: Addressing Modern Networking Needs
Computer Networking: The Transport Layer
Chapter 3 of "Computer Networking: A Top-Down Approach" delves into the crucial role of the transport layer, situated between the application and network layers. This chapter discusses various problems that arise in providing communication services to applications and the corresponding solutions implemented by transport-layer protocols, primarily focusing on UDP and TCP in the context of the Internet. It also covers fundamental principles and recent evolutions in transport-layer functionality.
Problems Raised and Their Solutions:
- Extending Host-to-Host Delivery to Process-to-Process Delivery: The network layer (IP) provides communication between end hosts. However, on a host, multiple application processes might be running. The transport layer faces the problem of directing incoming data to the correct application process and gathering data from different processes for transmission.
- Solution: Multiplexing and demultiplexing are employed [3.2, 46, 48]. Each application process is associated with a unique identifier called a port number. Source and destination port numbers are included in the transport-layer segment headers (UDP datagrams and TCP segments) [3.3.1, 3.5.2, 80]. The transport layer at the receiving host uses these port numbers to demultiplex the incoming segments to the appropriate application-layer socket. A socket is fully identified by a combination of the source IP address, source port number, destination IP address, and destination port number for TCP, while UDP sockets are identified by the destination IP address and destination port number.
- Unreliable Network Layer: The Internet Protocol (IP) provides a "best-effort" delivery service, which is unreliable. IP datagrams can be lost, corrupted, or delivered out of order. The transport layer needs to address these potential issues to provide reliable communication for applications that require it.
- Solutions:
- Reliable Data Transfer Protocols (General Principles and TCP): To combat data loss and corruption, transport protocols implement mechanisms such as acknowledgments (ACKs), negative acknowledgments (NAKs), sequence numbers, timers, and retransmission of lost or corrupted packets [3.4, 40, 51, 52, 53, 54, 55, 56, 57, 58, 59, 71, 72, 78, 79, 82, 90]. Sequence numbers allow the receiver to order packets correctly and detect duplicates. Timers are used by the sender to detect packets that have not been acknowledged within a certain period, leading to retransmission. The chapter explores various reliable data transfer protocols, including Alternating Bit Protocol, Go-Back-N (GBN) [3.4.3, 79, 82, 83], and Selective Repeat (SR) [3.4.4]. TCP provides reliable data transfer using a combination of these principles [3.5.4, 59, 72].
- Error Detection: Both UDP and TCP include checksum fields in their segment headers to detect if the data has been corrupted during transmission [3.3.2, 46, 50, 59, 106]. UDP typically discards damaged segments or passes them to the application with a warning. TCP, upon detecting an error, will retransmit the segment as part of its reliable data transfer mechanism.
- Solutions:
- Network Congestion: When too many sources send data at a high rate, network congestion can occur, leading to router buffer overflows and packet loss [3.6, 61, 63, 64, 65, 86]. This not only results in retransmissions but can also significantly degrade the overall network performance and throughput experienced by applications.
- Solutions:
- Congestion Control (General Principles and TCP): Transport-layer protocols, particularly TCP, implement congestion control mechanisms to throttle senders in the face of network congestion [3.6, 41, 61, 62, 65, 66]. TCP employs an end-to-end congestion control approach where it infers congestion based on observed packet loss (indicated by timeouts or duplicate ACKs) [3.7, 66, 69, 73]. The TCP congestion control algorithm has three main phases: slow start, congestion avoidance, and fast recovery [3.7, 67, 68]. TCP uses a congestion window (cwnd) to limit the number of unacknowledged bytes it can send. This window is adjusted based on network conditions: it increases when ACKs are received (indicating no congestion) and decreases when packet loss is detected. Newer versions of TCP also incorporate explicit congestion notification (ECN) from the network layer and delay-based congestion control [3.7.2, 69, 74]. The goal of TCP's congestion control is also to provide fairness among competing flows [3.7.3, 73].
- Solutions:
- Receiver Buffer Overflow: A fast sender might transmit data at a rate higher than the receiver can process or buffer, leading to buffer overflow at the receiver [3.5.5, 60].
- Solution: TCP implements flow control using a receive window (rwnd) advertised by the receiver to the sender [3.5.5, 60, 72]. The rwnd indicates the amount of free buffer space at the receiver. The sender limits the amount of unacknowledged data it sends to be within the advertised rwnd, preventing the receiver from being overwhelmed.
Aspects Covered in Chapter 3:
- Introduction and Transport-Layer Services: This section establishes the role of the transport layer in providing logical communication between application processes [3.1, 42]. It outlines the services a transport layer can offer, including reliable data transfer, throughput guarantees, timing, and security (though security is primarily covered in Chapter 8) [3.1.2, 28, 29, 42]. It also differentiates between the services provided by UDP (unreliable, connectionless) and TCP (reliable, connection-oriented) in the Internet [3.1.2, 44, 46].
- Multiplexing and Demultiplexing: This fundamental concept explains how the transport layer handles multiple application flows sharing the same network connection by using port numbers [3.2, 48, 49].
- Connectionless Transport: UDP: This section details the User Datagram Protocol, its segment structure, and the checksum mechanism for error detection. It emphasizes UDP's simplicity and its suitability for applications that are delay-sensitive or can tolerate some data loss [3.3, 44, 46, 50, 77].
- Principles of Reliable Data Transfer: This core section explores the fundamental concepts and building blocks required to achieve reliable data transfer over an unreliable channel [3.4, 51, 52, 53, 54, 55, 56, 57, 71]. It introduces various протоколи like stop-and-wait and pipelined protocols (GBN and SR), analyzing their mechanisms for handling errors and losses.
- Connection-Oriented Transport: TCP: This section provides a comprehensive overview of the Transmission Control Protocol, including TCP connection establishment (three-way handshake) and termination [3.5.1, 85], segment structure [3.5.2, 260], round-trip time estimation and timeout [3.5.3, 58, 86], reliable data transfer mechanisms (acknowledgments, retransmissions, sequence numbers) [3.5.4, 59], flow control using the receive window [3.5.5, 60], and TCP connection management [3.5.6, 85].
- Principles of Congestion Control: This section discusses the causes and costs of network congestion and introduces different approaches to congestion control, broadly categorizing them into end-to-end and network-assisted methods [3.6, 61, 62, 63, 64, 65, 66].
- TCP Congestion Control: This detailed section explains TCP's specific congestion control algorithm, covering slow start, congestion avoidance, and fast recovery [3.7, 66, 67, 68, 73, 88]. It also discusses network-assisted explicit congestion notification (ECN), delay-based congestion control, and the concept of fairness among TCP flows [3.7.2, 3.7.3, 69, 70, 73, 74]. The evolution of TCP congestion control protocols like TCP Reno and TCP CUBIC is also mentioned [3.7.1, 3.7.2, 66, 87].
- Evolution of Transport-Layer Functionality: This section touches upon recent developments, notably the QUIC protocol, which implements many transport-layer functions (reliability, congestion control, multiplexing) at the application layer on top of UDP [3.8, 31, 70, 74]. This section highlights the ongoing evolution and innovation in transport-layer design.
Key Points to Remember from Chapter 3:
- The transport layer provides logical end-to-end communication between application processes running on different hosts, abstracting away the details of the underlying network.
- UDP is a connectionless, unreliable protocol offering basic services like process-to-process delivery and error checking via checksums. It is suitable for applications where speed and low overhead are prioritized over guaranteed delivery [3.3, 44, 46].
- TCP is a connection-oriented, reliable protocol that provides ordered and error-free delivery of data. It achieves this through mechanisms like sequence numbers, acknowledgments, and retransmissions [3.5, 44, 59].
- Multiplexing and demultiplexing, using port numbers, allow multiple applications on a host to simultaneously use the network [3.2, 48].
- Reliable data transfer over an unreliable network is a fundamental problem addressed by transport protocols using techniques like ACKs, timers, and sequence numbers [3.4, 51, 52, 71].
- TCP implements flow control to prevent the sender from overwhelming the receiver's buffer using the receive window [3.5.5, 60].
- Congestion control is crucial for preventing network collapse and ensuring fair bandwidth sharing. TCP's congestion control mechanism dynamically adjusts the sending rate based on network conditions inferred from packet loss and acknowledgments [3.6, 3.7, 61, 66, 73].
- The choice between TCP and UDP depends on the specific requirements of the network application regarding reliability, overhead, and delay sensitivity.
- Newer protocols like QUIC are emerging, implementing transport-layer functionalities in the application layer to potentially improve performance and flexibility [3.8, 31, 70].
- Understanding the principles of reliable data transfer and congestion control is fundamental to comprehending how the Internet effectively supports a wide range of applications.
In summary, Chapter 3 provides a thorough grounding in the principles and protocols of the transport layer, highlighting the critical role it plays in enabling reliable and efficient communication for network applications despite the underlying network's inherent limitations. The chapter emphasizes the contrasting services offered by UDP and TCP and delves into the complexities of achieving reliability and managing congestion in computer networks.
Transport Layer: Services and Introduction
In Section 3.1, "Introduction and Transport-Layer Services," of Chapter 3, the textbook introduces the fundamental role of the transport layer and the services it provides, setting the stage for the more detailed discussions in the subsequent sections. While this section primarily introduces the concepts rather than deeply delving into problems and solutions, it does highlight the essential need for a transport layer and hints at the challenges it addresses.
Problems Raised (or Needs Highlighted):
- Extending Host-to-Host Delivery to Process-to-Process Communication: The network layer (IP) provides communication between end hosts. However, applications run as processes on these hosts, and multiple processes might be communicating over the network. Section 3.1 emphasizes the need for the transport layer to extend this host-to-host delivery to provide logical communication directly between these application processes running on different hosts. This implies the problem of how to identify and address specific processes within a host.
- Dealing with an Unreliable Network Layer: The Internet Protocol (IP), which operates at the network layer, offers a "best-effort" delivery service that is inherently unreliable. IP does not guarantee segment delivery, in-order delivery, or data integrity. Section 3.1 implicitly raises the problem of how to achieve reliable communication for applications that require it, given this unreliable underlying network layer.
Solutions (Introduced at a High Level):
- Transport-Layer Multiplexing and Demultiplexing: To address the need for process-to-process delivery, Section 3.1 introduces the concept of transport-layer multiplexing and demultiplexing. This is the fundamental service provided by the transport layer to extend the network layer's host-to-host delivery to process-to-process delivery. The text mentions that UDP and TCP provide this service, and Section 3.2 will delve into this in more detail. The use of port numbers to identify application processes is a key component of this solution, although not elaborated upon in 3.1 but mentioned in the context of extending IP's delivery service.
- Reliable Data Transfer Mechanisms: While not detailed in Section 3.1, the text states that a transport protocol can offer reliable data transfer service to an application even when the underlying network protocol is unreliable. This hints at the existence of mechanisms within the transport layer to handle the unreliability of IP, which will be explored in detail in later sections (3.4 and 3.5). The introduction mentions that TCP provides a reliable, connection-oriented service, contrasting with UDP's unreliable, connectionless service.
Aspects Covered in Section 3.1:
- Relationship Between Transport and Network Layers: This subsection (3.1.1) establishes the position of the transport layer in the layered network architecture, residing between the application and network layers. It emphasizes that the transport layer relies on the network layer's host-to-host communication service. It also points out that a transport protocol can offer services not provided by the network layer.
- Overview of the Transport Layer in the Internet: This subsection (3.1.2) introduces the two primary transport-layer protocols available in the Internet: UDP (User Datagram Protocol) and TCP (Transmission Control Protocol). It highlights the key difference in their service models: UDP provides an unreliable, connectionless service, while TCP offers a reliable, connection-oriented service. The application developer must choose one of these when designing a network application. The section also briefly describes the Internet's network-layer protocol, IP, and its best-effort, unreliable delivery service.
- Logical Communication: Section 3.1 introduces the concept of logical communication provided by the transport layer. From an application's perspective, it appears as if the hosts running the processes are directly connected, even though they might be geographically distant and connected by numerous routers and links. This abstraction shields the application from the complexities of the underlying physical infrastructure.
- Services a Transport Protocol Can Offer (High-Level Introduction): Although a more detailed discussion occurs in Chapter 2, Section 3.1 sets the stage by implying the types of services a transport layer can offer, such as reliability and process-to-process delivery.
Key Points to Remember from Section 3.1:
- The transport layer provides logical communication between application processes running on different hosts.
- This logical communication hides the complexities of the underlying network from the applications.
- The Internet offers two main transport-layer protocols: UDP and TCP.
- UDP is unreliable and connectionless, suitable for applications that prioritize speed or can tolerate loss.
- TCP is reliable and connection-oriented, providing guaranteed delivery for applications that require it.
- The choice between UDP and TCP is made by the application developer based on the application's requirements.
- The network layer (IP) provides a best-effort, unreliable host-to-host delivery service.
- Transport-layer protocols extend this host-to-host delivery to process-to-process delivery through multiplexing and demultiplexing.
- Transport protocols can potentially provide services (like reliability) that are not offered by the network layer.
In essence, Section 3.1 lays the groundwork for understanding the transport layer by defining its primary goal of facilitating communication between application processes and introducing the two fundamental transport protocols in the Internet, along with a preliminary understanding of their contrasting service models and their relationship with the network layer. The section emphasizes the crucial role of the transport layer as a bridge between the application's needs and the network's capabilities.
Transport Layer Multiplexing and Demultiplexing
In Section 3.2, "Multiplexing and Demultiplexing," a fundamentally important problem in computer networking is addressed: how to extend the host-to-host delivery service provided by the network layer (IP) to a process-to-process delivery service for applications running on end hosts. This section elaborates on the basic transport-layer service of multiplexing and demultiplexing within the context of the Internet.
Problems Raised:
The primary problem highlighted in this section is that while the network layer can deliver datagrams between any two end systems, applications running on these hosts communicate with specific processes, not necessarily the entire host. A single host can run multiple network applications concurrently, each involving one or more processes. Therefore, the transport layer must provide a mechanism to ensure that data arriving at a host is directed to the correct application process, and conversely, data originating from different application processes is correctly handled for transmission over the network.
Solutions:
The transport layer solves this problem through the techniques of multiplexing at the sender and demultiplexing at the receiver.
- Multiplexing (at the Sender): This is the job of gathering data chunks at the source host from different sockets, encapsulating each data chunk with header information, and then passing these segments down to the network layer. This header information will later be used for demultiplexing at the destination host. Ann's action of collecting letters from her siblings and giving them to the mail person serves as a household analogy for multiplexing.
- Demultiplexing (at the Receiver): This is the job of delivering the data in a received transport-layer segment to the correct socket running the application process. At the receiving end, the transport layer examines specific fields in the segment's header to identify the receiving socket and then directs the segment to that socket. Bill receiving a batch of mail and distributing it to the correct family members based on the address is the analogy used to explain demultiplexing.
For transport-layer multiplexing and demultiplexing to work, two requirements must be met:
- Sockets must have unique identifiers.
- Each segment must have special fields that indicate the socket to which the segment is to be delivered.
These special fields are the source port number field and the destination port number field, which are present in both UDP and TCP segment headers. Each port number is a 16-bit number, ranging from 0 to 65535. Port numbers from 0 to 1023 are designated as well-known port numbers and are reserved for use by well-known application protocols like HTTP (port 80) and FTP (port 21). When a new application is developed, it needs to be assigned a port number.
The middle host in a network also performs demultiplexing of segments arriving from the network layer to the appropriate process and multiplexing of outgoing data from sockets to the network layer. Multiplexing and demultiplexing are not exclusive to the transport layer; they are relevant whenever a single protocol at one layer is used by multiple protocols at the next higher layer.
Aspects Covered:
Section 3.2 primarily covers the following aspects:
- The Fundamental Mechanism: It explains the core concepts of multiplexing and demultiplexing as the basis for providing process-to-process communication.
- Port Numbers as Identifiers: It details the role of source and destination port numbers in identifying the sending and receiving application processes. The range and significance of well-known port numbers are also covered.
- Connectionless (UDP) Multiplexing and Demultiplexing: For UDP, a connectionless transport protocol, the demultiplexing is based on a two-tuple: the destination IP address and the destination port number. If two UDP segments have different destination IP addresses or different destination port numbers, they will be directed to different sockets. Note that the source IP address and source port number are also included in the UDP segment header and can be used for replies, but for demultiplexing to a receiving socket, only the destination information is crucial.
- Connection-Oriented (TCP) Multiplexing and Demultiplexing: For TCP, a connection-oriented transport protocol, demultiplexing is based on a four-tuple: the source IP address, source port number, destination IP address, and destination port number. Therefore, two TCP segments arriving at the same destination host with the same destination port number but different source IP addresses and/or source port numbers will be directed to different sockets. This allows a server to handle multiple simultaneous TCP connections from different clients, even if they use the same source port number, as their IP addresses will be different. For example, multiple HTTP sessions to a server (port 80) from different client hosts will be demultiplexed correctly because they will have unique source IP addresses in the four-tuple, even if the clients happen to choose the same source port number.
- The Role of Sockets: The section emphasizes that multiplexing happens from sockets at the sender, and demultiplexing delivers data to sockets at the receiver. Sockets are the interface between the application process and the transport layer.
- Generality of the Concepts: While discussed in the context of Internet transport protocols, the principles of multiplexing and demultiplexing are applicable in various layers of computer networks whenever a protocol serves multiple higher-layer entities.
Key Points to Remember:
- The transport layer provides process-to-process communication by extending the network layer's host-to-host delivery.
- Multiplexing at the sender gathers data from multiple application sockets and prepares it for network transmission.
- Demultiplexing at the receiver directs incoming data to the correct application socket.
- Port numbers are essential for identifying application processes at the transport layer.
- Well-known port numbers (0-1023) are reserved for standard application protocols.
- UDP demultiplexing uses a two-tuple: (destination IP address, destination port number).
- TCP demultiplexing uses a four-tuple: (source IP address, source port number, destination IP address, destination port number).
- A TCP server supporting n simultaneous connections from different client hosts would need n sockets to distinguish each connection uniquely based on the four-tuple identifier.
- Transport-layer multiplexing and demultiplexing are fundamental services needed for all computer networks.
Following this discussion, the book proceeds to delve into one of the Internet's transport protocols, UDP, highlighting that UDP adds little more to the network layer than this multiplexing/demultiplexing service and integrity checking.
UDP: The Connectionless Transport Protocol
In Section 3.3, "Connectionless Transport: UDP", the text addresses the need for a lightweight and minimal transport protocol in the Internet. Given that the network layer (IP) provides a basic "best-effort" delivery service between hosts without guarantees of delivery, order, or integrity, and that some applications might prioritize speed and low overhead over reliability, UDP emerges as a solution.
Problems Raised (Implicit):
While Section 3.3 doesn't explicitly list problems in the sense of failures of other protocols, it implicitly addresses the following situations where a simpler transport service is preferred:
- Overhead of Connection Establishment: Connection-oriented protocols like TCP require a handshaking process before data transfer can begin. For some applications, this initial delay is undesirable. UDP avoids this delay because it is connectionless and "just blasts away without any formal preliminaries". This is a significant reason why DNS, for example, often runs over UDP, as a TCP connection setup for every DNS query would introduce considerable latency.
- Connection State Maintenance: TCP maintains connection state information in the end systems, including buffers, congestion control parameters, and sequence/acknowledgment numbers. This state can consume resources on servers, limiting the number of concurrent clients they can support. UDP, being connectionless, does not maintain this state, allowing a server to potentially handle many more active clients simultaneously.
- Transmission Rate Constraints due to Congestion Control: TCP incorporates congestion control mechanisms to prevent overwhelming the network. While crucial for the overall health of the Internet, some applications, like multimedia streaming, might prefer to control their transmission rate directly and tolerate occasional packet loss rather than having their rate throttled by TCP's congestion control. By using UDP, applications can circumvent TCP's congestion control and packet overheads.
- Need for Minimal Header Overhead: TCP segments have a larger header (20 bytes) compared to UDP segments (8 bytes). For applications transmitting small amounts of data, the overhead of TCP might be disproportionately high. UDP's smaller header reduces this overhead.
Solutions Offered by UDP:
UDP offers a "no-frills, lightweight transport protocol, providing minimal services". The core solutions it provides are:
- Multiplexing and Demultiplexing: Like TCP, UDP provides the fundamental service of multiplexing data from multiple application processes at the sender and demultiplexing received data to the correct processes at the receiver. This is achieved through the inclusion of source port number and destination port number fields in the UDP segment header. When a UDP segment arrives at a host, the transport layer examines the destination port number to direct the segment's data to the appropriate application socket.
- Optional Integrity Checking: UDP includes a checksum field in its header. This allows the receiver to perform a basic check for errors that might have been introduced during transmission. The checksum is calculated over the UDP segment (header plus data) and, in practice, also includes some fields from the IP header. However, UDP's error checking is light, and it does not attempt to recover from detected errors. Some UDP implementations might discard damaged segments, while others might pass them to the application with a warning. The presence of the checksum serves as a safety measure, especially since the underlying IP layer is unreliable.
- Connectionless Service: UDP is connectionless, meaning there is no handshaking or connection establishment phase before data transmission. This simplifies the protocol and reduces latency for applications where a quick transmission is more important than guaranteed delivery.
Aspects Covered:
Section 3.3 covers the following aspects of UDP:
- UDP Service Model: It describes UDP as an unreliable and connectionless transport protocol that provides minimal services. It highlights the "no-frills" nature of UDP and its contrast with TCP.
- UDP Segment Structure: The section details the format of a UDP segment. It explains the purpose of each field in the 8-byte UDP header:
- Source Port Number: Identifies the sending process (optional in IPv4).
- Destination Port Number: Identifies the receiving process.
- Length: Specifies the total length of the UDP segment in bytes (header + data). This is necessary because the size of the data field can vary.
- Checksum: Used for error detection.
- Advantages of UDP: The section outlines the reasons why an application developer might choose to use UDP over TCP:
- No connection establishment delay.
- No connection state. This allows for a greater number of concurrent users for server applications.
- Small packet header overhead.
- No congestion control: This can be an advantage for applications that need to maintain a constant sending rate, although it needs to be managed carefully to avoid network congestion. Applications can implement their own congestion control mechanisms if needed.
- Finer application control: UDP offers more control over what data is sent and when, as it doesn't have the buffering and transmission timing constraints of a connection-oriented protocol like TCP.
- Use Cases of UDP: The section provides examples of applications that commonly use UDP, such as DNS, SNMP (Simple Network Management Protocol), and multimedia applications like Internet telephony and streaming. It notes that while reliability is often crucial for applications like web browsing (which typically uses TCP), other applications can tolerate some packet loss in exchange for lower latency and overhead. It also mentions that some applications, like QUIC, build reliability on top of UDP at the application layer.
- Possibility of Reliable Data Transfer over UDP: The text points out that it is possible for an application to achieve reliable data transfer even when using UDP by implementing its own mechanisms for acknowledgments, retransmissions, and sequence numbering at the application layer. However, this is a complex undertaking.
- Security Considerations: The section briefly touches on security, noting that some organizations block UDP traffic for security reasons (further discussed in Chapter 8).
Key Points to Remember:
- UDP is a connectionless and unreliable transport protocol.
- It provides multiplexing and demultiplexing of application data using port numbers.
- It offers an optional checksum for error detection but does not guarantee data integrity or recovery from errors.
- UDP does not have a connection establishment phase, reducing initial delays.
- It maintains no connection state, allowing servers to support more concurrent clients.
- UDP has a smaller header overhead (8 bytes) compared to TCP (20 bytes).
- It does not include congestion control, giving applications more control over their transmission rate but requiring careful management.
- Applications that prioritize speed, low latency, or need to avoid TCP's overhead or congestion control might choose UDP. Examples include DNS, SNMP, and some multimedia applications.
- Reliability can be implemented at the application layer on top of UDP, as seen in protocols like QUIC.
In essence, Section 3.3 positions UDP as a simple and efficient transport protocol for applications that either do not require the guarantees provided by TCP or implement their own reliability and congestion control mechanisms. It highlights the trade-offs between reliability and overhead/latency, showcasing UDP's role in scenarios where the latter are more critical.
Principles of Reliable Data Transfer Protocols
Section 3.4, "Principles of Reliable Data Transfer", addresses the fundamental problem of achieving reliable communication over an unreliable underlying network. This section explores various scenarios of channel unreliability and progressively builds reliable data transfer protocols (rdt) to tackle these challenges.
Problems Raised (and Addressed Incrementally):
- Reliable Data Transfer over a Perfectly Reliable Channel: While seemingly trivial, this initial scenario (addressed by protocol rdt1.0) establishes the basic framework for sender and receiver interactions. The implicit problem is to define the fundamental steps of sending and receiving data in an idealized setting. The solution is a simple protocol where the sender sends data, and the receiver receives and delivers it to the upper layer without any error checking or feedback.
- Reliable Data Transfer over a Channel with Bit Errors: This introduces the more realistic problem of data corruption during transmission. The challenge is to detect these bit errors and recover from them. Protocol rdt2.0 addresses this by incorporating error detection using checksums and introducing feedback from the receiver to the sender. The receiver sends acknowledgments (ACKs) for correctly received packets and negative acknowledgments (NAKs) for packets with detected errors. Upon receiving a NAK, the sender retransmits the corrupted packet. This introduces the concept of Automatic Repeat reQuest (ARQ) protocols.
- Handling Corrupted ACKs/NAKs: A flaw in rdt2.0 is the possibility of ACKs or NAKs themselves being corrupted. If an ACK or NAK is garbled, the sender doesn't know if the data was received correctly. Protocol rdt2.1 tackles this by adding sequence numbers to the data packets. The receiver uses the sequence number to determine if a received packet is a retransmission, and the sender can handle a corrupted ACK/NAK by retransmitting and relying on the sequence number for the receiver to identify duplicates. This leads to stop-and-wait behavior, where the sender sends one packet and waits for a response before sending the next.
- NAK-free Reliable Data Transfer: Protocol rdt2.2 refines rdt2.1 by eliminating the need for explicit NAK packets. Instead, the receiver sends an ACK for the last correctly received packet. If a packet is lost or corrupted, the sender will eventually receive a duplicate ACK for the previous packet, indicating that the subsequent packet needs to be retransmitted. The ACK now includes the sequence number of the packet being acknowledged, and the sender checks this sequence number.
- Reliable Data Transfer over a Lossy Channel with Bit Errors: This scenario adds the complexity of packet loss to bit errors. Protocol rdt3.0 addresses this by introducing timers at the sender. If an ACK is not received within a certain timeout period after sending a packet, the sender assumes the packet (or its ACK) was lost and retransmits the packet. Sequence numbers are again crucial for handling potential duplicate packets arising from retransmissions due to timeouts. Because it alternates between sequence numbers 0 and 1, rdt3.0 is also known as the alternating-bit protocol.
- Performance Limitations of Stop-and-Wait: The stop-and-wait nature of rdt3.0 leads to poor channel utilization, especially in high-speed networks with significant round-trip times (RTT). The sender remains idle while waiting for an acknowledgment. The solution to this performance bottleneck is pipelining, where the sender is allowed to send multiple packets without waiting for individual acknowledgments.
- Inefficiencies of Go-Back-N (GBN): While pipelining improves performance, a simple pipelined protocol like Go-Back-N (GBN) can be inefficient. In GBN, the sender maintains a window of unacknowledged packets. If a packet is lost, the sender retransmits all packets in its window starting from the lost one, even if subsequent packets were received correctly. This can lead to unnecessary retransmissions.
- Need for More Efficient Retransmission: Selective Repeat (SR) is introduced as a more sophisticated pipelined protocol that aims to overcome the inefficiency of GBN. In SR, the sender can retransmit only the packets that are believed to be lost. The receiver acknowledges each correctly received packet (both in-order and out-of-order) and buffers out-of-order packets. The sender maintains a more complex state, keeping track of the acknowledgments for each packet in its window.
Aspects Covered:
Section 3.4 covers several crucial aspects of reliable data transfer:
- Service Model: It clearly defines the desired service provided to the upper layer: a reliable channel where data is delivered without corruption, loss, or reordering. This service model is the abstraction that reliable data transfer protocols aim to implement.
- Protocol Design Principles: The section systematically introduces fundamental principles for building reliable protocols, including error detection (checksums), feedback (ACKs/NAKs), retransmission (ARQ), sequence numbering, and the use of timers.
- Stop-and-Wait Protocols: It details the operation and limitations of stop-and-wait protocols (rdt2.0, rdt2.1, rdt2.2, rdt3.0), which form the foundation for understanding more complex protocols. Finite State Machines (FSMs) are used to describe the sender and receiver behavior for each of these protocols.
- Pipelining: The concept of pipelining is introduced as a key technique to improve channel utilization by allowing multiple packets to be in transit simultaneously.
- Go-Back-N (GBN): The GBN protocol is explained, highlighting its use of a window, cumulative acknowledgments, and retransmission of the entire window upon a timeout or negative acknowledgment.
- Selective Repeat (SR): The SR protocol is presented as a more efficient alternative to GBN, allowing for the selective retransmission of lost packets and requiring receiver buffering. The sender and receiver must maintain window boundaries and track the status of individual packets within the window.
- Handling Channel Impairments: The section progressively addresses how to cope with bit errors (using checksums and ARQ), packet loss (using timers and retransmissions), and the challenges these introduce in terms of duplicate packets (handled by sequence numbers).
- Unidirectional Data Transfer: For simplicity, the initial discussion focuses on unidirectional data transfer, although it acknowledges that control packets (ACKs, NAKs) flow in the reverse direction.
- Practical Relevance: The section implicitly sets the stage for understanding how real-world transport protocols like TCP implement reliable data transfer by highlighting the fundamental techniques that will be seen again in the context of TCP.
Key Points to Remember:
- Reliable data transfer over an unreliable channel is a fundamental challenge in computer networking.
- ARQ protocols, which use acknowledgments and retransmissions, are a common approach to achieving reliability.
- Checksums are used for error detection.
- Sequence numbers are essential for identifying duplicate packets, especially in the presence of retransmissions due to errors or loss. A 1-bit sequence number suffices for stop-and-wait protocols.
- Timers are used to detect packet loss when acknowledgments are not received within a reasonable timeframe.
- Stop-and-wait protocols are simple but suffer from low channel utilization.
- Pipelining improves throughput by allowing multiple packets to be in transit.
- Go-Back-N (GBN) is a pipelined protocol with cumulative acknowledgments; a single lost packet can trigger the retransmission of multiple packets.
- Selective Repeat (SR) is a more efficient pipelined protocol that retransmits only lost packets and requires receiver buffering.
- The principles discussed in this section are not limited to the transport layer and can be applied at other layers, such as the link layer.
- TCP, the Internet's reliable transport protocol, builds upon many of the concepts introduced in this section, including error detection, acknowledgments, retransmissions, sequence numbers, and timers.
In summary, Section 3.4 lays the groundwork for understanding reliable data transfer by dissecting the problem into manageable parts, introducing key techniques, and illustrating their application through a series of increasingly sophisticated protocols. It highlights the trade-offs between simplicity and efficiency in designing reliable communication mechanisms and sets the stage for the subsequent discussion of TCP.
TCP: The Internet's Reliable Transport Protocol
Section 3.5, "Connection-Oriented Transport: TCP", delves into the details of the Transmission Control Protocol (TCP), the Internet's primary connection-oriented and reliable transport protocol. This section builds upon the fundamental principles of reliable data transfer discussed in Section 3.4.
Problems Raised (and Solutions Provided by TCP):
- Unreliable Network Layer: TCP operates on top of an unreliable network layer (IP). Packets can be lost, corrupted, or delivered out of order.
- Solution: TCP implements reliable data transfer mechanisms using a combination of sequence numbers, acknowledgments, retransmissions, and checksums.
- Sequence Numbers: Each byte in the TCP data stream is assigned a sequence number, ensuring ordered delivery and detection of duplicates. The 32-bit sequence number field in the TCP segment header carries this information. For example, if a file is divided into segments, each segment is associated with a range of sequence numbers corresponding to the bytes it carries.
- Acknowledgments (ACKs): The receiver sends acknowledgments back to the sender, indicating the next expected sequence number, implying that all preceding bytes have been received correctly. TCP uses cumulative acknowledgments, where an ACK with value y acknowledges the receipt of all bytes before byte number y.
- Retransmissions: The sender maintains a timer for each sent segment. If an acknowledgment is not received within the timeout interval, the sender retransmits the segment. TCP also employs fast retransmit, where the sender retransmits a segment upon receiving three duplicate ACKs, indicating likely loss.
- Checksum: Each TCP segment includes a checksum in its header to detect bit errors during transmission. If a corrupted segment arrives, it is discarded by the receiver.
- Solution: TCP implements reliable data transfer mechanisms using a combination of sequence numbers, acknowledgments, retransmissions, and checksums.
- Flow Control: The sender might transmit data at a rate faster than the receiver's application can consume it, potentially leading to receiver buffer overflow.
- Solution: TCP provides a flow control service using a receive window (rwnd). The receiver advertises the amount of free space in its receive buffer to the sender in the TCP header's window field. The sender limits the amount of unacknowledged data it sends to be no more than the advertised receive window. This prevents the sender from overwhelming the receiver. A mechanism exists to prevent deadlock when the receive window becomes zero; the sender is required to continue sending segments with one data byte, which will be acknowledged with an updated rwnd value once space becomes available.
- Connection Establishment and Teardown: Before data transfer can begin, a connection needs to be established, and after the transfer, it needs to be gracefully terminated.
- Solution: TCP uses a three-way handshake to establish a connection.
- The client sends a SYN (synchronize) segment with its initial sequence number (client_isn).
- The server responds with a SYNACK segment, acknowledging the client's SYN (ack = client_isn + 1) and including its own initial sequence number (server_isn). The server also allocates buffers and variables for the connection at this stage.
- The client sends an ACK segment acknowledging the server's SYN (ack = server_isn + 1).
- TCP uses a four-way handshake to terminate a connection. Either side can initiate termination by sending a FIN (finish) segment.
- Host A sends a FIN segment.
- Host B acknowledges the FIN by sending an ACK.
- Host B then sends its own FIN segment.
- Host A acknowledges Host B's FIN with an ACK.
- TCP manages various connection states during the life of a connection, such as CLOSED, LISTEN, SYN_SENT, SYN_RCVD, ESTABLISHED, FIN_WAIT_1, FIN_WAIT_2, TIME_WAIT, CLOSE_WAIT, and LAST_ACK. The TIME_WAIT state on the closing side allows for retransmission of the final ACK if lost.
- Solution: TCP uses a three-way handshake to establish a connection.
- Round-Trip Time (RTT) Estimation and Timeout: Setting an appropriate timeout interval for retransmissions is crucial for efficient reliable data transfer. A timeout too short can lead to unnecessary retransmissions, while a timeout too long can result in delays in recovering from loss.
- Solution: TCP estimates the RTT between the sender and receiver. It measures the SampleRTT for acknowledged segments and maintains a RunningAverageRTT and a DevRTT (deviation of RTT). The timeout interval is then set based on these estimated values (typically a function of the estimated RTT and its deviation). TCP generally avoids measuring SampleRTT for retransmitted segments.
- Handling Out-of-Order Segments: Due to network delays, TCP segments might arrive at the receiver out of order.
- Solution: TCP receivers can choose to either discard out-of-order segments or buffer them, waiting for the missing segments to arrive and reorder the data. The latter approach, buffering, is more common in practice as it is more efficient in terms of network bandwidth. Sequence numbers enable the receiver to identify the correct order of the segments.
Aspects Covered:
- TCP Connection: The concept of a connection, its establishment (three-way handshake), full-duplex nature, and teardown (four-way handshake). The initialization of TCP state variables during connection establishment.
- TCP Segment Structure: Detailed explanation of the TCP segment header, including source and destination port numbers (for multiplexing/demultiplexing), sequence number, acknowledgment number (used for reliable data transfer), checksum (for error detection), and various flag bits (SYN, ACK, FIN, RST, PSH, URG) used for connection control and indicating segment purpose. The maximum segment size (MSS) and its determination based on the maximum transmission unit (MTU).
- Reliable Data Transfer: In-depth discussion of how TCP ensures reliable delivery using sequence numbers, acknowledgments (including the concept of cumulative ACKs), and retransmission mechanisms (timeout-based and fast retransmit triggered by duplicate ACKs).
- Round-Trip Time Estimation and Timeout: The importance of RTT estimation for setting appropriate timeout values and the general approach TCP takes.
- Flow Control: The mechanism using the receive window (rwnd) to prevent sender buffer overflow and match sender/receiver speeds.
- TCP Connection Management: The different states a TCP connection goes through during its lifecycle on both the client and server sides, as represented by Finite State Machines (FSMs). Handling of reset (RST) segments when a connection request arrives for a non-listening port.
- SYN Flood Attack: A denial-of-service attack that exploits the TCP three-way handshake by sending numerous SYN packets without completing the handshake, potentially exhausting server resources.
Key Points to Remember:
- TCP is a connection-oriented protocol, requiring a handshake before data transfer.
- TCP provides reliable data transfer, guaranteeing that data is delivered correctly, in order, and without loss or duplication.
- Sequence numbers are used to order data and detect duplicates.
- Acknowledgments (cumulative) are used by the receiver to inform the sender of successfully received data.
- Retransmissions (triggered by timeouts and duplicate ACKs) handle lost or unacknowledged segments.
- A checksum in the segment header helps detect transmission errors.
- Flow control using the receive window (rwnd) prevents the sender from overwhelming the receiver.
- TCP uses a three-way handshake for connection establishment (SYN, SYNACK, ACK).
- TCP uses a four-way handshake for connection teardown (FIN, ACK, FIN, ACK).
- Round-Trip Time (RTT) is estimated to set appropriate timeout values for retransmissions.
- TCP receivers may buffer out-of-order segments to improve efficiency.
- TCP is a complex protocol that ensures reliability over an unreliable network.
- Understanding TCP's mechanisms is crucial for comprehending the reliable communication foundation of many Internet applications.
Principles of Network Congestion Control
Section 3.6, titled "Principles of Congestion Control", addresses a fundamentally important problem in networking: managing the rate at which senders transmit data to prevent network performance degradation. This section explores the causes and costs of congestion and introduces broad approaches to handling it.
Problems Raised (and Approaches to Solutions Discussed):
- Network Congestion and its Causes: The primary problem raised is network congestion itself, which occurs when too many sources attempt to send data at too high a rate, leading to an overflow of router buffers. Section 3.6.1 examines this problem through increasingly complex scenarios:
- Scenario 1: Two Connections Sharing a Single Hop with Infinite Buffers: In this simplified case, congestion leads to a limitation in throughput. When the combined sending rate of two hosts (A and B) sharing a link with transmission rate R exceeds R, the throughput for each connection is capped at R/2, regardless of how high they set their sending rates. The link simply cannot deliver data faster than its capacity allows when shared.
- Scenario 2: Four Senders and Routers with Finite Buffers: This scenario introduces the impact of finite buffer capacity. When senders A, B, C, and D transmit to receivers E, F, G, and H respectively, and two pairs of flows (A-E and C-G, and B-F and D-H) share a router with a finite buffer, congestion leads to packet loss when the arrival rate exceeds the buffer capacity. Retransmissions exacerbate the problem by increasing the offered load. Even with a single shared hop and finite buffers, increased offered load can lead to a decrease in throughput as packets are dropped and retransmitted.
- Scenario 3: Four Senders, Routers with Finite Buffers, and Multihop Paths: This scenario further complicates the situation by considering multihop paths. Traffic from one set of connections (e.g., B to D) can consume buffer space at intermediate routers, negatively impacting the throughput of other connections (e.g., A to C) that also rely on those routers. As the offered load from the B-D connection increases, the amount of A-C traffic that successfully gets through the shared router (R2) decreases, potentially leading to a near-zero end-to-end throughput for the A-C connection under very heavy traffic. This illustrates a key cost of congestion: the possibility of one set of users degrading the service for others.
- Costs of Congestion: Section 3.6.1 also details the costs associated with network congestion:
- Lost Segments (Packets): Router buffer overflow leads to packet drops, requiring retransmission and wasting network resources.
- Increased Delays: Congestion causes packets to queue in router buffers, leading to significant delays in receiving data.
- Limited Throughput: As demonstrated in the scenarios, congestion can severely limit the achievable throughput for individual connections, even well below the capacity of the links along the path.
- Wasted Resources (Retransmissions): Retransmitting lost packets due to congestion adds to the network load, potentially worsening the congestion.
- Poor Performance for End Systems: Ultimately, congestion results in a degraded experience for applications and end-users due to delays, data loss, and low throughput.
- Approaches to Congestion Control: Section 3.6.2 discusses two broad categories of approaches to congestion control:
- End-to-End Congestion Control: In this approach, the network layer provides no explicit feedback about congestion to the transport layer. End systems must infer the presence of congestion based on observed network behavior, such as packet loss (indicated by timeouts or duplicate acknowledgments) and increasing round-trip times. TCP is presented as a prime example of a protocol that primarily uses end-to-end congestion control, adjusting its sending rate based on these implicit indicators.
- Network-Assisted Congestion Control: In this approach, network devices (routers) provide explicit feedback to the sender and/or receiver regarding the congestion state of the network. This feedback can range from a simple congestion indication bit to more sophisticated information, such as the maximum supported sending rate. While the Internet's core IP layer doesn't mandate network-assisted congestion control, extensions like Explicit Congestion Notification (ECN) allow for optional implementation of this approach.
Aspects Covered:
- The fundamental problem of congestion in packet-switched networks.
- The causes of congestion, including high traffic rates, limited buffer capacities in routers, and the interaction of multiple flows over shared links and multihop paths.
- The costs of congestion as experienced by the network and end-user applications, such as packet loss, increased delays, and reduced throughput.
- Two main approaches to congestion control: end-to-end (inference-based) and network-assisted (feedback-based).
- Examples of protocols that employ these approaches, notably TCP (end-to-end) and early network architectures like IBM SNA and DECnet, as well as ATM's ABR (network-assisted). The section also hints at more recent developments in the Internet that allow for optional network assistance.
Key Points to Remember:
- Congestion in computer networks is a significant problem that can drastically reduce network efficiency and application performance.
- It arises from the fundamental issue of shared resources (link bandwidth and router buffers) being oversubscribed.
- Congestion manifests as packet loss, increased delays, and reduced throughput.
- Effective congestion control mechanisms are essential for the "well-being of the network".
- There are two primary philosophies for congestion control: relying on end systems to infer congestion or having the network explicitly signal congestion.
- Understanding the principles of congestion control is crucial for comprehending how the Internet manages traffic and maintains a degree of stability. This understanding lays the groundwork for the detailed study of TCP's specific congestion control algorithms in subsequent sections.
TCP Congestion Control: Mechanisms and Evolution
Section 3.7, titled "TCP Congestion Control", delves into the crucial mechanisms that the Transmission Control Protocol (TCP) employs to manage network congestion. This section addresses several key problems related to congestion, proposes solutions through TCP's algorithms and features, covers various aspects of how TCP achieves congestion control, and highlights essential points to remember for understanding this critical networking concept.
Problems Raised (and their TCP Solutions):
- Avoiding Congestion Collapse: A fundamental problem in any shared network is congestion collapse, where an increase in offered load leads to a decrease in useful throughput. This occurs when too many packets are in the network, leading to excessive queuing delays, packet loss due to buffer overflow, and retransmissions that further exacerbate the congestion.
- TCP's Solution: TCP addresses this through a suite of end-to-end congestion control algorithms. These algorithms dynamically adjust the sender's transmission rate based on the perceived level of congestion in the network path. By reducing the sending rate when congestion is likely and increasing it when the path appears uncongested, TCP prevents senders from overwhelming the network capacity.
- Determining the Appropriate Sending Rate: TCP senders need to determine a sending rate that is high enough to utilize the available bandwidth but not so high as to cause or worsen congestion. Since TCP operates end-to-end, it must infer the network conditions without explicit feedback from the network layer (in classic TCP).
- TCP's Solution: TCP employs a congestion window (cwnd) to limit the amount of unacknowledged data a sender can have in transit. The sender's send rate is roughly cwnd divided by the Round-Trip Time (RTT). TCP uses acknowledgments (ACKs) as a clock to increase cwnd when the network appears healthy and uses packet loss (indicated by timeouts or duplicate ACKs) as a signal to decrease cwnd when congestion is inferred. This "bandwidth probing" strategy allows TCP to adapt its sending rate to the prevailing network conditions.
- Reacting to Packet Loss: Packet loss is a primary indicator of congestion in IP networks. TCP needs mechanisms to detect packet loss and react appropriately to alleviate the congestion that likely caused it.
- TCP's Solution: TCP uses timeouts and the reception of three duplicate acknowledgments (ACKs) as indications of packet loss. Upon detecting loss, TCP reduces its congestion window (cwnd) to decrease its sending rate, thus reducing the load on the congested network segments. TCP also retransmits the lost segment(s) to ensure reliable data delivery.
- Starting a New Connection: When a TCP connection begins, the sender has no prior knowledge of the network's capacity along the path. Sending data too quickly at the start could lead to immediate congestion.
- TCP's Solution: TCP uses a "slow start" mechanism at the beginning of a connection or after a timeout event. In slow start, the cwnd starts at a small value (typically 1 MSS) and increases exponentially with each received ACK, effectively doubling the sending rate every RTT. This cautious initial increase allows TCP to gradually probe for available bandwidth without immediately overwhelming the network. Slow start continues until a loss event occurs or a threshold (ssthresh) is reached, at which point TCP transitions to congestion avoidance.
- Achieving Fairness Among Connections: When multiple TCP connections share a bottleneck link, an ideal congestion control mechanism should strive to provide a fair share of the available bandwidth to each connection.
- TCP's Approach: Classic TCP congestion control, with its additive increase and multiplicative decrease (AIMD) behavior, tends to promote fairness over time. When a loss event occurs, all competing TCP connections reduce their rates, and then they gradually increase their rates, competing for the available bandwidth. However, factors like different RTTs can still lead to some unfairness. The section also notes that using multiple parallel TCP connections by a single application can circumvent fairness mechanisms, allowing that application to grab a larger share of the bandwidth.
- Improving Performance in Specific Network Environments: Classic TCP congestion control, being loss-based, might not perform optimally in all network conditions, such as high-bandwidth, long-delay networks or networks with frequent spurious losses not due to congestion (e.g., wireless networks).
- TCP's Evolution and Alternative Approaches: The section discusses the evolution of TCP congestion control, including newer algorithms like TCP CUBIC, which aims to achieve higher throughput and more stable rates in high-bandwidth, long-delay networks by using a cubic increase function during congestion avoidance. It also introduces network-assisted congestion control using Explicit Congestion Notification (ECN), where routers can explicitly signal congestion to end hosts before packet loss occurs, allowing for a smoother rate reduction. Delay-based congestion control, exemplified by TCP Vegas, uses increasing RTT as a signal of congestion, aiming to "keep the pipe just full, but no fuller" by adjusting the sending rate based on the difference between the expected and actual throughput.
Aspects Covered:
- Congestion Window (cwnd): The section thoroughly explains the role of the congestion window as TCP's primary mechanism for controlling the sending rate. It details how cwnd is adjusted during different phases of TCP congestion control (slow start, congestion avoidance, fast recovery) in response to ACKs and loss events. The relationship between cwnd, the receive window (rwnd), and the amount of unacknowledged data is also mentioned.
- Slow Start: The algorithm for rapidly increasing cwnd at the beginning of a connection or after a timeout is covered in detail. The conditions for exiting slow start (reaching ssthresh, loss event) are also explained.
- Congestion Avoidance: The core of TCP's steady-state congestion control, where cwnd is increased more cautiously (typically linearly by 1 MSS per RTT) after slow start or fast recovery. The Additive Increase Multiplicative Decrease (AIMD) behavior is highlighted as a key characteristic of TCP congestion control.
- Fast Retransmit and Fast Recovery: The section explains how TCP uses duplicate ACKs to detect packet loss more quickly than waiting for a timeout and how fast retransmit triggers immediate retransmission of the lost segment. The fast recovery mechanism, used after a triple duplicate ACK, reduces cwnd by half and then enters a period of inflation upon receiving subsequent duplicate ACKs, aiming to avoid a drastic reduction in the sending rate. The differences between TCP Reno (which implements fast recovery) and TCP Tahoe (which reverts to slow start after triple duplicate ACKs) are discussed.
- Slow Start Threshold (ssthresh): The role of ssthresh in determining when TCP transitions from slow start to congestion avoidance is explained. How ssthresh is updated upon detection of loss (set to half of the cwnd at the time of loss) is also covered.
- Network-Assisted Congestion Control (ECN): The section introduces Explicit Congestion Notification as an optional mechanism where routers can mark IP datagrams to indicate congestion. The end hosts then use ECN bits in TCP headers (ECE and CWR) to inform the sender about congestion, allowing for a more proactive rate reduction.
- Delay-Based Congestion Control (TCP Vegas): A brief overview of TCP Vegas is provided, highlighting its approach of using RTT measurements to detect incipient congestion and adjust the sending rate to maintain a target level of buffering in the network.
- Fairness: The concept of fairness among TCP connections sharing a bottleneck link is discussed, noting that while AIMD tends towards fairness, factors like RTT and the use of parallel connections can affect it.
- Evolution of TCP Congestion Control: The section acknowledges that TCP congestion control has evolved significantly over time, with ongoing research and development leading to new algorithms like TCP CUBIC to address the challenges of modern networks.
- Self-Clocking: The concept of TCP being "self-clocking" is introduced, where the arrival of ACKs paces the transmission of new data, contributing to congestion control.
Key Points to Remember:
- TCP congestion control is crucial for the stability and efficiency of the Internet by preventing network overload.
- Classic TCP uses an end-to-end approach, inferring congestion based on packet loss (timeouts and triple duplicate ACKs).
- TCP employs a congestion window (cwnd) to limit its sending rate, adjusting it dynamically based on network feedback.
- TCP's congestion control involves three main phases: slow start (exponential increase of cwnd), congestion avoidance (linear increase of cwnd), and fast recovery (a less drastic response to loss indicated by duplicate ACKs).
- The slow start threshold (ssthresh) determines when TCP transitions from slow start to congestion avoidance.
- AIMD (Additive Increase Multiplicative Decrease) is the fundamental behavior of TCP congestion control in the congestion avoidance phase.
- Newer versions of TCP, like TCP CUBIC, aim to improve performance in high-bandwidth, long-delay networks.
- Network-assisted congestion control using ECN allows routers to provide explicit feedback to end hosts about congestion.
- Delay-based congestion control mechanisms like TCP Vegas use RTT variations as a congestion indicator.
- Achieving fairness among competing TCP flows is a goal of congestion control, although it can be influenced by various factors.
- TCP congestion control is an evolving field with ongoing research and development.
By understanding these problems, solutions, aspects, and key points, one can gain a comprehensive grasp of the principles behind TCP congestion control and its critical role in the functioning of the Internet.
Transport Layer Evolution: Addressing Modern Networking Needs
Section 3.8 of "Computer Networking: A Top-Down Approach" discusses the Evolution of Transport-Layer Functionality. This section addresses the problems and limitations encountered with the traditional transport protocols, UDP and TCP, over several decades, and highlights the ongoing developments aimed at improving and adapting transport-layer capabilities for modern networking needs.
Problems Raised and Their Solutions/Evolutions:
- Limitations of UDP and TCP in Certain Scenarios: After three decades of experience with UDP and TCP, it became evident that neither protocol was ideally suited for all circumstances. This suggests inherent limitations in their design and functionalities when faced with evolving network conditions and application requirements.
- Evolution/Solutions: This realization spurred the design and implementation of new transport-layer functionality and protocols.
- Need for Improved TCP Performance: Classic TCP algorithms like TCP Tahoe and Reno, while foundational, have limitations in achieving optimal throughput and responsiveness in various network environments, such as high-bandwidth, long-delay networks or networks with different types of loss.
- Evolution/Solutions: This led to the development of newer TCP versions. The section mentions several examples:
- TCP CUBIC and BIC: These algorithms are now more widely deployed on Web servers than classic TCP Reno and aim for better performance.
- DCTCP and CTCP: These are other examples of newer TCP variations that have seen significant use.
- BBR (Bottleneck Bandwidth and Round-trip propagation time): This is a delay-based congestion control algorithm deployed in Google's internal B4 network and on many of its public-facing servers. BBR infers congestion using measured packet delay rather than solely relying on packet loss. This is a shift from the loss-based congestion control of classic TCP.
- Evolution/Solutions: This led to the development of newer TCP versions. The section mentions several examples:
- Desire for Integration of Transport Layer Functions at the Application Layer: The traditional separation of layers, while providing modularity, can sometimes hinder performance or flexibility for certain applications. There's a trend towards implementing transport layer functionalities directly within the application layer.
- Evolution/Solutions: The emergence and adoption of the QUIC protocol is a prime example of this evolution.
- QUIC is technically not a transport-layer protocol but provides application-layer reliability, congestion control, and connection multiplexing services.
- It uses many of the error- and congestion-control principles developed for transport layer protocols.
- QUIC allows several different application-level "streams" to be multiplexed through a single QUIC connection.
- New streams can be added quickly once a QUIC connection is established.
- Each stream offers reliable and in-order bi-directional delivery of data.
- In the context of HTTP/3, each object on a Web page would have a different stream.
- QUIC uses connection IDs and stream IDs in its packet headers.
- Data from multiple streams can be contained within a single QUIC segment, which is carried over UDP.
- The concept of multiplexing multiple application-level streams through a single connection was pioneered by the Stream Control Transmission Protocol (SCTP), which is used in control plane protocols in 4G/5G cellular wireless networks.
- Evolution/Solutions: The emergence and adoption of the QUIC protocol is a prime example of this evolution.
- Addressing Limitations in Specific Network Environments: Classic TCP's loss-based congestion control might not be optimal in networks with high bit error rates (like wireless networks) or those with explicit congestion signals.
- Evolution/Solutions: The development of network-assisted explicit congestion notification (ECN) allows the network layer to explicitly signal congestion to TCP senders and receivers. This enables a more proactive and potentially smoother rate reduction compared to reacting to packet loss.
- Delay-based congestion control approaches, such as TCP Vegas and BBR, infer congestion using measured packet delay, aiming to maintain an optimal level of buffering in the network.
Aspects Covered:
- Newer TCP Congestion Control Algorithms: The section covers the development, deployment, and characteristics of modern TCP congestion control algorithms like CUBIC, DCTCP, CTCP, and BBR. It highlights their goals of achieving higher throughput, more stable rates, and better responsiveness in different network conditions.
- Application-Layer Transport Protocols (QUIC): The emergence of protocols like QUIC, which implement traditional transport layer functionalities at the application layer, is a key aspect discussed. The benefits of this approach, such as improved multiplexing and faster connection establishment (often combined with TLS) are implicitly covered.
- Network-Assisted Congestion Control (ECN): The use of explicit feedback from the network layer to assist TCP congestion control is discussed as an evolution beyond purely end-to-end loss-based mechanisms.
- Delay-Based Congestion Control: The section touches upon the shift towards using network delay as a primary indicator of congestion, as seen in protocols like BBR.
- Multiplexing: The evolution towards supporting multiple independent streams within a single connection, as exemplified by QUIC and SCTP, is covered.
- Integration with Security: The tight integration of security with connection establishment in protocols like QUIC (often combined with TLS) is an implied aspect of this evolution. Establishing a secure connection often happens concurrently with the transport connection setup, reducing latency.
- The Complexity of TCP: The section implicitly acknowledges the increasing complexity of TCP due to numerous patches, fixes, and improvements over the years, which motivates the exploration of alternative approaches.
Key Points to Remember:
- The transport layer continues to evolve to address the limitations of traditional protocols like UDP and TCP in modern network environments and to meet the demands of new applications.
- Newer TCP congestion control algorithms (e.g., CUBIC, BBR) aim to improve performance, stability, and fairness compared to classic TCP.
- Protocols like QUIC are emerging that implement transport-layer functionalities (reliability, congestion control, multiplexing, security) at the application layer, offering potential benefits in terms of performance and flexibility.
- Network assistance through ECN and delay-based congestion control are alternative approaches to inferring and reacting to network congestion, moving beyond solely relying on packet loss.
- The concept of multiplexing multiple application-level streams within a single connection is gaining importance.
- The evolution of the transport layer reflects a continuous effort to optimize network performance, reliability, and security for a diverse range of applications and network conditions.
- While TCP has become increasingly complex, this complexity is generally hidden from network applications through the socket interface.
In essence, Section 3.8 highlights that the transport layer is not static and is undergoing significant evolution driven by the need for better performance, new functionalities, and adaptation to diverse network environments. This evolution includes refinements to TCP itself as well as the emergence of new paradigms like application-layer transport protocols.