What is a CAM table, and how does a switch build it?
A CAM (Content Addressable Memory) table — also called the MAC (Media Access Control) address table — maps MAC addresses to switch ports, and is built dynamically by examining source addresses of incoming frames.
* Building the CAM table from source MACs. *
Unlike regular memory where you search by address to find data, a CAM table works in reverse: you search by content (the MAC address) and it returns the location (the port number). This is what makes switching so fast.
How it's built:
- A frame arrives on a port
- The switch reads the source MAC address
- It records the mapping: source MAC → ingress port
- Each entry has a 5-minute aging timer — if no frames from that MAC arrive within 5 minutes, the entry is removed
The table starts empty when the switch boots. Over time, as devices communicate, the switch "learns" the network topology organically.
Tip: Think of CAM as a reverse phone book — instead of looking up a name to find a number, you look up a MAC to find a port.
Go deeper:
MAC address table (Wikipedia) — covers the CAM (Content Addressable Memory)/FIB and the source-MAC learning process that populates it.