Demand-based switching is also referred to as flow-based switching and is a legacy method of implementing MLS in Cisco Catalyst switches. In Unicast transmission, a flow is a unidirectional sequence of packets between a particular source and destination that share the same protocol and Transport Layer information.
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. Demand-based switching requires the following components:
- Multilayer Switching Engine (MLS-SE)
- Multilayer Switching Route Processor (MLS-RP)
- Multilayer Switching Protocol (MLSP)
The MLS-SE is responsible for the packet switching and rewrite functions in ASICs. The MLS-SE is also capable of identifying Layer 3 flows. The MLS-SE represents the data plane and is responsible for determining the next hop and egress interface information for each frame received that requires routing, and then rewriting the frame as required and forwarding the frame to the correct egress interface.
The MLS-RP informs the MLS-SE of MLS configuration, and runs routing protocols, which are used for route calculation. The MLS-RP represents the control plane and maintains the route table, and is responsible for updating the route table as changes in the network topology occur.
The MLSP is a Multicast protocol that is used by the MLS-RP to communicate information, such as routing changes, to the MLS-SE, which then uses that information to reprogram the hardware dynamically with the current Layer 3 routing information. This is what allows for faster packet processing. Figure 7-6 below illustrates the operation of demand-based or flow-based switching:
Fig. 7-6. Demand-Based or Flow-Based Switching Operation
The following sequence of steps is in reference to the diagram illustrated in Figure 7-6.
-
The MLS-SE (PFC) receives a candidate packet for a new flow. This packet is forwarded to the MLS-RP (MSFC) for a route lookup and is processed in software
-
The MLS-RP (MSFC) determines the destination of the packet and forwards it, via the MLS-SE (PFC) to the correct destination. This is referred to as the enabler packet
-
Given that both the candidate packet and the enabler packet have passed through the MLS-SE (PFC), the next packet in the flow is not sent to the MLS-RP (MSFC) but is instead switched in hardware using ASICs. It is important that both the candidate and the enabler packets for a single flow pass through the same switch; otherwise, flow-based switching will not be used. The same is applicable to all new flows that traverse the switch.
With the introduction of the Supervisor 720 engine, flow-based switching is considered a legacy MLS method. This method of MLS has been replaced by topology-based (CEF-based) MLS.