CEF (Cisco Express Forwarding)

CAM: High speed memory that is primarily used for a switch’s layer 2 lookup information. This information allows the switch to decide which port to send a packet to (a known MAC address) or whether to flood it to all ports (unknown MAC address).

TCAM: Not all switches have this. Think of this as an extension of CAM. It is used for very rapid decisions on ACLs and Quality of Service. On high end layer 3 switches, the TCAM can also contain the FIB, again, so specialized hardware can making routing decisions without interrupting the central CPU of the switch.

FIB: When you think of the FIB vs the RIB, or routing table, the difference is where they “live” on the hardware. The RIB lives in the control plane, while FIB lives in the data plane. Any decisions made at the FIB level are fast and do not require an interrupt (and therefore time) from the device itself.

So the CAM/TCAM and FIB aren’t directly related other than the FIB may or may not be held in the TCAM depending on your switch model.

So, in the example of a packet traveling from source to destination, if a packet’s destination is on a remote subnet, the packet’s destination MAC would be set to the gateway’s MAC. The switch would use the CAM to determine in which port the gateway resides, and it would send it there. Depending on the model hardware involved, the layer3 switch or router would use the FIB to decide what the next hop needs to be (and since the FIB might be in the TCAM–again depending on the model–the TCAM might be used in this process). This would continue until the packet arrives at the destination subnet, where the final switch would again use the CAM table to determine the destination’s MAC and corresponding port.

7 Likes