Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

CAM & TCAM

Direct answer

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

When to use this

Use it when MAC, ACL or QoS scale limits are reached, or to understand why some features consume TCAM space.

First 30 seconds

1. CAM does exact-match lookups (MAC table); TCAM does masked matches (routes, ACLs, QoS).

2. Tables are finite and template dependent.

3. Exhaustion pushes traffic to software or drops it.

4. Pick the right SDM template.

5. Monitor utilisation before adding large ACLs/routes.

Operational verification

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

Failure signatureNew MAC addresses, ACL entries or routes are not programmed in hardware

Some hosts flood or are unreachable, or a new ACL/QoS policy only partly takes effect, while configuration looks correct.

Possible stored cause: A hardware table (MAC/CAM, TCAM for ACL/QoS/routes) is full, so new entries are not installed or fall back to software.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · IOS/IOS XE
Key commandshow mac address-table [dynamic]
Scope / prerequisiteUse it when MAC, ACL or QoS scale limits are reached, or to understand why some features consume TCAM space.
Show · 1
What next?3 suggested next steps
Catalog command links1
Evidence0
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

How to read the output

show mac address-table [dynamic]

Look first: VLAN, MAC, type, learned interface

Healthy: Endpoint MAC is learned in expected VLAN/interface.

Warning: Missing, flapping or learned on unexpected interface/VLAN.

Does not prove: MAC learning does not prove ARP/IP routing or application reachability.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

7 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Some hosts flood or are unreachable, or a new ACL/QoS policy only partly takes effect, while configuration looks correct.

Step 1 Verification & evidence Verify boundary

show mac address-table; platform-specific TCAM/resource commands; verify ACL/QoS programming.

Step 2 Commands & verification Verify boundary
  • show mac address-table — Inspect learned MAC-to-port mappings.
Step 3 Common failure modes Narrow the fault

Resource exhaustion, unexpected flooding, stale MAC learning, or policy entries not fitting/programming in hardware.

Step 4 Troubleshooting workflow Narrow the fault

Focus for this topic: Resource exhaustion, unexpected flooding, stale MAC learning, or policy entries not fitting/programming in hardware.

Step 5 Do not confuse logical config with hardware programming Narrow the fault

A VLAN, route or ACL can exist in configuration/control state while hardware programming is constrained or unexpected. When symptoms are selective or scale-related, compare logical tables with platform hardware/CEF/TCAM evidence rather than rewriting policy immediately.

Step 6 Common mistakes Narrow the fault
  • Running out of TCAM space for ACLs/routes and getting traffic punted to the CPU.
  • Changing SDM templates without a planned reload.
Step 7 Evidence-first troubleshooting Narrow the fault

When forwarding or policy looks correct in configuration but behaves unexpectedly, distinguish control/configuration intent from hardware programming/capacity. Verify the relevant MAC/CEF/ACL state before assuming the hardware table is the cause.

Command lookup Jump straight to Cisco syntax
Key points
  • 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.
Key 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
ReferenceWhat it is1 section · depth on demand

Concept overview

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

Key ideas: CAM excels at exact matches such as MAC addresses. TCAM can match 0/1/don’t-care patterns, enabling ACL, QoS and routing/policy lookups in hardware.

ReferenceWhy it matters1 section · depth on demand

Why it matters

CAM excels at exact matches such as MAC addresses. TCAM can match 0/1/don’t-care patterns, enabling ACL, QoS and routing/policy lookups in hardware.

ReferenceHow it works2 sections · depth on demand

Different tables answer different forwarding questions

CAM is commonly associated with exact-match Layer-2 MAC forwarding, while TCAM supports parallel ternary matching used by ACLs, QoS classifications and many Layer-3 forwarding/policy lookups. Hardware resources are finite, so forwarding scale and policy complexity can affect table utilization.

Mechanism, scope & boundaries

CAM and TCAM support different lookup styles. CAM is well suited to exact matches such as MAC-address forwarding entries; TCAM supports ternary/wildcard matching used by ACLs and other policy/forwarding lookups. Hardware table capacity is finite and platform dependent.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

CAM and TCAM in switches

Switches forward at line rate because lookups happen in specialised memory. CAM (content-addressable memory) holds exact-match tables, such as MAC addresses. TCAM (ternary CAM) can also match "don't care" bits, so it holds prefixes, ACLs and QoS rules. Cisco's MATM technote for Catalyst 9000 shows how to see the limits:

  • show platform hardware fed switch active fwd-asic resource tcam utilization lists each table's capacity and use.
  • For example, the MAC table on a C9300 has 32,768 exact-match entries and 1,024 TCAM entries.
  • The technote recommends watching for 95 % or more.

CAM compared with TCAM

CAM / exact matchTCAM
Match typeExact (0 or 1 for every bit)0, 1 or "don't care"
Typical contentsMAC addresses, host routesIP prefixes, ACLs, QoS classes, PBR
LookupOne resultThe first matching entry, in priority order
CostCheaper, largerExpensive, power-hungry, smaller

What fills which table

FeatureTable
Learned MAC addressesMAC (exact match)
Host and prefix routesIPv4/IPv6 FIB (exact match for hosts, TCAM for prefixes)
ACLs (security, QoS, PBR)TCAM regions per feature
Multicast routesMulticast tables

When tables are full

TableEffect
MACNo new learning; traffic to new hosts is flooded (MATM-3-MAX_ENTRIES)
FIBRoutes not programmed; traffic is punted or dropped
ACL TCAMACL fails to install; the configuration is rejected or only partly applied
SW1# show platform hardware fed switch active fwd-asic resource tcam utilization
Codes: EM - Exact_Match, I - Input, O - Output, IO - Input & Output, NA - Not Applicable
Table                  Subtype      Dir  Max     Used    %Used
Mac Address Table      EM           I    32768   4211    12.85%
Mac Address Table      TCAM         I    1024    21      2.05%
L3 Multicast           EM           I    8192    0       0.00%
IP Route Table         EM           I    24576   1903    7.74%
IP Route Table         TCAM         I    8192    455     5.55%
SW1# show sdm prefer
SW1(config)# sdm prefer distribution

SDM templates

On Catalyst switches, SDM templates divide the hardware tables between features, for example more routes versus more MAC addresses. Changing a template requires a reload. Check TCAM use before choosing one, especially on distribution switches with large routing tables.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

CAM and TCAM are the hardware lookup tables that let switches forward at line rate. CAM (content-addressable memory) does exact-match lookups, such as a destination MAC address in a VLAN. TCAM (ternary CAM) can match bits as 0, 1 or "don't care", so it handles longest-prefix routes, ACLs and QoS classifiers in a single lookup.

TableLookup typeHolds
CAMExact matchMAC address table
TCAMMasked match with priorityRoutes (FIB), ACL entries, QoS, PBR

TCAM is limited and shared between features through SDM templates on Catalyst switches. When it fills, entries may be punted to the CPU or not installed.

show sdm prefer
show platform hardware fed switch active fwd-asic resource tcam utilization
show mac address-table count

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Architecture → CAM & TCAM. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Depth when you need it

Deep reference

Design & tradeoffs

ENCOR design tradeoffs

Hardware tables are finite resources; feature scale and template choices can trade one table resource for another.

Confirmation

Confirm action

Continue?