Try   HackMD

TCP Congestion Control - AIMD

課程影片

第 8H 講 TCP 與網路阻塞偵測與控制技術 L08 8

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

第 8I 講 TCP 與網路阻塞偵測與控制技術 L08 9

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

AIMD

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這是 additive increase, multiplicative decrease 的縮寫。顧名思義,就是如果發現網路上可以傳輸更多流量而要增加流量時,就線性地增加流量,每次增加常數值; 但如果發現網路過度壅塞而需要減少流量時,則是直接減半。

3 次相同的 ACK = 封包遺失 = 壅塞 = 窗口減半

前面介紹 fast retransmission 時有介紹到:三次收到相同的 ACK,就視為那個流水號的封包遺失,不用等逾時就會直接重送。所以這裡就把「三次相同的 ACK」視為是「封包已經遺失」。而如果封包發生遺失,就表示網路可能很壅塞。所以每次發生這件事情時,AIMD 就把估計的 congestion window 減半。

ACK 通通準時到 = 順暢 = 按比例增加

如果在一個 RTT 內,這個 congestion window 的位元組都有順利收到 ACK,那就表示有可能可以把傳輸量調高一點。AIMD 的策略是「依照一個 RTT 中收到多少封包的 ACK 來決定」。為了方便,以下一個 RTT 中傳輸的資料量,都用「MSS」作為計量單位。比如說:若 congestion window

n,表示現在的順暢程度,允許發送方在一個 RTT 中,「用單一一次傳輸可傳輸的最大資料量傳輸
n
次」。

假定現在的 congestion window 大小為

n 個 MSS 的資料量:

CongestionWindow=n

那麼,在這個 RTT 當中,這個 congestion window 的增長量,就依照「這個 RTT 內傳輸的資料中,有多少比例的資料被 ACK」來增加。也就是:

CongestionWindow+=(nackn)

其中,

nack 指得是這個 RTT 中,有多少資料(單位為 MSS)被回傳。所以,當「送出的資料通通都得到 ACK 時」:

nack=n

整個 congestion window 恰好就會增加一個 MSS 的量。也就是:

CongestionWindow+=(nackn)1

所以,如果一直順暢地傳遞,每經過一個 RTT,congestion window 就會增加一個 MSS 常數。這也是叫做 additive increase 的理由。