CCNP BCMSN Exam Cram 2 (Exam Cram 642-811)
Cisco's switches support many types of MLS. However, Cisco's current crop of high-end switches, including the 3550, the 4000s, and the 6500, use CEF. A Layer 3 switching engine (sometimes referred to as the main processor) handles the control functions, such as building and maintaining the FIB, and pushes table information down to the line cards or ports, where data ASICs use this information to perform switching decisions in hardware. It's important to point out that CEF is used for hardware switching of unicast frames not broadcasts.
CEF Limitations
There are situations where switching decisions must be performed in software by the main processor. If your CEF switch sees any of the following traffic, the main processor is interrupted to handle it:
CEF Tables
CEF uses three tables to make its switching decisions: FIB, adjacency, and TCAM (commonly called CEF) tables. The FIB is built from the MLS switch's routing table and is sorted to optimize searches. The FIB table lookup for a destination is based on finding the longest matching prefix for the destination Layer 3 (IP) address. The FIB table is updated whenever one of the following three things occurs:
The adjacency table is built from the MLS switch's ARP table. This table contains Layer 2 information of neighbor's MAC addresses that will help the MLS switch rewrite Ethernet frames. The adjacency table is stored in double-data-rate DRAM. If the adjacency table becomes full, neighbors not listed in the adjacency table will have packets switched by the main processor whenever packets are sent to these neighbors (that is, they'll be software switched). The CEF table contains IP destination prefixes that are sorted from the most specific to least specific to speed up searches. To provide for accurate tracking of statistics, the CEF table contains a separate entry for each adjacency. If the CEF table becomes full, a special entry, called a wildcard entry, is used to redirect switching decisions to the main processor (or ASIC), where switching occurs in software. CEF Operation
The operation of CEF is similar to the process described earlier in the "MLS Implementation" and "Rewriting Frame and Packet Contents" sections. This section covers the operation of CEF as it relates to multilayer switching. Three basic steps occur during CEF's operation:
Of course, CEF's process is not as simple as the preceding three steps. Before any user frames are handled by CEF, the MLS switch first needs a MAC address that will represent itself when sending rewritten frames to a destination. The Layer 3 engine on the MLS switch assigns this MAC address from the chassis' MAC address range and this address is used by all VLANs remember that a MAC address has to be unique only in a broadcast domain (VLAN). Anytime frames are rewritten, the MLS switch will use this MAC address as the source MAC address in the frame. Second, the MLS switch will install wildcard entries in its CEF table, which are for when a lookup occurs and connection information is not found. Basically, this tells the data ASICs that to switch the frame, the Layer 3 forwarding engine will have to handle the task (at a much slower rate). Third, the Layer 3 forwarding engine will notify each interface that has been set up for CEF, as well as any CEF-specific features for that interface. Only interfaces enabled with CEF can have data ASICs (the ones on interfaces or line cards) perform the rewriting of frames. The MLS switch then sends the Layer 2 CAM table to the Layer 3 forwarding engine, which is used to build the CEF table. Once traffic begins to cross VLAN boundaries, the MLS process begins. For each initial packet from a source to a specific destination, called a flow, the data ASICs must have the Layer 3 forwarding engine handle the switching of the frame. The Layer 3 forwarding engine will then populate the CEF and adjacency tables and forward the frame. At this point, any flow from the same source to the same destination can be rewritten by the data ASIC for the inbound port. Load Balancing
MLS with CEF supports per-flow load balancing (sharing). Load balancing can be done on both an equal or unequal cost basis to a destination. For example, if your MLS switch's routing table has three paths to a destination, CEF can use all three paths in load balancing. CEF's FIB can contain up to six pointers to entries in the adjacency table for load balancing. When load balancing, the MLS switch takes the source and destination IP addresses, as well as the transport layer source and destination port numbers, and runs them through a hash function. The result of this function is used to pick one of the multiple paths to the destination. As you can see from this function, this is more of a flow load balancing process. In other words, load balancing is not done on a packet-by-packet basis. Load sharing becomes more distributed as traffic from different sources and applications is sent to a single destination. Also, load sharing is automatically enabled when you configure IP routing on the Layer 3 forwarding engine.
CEF Example
To illustrate this process in a little more depth, let's take a look at an example. I'll use the network shown in Figure 6.3. In this example:
Figure 6.3. CEF example.
CEF Configuration
One of the great features of configuring CEF is that the Catalyst switches that support it already assume that you'll be using it. Therefore, CEF is enabled by default. On the Catalyst 6500 with the Supervisor Engine II, CEF cannot be disabled if you have any of the following cards: Policy Feature Card 2 (PFC2), Multilayer Switch Feature Card 2 (MSFC2), or the Distributed Feature Card 2 (DFC2). With the Catalyst 4000, you can disable CEF with the no ip cef command at Global Configuration mode this disables CEF on the entire switch. You can also use this command to disable CEF on an interface by first going into the interface and then executing this command. With the Catalyst 3550, you can disable CEF with the no ip route-cache cef command at Global Configuration mode this disables CEF on the entire switch. You can also use this command to disable CEF on an interface by first going into the interface and then executing this command.
CEF Verification
After you've enabled CEF, there are a handful of show commands that you can use to examine its operation. To display general statistics about Layer 3 traffic switched in hardware, use this command: Switch> show interfaces type slot_#/port_# | begin L3 Here's an example of the output of this command: Switch> show interface fastethernet 3/1 | begin L3 L3 in Switched: ucast: 0 pkt, 0 bytes - mcast: 13 pkt, 760 bytes mcast L3 out Switched: ucast: 0 pkt, 0 bytes - mcast: 0 pkt, 0 bytes 4012302 packets input, 350170138 bytes, 0 no buffer Received 3385211 broadcasts, 2 runts, 0 giants, 0 throttles ...output omitted... To display CEF entries in the FIB table, use the show ip cef command. Here's an example of the use of this command: Switch> show ip cef ethernet 0/1 detail IP Distributed CEF with switching (Table Version 2338), flags=0x0 1380 routes, 0 reresolve, 0 unresolved (0 old, 0 new) 1380 leaves, 198 nodes, 370422 bytes, 2162 inserts, 942 invalidations 0 load sharing elements, 0 bytes, 0 references universal per-destination load sharing algorithm, id 9B6C8123 2 CEF resets, 0 revisions of existing leaves refcounts: 54376 leaf, 51514 node 192.168.2.2/32 version 1987, cached adjacency 192.168.2.2 0 packets, 0 bytes, adjacency-prefix via 192.168.2.2 Ethernet0/1, 0 dependencies next hop 192.168.2.2, Ethernet0/1 ...output omitted... The detail parameter lists all FIB information for all FIB entries. To see the adjacency table, use the show adjacency command. These statistics are updated every 60 seconds. Here's an example of this command with the detail parameter: Switch> show adjacency detail Protocol Interface Address IP FastEthernet3/3 192.168.2.2(3045) 0 packets, 0 bytes 000000000FF9200003 00605C865B2800D0BB ARP 02:48:09 IP FastEthernet3/3 192.168.2.3(11) 0 packets, 0 bytes 000000000FF9200003 00801C93804000D0BB ARP 02:48:03 In addition to listing the next-hop address for the adjacency, other types of adjacencies can appear, as shown in Table 6.2.
CEF Troubleshooting
If you're experiencing problems with CEF, you can use debug and ping commands to troubleshoot the problem. Use this command to perform detailed troubleshooting of CEF: Switch# debug ip cef drops|receive|events|prefix-ipc|table| ipc|interface-ipc Table 6.3 explains the different parameters for this command.
Optionally, you can add an ACL to the debug command to limit the amount of output you see in your terminal session. You can also use Cisco's extended ping command. This command is executed by itself at Privilege EXEC mode, and it prompts you for all the ICMP information for IP. One nice feature is that you can change the source IP address that will be used with the ping. This is normally the IP address of the exit interface of the IOS device, but you can change it to any IP address on the IOS device. This is useful for advanced testing of the reachability of a device. |