Lecture Transport Layer Numericals
Lecture Transport Layer Numericals
Transport-layer services
Multiplexing and demultiplexing
Connectionless transport: UDP
Principles of reliable data transfer
Connection-oriented transport: TCP
segment structure
reliable data transfer
flow control
connection management
Principles of congestion control
TCP congestion control
Suppose that the channel connecting the sender and receiver can corrupt but not
lose or reorder packets.
Now consider the figure below, which shows four data packets and three
corresponding ACKs being exchanged between an rdt 2.2 sender and receiver.
The actual corruption or successful transmission/reception of a packet is indicated
by the corrupt and OK labels, respectively, shown above the packets in the figure
below.
Reliable Data Transfer: rdt2.2 #(sender and receiver actions)
Transport Layer: 3-5
Consider the figure below in which a TCP sender and receiver communicate over a
connection in which the sender->receiver segments may be lost. The TCP sender sends
an initial window of 5 segments.
Suppose the initial value of the sender->receiver sequence number is 25 and the
first 5 segments each contain 858 bytes.
The delay between the sender and receiver is 7 time units, and so the first segment
arrives at the receiver at t=8.
As shown in the figure below, 3 of the 5 segment(s) are lost between the segment
and receiver.
TCP sequence and ACK numbers with segment loss
Transport Layer: 3-7
Suppose that TCP's current estimated values for the round trip time (estimatedRTT)
and deviation in the RTT (DevRTT) are 320 msec and 44 msec, respectively. Suppose
that the next three measured values of the RTT are 360 msec, 370 msec, and 280 msec
respectively.
Compute TCP's new value of DevRTT, estimatedRTT, and the TCP timeout value after
each of these three measured RTT values is obtained. Use the values of α = 0.125,
and β = 0.25. Round your answers to two decimal places after leading zeros.
Computing TCP's RTT and timeout values
Transport Layer: 3-9
TCP timeout is calculated with the following equation: estimatedRTT + (4*DevRTT)
estimatedRTT: (1-alpha)*estimatedRTT + alpha*sampleRTT
DevRTT: (1-beta) * DevRTT + beta * |estimatedRTT - sampleRTT|
1. The estimatedRTT for RTT1 is 325#2. The DevRTT for RTT1 is 43#3. The timeout for
RTT1 is 497#4. The estimatedRTT for RTT2 is 330.63#5. The DevRTT for RTT2 is
43.5#6. The timeout for RTT2 is 504.63#7. The estimatedRTT for RTT3 is 324.3#8. The
DevRTT for RTT3 is 45.28#9. The timeout for RTT3 is 505.42
9
Consider that only a single TCP (Reno) connection uses one 54 Mbps wireless link
which does not buffer any data. Suppose that this link is the only congested link
between the sending and receiving hosts. Assume that the TCP sender has a huge file
to send to the receiver and the receiver’s receive buffer is much larger than the
congestion window.
We also make the following assumptions: each TCP segment size is 536 bytes; the
two-way propagation delay of this connection is 6 msec; and this TCP connection is
always in congestion avoidance phase, that is, ignore slow start.
What is the maximum window size (in segments) that this TCP connection can achieve?
What is the average window size (in segments) and average throughput (in bps) of
this TCP connection?
How long would it take for this TCP connection to reach its maximum window again
after recovering from a packet loss?
TCP in Action: single TCP (Reno) connection
Transport Layer: 3-12
Given:
Link bandwidth = 54 Mbps
Segment size = 536 bytes = 536 × 8 = 4288 bits
RTT (two-way delay) = 6 ms
Always in congestion avoidance
No buffering at the link → any excess segment is dropped
Only one TCP flow
a) What is the maximum window size (in segments) that this TCP connection can
achieve?
In a bufferless link, to fully utilize the available bandwidth, the sender needs to
send enough data to keep the pipe full without overflowing it.
Use the Bandwidth-Delay Product (BDP) to compute the maximum number of segments
that can be in flight:
b) What is the average window size (in segments) and average throughput (in bps) of
this TCP connection?
loss. The congestion window grows from 𝑊/2 to 𝑊, then back to W/2 after a loss.
In congestion avoidance, TCP Reno increases the window linearly and halves it on
So
b) What is the average window size (in segments) and average throughput (in bps) of
this TCP connection?
c) How long would it take for this TCP connection to reach its maximum window again
after recovering from a packet loss?
After a loss, TCP Reno halves the window, then increases it by 1 segment per RTT
(additive increase).
So, from W/2 = 37.5⇒37 segments back to 75 segments, it needs to grow by:
Consider a simplified TCP’s AIMD algorithm where the congestion window size is
measured in number of segments, not in bytes. In additive increase, the congestion
window size increases by one segment in each RTT. In multiplicative decrease, the
congestion window size decreases by half (if the result is not an integer, round
down to the nearest integer). Suppose that two TCP connections, C1 and C2, share a
single congested link of speed 30 segments per second. Assume that both C1 and C2
are in the congestion avoidance phase. Connection C1’s RTT is 50 msec and
connection C2’s RTT is 100 msec. Assume that when the data rate in the link exceeds
the link’s speed, all TCP connections experience data segment loss.
If both C1 and C2 at time t0 have a congestion window of 10 segments, what are
their congestion window sizes after 1000 msec?
In the long run, will these two connections get the same share of the bandwidth of
the congested link? Explain.
The difference between C1 and C2 is that RTT of C1’s is only half of the RTT of C2.
Therefore, C1 adjusts its window size after 50 msec, but C2 adjusts its window size
after 100 msec.
Assume that C1 receives it after 50msec and C2 receives it after 100msec, whenever
a loss event happens.
The following simplified model of TCP is that after each RTT, a connection
determines if it should increase window size or not.
For C1, to compute the average total sending rate in the link in the previous 50
msec.
If that rate exceeds the link capacity, then we assume that C1 detects loss and
reduces its window size.
But for C2, we compute the average total sending rate in the link in the previous
100msec.
If the rate exceeds the link capacity, then we assume that C2 detects loss and
reduces its window size.
TCP in Action: TCP’s AIMD algorithm
Transport Layer: 3-19
b) In the long run, these two connections will not get the same share of the band-
width of the congested link because C1’s bandwidth share is roughly twice as that
of C2’s, because C1 has shorter RTT, only half of that of C2, so C1 can adjust its
window size twice as fast as C2. According to the above table, for every cycle has
200msec.
For example, in the cycle from 850msec to1000msec, inclusive. The sending rate of
C1 is 40+20+40+20 = 120, which is thrice as large as the sending of C2 given by
10+10+10+10 = 40.