The data link layer is the second layer from the bottom in the OSI network architecture model.
- The major functions of the Data Link Layer include framing, physical addressing, error detection, flow control, and media access control.
- It organises data into frames and provides node-to-node delivery over a physical link.
- It also provides an interface between the Network Layer and the Physical Layer.

Sub-Layers of The Data Link Layer
The data link layer is further divided into two sub-layers, which are as follows:
1. Logical Link Control (LLC): This sublayer provides services to the Network Layer and handles functions such as multiplexing, flow control, error control, and acknowledgments, depending on the LLC service used.
- Protocol Identification: Identifies which network layer protocol (such as IP) is being used and ensures correct delivery of data.
- Flow Control: Regulates the rate of data transmission to prevent data overflow between sender and receiver.
- Error Control: Detects transmission errors and may request retransmission of corrupted frames.
2. Media Access Control (MAC): This is the lower sub-layer of the Data Link Layer responsible for controlling how devices access the physical transmission medium. It handles physical addressing and ensures that data is transmitted efficiently without conflicts on the network.
- Physical Addressing: Adds MAC address to frames to uniquely identify sender and receiver devices.
- Media Access Management: Controls when a device can send data to avoid collisions in shared communication channels.
- Frame Transmission: Encapsulates packets received from the Network Layer into frames and passes them to the Physical Layer for transmission.
Functions of DLL
Read more about Data Link Layer Services.
Protocols in Data link layer
There are various protocols in the data link layer, which are as follows:
- Synchronous Data Link Protocol (SDLC)
- High-Level Data Link Control (HDLC)
- Serial Line Interface Protocol (SLIP)
- Point to Point Protocol (PPP)
- Link Access Procedure (LAP)
- Link Control Protocol (LCP)
- Network Control Protocol (NCP)
Devices Operating at the Data Link Layer
All these devices rely on MAC addresses for efficient frame delivery and play a crucial role in local network communication and access control.

1. Switch
- A switch is a key device in the Data Link Layer.
- It uses MAC addresses to forward data frames to the correct device within a network.
- Works in local area networks (LANs) to connect multiple devices.
2. Bridge
- A bridge is a Layer 2 networking device that connects network segments and forwards frames based on MAC addresses.
- It can divide a LAN into separate segments to reduce unnecessary traffic.
- Traditional standalone bridges are now uncommon, as modern Ethernet switches provide similar bridging functionality with multiple ports.
3. Network Interface Card (NIC)
- A NIC is a hardware component in devices like computers and printers.
- A NIC provides the network interface for a device and handles Data Link Layer functions such as MAC addressing and frame processing.
- It also interfaces with the Physical Layer to transmit and receive data over the network medium.
4. Wireless Access Point (WAP)
- A WAP allows wireless devices to connect to a wired network.
- Operates at the Data Link Layer by managing wireless MAC addresses.
- Uses protocols like Wi-Fi (IEEE 802.11) to communicate with devices.
5. Layer 2 Switches
- These are specialized switches that only operate at Layer 2, unlike multi-layer switches.
- Responsible for frame forwarding using MAC address tables.
Note: The Data Link Layer can be targeted by attacks like MAC spoofing or ARP poisoning. Understanding how devices and frames operate at this layer helps detect and mitigate such threats.
Limitations
- Limited Scope: It operates only within a local network and cannot handle end-to-end communication across different networks.
- Increased Overhead: Adding headers, trailers, and redundant data (for error correction) increases the size of transmitted data.
- Error Handling Dependency: While it can detect and correct some errors, it relies on upper layers for handling more complex issues.
- No Routing Capability: The Data Link Layer cannot make routing decisions. It only ensures delivery within the same network segment.
- Resource Usage: Flow control and error correction mechanisms may consume extra processing power and memory
Applications
- Local Area Networks (LANs): Enables reliable communication between devices within a local network using protocols like Ethernet (IEEE 802.3).
- Wireless Networks (Wi-Fi): Manages communication between devices in wireless networks via protocols like IEEE 802.11 hence, handling media access and error control.
- Switches and MAC Addressing: Facilitates the operation of switches by using MAC addresses to forward data frames to the correct device within the network.
- Point-to-Point Connections: Used in protocols like PPP (Point-to-Point Protocol) to establish and manage direct communication between two nodes.