Two protocols have been developed to control the flow of
data across communications links. These are:
(@) Simplex Stop-and-Wait
(b) Sliding window
Simplex Stop-and-Wait Protocol
This is a half-duplex
protocol and it is also referred to as a Stop-and-Wait protocol. This is so
because transmission is one direction must stop before transmission in the
opposite direction occurs. In this protocol, the sender sends one frame and
then waits for an acknowledgment before proceeding.
After having passed a packet to its network layer, the
receiver sends a little dummy frame back to the sender which, in effect, gives
the sender permission to transmit the next frame. After having sent a frame,
the sender is required by the protocol to hold its time until the little dummy
(i.e. acknowledgment) frame arrives.
>The sender starts out by fetching a packet from the network layer,
using it to construct a frame and sending it on its way. Only now, the sender
must wait until an acknowledgement frame arrives before looping back and
reaching the next packet from the network layer. The sending data link layer
need not even inspect the incoming frame.
The only difference between one receiver i.e. receiver1 and
the other receiver i.e. receiver2 is that after delivering a packet to the
network layer, the receiver2 sends an acknowledgement frame back to the sender
before entering the wait loop again. Because only the arrival of the frame back
at the sender is important, not its contents, the receiver need not put any
particular information in it.
Noisy Channel Simplex Protocol
If the channel is noisy, then the frames may be either
damaged or lost completely due to attenuation or the noise in the channel. If
the frame is damaged, then the receiver hardware will be able to detect this
using the checksum error. If the frame is damaged in such a way that the
checksum is never correct, then the protocol may totally fail. But such a
situation is very less likely to occur.
PAR (Positive Acknowledgement with Restransmission) or ARQ
(Automatic Repeat Request)
The protocol in which the sender waits for a possitive
acknowledgement before advancing to the
next data item is called PAR or ARQ. This type of protocol also transmits data
in one direction. This requires that the
timeout interval should be long enough to prevent premature timeouts. If the
sender times out too early, while the acknowledgement is still on the way, it
will send a duplicate.
Many procedures
require a device to respond or reply to an inquiry within a certain period of
time. If the device does not respond, a timeout condition occurs, thus
preventing the procedure from hanging uo the computer. Timeouts are also used
in communications to detect retransmission failures.
When the previous
acknowledgement finally does arrive, the
sender will mistakenly think that the just-sent frame is the one being
acknowledged and will not realize that there is potentially another
acknowledgement frame somewhere "in the pipe". If the next framesent
is lost completely but the extra acknowledgement arrives correctly, the sender
will not attempt to transmit the lost frame and the protocol will fail.
Thus, after transmitting a frame, the sender starts the timer
running. if it was already running, it will be reset to allow another full
timer interval. The time intreval must be chosen to allow enough time for the
frame to get to the receiver. Only when that time nterval has elapsed, it is
safe to assume that either the transmitted frame or its acknowledgement has
been lost and then try to send a duplicate.
After
transmitting a frame and starting the timer, the sender can except any one of
three happenings :
(a) An acknowledgement frae arrives undamaged or,
(b) A damaged acknowledgement frame staggers in, or
(c) The timer goes off
If a valid
acknowledgement comes in, the sender fetches the next packet from the network
layer and puts it in the buffer, overwriting the previous packet. It also
advances the sequence number.
If a damaged frame
arrives or no frame at all arrives, neither the buffer nor the sequence number
are changed, so that a duplicate can be sent.
At the receiver,
when a valid frame arrives to its sequence number is checked to see if it is a
duplicate. If not, it is accepted, passed to the network layer and an
acknowledgement generated. Damaged and duplicate frames are not passed to the
network layer.
see at previous page about Flow control and its Type's.
See at Next page about Sliding Window.
see at previous page about Flow control and its Type's.
See at Next page about Sliding Window.
No comments:
Post a Comment