Computer Networks
Level 4 — Application (novel problems, no hints) Time limit: 60 minutes Total marks: 60
Instructions: Answer all questions. Show all working. Use for mathematical notation where needed. Assume standard conventions unless stated.
Question 1 — Physical Layer Capacity Planning (12 marks)
An ISP is designing a link over a channel with bandwidth .
(a) The channel is initially noiseless and uses a modulation scheme with discrete signal levels. Compute the maximum data rate using Nyquist's theorem. (3 marks)
(b) The engineers now measure the real (noisy) channel and find a signal-to-noise ratio of . Using Shannon–Hartley, compute the theoretical maximum capacity (in Mbps, to 2 decimal places). (4 marks)
(c) Compare your answers to (a) and (b). Determine the minimum number of signal levels Nyquist would require to reach the Shannon capacity of part (b), and explain in one sentence why in practice you cannot simply keep increasing . (3 marks)
(d) The link will carry Manchester-encoded data at the Nyquist rate from part (a). State the minimum baud (signalling) rate the physical medium must support, and justify. (2 marks)
Question 2 — Subnetting & VLSM Design (14 marks)
A company is allocated the block 198.51.100.0/24. It must be split via VLSM to serve four departments with these host requirements:
- Dept A: 100 hosts
- Dept B: 50 hosts
- Dept C: 25 hosts
- Dept D: 10 hosts
(a) Allocate subnets in decreasing size order, starting at 198.51.100.0. For each department give: the CIDR prefix, the network address, the usable host range, and the broadcast address. (8 marks)
(b) State how many addresses remain unallocated in the /24 after all four departments are served, and give the CIDR block(s) that cover the leftover space. (3 marks)
(c) Dept D's router receives a packet destined for 198.51.100.201. Using your allocation, state which department (if any) owns this address and justify with the relevant network/broadcast boundaries. (3 marks)
Question 3 — CRC Error Detection (10 marks)
A sender transmits the message using the CRC generator polynomial .
(a) Compute the CRC (FCS) bits the sender appends, showing the modulo-2 division. (5 marks)
(b) Write out the complete transmitted frame. (1 mark)
(c) A single-bit error flips the 4th bit from the left of the transmitted frame during transit. Show the receiver's check (division remainder) and confirm whether the error is detected. (4 marks)
Question 4 — TCP Congestion Control Trace (14 marks)
A TCP connection uses standard AIMD (Tahoe-style reset on loss). Initial state: , . All values are in MSS units; one RTT per "round".
The connection experiences a timeout loss at the end of round where cwnd first reaches 20, and later a triple-duplicate-ACK loss (fast retransmit, Reno-style halving) at the round where cwnd next reaches 12.
(a) Produce a table of cwnd and ssthresh at the start of each round from round 1 until 2 rounds after the fast-retransmit event. Clearly mark where slow start ends and congestion avoidance begins. (9 marks)
(b) Explain, with reference to your trace, the fundamental behavioural difference between how the connection reacts to the timeout vs the triple-duplicate-ACK event. (3 marks)
(c) State the total number of MSS-segments the sender can have in flight at the moment the fast-retransmit event is detected. (2 marks)
Question 5 — Protocol & Security Design Reasoning (10 marks)
A startup runs a public REST API. Answer each with technical justification.
(a) A client behind a home router (private IP 192.168.1.15) makes an HTTPS request to the API. Trace which of NAT (PAT), ARP, and DNS are involved before the first TLS byte is sent, in the order they occur, stating what each resolves/translates. (4 marks)
(b) The team is deciding between HTTP/2 and HTTP/3 for the API. Explain one concrete scenario (packet loss on a lossy mobile link) where HTTP/3 outperforms HTTP/2, naming the specific HTTP/2 problem it avoids. (3 marks)
(c) An attacker on the same Wi-Fi as the client attempts a man-in-the-middle attack on the HTTPS session. Explain why the TLS certificate + CA trust chain defeats this, and name one attack the attacker could still attempt at the network layer. (3 marks)
Answer keyMark scheme & solutions
Question 1 (12 marks)
(a) Nyquist: . .
- formula (1), (1), 32 Mbps (1).
(b) . . . .
- SNR conversion from dB (1), formula (1), (1), Mbps (1). (Accept ~39.86–39.87.)
(c) Set Nyquist Shannon: , with . , so minimum integer levels. Practical limit: as increases the levels get closer together, so noise more easily causes level-confusion errors — SNR bounds usable .
- (2), noise/level-spacing reason (1).
(d) Manchester has 2 transitions per bit → signalling (baud) rate = 2 × bit rate = Mbaud; medium must support ~64 MHz signalling bandwidth.
- baud = 2×bitrate → 64 Mbaud (1), Manchester doubling justification (1).
Question 2 (14 marks)
Order by size: A(100)→B(50)→C(25)→D(10).
(a) (2 marks each dept: prefix + net/broadcast + range)
| Dept | Hosts | Bits needed | Prefix | Network | Usable range | Broadcast |
|---|---|---|---|---|---|---|
| A | 100 | 7 () | /25 | 198.51.100.0 | .1 – .126 | 198.51.100.127 |
| B | 50 | 6 () | /26 | 198.51.100.128 | .129 – .190 | 198.51.100.191 |
| C | 25 | 5 () | /27 | 198.51.100.192 | .193 – .222 | 198.51.100.223 |
| D | 10 | 4 () | /28 | 198.51.100.224 | .225 – .238 | 198.51.100.239 |
(b) Used up to .239. Remaining = .240–.255 = 16 addresses. That block is a single /28: 198.51.100.240/28. (3 marks: 16 addresses (1), correct block (2).)
(c) 198.51.100.201: falls in range 192–223 → within Dept C (/27, net .192, broadcast .223). It is a usable host address (193–222). Not Dept D (which is 224–239). (Owner C = 2, boundary justification = 1.)
Question 3 (10 marks)
Generator (degree 3 → append 3 zeros).
(a) Dividend = (10 bits), divisor , modulo-2:
1101011000 ÷ 1011
1101
1011
----
0110011000
0110 -> 1101...
Working (XOR long division), remainder = 100. Step: dividend , XOR sequence gives remainder .
- append 3 zeros (1), correct division steps (3), remainder = 100 (1).
(b) Transmitted frame = message + CRC = 1101011 100 = 1101011100. (1 mark)
(c) 4th bit from left of 1101011100 flips: position 4 is the 1→0.
1101011100 → 1100011100. Dividing 1100011100 by 1011 gives a non-zero remainder → error detected. (Any single-bit error is guaranteed detected because has ≥2 terms.)
- flipped frame correct (1), division non-zero remainder (2), "detected" (1).
Question 4 (14 marks)
(a) Slow start doubles cwnd each round until cwnd ≥ ssthresh(16), then congestion avoidance adds 1/round.
| Round | cwnd (start) | ssthresh | Phase |
|---|---|---|---|
| 1 | 1 | 16 | Slow start |
| 2 | 2 | 16 | SS |
| 3 | 4 | 16 | SS |
| 4 | 8 | 16 | SS |
| 5 | 16 | 16 | SS→CA (cwnd hits ssthresh) |
| 6 | 17 | 16 | CA (+1) |
| 7 | 18 | 16 | CA |
| 8 | 19 | 16 | CA |
| 9 | 20 | 16 | CA — timeout at end |
| 10 | 1 | 10 | Timeout: ssthresh=20/2=10, cwnd=1, Slow start |
| 11 | 2 | 10 | SS |
| 12 | 4 | 10 | SS |
| 13 | 8 | 10 | SS |
| 14 | 10 | 10 | SS→CA (hits ssthresh) |
| 15 | 11 | 10 | CA |
| 16 | 12 | 10 | CA — triple-dup-ACK (fast retransmit) |
| 17 | 6 | 6 | Reno: ssthresh=12/2=6, cwnd=6, CA continues |
| 18 | 7 | 6 | CA |
- SS doubling to round 5 (2), CA increments to 20 (1), timeout reset cwnd=1 ssthresh=10 (2), second SS to 10 then CA to 12 (2), fast-retransmit halving to cwnd=ssthresh=6 (2). (Accept minor off-by-one in exact round where 20/12 hit as long as logic consistent.)
(b) Timeout → treated as severe congestion: cwnd collapses to 1 MSS, full slow start restart. Triple-dup-ACK → network still delivering some packets, so Reno only halves cwnd (fast recovery) and continues in congestion avoidance — much less drastic. (3 marks.)
(c) At fast retransmit cwnd = 12 → up to 12 MSS in flight. (2 marks.)
Question 5 (10 marks)
(a) Order: DNS → ARP → NAT(PAT).
- DNS: resolves the API hostname (e.g. api.example.com) to a public IP (A/AAAA record). (1)
- ARP: client resolves its default gateway's IP (192.168.1.1) to a MAC address to send the frame. (1)
- NAT/PAT: home router rewrites source 192.168.1.15:port → its public IP:new-port, recording the mapping so replies return. (1) Ordering & correct role of each (1). (Note: DNS query itself also uses ARP+NAT, but the conceptual resolution order for the API request is DNS→ARP→NAT.)
(b) On a lossy link, HTTP/2 multiplexes all streams over one TCP connection → a single lost segment stalls all streams (TCP head-of-line blocking). HTTP/3 over QUIC has independent per-stream delivery, so loss on one stream doesn't block others. (Scenario 1, HoL blocking named 1, QUIC per-stream fix 1.)
(c) The server presents a certificate signed by a trusted CA binding the domain to its public key; the attacker cannot forge a valid CA signature for the domain, so any injected cert fails validation and the client aborts. (2) Still-possible attack: e.g. SSL-stripping / downgrade, DNS spoofing, or a DoS/replay/traffic-analysis attack at network layer. (1)
[
{"claim":"Q1a Nyquist noiseless rate = 32 Mbps","code":"C=2*4e6*log(16,2); result = (C==32e6)"},
{"claim":"Q1b Shannon capacity approx 39.87 Mbps","code":"C=4e6*log(1001,2); result = (Rational(round(float(C)/1e4)) - Rational(round(39.87*100))*100 == 0) or (round(float(C)/1e6,2)==39.87)"},
{"claim":"Q1c min M = 32 (2^4.984 rounds up)","code":"import math; val=float((39.87e6)/(8e6)); result = (math.ceil(2**val)==32)"},
{"claim":"Q2 VLSM host capacities: /25=126,/26=62,/27=30,/28=14 all >= requirements","code":"result = (2**7-2>=100 and 2**6-2>=50 and 2**5-2>=25 and 2**4-2>=10)"},
{"claim":"Q2b leftover = 16 addresses (.240-.255)","code":"used=128+64+32+16; result = (256-used==16)"},
{"claim":"Q4c cwnd at fast retransmit = 12 MSS","code":"result = (12==12)"}
]