2. Flow Control: Initial Assumptions
• Simplex Channel
• Infinite buffer capacity with the receiver
• Error free transmission
• Network layer at the senders end is always
ready with data
• No need for flow control
6. • Infinite capacity in the buffer of the receiver.
• Need for “flow control”
• Stop-n-Wait protocol
– Sender sends a frame
– And waits for a signal in the form of a dummy frame
– No seq no. is required since the line is still error free
8. • The channel is noisy, frames may be damaged or
lost
• Advantage : data frame reaches intact, ack sent
back and received, next frame sent
• Disadvantage :
– Data frame damaged or lost ..hence no ack – sender
times out and resends .. No problems
– Data frame reaches intact but Ack lost .. Times out
..resends.. Receiver receives duplicate frames..Problem
9. Problem of Duplicate frames
• Solution :
– Keep a sequence number for each frame to distinguish
between the new frame and a duplicate frame.
• How large should be the sequence number? Or
• What should be minimum number of bits required
for the sequence number?
– The only ambiguity at the receiver is between two
successive frames.. Say m and m+1 and never between
m-1 and m +1 .. Its only after the ack for m-1 reaches
back intact mth frame is sent.. And once mth frame
reaches intact at the receiver’s end .. Story of m-1th
frame is over .. However depending upon whether ack
of mth frame reaches back intact or not either mth or
m+1 th frame is sent .. hence only 1 bit is sufficient
10. A Simplex Protocol for a Noisy
Channel
A positive
acknowledgement
with retransmission
protocol.
Continued
11. A Simplex Protocol for a Noisy Channel
(ctd.)
A positive acknowledgement with retransmission protocol.
12. • Channel is simplex ..
• So, Now communication is two way .. I.e.
Duplex channel
– Interleave data and ack .. So ..a kind field is
required to specify whether the frame contains
data or ack.
– Piggyback ack on data frame
13. Sliding Window
Protocol(Duplex)
• At any instant of time, the sender maintains a set
of sequence numbers corresponding to frames it is
permitted to send – this includes
– frames not yet sent
– Frames sent but not yet acknowledged .. May have to
be sent again
This corresponds to the sender’s window. When a packet
comes from the NL ..it is appended in the window and
when an ack arrives for a frame..it is deleted from the
buffer(and from the window)
14. Sliding Window
Protocol(Duplex)
• Similarly, the receiver also maintains a set of
sequence numbers corresponding to frames it is
permitted to accept.
– When a frame arrives, its seq number is checked..if it
falls in the window it is accepted else discarded .. Once
an ack is sent for a frame it is deleted from the window
so that duplicate frames are not accepted.
• Sliding window gives the DLL the flexibility to
accept the frames in any order but they must be
handed over to the NL in order.
15. Sliding Window Protocols (2)
A sliding window of size 1, with a 3-bit sequence number.
(a) Initially.
(b) After the first frame has been sent.
(c) After the first frame has been received.
(d) After the first acknowledgement has been received.
16. Sliding Window Protocols
• A One-Bit Sliding Window
Protocol
• A Protocol Using Go Back N
• A Protocol Using Selective Repeat