networks. Cisco IOS platforms have the capability to overcome the slow performance of process switching. The platforms support several switching mechanisms that use a cache to store the most recently used destinations. A cache uses a faster searching mechanism than process switching does while storing the entire Layer 2 frame header to improve the encapsulation performance. In cache-driven switching, an entry is created in the cache when the first packet whose destination is not found in the fast-switching cache is process switched. The subsequent packets are switched in the interrupt code; this is how the cache improves performance. The most recent and preferred Cisco IOS platform switching mechanism is CEF, which incorporates the best of the previous switching mechanisms. One of the benefits of CEF is that this mechanism supports per-packet load balancing, which was previously supported only by process switching. CEF also supports per-source or per-destination load balancing, fast destination lookup, and many other features that are not supported by other switching mechanisms. CEF uses a Forwarding Information Base (FIB) to make IP destination prefix-based switching decisions. The FIB is conceptually similar to a routing table or information base. It maintains a mirror image of the forwarding information contained in the IP routing table. When routing or topology changes occur in the network, the IP routing table is updated, and those changes are reflected in the FIB. The FIB maintains next-hop address information based on the information in the IP routing table. Because there is a one-to-one correlation between FIB entries and routing table entries, the FIB contains all known routes and eliminates the need for route cache maintenance that is associated with switching paths such as fast switching and optimum switching. Using Standard IP Switching
Figure illustrates a specific sequence of events for process switching and fast switching for destinations that were learned through Border Gateway Protocol (BGP). Three events occur for both process switching and fast switching: Step 1 When a BGP update is received and processed in the BGP table, if the update is selected as the best route, an entry is created in the routing table. Step 2 When the first packet arrives for this destination, the router tries to find the destination in the fast-switching cache. Because the destination is not in the fast-switching cache, process switching has to switch the packet and a recursive lookup is performed to find the outgoing interface. If the Layer 2 address is not found in the cache, an Address Resolution Protocol (ARP) request is triggered. In this example, if the destination is in network 10.0.0.0/8, according to the BGP, the next hop to reach that network is 172.16.3.4. To reach network 172.16.3.0/24, the outgoing interface is Ethernet 0. Once the pathway is found, an entry is created in the fast-switching cache. Step 3 All subsequent packets for the same destination are fast switched according to a three-step procedure: When a router receives a packet that should be fast switched but the packet destination is not in the switching cache, the packet is process switched instead. To ensure that the subsequent packets for the same destination prefix will be fast switched, a full routing table lookup is performed and an entry is created in the fast switching cache. CEF Switching Architecture
CEF uses an architecture that is different from process switching or any other cache-based switching mechanism. The Figure illustrates CEF switching. CEF uses a complete IP switching table and the FIB table. The FIB table holds the same information that the IP routing table holds. The generation of entries in the FIB table is not packet-triggered but change-triggered. When something changes in the IP routing table, the change is also reflected in the FIB table. Because the FIB contains the complete IP switching table, the router can make definitive decisions based on the information in the FIB table. Whenever a router receives a packet that should be CEF-switched but the destination is not in the FIB, the packet is dropped. The FIB table is also different from other fast-switching caches. This table does not contain information about the outgoing interface and the corresponding Layer 2 header. That information is stored in a separate table called the Adjacency Table. The Adjacency Table provides a copy of the ARP cache, but instead of holding only the destination MAC address, the table holds the Layer 2 header. CEF is the most recent and preferred Cisco IOS platform-switching mechanism. The next topic gives more details about the MPLS architecture. Note
If the router carries full Internet routing of more than 100,000 networks, enabling the CEF can consume excessive memory. Enabling the distributed CEF also affects memory use on the Versatile Interface Processor (VIP) modules or line cards because the entire FIB table will be copied to all VIP modules or line cards.
Content 4.1 Introducing MPLS Networks 4.1.3 MPLS Basics Figure illustrates a simple IP network using MPLS. In a standard IP network, Router R1 and R4 are edge routers, R2 and R3 are core routers. Core routers communicate with the external world through the edge routers. To use MPLS on this network, the core routers become label switching routers (LSRs) and edge routers become Edge LSRs. When the LSR receives an MPLS packet, the router inspects the packet to extract the information that the LSR needs to efficiently forward to the next hop within the MPLS network. This information is in the label. In the network shown in Figure , the frame generated by Station A follows the standard Ethernet format with a normal Layer 2 header followed by a Layer 3 header. Because the destination address resides in a different network, Station A targets the Layer 2 header to the station’s default gateway. In this case, the default gateway also serves as the Edge LSR (ingress side). The ingress LSR references the router’s internal switch table (the Label Forwarding Information Base [LFIB] table) and determines that the LSR needs to forward the frame toward the next LSR. The ingress LSR must then insert a label between the Layer 2 and Layer 3 headers to indicate what path the frame should travel on the way to Station B. Router 2 looks at the frame entering the port and determines that there is a label embedded between Layers 2 and 3. Therefore, the router treats the frame according to the configuration in the router LFIB, which says to forward the frame out Port 2 and replace the label with a new value. Each of the subsequent routers handles the frame in a similar manner until the frame reaches the egress LSR. The egress Edge LSR strips off all label information and passes a standard frame to Station B. Because each of the routers between Stations A and B can switch the frame based on the content in the LFIB and do not need to perform the usual routing operation, the frame is handled more quickly than the frame would be handled with other switching methods. Figure summarizes the characteristics of MPLS. MPLS works on any media and Layer 2 encapsulation. Most Layer 2 encapsulations are frame-based, and MPLS simply inserts or imposes a 32-bit label between the Layer 2 and Layer 3 headers (frame mode MPLS). ATM