rsgamage1 Thu, 07/17/2008 - 04:45

CAM is useful whenever the switch needs to do a lookup and needs to be an "exact match".

TCAM table is useful when you are interested in a "certain portion" of the address as a match.

e.g. first 8 bits of a 32-bit address.


mohammedmahmoud Thu, 07/17/2008 - 05:06


CAM stands for Content Addressable Memory which is a special type of memory used by Cisco switches, in the case of ordinary RAM the IOS uses a memory address to get the data stored at this memory location, while with CAM the IOS does the inverse, it uses the data and the CAM returns the address where the data is stored, also the CAM is considered to be faster than the RAM since the CAM searches the entire memory in one operation.

The problem with CAM is that it can only do exact matches on ones and zeros (binary CAMs), and here TCAM (Ternary CAM) comes, since it can match a third state which is any, this makes TCAM a very important component of Cisco layer 3 switches and modern routers, since they can store their routing table in the TCAMs, allowing for very fast lookups, which is considerably better than routing tables stored in ordinary RAM.

CAM and TCAM are the most important parts of the so called ASICs that Cisco switches leverage for line-speed fast switching.


Mohammed Mahmoud.

bethamprashanth Thu, 07/17/2008 - 05:18

hi mohammed,

I just know that cam contain mac address, port and vlan information.

and switch will be using this information to transfer information.

then what about TCAM,

1.what it contains, will it help in L3 switching,

3.does L2 switches dont have this table. will be the lookup process in L3 switches

thanking you,


mohammedmahmoud Thu, 07/17/2008 - 05:51

Hi Prashanth,

Well to keep it simple, a multilayer switch uses sets of TCAMs, each set of TCAMs are used for a certain feature (Routing, QoS, ACLs ...), and it does parallel lookups to get all the required results using the VMR combination (Value, Mask and Result), these results can be permit and deny in the case of ACLs, values for QoS policies in case of QoS or pointers to a next-hop in the routing table in case of routing, most of the traditional layer 2 Cisco switches has only CAMs for only layer 2 switching, while some layer 2 Cisco switches has TCAMs for QoS and not for routing, while layer 3 switches has the routing TCAMs.

To get into depth please review the "CCNP BCMSN Exam Certification Guide" book, i believe that it covered this point perfectly.


Mohammed Mahmoud.

rsgamage1 Thu, 07/17/2008 - 06:15

An excerpt from a self-study guide[ISBN: 1-58720-077-5] (of course if you don't have access to the same)

lamav Thu, 07/17/2008 - 06:16

Haj Mohammed:

Great explanations. I'm giving you a 5 plus. :-)



This Discussion