Group members : Alisha Korpal Nancy Jain Nivia Jain Sharuti Jain
The data link layer has a number of specific functions it can carry out. These functions include
Providing a well-defined service interface to the network layer.
Dealing with transmission errors.
Regulating the flow of data so that slow receivers are not swamped by fast senders.
Unacknowledged connectionless service.
Acknowledged connectionless service.
Acknowledged connection-oriented service
Source sends frames to destination machine but the destination machine does not send any acknowledgement of these frames back to the source.
There is no connection established between source & destination machine before data transfer or after data transfer.
The connection is not established before the data transfer or after the data transfer.
When the sender sends the data to destination, destination sends back the acknowledgment of these frames.
It means that connection is established between source &destination before any data is transferred.
Each frame being transmitted from source to destination is given a specific number and is acknowledged by the destination machine.
Data transfer has three different phases :-
Actual data transfer
When data is being transmitted from one machine to another, it may possible that data become corrupted on its way. Some of the bits may be altered, damaged or lost during transmission. Such a condition is known as error.
Types of errors
Single bit error
Vertical Redundancy check/parity check
Longitudinal Redundancy check
Cyclic Redundancy check
Redundancy is the method in which some extra bits are added to the data so as to check whether the data contain error or not .
Even parity 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 1 Even Parity Generator (counts 1 in data) 1 Sender Receiver Parity checker Counts 1 in data + VRC) Odd parity Accept data Reject data
11001010 10101010 11001100 11100011 01001111 11001010 10101010 11001100 11100011 11001010 10101010 11001100 11100011 01001111 Original data LRC
10101001 subunit1 00111001 subunit 2 11100010 sum 00011101 Compliment of sum 10101001 00111001 00011101 data checksum Sender :
Receiver: 10101001 subunit1 00111001 subunit2 00011101 Checksum 11111111 sum 00000000 compliment No error
Receiver : 1011 1010 Note: Remainder is zero, no error 1001110 1011 0101 0000 1011 1011 0000 0000 000
Another important design issue that occurs in the data link layer (and higher layers as well) is what to do with a sender that systematically wants to transmit frames faster than the receiver can accept them.
This situation can easily occur when the sender is running on a fast (or lightly loaded) computer and the receiver is running on a slow (or heavily loaded) machine.
The sender keeps pumping the frames out at a high rate until the receiver is completely swamped. Even if the transmission is error free, at a certain point the receiver will simply be unable to handle the frames as they arrive and will start to lose some. Clearly, something has to be done to prevent this situation.
Stop and Wait
The sender sends a single frame to receiver & waits for an ACK.
The next frame is sent by sender only when ACK of previous frame is received.
To end up the transmission sender sends EOT End Of Transmission.
Sender Receiver DATA ACK EOT DATA ACK
In this multiple frames are sent by the sender at a time before needing an acknowledgment.
Multiple frames sent by source and acknowledged by receiver using a single unit.
Sliding window is an imaginary boxes that hold the frames on both sender and receiver side
It provides the upper limit on the number of frames hat can be transmitted before requiring an acknowledgment.
Error control function of data link layer detects the error in transmitted frames and retransmits all the erroneous frames.
Therefore error control function of data link layer helps in dealing with data frames that are damaged in transmit, data frame lost in transmit and the acknowledgment frame that are lost in transmission.
The method is used for error control is called Automatic Repeat Request (ARQ).
If an error is detected in any frame, the receiver sends a negative acknowledgement (NAK) back to source and the specific frame is retransmitted.
ARQ techniques helps us in dealing with:
Damaged data frames
Lost data frame
Lost acknowledgment frames(both ACK & NAK)
Stop and wait ARQ
Sliding window ARQ
Go – back – n
Selective – reject
The sending device keeps a copy of the last frame transmitted until it receives an acknowledgment for that frame. Keeping this copy helps the sender in retransmission of lost or damaged frames later on.
Both data frames and ACK frames are numbered alternately 0 and 1 for identification purpose.
Criteria used by stop and wait ARQ method:
Damaged data frames
Lost data frames
Lost acknowledged frames
If a data frame received by a receiver contains an error, it returns NAK frame to the sender.
On receiving NAK frame ,sender retransmits the last data frame.
Sender Receiver DATA 0 ACK 1 DATA 2 DATA 1 AC K 2 error NAK retransmit DATA 2 AC K 3
Every sending device is equipped with timer.
The sender starts this timer when it transmits data frame.
If a data frame is lost on its way, it will not be received by receiver. As a result the receiver can never acknowledge it, positively or negatively.
The sending device waits for an ACK and NAK frame until timer goes of.
retransmit Sender Receiver DATA 0 ACK 1 DATA 2 DATA 1 AC K 2 lost DATA 2 AC K 3 Time out
When any data frame reaches the destination, the receiver acknowledges it either with ACK or with NAK.
If ACK or NAK frame returned by the receiver is lost in transmit, sending device retransmit the data frame that has not been acknowledged
Sender Receiver DATA 0 ACK 1 DATA 1 DATA 1 AC K 2 ACK 2 retransmit DATA 2 AC K 4 lost
The sending device keeps the copies of all the transmitted frames until they are acknowledged.
The receiver can send both ACK and NAK frames to source. Both ACK & NAK frames are numbered for identification, because this method is a continuous transmission.
Go back n ARQ
Whenever receiver sees a damaged data frame it sends NAK indicating the number of that frame. the NAK indicates that all the frames received prior to this frame are intact and the frame whole number is specified in NAK damaged.
Whenever receiver gets damaged frame it stops accepting any subsequent data frames and sends NAK to sender.
Whenever NAK is received by the sender it retransmit all the data.
In sliding window the data frames must be transmitted sequentially
Receiving any frame, the receiver checks the identifying number on each frame. If any of the frame is lost & is missing in sequence, the receiver sends NAK indicating the number of that frame & discard all other frames that are received out of order.
In sliding window the sender does not wait for acknowledgment after every single frame.
In this method multiple frames are sent. The source can send as many frames as the window size before waiting for an acknowledgment.
Once that limit has been reached or sender has no more frames to send, it must wait.
When a receiver gets damaged frame it sends NAK for that particular frame. This NAK acknowledges the intact receipt of a previously unacknowledged data frames and also indicates an error in current frame.