TCP/IP - Layer 2
Definition
The Data Link Layer (Layer 2) is responsible for delivering data node-to-node (hop-to-hop) within the same local network using MAC addresses.
What Problem It Solves
It ensures that data is correctly delivered between devices on the same LAN by identifying devices using physical (MAC) addresses and managing local network communication.
What Happens If Not Used
Without Layer 2, devices on the same network would not be able to identify each other or deliver frames correctly, leading to failed local communication even if physical connections exist.
Easy Wording
This layer helps devices in the same network send data to the correct device using hardware addresses (MAC addresses).
Layman Example
It’s like a delivery system inside a building where each apartment has a unique number, so the delivery person knows exactly which door to deliver the package to.
Technical Example
Layer 2 functions include:
- Uses MAC addresses for device identification
- Provides hop-by-hop delivery within a LAN
- Encapsulates data into frames
- Handles error detection (not correction)
Protocols / technologies:
- Ethernet (IEEE 802.3)
- Wi-Fi (IEEE 802.11)
Example: A switch receives an Ethernet frame and forwards it based on the destination MAC address to the correct port within the same LAN.