22-Elec-B4 Information Technology Networks · May 2015
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Paper format. Professional Engineers of Ontario annual examination, 07-Elec-B4 Information Technology Networks, May 2015. Three hours, closed book, one PEO-approved non-programmable calculator permitted. Marks are printed in the left margin; the cover page states that there are five questions of 25 marks each and that any four constitute a complete paper worth 100 marks. All five questions and every sub-part are answered below, because this set is intended as a study resource rather than as a sat examination.
Reference texts. A. Leon-Garcia and I. Widjaja, Communication Networks: Fundamental Concepts and Key Architectures, 2nd ed. — the text listed by the Engineers Canada syllabus for this examination code; J. F. Kurose and K. W. Ross, Computer Networking: A Top-Down Approach, 8th ed.; A. S. Tanenbaum and D. J. Wetherall, Computer Networks, 5th ed.; W. Stallings, Wireless Communications and Networking, 2nd ed.; T. S. Rappaport, Wireless Communications: Principles and Practice, 2nd ed. Normative documents cited: ISO/IEC 7498-1 (the OSI reference model), IEEE 802.3 (CSMA/CD), IEEE 802.5 (token ring), IEEE 802.11 (wireless LAN), 3GPP TS 23.401 (the LTE Evolved Packet Core), RFC 793 (TCP), RFC 768 (UDP) and RFC 5681 (TCP congestion control).
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Part (a) — the major differences. Both protocols do the one thing the transport layer must do, which is to multiplex and demultiplex data between processes using port numbers, and to checksum what they carry. Beyond that they are opposites: TCP adds every service a stream could want, and UDP deliberately adds nothing.
| Property | TCP (RFC 793) | UDP (RFC 768) |
|---|---|---|
| Connection | Connection-oriented: a three-way handshake (SYN, SYN-ACK, ACK) establishes state at both ends before any data moves, and a four-way exchange closes it. | Connectionless: a datagram may be sent at any time with no prior exchange and no state kept. |
| Reliability | Reliable: every byte is sequence-numbered, acknowledged, and retransmitted on timeout or on triple duplicate ACK. | Best effort: a lost datagram is simply lost, and the application must detect and handle it or tolerate it. |
| Ordering | Delivers the byte stream in the order sent, buffering out-of-order segments until the gap is filled. | Delivers datagrams in whatever order they arrive. |
| Flow control | Yes — the receiver advertises a window so a fast sender cannot overrun a slow receiver's buffer. | None; the receiver's buffer can overflow silently. |
| Congestion control | Yes — slow start plus AIMD, which is what keeps the Internet stable under load. | None; a UDP source transmits at whatever rate the application chooses. |
| Service model | A byte stream: message boundaries are not preserved, and the receiver may read a different segmentation than the sender wrote. | A message service: each datagram is delivered whole or not at all, preserving boundaries. |
| Header and overhead | 20 bytes minimum, plus handshake round trips and per-connection state at both ends. | 8 bytes, no round trips, no state — so one server can serve very large client populations cheaply. |
| Addressing modes | Unicast only, because a connection has exactly two endpoints. | Supports unicast, broadcast and multicast. |
The single sentence that captures it: TCP trades latency and complexity for a guarantee, and UDP trades the guarantee for latency and simplicity.
Part (b) — one application for each. Better for TCP: bulk file transfer, and web page delivery over HTTP. The content is useless unless every byte arrives exactly once and in order — a missing block in an executable or a corrupted row in a database export is a failure, not a glitch — and the transfer is elastic, so it is content to run faster or slower as capacity allows, which is exactly what TCP's congestion control delivers. Better for UDP: real-time voice or video, such as a VoIP call. A packet that has to be retransmitted arrives long after its playout deadline and is therefore worthless, so retransmission would add delay without adding value; the codec conceals the occasional lost packet far more gracefully than the conversation tolerates a stall, and a constant-rate stream has no use for a window that halves on loss. A second good UDP example is DNS, where the whole transaction is one small request and one small reply and a TCP handshake would triple the latency of a lookup that is repeated billions of times a day.
Part (c) — evolution of the congestion window.
Given. Initial congestion window $\text{cwnd}_1 = 1$ MSS; congestion threshold (slow-start threshold) $\text{ssthresh} = 16$ MSS; every segment is acknowledged, so there is no loss and no timeout anywhere in the trace.
Find. The sequence of window sizes, round by round, showing both the behaviour below the threshold and the behaviour above it.
Approach. Apply the two rules of RFC 5681: while $\text{cwnd} < \text{ssthresh}$ the sender is in slow start and increases cwnd by one MSS for every ACK received, which doubles cwnd every round-trip time; once $\text{cwnd} \ge \text{ssthresh}$ it is in congestion avoidance and increases cwnd by one MSS per round-trip time.
| Round (window) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| cwnd (MSS) | 1 | 2 | 4 | 8 | 16 | 17 | 18 | 19 | 20 |
| Phase | slow start (exponential) | congestion avoidance (linear) | |||||||
The number of segments the sender has been able to inject by the end of round 9 is $1+2+4+8+16+17+18+19+20 = 105$ MSS, of which the first five rounds contributed only 31 — the exponential phase is short, and almost all of the transfer happens in congestion avoidance.
Part (d) — a packet in the third window is lost.
Given. The same trace as above (initial window 1, threshold 16), except that a segment sent in the third window is not acknowledged. From part (c) the third window has $\text{cwnd} = 4$.
Find. The congestion window for each of the first eight windows.
Approach. An unacknowledged segment that produces no ACK at all is detected by the retransmission timer expiring. On timeout, TCP sets the threshold to half the window in flight, collapses the window to one MSS and re-enters slow start.
| Window | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| cwnd (MSS) | 1 | 2 | 4 (loss) | 1 | 2 | 3 | 4 | 5 |
| ssthresh (MSS) | 16 | 16 | 16 | 2 | ||||
Check: this answer assumes the loss is detected by timeout, which is what "a packet is not acknowledged" most directly describes, and it is the behaviour of TCP Tahoe and of any Reno sender whose window is too small to generate three duplicate ACKs — with only four segments in flight, three duplicate ACKs are in fact unlikely, so the timeout reading is also the physically correct one here. If instead the loss were signalled by three duplicate ACKs, a TCP Reno sender would use fast retransmit and fast recovery: it would halve the window rather than collapse it, giving 1, 2, 4, 2, 3, 4, 5, 6. State whichever assumption you use.