Lecture-3(DATA LINK CONTROL AND SLIDING

advertisement
MUDULI ACADEMY
DATALINK CONTROL:
The most important responsibilities of the data link are flow control and error control.
Collectively these functions are known as data link control.
Flow control
It is a technique so that sender and receiver with different speed characteristics can communicate
with each other i.e flow control refers to a set of procedures used to restrict the amount of data
that the sender can send before waiting for acknowledgement.
Error control
It is involves both error detection and correction. When an error is detected the receiver can have
the specified frame retransmitted by the sender.
This mechanism is commonly known as automatic repeat request (ARQ) or PAR (positive ACK
with retransmission)
Elementary data link protocols:
The elementary data link protocols is
1. Simplest protocol
2. Stop-and-wait protocol
Simplest protocol:
 The simplest protocol has no flow control or error control.
 It is a unidirectional protocol.
 It is assumed that the processing time can be ignored and infinite buffer space is
available.
 The communication channel is imagined to be noise free/noiseless so it does not damage
or lose ay frame.
 No sequence number and acknowledgement is used in simplest
MUDULI ACADEMY
Stop-and-wait protocol:
 In stop-and-wait protocol, the sender sends one frame, stops until it receives
confirmation/acknowledgement from the receiver and then it sends the next frame.
 This protocol uses unidirectional communication for data frames but ACK frames travels
in the opposite direction.
Sliding window protocol:
 In the elementary data link protocol data frames are transmitted in one direction only but
there is a need to transmitting data in both directions. This is achieved by sliding window
protocol.
 Sliding window protocol is used to provide reliable data transmission between two
computers in a networking environment.
 A sliding window protocol is a connection oriented protocol and this protocol is situated
in the data link layer as well as transport layer. Of the ISO/OSI model.
 It is full duplex protocol.
 Sliding window is a imaginary box at transmitter and receiver. At the transmitter the
window is called sending window and at receiver the window is called receiver window.
0 1 2 3 4 5 6 7 0 1 2
0 1 2 3 4 5 6 7 0 1 2
Frame 0
0 1 2 3 4 5 6 7 0 1 2
ACK1
0 1 2 3 4 5 6 7 0 1 2
0 1 2 3 4 5 6 7 0 1 2
0 1 2 3 4 5 6 7 0 1 2
Wall move to the right when data is sent
Wall move to the right when ack
is received
Wall move to the right when data is
received
Wall move to the right when ack is sent
MUDULI ACADEMY
STOP AND WAIT ARQ :( one bit sliding window protocol or alternating bit protocol)
General technique of stop and wait ARQ
 In stop and wait ARQ the sender (say station A) transmits a frame and then waits till it
receives acknowledgement (ACK) from the receiver (say station B). as long as the sender
does not receive acknowledgement with in the time period , the sender does not send
next frame.
 If the time is out and acknowledgement is not received by the sender then it retransmit
the old frames.
Lost frame:
When a frame is lost during the transmission, the sender again retransmits the
frame.
MUDULI ACADEMY
Damaged frame:
If the sending frame is damaged then again it retransmits the damaged frame from sender to
receiver.
Lost Acknowledgement:
If the acknowledgement is lost the transmitter retransmits the same data frame after
its timer goes off. Here the receiver has discards the sending copy of frame.
DRAWBACK OF STOP AND WAIT PROTOCOL:
1. It is very inefficient.
2. At only one moment only one frame is in transition.
3. The sender will have to wait at least one round trip time before sending next.
MUDULI ACADEMY
GO-BACK-N-ARQ:
Principle of GO-BACK-N ARQ/General techniques of GO-BACK-N ARQ:
In GO-Back-N ARQ the sender does not wait for ACK signal for the transmission of next time.
It transmits the frames continuously as long as it does not receive the NAK signal.
When the receiver detects an error in the frame the receiver sends a NAK signal back to the
sender. On the reception of the NAK signal the transmitter will resend all the frames where the
error was occurred.
Note:
The size of the window is at most 2m -1 where m is the number of bits for the sequence number
Here Sender has 3 variables: S, SF, and SL .S holds the sequence number of recently sent frame.
SF holds the sequence number of the first frame. SL holds the sequence number of the last frame
Frame LOST:
Due to loss of data frame the receiver does not receive the sending data frame, so it sends a
NAK (negative acknowledgement) to the transmitter and the transmitter retransmits all the
frames.(lost frame + all frames after lost frame)
MUDULI ACADEMY
Frame damage:
When some error has occurred in the data frame then the data frame is damaged . so the error is
detected and receiver send NAK signal back to the receiver. On receiving this signal, the
transmitter starts retransmission from damaged frame. Those frames received after damaged
frame and before NAK that are to be discarded by the receiver.
Acknowledgement lost:
In this case the transmitter does not except an acknowledgement after every data frames. So it
uses a timer and within the time if the acknowledgement is not received by the sender then again
it retransmits the old frame as transmitted previously. Here that type of acknowledgement is
called cumulative acknowledgement.
DRAWBACKS OF GO-BACK-N:
1. It transmits all the frames if one frame is damaged or lost.
2. It transmits frames continuously as long as it does not receive the NAK signal.
Selective repeat ARQ:
MUDULI ACADEMY
Principle of selective repeat/general technique:
In this method, only the specified damaged or lost frame is retransmitted. Here the
transmitter must contain a searching mechanism that allows it to find and select only the
requested frame for retransmission.
1
2
3
4
5
6
7
3
8
9
10
Frame 3 has error so frame 3 is retransmitted
1
2
3
4
5
6
7
3
8
9
10
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.
Frame lost:
In this ARQ after getting the negative acknowledgement , the lost frame is sent to the receiver
not all the frames which are send after the error frames.
Frame damaged:
MUDULI ACADEMY
Here when frame is damaged only that frame is resend after receiving the NAK and is not
required to resend all the frames after damaged frame.
Acknowledgement lost:
When acknowledgement is lost of the corresponding sending frame then only that frame is
resend again to the receiver for geting the acknowledgement which was previously lost.
Piggybacking :( bidirectional)
It is a method to combine a data frame with an acknowledgement during the transmission.
Example:
if station A and station B both have data to send. Instead of sending separate data and ACK
frames, station A sends a data frame that includes an ACK. Station B behaves in a similar
manner.
Advantage:
It is better use of available channel bandwidth
Disadvantage:
The drawback of piggybacking is the additional system complexity.
Download