cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1057
Views
0
Helpful
4
Replies

CEF implementation,routers and switches

sarahr202
Level 5
Level 5

Hi everybody

Cisco switches complie FIB table and adjacency table in TCAM. Is there any switch which does not use TCAM for fib and adjacency table?

Cisco high end routers also use TCAM to compile FIB and adjacency table. There are some routers which does use CEF to efficiently forward traffic but do not use TCAM. What are some examples of such routers?

Thanks and have a great day.

2 Accepted Solutions

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hello Sarah,

To my best knowledge and as far as I visualize the concept, the CAM/TCAM is used only for lookup keys storage - meaning that the CAM/TCAM does not store the entire information that is being looked up (i.e. the egress interface, the pre-built L2 header, etc.) but only the keys that are used to index and look up this information, i.e. MAC addresses or IP prefixes. Thus, the CAM/TCAM is a hardware embodiment of a search function but it does not contain the entire information. That information is stored either in DRAM or in some other specialized circuitry that is used to actually perform the datagram forwarding function.

So in my understanding, the TCAM in particular holds only IP prefixes. It does not store the adjacency table - rather, the lookup of an IP prefix in the TCAM produces a pointer to a particular entry in the adjacency table but that table is somewhere outside the TCAM.

Is there any switch which does not use TCAM for fib and adjacency table?

None that I am aware of. If TCAM is not used to store FIB then the lookup must be done in a different way, and if it is not done in hardware like TCAM, then I presume that the only other way would be to do the lookup in software, which diminishes the point of having a switch in the first place.

There are some routers which does use CEF to efficiently forward traffic  but do not use TCAM. What are some examples of such routers?

All software-based routers like x800 (i.e. 800, 1800, 2800, 3800) or x900 (i.e. 900, 1900, 2900, 3900) series - the ISR and ISR G2 are precisely examples of software-based routers that use a software trie instead of a TCAM to hold the FIB.

Best regards,

Peter

View solution in original post

Hello Sarah,

But if you look at the contents of FIB table, you will will ip prefix,  next hop and egress port. Out of them , only ip prefix will be stored in  TCAM. Is my understanding correct?

Yes, that is correct.

The show commands are not always guaranteed to show you only the information stored in one particular data structure. Their output may be extended using data from different structures - the main reason being clarity and readability of the shown information.

If my understanding is correct, where are the rest of contents of fib table i.e egress port and next hop are stored ?

These data, specifically, the egress port and L2 header rewrite information, are not a part of the FIB but rather of the adjacency table. As such, they are placed into the adjacency table.

I am not sure where the next hop IP address is placed - if at all. The next hop IP address is used only to identify the egress interface and to determine the corresponding next-hop L2 address. However, it is not used as an IP address itself. Therefore, I am not sure if the next hop IP address is truly stored in any of these two structures (FIB and adjacency) because you use the next hop IP address when you initialize the FIB/adjacency contents but not when you use them. This is a strongly implementation-specific issue.

Best regards,

Peter

View solution in original post

4 Replies 4

Peter Paluch
Cisco Employee
Cisco Employee

Hello Sarah,

To my best knowledge and as far as I visualize the concept, the CAM/TCAM is used only for lookup keys storage - meaning that the CAM/TCAM does not store the entire information that is being looked up (i.e. the egress interface, the pre-built L2 header, etc.) but only the keys that are used to index and look up this information, i.e. MAC addresses or IP prefixes. Thus, the CAM/TCAM is a hardware embodiment of a search function but it does not contain the entire information. That information is stored either in DRAM or in some other specialized circuitry that is used to actually perform the datagram forwarding function.

So in my understanding, the TCAM in particular holds only IP prefixes. It does not store the adjacency table - rather, the lookup of an IP prefix in the TCAM produces a pointer to a particular entry in the adjacency table but that table is somewhere outside the TCAM.

Is there any switch which does not use TCAM for fib and adjacency table?

None that I am aware of. If TCAM is not used to store FIB then the lookup must be done in a different way, and if it is not done in hardware like TCAM, then I presume that the only other way would be to do the lookup in software, which diminishes the point of having a switch in the first place.

There are some routers which does use CEF to efficiently forward traffic  but do not use TCAM. What are some examples of such routers?

All software-based routers like x800 (i.e. 800, 1800, 2800, 3800) or x900 (i.e. 900, 1900, 2900, 3900) series - the ISR and ISR G2 are precisely examples of software-based routers that use a software trie instead of a TCAM to hold the FIB.

Best regards,

Peter

Hi peter

Please consider the following output:

Router# show ip c 


Prefix              Next Hop            Interface

10.11.0.0/16        10.50.0.1           Ethernet1/3

Router# show adjacency

Protocol Interface                 Address
IP       Ethernet1/3          10.50.0.1(3045)


So in my understanding, the TCAM in particular holds only IP prefixes. It does not store the adjacency table - rather, the lookup of an IP prefix in the TCAM produces a pointer to a particular entry in the adjacency table but that table is somewhere outside the TCAM.

What ip prefix will TCAM  for the output shown above ? 
I understand adjacency table is stored somewhere outside TCAM. But if you look at the contents of FIB table, you will will ip prefix, next hop and egress port. Out of them , only ip prefix will be stored in TCAM. Is my understanding correct?
If my understanding is correct, where are the rest of contents of fib table i.e egress port and next hop are stored ?
thanks and have a great day.

Hello Sarah,

But if you look at the contents of FIB table, you will will ip prefix,  next hop and egress port. Out of them , only ip prefix will be stored in  TCAM. Is my understanding correct?

Yes, that is correct.

The show commands are not always guaranteed to show you only the information stored in one particular data structure. Their output may be extended using data from different structures - the main reason being clarity and readability of the shown information.

If my understanding is correct, where are the rest of contents of fib table i.e egress port and next hop are stored ?

These data, specifically, the egress port and L2 header rewrite information, are not a part of the FIB but rather of the adjacency table. As such, they are placed into the adjacency table.

I am not sure where the next hop IP address is placed - if at all. The next hop IP address is used only to identify the egress interface and to determine the corresponding next-hop L2 address. However, it is not used as an IP address itself. Therefore, I am not sure if the next hop IP address is truly stored in any of these two structures (FIB and adjacency) because you use the next hop IP address when you initialize the FIB/adjacency contents but not when you use them. This is a strongly implementation-specific issue.

Best regards,

Peter

Thanks Peter .

I apologize for the late response.

The next hop address is used to determine the egress port and mac address associated it;  adjacency table stores these information i.e egress port and mac address of next hop.

But when I read Cisco books, I found conflicting material. For example , here is quote from one of Cisco book:

To display adjacency table information, use the show adjacency command.

Example 9-5 Sample Use of the show adjacency Command

Router#show adjacency

Protocol Interface     Address

IP  GigabitEthernet3/16  10.20.248.202(11120)

Router#show adjacency detail

Protocol Interface     Address

IP  GigabitEthernet3/16  10.20.248.202(11120)

         0 packets, 0 bytes

         00D00178780A

         00D00624440A0800

         ARP  00:05:40

         Epoch: 0

The book says the contents of adjacency table are: next hop ( ip)  Mac address, egress port.


But then I remember you said:

The show commands are not always guaranteed to show you  only the information stored in one particular data structure. Their  output may be extended using data from different structures - the main  reason being clarity and readability of the shown information.



Is that the reason why we see next hop ( ip) in " show adjacency detail " output?

Thanks and have  a great weekend.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: