Configuring CEF

A Cisco proprietary switching mechanism, CEF is extremely fast and efficient. CEF is an advanced Layer 3 switching technology that optimizes the performance and stability of networks with large, dynamic traffic patterns. CEF switching is less CPU intensive than process switching or fast switching, allowing more CPU time to be allocated to services and applications.

CEF can be run in central mode or distributed mode. In central mode, only one instance of CEF is running on the router. Distributed mode CEF (called dCEF) is designed to run on high-end routers. This allows each blade in a router to run its own instance of CEF and maintain its own switching cache. This allows the ability for some percentage of traffic to be same-blade switched if source and destination interfaces are on the same blade.

As discussed in previous chapters, the FIB is a mirror copy of the routing table, containing all known routing prefixes from the routing table. CEF uses the FIB rather than a route cache to eliminate cache maintenance and fast/process switching of packets.

The FIB and adjacency tables provide the operational base for CEF. CEF uses the FIB to make IP destination switching decisions. The adjacency table keeps a database of Layer 2 information, including Layer 2 next-hop information. CEF uses the adjacency table to prepend Layer 2 information to outbound traffic. This avoids any need for Address Resolution Protocol (ARP) or other Layer 2/3 resolution processes.

CEF is enabled at the global configuration command prompt in the router. The command is as follows:

BM2851(config)#ip cef

Optionally, the command can be entered to enable CEF for distributed mode by entering

BM2851(config)#ip cef distributed

Distributed mode CEF should be used only when the router's line cards are capable of performing express forwarding. This allows the route processor (RP) on the blade to handle the switching functions.

To enable CEF operation on a particular interface, use the following command:

BM2851(config-if)#ip route-cache cef

There are no configuration options for this command. This is useful simply because the enabling of CEF in global configuration mode enables CEF on all CEF-capable interfaces. To disable CEF on interfaces where it is not desired or needed, issue the no form of the command.

Additional options available for CEF configuration include the following:

■ CEF load balancing—Can be configured for per-destination or per-packet load balancing.

■ CEF network accounting—Allows collecting of traffic statistics such as packets and bytes switched to a particular prefix.

■ CEF distributed tunnel switching—Enabled automatically with CEF, this option allows the switching of tunnels such as GRE tunnels. This option is not configurable.

To monitor and view CEF statistics, you can use the show ip cef command; to view more detailed information, enter the detail keyword. Example 10-1 displays the resulting output from the show ip cef detail command.

Example 10-1 show ip cef detail Command Output BM2851#show ip cef detail

IP CEF with switching (Table Version 21), flags=0x0

16 routes, 0 reresolve, 0 unresolved (0 old, 0 new), peak 0 16 leaves, 24 nodes, 27392 bytes, 29 inserts, 13 invalidations 0 load sharing elements, 0 bytes, 0 references universal per-destination load sharing algorithm, id CB41AB75 3(0) CEF resets, 0 revisions of existing leaves Resolution Timer: Exponential (currently 1s, peak 1s) 0 in-place/0 aborted modifications refcounts: 6433 leaf, 6400 node

Table epoch: 0 (16 entries at this epoch)

Adjacency Table has 2 adjacencies

0.0.0.0/0, version 0, epoch 0, attached, default route handler 0 packets, 0 bytes via 0.0.0.0, 0 dependencies valid no route adjacency 0.0.0.0/32, version 1, epoch 0, receive 1.1.1.1/32, version 18, epoch 0, connected, receive tag information set local tag: implicit-null 2.2.2.2/32, version 19, epoch 0, connected, receive tag information set local tag: implicit-null 3.3.3.3/32, version 20, epoch 0, connected, receive tag information set local tag: implicit-null 10.10.1.0/24, version 13, epoch 0, attached, connected 0 packets, 0 bytes tag information set local tag: implicit-null

Example 10-1 show ip cef detail Command Output (Continued)

via GigabitEthernet0/1, 0 dependencies valid glean adjacency 10.10.1.0/32, version 11, epoch 0, receive 10.10.1.1/32, version 10, epoch 0, receive

10.10.1.2/32, version 14, epoch 0, connected, cached adjacency 10.10.1.2 0 packets, 0 bytes via 10.10.1.2, GigabitEthernet0/1, 0 dependencies next hop 10.10.1.2, GigabitEthernet0/1 valid cached adjacency 10.10.1.255/32, version 12, epoch 0, receive

172.16.0.0/16, version 15, epoch 0, cached adjacency 10.10.1.2 0 packets, 0 bytes tag information set local tag: 16 via 10.10.1.2, GigabitEthernet0/1, 0 dependencies next hop 10.10.1.2, GigabitEthernet0/1 valid cached adjacency tag rewrite with Gi0/1, 10.10.1.2, tags imposed: {} 192.168.1.0/24, version 16, epoch 0, cached adjacency 10.10.1.2 0 packets, 0 bytes tag information set local tag: 17 via 10.10.1.2, GigabitEthernet0/1, 0 dependencies next hop 10.10.1.2, GigabitEthernet0/1 valid cached adjacency tag rewrite with Gi0/1, 10.10.1.2, tags imposed: {} 192.168.1.2/32, version 17, epoch 0, cached adjacency 10.10.1.2 0 packets, 0 bytes tag information set local tag: 18 via 10.10.1.2, GigabitEthernet0/1, 0 dependencies next hop 10.10.1.2, GigabitEthernet0/1 valid cached adjacency tag rewrite with Gi0/1, 10.10.1.2, tags imposed: {} 224.0.0.0/4, version 7, epoch 0 0 packets, 0 bytes via 0.0.0.0, 0 dependencies next hop 0.0.0.0 valid drop adjacency 224.0.0.0/24, version 3, epoch 0, receive 255.255.255.255/32, version 2, epoch 0, receive BM2851#

The show ip cef detail command displays summary information residing in the FIB. Each known prefix is represented along with next-hop information. Table 10-2 lists other possible parameters of the show ip cef command.

Table 10-2 show ip cef Command Parameters

Parameter

Description

unresolved

Displays unresolved FIB entries

summary

Displays a FIB summary

adjacency

Displays FIB entries known via a particular interface and next-hop address

A.B.C.D

Displays a FIB entry for a specific destination network

A.B.C.D A.B.C.D

Displays a FIB entry for a specific destination network and mask

longer-prefixes

Displays a FIB entry for all specified destinations

detail

Displays detailed FIB information

type number

Displays interface-specific FIB entries

Among the many commands available to monitor the CEF processes, a few other important ones are added here to provide a more complete picture.

There are times when the network becomes unstable or a single router finds itself in duress and unable to properly maintain the juggling act imposed upon it. In such circumstances, commands such as clear adjacency, clear ip cef inconsistency, and clear cef interface will become the friend of the network administrator. In monitoring real-time events of CEF on a particular router, debug ip cef and debug ip cef events are useful commands.

Was this article helpful?

0 0

Post a comment