12 Dec - CN - Congestuon control and Timers

Duration: 53 min

This video lesson is available to enrolled students.

Enroll to watch — GATE Guidance by Sanchit Sir

AI Summary

An AI-generated summary of this video lecture.

This video is a comprehensive lecture on TCP congestion control, focusing on the Additive Increase Multiplicative Decrease (AIMD) algorithm. The instructor begins by introducing the two main phases: Slow Start and Congestion Avoidance. He explains the key parameters involved, including the congestion window (cwnd), slow start threshold (ssthresh), and receiver window (rwnd), and how the effective window size (SWS) is determined as the minimum of cwnd and rwnd. The core of the lecture is a detailed, step-by-step walkthrough of the AIMD algorithm's behavior. The instructor demonstrates how cwnd grows exponentially during the slow start phase (doubling each round-trip time) until it reaches the ssthresh. Once in congestion avoidance, cwnd increases linearly by one MSS per round-trip time. The lecture then covers the critical event of a timeout, which triggers a reset: ssthresh is set to half of the current cwnd, cwnd is reset to 1 MSS, and the algorithm re-enters slow start. The video includes multiple worked examples on a whiteboard, where the instructor applies these rules to calculate the congestion window size at the end of a specific transmission round, illustrating the entire process from initialization to recovery after a packet loss.

Chapters

  1. 0:00 2:00 00:00-02:00

    The video opens with a view of the instructor, Sandeep Jan, in a video call. He begins the lecture by introducing the topic of TCP congestion control, which is written on the whiteboard. He outlines the two primary mechanisms: Slow Start and Congestion Avoidance, setting the stage for a detailed explanation of the Additive Increase Multiplicative Decrease (AIMD) algorithm.

  2. 2:00 5:00 02:00-05:00

    The instructor writes the key parameters on the whiteboard: cwnd (congestion window), rwnd (receiver window), and ssthresh (slow start threshold). He explains that the effective window size (SWS) is the minimum of cwnd and rwnd, and that the algorithm operates in two phases. He draws a diagram of a client and server to illustrate the network setup for the upcoming examples.

  3. 5:00 10:00 05:00-10:00

    The instructor begins a detailed example, setting up the initial conditions: cwnd = 1000 bytes, ssthresh = 16, and WS = 500 bytes. He explains the two phases of the algorithm. The first phase, Slow Start, is triggered when cwnd < ssthresh. The second phase, Congestion Avoidance, is triggered when cwnd >= ssthresh. He draws a timeline diagram to illustrate the flow of data and acknowledgements between the client and server.

  4. 10:00 15:00 10:00-15:00

    The instructor demonstrates the slow start phase. He shows that cwnd starts at 1 MSS and doubles each round-trip time (RTT). He draws a timeline where the client sends 1 MSS, receives an ACK for 1 MSS, then sends 2 MSS, receives an ACK for 2 MSS, and so on, until cwnd reaches 16 MSS. He then explains that once cwnd >= ssthresh, the algorithm enters congestion avoidance.

  5. 15:00 20:00 15:00-20:00

    The instructor continues the example, showing the transition from slow start to congestion avoidance. He explains that after cwnd reaches 16 MSS, it enters the congestion avoidance phase, where it increases by 1 MSS per RTT. He draws the timeline showing cwnd growing from 16 to 17, 18, 19, and so on. He then introduces a timeout event, which causes a packet loss.

  6. 20:00 25:00 20:00-25:00

    The instructor explains the reaction to a timeout. He states that upon a timeout, the ssthresh is set to half of the current cwnd (e.g., if cwnd was 16, ssthresh becomes 8). The cwnd is reset to 1 MSS, and the algorithm re-enters slow start. He draws a new timeline to show this process, starting with cwnd = 1 and ssthresh = 8, and shows the cwnd doubling each RTT until it reaches 8, at which point it enters congestion avoidance.

  7. 25:00 30:00 25:00-30:00

    The instructor presents a new problem on the whiteboard. The problem states that the initial cwnd is 8 MSS and the initial ssthresh is 8 MSS. A timeout occurs during the 5th transmission. The task is to find the congestion window size at the end of the 10th transmission. He begins to solve it by drawing a timeline, starting with cwnd = 8 MSS in round 1.

  8. 30:00 35:00 30:00-35:00

    The instructor continues solving the problem. He shows that in round 1, cwnd = 8 MSS, and after receiving an ACK, cwnd becomes 16 MSS in round 2. He explains that since cwnd (16) is now greater than ssthresh (8), the algorithm enters congestion avoidance. He draws the timeline showing cwnd increasing by 1 MSS per round: 16, 17, 18, 19, 20. He then indicates that a timeout occurs during the 5th transmission, which is when cwnd is 20 MSS.

  9. 35:00 40:00 35:00-40:00

    The instructor explains the reaction to the timeout. He states that ssthresh is set to half of the current cwnd, so ssthresh = 20 / 2 = 10 MSS. The cwnd is reset to 1 MSS, and the algorithm re-enters slow start. He draws a new timeline for the recovery phase, starting with cwnd = 1 MSS in round 6.

  10. 40:00 45:00 40:00-45:00

    The instructor continues the recovery process. He shows the cwnd doubling each round: 1, 2, 4, 8, 16. He notes that when cwnd reaches 10 MSS (in round 9), it has reached the new ssthresh, so the algorithm enters congestion avoidance. He then shows the cwnd increasing by 1 MSS per round in round 10, resulting in cwnd = 11 MSS. He concludes that the answer is 11 MSS, but then revises it to 7 MSS, indicating a possible error in the problem statement or his calculation.

  11. 45:00 50:00 45:00-50:00

    The instructor presents another problem. The initial cwnd is 8 MSS and ssthresh is 8 MSS. A timeout occurs during the 5th transmission. The task is to find the congestion window size at the end of the 10th transmission. He draws a timeline, showing cwnd growing from 8 to 16 in round 1 and 2, then to 17, 18, 19, 20 in rounds 3, 4, 5. He indicates a timeout during the 5th transmission, which is when cwnd is 20 MSS.

  12. 50:00 52:46 50:00-52:46

    The instructor explains the reaction to the timeout. He states that ssthresh is set to half of the current cwnd, so ssthresh = 20 / 2 = 10 MSS. The cwnd is reset to 1 MSS, and the algorithm re-enters slow start. He draws a new timeline for the recovery phase, starting with cwnd = 1 MSS in round 6. He shows the cwnd doubling each round: 1, 2, 4, 8, 16. He notes that when cwnd reaches 10 MSS (in round 9), it has reached the new ssthresh, so the algorithm enters congestion avoidance. He then shows the cwnd increasing by 1 MSS per round in round 10, resulting in cwnd = 11 MSS. He concludes that the answer is 11 MSS, but then revises it to 7 MSS, indicating a possible error in the problem statement or his calculation.

The video provides a clear and structured explanation of the TCP congestion control algorithm, using the Additive Increase Multiplicative Decrease (AIMD) principle. The instructor effectively uses a whiteboard to visually demonstrate the two phases: Slow Start, where the congestion window (cwnd) grows exponentially, and Congestion Avoidance, where it grows linearly. The core of the lesson is the reaction to a timeout, which is a critical event that resets the algorithm. The instructor systematically walks through multiple examples, showing how the ssthresh is halved, cwnd is reset to 1 MSS, and the process restarts. This step-by-step approach, combined with the visual timeline diagrams, makes the complex behavior of the algorithm easy to understand and apply to solve problems.