Recall warm-up
- In Stop-and-Wait ARQ with a = 4, what fraction of each cycle is the sender actually transmitting data?
Stuck? Peek at 4.2.1 Stop-and-Wait ARQ, 1-bit sequence numbers & link utilisation
- Stop-and-Wait ARQ: 1 packet in flight; uses 1-bit sequence numbers (0, 1) to discard duplicates when ACKs are lost.
- Utilisation:
η = Tt / (Tt + 2·Tp) = 1 / (1 + 2a), wherea = Tp / Tt(with losses of prob p:(1 − p)/(1 + 2a)). - Throughput:
η × B = L / (Tt + 2·Tp).
- What is the Bandwidth-Delay Product (BDP) of a link?
Stuck? Peek at 1.3.3 RTT, bandwidth-delay product, utilisation and a = Tp/Tt
- RTT = 2·Tp for tiny signals (add Tt / queuing if stated).
- BDP = B × Tp bits in flight; B × RTT before any reply.
- a = Tp / Tt.
- Send-and-wait: U = Tt/(Tt + 2Tp) = 1/(1 + 2a); throughput = U·B.
- To keep the link busy: about 1 + 2a units in flight.
- How many distinct values can a k-bit binary field represent?
Stuck? Peek at 0.2.4 Exponents, logarithms and basic probability
- 2ᵃ·2ᵇ = 2ᵃ⁺ᵇ; 2¹⁰ ≈ 10³ (estimates only).
- log₂ x = power of 2 giving x; bits for N values = ⌈log₂ N⌉.
- P(none) = (1−p)ⁿ · P(≥ 1) = 1 − (1−p)ⁿ · P(exactly 1) = n·p·(1−p)ⁿ⁻¹.
- (1 − 1/n)ⁿ → 1/e ≈ 0.368; 1/(2e) ≈ 0.184.
- 1 + 2 + … + 2ᵏ⁻¹ = 2ᵏ − 1; expected tries = 1/p.
The Hook
In Lesson 4.2.1, when Tt = 2 ms and 2·Tp = 18 ms (cycle = 20 ms), our sender transmitted for 2 ms and sat idle for 18 ms. Notice that 20 ms / 2 ms = 10 packets could have fit back-to-back inside that 20 ms cycle!
Pipelining lets the sender transmit up to N packets back-to-back without waiting for an ACK. A sliding window of size N tracks which packets are currently in flight and slides forward every time an ACK arrives.
Predict First
In our example where 1 cycle is Tt + 2·Tp = 2 + 18 = 20 ms (so 1 + 2a = 10), what is the link utilisation if the sender window size is N = 5 packets? What if N = 10 packets? What if N = 15 packets?
• For N = 5: sender transmits for 5 × 2 = 10 ms out of every 20 ms cycle → η = 5/10 = 50%.
• For N = 10: the first ACK returns at t = 20 ms, right as the 10th packet finishes transmitting → η = 10/10 = 100%!
• For N = 15: the link is already 100% busy (utilisation can never exceed 100%) → η = min(1, 15/10) = 100%!
Core Concept
Pipelining & the Sliding Window Utilisation Formula
A sliding-window protocol allows the sender to have up to N (also written Ws) unacknowledged packets in flight simultaneously. In one cycle of duration Tt + 2·Tp, the sender can transmit N packets (taking N · Tt time):
η = min( 1, (N · Tt) / (Tt + 2·Tp) ) = min( 1, N / (1 + 2a) ), where a = Tp / Tt.Minimum window size for 100% (full) utilisation:
N_opt = ⌈1 + 2a⌉ = ⌈(Tt + 2·Tp) / Tt⌉.Sender Window (Ws) and Receiver Window (Wr)
Both endpoints maintain a window over the sequence number space:
- Sender Window (Ws = N): The range of sequence numbers the sender has transmitted (or is allowed to transmit) that are not yet acknowledged. When the oldest packet in the window is ACKed, the window's left and right edges slide forward.
- Receiver Window (Wr): The range of sequence numbers the receiver is willing to accept and buffer:
— If Wr = 1, the receiver accepts packets strictly in order (Go-Back-N, 4.2.3).
— If Wr > 1, the receiver can buffer out-of-order packets until the missing gap arrives (Selective Repeat, 4.2.4).
k-bit Sequence Numbers & Wrap-Around Ambiguity
In a header, the sequence number field has a fixed width of k bits, so sequence numbers cycle modulo 2ᵏ: 0, 1, 2, …, 2ᵏ − 1, 0, 1, ….
Critical insight: Can a sender use a window of size Ws = 2ᵏ with k-bit sequence numbers? NO! As we prove in 4.2.3 and 4.2.4, to prevent wrap-around ambiguity between old retransmitted packets and new packets when ACKs are lost, every sliding-window protocol must obey the Fundamental Window Bound:
Ws + Wr ≤ 2ᵏ (where k is the number of sequence-number bits).Putting it together
- Pipelining keeps up to N packets in flight at once, boosting link utilisation to η = min(1, N / (1 + 2a)).
- Full (100%) link utilisation is reached when the window size covers the entire round-trip pipe: N ≥ 1 + 2a.
- With k-bit sequence numbers (2ᵏ values), sender and receiver windows must satisfy W_s + W_r ≤ 2ᵏ.
Visual
Worked Examples
A link has a = Tp / Tt = 4. What is the link utilisation for a sliding-window protocol with sender window N = 5? What minimum integer window size N achieves 100% utilisation?
Show the full solution
Here 1 + 2a = 1 + 8 = 9.
For N = 5: η = 5 / 9 ≈ 55.6%.
For 100% utilisation: N = 1 + 2a = 9.
A satellite link has bandwidth B = 1 Mbps and one-way propagation delay Tp = 250 ms. Frames are 1000 bits long. Find Tt, a, and the minimum window size N needed to achieve 100% link utilisation.
Show the full solution
• Tt = 1000 bits / 10⁶ bit/s = 1 ms.
• a = Tp / Tt = 250 / 1 = 250.
• N_opt = 1 + 2a = 1 + 2(250) = 501 frames.
In the satellite link of Example 2 (where 1 + 2a = 501), suppose the protocol instead wants to achieve at least 50% link utilisation (η ≥ 0.50). What is the minimum sender window size N required?
Show the full solution
We need N / (1 + 2a) ≥ 0.50 → N ≥ 0.50 × 501 = 250.5.
Since window size N must be an integer, N = ⌈250.5⌉ = 251 frames.
GATE Traps
- Utilisation cannot exceed 1 (100%)! If
1 + 2a = 5andN = 8, utilisation is 1 (100%), NOT8/5 = 160%! Always applymin(1, N/(1+2a)). - k bits ≠ window size k! A k-bit sequence number field gives 2ᵏ sequence numbers (not k).
Memory Hook
Fill the pipe of length (1 + 2a) with N packets: η = min(1, N / (1 + 2a)), and Ws + Wr ≤ 2ᵏ!
Connect the Dots
Now we have the general sliding-window framework. What happens when Packet #3 in the middle of a window of 8 packets gets lost? Next question (4.2.3): How does Go-Back-N (GBN) handle losses when the receiver refuses to buffer out-of-order packets (Wr = 1)?
Self-Test
- NAT
A link has ratio a = T_p / T_t = 7.5. What is the minimum sender window size N required to achieve 100% link utilisation?
Write your answer before opening the key.
- NAT
On a link where 1 + 2a = 20, what is the link utilisation (in percent) when a sliding-window protocol uses a sender window of size N = 7?
Write your answer before opening the key.
- MCQ
What is the universal relationship between sender window size W_s, receiver window size W_r, and a k-bit sequence number field to guarantee no sequence-number ambiguity?
- W_s + W_r ≤ k
- W_s + W_r ≤ 2ᵏ
- W_s × W_r ≤ 2ᵏ
- W_s + W_r ≤ 2ᵏ − 1
- NAT
A 4 Mbps link has one-way propagation delay T_p = 10 ms and sends 4000-bit frames. What is the link utilisation (in percent) if the sender window size is N = 25?
Write your answer before opening the key.
Rule Card
- Sliding-window utilisation:
η = min(1, N / (1 + 2a)); full utilisation atN = ⌈1 + 2a⌉. - k-bit sequence space:
0 .. 2ᵏ − 1(2ᵏ numbers); universal bound:Ws + Wr ≤ 2ᵏ.
Concept Ledger
- sliding window
- sender window Ws
- receiver window Wr
- k-bit sequence space 0..2ᵏ−1
- pipelining
- η = min(1, N/(1+2a))
Answer Vault
Try the questions first. Open when you are ready to check.
Warm-up answers
- 1 / (1 + 2×4) = 1/9 (about 11.11%).
- The number of bits that can be in flight in the pipe across one RTT (2·T_p × B).
- 2ᵏ values (from 0 to 2ᵏ − 1).
Self-test answers
- 16 — N_opt = 1 + 2a = 1 + 2(7.5) = 16.
- 35 — η = N / (1 + 2a) = 7 / 20 = 0.35 = 35%.
- B — To prevent overlap between the old window and the new window when ACKs are lost, W_s + W_r ≤ 2ᵏ must hold.
- A: k bits give 2ᵏ sequence numbers, not k.
- C: The bound is additive (W_s + W_r ≤ 2ᵏ), not multiplicative.
- D: W_s + W_r can equal 2ᵏ (in GBN, W_s = 2ᵏ − 1 and W_r = 1 sum to 2ᵏ).
- 100 — T_t = 4000 / (4 × 10⁶) = 1 ms → a = 10 / 1 = 10 → 1 + 2a = 21. Since N = 25 ≥ 21, η = min(1, 25/21) = 1 = 100%.
Flashcards
- Formula for sliding-window link utilisation with window size N?
Reveal answer
η = min(1, N / (1 + 2a)), where a = T_p / T_t. - Minimum window size N for 100% link utilisation?
Reveal answer
N = ⌈1 + 2a⌉ = ⌈(T_t + 2·T_p) / T_t⌉. - State the universal window bound connecting W_s, W_r, and k.
Reveal answer
W_s + W_r ≤ 2ᵏ.
Exam shortcuts
- Universal Window Bound
Ws + Wr ≤ 2ᵏ: Memorise this ONE inequality and plug inWr = 1for GBN (Ws ≤ 2ᵏ − 1) orWr = Wsfor SR (Ws ≤ 2ᵏ⁻¹)! — never mixing up the GBN and SR window size formulas. - Target Utilisation Window Formula: To reach target efficiency η_target, minimum integer window is
N = ⌈η_target × (1 + 2a)⌉. — GATE NAT questions asking for window size or bits for 50%, 80%, or 100% efficiency.