cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
852
Views
0
Helpful
4
Replies

Load Balancing via Static Route and CEF

Hamidsattarrana
Level 1
Level 1

hi All

Hope u are well.

 

I have 2 ISPs. And 2 default routes for both ISP.

0.0.0.0 0.0.0.0 next hop (ISP1)

0.0.0.0 0.0.0.0 next hop (ISP2)

 

How the load balancing will work?

Can someone help how cef do balancing?

 

Thanks.

4 Replies 4

kubn2
Level 1
Level 1

Hi,

 

By default load balancing will distribute the load per flow (src-destination pair). If you are using public IPs in the local LAN and you are advertising this subnet to both ISPs then return traffic might nob be load balanced. If you are using NAT then you should be good as long as you are not advertising ISP1 address to ISP2 and vice versa, return traffic will go via the same link which was sent.

Harold Ritter
Level 12
Level 12

CEF does per flow (source and destination address) load balancing by default. You can check which one of the next hop will be used for a given flow using the following command:

 

sh ip cef exact-route <source IP address> <destination IP address>

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Hamid,

>> Can someone help how cef do balancing?

just to add to other replies

CEF load balancing works per flow

A math operation is performed :

the less meaningful bits of IP SA taken from the rightmost octect ( 4th octect)  are in boolean EXOR

with corresponding bits of IP DA taken from the rightmost octect ( 4th octect) 

Then another EXOR with a seed value chosen at router startup is used .

 

The result is an index that is used to choice one of the exit links.

With two links for example an even result means first link and an odd result means second link .

As explained by Harold there is a show command that allows to verify which path is used by a flow.

All packets of a given flow will use the same link in outgoing direction.

 

Hope to help

Giuseppe

 

Joseph W. Doherty
Hall of Fame
Hall of Fame

"How the load balancing will work?"

As the others have noted, by default, routed load balancing will determine which egress next hop a particular flow will be directed to use.  Such load balancing does not, by default, take into consideration actual port usage.  I.e. it's possible flows can be directed to an already busy port while another port goes unused.

Also, by default, static routing and dynamic routing protocols that support ECMP will only balance across a fixed number of next hops, which, usually, can be changed, if needed.  (NB: the typical default value was 4.  BGP, though, I recall defaults with a value of only 1.)

For your static routes, for same destination, if cost is the same, router should load balance across them, within the limitations noted above.

"Can someone help how cef do balancing?"

CEF load balancing, is, more-or-less, "automatic" if CEF is doing the route lookup for forwarding.  As, generally, on most, if not all, Cisco recent platforms doing routing, CEF processing is the default.

One possible option with CEF is setting load balancing per packet.  This generally results in a very equal load split across all the egress paths, but can often be detrimental to traffic as many flows do not well tolerate out-of-sequence packets.  (NB: yes, IP and even TCP might be argued that maintaining packet sequence shouldn't matter, but often it does.)

As explained by Giuseppe, CEF load balancing is deterministic.  I.e. a flow with one set of attributes will always be sent the same way.  However, some routed load balancing, I recall, such as processed switched, uses a round robin approach.

Review Cisco Networking for a $25 gift card