The Link Layer Container
Before an IP packet crosses a local network it is wrapped in an Ethernet frame, the unit the link layer actually transmits. The frame carries hardware addresses and a checksum around the payload.
MAC Addresses
Every network interface has a MAC address, a forty eight bit identifier usually burned into the hardware. Unlike an IP address, which can change as a device moves between networks, a MAC address names a specific interface on the local segment.
- The frame holds a destination MAC and a source MAC.
- Addresses are local in scope and are rewritten at each hop by routers.
- A special broadcast MAC reaches every device on the segment.
Inside A Frame
- A preamble lets receivers synchronize timing.
- The destination and source MAC addresses steer the frame on the segment.
- A type field names the upper protocol such as IPv4.
- The payload carries the IP packet.
- A trailing frame check sequence detects corruption.
How It Fits Together
A switch reads the destination MAC and forwards the frame only out the port leading to that device. When a packet crosses a router to a new network, the router strips the old frame and builds a new one with fresh MAC addresses, while the IP addresses stay the same end to end.
Key idea
The link layer wraps each packet in an Ethernet frame addressed by MAC, and routers rebuild the frame at every hop while the IP addresses remain unchanged end to end.