Pcornel
Networking · Architecture

CAM & TCAM

Cheat sheet · https://pcornel.dk/topic.php?topic=35

Back to the Topic

Answer

How switches use CAM for exact-match MAC lookups and TCAM for ternary policy/prefix classification.

Remember

  • CAM stores exact MAC matches for Layer 2 forwarding.
  • TCAM matches with masks for ACLs, QoS and routing lookups at line rate.
  • When TCAM is full, traffic may be punted to software.

First checks

  • show platform hardware fed switch active fwd-asic resource tcam utilization — TCAM use (Catalyst 9k)
  • show sdm prefer — template
  • show mac address-table count — CAM usage

Commands

show mac address-table [dynamic]
Inspect learned MAC-to-port mappings.
show platform hardware fed switch active fwd-asic resource tcam utilization
show mac address-table

Verify in this order

packet → CAM (MAC) / TCAM (route, ACL, QoS) lookup → hardware forwarding

Where it usually breaks

physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=35

Confirmation

Confirm action

Continue?