Mechanisms have been invented to prevent network congestion or to deal with a network collapse: •
Network scheduler active queue management which reorders or selectively drops network packets in the presence of congestion •
Explicit Congestion Notification an extension to IP and TCP communications protocols that adds a flow control mechanism •
TCP congestion control various implementations of efforts to deal with network congestion The correct endpoint behavior is usually to repeat dropped information, but progressively slow the repetition rate. Provided all endpoints do this, the congestion lifts and the network resumes normal behavior. Other strategies such as
slow start ensure that new connections do not overwhelm the router before congestion detection initiates. Common router congestion avoidance mechanisms include
fair queuing and other
scheduling algorithms, and
random early detection where packets are randomly dropped as congestion is detected. This proactively triggers the endpoints to slow transmission before congestion collapse occurs. Some end-to-end protocols are designed to behave well under congested conditions; TCP is a well-known example. The first TCP implementations to handle congestion were described in 1984, but Van Jacobson's inclusion of an open source solution in the Berkeley Standard Distribution UNIX ("
BSD") in 1988 first provided good behavior.
UDP does not control congestion. Protocols built atop UDP must handle congestion independently. Protocols that transmit at a fixed rate, independent of congestion, can be problematic. Real-time streaming protocols, including many
Voice over IP protocols, have this property. Thus, special measures, such as quality of service, must be taken to keep packets from being dropped in the presence of congestion.
Practical network congestion avoidance Connection-oriented protocols, such as the widely used TCP protocol, watch for
packet loss or
queuing delay to adjust their transmission rate. Various network congestion avoidance processes support different trade-offs.
TCP/IP congestion avoidance The
TCP congestion avoidance algorithm is the primary basis for congestion control on the Internet. Problems occur when concurrent TCP flows experience
tail-drops, especially when
bufferbloat is present. This delayed packet loss interferes with TCP's automatic congestion avoidance. All flows that experience this packet loss begin a TCP retrain at the same moment – this is called
TCP global synchronization.
Active queue management Active queue management (AQM) is the reordering or dropping of network packets inside a transmit buffer that is associated with a
network interface controller (NIC). This task is performed by the
network scheduler.
Random early detection One solution is to use
random early detection (RED) on the network equipment's egress queue. On
networking hardware ports with more than one egress queue,
weighted random early detection (WRED) can be used. RED indirectly signals TCP sender and receiver by dropping some packets, e.g. when the average queue length is more than a threshold (e.g. 50%) and deletes
linearly or
cubically more packets, up to e.g. 100%, as the queue fills further.
Robust random early detection The
robust random early detection (RRED) algorithm was proposed to improve the TCP throughput against denial-of-service (DoS) attacks, particularly low-rate denial-of-service (LDoS) attacks. Experiments confirmed that RED-like algorithms were vulnerable under LDoS attacks due to the oscillating TCP queue size caused by the attacks.
Flow-based WRED Some network equipment is equipped with ports that can follow and measure each flow and are thereby able to signal a too big bandwidth flow according to some quality of service policy. A policy could then divide the bandwidth among all flows by some criteria.
Explicit Congestion Notification Another approach is to use
Explicit Congestion Notification (ECN). ECN is used only when two hosts signal that they want to use it. With this method, a protocol bit is used to signal explicit congestion. This is better than the indirect congestion notification signaled by packet loss by the RED/WRED algorithms, but it requires support by both hosts.
TCP window shaping Congestion avoidance can be achieved efficiently by reducing traffic. When an application requests a large file, graphic or web page, it usually advertises a
window of between 32K and 64K. This results in the server sending a full window of data (assuming the file is larger than the window). When many applications simultaneously request downloads, this data can create a congestion point at an upstream provider. By reducing the window advertisement, the remote servers send less data, thus reducing the congestion.
Backward ECN Backward ECN (BECN) is another proposed congestion notification mechanism. It uses
ICMP source quench messages as an IP signaling mechanism to implement a basic ECN mechanism for IP networks, keeping congestion notifications at the IP level and requiring no negotiation between network endpoints. Effective congestion notifications can be propagated to transport layer protocols, such as TCP and UDP, for the appropriate adjustments. ==Side effects of congestive collapse avoidance==