22

I know the CAM table in a switch holds MAC addresses and the ports that are associated with the respective MAC addresses. There are no such thing as CAM addresses from my knowledge, so why is it called CAM table and not MAC table?

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
yoyo_fun
  • 1,531
  • 4
  • 19
  • 28
  • If you look up "CAM Table" on Wikipedia this is explained in the first paragraph. – Stig Hemmer Aug 31 '17 at 10:21
  • 2
    CAM tables are a kind of memory/table device used to store and lookup data efficiently. The name "CAM" is not related to name of the name of the data it is storing "MAC address" - its just coincidence that it's the same three letters but in reverse. – Baldrick Mar 24 '18 at 18:53

4 Answers4

35

CAM (Content Addressable Memory) is memory that can be addressed by content, rather than a numeric memory address. You can look up the interface by presenting the memory with the MAC address. This is done in a single CPU cycle vs. the traditional programming of searching through a table, which will cost many CPU cycles.

There is also TCAM (Ternary Content Addressable Memory) that can use a mask. This is particularly useful for IP addressing, and it is used by ACLs or routing tables, among other things.

CAM and TCAM cost much more than standard DRAM, but the performance boost given by them for specific applications can be worth the cost, power, and size compromises you must make.

Since most standard PCs do not include anything like this, you can see how a purpose-built piece of hardware, e.g. router or switch, can have a performance advantage over a standard PC for the purpose of routing or switching.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
15

CAM - Content Addressable Memory, referring to the memory used for the MAC address table.

It works kind of reverse from RAM, you address it by giving it content and it returns you the address where the content is stored - which is then used to find the egress port for this address.

manish ma
  • 1,614
  • 9
  • 15
4

Actually, it is called the MAC table by most. The command to look it up in almost all switches/devices is show mac-address table (or some form of this). Very seldom is it specified as the CAM table unless the distinction between CAM and TCAM needs to be made, or someone is teaching the subject.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
Fixitrod
  • 938
  • 4
  • 13
2

A CAM table can also be use to store other forms of exact match entries in an L2/L3 switch that do not require masks, e.g. host routes, MPLS labels, or even maskless exact matches, for example partitioning a table with 24-bit entries, and filling it with /24 routes.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195