What is the data link layer?
The data link layer is the protocol layer of a program that manages how data moves in and out of a physical link in a network. The data link layer is Layer 2 of the Open Systems Interconnection (OSI) architectural model for a set of telecommunication protocols.
The data link layer encodes, decodes and organizes the data bits in the data link layer before it transports the data bits as frames between two adjacent nodes on the same local area network (LAN ) or wide area network. The data link layer also determines how devices recover from collisions that can occur when nodes try to send frames at the same time.
The data link layer has two sublayers: the logical link control (LLC) sublayer and the media access control (MAC) sublayer.
The IEEE 802 LAN specification dictates the LLC sublayer that controls the flow of data between various applications and services, as well as provides error detection and notification mechanisms. The LLC sublayer can then communicate with a number of IEEE 802 MAC sublayers, which control access to the physical media for transport. It is also responsible for the physical addressing of frames.
Two common types of MAC layer are Ethernet and 802.11 wireless specifications.
Data link layer functions
The data link layer has three main functions:
- It handles the problems that occur as a result of bit transmission errors.
- This ensures that data flows at a speed that does not overwhelm the devices that send and receive data.
- This allows data to be passed to Layer 3, the network layer, where it is addressed and routed.
Data link layer and error detection
The data link layer ensures an initial connection is set up, divides the output data into data frames and handles acknowledgments from a receiver that confirms whether the data has arrived successfully. It also analyzes bit patterns in special areas of frames, ensuring that incoming data is received successfully.
When an error occurs, the data link layer informs higher-level protocols that something has happened to the physical link. Frame sequencing capabilities within the data link layer allow the receiving device to reorder frames that may have been transmitted out of sequence. The data link layer verifies that the packet is not corrupted.
The data link layer also manages flows because it enables devices on a link to be detected congestion. Nearby devices then send congestion information, so that traffic can change in the network.
Editor’s note: This article has been reformatted to improve the reader experience.
It was last updated on November 2023
Continue Reading About the data link layer