0% found this document useful (0 votes)
21 views40 pages

ECEN1012

The document is a tutorial for Chapter 3 on the Transport Layer, covering various transport layer protocols and their functionalities. It includes questions and answers related to concepts such as link utilization, error retransmission methods, TCP segment transmission, and RTT estimation. Additionally, it discusses TCP congestion control mechanisms like Slow Start and Congestion Avoidance.

Uploaded by

h5knbhzy4j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views40 pages

ECEN1012

The document is a tutorial for Chapter 3 on the Transport Layer, covering various transport layer protocols and their functionalities. It includes questions and answers related to concepts such as link utilization, error retransmission methods, TCP segment transmission, and RTT estimation. Additionally, it discusses TCP congestion control mechanisms like Slow Start and Congestion Avoidance.

Uploaded by

h5knbhzy4j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Tutorial for Chapter 3

Transport Layer

TA: Qiaoyan Peng

2024
Q: Transport layer protocols deal with
_________.

A: application to application communication


B: process to process communication
C: node to node communication
D: none of the above

 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_______.

A: all UDP packets are treated independently by


transport layer
B: it sends data as a stream of related packets
C: it is received in the same order as sent order
D: it sends data very quickly

 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

Protocol Stop and Wait Go-Back-N Selective Repeat

Sender Window 1 (2^m)-1 2^(m-1)


Size
Receiver Window 1 1 2^(m-1)
Size
Minimum number 2 2^m 2^m
of the sequence
numbers
11
Efficiency (L/R)/ ((L/R) N*(L/R)/ ((L/R) N*(L/R)/ ((L/R)
+RTT) +RTT) +RTT)
Q: Consider a selective repeat is used where the packet
size is 1024 byte and the link transmission rate is 1.5Mbps
with one-way propagation delay is 50msec. To achieve a link
utilization of 60%, the minimum number of bits required to
represent the sequence number field is ____.

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

 Suppose that the last SampleRTT in a TCP connection is


equal to 1 sec. The current value of TimeoutInterval for
the connection will necessarily be >=1 sec.
 False
 Suppose Host A sends one segment with sequence
number 38 and 4 bytes of data over a TCP connection to
Host B. In this same segment the ACK number is
necessarily 42.
 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.

2.Identify the intervals of time when TCP congestion avoidance is


operating.
3. After the 16th transmission round, is segment loss detected by
a triple duplicate ACK or by a timeout?
4. After the 22nd transmission round, is segment loss detected by
a triple duplicate ACK or by a timeout?
5. What is the value of Threshold at the first transmission round?

6.What is the value of Threshold at the 18th transmission round?

7.What is the value of Threshold at the 24th transmission round?

8.During what transmission round is the 70th segment sent?


9.Assuming a packet loss is detected after the 26th round by the
receipt of a triple duplicate ACK, what will be the values of the
congestion window size and of the Threshold?
26
Answer
1.Identify the intervals of time when TCP slow start is operating.
[1,6] and [23,26]

2.Identify the intervals of time when TCP congestion avoidance is operating.


[6,16] and [17,22]

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

6.What is the value of Threshold at the 18th transmission round?


21

7.What is the value of Threshold at the 24th transmission round?


13

8.During what transmission round is the 70th segment sent?


7th transmission round
9.Assuming a packet loss is detected after the 26th round by the receipt of a triple duplicate
ACK, what will be the values of the congestion window size and of the Threshold?
4 27
How to Estimate RTT?
 SampleRTT: measured time from segment
transmission until ACK receipt
 ignore retransmissions
 SampleRTT will vary. We want the estimated RTT
to be “smoother”
 average several recent measurements, not just current
SampleRTT
 Exponential weighted moving average(EWMA)
EstimatedRTT = (1- )*EstimatedRTT + *SampleRTT
 Put more weight on recent samples than on old samples
 Influence of past sample decreases exponentially fast
 typical value:  = 0.125
28
Example RTT estimation:
RTT: gaia.cs.umass.edu to fantasia.eurecom.fr

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)

SampleRTT Estimated RTT


TCP Round Trip Time and Timeout
 RTT variation DevRTT
 Measure the variability of the RTT.
 It is an estimation of how much SampleRTT typically
deviates from EstimateRTT
 Exponential weighted moving average(EWMA)

 Put more weight on recent samples than on old samples


 Influence of past sample decreases exponentially fast
 typical value: β = 0.25

30
TCP Round Trip Time and Timeout
 Setting timeout interval
 EstimatedRTT plus “safety margin” (RTT variation
DevRTT)
 Large variation in EstimatedRTT  large safety
margin

TimeoutInterval = EstimatedRTT + 4*DevRTT

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

 Option 2: duplicate ACKs 11

 Duplicate ACK
11

11

 It is an ACK that re-


acknowledges a segment
Sender Receiver
for which the sender has
already received an
earlier acknowledgment. 35
Reaction toTimeout

 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.

 Fast recovery: we call the immediate


retransmission after 3 dupACKs without waiting
for timeout as fast retransmission or fast
recovery since usually waiting for timeout is quite
long.
37
Fast Retransmit
 Fast retransmission
triggered by three
duplicated ACKs

38
CongWin <= Threshold: Doubles each RTT (add MSS for each MSS ACKed)
CongWin > Threshold: Adds MSS each RTT

Time Out: Threshold = 1/2 CongWin, CongWin = 1 (Slow-Start)


3-Dup Ack: Threshold = 1/2 CongWin, CongWin = Threshold (Fast Recovery)

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: Threshold = 1/2 CongWin, CongWin = 1 (Slow-Start)


3-Dup Ack: Threshold = 1/2 CongWin, CongWin = Threshold (Fast Recovery)

Time Out

3 Dup. ACKs

CW=12

Q: What happens at point B?


Answer: 3 duplicate Acks
Q: What happens at point E?
Answer: A timeout event happens

53

You might also like