Question 2 of 6: Fundamental Concepts and Mechanisms
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
98-Comp-B10 Distributed Systems — National Examinations, May 2017. 3 hours, closed book, non-programmable calculator only. Candidates were instructed to answer any five of the six questions (only the first five as they appear in the answer book are marked), all carrying equal weight and mostly requiring essay-format answers; all six are answered below as a complete study resource.
Reference texts: Coulouris, Dollimore, Kindberg & Blair, Distributed Systems: Concepts and Design (5th ed.) — system models, peer-to-peer systems, middleware and client-server architecture (ch. 1–2), interprocess communication and the request-reply protocol (ch. 4–5), remote invocation (ch. 5), operating system support for distributed systems (ch. 7), security (ch. 11), distributed file systems (ch. 12), and time, coordination, replication and fault tolerance (ch. 14–15, 18).
Check — source parsing artifact. Every question header on this paper is printed as “Question # N.” (a literal hash between the word and the number).
Question 2: Fundamental Concepts and Mechanisms (20 marks)
Given (a). Two back-to-back client requests of 750 bytes each, answered by a single 6000-byte response; per-packet latency 5 ms (applies whether local or remote, incurred once per packet in each direction); one-time TCP connection setup 5 ms; data transfer rate 20 Mbps; MTU 2000 bytes; server processing time 2 ms; network lightly loaded (no queuing delay).
Given data — Q2(a)
Quantity
Value
Request size (each of two)
750 bytes
Response size
6000 bytes
Per-packet latency (local or remote)
5 ms
TCP connection setup (TCP only)
5 ms
Data transfer rate
20 Mbps
MTU
2000 bytes
Server processing time
2 ms
Find. The total estimated elapsed time from the client sending the first request to it receiving the complete response, for (i) UDP, (ii) TCP, and (iii) client and server co-located on one machine.
Approach. Model the time to move an L-byte message across the network as k packet-latencies (one per MTU-sized packet) plus the message's transmission time at the link rate; add the server's fixed processing time once (it produces one combined response after both requests), and add the one-time TCP handshake only for the connection-oriented case.
Check — modelling assumptions. Two assumptions are needed beyond the stated model. (1) Since the two 750-byte requests are sent back to back with no reply in between, their transmission times are additive and each still pays its own per-packet latency (both fit within the 2000-byte MTU, so 1 packet each, 2 packets total). (2) "Produces a single response message" is read as the server processing both requests together and incurring its 2 ms processing cost once, not once per request.
Packet counts. Each 750-byte request fits in a single packet ($750<2000$): $k_{req}=1$ per request, 2 packets total for both. The 6000-byte response needs $k_{resp}=\lceil 6000/2000\rceil=3$ packets.
Request transfer time (both requests, back to back). $$T_{req}=2(5)+\dfrac{8(2\times750)}{20\times10^{6}}\times1000=10+0.6=10.6\ \text{ms}$$
Response transfer time. $$T_{resp}=3(5)+\dfrac{8(6000)}{20\times10^{6}}\times1000=15+2.4=17.4\ \text{ms}$$
(i) UDP (connectionless). No connection to establish; the client sends both requests, the server processes them once, and sends the response. $$\boxed{T_{UDP}=T_{req}+T_{proc}+T_{resp}=10.6+2+17.4=30.0\ \text{ms}}$$
(ii) TCP (connection-oriented). The same exchange is preceded by a one-time 5 ms handshake. $$\boxed{T_{TCP}=T_{setup}+T_{req}+T_{proc}+T_{resp}=5+10.6+2+17.4=35.0\ \text{ms}}$$
(iii) Same machine. The stated latency applies "local or remote," representing the fixed marshalling/kernel-crossing overhead paid even between two processes on the same host; with no physical network to cross, there is no MTU-driven fragmentation and the data-rate term is negligible, but the two requests are still two separate local send/receive exchanges, each paying its own local latency, followed by one exchange for the response. $$\boxed{T_{local}=5+5+2+5=17.0\ \text{ms}}$$
Final Results — Q2(a)
Case
Estimated total time
(i) UDP (connectionless)
30.00 ms
(ii) TCP (connection-oriented)
35.00 ms
(iii) Client and server on the same machine
17.00 ms
(b) Packet reordering over a WAN vs. a LAN.(i) Wide area network — reordering IS possible. A WAN is built from many interconnected routers, and IP is a connectionless, best-effort protocol: consecutive datagrams from the same source to the same destination are not guaranteed to follow the same physical path, because routers make independent, per-packet (or at best per-flow-with-periodic-reselection) forwarding decisions, and dynamic routing can shift a flow onto a different path between one packet and the next (a link becoming congested, a route recalculation, load-balancing across multiple equal-cost paths). Two packets sent back to back can therefore traverse paths with different numbers of hops, different queuing delays at different routers, or different congestion, so a later-sent packet can legitimately arrive before an earlier one. This is precisely why protocols that need in-order delivery (TCP) must explicitly resequence packets at the receiver using sequence numbers, rather than assuming the network preserves order — the network itself makes no such promise. (ii) Same local area network — reordering is far less likely, but not impossible. On a classical shared-medium or simple switched LAN with a single path between source and destination, packets traverse exactly one link (or one store-and-forward switch) in strict transmission order with no alternate routes to diverge onto, so under normal conditions they are delivered in the order sent. However, it is not an absolute guarantee: a modern switch with multiple internal queues/priority classes (QoS-tagged traffic taking a different internal path or being serviced ahead of untagged traffic), link-layer retransmission on a wireless LAN segment, or link aggregation across multiple physical paths between the same two switches can still reorder packets even within one LAN, so an application that depends on strict ordering should still not assume a LAN's physical proximity alone guarantees it.