CEF, CAM, TCAM, FIB, RIB, and adjacency tables

1.6 Describe hardware and software switching mechanisms

📘CCNP Encore (350-401-ENCORE-v1.1)


1. Introduction to Switching Mechanisms (Exam View)

In Cisco networks, switching mechanisms decide how packets are forwarded from a source to a destination.

Cisco devices can forward packets using:

  • Software-based switching (CPU-based)
  • Hardware-based switching (ASIC-based)

For the CCNP ENCOR exam, you must understand:

  • What each table or mechanism does
  • Where it is used (router or switch)
  • Whether it works in software or hardware
  • How these components work together

2. Software Switching vs Hardware Switching

Software Switching

  • Packet processing is done by the CPU
  • Slower performance
  • Used mainly for:
    • Learning routes
    • Control plane decisions
    • Troubleshooting or exceptions

Hardware Switching

  • Packet processing is done by ASICs (special hardware chips)
  • Very fast
  • Used for:
    • Normal data forwarding
    • High-speed routing and switching

📌 Exam Key Point:
Modern Cisco devices always forward packets in hardware, but routing decisions are learned in software first.


3. RIB (Routing Information Base)

What is RIB?

The RIB is the main routing table stored in CPU memory (software).

Purpose of RIB

  • Stores all routes learned from:
    • Connected interfaces
    • Static routes
    • Routing protocols (OSPF, EIGRP, BGP, etc.)
  • Decides the best route using:
    • Administrative Distance
    • Routing metrics

Key Characteristics

FeatureDescription
LocationSoftware (RAM)
Used byCPU
ContainsAll known routes
FunctionRoute selection

📌 Important:
The RIB does NOT forward packets directly.


4. FIB (Forwarding Information Base)

What is FIB?

The FIB is a simplified and optimized copy of the RIB, created for fast packet forwarding.

Purpose of FIB

  • Used by the data plane
  • Contains only:
    • Best routes
    • Next-hop information
  • Optimized for quick lookups

Key Characteristics

FeatureDescription
LocationHardware (ASIC)
Built fromRIB
Used byCEF
FunctionPacket forwarding

📌 Exam Rule:
RIB = decision making
FIB = packet forwarding


5. CEF (Cisco Express Forwarding)

What is CEF?

Cisco Express Forwarding (CEF) is Cisco’s primary packet forwarding mechanism.

What CEF Does

  • Uses:
    • FIB
    • Adjacency Table
  • Forwards packets without using the CPU for each packet

Why CEF is Important

  • High performance
  • Predictable forwarding
  • Low CPU usage
  • Default on all modern Cisco devices

Key Characteristics

FeatureDescription
TypeHardware-based forwarding
UsesFIB + Adjacency Table
SpeedVery fast
StatusEnabled by default

📌 Exam Tip:
CEF is not a routing protocol.
CEF is a forwarding mechanism.


6. Adjacency Table

What is an Adjacency Table?

The Adjacency Table stores Layer 2 rewrite information needed to forward packets.

What Information It Contains

  • Next-hop MAC address
  • Outgoing interface
  • Encapsulation type (Ethernet, etc.)

Purpose

  • Converts Layer 3 routing decisions into Layer 2 forwarding actions

Key Characteristics

FeatureDescription
Used byCEF
StoresMAC & interface info
Built usingARP (IPv4) / ND (IPv6)
LocationHardware

📌 Exam Key Concept:
FIB tells where to send the packet
Adjacency table tells how to send it


7. CAM Table (Content Addressable Memory)

What is CAM?

The CAM table is used by Layer 2 switches.

Purpose of CAM Table

  • Maps:
    • MAC address → Switch port
  • Used to make switching decisions

Key Characteristics

FeatureDescription
Used onSwitches
LayerLayer 2
StoresMAC addresses
Memory typeHardware

📌 Exam Rule:
CAM is for switching, not routing.


8. TCAM (Ternary Content Addressable Memory)

What is TCAM?

TCAM is a special type of memory that supports:

  • 0
  • 1
  • “Don’t care” (X)

Purpose of TCAM

Used for complex and fast lookups, such as:

  • Access Control Lists (ACLs)
  • Quality of Service (QoS)
  • Policy-Based Routing (PBR)
  • Route lookups with masks

Key Characteristics

FeatureDescription
Used bySwitches and routers
LayerLayer 3 & 4
SupportsWildcards
SpeedExtremely fast

📌 Exam Tip:
TCAM is used when multiple conditions must be checked at once.


9. Relationship Between All Components (Very Important)

Step-by-Step Packet Flow (Simplified)

  1. Routing Protocols populate the RIB
  2. Best routes from RIB are copied to the FIB
  3. CEF uses:
    • FIB for next-hop decision
    • Adjacency table for Layer 2 rewrite
  4. Packet is forwarded in hardware
  5. Switches use:
    • CAM for MAC lookup
    • TCAM for ACLs and policies

10. Summary Table (High-Value Exam Content)

ComponentUsed OnLayerPurposeSoftware / Hardware
RIBRouterL3Stores all routesSoftware
FIBRouterL3Fast forwarding tableHardware
CEFRouterL3Packet forwarding engineHardware
Adjacency TableRouterL2MAC rewrite infoHardware
CAMSwitchL2MAC-to-port mappingHardware
TCAMSwitch/RouterL3/L4ACLs, QoS, policiesHardware

11. Exam-Focused Key Takeaways

  • RIB selects routes, FIB forwards packets
  • CEF is the default forwarding method
  • Adjacency table handles Layer 2 details
  • CAM = Layer 2 switching
  • TCAM = complex matching (ACLs, QoS)
  • Packet forwarding is hardware-based
  • Control plane decisions are software-based

12. Final Exam Tip

If the question asks:

  • “Where are routes learned?” → RIB
  • “Where are packets forwarded?” → FIB + CEF
  • “Which table stores MAC addresses?” → CAM
  • “Which memory supports wildcard matching?” → TCAM

Buy Me a Coffee