ECEN1012
ECEN1012
Transport Layer
2024
Q: Transport layer protocols deal with
_________.
Correct Answer: B
2
Q. If the RTT is 45ms, packet size is 1
KByte, the transmission rate of the link is
1.5Mbps. The transmission time of the
acknowledgement frame is negligible.
Please calculate the link/channel utilization
with Stop and Wait protocol?
Correct answer
Transmission Delay: (1 × 103 ×8) /(1.5 × 106
) =5.33 ms
Link Utilization: 5.33/(5.33 + 45)=10.5%
3
Q: A link has a transmission rate of 10^6 bits/sec. It uses
data packets of size 1000 bytes. Assume that the
acknowledgment has negligible transmission delay, and that
its propagation delay is the same as the data propagation
delay. Also assume that the processing delays at nodes are
negligible. The efficiency of the stop-and-wait protocol in
this setup is exactly 25%. The value of the one-way
propagation delay (in milliseconds) is ___________
A: 4
B: 8
C: 12
D: 16
Correct Answer: C
4
Q
Station A needs to send a message consisting of 9 packets
to station B using go back 3 ARQ strategy. All packets are
ready and immediately available for transmission. If every
5th packet that A transmits gets lost (but no ACKs from B
ever get lost), then what is the number of packets that A
will transmit for sending the message to B?
A: 12
B: 14
C: 16
D:18
Correct answer
C
5
Q: User datagram protocol is called
connectionless because_______.
Correct Answer: A
6
Q: Suppose host A and B are connected by a link
with the transmission rate of 1.5Mbps. The round-
trip propagation delay is 45 msec. Assume that the
packet size is 1Kbytes. Please calculate the link
utilization when the stop and wait protocol is used.
Answer:
RTT=45msec.
Transmission time (Ttr)= packet size/transmission rate
= (10^3 * 8)/(1.5*10^6) =
Link utilization= Ttr/(Ttr+RTT)= …..
7
Q: Which of the following is NOT the correct
statement in error retransmission used in
different methods:
A: Go-back-N method requires more storage at
the receiving site compared with selective
repeat
B: Selective repeat has better link utilization
C: Selective repeat is complex than Go-back-N
D: Go-back-N has better link utilization
compared with stop and wait.
Correct Answer: A
8
Q: Using stop and wait protocol, sender wants to
transmit 10 data packets to the receiver. Out of
these 10 data packets, every 4th data packet is
lost. How many packets sender will have to send in
total?
Correct answer:
13 packets
1 2 3 4 4 5 6 7 7 8 9 10 10
9
Q: Assume that n bits are used to identify the sequence
number of a packet/frame. The maximum window size for
the data transmission using the selective repeat protocol is
_______.
A: 2^n
B: 2^(n-1)
C: (2^n)- 1
D: 2^(n-2)
Correct Answer: B
10
Comparison
A: 3
B: 4
C: 5
D: 6
Correct Answer: C
12
Q: The distance between two stations M and N is L
kilometers. All packets/frames are K bits long. The
propagation delay per kilometer is t seconds. Let R
bits/second be the link transmission rate. Assuming that
processing delay is negligible and the selective repeat is
used. The minimum number of bits for the sequence number
field in a packet/frame for maximum utilization is
________,
Correct Answer: C
13
Q: Station A uses 32 byte packets to transmit messages to
station B using the selective repeat protocol. The round
trip time between A and B is 80 milliseconds and the link
transmission rate is 128 kbps. Which of the following is
the optimal window size that A should use?
A: 20
B: 40
C: 160
D: 320
Correct Answer: B
14
Q: Suppose Host A sends two TCP segments
back to back to Host B over a TCP
connection. The first segment has sequence
number 90; the second has sequence number
110. How much data is in the first segment?
A: 20 bytes
B: 60 bytes
C: 20 MSS
D: None of the above
Correct Answer: A
15
Q: Suppose Host A sends two TCP segments back to back
to Host B over a TCP connection. The first segment has
sequence number 90; the second has sequence number 110.
Suppose that the first segment is lost but the second
segment arrives at B. Which of the following is the ACK
number in the ACK that Host B sends to host A?
A: 90
B: 110
C: 0
D: None of the above
Correct Answer: A
16
How to Decide the Sequence No.
TCP views data as unstructured, but ordered
stream of bytes.
We label these bytes with integer numbers.
Sequence number is the number of the first data in
the segment in unit of bytes.
Sequence numbers are over bytes, not segments.
Example:
The data file consisting of 500,000 bytes, MSS is
1000bytes, the initial sequence number is 0.
TCP constructs 500 segments; the sequence number set in
the first, second, third segments is 0, 1000, 2000,
respectively.
17
How to Decide the ACK No.
Acknowledgement number – At host B(A),
ACK number is the sequence number of the
next byte that Host B(A) is expecting from
host A(B).
Example:
Host B received the 1st segment from Host A and
is waiting for all the subsequent segments.
In this case, Host B puts 1000 in the ACK number
field of the segment it sends to Host A.
18
TCP Reliable Data Transfer
ACKs are cumulative
TCP uses cumulative
ACK: TCP ACKs the
received highest in-
order byte.
Correctly received but
out-of-order segments
are not individually
ACKed by the
receiver, but they will
be buffered at the
receiver side.
Is TCP a selective repeat
protocol?
Is TCP is a GBN
protocol? 19
True or False
The size of the TCP Receive Window never changes
throughput the duration of the connection.
False
Suppose Host A is sending Host B a large file over a TCP
connection. The number of unACKed bytes that A sends
cannot exceed the size of the receive buffer.
False
Suppose Host A is sending Host B a large file over a TCP
connection. If the sequence number for a segment of
this connection is m, then the sequence number for the
subsequent segment will necessarily be m+1
False
20
True or False
21
Q. Consider the SR protocol. Suppose the
sequence number space is of size 2^k. What is the
largest allowable sender window size?
A: 2^(k-1)
B: 2^K
C: 2K
D: None of the above
Correct Answer: A
22
Selective Repeat
Window size
Sender window size = receiver window size
The size of the sender and receiver windows must be no more
than half of 2^m, where m is the number of bits used to
identify the sequence number.
If m bits are used to identify the sequence number of packets, the range
of the sequence numbers is from 0 to (2^m) – 1.
The sequence numbers are modulo 2^m. if m=3, sequence number range
from 0 to 7: 0,1,2,3,4,5,6,7,0, 1,2,3, 4, 5,6,7,0,1,…….
For example, m=4, which means the size of window is (2^m)/2 =
2^(m-1)=8. It means the sequence numbers go from 0 to 7.
Why?
This is to avoid packets being recognized incorrectly. If the
window size is greater than the half of the sequence number
space, then if an ACK is lost, the sender may retransmit
packets that the receiver will recognize as a new packet.
23
Selective Repeat
For example, m=2, which limits the maximum window
size to be 2.
Case 1: Case 2:
Window size N=2 Window size N=3
24
Q: Assuming TCP protocol is experiencing the behavior
showing in the following Figure. Please answer the
following subquestions.
25
Questions
1.Identify the intervals of time when TCP slow start is operating.
3. After the 16th transmission round, is segment loss detected by a triple duplicate ACK or by
a timeout?
Triple duplicated ACK
4. After the 22nd transmission round, is segment loss detected by a triple duplicate ACK or by
a timeout?
Time out
5. What is the value of Threshold at the first transmission round?
32
350
300
250
RTT (milliseconds)
200
150
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
30
TCP Round Trip Time and Timeout
Setting timeout interval
EstimatedRTT plus “safety margin” (RTT variation
DevRTT)
Large variation in EstimatedRTT large safety
margin
31
TCP congestion control: Slow Start
sender receiver
“Slow Start”: cwnd
1 data
Initially: CW = 1 segment
On each successful ACK: ACK
2
CW CW + 1
Exponential growth of CW
3
after each RTT: 4
CW 2 x CW
5
6
7
Initial rate is slow but 8
ramps up exponentially
fast
double CongWin every RTT
done by incrementing CongWin
for every ACK received32
Congestion Avoidance: Linear
Increase Phase or Additive Increase
ssthresh: window size after sender receiver
which TCP cautiously probes 1 data
for available bandwidth segment
Enter CA(Congestion
ACK
2
avoidance) when
CW >= ssthresh
3
On each successful ACK:
CW CW+ 1/CW
Linear growth of CW each 4
RTT:
CW CW + 1
33
Congestion Avoidance: Additive
Increase, Multiplicative Decrease
(AIMD)
AI: We have “additive increase” during the
congestion avoidance in the absence of loss
events.
MD: After loss event indicated by 3
duplicated ACKs, decrease congestion
window by half – “multiplicative decrease”
ssthresh = CW/2
Enter addition increase (AI)
34
Detecting Packet Loss
Assumption: packet loss
10
indicates congestion 11
12 X
Loss event 13
14
Option 1: time-out 15
16
• Waiting for a time-out may 17
10
be long! 11
Duplicate ACK
11
11
Adjusts ssthresh
ssthresh CW/2
Enter slow start
CW 1
36
Reaction to 3 dupACKs
After loss event indicated by 3 duplicated ACKs,
decrease congestion window by half –
“multiplicative decrease”
Adjusts ssthresh and CongWin
ssthresh CW/2, CW CW/2
Enter additive increase.
38
CongWin <= Threshold: Doubles each RTT (add MSS for each MSS ACKed)
CongWin > Threshold: Adds MSS each RTT
CongWin / mss
Time Out
CW = 20
3 Dup. ACKs
CW=12
53
CongWin <= Threshold: Doubles each RTT (add MSS for each MSS ACKed)
CongWin > Threshold: Adds MSS each RTT
Time Out
3 Dup. ACKs
CW=12
53