Slow Start vs Congestion Avoidance in TCP
13.7 هزار بار بازدید -
2 سال پیش
-
Fundamentals of Networking for Effective
Fundamentals of Networking for Effective Backends udemy course (link redirects to udemy with coupon)
https://network.husseinnasser.com
Congestion control is a collection of algorithms that controls the amount of data transmitted in a network by a sender in order to avoid flooding the networks with packets. Middle routers have buffers that hold the packets (segments to be exact) temporarily to be processed and routed to the next destination. When the buffer is filled up new packets will be dropped by those routers which causes an indication by the sender that some packets are getting lost. This signals a congestion of the network (new papers challenge definitions such as the Homa paper but it's outside the scope of this post) when a congestion is detected the congestion control slows down transmission by flipped between several algorithms. We discuss in this post the two major algorithms, the slow start and the congestion avoidance.
The transmission starts with the slow start algorithm with an initial congestion window size of specific value (the CWND controls the congestion), the slow starts increases the CWND with 1 maximum segment size (around 1500 bytes in most cases) for each acknowledgment the sender gets. This continues until the CWND reaches the slow start threshold (SSTHRES) the algorithm then changes to the congestion avoidance. In the congestion avoidance algorithm, the CWND is increased by 1 MSS for each round trip (not each ack), this means if your CWND is 5 segments worth of size, sending 5 segments and getting acknowledgment for the entire 5 segments will get you an increase of 1 MSS to your CWND. This is as opposed to slow start where if you receive 5 acknowledgments you get +5 MSS to your CWND. That is why Slow Start starts slow but increases aggressively. While congestion avoidance increases slowly.
When congestion is detected , the slow start threshold is reduced by however many unacknowledged segments that are in flights (flight size) divided by two (not as commonly mistakenly CWND/2), Flight size is usually lower than CWND. The CWND is also reset to 1 MSS which then kicks back the slow start algorithm again since the CWND is lower than the slow start threshold. This goes on over and over again until the slow start threshold becomes equal or less than the value of 2MSS. That is where slow start.
In this video I explain the difference between the two algorithms and how they each take effect in transmission.
Resources
https://www.rfc-editor.org/rfc/pdfrfc...
https://web.stanford.edu/~ouster/cgi-...
TCP Slow Start and Congestion Avoidance are algorithms used in TCP congestion control. In this video I explain the difference between the two algorithms and how they each take effect in transmission.
Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)
https://database.husseinnasser.com
Introduction to NGINX (link redirects to udemy with coupon)
https://nginx.husseinnasser.com
Python on the Backend (link redirects to udemy with coupon)
https://python.husseinnasser.com
Become a Member on YouTube
@hnasr
Arabic Software Engineering Channel
@husseinnasser
🔥 Members Only Content
Members-only videos
🏭 Backend Engineering Videos in Order
https://backend.husseinnasser.com
💾 Database Engineering Videos
Database Engineering
🎙️Listen to the Backend Engineering Podcast
https://husseinnasser.com/podcast
Gears and tools used on the Channel (affiliates)
🖼️ Slides and Thumbnail Design
Canva
https://partner.canva.com/c/2766475/6...
Stay Awesome,
Hussein
https://network.husseinnasser.com
Congestion control is a collection of algorithms that controls the amount of data transmitted in a network by a sender in order to avoid flooding the networks with packets. Middle routers have buffers that hold the packets (segments to be exact) temporarily to be processed and routed to the next destination. When the buffer is filled up new packets will be dropped by those routers which causes an indication by the sender that some packets are getting lost. This signals a congestion of the network (new papers challenge definitions such as the Homa paper but it's outside the scope of this post) when a congestion is detected the congestion control slows down transmission by flipped between several algorithms. We discuss in this post the two major algorithms, the slow start and the congestion avoidance.
The transmission starts with the slow start algorithm with an initial congestion window size of specific value (the CWND controls the congestion), the slow starts increases the CWND with 1 maximum segment size (around 1500 bytes in most cases) for each acknowledgment the sender gets. This continues until the CWND reaches the slow start threshold (SSTHRES) the algorithm then changes to the congestion avoidance. In the congestion avoidance algorithm, the CWND is increased by 1 MSS for each round trip (not each ack), this means if your CWND is 5 segments worth of size, sending 5 segments and getting acknowledgment for the entire 5 segments will get you an increase of 1 MSS to your CWND. This is as opposed to slow start where if you receive 5 acknowledgments you get +5 MSS to your CWND. That is why Slow Start starts slow but increases aggressively. While congestion avoidance increases slowly.
When congestion is detected , the slow start threshold is reduced by however many unacknowledged segments that are in flights (flight size) divided by two (not as commonly mistakenly CWND/2), Flight size is usually lower than CWND. The CWND is also reset to 1 MSS which then kicks back the slow start algorithm again since the CWND is lower than the slow start threshold. This goes on over and over again until the slow start threshold becomes equal or less than the value of 2MSS. That is where slow start.
In this video I explain the difference between the two algorithms and how they each take effect in transmission.
Resources
https://www.rfc-editor.org/rfc/pdfrfc...
https://web.stanford.edu/~ouster/cgi-...
TCP Slow Start and Congestion Avoidance are algorithms used in TCP congestion control. In this video I explain the difference between the two algorithms and how they each take effect in transmission.
Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)
https://database.husseinnasser.com
Introduction to NGINX (link redirects to udemy with coupon)
https://nginx.husseinnasser.com
Python on the Backend (link redirects to udemy with coupon)
https://python.husseinnasser.com
Become a Member on YouTube
@hnasr
Arabic Software Engineering Channel
@husseinnasser
🔥 Members Only Content
Members-only videos
🏭 Backend Engineering Videos in Order
https://backend.husseinnasser.com
💾 Database Engineering Videos
Database Engineering
🎙️Listen to the Backend Engineering Podcast
https://husseinnasser.com/podcast
Gears and tools used on the Channel (affiliates)
🖼️ Slides and Thumbnail Design
Canva
https://partner.canva.com/c/2766475/6...
Stay Awesome,
Hussein
2 سال پیش
در تاریخ 1401/05/21 منتشر شده
است.
13,721
بـار بازدید شده