Module 4.1 45 minBeginner

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.

Course plan — preview

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.

FieldBytesPurpose
Destination MAC6Who is supposed to receive it
Source MAC6Who sent it
Type/Length2Higher-layer protocol (0x0800 = IPv4, 0x86DD = IPv6, 0x0806 = ARP)
Payload46–1500The IP packet (or other L3 PDU)
FCS4CRC-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.

Course plan

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