TCPCongestion control process. (All four states should be explained clearly.)
  • In a certain period of time, the demand for a resource in the network exceeds the available range, that is, the demand exceeds the supply, and the network performance degrades. This condition is called congestion

  • Research premise

    1. Data is sent in one direction, and only confirmation is sent in the other
    2. The receiver always has enough cache space, so the size of the sender sending window is determined by the level of congestion on the network
    3. The problem is discussed in terms of the number of maximum MSS, not in bytes
  • If congestion occurs without control, the throughput of the entire network will decrease with the increase of the input load

  • The sender maintains a congestion window CWND state variable whose value depends on the degree of congestion in the network and changes dynamically

    • Congestion windowMaintenance principles for CWND: Just networkThere is no congestionThe congestion window is right thereincreaseSome; As long as therecongestion, congested Windows onReduce some
    • Judge aThe basis of network congestion: The acknowledgement packet that should have arrived was not received on time (retransmission timed out occurred).
  • The sender takes the congestion window as the sending window SWND, that is, SWND = CWND

  • Maintain a slow start threshold SSthRESH status variable:

    • When CWND < SSTHRESH, the slow start algorithm is used
    • When CWND > SSTHRESH, stop using the slow-start algorithm and use the congestion avoidance algorithm instead
    • When CWND = SSTHRESH, either the slow start algorithm or the congestion avoidance algorithm can be used
  • Four congestion control algorithms: Slow start, congestion avoidance, fast retransmit and Fast recovery

  • If the retransmission timer times out, the network may be congested:

    1. Update the SSTHRESH value to half the CWND value when congestion occurs
    2. Reduce the CWND value to 1 and restart the slow start algorithm
  • Slow start

    • Under the slow-start algorithm, the number of congestion Windows increases exponentially with the propagation rounds and keeps doubling
    • Slow start indicates that the number of packet segments is small at the beginning, not that the congestion window grows at a full speed
  • Congestion avoidance

    • Under the congestion avoidance algorithm, the number of congestion Windows increases linearly with the number of transmission rounds, continuously +1
    • The congestion avoidance algorithm cannot completely avoid congestion, but allows the congestion window to grow linearly, so that the network is not prone to congestion

    ————— slow start and congestion avoidance algorithms were originally introduced as —————

    Sometimes, the loss of a certain packet segment is mistaken for congestion, which reduces the congestion algorithm and reduces the efficiency. To solve this problem, the latter two algorithms were added

  • Fast retransmission

    • The fast retransmission algorithm enables the sender to know the loss of an individual segment as soon as possible

    • Fast retransmission means that the sender starts retransmission as soon as possible, rather than waiting for the timeout retransmission timer to run out

      • Ask the receiver not to wait for confirmation before sending data, but toImmediately confirm.
      • Even if an out-of-order packet segment is received, the system immediately sends an acknowledgement of the received packet segmentRepeated confirmation.
      • Once the sender receives three consecutive repeated acknowledgements, it sends the corresponding message segmentImmediately the retransmissionInstead of waiting for the timeout retransmission timer for the message to run out
      • Fast retransmission can increase the throughput of the entire network by 20%

  • Fast recovery

    • The sender received itThree duplicate confirmations, you know that only some segments of packets are lost, and start the fast recovery algorithm.
    • The sender adjusts the slow start threshold SSTHRESH value and the congestion window CWND value to half of the current window; Start executing congestion avoidance algorithm
    • There are also some fast recovery implementation 18 recovery at the start of the two point congestion window value CWND increased a bit, namely SSthRESH +3
      • Since the sender received three repeated acknowledgements, three data packet segments appear to have left the network
      • These three segments no longer consume network resources but remain in the receive cache
      • So instead of stacking up segments, you have fewer, and you can expand the window a little bit