Switching in 7000, 7500, 4000, 3000, and 2500 Series Routers
This section discusses the switching options and their initialization on different router models. As you will notice, most of the methods are performing the same task, but some are faster than others due to highly specialized internal techniques and microchips.
It is important to know that all the switching features, except fast switching, need to be turned on manually. Enabling a specific type of switching is an interface configuration task and must be done for each protocol individually. Of course the type of switching that is available is dependent upon the router.
Switching in 7000 Series Routers
The 7000 series routers, similar to other Cisco routers, have a fast switching option that is enabled by default. Fast switching is performed using a Fast Switch Cache in the Route Processor. Two major components that participate in the routing and switching operations are RP (Route Processor) and SSP (Silicon Switch Processor). The early models of the 7000 series had RP and SP (Switch Processor). The SP (in the earlier models) only had an Autonomous Switch Cache. The SSP was introduced later and is equipped with both an Autonomous Switch Cache and a Silicon Switch Cache (see Figure 4-1). Autonomous and silicon switching are not enabled by default. The administrator of a router may enable either or both of these switching options on a per-protocol basis at each interface. The commands for enabling and disabling fast switching, autonomous switching, and silicon switching are:
Router(config-if)# [no] [protocol] route-cache
Router(config-if)# [no] [protocol] route-cache cbus
Router(config-if)# [no] [protocol] route-cache sse
You must specify a protocol name, such as ip or ipx.
Assume that fast switching, autonomous switching, and silicon switching are all enabled on all of the interfaces of a router (call it R1) for all protocols, including IP. Now, for the sake of the example, take a look at the sequence of tasks and operations executed by R1 to process some packets (call them P1, P2, and so on) entering into the router via its ethernet 0 interface. When the frame carrying P1 is accepted by the ethernet 0 interface (E0 of R1), the header (layer 2 frame) is discarded and the encapsulated packet (P1) is kept in the interface buffer.
The E0 interface must wait its turn to get a chance to send P1 through the router's bus (CxBus in the case of 7000 series routers operating at 533Mbps) to the SSP. When P1 arrives at the SSP, it is stored in a buffer, and then its destination address is first checked against the entries in the Silicon Switch Cache (to find a match).
Since P1 is the first packet from the sequence of packets with the same destination (P1, P2, and so on), there won't be a match in the SSP's Silicon Switch Cache for P1. There will be no entries matching P1's destination address in the Autonomous Switch Cache, either.
Figure 4-1 Routing and Switching in 7000 Routers
Next, P1's header is moved through a system bus (operating at only 153 Mbps) to the Route Processor for a quick search and match against the entries in the Fast Switch Cache (residing in the RP). Again, there won't be a match. Now the entire packet (not only the packet header) must be moved from the SSP to the RP, stored in a buffer, and in turn be looked after by the routing process. Hence, the entire P1 packet waits its turn in a buffer (within RP's memory) until the routing process gets a chance to administer it.
The routing process uses the destination address of P1 and the content of its routing table to select the best (if any) interface to send P1 out from. Say TokenRing 0 is selected. Of course an appropriate frame must be created for P1 to be encapsulated into, before it is sent to the TokenRing 0 interface (To0) and ultimately out to the wire. Once these tasks (perhaps including ARP) are completed, the router sends the P1 packet (encapsulated in a Token Ring frame) from the RP to the SSP and then to the T0 interface.
The knowledge gained from processing the P1 packet is saved in the router's switching caches, to be used for processing P2, P3, and so on. Assuming that all switching options are enabled, P1's destination addressthe network component of it, to be accuratealong with the destination interface (number), are stored in the Fast Switch Cache (in RP) and the Autonomous and Silicon Switch Caches (in SSP). When P2 arrives from an interface into the SSP and the Silicon Switch Cache is checked, a match is found. The matching entry from the Silicon Switch Cache quickly identifies which interface P2 must exit from (To0 in this case). Recall that the router keeps information such as the recently used MAC addresses in its ARP cache, as well. As you can imagine, processing of P2 (and P3 and so on) will be much faster than the processing of P1. These packets are not process-switched: they don't interrupt the RP, they don't have to travel through the slow system bus (153 Mbps) to go to the RP, and they don't have to wait in a buffer in RP for their turn to be looked after by the routing process.
In our example, if silicon switching was not enabled on To0, but autonomous switching was, then the match would be found in the Autonomous Switch Cache. If both silicon and autonomous switching were disabled for To0 (notice that it is the output interface that matters), then the match would be found only in the Fast Switch Cache in the RP. Recall that if a match is not found in either of SSP's caches, the header of the packet is moved from the SSP (through the slow system bus) to the RP to do a quick check on the Fast Switch Cache. In a Cisco 7000 router, silicon switching is considered to be roughly 35% faster than autonomous switching, and autonomous switching is roughly 6.6 times faster than fast switching. Finally, fast switching in a Cisco 7000 router is about 12 times faster than process switching. All of the mentioned estimations are based on tests performed using packets of 64 byte in size.
Switching in 7500 Series Routers
To enhance the performance and efficiency of its high-end routers, Cisco Systems made some major improvements in the 7500 series routers:
The internal bus of the 7500 series router (CyBus) operates at1 Gbps, which is about twice as fast as the 7000 router's CxBus.
Instead of having two separate components for routing and switching (SSP and RP) as in 7000 routers, the 7500 router is equipped with one component called the Route/Switch Processor (which eliminates the slow 153 Mbps system bus previously needed to connect the RP and SSP).
The switch cache of the 7500 series router, called Optimum Switch Cache, is faster than the Silicon Switch Cache of the 7000 router (see Figure 4-2).
As with the 7000 router and other routers, fast switching in the 7500 router is enabled by default and it is accomplished using the Fast Switch Cache (located in the Route Switch Processor [RSP]). However, the second type of switching performed by the 7500 router, called optimum switching, is the winning card for the 7500 router, as it is even faster than the 7000 router's Silicon Switch Cache. The Optimum Switch Cache is also located on the RSP. Optimum switching must be manually enabled on each interface for each protocol, except for IP. In other words, this feature is enabled by default for IP on all supported interfaces (Ethernet, FDDI, and Serial with HDLC encapsulation). Use the following interface configuration command to enable/disable optimum switching for a protocol on an interface:
Router(config-if)# [no] [protocol] route-cache optimum
Figure 4-2 Routing and Switching in 7500 Routers
After a packet is extracted from its frame by the ingress interface, it is stored in the interface buffer and waits its turn to be sent through the CyBus to the RSP. In the RSP, the packet is stored in a buffer, and then its destination address is compared to the entries in the Optimum Switch Cache. If a match is found, the output interface is known, and an appropriate frame is swiftly created (using the information stored in the ARP cache, for example) and the packet is sent to the output interface through the CyBus. On the other hand, if a match is not found in the Optimum Switch Cache, the Fast Switch Cache is checked. If no match is found in the Fast Switch Cache either, the packet must wait in the buffer for its turn to be looked after by the appropriate routing process. The destination address (destination network, to be accurate) of this packet along with the output interface that the routing process selects for it are stored in the Fast Switch Cache and the Optimum Switch Cache (if enabled). This information shall be used for swift forwarding of the packets destined for the same network as the first packet.
The 7500 routers also feature Versatile Interface Processors (VIPs) that have a RISC processor and memory locally (on the blade). The 7500 routers can be configured to distribute routing information to be stored on the VIP. The VIP can then use the cached information to switch the packets on its own without having to send packets over to the RSP. This method of switching is called distributed switching. Distributed switching can make the processing of packets more than three times faster than silicon switching. Use the following interface configuration command to enable/disable distributed switching for a protocol on a VIP card:
Router(config-if)# [no] [protocol] route-cache distributed
Netflow switching was introduced with Cisco IOS version 11.1(2) for the Cisco 7000, 7200, and 7500 routers with an RSP (Cisco offers the RSP7000 card for the 7000 routers). Netflow identifies a flow based on the source and destination IP address, source and destination port, protocol type (number), type of service (TOS), and input interface. The other switching types keep network layer destination address and output interface pairs in the cache. If a packet's destination address matches an entry in the cache, it is sent out of the destination interface specified by the cache, regardless of which interface the packet has entered the router from and what conversation it belongs to.
With other switching methods, even though the routing process is not performed for those packets with destination addresses matching the cache entry, other tasks (security and accounting, for example) are still performed on each packet. Netflow switching, on the other hand, caches security information and accounting information as well as routing information for each flow. As a result, once a network flow is identified and the first packet (of this flow) is processed, access list checks for subsequent packets belonging to the flow are bypassed and packet switching and statistics capture are performed in tandem.
Netflow also allows for exporting captured data to management utilities. Netflow switching, especially with the export option, can be quite resource consuming, so caution must be exercised when enabling this feature in production network routers. On 7000 and 7500 routers with RSP, Netflow switching can also be performed on a distributed basis on individual VIPs. Netflow switching can be disabled/enabled on a supported interface with the following interface configuration command:
router(config-if)# [no] [protocol] route-cache flow
Switching in 4000, 3000, and 2500 Series Routers
On the 4000, 3000, and 2500 series routers, unlike the high-end routers discussed previously, the options are process switching and fast switching only (see Figure 4-3). Fast switching, a term often used when referring to route caching in shared memory, is enabled by default on all interfaces for all supported protocols.
Figure 4-3 Routing and Switching in 4000, 3000, and 2500 Routers
Depending on the operations performed on a particular interface, fast switching might have to be disabled manually or it may get disabled automatically by the IOS while that operation or configuration is in effect (this is IOS dependent). For instance, say you enter the command that applies a priority queue to an interface; depending on the IOS version, fast switching on that interface might be disabled by the IOS automatically, or the IOS might prompt you to disable fast switching before it allows you to apply the priority queue to the interface. You may disable/enable fast switching on an interface for a particular protocol using the following command:
router(config-if)# [no] [protocol] route-cache
The output of the following command includes information about whether fast switching is enabled/disabled for a particular protocol on a particular interface:
router# show [protocol] interface type number
Example 4-1 displays a sample output of the show interface ethernet 0 command. IP fast switching, as the output shows, is enabled on the ethernet 0 interface of the router being examined.
Example 4-1 A Sample Output of the show interface ethernet 0 Command
A_StubR#show ip interface ethernet 0
Ethernet0 is up, line protocol is up
Internet address is 188.8.131.52/22
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is enabled
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is disabled
IP multicast fast switching is enabled
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
Probe proxy name replies are disabled
Gateway Discovery is disabled
Policy routing is disabled
Network address translation is disabled
To see the statistics on the number of packets that are process switched and fast switched, issue this command:
router# show interface stats
With each new release of the Cisco IOS, more tasks may get added to the list of fast-switched tasks. It is important to notice that when one talks about whether a task is process switched as opposed to fast switched, one is really talking about whether the packets associated with this particular task are fast switched or process switched. To clarify this point, assume that you have enabled IPX packet debugging on a particular router's Ethernet interface. Instead of thinking that IPX debugging is a process-switched task, you must understand that only those packets that are subject to this debugin other words, all IPX packets that exit the router through this interfaceare process-switched. Here is a list of some operations (in other words, packet types) that are process switched:
- Data-link layer broadcasts
- Packets subjected to Debug
- Packets delivering error log messages to syslog
- SNMP packets
- Protocol translationsfor example, 1. SR/TLB, 2. DEC and LAT to Telnet
- Tunnelingfor example, 1. GRE, 2. X25 remote switching
- Custom and priority queuing
- Link compression
For an accurate list of tasks (packet types) that are process switched, refer to the Cisco documentation for each device and the IOS version it is running.