OSI Layer 2: Data Link Layer
Definition
The Data Link Layer provides direct, reliable point-to-point and point-to-multipoint data transfer between two adjacent nodes connected over the same physical network segment (LAN). It packages Layer 3 packets into Frames.
Sub-layers
The IEEE 802 standard divides Layer 2 into two sub-layers:
- Logical Link Control (LLC) (IEEE 802.2): Handles flow control, multiplexing multiple network layer protocols over the same physical link, and frame synchronization.
- Media Access Control (MAC): Handles hardware addressing (48-bit MAC addresses) and arbitrates access to the physical transmission medium (CSMA/CD in legacy Ethernet, CSMA/CA in Wi-Fi).
Key Functions
- Framing: Adds headers (source & destination MAC addresses, EtherType) and trailers (FCS / CRC checksums) to network packets.
- Physical (MAC) Addressing: Unique Burned-In Address (BIA) for local device identification.
- Error Detection: Frame Check Sequence (FCS) using Cyclic Redundancy Check (CRC-32) to discard corrupted frames.
- Flow & Congestion Control on Local Link: E.g. Ethernet pause frames (802.3x).
Common Protocols & Devices
- Ethernet (IEEE 802.3)
- Wi-Fi (IEEE 802.11)
- ARP (Address Resolution Protocol): Maps IP to MAC addresses.
- VLANs (IEEE 802.1Q)
- PPP / HDLC
- Hardware: Network Switches, Network Interface Cards (NICs), Bridges.
Protocol Data Unit (PDU)
- Frame
Adjacent Layers
- Sits below OSI Layer 3: Network Layer and above OSI Layer 1: Physical Layer.