Upload
others
View
14
Download
0
Embed Size (px)
Citation preview
1
TCP Congestion Control
Rung-Shiang ChengDepartment of Computer and Communication, Kun Shan University
http://teachers.ksu.edu.tw/rscheng
擁塞控制的基本方法 (Congestion Control Mechanisms of TCP)
4
Fast
Recovery
Congestion
Avoidance
Slow
Start
triple dup-ACK
cwnd ≥
ssthresh
triple
dup-ACK
retransmit first
lost packet
new ACK
initial or
timeout Fast
Retransmit
expiry timer upon 1,
ACK) duplicate- triple(receive congestion if ,2/
if , ,/1
if , ,1
cwnd
ssthreshcwndcwndcwnd
ssthreshcwndcwnd
cwndavoidance Congestion
phase start-Slow
Timeout: ssthresh = cwnd/2, cwnd =1
傳送端
接收端
New-Reno TCP
修改Fast recovery機制
– 解決Reno在收到partial ACK時會提早結束Fast recovery
而導致TCP連線Timeout的問題
– 每個RTT時間內可重送一個遺失的封包.
7
1. 第7與第8個封包遺失2. 在收到3個duplicate-ACK後,cwnd
被重設為6 (3+3=6)3. cwnd + ack = 6 + 6 = 124. 在這個例子中,由於傳送端不會再
送出新的封包,因此只能等待timeout
SACK TCP
修改TCP的傳送端與接收端
在TCP header加入SACK選項
– 接收端在收到out-of-order packet時,會回傳目前已經收到的連續區段.
– 傳送端可藉由這些資訊得知那些packet沒被收到
8
TCP agent types in Ns-2
9
Agent Type Description
TCP A TCP Tahoe sender
TCP/Reno A TCP Reno sender
TCP/Newreno A TCP New Reno sender
TCP/Vegas A TCP Vegas sender
TCP/SACK1 A TCP sender with selective acknowledgments
TCPSink A TCP receiver that sends one ACK per packet
TCPSink/DelAck A TCP receiver with a configurable delay for ever
ACK
TCPSink/Sack1 A TCP receiver with selective ACKs
TCPSink/Sack1/DelAck A TCP receiver with Sack1 and DelAck
TCP Source 的設定參數
10
參數 說明fid_ TCP連線的號碼 (Flow ID)。window_ Advertised window的上限值 (upper bond)。Advertised
window有時也稱為receive window,其實指的就是接收端的緩衝區可以容納的封包個數。因此當Congestion window的值超過Advertised window時,TCP的傳送端會執行流量控制以避免送的太快而導致接收端的緩衝區溢滿 (overflow)。
maxcwnd_ Congestion window的最大值。windowInit Congestion window的初始值ecn_ True表示使用ECN。packetSize_ 傳送封包的資料大小。tcpTick_ TCP的timeout時間 (預設值為0.01秒)
maxburst_ 每收到一個ACK觸發傳送端最多能送出的封包個數。0表示關閉此選項功能。
TCP傳送端的狀態參數
11
參數 說明dupacks_ Duplicate ACK個數t_seqno_ 目前傳送的封包序號ssthresh_ Slow-start threshold的值cwnd_ Congestion window的值ack_ 傳送端最後收到的ACK序號maxseq_ 傳送端最後送出的封包序號
模擬架構圖
12
10,000,000 bps x 0.001 sec / 8 bits / 1,000 bits = 1.25 packets
1,000,000 bps x 0.004 sec / 8 bits / 1,000 bits = 0.5 packets
10,000,000 bps x 0.001 sec / 8 bits / 1,000 bits = 1.25 packets
(1.25 + 0.5 + 1.25) + 18 = 21 packets
觀察Bottleneck佇列長度的變化 (NewReno)
25
編號為32、34、36、38、40、42、44以及46
的封包在傳送的過程中遺失
q_lenaction seq_no time q_lenaction seq_no time
queue_length-newreno.tr檔的部份內容