Cisco Express Forwarding and Layer 2 to Layer 3

2010-04-04 14:21:36

Cisco Express Forwarding (CEF)
The two main components of CEF are the forwarding information base (FIB) and the adjacency table. IP routing table is maintained by a router’s control plane. CEF operates in the data plane.

  • Forwarding Information Base (FIB) — Conceptually similar to a routing table, however, it is structured in a format that is optimized for forwarding. It is even updated when changes occur in the network and there is a one-to-one correlation between FIB entries and routing table entries.
  • Adjacency Table — Maintains layer 2 next-hop addresses for all FIB entries. Adjacencies can be added manually or discovered through protocols such as ARP or OSPF.
  • sh ip cef
    Shows layer 3 forwarding information. Version is the version of the table and epoch is the number of times the table has been rebuilt.

    R1#sh ip cef, version 42, epoch 0, receive

    clear ip cef epoch
    Here you can see that I rebuild the CEF table and increase the epoch count.

    R1#sh ip cef, version 42, epoch 0, receive
    R1#clear ip cef epoch
    R1#sh ip cef, version 42, epoch 1, receive

    sh ip cef longer-prefixes
    Attached, obviously the subnet is attached to this router. Receive, the router listens on that subnet or address.

    R1#sh ip cef longer-prefixes 
    Prefix              Next Hop             Interface         attached             Serial0/0/0.12         receive         receive         receive             Serial0/0/0.12             Serial0/0/0.12             Serial0/0/0.12             Serial0/0/0.12             Serial0/0/0.12             Serial0/0/0.12             Serial0/0/0.12

    sh adjacency
    Verifies an adjacency exists for a connected host.

    R1#sh adjacency 
    Protocol Interface                 Address
    IP       Serial0/0/0.12            point2point(19)
    IPV6     Serial0/0/0.12            point2point(10)
    IP       Serial0/1/0.15            point2point(7)

    Troubleshooting Layer 2 to Layer 3 Mapping
    sh ip arp — Shows the ARP cache of the router, by default stores them for four hours. IT is the MAC address to IP address mapping.
    sh frame-relay map — Displays the Frame Relay DLCIs and their next hop ip address.
    sh adjacency detail — Displays information from a router CEF adjacency table.

    sh ip arp

    R4#sh ip arp
    Protocol  Address          Age (min)  Hardware Addr   Type   Interface
    Internet             207   0018.1825.2543  ARPA   FastEthernet0/1
    Internet                -   001b.d421.480b  ARPA   FastEthernet0/1
    Internet               41   0012.d9a5.1542  ARPA   FastEthernet0/0
    Internet                -   001b.d421.480a  ARPA   FastEthernet0/0

    sh frame-relay map

    R1#sh frame-relay map
    Serial0/0/0.12 (up): point-to-point dlci, dlci 102(0x66,0x1860), broadcast
              status defined, active
    Serial0/1/0.15 (up): point-to-point dlci, dlci 105(0x69,0x1890), broadcast
              status defined, active

    sh adjacency detail

    R1#sh adjacency detail 
    Protocol Interface                 Address
    IP       Serial0/0/0.12            point2point(19)
                                       25 packets, 1940 bytes
                                       CEF   expires: 00:02:35
                                       	 refresh: 00:00:35
                                       Epoch: 0
    IPV6     Serial0/0/0.12            point2point(10)
                                       0 packets, 0 bytes
                                       IPv6 CEF   never     
                                       Epoch: 0
    IP       Serial0/1/0.15            point2point(7)
                                       32 packets, 3955 bytes
                                       CEF   expires: 00:02:26
                                       	 refresh: 00:00:26
                                       Epoch: 0

    CEF Overview

    This entry was posted in Routing. Bookmark the permalink.

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s