Cam
Cam
References
Title: Network Processors Architectures, Protocols, and Platforms Author: Panos C. Lekkas Publisher: McGraw-Hill Kostas Pagiamtzis, Ali Sheikholeslami, Content-Addressable Memory (CAM) Circuits and Architectures: A Tutorial and Survey, IEEE J of Solid-State Circuits vol. 41, No.3, March 2006. NetLogic MicroSystems Application Note, Intradevice Configuration of Network Search Engines. NetLogic MicroSystems Application Note, High Performance Layer 3 Forwarding. IDT White Paper, Taking Packet Processing to the Next Level.
What is CAM?
Content Addressable Memory is a special kind of memory! Read operation in traditional memory: Input is address location of the content that we are interested in it. Output is the content of that address. In CAM it is the reverse: Input is associated with something stored in the memory. Output is location where the associated content is stored.
00 01 10 11 1 0 1 X X 0 1 1 0 X 0 1 1 0 X 0 1 1 X X 1 0 0 1 1
0 1
Traditional Memory
00 01 10 11
1 0 1 X X 0 1 1 0 X 01 0 1 1 X X 1 0 0 1 1
0 1 1 0 1
Source: http://pagiamtzis.com/cam/camintro.html
Source: K. Pagiamtzis, A. Sheikholeslami, Content-Addressable Memory (CAM) Circuits and Architectures: A Tutorial and Survey, IEEE J. of Solid-state circuits. March 2006
Source: K. Pagiamtzis, A. Sheikholeslami, Content-Addressable Memory (CAM) Circuits and Architectures: A Tutorial and Survey, IEEE J. of Solid-state circuits. March 2006
CAM Basics
The search-data word is loaded into the search-data register. All match-lines are pre-charged to high (temporary match state). Search line drivers broadcast the search word onto the differential search lines. Each CAM core compares its stored bit against the bit on the corresponding search-lines. Match words that have at least one missing bit, discharge to ground.
ENTS689L: Packet Processing and Switching Content Addressable Memory (CAM) Source: K. Pagiamtzis, A. Sheikholeslami, Content-Addressable Memory (CAM) Circuits and Architectures: A Tutorial and Survey, IEEE J. of Solid-state circuits. March 2006
Type of CAMs
Binary CAM (BCAM) only stores 0s and 1s Applications: MAC table consultation. Layer 2 security related VPN segregation. Ternary CAM (TCAM) stores 0s, 1s and dont cares. Application: when we need wilds cards such as, layer 3 and 4 classification for QoS and CoS purposes. IP routing (longest prefix matching).
CAM Advantages
They associate the input (comparand) with their memory contents in one clock cycle. They are configurable in multiple formats of width and depth of search data that allows searches to be conducted in parallel. CAM can be cascaded to increase the size of lookup tables that they can store. We can add new entries into their table to learn what they dont know before.
10
CAM Disadvantages
They cost several hundred of dollars per CAM even in large quantities.
11
CAM structure
The comparand bus is 72 bytes wide bidirectional. The result bus is output. Command bus enables instructions to be loaded to the CAM. It has 8 configurable banks of memory. The NPU issues a command to the CAM. CAM then performs exact match or uses wildcard characters to extract relevant information. There are two sets of mask registers inside the CAM.
ENTS689L: Packet Processing and Switching Content Addressable Memory (CAM)
I/O Port Control
CAM control
Pipeline execution control (command bus)
12
Flag Control
Mixable with 72 bits x 16384 144 bits x 8192 288 bits x 4096 576 bits x 2048
Priority Encoder
Empty Bit
CAM structure
There is global mask registers which can remove specific bits and a mask register that is present in each location of memory. The search result can be one output (highest priority) Burst of successive results. The output port is 24 bytes wide. Flag and control signals specify status of the banks of the memory. They also enable us to cascade multiple chips.
ENTS689L: Packet Processing and Switching Content Addressable Memory (CAM)
I/O Port Control
CAM control
Pipeline execution control (command bus)
13
Flag Control
Mixable with 72 bits x 16384 144 bits x 8192 288 bits x 4096 576 bits x 2048
Priority Encoder
Empty Bit
CAM Features
CAM Cascading: We can cascade up to 8 pieces without incurring performance penalty in search time (72 bits x 512K). We can cascade up to 32 pieces with performance degradation (72 bits x 2M). Terminology: Initializing the CAM: writing the table into the memory. Learning: updating specific table entries. Writing search key to the CAM: search operation Handling wider keys: Most CAM support 72 bit keys. They can support wider keys in native hardware. Shorter keys: can be handled at the system level more efficiently.
ENTS689L: Packet Processing and Switching Content Addressable Memory (CAM)
14
CAM Latency
Clock rate is between 66 to 133 MHz. The clock speed determines maximum search capacity. Factors affecting the search performance: Key size Table size For the system designer the total latency to retrieve data from the SRAM connected to the CAM is important. By using pipeline and multi-thread techniques for resource allocation we can ease the CAM speed requirements.
Source: IDT
15
Source: IDT
16
MASK 3
MASK 2 MASK 1 MASK 0
00000000
FFFFFFFF FFFFFFFF FFFFFFFF
FFFFFFFF
00000000 FFFFFFFF FFFFFFFF
FFFFFFFF
FFFFFFFF 00000000 FFFFFFFF
FFFFFFFF
FFFFFFFF FFFFFFFF 00000000
17
Example Continued
We can still use the mask register (not global mask register) to do maximum prefix length match.
127
1 0 1 1 0 1 1 0 1 1 1 0
. . . . . .
97
96
95
94
0 0 0 0 1 1 0 1 1 0 1 0 1 1 1 0
. . . . . .
1 1 0 1 1 0 1 0 0 0 0 1 0 1 1 0
MATCH FOUND
1 0 1
1 1 0 0
1 1 1 0
Comparand Register
0 0 0
0 0 1 1
1 1 1 1
18
Table Aggregation
We can use tag bits to aggregate multiple tables in a single CAM. Example: We want to use a single CAM (NL85721) for IPV4 packet classification and forwarding. We want to filter packets based on other parameters such as VPN. We can have an undesired match when we want to do a classification. CAM word 0 does not match but the dest. address matches CAM word 1
Source: http://www.netlogicmicro.com/pdf/ncs12_rev_0_8.pdf
ENTS689L: Packet Processing and Switching Content Addressable Memory (CAM)
19
Source: http://www.netlogicmicro.com/pdf/ncs12_rev_0_8.pdf
ENTS689L: Packet Processing and Switching Content Addressable Memory (CAM)
20
Source: http://www.netlogicmicro.com/pdf/ncs12_rev_0_8.pdf
21
CAM
CAM
CAM
CAM
22
23
24
Source: http://www.netlogicmicro.com/pdf/cidr_white_paper.pdf 25
26
27
28
29