The method chosen for packet forwarding is dependent on the type of switching the router is performing for IP datagrams. This book was written using Cisco 2500s running IOS version 11.1. Cisco 2500s running 11.1 only have the following two switching methods available:
Process switching (performing packet-by-packet load balancing)
Fast switching (performing destination-by-destination load balancing)
Process switching utilizes the CPU for looking up the next hop in the routing table for every packet that needs to be forwarded.
Fast switching, which uses a route cache of the destination IP address and the next hop IP address, is less CPU intensive than process switching. The first packet to any host is always process switched. If fast switching is enabled on the outbound interface, the router creates a cache entry for the destination host after forwarding the first packet. The CPU forwards the next packet destined for the same host based on the cache entry. Having the CPU do a route cache lookup is much faster than having it do a routing table lookup.
Cisco IOS actually has several different methods of switching IP packets from an inbound interface to an outbound interface. The methods available are dependent on the version of IOS in use and the hardware platform it is being run on. A thorough discussion of all Cisco switching methods is beyond the scope of this book. Refer to the Cisco IOS documentation for the hardware and software you are using for more information.
The following text shows how to configure a router to perform process switching on an interface, which causes the router to load balance on a packet-by-packet basis [the no ip route-cache command was also applied to Serial 1]:
RouterA#-config#interface serial 0 RouterA#-config-if#no ip route-cache RouterA#-config-if#^Z RouterA#sh ip int s 0 Serial0 is up, line protocol is up Internet address is 168.71.6.1/24 Broadcast address is 255.255.255.255 Address determined by non-volatile memory MTU is 1500 bytes Helper address is not set Directed broadcast forwarding is enabled Multicast reserved groups joined: 224.0.0.9 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 disabled 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 RouterA#
In the following output, the debug IP packet from RouterA (which was captured as the PC in Figure 2-5 and sent four pings to 168.71.7.1), you can see the packets load balancing over serial 0 and serial 1. This occurs because there are two equal-cost routes to 168.71.7.0 and the pings are being process switched:
RouterA#debug ip packet
IP: s=171.68.207.222 (Ethernet0), d=168.71.7.1 (Serial1), g=168.71.9.2, len 74, forward
IP: s=171.68.207.222 (Ethernet0), d=168.71.7.1 (Serial1), g=168.71.9.2, len 74, forward
IP: s=171.68.207.222 (Ethernet0), d=168.71.7.1 (Serial0), g=168.71.6.2, len 74, forward
IP: s=171.68.207.222 (Ethernet0), d=168.71.7.1 (Serial1), g=168.71.9.2, len 74, forward
IP: s=171.68.207.222 (Ethernet0), d=168.71.7.1 (Serial0), g=168.71.6.2, len 74, forward
The following text shows how to configure a router to perform fast switching on an interface. This will cause the router to load balance on a session-by-session basis [the ip route-cache command was also applied to Serial 1]:.
RouterA#-config#interface serial 0 RouterA#-config-if#ip route-cache RouterA#-config-if#^Z RouterA#sh ip int s 0 Serial1 is up, line protocol is up Internet address is 168.71.6.1/24 Broadcast address is 255.255.255.255 Address determined by non-volatile memory MTU is 1500 bytes Helper address is not set Directed broadcast forwarding is enabled Multicast reserved groups joined: 224.0.0.9 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 enabled 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 RouterA#
The PC in Figure 2-5 is again sending four pings to 168.71.7.1. Notice that only one packet shows up in the debug. This is because debugging shows only the packets getting process switched. The final three pings in sequence were fast switched using the route cache entry created after the first ping was switched out serial 1. You can also see the IP cache becoming populated when the packets are forwarded because the debug ip cache command has been entered. Refer to Figure 2-6 to see the network topology used for this scenario.
RouterA#deb ip packet RouterA#deb ip cache IP: s=171.68.207.222 (Ethernet0), d=168.71.7.1 (Serial0), g=168.71.6.2, len 74, forward IP: created cache entry for 168.71.7.1/32
The following text shows the output of entering the show ip cachecommand on RouterA. There are no entries for Ethernet0 because it was configured for process switching in this example.
RouterA#sh ip cache
IP routing cache 3 entries, 444 bytes
Minimum invalidation interval 2 seconds, maximum interval 5 seconds,
quiet interval 3 seconds, threshold 0 requests
Invalidation rate 0 in last second, 0 in last 3 seconds
Last full cache invalidation occurred 0:00:25 ago
Prefix/Length Age Interface Next Hop
168.71.7.1/32 0:00:08 Serial1 168.71.9.2
RouterA#
A thorough explanation of debugging the ip route cacheis beyond the scope of this book. Refer to the Cisco IOS debug command reference for the IOS version you are using for more details on this command.
Note
The preceeding router output shows the use of the debug ip cache command. This command causes the router to display messages when changes occur in the IP forwarding cache.
18.222.125.171