What is the data link layer?

The primary service of the data link layer is to support error-free transmission. The physical layer sends the information from the sender's hub to the receiver's hub as raw bits.

The data link layer must identify and correct any bug in the communicated data.

It takes packets from the network layer and divides the packets into frames which are shared by the sender through the physical layer, as demonstrated in the diagram below −

A Cyclic Redundancy Check (CRC) which is inserted into the data frame can find the loss frames. Hence, the data link layer in the receiving device can request for the data we display. It can also see when the frames are lost and request that they may be transmitted again.

Functions of data link layer

The functions of the data link layer are explained below −

  • Framings: It splits packets which are obtained from the network layer into the controllable units known as frames.

  • Physical Addressing: It inserts a header to the frame to represent the physical address of the sender and receiver of the frame.

  • Error Control: This is the leading service of the data link layer. It helps the protocols to identify error frames and to provide the communication of accurate frames.

  • Flow Control: It supports a flow control structure to prevent a quick transmitter from defeating a slow receiver by buffering more bits.

  • Access Control: The data link layer protocol decides which device has control over the connection at any provided time, when the other systems are linked to a parallel connection.