1 / 20

實驗九 各種 TCP 版本之觀察 ( 二 )

實驗九 各種 TCP 版本之觀察 ( 二 ). 指導教授:許子衡 教授 報告學生:馬敏修. ( 一 ) 實驗目的 ( 二 ) 背景知識 ( 三 ) 實驗步驟 ( 四 ) 實驗結果. 實驗目的. 暸解 TCP NewReno 與 TCP Sack 之運作方式。. 背景知識. 若同時有多個封包在網路上遺失, TCP Reno 都必須等到 timeout 才能重送遺失的封包。 因為 TCP Reno 收到 Partial ACK 就會結束 Fast-recovery ,進入 Congestion avoidance 階段

colt-turner
Download Presentation

實驗九 各種 TCP 版本之觀察 ( 二 )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 實驗九 各種TCP版本之觀察(二) 指導教授:許子衡 教授 報告學生:馬敏修

  2. (一)實驗目的 (二)背景知識 (三)實驗步驟 (四)實驗結果

  3. 實驗目的 • 暸解TCP NewReno與TCP Sack之運作方式。

  4. 背景知識 • 若同時有多個封包在網路上遺失,TCP Reno都必須等到timeout才能重送遺失的封包。 • 因為TCP Reno收到Partial ACK就會結束Fast-recovery,進入Congestion avoidance階段 • 其中Partial ACK的ACK號碼較先前收到的ACK大,但比稍早已送出的封包編號小。

  5. 若遺失的封包無法使用 Fast-retransmit/Fast-recovery重送,就必須等待Timeout來觸發重送機制。 • 等待Timeout期間TCP不能送出新出的資料,link使用率變差。 • Timeout之後,cwnd值會被重設為1,降低了TCP傳輸效能。

  6. TCP NewReno • NewReno在收到Partial ACK時並不會立刻結束Fast-recovery,反而傳送端會持續重送Partial ACK之後的封包。 • NewReno的傳送端在網路有大量封包遺失時不需等待Timeout就能更正此錯誤。 • NewReno大約每一個RTT時間可重送一個遺失的封包。

  7. TCP with Selective Acknowledgments • 此版本加入了一個SACK選項允許接收端在回傳Duplicate ACK時,將已經收到的資料區段回傳給傳送端,資料區段與資料區段之間的間隔就是接收端沒收到的資訊。

  8. 實驗步驟

  9. 實驗1:TCP Reno • if {$argc !=1} { • puts "Usage: ns exp9.tcl TCPversion " • puts "Example:ns exp9.tcl Reno or ns exp9.tcl Newreno or ns exp9.tcl Sack" • exit • } • set par1 [lindex $argv 0] • set ns [new Simulator] • set nd [open out-$par1.tr w] • $ns trace-all $nd • set f0 [open cwnd-$par1.tr w] • proc finish {} { • global ns nd f0 tcp par1 • puts [format "average throughput: %.1f Kbps" \ • [expr [$tcp set ack_]*([$tcp set packetSize_])*8/1000.0/10]] • $ns flush-trace

  10. close $nd • close $f0 • exec awk { • BEGIN { • highest_packet_id = -1; • packet_count = 0; • q_eln = 0; • } • { • action = $1; • time = $2; • src_node = $3; • dst_node = $4; • type = $5; • flow_id = $8; • seq_no = $11; • packet_id = $12; • if (src_node == "0" && dst_node == "1") { • if (packet_id > highest_packet_id) { • highest_packet_id = packet_id; • }

  11. if (action == "+") { • q_len++; • print time, q_len; • } • if (action == "-" || action == "d") { • q_eln = q_len--; • print time, q_len; • } • } • } • } out-$par1.tr > queue_length-$par1.tr • exit 0 • } • proc record {} { • global ns tcp f0 • set now [$ns now] • puts $f0 "$now [$tcp set cwnd_]" • $ns at [expr $now+0.01] "record" • }

  12. set r0 [$ns node] • set r1 [$ns node] • set n0 [$ns node] • set n1 [$ns node] • $ns duplex-link $n0 $r0 10Mb 1ms DropTail • $ns duplex-link $r0 $r1 1Mb 4ms DropTail • $ns duplex-link $r1 $n1 10Mb 1ms DropTail • set buffer_size 15 • $ns queue-limit $r0 $r1 $buffer_size • if {$par1=="Reno"} { • set tcp [new Agent/TCP/Reno] • set tcpsink [new Agent/TCPSink] • } elseif {$par1=="Newreno"} { • set tcp [new Agent/TCP/Newreno] • set tcpsink [new Agent/TCPSink] • } else { • set tcp [new Agent/TCP/Sack1] • set tcpsink [new Agent/TCPSink/Sack1] • }

  13. $ns attach-agent $n0 $tcp • $tcp set window_ 24 • $ns attach-agent $n1 $tcpsink • $ns connect $tcp $tcpsink • set ftp [new Application/FTP] • $ftp attach-agent $tcp • $ns at 0.0 "$ftp start" • $ns at 10.0 "$ftp stop" • $ns at 0.0 "record" • $ns at 10.0 "finish" • puts [format "on path: %.2f packets" \ • [expr (1000000/(8*([$tcp set packetSize_]+40)) * ((1+4+1) * 2 * 0.001)) + $buffer_size]] • $ns run

More Related