OSI Model - Data Link Layer
Layer 2 is the layer that actually gets a chunk of data across one link and into the next device. It frames the packet, stamps it with MAC addresses, adds a checksum, and decides whose turn it is to talk on the wire.
Layer 2 in the stack
The Data Link layer is Layer 2. It sits directly above the Physical layer (Layer 1) and directly below the Network layer (Layer 3). Its scope is deliberately narrow: it moves data across a single link between two directly connected devices, called nodes. That is why Layer 2 delivery is described as node-to-node (or link-to-link) delivery, while Layer 3 is host-to-host across the whole path.
The Data Link layer takes the Layer 3 packet from above and hands the Physical layer a frame to transmit. On receipt it does the reverse. Everything Layer 2 does happens per hop, on one link at a time.
The jobs of the data link layer
Layer 2 has five jobs. Learn them as a set, because exam questions often ask you to spot which one is being described:
| Job | What it means |
|---|---|
| Framing | Wrap the packet in a frame with a header and trailer so the receiver can tell where the frame begins and ends. |
| Physical addressing | Add source and destination MAC addresses to identify the devices on this link. |
| Error detection | Append an FCS checksum; a frame that fails the check is discarded. |
| Media access control | Decide which device may transmit when several share the medium (for example CSMA/CD on old Ethernet, CSMA/CA on Wi-Fi). |
| Topology control | Define and manage how nodes are arranged on the link (the link’s logical topology) and provide link-level flow control. |
Notice that Layer 2 detects errors but does not correct them. A corrupted frame is simply dropped, and recovery is left to upper-layer protocols such as TCP.
Two sublayers: LLC and MAC
The IEEE split Layer 2 into two sublayers so that the logical and hardware parts could evolve independently:
- Logical Link Control (LLC) — defined by IEEE 802.2. It is the upper sublayer and provides a common interface to the network layer. It identifies which upper-layer protocol the payload belongs to (multiplexing) and can offer connection-oriented or connectionless service. Because it is shared, LLC lets IP run over wildly different link technologies without change.
- Media Access Control (MAC) — the lower sublayer, defined per technology (IEEE 802.3 for Ethernet, IEEE 802.11 for Wi-Fi). It handles hardware addressing (the MAC address) and access to the shared medium.
+-----------------------------------------------+ | Network layer (Layer 3) - IP packet | +-----------------------------------------------+ | Data Link layer (Layer 2) | | +-----------------------------------------+ | | | LLC sublayer (IEEE 802.2) | | | +-----------------------------------------+ | | | MAC sublayer (802.3 / 802.11) | | | +-----------------------------------------+ | +-----------------------------------------------+ | Physical layer (Layer 1) - bits | +-----------------------------------------------+
The LLC sublayer is the same regardless of whether the link is wired or wireless; the MAC sublayer changes with the technology. That is why Ethernet and Wi-Fi are different at Layer 2 but both carry IP perfectly happily at Layer 3.
The frame and the trailer
A frame is the Layer 2 PDU: the Layer 3 packet plus a Layer 2 header and a Layer 2 trailer. The Data Link layer is the only layer that adds a trailer, and that trailer holds the Frame Check Sequence (FCS). In IEEE 802.3 (Ethernet) the frame is a sequence of fields. At a high level they are:
Two naming facts to lock in: the Layer 2 PDU is a frame, and Layer 2 is the only OSI layer that adds a trailer (the FCS) in addition to a header.
Devices: switch and bridge
The classic Layer 2 devices are the bridge and the switch. A switch is effectively a multi-port bridge:
- Both forward frames within a single LAN using MAC addresses.
- A switch learns which MAC address lives on which port by reading the source MAC of frames that arrive, and stores this in its MAC address table.
- It then forwards a frame only out the port where the destination MAC lives. If the destination is unknown, it floods the frame out all ports except the one it arrived on.
A bridge does exactly the same job, historically with fewer ports and often implemented in software. The switch is simply the modern, hardware-based descendant.
Layer 2 protocols
Several different protocols define how Layer 2 works on different media:
| Protocol | Standard / RFC | Where it is used |
|---|---|---|
| Ethernet | IEEE 802.3 | The dominant wired LAN technology; defines the MAC sublayer and the Ethernet frame. |
| Wi-Fi | IEEE 802.11 | The dominant wireless LAN technology; uses CSMA/CA for media access. |
| PPP | RFC 1661 | Point-to-point links, classically WAN serial connections between two devices. |
| LLC | IEEE 802.2 | The upper sublayer used with 802.3 and 802.11 to present a common interface to Layer 3. |
Other technologies such as Frame Relay, ATM, and HDLC also live at Layer 2, but modern networks are overwhelmingly Ethernet at the access layer, 802.11 in the air, and PPP or Ethernet on WAN links.
Review
Check what you have learned with these review questions.
Key terms
- Data Link layer (Layer 2) — the OSI layer that frames data and delivers it node-to-node across a single link.
- Frame — the Layer 2 PDU: a header, the payload, and a trailer.
- FCS — Frame Check Sequence; the trailer field used to detect transmission errors.
- LLC — Logical Link Control; the IEEE 802.2 upper sublayer that interfaces to the network layer.
- MAC sublayer — the lower Layer 2 sublayer handling MAC addressing and control of the shared medium.
- MAC address — a hardware address, local to a link, used to identify devices at Layer 2.
- Switch — a multi-port Layer 2 device that forwards frames by MAC address within a LAN.
- Media access control — the method that determines which device may transmit on a shared medium.
Sources: RFC 791; RFC 1122; RFC 1661 (PPP); IEEE 802.2, 802.3 and 802.11; ISO/IEC 7498-1; Cisco CCNA 200-301 exam topics.
Sources & references
- Postel, J. RFC 791: Internet Protocol (1981). rfc-editor.org/rfc/rfc791.
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989). rfc-editor.org/rfc/rfc1122.
- IEEE. IEEE 802.3 (Ethernet; MAC sublayer and frame format). standards.ieee.org.
- IEEE. IEEE 802.11 (Wireless LAN MAC and PHY). standards.ieee.org.
- ISO/IEC. 7498-1:1994 — Open Systems Interconnection — Basic Reference Model. iso.org.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.