Ethernet, MAC tables, and switching
An L2 switch makes forwarding decisions by destination MAC. It builds its table from source MACs of arriving frames. This chapter walks through MAC learning, flooding, and the difference between a hub, switch, and router.
What you'll learn
- Describe the format of an Ethernet II frame.
- Walk through how a switch learns and populates its MAC address table.
- State the three forwarding outcomes: forward, flood, drop.
The Ethernet II frame
Every frame a switch handles has the same layout. The frame starts at the destination MAC and ends at the FCS. Before it, the sender transmits 7 bytes of preamble and a 1-byte start frame delimiter (SFD), which let the receiver lock onto the signal and find where the frame begins. They belong to the physical-layer transmission, not to the frame, and they are never counted in its size.
| Field | Bytes | Purpose |
|---|---|---|
| Destination MAC | 6 | Who is supposed to receive it |
| Source MAC | 6 | Who sent it |
| Type/Length | 2 | Higher-layer protocol (0x0800 = IPv4, 0x86DD = IPv6, 0x0806 = ARP) |
| Payload | 46–1500 | The IP packet (or other L3 PDU) |
| FCS | 4 | CRC-32 integrity check |
The MAC learning algorithm
When a frame arrives on port X, the switch records 'source MAC is reachable through port X' in its MAC address table. This is dynamic — entries age out after a few minutes (default 300 seconds on most switches) of inactivity.
The MAC address table is kept per VLAN: every entry is a (VLAN, MAC, port) triple, and a frame arriving in VLAN 10 is looked up only against VLAN 10 entries. If the destination MAC has only been learned in VLAN 20, it is still an unknown unicast for VLAN 10 and is flooded to the other VLAN 10 ports — a switch never uses another VLAN's entry, because that would bridge the two VLANs together. Reaching a host in another VLAN always takes a router or SVI.
When the switch needs to forward a frame, it looks up the destination MAC. If found, the frame is sent only out the matching port (forward). If not found, the frame is sent out every other port in that VLAN except the ingress port (flood). If the destination MAC is the broadcast FF:FF:FF:FF:FF:FF, the frame is always flooded. If the matching port is the same as the ingress port, the frame is dropped (filtering): the destination sits on the segment the frame came from and has already heard it.
8 more sections in this chapter, plus a 4-question quiz and a hands-on lab.
Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.
- Read every chapter in Module 1 — How Networks Work
- Save labs of up to 5 devices
- Save up to 3 topologies
- See the full course syllabus + chapter titles
Free account · no card required · compare plans any time
Build it step by step
- Three hosts, one switchPut three PCs on a single subnet through an unconfigured switch and watch it learn who lives where. · 6 steps · ~12 min · 4 devices
- ARP and MAC learning, side by sideWatch a host's ARP cache and a switch's MAC table fill from the very first frame — and see why a host never ARPs for anything beyond its gateway. · 5 steps · ~14 min · 4 devices
- Two departments, one switchSplit a single switch into Sales and Ops with VLANs, and watch the pings between them stop. · 7 steps · ~15 min · 5 devices
- One VLAN across two switchesSplit four PCs into two VLANs across two switches, then carry both VLANs between the switches over a single tagged trunk. · 7 steps · ~18 min · 6 devices