Tuesday, October 9, 2018

Understanding TCP congestion control

Trying to understand rfc2581 and TCP a bit better.

Consider the following topology:

Sender ----- R1 ----- R2 ------ R3 ----- Receiver 

Let's say:

  1. A TCP session exists between Sender and Receiver, flowing at 10Mbps in that direction.
  2. Part way through the transfer, R3 experiences congestion, such that there is now only 5Mbps of bandwidth available to the transfer.

As I understand it, here's what happens:

  1. Before congestion, cwnd is greater than the slow start threshold (ssthresh). The TCP session is in the congestion avoidance state.
  2. When R3 congests, it starts dropping frames on egress to Receiver. Some of those frames include TCP segments.
  3. Receiver does not ACK receipt of those segments.
  4. Sender interprets those un-ACK'ed segments as loss.
  5. Sender interprets lost segments as congestion.
  6. Sender enters slow start phase, wherein, it reduces ssthresh by half the amount of data in flight at the time it detected loss.
  7. If Sender receives ACKs for all its segments, it slowly increases cwnd after each successful ACK, reaching balance at the new available data rate (5Mbps)

Questions:

  1. Confirm or clarify the above? I'm sure I have some of it mixed up :)
  2. When R3 congests, after the TCP flow reaches its new equilibrium at 5Mbps (which takes a few seconds?), R1 and R2 are now passing only 5Mbps. Bandwidth reduction from 10Mbps to 5Mbps occurs at the Sender, so all intermediate hops experience lower data rate, correct?


No comments:

Post a Comment