Tuesday, November 22, 2011

Cisco IOS Routing and Switching Functions

Both the routing and switching functions must be performed within a router to move a packet from an incoming (input) interface to one or more outgoing (output) interfaces. The destination path is first determined with the routing process, while the sending of the packet to the outgoing interface(s) is performed by the switching process.

The routing function is responsible for learning the logical topology of the network and making decisions based on the knowledge – determine whether the incoming packet can be routed, and how to route it. Routing is more processing intensive and has higher latency than switching.

The switching function is responsible for moving data within a router – from an inbound interface to an outbound interface, which is performed after making the routing decisions. Switching is very fast and has much lower latency than routing as it does not require extra header processing and routing table lookup.

A packet destined to a router is accepted into the router if the frame header that encapsulated the packet contains the L2 address of one of the router’s interfaces. After the framing is checked, the frame and its content (the packet) are buffered in memory and pending for further processing.

If the router has not seen the source and destination L3 address of the packet before (the first packet that is being routed), the packet will be process switched, in which the first packet must be handled by both the routing and switching processes. A routing table lookup is first performed to determine which outgoing interface(s) the packet should be forwarded, and followed by the switching process which move the packet to the output queue of the outgoing interface(s). Finally the packet will be encapsulated in data link layer frame and transmitted to the medium.

If fast switching is enabled, the packet is examined again, and an entry that consists of an IP prefix, the output interface, and the L2 layer header to be used when forwarding the packet is stored into a route cache. The effort spent for making the routing decision can be reused later.

Subsequent packets destined to the same destination are forwarded (switched) using the routing information stored in the route cache. The routing function is not initiated and hence no CPU cycle is consumed for processing such packets.

Fast switching is enabled by default with the ip route-cache interface subcommand (not shown in configuration files). The show ip int {intf-type intf-num} EXEC command displays the route cache information for a particular interface.
Router#sh ip int s0/0
Serial0/0 is up, line protocol is up
  Internet address is 10.10.10.1/24
  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 disabled
  Outgoing access list is not set
  Inbound  access list is not set
  Proxy ARP is enabled
  Local Proxy ARP is disabled
  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 Flow switching is disabled
  IP CEF switching is enabled
  IP CEF Fast switching turbo vector
  IP multicast fast switching is enabled
  IP multicast distributed fast switching is disabled
  IP route-cache flags are Fast, CEF
  Router Discovery is disabled
  IP output packet accounting is disabled
  IP access violation accounting is disabled
  TCP/IP header compression is disabled
  RTP/IP header compression is disabled
  Policy routing is disabled
  Network address translation is disabled
  WCCP Redirect outbound is disabled
  WCCP Redirect inbound is disabled
  WCCP Redirect exclude is disabled
  BGP Policy Mapping is disabled
Router#

The type of route cache being used and the contents in the cache depend on the router hardware and the type of interrupt content switching, eg: fast switching, optimum switching, autonomous switching, silicon switching, and Cisco Express Forwarding (CEF). Different switching methods affect system performance and how load balancing is performed.

There are several additional features that require additional processing and can affect switching performance, eg: queuing, Random Early Detection (RED), compression, filtering (ACLs), encryption, and accounting.

No comments:

Post a Comment