diff options
| author | mo khan <mo@mokhan.ca> | 2025-09-30 12:57:44 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-09-30 12:57:47 -0600 |
| commit | 17ddcdd0fcd06e7bd0b4e368313f1b3070319df9 (patch) | |
| tree | 426e6ba231dc8595f5f54831cca06f625374da8b | |
| parent | 092fcbf5abec7da9ad4492e19a9bf6631c13f767 (diff) | |
Complete assignment 2
| -rw-r--r-- | assignments/2/README.md | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/assignments/2/README.md b/assignments/2/README.md index 105ad47..394e4b0 100644 --- a/assignments/2/README.md +++ b/assignments/2/README.md @@ -351,30 +351,49 @@ d. 192.53.56.7 -> no /23 match -> forward using Default -> Router 3. > (20%) Consider that only a single TCP connection uses a 1 Gbps link, which does not buffer any data. Suppose that this link is the only congested link between the sending and receiving hosts. Assume that the -TCP sender has a huge file to send to the receiver and the receiver’s +TCP sender has a huge file to send to the receiver and the receiver's receive buffer is much larger than the congestion window. Further assume that each TCP segment size is 1,500 bytes; the two-way propagation delay of this connection is 15 msec; and this TCP connection is always in the congestion avoidance phase (ignore slow start). -Given: Single TCP flow over a 1 Gbps link, no buffering at the link; MSS=1500 B (12,000 bits); two-way propagation delay (RTT) = 15 ms; always in congestion avoidance. +Given: + +* Single TCP flow over a 1 Gbps link, no buffering at the link +* segment size = 1500 B (12,000 bits) +* two-way propagation delay (RTT) = 15 ms +* always in congestion avoidance > a) What is the maximum window size (in segments) that this TCP connection can achieve? +Maximum window is equal to the bandwidth delay product in segments. + +- BDP: 1,000,000,000 bps * 0.015 s = 15,000,000 bits. +- segment size: = 1,500 B * 8 = 12,000 bits. +- Maximum window = 15,000,000 / 12,000 = 1,250 segments. + > b) What is the average window size (in segments) and average throughput (in bps) of this TCP connection? +The window will go and up down between the window maximum and half the window maximum. + +- Average window: 0.75 * maximum window = 937.5 segments. +- Average throughput: = + - (average window * segment size) / RTT + - (937.5 * 12,000) / 0.015 = 750,000,000 bps (0.75 Gbps). + > c) How long would it take for this TCP connection to reach its maximum window again after recovering from a packet loss? +After a loss, congestion window equal window max / 2 = 625 segments and then grows by 1 segment per RTT. + +- 1,250 / 2 = 625 segments +- 625 * 0.15 s = 9.375 s + +Time to return to the maximum window is 9.375 s. + > d) Assume we want the 1 Gbps link to buffer a finite number of segments and always keep the link busy sending data. How would you choose a buffer size? Justify your answer. -Answer: -- a) Maximum window without queuing equals the bandwidth-delay product (BDP) in segments. - - BDP(bits) = 1e9 bps * 0.015 s = 15,000,000 bits. - - MSS(bits) = 1,500 B * 8 = 12,000 bits. - - Wmax = 15,000,000 / 12,000 = 1,250 segments. -- b) In AIMD congestion avoidance (Reno-like), cwnd sawtooths between Wmax and Wmax/2. Average window Wavg = 0.75 * Wmax = 937.5 segments. Average throughput = Wavg * MSS / RTT = 937.5 * 12,000 / 0.015 = 750,000,000 bps (0.75 Gbps). -- c) After a loss, cwnd halves to Wmax/2 = 625 segments and then grows by ~1 segment per RTT. Time to return to Wmax is 625 RTTs = 625 * 0.015 s = 9.375 s. -- d) To keep the link busy right after a multiplicative decrease, the queue should supply the missing in-flight data between BDP and cwnd. Provision about BDP/2 worth of buffering: ~625 segments. Then cwnd (625) + queue (625) = BDP, so the link remains fully utilized while cwnd ramps up (with some extra headroom and AQM/ECN recommended in practice). +To keep the link busy right after a drop, the queue should supply the missing in-flight data between BDP and the congestion window. +Provision about BDP/2 worth of buffering. Then congestion window + queue so that the link can be fully utilized while the congestion window ramps up. # References |
