The Wayback Machine - https://web.archive.org/web/20240708080936/https://www.geeksforgeeks.org/data-link-layer/
Open In App

Data Link Layer

Last Updated : 18 Jun, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The data link layer is the second layer from the bottom in the OSI (Open System Interconnection) network architecture model. It is responsible for the node-to-node delivery of data. Its major role is to ensure error-free transmission of information. DLL is also responsible for encoding, decoding, and organizing the outgoing and incoming data.

This is considered the most complex layer of the OSI model as it hides all the underlying complexities of the hardware from the other above layers. In this article, we will discuss Data Link Layer in Detail along with its functions, and sub-layers.

Data-Link-Layer

OSI Model: Data Link Layer

Sub-Layers of The Data Link Layer

The data link layer is further divided into two sub-layers, which are as follows:

Logical Link Control (LLC)

This sublayer of the data link layer deals with multiplexing, the flow of data among applications and other services, and LLC is responsible for providing error messages and acknowledgments as well. 

Media Access Control (MAC)

MAC sublayer manages the device’s interaction, responsible for addressing frames, and also controls physical media access.

The data link layer receives the information in the form of packets from the Network layer, it divides packets into frames and sends those frames bit-by-bit to the underlying physical layer. 

Functions of The Data-link Layer

There are various benefits of data link layers s let’s look into it.

Data Link Layer

Framing

The packet received from the Network layer is known as a frame in the Data link layer. At the sender’s side, DLL receives packets from the Network layer and divides them into small frames, then, sends each frame bit-by-bit to the physical layer. It also attaches some special bits (for error control and addressing) at the header and end of the frame. At the receiver’s end, DLL takes bits from the Physical layer organizes them into the frame, and sends them to the Network layer. 

Addressing

The data link layer encapsulates the source and destination’s MAC address/ physical address in the header of each frame to ensure node-to-node delivery. MAC address is the unique hardware address that is assigned to the device while manufacturing. 

Error Control

Data can get corrupted due to various reasons like noise, attenuation, etc. So, it is the responsibility of the data link layer, to detect the error in the transmitted data and correct it using error detection and correction techniques respectively. DLL adds error detection bits into the frame’s header, so that receiver can check received data is correct or not. It adds reliability to phyiscal layer by adding mechansims to detect and retransmit damaged or lost frames.

Flow Control

If the receiver’s receiving speed is lower than the sender’s sending speed, then this can lead to an overflow in the receiver’s buffer and some frames may get lost. So, it’s the responsibility of DLL to synchronize the sender’s and receiver’s speeds and establish flow control between them. 

Access Control

When multiple devices share the same communication channel there is a high probability of collision, so it’s the responsibility of DLL to check which device has control over the channel and CSMA/CD and CSMA/CA can be used to avoid collisions and loss of frames in the channel. 

Protocols in Data link layer

There are various protocols in the data link layer, which are as follows:

Conclusion

In conclusion, the Data Link Layer is essential for ensuring that data is transferred reliably and accurately across a network. It handles error detection and correction, manages data frame sequencing, and provides access to the physical network. By organizing data into frames and controlling how devices on the network communicate, the Data Link Layer plays a crucial role in maintaining smooth and efficient network operations.

Frequently Asked Questions on Data Link Layer – FAQs

What is the purpose of framing in the Data Link Layer?

Framing involves encapsulating data into frames with headers and trailers, allowing the receiver to identify the start and end of each frame and to distinguish between different frames.

What is MAC address in the Data Link Layer?

MAC (Media Access Control) address is a unique hardware address assigned to network interfaces at the Data Link Layer. It is used to identify devices on a network.

What is the difference between a MAC address and an IP address?

A MAC address is a hardware address associated with a network interface card, while an IP address is a logical address used for routing data packets in a network. MAC addresses are used at the Data Link Layer, and IP addresses are used at the Network Layer.


Previous Article
Next Article

Similar Reads

Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Why Flow Control is Used in Both Data Link Layer and Network Layer?
OSI model was established in1947 by international standard organization is a multinational body dedicated to worldwide agreement on international standards.ISO standard covers all the aspects of network communications is the Open System Interconnection model.It was introduced in the late 1070s. an open system is a set of protocols that allows any t
6 min read
Framing in Data Link Layer
Frames are the units of digital transmission, particularly in computer networks and telecommunications. Frames are comparable to the packets of energy called photons in the case of light energy. Frame is continuously used in Time Division Multiplexing process. Framing is a point-to-point connection between two computers or devices consisting of a w
6 min read
Data Link Layer Communication Protocols in IoT
Several Communication Protocols are used in Internet of Things (IoT) to provide service to the network layer. As we know IoT is based on networking of things where smart devices communicate with each other by sending and receiving data. So for that several network protocols (Communication protocols) are used to connect the IoT enabled devices and t
5 min read
Examples of Data Link Layer Protocols
Data Link Layer protocols are generally responsible to simply ensure and confirm that the bits and bytes that are received are identical to the bits and bytes being transferred. It is basically a set of specifications that are used for implementation of data link layer just above the physical layer of the Open System Interconnections (OSI) Model. S
4 min read
Services provided by Data Link Layer
Prerequisite - Data Link Layer Data Link Layer is generally representing protocol layer in program that is simply used to handle and control the transmission of data between source and destination machines. It is simply responsible for exchange of frames among nodes or machines over physical network media. This layer is often closest and nearest to
4 min read
Various kind of Framing in Data link layer
Framing is function of Data Link Layer that is used to separate message from source or sender to destination or receiver or simply from all other messages to all other destinations just by adding sender address and destination address. The destination or receiver address is simply used to represent where message or packet is to go and sender or sou
4 min read
Error Control in Data Link Layer
Data-link layer uses the techniques of error control simply to ensure and confirm that all the data frames or packets, i.e. bit streams of data, are transmitted or transferred from sender to receiver with certain accuracy. Using or providing error control at this data link layer is an optimization, it was never a requirement. Error control is basic
4 min read
Flow Control in Data Link Layer
Flow control is design issue at Data Link Layer. It is a technique that generally observes the proper flow of data from sender to receiver. It is very essential because it is possible for sender to transmit data or information at very fast rate and hence receiver can receive this information and process it. This can happen only if receiver has very
4 min read
Data Link Layer in OSI Model
Below are some common GATE CS topics of data link layer. Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access or CSMA method was developed to minimize the probability of collision and thus, to increase the performance. The probability of collision can be minimized if a station senses or reads the medium before trying to use it for sen
3 min read