1234MAC addressPortTimer(empty)00:00:5e:00:53:011300 s00:00:5e:00:53:022300 s00:00:5e:00:53:033300 sABCD
Envelopes: one frame each; the coloured seal shows who sent itTag chip: the source MAC, carried to its row in the tableCheck: the host keeps the frame · Cross: not for it, droppedA switch with four ports and four hosts. It learns from the SOURCE MAC of every frame and the port it came in on, floods frames for unknown destinations and every broadcast (ff:ff:ff:ff:ff:ff) out of all other ports, forwards frames for known destinations out of one port, and removes rows that are not refreshed within the aging time (300 s by default). MAC addresses 00:00:5e:00:53:01-04 are RFC 7042 documentation values; ff:ff:ff:ff:ff:ff is the real broadcast address. IPs are from the private range 192.168.1.0/24 (RFC 1918). Frames cross a switch in microseconds; the figure slows everything down so you can watch.

Starting empty

  1. A switch joins devices with cables, one per port. Every device has a MAC address, an ID built into its network hardware. This switch was just turned on, so its MAC address table, the list of which MAC sits behind which port, is empty.

Unknown destination

Known destination

Broadcast

Steady state

Inside the switch

;; step 1/11 · empty-table · idle
MAC address table (filtering database)
  MAC address        port   timer
  (no entries)
ports 1-4 up · one VLAN · aging time 300 s (IEEE 802.1Q default)

A real switch floods only within the frame's VLAN, and spanning tree may block some ports to stop loops. Here there is one VLAN and no loop. If a device moves to another port, its next frame simply rewrites its row with the new port.