CAP7001 · Unit 5: Transport layer
Congestion control and quality of service
18 practice questions · in the ETE syllabus
Key points
- Sender window = min(cwnd, receiver window)
- Slow start doubles per RTT, avoidance adds one MSS per RTT
- Timeout: ssthresh = cwnd / 2 and cwnd = 1
- Token bucket permits bursts, leaky bucket smooths to a constant rate
- QoS traits are reliability, delay, jitter and bandwidth
- QoS techniques: scheduling, traffic shaping, resource reservation, admission control
Congestion occurs when more traffic arrives than the network can carry. TCP reacts with a congestion window (cwnd), which limits the unacknowledged data in flight. The sender may have at most min(cwnd, receiver window) outstanding, so throughput is about window / RTT.
Phases. In slow start cwnd doubles each RTT (1, 2, 4, 8, 16, ...) until it reaches ssthresh. In congestion avoidance it grows by about one MSS per RTT. On a timeout, ssthresh becomes half of cwnd and cwnd drops to 1 MSS (Tahoe). On three duplicate acks, Reno halves cwnd and continues from ssthresh (fast recovery).
Worked example: after a timeout at cwnd 32, ssthresh = 16 and cwnd = 1. Counting RTT 1 with cwnd 1, the window first reaches 16 at RTT 5. With 10 segments of 1460 bytes and RTT 100 ms, throughput is 10 x 1460 x 8 / 0.1 = 1.168 Mbps.
Traffic shaping. A leaky bucket outputs at a constant rate. A token bucket lets a source save tokens and send a burst up to the bucket size: a 6-token bucket refilling at 2 per second passes 6 packets of a 10-packet burst at once and the last 4 after 2 seconds.
QoS describes a flow by reliability, delay, jitter and bandwidth. IntServ reserves resources per flow with RSVP, while DiffServ marks packets with a DSCP and routers apply per-hop behaviours without per-flow state.
Exam trap: a timeout restarts cwnd at 1, but triple duplicate acks do not.
Techniques to improve QoS
- Scheduling. FIFO serves packets in arrival order and drops new arrivals when full (tail drop). Priority queuing serves the low-priority queue only when the high one is empty, so it can starve. Weighted fair queuing gives each class weight / total weight of the link: weights 3, 2 and 1 on 600 kbps give 300, 200 and 100 kbps.
- Traffic shaping. A leaky bucket drains at a constant rate: a 12 Mb burst at 2 Mbps takes 6 s. A token bucket of capacity C filling at rho on a link of rate M allows a full-speed burst of
S = C / (M - rho): 1 Mb, 2 Mbps and 10 Mbps give 1/8 s = 125 ms. - Resource reservation. Buffers and bandwidth are reserved per flow in advance (RSVP in IntServ).
- Admission control. A router accepts a new flow only if it can meet the flow's specification without hurting existing flows.
Jitter is the variation in delay between packets of a flow (delays of 40, 45 and 38 ms vary by 7 ms).
Try two questions
cwnd is 10 segments of 1460 bytes each and the RTT is 100 ms. What is the approximate throughput?
- About 1.17 Mbps
- About 0.15 Mbps
- About 11.7 Mbps
- About 0.12 Mbps
Show the answer
A. 10 x 1460 x 8 = 116800 bits per 0.1 s, which is 1168000 bits per second.
Why not B: That forgets to convert bytes to bits.
Why not C: That treats the RTT as 10 ms.
Why not D: That forgets to divide by the RTT.
In FIFO queuing, what happens when packets arrive faster than the router can send them and the queue is full?
- The oldest packets are given priority bits
- The router sends packets out of order to catch up
- Newly arriving packets are dropped
- The sender's window is reduced by the router directly
Show the answer
C. First-in, first-out serves packets in arrival order. When the buffer fills, further arrivals are discarded (tail drop).
Why not A: FIFO has no priorities.
Why not B: FIFO keeps arrival order.
Why not D: Routers do not change TCP windows.