Re: > ip-cef understanding ...., cant get a clear picture of

From: rakesh_groupstudy@yahoo.com
Date: Fri Sep 26 2008 - 23:27:41 ART


 CEF b Fast switching & Process Switching
Routing protocols does load balance but that not technically what is happening,
they may install more than 1 route per destination, but the switching mechanism
on both routes is done by the switching type (process sw, fast sw, cef)
Load Sharing and Cisco Express Forwarding
Per destination load sharing distributes the load according to destination
address. Given two paths to the same network, all packets for one destination
may travel over the first path, all packets for a second destination on the
same network may travel over the second path, all packets for a third
destination may again be sent over the first path, and so on. This is the
default type of load sharing used by Cisco Express Forwarding (CEF). On most
platforms, CEF is the default switching mode for IPv4, but not IPv6.

CEF is a very efficient switching process. Its forwarding information is
obtained and stored in tables before any packet needs to use the information.
CEF builds a forwarding information base (FIB) with information obtained from
the route table. All the destination networks entered in the route table are
entered into the CEF FIB. If the route table is stable and not changing, the
FIB will not change. CEF uses a separate table, the adjacency table, to
maintain Layer 2 forwarding information for each entry in the FIB. The
adjacency table is created as Layer 2 information is learned, through IP ARP or
IPv6 Neighbor Discovery, for instance. Both the FIB and adjacency table are
created before packets need to be forwarded. Not even the first packet to a
destination is process switched, as is the case with other switching schemes.

CEF performs per-destination load sharing by default. This is actually per
source-destination pair load sharing. All traffic that has a particular source
address and is destined to a specific destination address will exit the same
interface. Traffic with a different source/destination address pair may exit
the next interface.
Per packet load sharing is another method available to CEF switched IPv4
packets. IPv6 CEF only supports per destination load sharing. Per packet load
sharing means that one packet is sent over one link, the next packet is sent
over the next link, even if this next packet is to the same destination as the
first, and so on, given equal-cost paths. If the paths are unequal cost, the
load sharing may be one packet over the higher-cost link for every three
packets over the lower-cost link, or some other proportion depending upon the
ratio of costs. Per packet load sharing may distribute the load more evenly
than per destination load sharing, depending upon the number of different
source-destination pairs, but because the packets to a given destination will
be taking different paths, the packets are likely to arrive out of order, which
is unacceptable for some applications, such as Voice over IP.
Per Destination Load Sharing and Fast Switching ( default )
IOS performs per destination load sharing on exit interfaces configured with
fast switching. Fast switching is the default IOS switching mode in some
routers.

Fast switching works as follows:
1.When a router switches the first packet to a particular destination, a route
table lookup is performed and an exit interface is selected.
2.The necessary data-link information to frame the packet for the selected
interface is then retrieved (from the ARP cache, for instance), and the packet
is encapsulated and transmitted.
3.The retrieved route and data-link information is then entered into a fast
switching cache.
4.As subsequent packets to the same destination enter the router, the
information in the fast cache allows the router to immediately switch the
packet without performing another route table and ARP cache lookup.

While switching time and processor utilization are decreased, fast switching
means that all packets to a specific destination, not source-destination pair,
are routed out the same interface. When packets addressed to a different host
on the same network enter the router and an alternate route exists, the router
may send all packets for that destination on the alternate route. Therefore,
the best the router can do is balance traffic on a per destination basis.

Per Packet Load Sharing and Process Switching
Process switching simply means that for every packet, the router performs a
route table lookup, selects an interface, and then looks up the data link
information. Because each routing decision is independent for each packet, all
packets to the same destination are not forced to use the same interface. To
enable process switching on an interface, use the command no ip route-cache for
IPv4.
You don't have to do anything to enable process switching for IPv6. It is
enabled by default.

Note: Like many design choices, per packet load balancing has a price. The
traffic may be distributed more evenly among the various links, which may
affect VOIP traffic due to variation in delay among load balancing via more
than one link.
With per destination load balancing, you got lower switching time and processor
utilization .

Which Switching Method Will Be Used?
IOS makes switching decisions based on the configuration of the inbound
interface first. If CEF is configured on an inbound interface, the packet will
be CEF switched regardless of the configuration on the outbound interface.
If CEF is not enabled on the inbound interface, then IOS processes and forwards
the packet, and based on the configuration of the outbound interface,

IOS switching determination is based on configuration of inbound and outbound
interfaces.
Inbound Configuration Outbound Configuration Switching Method Used
CEF Process CEF
CEF Fast CEF
Process Fast Fast
Fast Process Process
Fast CEF Fast (or process if IPv6)
Process CEF Fast (or process if IPv6)

IOS will switch a packet using CEF only if CEF is enabled on the inbound
interface. If CEF is not configured on the inbound interface, the configuration
of the exit interface determines the switching method.
Notice that when process or fast-switching is configured inbound and CEF is
configured on the outbound interface, fast-switching is used. CEF is only used
if it is configured on the ingress interface. For IPv4, fast-switching is
enabled outbound, even if CEF is enabled on the interface.
IMPORTANT NOTE: There are times when a packet will not be switched using CEF
even if it is enabled (for example, if access-list logging is enabled and a
packet will be logged). Packets will be punted down to the next fastest
switching method. For IPv4, the next fastest switching method is
fast-switching. For IPv6, this is process switching.

Basic CEF Commands

Config)# ip cef (Enables Cisco Express Forwarding for IPv4.)
Config)# ipv6 cef (Enables Cisco Express Forwarding for IPv6. IPv4 CEF must be
enabled
before IPv6 CEF can be enabled.)
Config-if)# ip load-sharing < per-packet | per-destination >
Config-if)# ip route-cache (Configures Fast switching cache an interface for
IPv4.)
Config-if)# no ip route-cache (Configures Process switching cache an interface
for IPv4.)

# show ip/ipv6 cef (Displays CEF forwarding cache or a message indicating CEF
is not enabled.)
# show ip/ipv6 cef <interface> detail (Displays whether CEF is enabled on an
interface,
among other things.

Blogs and organic groups at http://www.ccie.net



This archive was generated by hypermail 2.1.4 : Sat Oct 04 2008 - 09:26:20 ART