cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
879
Views
15
Helpful
4
Replies

CEF / Routing Protocols

GRANT3779
Spotlight
Spotlight

I've been reading up on CEF which is a new topic for me.

If I have a router with multiple equal cost paths learned via OSPF for example, how does the router distribute traffic between these paths? Is it dependent on CEF to be able to do this load balancing? What if I do not have CEF configured on my device. How is the router able to load balance across the equal cost routes? Is this something within the OSPF process?

Thanks

1 Accepted Solution

Accepted Solutions

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

. . . how does the router distribute traffic between these paths?

Generally it round robins flows.  It can also round robin packets, which generally you want to avoid.

Is it dependent on CEF to be able to do this load balancing?

No, but CEF does it best.

What if I do not have CEF configured on my device. How is the router able to load balance across the equal cost routes?

It might do "process switching", generally the slowest forwarding in software.  Or it might use other caching techniques to improve performance.  Again, CEF is generally Cisco's best.

Is this something within the OSPF process?

No.  OSPF will contribute to the routing table, and then the router uses that for forwarding.  If you adjusted AD and metrics, I believe, you could, for example, have equal cost between OSPF and RIP, and the router could round robin between them.

View solution in original post

4 Replies 4

chris noon
Level 1
Level 1

This is an extract from a Cisco article which should give you a basic explanation of how CEF load balances equal cost routes:

http://www.cisco.com/c/en/us/support/docs/ip/express-forwarding-cef/18285-loadbal-cef.html

 

Configuring Cisco Express Forwarding Load Sharing

Cisco Express Forwarding accomplishes load balancing through use of the loadshare table. As with all other load balancing solutions on Cisco routers, the load balancing decision is made on outbound interfaces. Unlike other switching methods, Cisco Express Forwarding tracks paths based on both the source and destination address of the path. To simplify this, you could say that the path is an IP session and each session is logically identified as a unique source-destination address pair.

In order to understand how the load balance takes place, you must first see how the tables relate. The Cisco Express Forwarding table points to 16 hash buckets (load share table), which point to the adjacency table for parallel paths. See the Cisco Express Forwarding Load Balancing Internal Mechanisms section for more details. Each packet to be switched is broken up into the source and destination address pair and checked against the loadshare table.

Note: There are two main types of Cisco Express Forwarding switching, per-destination and per-packet. If both types are in use on a router, each type has its own loadshare table.

Per-destination load balancing allows the router to use multiple paths to achieve load sharing. Per-destination load balancing is enabled by default when you enable Cisco Express Forwarding, and it is the load balancing method of choice for most situations. Because per-destination load balancing depends on the statistical distribution of traffic, load sharing becomes more effective as the number of source-destination pairs increase.

Per-packet load balancing allows the router to send successive data packets over paths without regard to individual hosts or user sessions. It uses the round-robin method to determine which path each packet takes to the destination. Per-packet load balancing ensures balancing over multiple links. Path utilization with per-packet load balancing is good, but packets for a given source-destination host pair might take different paths which could cause reordering of packets. For this reason, per-packet load balancing is inappropriate for certain types of data traffic, such as VoIP, that depend on packets arriving at the destination in sequence. Use per-packet load balancing to help ensure that a path for a single source-destination pair does not become overloaded.

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

. . . how does the router distribute traffic between these paths?

Generally it round robins flows.  It can also round robin packets, which generally you want to avoid.

Is it dependent on CEF to be able to do this load balancing?

No, but CEF does it best.

What if I do not have CEF configured on my device. How is the router able to load balance across the equal cost routes?

It might do "process switching", generally the slowest forwarding in software.  Or it might use other caching techniques to improve performance.  Again, CEF is generally Cisco's best.

Is this something within the OSPF process?

No.  OSPF will contribute to the routing table, and then the router uses that for forwarding.  If you adjusted AD and metrics, I believe, you could, for example, have equal cost between OSPF and RIP, and the router could round robin between them.

GRANT3779
Spotlight
Spotlight

Thanks for the info both.

 I actually just came across the following statement in a Cisco doc just after posting.

"When you work with CEF, you could ask: Who does the load balancing, CEF or the routing protocol used? The way in which CEF works is that CEF does the switching of the packet based on the routing table which is being populated by the routing protocols such as EIGRP. In short, CEF performs the load-balancing once the routing protocol table is calculated"

Source - 
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/5212-46.html

Hello,

OSPF does not have anything to do with forwarding the packets. OSPF just makes the routing table.

Cisco supports two modes to forward packets across multi paths.

1: Per Packet(old method)  It is done by looking up the route from routing table and load balancing per packet. Problem here is packets may get to the destination out of order. If CEF does not exist, this method is used for load balancing.

 

2: Per destination. It is done by CEF. CEF maintains a cache entry for each destination. If there are two paths to a network, actual load balancing is done by destination(per host) not by the network address.

As an example if there are two paths to 10.10.0.0/16 in the routing table, router sends all packets toward 10.10.1.1 on one link and 10.10.1.2 on another link. And it is on demand. Cache will have an entry to a specific destination if there is a flow to that destination. There is a problem with this method. One link may have more traffic than other.

Activating CEF usually disables per packet load balancing.

 

Cisco introduced a new way of load balancing in IOS 11.1 cc which uses two methods together. I hope this helps.

 

 

Review Cisco Networking for a $25 gift card