0% found this document useful (0 votes)
6 views

Lecture Transport Layer Numericals

Chapter 3 covers transport-layer services, focusing on multiplexing, demultiplexing, and the differences between connectionless (UDP) and connection-oriented (TCP) transport protocols. It details reliable data transfer principles, TCP segment structure, flow control, and congestion management techniques. The chapter also includes practical examples and calculations related to TCP's performance metrics and behavior under various network conditions.

Uploaded by

231566
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lecture Transport Layer Numericals

Chapter 3 covers transport-layer services, focusing on multiplexing, demultiplexing, and the differences between connectionless (UDP) and connection-oriented (TCP) transport protocols. It details reliable data transfer principles, TCP segment structure, flow control, and congestion management techniques. The chapter also includes practical examples and calculations related to TCP's performance metrics and behavior under various network conditions.

Uploaded by

231566
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Chapter 3

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

Transport Layer: 3-1


1

Multiplexing and demultiplexing


Transport Layer: 3-2

Multiplexing and demultiplexing


What is the source port # for packet A?
What is the destination port # for packet A?
What is the source port # for packet C?
What is the destination port # for packet C?
What is the source port # for packet D?
What is the destination port # for packet D?
What is the source port # for packet B?
What is the destination port # for packet B?
Transport Layer: 3-3
1. The source port for packet A is port 7270.#2. The destination port for packet A
is port 6100.#3. The source port for packet C is port 7086.#4. The destination port
for packet C is port 6100.#5. The source port for packet D is port 6121.#6. The
destination port for packet D is port 6100.#7. The source port for packet B is port
6100.#8. The destination port for packet B is port 7270.
3

Reliable Data Transfer: rdt2.2 #(sender and receiver actions)


Transport Layer: 3-4

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

Reliable Data Transfer: rdt2.2 #(sender and receiver actions)


Transport Layer: 3-6
1. At time t=0, what is the sender state?##2. At time t=0, what is the receiver
state?##3. At time t=0, what is the sequence/ack # of the packet?##4. At time t=1,
what is the sender state?##5. At time t=1, what is the receiver state?##6. At time
t=1, what is the sequence/ack # of the packet?##7. At time t=2, what is the sender
state?##8. At time t=2, what is the receiver state?##9. At time t=2, what is the
sequence/ack # of the packet?##10. At time t=3, what is the sender state?##11. At
time t=3, what is the receiver state?##12. At time t=3, what is the sequence/ack #
of the packet?##13. How many times is the payload of the received packet passed up
to the higher layer?
1. At time t=0, the sender state is: Wait for ACK 0#2. At time t=0, the receiver
state is: Wait for 0 from below#3. At time t=0, the sequence # is: 0#4. At time
t=1, the sender state is: Wait for ACK 0#5. At time t=1, the receiver state is:
Wait for 1 from below#6. At time t=1, the ACK # is: 0#7. At time t=2, the sender
state is: Wait for ACK 0#8. At time t=2, the receiver state is: Wait for 1 from
below#9. At time t=2, the sequence # is: 0#10. At time t=3, the sender state is:
Wait for ACK 0#11. At time t=3, the receiver state is: Wait for 1 from below#12. At
time t=3, the ACK # is: 0#13. 1 packets were passed up to the higher layer by the
receiver.
6

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

TCP sequence and ACK numbers with segment loss


Transport Layer: 3-8
1. Give the sequence numbers associated with each of the 5 segments sent by the
sender.
Format your answer as:
a= b= c= d= e=
#2. Give the ACK numbers the receiver sends in response to each of the segments. If
a segment never arrives use 'x' to denote it, and format your answer as:
a= b= c= d= e=

25 883 1741 2599 3457


x 25 x x 25

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

TCP in Action: slow start, congestion avoidance, and fast retransmit


Consider the figure below, which plots the evolution of TCP's congestion window at
the beginning of each time unit (where the unit of time is equal to the RTT); see
Figure 3.53 in the text. In the abstract model for this problem, TCP sends a
"flight" of packets of size cwnd at the beginning of each time unit.
The result of sending that flight of packets is that either
(i) all packets are ACKed at the end of the time unit,
(ii) there is a timeout for the first packet, or
(iii) there is a triple duplicate ACK for the first packet.
In this problem, you are asked to reconstruct the sequence of events (ACKs, losses)
that resulted in the evolution of TCP's cwnd shown below.
Transport Layer: 3-10
Consider the evolution of TCP's congestion window in the example above and answer
the following questions. The initial value of cwnd is 1 and the initial value
of ssthresh (shown as a red +) is 8.

TCP in Action: slow start, congestion avoidance, and fast retransmit


Transport Layer: 3-11
1. Give the times at which TCP is in slow start. ##2. Give the times at which TCP
is in congestion avoidance. ##3. Give the times at which TCP is in fast recovery.
##4. Give the times at which packets are lost via timeout. ##5. Give the times at
which packets are lost via triple ACK. ##6. Give the times at which the value
of ssthresh changes (if it changes between t=3 and t=4, use t=4 in your answer)#
The initial value of cwnd is 1 and the initial value of ssthresh (shown as a red +)
is 8.

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

TCP in Action: single TCP (Reno) connection


Transport Layer: 3-13

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:

TCP in Action: single TCP (Reno) connection


Transport Layer: 3-14
BDP = Bandwidth × RTT
Convert units:
Bandwidth = 54 Mbps = 54 × 106 bps
RTT = 6 ms = 6× 10-3 s
Segment size = 4288 bits

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

TCP in Action: single TCP (Reno) connection

Where 𝑊 = 75 (max window from part a)


Transport Layer: 3-15

b) What is the average window size (in segments) and average throughput (in bps) of
this TCP connection?

TCP in Action: single TCP (Reno) connection


Transport Layer: 3-16

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:

At 1 segment per RTT (6 ms):

TCP in Action: single TCP (Reno) connection


Transport Layer: 3-17
75 − 37 = 38 segments

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.

TCP in Action: TCP’s AIMD algorithm


Transport Layer: 3-18

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

TCP in Action: TCP’s AIMD algorithm


Transport Layer: 3-20
The two TCP connections, C1 and C2, share a single congested link of speed 30
segments per second.
The RTT for TCP connection of C1 is 50msec and RTT of C2 is 100msec.
We conclude that after 1000 msec, C1’s and C2’s window sizes are 1 segment each
based on the above table.

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.

TCP in Action: TCP’s AIMD algorithm


Transport Layer: 3-21

You might also like