Layer 2 Switching — How Switches Forward Frames and Learn MAC Addresses
Layer 2 switching forwards frames using MAC addresses. Here are the three switch functions, the CAM table, and…
An Ethernet frame is the unit of data at Layer 2. Everything you send over a wired network, an IP packet, an ARP request, an STP BPDU, travels inside one. Understanding its fields explains MTU, jumbo frames, VLAN tagging, runts and giants, and most Layer 2 troubleshooting.
| Field | Size | Purpose |
|---|---|---|
| Preamble | 7 bytes | Alternating 1s and 0s so the receiver can synchronise its clock |
| SFD (Start Frame Delimiter) | 1 byte | 10101011, marks where the frame proper begins |
| Destination MAC | 6 bytes | Who the frame is for |
| Source MAC | 6 bytes | Who sent it, this is what a switch learns from |
| 802.1Q tag (optional) | 4 bytes | VLAN ID and priority, when present |
| EtherType / Length | 2 bytes | What is in the payload, or how long it is |
| Payload | 46 – 1500 bytes | The encapsulated packet |
| FCS (Frame Check Sequence) | 4 bytes | CRC-32 over the frame; corrupted frames are dropped |
| Interframe Gap | 12 bytes’ time | Mandatory idle period between frames |
The preamble, SFD and interframe gap are physical-layer overhead and are not counted in the frame size. The frame itself, destination MAC through FCS, is 64 bytes minimum, 1518 bytes maximum (1522 with a VLAN tag).
Six bytes each, usually written as 00:1A:2B:3C:4D:5E. The first three bytes are the OUI, assigned to a manufacturer, which is why you can look up a vendor from a MAC address. The last three are assigned by that manufacturer.
Two bits in the first byte carry meaning:
FF:FF:FF:FF:FF:FF is the all-ones case.A switch reads the source MAC to learn, and the destination MAC to forward. See Layer 2 switching for how that works.
The same 2-byte field means different things depending on its value, which is a historical artefact of Ethernet II and IEEE 802.3 coexisting:
Because the maximum payload is 1500 and the minimum EtherType is 1536, the two interpretations never collide.
| EtherType | Protocol |
|---|---|
| 0x0800 | IPv4 |
| 0x0806 | ARP |
| 0x86DD | IPv6 |
| 0x8100 | 802.1Q VLAN tag |
| 0x88A8 | 802.1ad QinQ |
| 0x8847 | MPLS unicast |
| 0x8863 / 0x8864 | PPPoE discovery / session |
| 0x888E | 802.1X authentication |
The 64-byte minimum frame size is not arbitrary. On the original shared-medium Ethernet, a station had to still be transmitting when a collision signal could reach it from the far end of the segment, otherwise it would never detect the collision. 64 bytes was the transmission time that guaranteed this across the maximum legal cable length.
Payloads shorter than 46 bytes are therefore padded to reach it. A frame arriving shorter than 64 bytes is a runt, and on modern full-duplex links a runt indicates corruption or a faulty NIC rather than a collision.
A CRC-32 computed over everything from the destination MAC to the end of the payload. The receiver recomputes it and silently discards the frame if it does not match. Ethernet has no retransmission, recovery is TCP’s job at a higher layer.
Rising CRC error counters are one of the most useful diagnostics available:
Switch# show interfaces GigabitEthernet0/5 | include CRC|runts|giants|input errorsCRC errors point at a physical problem, a damaged cable, a failing SFP, an EMI source, or a duplex mismatch.
A tagged frame has 4 extra bytes inserted after the source MAC, pushing the maximum frame size to 1522:
| Sub-field | Bits | Purpose |
|---|---|---|
| TPID | 16 | Always 0x8100, marking this as a tagged frame |
| PCP | 3 | Priority, 0–7, the QoS marking at Layer 2 |
| DEI | 1 | Drop eligible indicator |
| VID | 12 | VLAN ID, 1–4094, which is where the 4,094 VLAN limit comes from |
Access ports send and receive untagged frames. Trunk ports carry tagged frames, with one exception: the native VLAN is sent untagged. QinQ (802.1ad) stacks a second tag for service-provider use.
A jumbo frame carries a payload larger than 1500 bytes, typically 9000. There is no IEEE standard for them, it is a de facto convention, which is why MTU mismatches are so common.
# Test path MTU with a DF-bit ping
ping -M do -s 8972 10.10.10.5 # Linux, 8972 + 28 = 9000
ping -f -l 8972 10.10.10.5 # WindowsDo not enable jumbo frames on a general-purpose LAN. The gain is small and the failure mode is confusing. Enable them on a dedicated storage or backup VLAN where you control every device in the path.
| Condition | Frame size | Called |
|---|---|---|
| Below minimum | < 64 bytes | Runt |
| Standard minimum | 64 bytes | — |
| Standard maximum | 1518 bytes | — |
| With one VLAN tag | 1522 bytes | Baby giant |
| Above maximum with a bad FCS | > 1518 bytes | Giant / jabber |
| Jumbo | up to ~9018 bytes | Jumbo frame |
1518 bytes for a standard frame, 14 bytes of header, up to 1500 bytes of payload, and 4 bytes of FCS. A VLAN tag adds 4 more, making 1522.
It was a compromise between efficiency and the buffer memory available in 1980s hardware, and it stuck because changing it would break interoperability everywhere. Larger MTUs exist as jumbo frames but were never standardised.
Ethernet II uses the 2-byte field as an EtherType identifying the payload protocol. IEEE 802.3 uses it as a length and puts an LLC header inside the payload. Values of 1536 and above are EtherTypes; 1500 and below are lengths. Almost all data traffic today is Ethernet II.
Physical-layer problems, a damaged or out-of-spec cable, a failing transceiver, electromagnetic interference, or a duplex mismatch. CRC errors are effectively never a software or configuration issue.
No. The preamble and start frame delimiter are physical-layer synchronisation and are not counted in the 64–1518 byte range, nor covered by the FCS.
Those are tagged frames, the 802.1Q tag adds 4 bytes. They are sometimes called baby giants and switches must be configured to accept them on trunk links.