Chapter 3 Problems

Transport layer ✎ Practice Kurose & Ross pp. 284–299 · ~7 min read

  • internet checksum
  • congestion window
  • slow start
  • round-trip time

Where you are

  • Application layer
  • Transport layer you are here
  • Network layer
  • Link layer
  • Physical layer

Nineteen review questions and fifty-eight problems — the largest set in the book — with every numeric answer computed rather than copied, and every book misprint named where it appears.

How to use this page

  • Attempt first. A numeric answer reveals its working once you get it right, or when you explicitly ask for it. An open question hides behind “think first”. A solution read too early is a solution not learned.
  • Numeric answers accept a 1 % tolerance by default, so rounding as you go is fine. A few parts that must be exact — window sizes in segments, round numbers — accept no tolerance at all.
  • Six problems refer to figures or sections by the wrong number. Each one says so in its setup, and gives the number that was meant. They are printing errors, not traps.
  • Where a problem asks for a drawing, the solution gives the trace or the state machine in words and a table. Draw yours first, then compare.

Why this matters

Chapter 3 is the chapter where a mechanism can look obviously right and be wrong. These problems are where you discover which.

Four are worth doing even if you skip everything else. P12 takes a one-line change to the rdt3.0 reliable data transfer protocol — retransmit instead of ignore — and shows the protocol stays correct while its cost grows without bound. P23 gives the rule that decides how large a sender window a sequence space can carry, and it differs between the two pipelined protocols.

P40 asks you to read a protocol’s internal state off a graph of its window, which is what anybody debugging a slow transfer actually does. And P50 computes how long TCP (Transmission Control Protocol) Reno takes to recover from one lost packet on a 10 Gbps link. The answer is over two hours, and it is the reason every modern replacement exists.

Review questions

Review Questions R1–R19

These check that you can say what the chapter said. Answer first, then read the worked solution. Several of them look like they have one answer and have two.

  1. R1The network layer accepts a segment of at most 1,200 bytes plus a destination host address, and guarantees to deliver it. Many application processes run on the destination host.

    The operating system on the destination host has given every running process a 4-byte port number.

    a.Design the simplest transport protocol that gets application data to the right process.

    Hint: What is the one thing the network layer does not know?

    b.Now add a "return address", so the destination process can reply.

    c.In your protocols, does the transport layer have to do anything in the core of the network?

  2. R2On some planet everyone lives in a family of six. Each house has a unique address. Each person in a house has a unique name. The mail service carries letters from house to house, and requires that the letter be in an envelope with the destination house address written on it, and nothing more. Each family has one delegate who collects and hands out letters.

    This is the household analogy from section 3.1, turned into a question. Ann and Bill are the delegates; the mail service is the network layer.

    a.Describe a protocol the delegates can use to deliver letters from one family member to another.

    b.In your protocol, does the mail service ever have to open the envelope?

  3. R3On a TCP connection between Host A and Host B, the segments from A to B carry source port x and destination port y. What are the source and destination ports on the segments travelling from B to A?

    Pick the pair.

  4. R4Why might an application developer choose to run an application over UDP rather than TCP?

    Give the four reasons section 3.3 lists.

    Hint: Two are about control, one is about state, one is about the handshake.

  5. R5Why is voice and video traffic often sent over TCP in today's Internet? The answer has nothing to do with congestion control.

    Pick the reason.

  6. R6Can an application have reliable data transfer even though it runs over UDP? If so, how?

    Answer, then read the solution.

  7. R7A process on Host C has a UDP socket with port number 6789. Host A and Host B each send a UDP segment to Host C with destination port 6789.

    a.Will both segments be directed to the same socket at Host C?

    b.How will the process on Host C tell the two apart?

  8. R8A Web server runs on Host C on port 80. It uses persistent connections and is currently serving requests from two different hosts, A and B.

    a.Are all the requests arriving through the same socket at Host C?

    b.Do both sockets have port 80?

  9. R9In the rdt protocols of section 3.4, why did we need to introduce sequence numbers?

    Pick the reason the chapter gives.

  10. R10In the rdt protocols, why did we need to introduce timers?

    Pick the reason the chapter gives.

  11. R11Suppose the round-trip delay between sender and receiver is constant and known to the sender. Would a timer still be necessary in rdt3.0, assuming packets can be lost?

    Answer, then read the solution.

  12. R12Visit the Go-Back-N interactive animation at the companion Web site.

    You do not need the companion site — this section's own Go-Back-N widget does the same three experiments. Answer from the mechanism, then check with the widget.

    a.Send five packets, pause before any reach the destination, kill the first packet, then resume. What happens?

    b.Repeat, but let the first packet arrive and kill the first acknowledgement instead. What happens?

    c.Finally, try sending six packets. What happens?

  13. R13Repeat R12 with the Selective Repeat animation. How are Selective Repeat and Go-Back-N different?

    Describe the three differences the experiments expose.

    Hint: Buffering, acknowledging, retransmitting.

  14. R14True or false?

    a.Host A is sending Host B a large file over TCP. Host B has no data to send. So Host B will not send acknowledgements, because it cannot piggyback them on data.

    b.The size of the TCP receive window never changes during the connection.

    c.Host A is sending Host B a large file over TCP. The number of unacknowledged bytes A has sent cannot exceed the size of the receive buffer.

    d.If the sequence number of a segment is m, the sequence number of the next segment is necessarily m + 1.

    e.The TCP segment has a header field for the receive window.

    f.If the last measured round-trip-time sample is 1 second, the current timeout interval is necessarily at least 1 second.

    g.Host A sends one segment with sequence number 38 and 4 bytes of data. In the same segment, the acknowledgement number is necessarily 42.

  15. R15Host A sends two TCP segments back to back to Host B. The first has sequence number 90; the second has sequence number 110.

    a.How much data is in the first segment?

    bytes

    b.The first segment is lost but the second arrives. What acknowledgement number does Host B send?

  16. R16In the Telnet example of section 3.5, the user types the letter C. A few seconds later the user types the letter R. After typing R, how many segments are sent, and what is in their sequence-number and acknowledgement-number fields?

    In Figure 3.36 the client's initial sequence number is 42 and the server's is 79. The letter C has already been typed, echoed and acknowledged. Assume Host A is the client and Host B is the server.

    a.How many segments are sent in total after R is typed?

    segments

    b.Why does the third segment carry no data?

  17. R17Two TCP connections share a bottleneck link of rate R bits per second. Both have a huge file to send in the same direction, and both start at the same time. What transmission rate would TCP like to give each connection?

    Pick the rate.

  18. R18True or false? In TCP congestion control, when the timer expires at the sender, ssthresh is set to one half of its previous value.

    True or false?

  19. R19The TCP splitting sidebar in section 3.7 claims the response time is approximately 4·RTT_FE + RTT_BE + processing time. Justify the claim.

    RTT_FE is the round-trip time between the client and a nearby front-end server. RTT_BE is the round-trip time between the front end and the distant data centre.

    Where do the four front-end round trips come from, and why is there only one back-end round trip?

Problems

Problems P1–P58

Every numeric answer here was computed rather than read from a solution manual. Where the book misprints a reference or the printed numbers do not behave, the solution says so plainly.

  1. P1Client A starts a Telnet session with Server S. At about the same time, Client B also starts a Telnet session with Server S.

    Telnet's well-known server port is 23. Client ports are chosen by the operating system from the ephemeral range, above 1023.

    a.Possible source and destination ports on the segments from A to S?

    b.And from B to S?

    c.And from S back to A?

    d.And from S back to B?

    e.If A and B are different hosts, can the source port from A equal the source port from B?

    f.What if A and B are the same host?

  2. P2Consider Figure 3.5. What are the source and destination port values in the segments flowing from the server back to the clients' processes? What are the IP addresses in the network-layer datagrams carrying those segments?

    In Figure 3.5, host A sends from port 26145 to server C's port 80, and host B sends from ports 7532 and 26145 to the same server port 80.

    Give the ports and addresses on each returning segment.

  3. P3UDP and TCP use ones-complement arithmetic for their checksums. You have three 8-bit bytes: 01010011, 01100110, 01110100. What is the ones complement of their sum?

    The real protocols use 16-bit words. This problem uses 8-bit words to keep the arithmetic short. The section 3.3 widget on this page will do the same sum bit by bit.

    a.The checksum is:

    b.Why take the ones complement? Why not just send the sum? And how does the receiver detect errors?

    c.Can a 1-bit error go undetected?

    d.Can a 2-bit error go undetected?

  4. P4More ones-complement arithmetic.

    a.Bytes 01011100 and 01100101. The ones complement of their sum is:

    b.Bytes 11011010 and 01100101. The ones complement of their sum is:

    c.For the bytes in part (a), give an example where one bit is flipped in each byte and yet the checksum does not change.

  5. P5A UDP receiver computes the Internet checksum for a received segment and finds it matches the value in the checksum field. Can the receiver be absolutely certain that no bit errors occurred?

    Answer, then read the solution.

  6. P6Show that the receiver in Figure 3.60, operating with the rdt2.1 sender of Figure 3.11, can lead sender and receiver into a deadlock, where each waits for an event that will never occur.

    The incorrect receiver of Figure 3.60 replies NAK when it gets a corrupted packet **or** when it gets a packet with the sequence number it is not expecting. The correct rdt2.1 receiver replies with an acknowledgement in the second case.

    Trace the deadlock.

    Hint: Start by corrupting an acknowledgement rather than a data packet.

  7. P7In rdt3.0, the acknowledgement packets flowing from receiver to sender have no sequence numbers of their own, although they do carry the sequence number of the packet they acknowledge. Why do the acknowledgements not need sequence numbers?

    Pick the reason.

  8. P8Draw the finite state machine for the receiver side of rdt3.0.

    Describe the states, the transitions and their actions.

    Hint: Compare with the rdt2.2 receiver. How much of it has to change?

  9. P9Give a trace of rdt3.0 when data packets and acknowledgement packets are garbled, similar to the trace in Figure 3.16.

    Trace both cases: a corrupted data packet and a corrupted acknowledgement.

  10. P10A channel can lose packets, but has a known maximum delay. Modify rdt2.1 to include a sender timeout and retransmission. Argue informally why your protocol works.

    Describe the changes and the argument.

  11. P11Look at the rdt2.2 receiver in Figure 3.14 and the packet it builds in its self-transitions: `sndpkt = make_pkt(ACK, 1, checksum)` in the wait-for-0 state, and `sndpkt = make_pkt(ACK, 0, checksum)` in the wait-for-1 state. Would the protocol still work if this action were removed?

    a.Remove it from the self-transition in the wait-for-1-from-below state. Does the protocol still work?

    b.Now remove it from the self-transition in the wait-for-0-from-below state. Does the protocol still work?

  12. P12The rdt3.0 sender ignores every received packet that is in error or has the wrong `acknum`. Suppose instead it retransmitted the current data packet in those circumstances. Would the protocol still work?

    The hint says: consider a channel with bit errors only — no losses — but where premature timeouts can occur. Count how many times the nth packet is sent as n grows.

    Does it still work?

  13. P13Draw a diagram showing that if the channel between sender and receiver can reorder messages, the alternating-bit protocol will not work correctly. Say clearly in what sense it fails.

    Give the trace and name the failure.

    Hint: Delay one old data packet long enough to arrive after a later one.

  14. P14Consider a reliable transfer protocol that uses only negative acknowledgements. Would a NAK-only protocol be preferable when the sender sends data infrequently? What if the sender has a lot of data to send and the connection loses little?

    a.Sender sends data infrequently. NAK-only or ACK-based?

    b.Sender has a lot of data and losses are rare. NAK-only or ACK-based?

  15. P15Consider the cross-country example of Figure 3.17. How large must the window be for channel utilisation to exceed 98 percent? A packet is 1,500 bytes, including headers.

    From Figure 3.17: the link runs at 1 Gbps and the round-trip propagation delay is 30 ms.

    Smallest window size, in packets:

    packets
  16. P16An application uses rdt3.0. Because stop-and-wait has very low utilisation, its designers let the receiver keep sending back several alternating ACK 0 and ACK 1 packets, even when the corresponding data has not arrived. Would this increase channel utilisation? Are there problems?

    a.Does utilisation go up?

    b.What is wrong with it?

  17. P17Two entities A and B are joined by a perfect two-way channel: nothing is corrupted, lost or reordered. They must deliver messages to each other strictly in turn — A to B, then B to A, then A to B, and so on. If an entity is asked to send when it is not its turn, it answers with `rdt_unable_to_send(data)`. Draw one finite state machine for A and one for B.

    Give both machines.

    Hint: The channel is perfect, so no checksums, sequence numbers, timers or acknowledgements are needed. All you are modelling is whose turn it is.

  18. P18In the generic Selective Repeat protocol the sender transmits a message as soon as it is available, if it is in the window. Design a Selective Repeat variant that sends messages **two at a time**: it sends a pair, and sends the next pair only when it knows both messages of the first pair arrived correctly. The channel may lose messages but will not corrupt or reorder them.

    Give the packet formats, the two finite state machines, and a trace showing recovery from a lost packet.

  19. P19Host A wants to send packets to Hosts B and C at the same time, over a broadcast channel: a packet sent by A is carried to both. The channel can independently lose and corrupt packets, so a packet may reach B correctly but not C. Design a stop-and-wait-like protocol so that A does not take new data from the layer above until it knows **both** B and C have received the current packet. Give machines for A and C, and the packet formats.

    Give the design.

    Hint: A single acknowledgement is no longer enough. What must A wait for?

  20. P20Hosts A and B both send messages to Host C. A and C are joined by a channel that can lose and corrupt messages but not reorder them; B and C are joined by an independent channel with the same properties. The transport layer at C must **alternate** in delivering messages upward: first a message from A, then one from B, then one from A, and so on. Design a stop-and-wait-like protocol. Give machines for A and C, and the packet formats.

    Give the design.

    Hint: A and B do not talk to each other. Who enforces the alternation, and how?

  21. P21Entity B has data messages for entity A. When A is asked by the layer above for the next data message, A must send a request message R to B. Only on receiving an R may B send a data message D back. A must deliver exactly one copy of each D to the layer above. R messages can be lost, but not corrupted. D messages, once sent, always arrive correctly. Delays on both channels are unknown and variable. Give a finite state machine for a protocol using only the mechanisms that are absolutely necessary.

    Which mechanisms are necessary, and which are not? Then give the machines.

    Hint: Go through the list — checksum, acknowledgement, sequence number, timer — and justify each one against the stated channel.

  22. P22Go-Back-N with a sender window of 4 and a sequence-number range of 1,024. At time t, the next in-order packet the receiver expects has sequence number k. The medium does not reorder messages.

    a.What are the possible sets of sequence numbers inside the sender's window at time t?

    Hint: The sender's base can lag behind k by at most the window size. Why?

    b.What are all the possible values of the acknowledgement field in the messages currently propagating back to the sender at time t?

  23. P23Consider Go-Back-N and Selective Repeat with a sequence-number space of size k. What is the largest allowable sender window that avoids the problem in Figure 3.27?

    a.Largest sender window for Go-Back-N, as a formula in k. Enter the window when k = 8.

    packets

    b.Largest sender window for Selective Repeat. Enter the window when k = 8.

    packets
  24. P24True or false, with a brief justification.

    a.With Selective Repeat, the sender can receive an acknowledgement for a packet outside its current window.

    b.With Go-Back-N, the sender can receive an acknowledgement for a packet outside its current window.

    c.The alternating-bit protocol is the same as Selective Repeat with sender and receiver windows of 1.

    d.The alternating-bit protocol is the same as Go-Back-N with sender and receiver windows of 1.

  25. P25An application may choose UDP because UDP offers finer control than TCP over **what** data is sent in a segment, and **when**. Explain both.

    a.Why does the application have more control over what is sent?

    b.Why does the application have more control over when the segment is sent?

  26. P26An enormous file of L bytes is transferred from Host A to Host B. The maximum segment size is 536 bytes.

    a.Maximum value of L such that TCP sequence numbers are not exhausted. The sequence-number field is 4 bytes.

    bytes

    b.For that L, how long does the transfer take? Each segment gets 66 bytes of transport, network and link headers, and the link runs at 155 Mbps. Ignore flow control and congestion control.

    seconds
  27. P27Hosts A and B are communicating over a TCP connection, and B has already received all bytes from A up through byte 126. A now sends two segments back to back, carrying 80 and 40 bytes of data. In the first segment the sequence number is 127, the source port is 302 and the destination port is 80. B acknowledges every segment it receives.

    a.Sequence number of the second segment from A to B:

    b.If the first segment arrives before the second, what acknowledgement number does B send for it?

    c.If the second segment arrives before the first, what acknowledgement number does B send for that first-arriving segment?

    d.The two segments arrive in order. The first acknowledgement is lost, and the second arrives after the first timeout interval. Draw the timing diagram, giving sequence numbers and data lengths for each segment and acknowledgement numbers for each acknowledgement.

  28. P28Hosts A and B are directly connected by a 100 Mbps link, with one TCP connection between them. A is sending B an enormous file. A can push application data into its socket at up to 120 Mbps, but B can read out of its receive buffer at only 50 Mbps. Describe the effect of TCP flow control.

    What rate does the connection settle at?

  29. P29SYN cookies, from section 3.5.6.

    a.Why must the server use a special initial sequence number in the SYNACK?

    b.An attacker knows the target uses SYN cookies. Can the attacker create half-open or fully open connections by simply sending ACK packets?

    c.An attacker collects a large number of initial sequence numbers the server has sent. Can they then cause many fully open connections by sending ACKs with those numbers?

  30. P30Consider Scenario 2 of section 3.6.1. Both sending hosts A and B have fixed timeout values.

    a.Argue that increasing the size of the router's finite buffer might actually decrease the throughput.

    Hint: What does a longer queue do to the round-trip time, and what does a fixed timeout make of that?

    b.Now both hosts adjust their timeouts dynamically, based on the buffering delay — as TCP does. Would increasing the buffer size help throughput?

  31. P31Five measured round-trip-time samples are 106 ms, 120 ms, 140 ms, 90 ms and 115 ms. Compute EstimatedRTT, DevRTT and TimeoutInterval after each sample.

    Use α = 0.125 and β = 0.25. Just before the first sample, EstimatedRTT was 100 ms and DevRTT was 5 ms. The formulas are in section 3.5.3.

    a.EstimatedRTT after the first sample (106 ms):

    ms

    b.TimeoutInterval after the last sample (115 ms):

    ms
  32. P32Consider TCP's procedure for estimating the round-trip time, with α = 0.1. Let SampleRTT₁ be the most recent sample, SampleRTT₂ the next most recent, and so on.

    a.Four acknowledgements have returned, giving SampleRTT₄, SampleRTT₃, SampleRTT₂ and SampleRTT₁. Express EstimatedRTT in terms of the four samples.

    b.Generalise to n samples.

    c.Let n approach infinity. Why is this averaging procedure called an exponential weighted moving average?

  33. P33Why do you think TCP avoids measuring the round-trip-time sample for retransmitted segments?

    Pick the reason.

  34. P34What is the relationship between the variable SendBase of section 3.5.4 and the variable LastByteRcvd of section 3.5.5?

    Pick the relationship.

  35. P35What is the relationship between the variable LastByteRcvd of section 3.5.5 and the variable y of section 3.5.4?

    In the section 3.5.4 pseudocode, y is the acknowledgement number carried in an arriving acknowledgement segment.

    Pick the relationship.

  36. P36TCP waits until it has received three duplicate acknowledgements before performing a fast retransmit. Why did the designers choose not to retransmit after the very first duplicate acknowledgement?

    Pick the reason.

  37. P37Compare Go-Back-N, Selective Repeat and TCP without delayed acknowledgements. Host A sends five data segments to Host B and the **second** one is lost. All timeouts are long enough that five segments and their acknowledgements can be exchanged before any timer fires. In the end all five segments are correctly received.

    a.Go-Back-N: how many segments does Host A send in total?

    segments

    b.Selective Repeat: how many segments does Host A send in total?

    segments

    c.TCP: how many segments does Host A send in total?

    segments

    d.If all three timeout values are much longer than 5 round-trip times, which protocol delivers all five segments in the shortest time?

  38. P38In the description of TCP in Figure 3.53, ssthresh is set to cwnd/2 in several places, and is described as half the window size when a loss event occurred. Must the rate at which the sender was sending when the loss occurred be approximately cwnd segments per round-trip time? If not, can you suggest a different way to set ssthresh?

    The book cites Figure 3.53 here. In the 8th edition the congestion-control state machine is **Figure 3.51**; 3.53 is a different figure. This is a misprint.

    a.Was the sending rate approximately cwnd segments per round-trip time?

    b.Since the answer is no, suggest a better way to set ssthresh.

  39. P39Consider Figure 3.46(b). If λ′in increases beyond R/2, can λout increase beyond R/3? Now consider Figure 3.46(c). If λ′in increases beyond R/2, can λout increase beyond R/4, given that a packet is forwarded twice on average from the router to the receiver?

    Scenario 2 of section 3.6.1: two connections share one router whose output link runs at R, so each connection can get at most R/2. λ′in is the offered load including retransmissions; λout is the useful data delivered.

    a.Figure 3.46(b): can λout exceed R/3?

    b.Figure 3.46(c): can λout exceed R/4?

  40. P40Consider Figure 3.61, assuming TCP Reno is the protocol shown.

    Reading the figure: cwnd is 1, 2, 4, 8, 16, 32 in rounds 1–6; then 33 up to 42 in rounds 7–16; then it drops to 24 and climbs to 29 in rounds 17–22; then it drops to 1 and doubles to 8 in rounds 23–26.

    a.When is TCP slow start operating?

    b.When is congestion avoidance operating?

    c.After the 16th round, was the loss detected by a triple duplicate acknowledgement or by a timeout?

    d.After the 22nd round, was the loss detected by a triple duplicate acknowledgement or by a timeout?

    e.Initial value of ssthresh, at the first transmission round:

    segments

    f.Value of ssthresh at the 18th transmission round:

    segments

    g.Value of ssthresh at the 24th transmission round:

    segments

    h.During which transmission round is the 70th segment sent?

    i.A loss is detected after the 26th round by a triple duplicate acknowledgement. What is the new cwnd?

    segments

    j.Suppose TCP Tahoe is used instead, and triple duplicate acknowledgements arrive at round 16. What is cwnd at the 19th round?

    segments

    k.Still TCP Tahoe, with a timeout at round 22. How many packets are sent from round 17 through round 22, inclusive?

    packets
  41. P41Figure 3.55 illustrates the convergence of TCP's additive-increase, multiplicative-decrease algorithm. Suppose that instead of a multiplicative decrease, TCP decreased the window by a constant amount. Would the resulting additive-increase, additive-decrease algorithm converge to an equal share?

    The book cites Figure 3.55 here. In the 8th edition the convergence diagram is **Figure 3.56**; 3.55 is the fairness picture that precedes it. This is a misprint, and it repeats a slip made in section 3.7.3 itself.

    Does additive-increase, additive-decrease converge to an equal share?

  42. P42Section 3.5.4 discussed doubling the timeout interval after a timeout. That is itself a form of congestion control. Why does TCP need a window-based congestion-control mechanism in addition?

    Pick the strongest reason.

  43. P43Host A is sending an enormous file to Host B over a TCP connection. There is never any packet loss and the timers never expire. The link from A to the Internet runs at R bits per second. The process on A can push data into its socket at S = 10R. The receive buffer is large enough for the whole file; the send buffer holds only one percent of the file. What prevents the process on Host A from continuously passing data at rate S? Flow control? Congestion control? Something else?

    What is the limit?

  44. P44A large file is sent over a TCP connection with no loss. TCP uses additive increase and multiplicative decrease without slow start. cwnd increases by 1 MSS for each batch of acknowledgements, and the round-trip time is approximately constant.

    a.How long does it take cwnd to grow from 6 MSS to 12 MSS?

    RTTs

    b.What is the average throughput up through time = 6 RTT, in MSS per RTT?

    MSS/RTT
  45. P45Consider Figure 3.54. Suppose that at t₃ the sending rate at which congestion loss next occurs drops to 0.75·Wmax, without the senders knowing. Show the evolution of both TCP Reno and TCP CUBIC for two more rounds each.

    Figure 3.54 compares Reno and CUBIC after a loss at Wmax. The hint warns that the two protocols may no longer react to loss at the same moments.

    Describe both evolutions.

  46. P46Consider Figure 3.54 again. Suppose that at t₃ the rate at which congestion loss occurs **increases** to 1.5·Wmax. Show the evolution of both TCP Reno and TCP CUBIC for two more rounds each.

    Describe both evolutions.

  47. P47Recall the macroscopic description of TCP throughput. As the connection's rate goes from W/(2·RTT) to W/RTT, only one packet is lost, right at the end of the period.

    a.Show that the loss rate — the fraction of packets lost — is L = 1 / (3W²/8 + 3W/4).

    b.Use that result to show that a connection with loss rate L has an average rate of approximately 1.22 · MSS / (RTT · √L).

  48. P48A single TCP Reno connection uses one 10 Mbps link which does not buffer any data, and it is the only congested link on the path. The sender has a huge file to send and the receive buffer is much larger than the congestion window. Each TCP segment is 1,500 bytes; the two-way propagation delay is 150 ms; and the connection is always in congestion avoidance — ignore slow start.

    a.Maximum window size, in segments:

    segments

    b.Average throughput, in Mbps:

    Mbps

    c.How long does it take to reach the maximum window again after recovering from a loss?

    seconds
  49. P49Take the scenario of P48, but now let the 10 Mbps link buffer a finite number of segments. Argue that to keep the link always busy sending data, the buffer should be at least the product of the link speed C and the two-way propagation delay.

    Give the argument.

  50. P50Repeat P48 with the 10 Mbps link replaced by a 10 Gbps link. You will find that recovery takes a very long time. Sketch a solution.

    The book says "repeat Problem 46". In the 8th edition the problem being referred to is **P48**; the numbering slipped by two. Everything else is unchanged: 1,500-byte segments, 150 ms two-way propagation delay, no buffering, always in congestion avoidance.

    a.Maximum window size, in segments:

    segments

    b.Average throughput, in Gbps:

    Gbps

    c.How long to reach the maximum window again after a loss?

    seconds
  51. P51Let T, measured in round-trip times, be the time a TCP connection takes to increase its congestion window from W/2 to W, where W is the maximum window. Argue that T is a function of TCP's average throughput.

    Give the argument.

  52. P52A simplified additive-increase, multiplicative-decrease algorithm measures the congestion window in segments. Additive increase adds one segment per round trip. Multiplicative decrease halves the window, rounding down. Two connections C1 and C2 share a congested link of speed 30 segments per second, both in congestion avoidance. C1's round-trip time is 50 ms; C2's is 100 ms. When the data rate in the link exceeds the link's speed, all connections lose a segment.

    a.Both connections have a window of 10 segments at t₀. What is C1's window after 1000 ms?

    segments

    b.In the long run, will the two connections get the same share of the link?

  53. P53The same network as P52, but now both connections have a round-trip time of 100 ms. At t₀, C1's window is 15 segments and C2's is 10.

    a.What is C1's congestion window after 2200 ms?

    segments

    b.In the long run, will the two connections get about the same share?

    c.Two connections are synchronised if they reach their maximum windows at the same time and their minimum windows at the same time. Will these two become synchronised? If so, what is the maximum window?

    d.Does this synchronisation help the utilisation of the shared link? Sketch an idea for breaking it.

  54. P54Consider a modification to TCP's congestion control. Instead of additive increase, use multiplicative increase: the sender increases its window by a small positive constant a, with 0 < a < 1, whenever it receives a valid acknowledgement. Find the relationship between the loss rate L and the maximum window W. Argue that this modified TCP always takes the same time to increase its window from W/2 to W, whatever its average throughput.

    a.Find the relationship between L and W.

    b.Argue that the time from W/2 to W is the same regardless of average throughput.

  55. P55The book notes that to achieve a throughput of 10 Gbps, TCP could only tolerate a segment loss probability of about 2 × 10⁻¹⁰. Show the derivation, using the round-trip time and segment size given in section 3.7. What would the tolerable loss be for a 100 Gbps connection?

    This problem refers to a "TCP futures" subsection that **does not exist in the 8th edition** — it was in earlier editions and was removed. Its constants were a 1,500-byte segment size and a 100 ms round-trip time; use those. The problem also states its own figure two different ways: 2 × 10⁻¹⁰ is one loss in 5,000,000,000 segments, and the printed "1 out of 5,000,000" is a misprint.

    a.Tolerable loss rate for 10 Gbps (give it as a power of ten, e.g. 2.14e-10):

    b.Tolerable loss rate for 100 Gbps:

  56. P56Section 3.7 assumed the TCP sender always had data to send. Suppose instead the sender sends a large amount of data and then goes idle at t₁, stays idle for a long time, and wants to send again at t₂. What are the advantages and disadvantages of using the cwnd and ssthresh values from t₁ when restarting at t₂? What would you recommend?

    Give both sides, then a recommendation.

  57. P57Does UDP or TCP provide any degree of end-point authentication?

    a.A server receives a request in a UDP datagram and replies in a UDP datagram, as a DNS server does. A client at IP address X spoofs its address as Y. Where does the server send the reply?

    b.A server receives a SYN with source address Y, replies with a SYNACK, and then receives an ACK from source Y with the correct acknowledgement number. The initial sequence number was random and there is no attacker in the middle. Can the server be certain the client really is at Y?

  58. P58Consider the delay introduced by TCP slow start. A client and a Web server are directly connected by one link of rate R. The client retrieves an object of exactly 15·S bytes, where S is the maximum segment size. The round-trip time is a constant RTT. Ignoring protocol headers, find the time to retrieve the object, including connection establishment.

    Because 15·S = (2⁴ − 1)·S, slow start delivers the object in exactly four windows of 1, 2, 4 and 8 segments. After sending a window of 2^(k−1) segments, the server must wait for the first acknowledgement of that window, which arrives S/R + RTT after the window began. So the idle time after window k is max(0, S/R + RTT − 2^(k−1)·S/R).

    a.Case: 4S/R > S/R + RTT > 2S/R

    b.Case: S/R + RTT > 4S/R

    c.Case: S/R > RTT

Figure 3.61, redrawn

P40 has eleven parts and all of them are read off one graph. Here it is, with the values taken round by round from the printed figure.

Figure 3.61 — the window trace that problem P40 is set on
0.00011.322.533.845.01.06.011.016.021.026.0transmission roundcongestion window (segments)doubling stops here — this is ssthreshfalls to 24, not to 1falls to 1

At 26.0 (move the pointer over the plot to read it anywhere):

  • congestion window:8.0 segments
  • ssthresh:14.0 segments

Redrawn from the printed figure, round by round. Do not read the answers off the dashed line until you have attempted P40(e) to P40(g) — that line is exactly what those three parts ask you to work out.

How to read a window trace

Three shapes, and each one names a mechanism.

Doubling — 1, 2, 4, 8, 16, 32 — is slow start . It appears twice here: rounds 1 to 6 and rounds 23 to 26.

Rising by one per round — 32, 33, 34 … 42 — is congestion avoidance . Also twice: rounds 6 to 16 and rounds 17 to 22.

A fall is a loss event, and how far it falls says which kind. A fall to 1 is a timeout. A fall to roughly half plus three is three duplicate acknowledgements, because Reno’s rule is cwnd = ssthresh + 3·MSS.

Check that last one against the numbers. The congestion window at round 16 is 42, so ssthresh becomes 21, so cwnd becomes 24 — and 24 is exactly what the figure shows in round 17. The arithmetic agreeing with the picture is how you know you have read the picture correctly.

The six problems that cite the wrong number

These are misprints in the 8th edition, recorded rather than quietly corrected.

  • P38 cites Figure 3.53 for the congestion-control state machine. It is Figure 3.51.
  • P41 cites Figure 3.55 for the convergence diagram. It is Figure 3.56. The same slip appears in section 3.7.3 itself.
  • P50 says “repeat Problem 46”. It means P48 — the problem whose link rate it is replacing.
  • P55 refers to a “TCP futures” subsection of section 3.7. That subsection does not exist in the 8th edition. It was removed, and its constants — a 1,500-byte segment and a 100 ms round trip — went with it.
  • P55 also states its own loss figure twice, inconsistently. 2 × 10⁻¹⁰ is one loss in 5,000,000,000 segments, and the printed “1 out of 5,000,000” is wrong by a factor of a thousand.
  • P52 and P53 state a link rate of 30 segments per second while starting both connections at windows of 10 and 15 segments. Those windows already offer several hundred segments per second, so the arithmetic collapses both windows to 1 within a few round trips. The solutions carry that computation out honestly and say where the real content of each problem is.

Noticing that a printed number cannot be right is a more useful habit than getting the answer by trusting it.

The eight answers worth memorising

P15 — the window a fast, long path needs. A 1 Gbps link with a 30 ms round trip and 1,500-byte packets needs 2,451 packets in flight for 98 % use of the link. That is 3.68 megabytes — far past the 65,535-byte ceiling of the receive-window field, which is why the window scale option exists.

P23 — the largest safe window. With a sequence space of k: Go-Back-N allows k − 1, Selective Repeat allows k / 2. Two different answers to what looks like one question, because Selective Repeat’s receiver has a window too.

P26 — how much data fits in the sequence numbers. 2³² = 4,294,967,296 bytes, and with a 536-byte segment size it takes 249 seconds at 155 Mbps. The headers alone add 528 megabytes, 12.3 % of the payload.

P31 — the round-trip estimate in five steps. Starting from 100 ms and 5 ms, the samples 106, 120, 140, 90, 115 give a final timeout of 158.3 ms. Watch the 140 ms sample: it moves the estimate by 4.6 ms and the timeout by 29 ms. The margin tracks variability, not level.

P40 — the whole trace. ssthresh starts at 32, becomes 21 after the duplicate-acknowledgement loss at cwnd = 42, and 14 after the timeout at cwnd = 29. The 70th segment goes out in round 7.

P47 — the macroscopic model. Loss rate L = 1 / (3W²/8 + 3W/4), and average rate ≈ 1.22 · MSS (maximum segment size) / (RTT · √L). Both halves of that formula are bad news: throughput falls as 1/√L and as 1/RTT.

P48 and P50 — the cost of one lost packet. On a 10 Mbps unbuffered link, maximum window 125 segments, average throughput 7.5 Mbps, recovery 9.375 s. On a 10 Gbps link, 125,000 segments, 7.5 Gbps, recovery 9,375 s — two hours and thirty-six minutes. The 75 % utilization is the same in both cases, and it is a property of the saw tooth, not of the link rate.

P58 — what slow start costs a Web page. For an object of 15 segments the delay is 3·RTT + 15S/R, 4·RTT + 14S/R or 5·RTT + 11S/R. Which one applies depends on how the round trip compares with the time to send one segment. The longer the path, the more of the answer is round trips.

What these problems are really testing

  • A sequence number answers a question the receiver cannot otherwise answer. P7, P13, P18 and P23 are all one idea: is this new, or have I seen it before?
  • A correct protocol can still be a bad protocol. P12’s modified rdt3.0 never loses or duplicates data, and its cost grows without bound. P16’s fake acknowledgements raise utilization and destroy reliability.
  • Check which window is binding. P28 is flow control, P43 is neither window but the link itself, and P48 is congestion control alone. The three look alike and are not.