UNIT 3 Data Link Layer
UNIT 3 Data Link Layer
Data Link Layer is the second layer of OSI Layered Model after Physical Layer.
When a packet or message reaches to a network, it is the responsibility of Data Link Layer to transmit it to the Host using its MAC address.
Data Link Layer devices are Switch & Bridges.
Sub layers of Data Link Layer
Data Link Layer has two sub layers,
Logical Link Control (LLC):
This is the uppermost sub-layer, LLC consists of protocols running at the top of the data link layer, and also provides flow control,
acknowledgment, and error notification. The LLC provides addressing and data link control. It specifies which methods are to be used for
addressing channels over the transmission medium and for controlling the data exchanged between the generator of packet and recipient
of the message.
Media Access Control (MAC):
Who can access the media at any one time, determines by the MAC sub layer(e.g. CSMA/CD).
The packet obtains from the Network layer is further divided into frames depending on the frame size of NIC(Network Interface Card). DLL
also encases Sender's and Receiver's MAC address in the header.
An ARP(Address Resolution Protocol) request is placed onto the wire asking "Who has that IP address?" and after getting this message
destination host replies with its MAC address. By this, the receiver's MAC address is obtained.
Framing: The data link layer receives the stream of bits from the network layer divides into manageable data units called frames.
Physical addressing: If frames are to be distributed to different stations on the network. To define the physical address of the sender
(source address) and/or receiver (destination address) of the frame, the DLL adds a header to the frame.
If the frame is to be sent for a system outside the sender's network. The receiver's address means the address of the device that connects
one network to another.
Flow control: If the rate at which the data are consumed by the receiver is less than the rate produced by the sender, the data link layer
deals with a flow control mechanism to prevent overrun the receiver.
Flow Control Techniques in Data Link Layer
Data link layer uses feedback based flow control mechanisms. There are two main techniques −
Error control: The data link layer also deals with damaged or lost frames. By adding mechanisms to detect and retransmit lost frames
increases reliability.
A trailer added to the end of the frame to achieve error control.
Access control: When more than two or two devices are connected to the common link, data link layer protocols are necessary to
determine which device has control over the link at any point of time.
Example: In this figure, a node with physical address 23 sends a frame to a node with physical address 92. The two nodes connected by a
link level. At the link level this frame contains physical (link) addresses in the header.
These are the only addresses needed. The remaining header contains other information that is required at this level. The extra bits needed
for error detection contains by the trailer.
Error Detection
Error
A condition when the receiver’s information does not match with the sender’s information. During transmission, digital signals suffer
from noise that can introduce errors in the binary bits travelling from sender to receiver. That means a 0 bit may change to 1 or a 1 bit
may change to 0.
Some popular techniques for error detection are:
1. Simple Parity check
2. Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check
1. Simple Parity check
Blocks of data from the source are subjected to a check bit or parity bit generator form, where a parity of :
1 is added to the block if it contains odd number of 1’s, and
0 is added if it contains even number of 1’s
This scheme makes the total number of 1’s even, that is why it is called even parity checking.
3. Checksum
In checksum error detection scheme, the data is divided into k segments each of m bits.
In the sender’s end the segments are added using 1’s complement arithmetic to get the sum. The sum is complemented to get the
checksum.
The checksum segment is sent along with the data segments.
At the receiver’s end, all received segments are added using 1’s complement arithmetic to get the sum. The sum is complemented.
If the result is zero, the received data is accepted; otherwise discarded.
4. Cyclic redundancy check (CRC)
Unlike checksum scheme, which is based on addition, CRC is based on binary division.
In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of data unit so that the resulting data
unit becomes exactly divisible by a second, predetermined binary number.
At the destination, the incoming data unit is divided by the same number. If at this step there is no remainder, the data unit is assumed
to be correct and is therefore accepted.
A remainder indicates that the data unit has been damaged in transit and therefore must be rejected.