Switch – Why is the CAM table in a switch called CAM table and not MAC table even though it holds MAC addresses

ethernetlanmac addressswitchswitching

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?

Best Answer

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.