Multilayer Switching (MLS) combines Layer 2, Layer 3, and Layer 4 switching technologies to forward packets at wire speed using hardware. Cisco supports MLS for both Unicast and Multicast traffic flows. In Unicast transmission, a flow is a unidirectional sequence of packets between a source and destination pair that shares the same protocol and Transport Layer information. These flows are based only on Layer 3 address information. In Multicast transmission, a flow is a unidirectional sequence of packets between a Multicast source and the members of a destination Multicast group. Multicast flows are based on the IP address of the source device and the destination IP Multicast group address.
In MLS switching, a Layer 3 switching table, referred to as an MLS cache, is maintained for the Layer 3-switched flows. The MLS cache maintains flow information for all active flows and includes entries for traffic statistics that are updated in tandem with the switching of packets. After the MLS cache is created, any packets identified as belonging to an existing flow can be Layer 3-switched based on the cached information.
MLS integrates both data plane and control plane functions. These two planes are responsible for the building of routing tables and the actual forwarding of packets. The control plane is where routing information, routing protocol updates, and other control information, is stored and exchanged. Using routing protocols, the control plane is responsible for updating the routing table as changes in the network topology occur. The data plane is responsible for the actual forwarding of data. The data plane is typically populated using information derived from the control plane. This plane is used to determine the physical next hop egress interface for received packets or frames and then forwards the packets or frames using the correct egress interface.
MLS is enabled by configuring Cisco Express Forwarding (CEF) on the switch. CEF operates at the data plane and is a topology-driven proprietary switching mechanism that creates a forwarding table that is tied to the routing table, i.e. the control plane. CEF was developed to eliminate the performance penalty experienced due to the first-packet process-switched lookup method used by flow based switching.
CEF eliminates this by allowing the route cache used by the hardware-based Layer 3 routing engine to contain all the necessary information to Layer 3 switch in hardware beforeany packets associated with a flow are even received. Information that is conventionally stored in a route cache is stored in two data structures for CEF switching. These data structures provide optimized lookup for efficient packet forwarding and are referred to as the Forwarding Information Base (FIB) and Adjacency Table. These are described in the following section.
CEF uses a 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. In other words, the FIB contains all IP prefixes from the routing table. When routing or topology changes occur in the network, the IP routing table is updated, and those changes are also 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.
Additionally, because the Forwarding Information Base (FIB) lookup table contains all known routes that exist in the routing table, it eliminates route cache maintenance and the fast switching and process switching forwarding scenarios. This allows CEF to switch traffic more efficiently than typical demand caching schemes.
The adjacency table is created to contain all connected next hops. An adjacent node is a node that is one hop away, i.e. directly connected. The adjacency table is populated as adjacencies are discovered. As soon as a neighbor becomes adjacent, a Data Link Layer header, called a MAC string or MAC rewrite, which will be used to reach that neighbor is created and stored in the table. On Ethernet segments, the header information is the destination MAC address, the source MAC address, and the EtherType, in that specific order.
As soon as a route is resolved, it points to an adjacent next hop. If an adjacency is found in the adjacency table, a pointer to the appropriate adjacency is cached in the FIB element. If multiple paths exist for the same destination, a pointer to each adjacency is added to the load-sharing structure, which allows for load-balancing. When prefixes are added to the FIB, prefixes that require exception handling are cached with special adjacencies. These components, and their interaction, are illustrated in Figure 3-1.
Fig. 3-1. Cisco Express Forwarding Operation
Enabling CEF requires the use of a single command, which is the ip cef [distributed] global configuration command. The [distributed] keyword is only applicable to high-end switches, such as the Catalyst 6500 series switches, that support Distributed CEF. MSFC and PFCs are explained later in this chapter.
