Open In App

Difference between TCAM and CAM

Last Updated : 18 Oct, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

1. CAM :
Content Addressable Memory (CAM) is a peculiar computer memory used in high-speed search-oriented applications. CAM consists of conventional semiconductor memory, typically SRAM(static RAM) along with connected logic comparison circuitry that makes it perform search operations in a single clock cycle. It can store and query binary inputs i.e. 0 and 1. 

The functioning of CAM is the opposite of the functioning of RAM (Random Access Memory). In the case of RAM, OS (Operating System) performs retrieval of data stored on RAM by giving the memory address which represents the location of stored data. But in the case of CAM, the retrieval of data stored on it is done by looking for the data itself. The memory retrieves the addresses where the data can be detected. 

The parallel nature of CAM makes it much faster than RAM in search tasks. It performs exact match-based searching that is useful for storing MAC (Media Access Control) addresses because of its fixed length.

2. TCAM :
Ternary Content Addressable Memory is a special type of CAM (Content Addressable Memory) that permits the third state referred to as “don’t care” in one or more bits of stored data. It also performs the entire search task in a single clock cycle. 

The term “ternary” means there are inputs available which the memory can store and query i.e. 0,1 and “don’t care”. The “don’t care” state introduces the flexibility in searching that enables TCAM to perform pattern-based searching. Because of its flexibility, it is used for storing IP addresses where the entire range of IP addresses can be searched at once. 

It is utilized in enhancing the speed of routing table lookups, forwarding, and classification of packets, and ACL (Access Control Lists) commands.

Difference between CAM and TCAM :

S.NO. CAM (Content Addressable Memory) TCAM (Ternary Content Addressable Memory)
    1. CAM stands for Content Addressable Memory. TCAM stands for Ternary Content Addressable Memory.
    2. It is a search engine-based computer memory used for various search applications. It is a specialized version of CAM depicted for quick table lookups.    
    3. It performs the entire search operation in a single clock cycle. It also performs the entire search operation in a single clock cycle.
4. The way it operates is the opposite of RAM (Random Access Memory), thus this makes it much faster than RAM in case of search operations.  It adds a third state to RAM (Random Access Memory) that provides flexibility in functionality for wildcard characters, thus makes it faster than RAM.
5. Unlike RAM, data loaded on CAM can be retrieved by executing a query for the data itself. Operating System utilizes the data and CAM retrieves the address that represents the location of stored data. It allows high-speed routing table lookups when compared to RAM.
6. CAM stores and query binary inputs i.e. 0 and 1. TCAM stores and query ternary inputs i.e. 0,1 and “don’t care”.
7. It is most useful for implementing tables that perform exact match based searching. For example – the MAC address table. It is most useful for implementing tables that perform the longest match-based searching. For example – the IP routing table.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads