Main menu


Data link layer functions and basics, data link layer is the second layer of the “OSI” layer model, and this layer is one of the most complex layers and has complex functions and adversaries, and the data link layer hides the details of the basic devices and represents itself to the upper layer as a communication medium. The data link layer operates between two directly linked hosts in a sense, this direct connection can be point-to-point or broadcast, the systems on the broadcast network are on the same link and the work of the data link layer tends to become more complex when dealing with multiple hosts in a single collision domain.

Data link layer functions and basics

Data link layer basics

The data link layer accomplishes the most reliable node to send data to the node, and it forms frames of packets that are received from the network layer and sent to the physical layer. And it synchronizes the information to be transmitted through the data and the error is easily controlled, then the encrypted data is passed to the data physical.

Error detection bits are used by the data link layer. It corrects errors and outgoing messages are grouped into frames. The system then waits for acknowledgments of receipt after sending and can be relied upon to send messages.

The main task of the data link layer is to change a raw transfer facility into a seemingly error-free bus of undetected transmission to the network layer, and it accomplishes this task by having the transmitter separate the input data into data frames. typically a few hundred or a few thousand bytes. and transfer frames sequentially, where if the service is reliable, the recipient confirms the correct receipt of each frame by sending an acknowledgment frame.

The data link layer converts the initial transmission facility into a line that appears free from undetected transmission errors to the network layer. which is responsible for the delivery from node to node and also makes the physical layer free of errors and appears in the upper layer i.e. the network layer.

Data link layer properties

  • When a packet or message arrives at a network, the data link layer is responsible for sending it to the host using its MAC address.
  • The data link layer devices are “Switch” and “Bridges”.

Sub-layers of the data link layer

The data link layer includes two sub-layers, the “LLC” layer and the “MAC” layer, and as described in the “IEEE-802 LAN” specification, the role of the “LLC” sublayer is to control the flow of data between applications and various services as well as providing mechanisms Acknowledgment and notification of error.

The “LLC” sublayer can then talk to a number of “IEEE 802 MAC” sublayers that control access to the physical media for transport and are also responsible for the physical addressing of frames. Two common types of MAC layers include the Ethernet and 802.11 specifications. ″ wireless.

1- Logical link control

Logical link control: is the upper sublayer and consists of protocols that run at the top of the data link layer, and also provide flow control, acknowledgment, and error notification. Through the transmission medium and to control the data exchanged between the originator of the packet and the recipient of the message.

  • “LAN” is an abbreviation for “Local Area Network.
  • “LLC” is an acronym for “Logical Link Control.
  • “MAC” is an acronym for “Media Access Control.

2- Media Access Control (MAC)

  • Who can switch to the media at any time is specified by the “MAC” sub-layer such as “CSMA / CD”.
  • The packet obtained from the network layer is divided into frames depending on the NIC frame size, and the DLL also encapsulates the MAC address of the sender and receiver in the header.
  • An ARP request is placed on the wire and contains the question “Who has this IP address?” After getting the destination of this message, the host replies with its “MAC” address, and through this, the “MAC” address of the receiver is obtained.


  1. “ARP” is an acronym for “Address Resolution Protocol” and “DLL” is an acronym for “Dynamic-Link Library.”
  2. “CSMA/CD” is an acronym for “Carrier Sense Multiple Access/Collision Detection” and “NIC” is an acronym for “Network Interface Card”.

Function classes defined for the data link layer

1- framing

The data link layer receives a stream of bits from the network layer that is divided into manageable data units called frames.

2- Physical addressing

If frames are to be distributed to different stations on the network, to determine the actual address of the sender (the source address), or the receiver (the destination address) of the frame, the DLL adds a header to the frame, and if the frame is to be sent to a system outside the sender's network, the address of the receiver Means the address of the device that connects one network to another.

3- Flow control

If the rate at which the receiver consumes data is less than the rate produced by the sender, the data link layer handles the flow control mechanism to prevent the receiver from being bypassed.

4- Error control

The data link layer also deals with damaged or lost frames, and by adding mechanisms to detect and retransmit lost frames increasing reliability, a “trailer” has been added to the end of the frame to achieve error control.

5- 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 is controlling the link at any time.

Data Link Layer Functions

  • Addresses problems that occur as a result of bit transmission errors.
  • Ensures that data flows at a pace that does not overwhelm the transmitters and receivers.
  • It allows data to be transmitted to Layer 3, the network layer, where it is processed and routed.

Data link layer and error solving

The data link layer ensures that an initial connection is set up, the output data is divided into data frames, and processes the acknowledgments from the receiver that the data has arrived successfully. It also ensures that the incoming data is received correctly by analyzing bit patterns at specific places in the frames. Informs higher-level protocols that something has happened to the actual link.

Frame sequencing capabilities within the data link layer allow the receiving device to rearrange frames that may have been sent out of sequence, the data link layer verifies that a packet is not obstructed, and the data link layer also manages flows by enabling devices on a link to detect congestion, and it transmits Neighboring devices then have the congestion information so that the traffic can be redirected accordingly.