CS3.301 Operating Systems and Networks
Introduction to Networks and Transport Layer – Practice Questions
1) A host sends a 5000-byte application message over TCP. The network stack is
organized into the classic OSI-style layered abstraction, where each layer treats
everything handed to it from above as an OPAQUE PAYLOAD and simply wraps its
own header (and, where applicable, trailer) around it:
Layer
Header / Trailer added
Transport (TCP)
20-byte header (no options)
Network (IP)
20-byte header per packet/fragment (no options)
Data Link (Ethernet)
14-byte header + 4-byte trailer (18 bytes total)
per frame
The link's Ethernet MTU limits each IP packet (header + payload) to at most
1500 bytes.
(a) Using the principle of layering/encapsulation, explain why the 1500-byte MTU
constrains the IP packet (IP header + everything above it) but is completely
unaffected by the Ethernet header/trailer itself. In general terms, why does a
lower layer never need to understand the internal structure of the payload it has
been handed?
(b) Compute the size of the single TCP segment (TCP header + application data)
that the Transport layer hands down to the Network layer.
(c) This segment must now be carried across the link. Determine whether it fits
within one IP packet given the 1500-byte MTU. If not, compute the minimum
number of IP fragments required, and the exact size of each fragment — keeping
in mind that IP fragmentation splits the TCP segment purely as a stream of bytes
(it has no awareness of the TCP header's existence), and every fragment needs
its own 20-byte IP header.
(d) Each IP fragment is carried in its own separate Ethernet frame. Compute the
total number of bytes actually transmitted on the wire, across all frames,
including every layer's overhead.
(e) At the receiver, the Data Link and Network layers reverse this process,
reassembling the fragments back into the original TCP segment before handing it
to the Transport layer. Referencing the specific header field(s) involved, explain
exactly how the Transport layer demultiplexes the reassembled segment to the
correct socket — and explain why this demultiplexing cannot happen fragmentby-fragment as each one arrives.
2) A TCP sender starts a connection with the following initial values and
parameters: [10 marks]
EstimatedRTT₀ = 100 ms, DevRTT₀ = 10 ms, α = 0.125, β = 0.25
It then measures the following actual round-trip times for three consecutive
(non-retransmitted) segments:
Sample #
SampleRTT
1
140 ms
2
90 ms
3
115 ms
(a) Compute EstimatedRTT, DevRTT, and TimeoutInterval after each of the three
samples. Show all intermediate values (to 3 decimal places where needed).
(b) Immediately after sample 3, the sender transmits a 4th segment. The ACK for
it does not arrive until 172 ms later. Using your TimeoutInterval from part (a),
determine whether the sender's retransmission timer would have already fired
before this ACK arrived — i.e., would this trigger an unnecessary retransmission?
Justify your answer.
(c) In one sentence, explain why TCP uses 4 × DevRTT as the margin above
EstimatedRTT rather than a fixed constant such as 20 ms.
3) A TCP connection has MSS = 1000 bytes, a fixed RTT = 80 ms, and starts with
cwnd = 1 MSS and ssthresh = 16 MSS. Assume one full window's worth of data is
sent and fully ACKed every RTT.
(a) Tabulate cwnd (in MSS) for rounds 1 through 9, clearly marking which rounds
are in Slow Start and which are in Congestion Avoidance.
(b) At the end of round 9, the sender detects a loss via three duplicate ACKs.
Using the multiplicative-decrease rule, compute the new ssthresh and the new
cwnd immediately after this event.
(c) Continue the trace and give cwnd for rounds 10, 11, and 12.
(d) Compute the sender's approximate throughput (in Mbps) at round 4 and again
at round 11, using throughput ≈ cwnd / RTT.
(e) Suppose that instead of a triple-duplicate-ACK, the loss at round 9 had
instead been detected via a timeout. State what cwnd and ssthresh would
become in that case, and name the phase TCP re-enters. Explain in one
sentence why TCP treats these two loss signals differently.
4) Recall two facts about how TCP transmits data:
(1) flow control limits the sender to at most Window bytes of currentlyunacknowledged (“in-flight”) data at any time, computed as LastByteSent −
LastByteAcked; and
(2) TCP's acknowledgment numbers are CUMULATIVE — an ACK value reports
the next byte the receiver expects, meaning everything up through that point has
been received, in order, with no gaps.
(a) In terms of LastByteSent and LastByteAcked, state precisely the condition
under which a sender that has plenty of application data ready must stop
transmitting any further segments.
(b) A sender has an advertised window of W bytes, and has already transmitted
several back-to-back segments whose combined data exactly fills that window
(it currently has exactly W bytes in flight and cannot send more). The EARLIEST of
these outstanding segments — the very first one sent — is lost in the network,
but every segment sent after it arrives successfully and is buffered at the
receiver. Explain what ACK value the receiver sends back in response to these
successfully-arrived segments, and explain precisely why the sender's usable
window does NOT grow at all, even though most of its outstanding data
technically did arrive safely.
(c) The lost segment from part (b) is then successfully retransmitted and arrives
at the receiver. Explain what happens to the value the receiver reports in its very
next ACK, and why this single retransmission can cause a disproportionately
large jump in how much NEW data the sender is suddenly permitted to send.
(d) In one sentence, explain why this behavior means a single early segment loss
can have an outsized effect on a flow-control-limited sender's throughput, even
though only one segment out of many was actually lost.