Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
27 views

Chapter - 3 Lecture 2 Flow and Error Control

The document discusses various methods of flow control and error control used at the transport layer. It describes stop-and-wait flow control and its inefficiency for small frames. It then covers sliding window protocols and pipelining to increase efficiency. It also discusses different automatic repeat request (ARQ) protocols like stop-and-wait ARQ, go-back-N ARQ, and selective repeat ARQ to handle lost or damaged frames.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Chapter - 3 Lecture 2 Flow and Error Control

The document discusses various methods of flow control and error control used at the transport layer. It describes stop-and-wait flow control and its inefficiency for small frames. It then covers sliding window protocols and pipelining to increase efficiency. It also discusses different automatic repeat request (ARQ) protocols like stop-and-wait ARQ, go-back-N ARQ, and selective repeat ARQ to handle lost or damaged frames.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Chapter 3

Lecture 3.2: Flow and Error Control

1
Flow Control
• The responsibilities of both the transport (end-
to-end) and the data link layer (hop-to-hop).
• Flow control is needed since the sending entity
should not overwhelm the receiving entity
—Recipient needs some time to process incoming
packets
—If sender sends faster than recipient processes, then
buffer overflow occurs
• flow control prevents buffer overflow

2
1.1 Stop and Wait Flow Control
• Source transmits frame
• Destination receives frame and replies with
acknowledgement (ACK)
• Source waits for ACK before sending next frame
• Destination can stop flow by not sending ACK
• Works well for large frames
• Inefficient for smaller frames, link utilization will
be very low.

3
With the use
of multiple
frames for a
single
message, the
stop-and-wait
procedure
may be
inadequate.
Performance of stop-and-wait

 It works, but performance stinks


 ex: 1 Gbps link, 15 ms prop. delay, 8000 bit packet:

L 8000 bits
d trans   9
 8 microseconds
R 10 bps
 U sender: utilization – fraction of time sender busy sending

U L/R .008
= = = 0.00027
sender 30.008
RTT + L / R microsec
onds
 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link

Transport Layer 3-5


stop-and-wait operation
sender receiver
first packet bit transmitted, t = 0
last packet bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK

ACK arrives, send next


packet, t = RTT + L / R

U L/R .008
= = = 0.00027
sender 30.008
RTT + L / R microsec
onds

Transport Layer 3-6


Pipelined protocols
Pipelining: sender allows multiple, “in-flight”, yet-to-
be-acknowledged pkts
 range of sequence numbers must be increased
 buffering at sender and/or receiver

 Two generic forms of pipelined protocols: go-Back-N,


selective repeat
Transport Layer 3-7
Pipelining: increased utilization
sender receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK
last bit of 2nd packet arrives, send ACK
last bit of 3rd packet arrives, send ACK
ACK arrives, send next
packet, t = RTT + L / R

Increase utilization
by a factor of 3!

U 3*L/R .024
= = = 0.0008
sender 30.008
RTT + L / R microsecon
ds
Transport Layer 3-8
1.2. Sliding Window Flow Control
• The problem of “Stop and Wait” is not able to send
multiple packets
• Sliding Window Protocol allows multiple frames to be in
transit
• Receiver has buffer of W (called window size) frames
• Transmitter can send up to W frames without ACK
• Each frame is numbered
— Sequence number bounded by size of the sequence number
field (k bits)
— thus frames are numbered modulo 2k (0 … 2k-1)
• ACK includes number of next frame expected

9
Sliding Window Flow Control
(W = 7, k=3)

10
Example of a Sliding Window
Protocol (W = 7)

11
2. Error Control
• So far we have seen flow control mechanisms
where frames are transmitted without errors
—in real life any transmission facility may introduce
errors
• So we have to
—detect errors
—if possible, correct errors
—adopt flow control algorithms such that erroneous
frames are retransmitted

12
Error Control
• Actions to be taken against
—Lost frames
—Damaged frames
• Automatic repeat request (ARQ) mechanism
components
—Error detection
—Positive acknowledgment
—Retransmission after timeout
—Negative acknowledgement and retransmission

13
Automatic Repeat Request
(ARQ)
• Stop-and-wait ARQ
• Go-back-N ARQ
• Selective-reject (selective retransmission) ARQ

14
2.1 Stop and Wait ARQ
• Source transmits single frame
• Wait for ACK
• If received frame is damaged, discard it
—If transmitter receives no ACK within timeout,
retransmits
• If ACK damaged,transmitter will not recognize it
—Transmitter will retransmit after timeout
—Receiver gets two copies of frame, but disregards
one of them
—Use ACK0 and ACK1
• ACKi means “I am ready to receive frame i”

15
Stop-and-Wait ARQ –
Example

• Simple but inefficient

16
2.2 Go-Back-N ARQ
• Based on sliding window
• If no error, ACK as usual with next frame
expected
—ACKi means “I am ready to receive frame i” and “I
received all frames between i (not included) and my
previous ack”
• Sender uses window to control the number of
unacknowledged frames
• If error, reply with rejection (negative ack)
—Discard that frame and all future frames until the
frame in error is received correctly
—Transmitter must go back and retransmit that frame
and all subsequent frames
17
Go-Back-N ARQ

Normal operation

 ACK1 is not
necessary if
ACK2 is sent:
Cumulative
ACK
Go-Back-N ARQ

Damage or Lost Frame

Correctly received out


of order packets are not
Buffered.
Go-Back-N ARQ- Lost Frame (2)
• Frame i lost and no additional frame sent
• Receiver gets nothing and returns neither
acknowledgment nor rejection
— This is kind of a deadlock situation that needs to be resolved
• Transmitter times out and sends acknowledgment
frame with P bit set to 1 (this is actually a
command for ack request)
—Receiver interprets this as an ack request command
which it acknowledges with the number of the next
frame it expects (i )
• Transmitter then retransmits frame i
20
Go-Back-N ARQ -
Example (k=3, i.e.
frame numbering is
modulo 8)
RR means Receive Ready
i.e. ack message

21
Go-Back-N ARQ, sender window size
• Size of the sender window must be less than 2 m. Size of the
receiver is always 1. If m = 2, window size = 2 m – 1 = 3.
• Fig compares a window size of 3 and 4.

Accepts as
the 1st
frame in
the next
cycle-an
error
2.3 Selective Repeat ARQ, sender and receiver windows
• Go-Back-N ARQ simplifies the process at the receiver site. Receiver only keeps
track of only one variable, and there is no need to buffer out-of-order frames,
they are simply discarded.
• However, Go-Back-N ARQ protocol is inefficient for noisy link. It bandwidth
inefficient and slows down the transmission.
• In Selective Repeat ARQ, only the damaged frame is resent. More bandwidth
efficient but more complex processing at receiver.
• It defines a negative ACK (NAK) to report the sequence number of a damaged
frame before the timer expires.
Selective Repeat ARQ, lost frame • Frames 0 and 1
are accepted
when received
because they
are in the range
specified by the
receiver
window. Same
for frame 3.
• Receiver sends
a NAK2 to show
that frame 2
has not been
received and
then sender
resends only
frame 2 and it is
accepted as it is
in the range of
the window.
Selective Repeat ARQ, sender window size
• Size of the sender and receiver windows must be at most one-half of 2 m. If m =
2, window size should be 2 m /2 = 2. Fig compares a window size of 2 with a
window size of 3. Window size is 3 and all ACKs are lost, sender sends duplicate
of frame 0, window of the receiver expect to receive frame 0 (part of the
window), so accepts frame 0, as the 1st frame of the next cycle – an error.

You might also like