cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8371
Views
17
Helpful
9
Replies

OSPF load balance and CEF

bapatsubodh
Level 1
Level 1

Hi,

If we have two OSPF equal cost learned routes to same subnet and traffic destined for that subnet need to be load balanced between two links do we need to enable  CEF for per-packet instead of per destination that is default?

Is changing the CEF mode is of a big impact.( May be if it is clearing all cache entries.)

Please share the experience.

Thanks

Subodh

2 Accepted Solutions

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hello Subodh,

It is actually highly recommended to have the CEF activated because it provides a great reduction in the CPU load on the software-based routers. The CEF itself defaults to per-destination load balacing but can be instructed to perform per-packet load balacing. Please note, however, that using the per-packet load balacing may ultimately result in packets being reordered during their delivery to the destination which is an unpleasant side effect.

The per-packet load balacing must be enabled on the egress interfaces using the command

ip load-sharing per-packet

Changing the load-sharing mechanism should not have any significant impact on your router load. Neither the FIB nor the adjacency database should be affected by it. The load-sharing is performed via a hash table placed between the FIB and ADJ database so the FIB/ADJ should not be modified at all.

Best regards,

Peter

View solution in original post

Subodh

If I understand your post correctly your requirement is that you have several equal cost paths to a subnet and want to achieve load balancing over those paths. Peter has given a very nice explanation of CEF. But I would like to approach answering your question from a slightly different perspective.

If you have a single source sending to a single destination, then the default load balancing of CEF will not produce much load balancing. But if you have multiple sources sending to multiple destinations, then the default load balancing of CEF is likely to produce pretty good load balancing without doing anything fancy.

Peter mentions the potential disadvantage of using per packet load balancing. When you configure CEF to load balance per packet you intoduce the probability that some packets will be delivered out of order. A simple example may help to illustrate this. Lets us think about a simple scenario where we have 3 packets from some source to some destination and assume that CEF is configured for per packet load balancing. Let us assume that packet 1 is of lenfth 100, packet 2 is of length 1500, and packet 3 is of length 100. The router starts sending packet 1 on a link. Then it starts sending packet 2 on the other link. Packet 1 complets transmission and the router begins transmitting packet 3 on the first link while packet 2 is still being send on the other link. so the destination receives packet 1, then packet 3, and then packet 2. Some applications are very sensitive to out of order packets. (Voice traffic is one example that comes to mind and there are quite a few others). So you should consider the applications that run in your network and whether any of them are sensitive to out of order packets before you decide to configure per packet load balancing.

HTH

Rick

HTH

Rick

View solution in original post

9 Replies 9

Peter Paluch
Cisco Employee
Cisco Employee

Hello Subodh,

It is actually highly recommended to have the CEF activated because it provides a great reduction in the CPU load on the software-based routers. The CEF itself defaults to per-destination load balacing but can be instructed to perform per-packet load balacing. Please note, however, that using the per-packet load balacing may ultimately result in packets being reordered during their delivery to the destination which is an unpleasant side effect.

The per-packet load balacing must be enabled on the egress interfaces using the command

ip load-sharing per-packet

Changing the load-sharing mechanism should not have any significant impact on your router load. Neither the FIB nor the adjacency database should be affected by it. The load-sharing is performed via a hash table placed between the FIB and ADJ database so the FIB/ADJ should not be modified at all.

Best regards,

Peter

Subodh

If I understand your post correctly your requirement is that you have several equal cost paths to a subnet and want to achieve load balancing over those paths. Peter has given a very nice explanation of CEF. But I would like to approach answering your question from a slightly different perspective.

If you have a single source sending to a single destination, then the default load balancing of CEF will not produce much load balancing. But if you have multiple sources sending to multiple destinations, then the default load balancing of CEF is likely to produce pretty good load balancing without doing anything fancy.

Peter mentions the potential disadvantage of using per packet load balancing. When you configure CEF to load balance per packet you intoduce the probability that some packets will be delivered out of order. A simple example may help to illustrate this. Lets us think about a simple scenario where we have 3 packets from some source to some destination and assume that CEF is configured for per packet load balancing. Let us assume that packet 1 is of lenfth 100, packet 2 is of length 1500, and packet 3 is of length 100. The router starts sending packet 1 on a link. Then it starts sending packet 2 on the other link. Packet 1 complets transmission and the router begins transmitting packet 3 on the first link while packet 2 is still being send on the other link. so the destination receives packet 1, then packet 3, and then packet 2. Some applications are very sensitive to out of order packets. (Voice traffic is one example that comes to mind and there are quite a few others). So you should consider the applications that run in your network and whether any of them are sensitive to out of order packets before you decide to configure per packet load balancing.

HTH

Rick

HTH

Rick

Hello Rick,

Thank you for updating my reply - it is a most welcome and informative addition!

Regarding the sensitivity of applications to reordered packets - you are absolutely correct with the VoIP, and I have even seen some TCP implementations to react very intensively to reordered segments by aggresively slowing down the transmission rate, resulting in poor data transmission performance.

Best regards,

Peter

Gentlemen,

Thanks a lot.

Updated my CEF switching knowledge.

Subodh

Hello Rick,

Since we have this problems in "Per packet load balancing" so do we have any other method to balance the traffic in this case. by the way thanks for this information.

 

Regards:
DPK

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

PfR with PIRO.

DPK

 

The original post asked a question that was about the situation where you have learned two equal cost paths via a dynamic routing protocol. And for that the main options are the per destination and per packet load sharing. It seems your question wants to explore what other options there might be. So here are a couple for you to consider.

 

One option is to make one path more attractive than the other so that the routing protocol would prefer one path and would dynamically switch to the other path if the first path fails. That generates a lot of traffic on the primary path. You then take something like Policy Based Routing and you direct certain types of traffic (perhaps it is Email, perhaps it is file transfers, perhaps it is data base backups, perhaps it is something else) over the other link. That gives you load sharing that is not dependent on the routing protocol.

 

Another option would be to configure Performance Based Routing. I have not implemented it and so can not speak to it directly. But it is my understanding that PfR has the ability to take load on links into consideration and can shift traffic patterns to achieve load sharing over several links.

 

HTH

 

Rick

HTH

Rick

Thanks Rick. smiley

Deepak,

As Rick explained you can tune the routing by different methods. Also CEF load-balancing per packet can be useful Rick's earlier post explains the same.

 

So in short, theoretically if you have many sources to many destinations per packet load balancing is the way to go in my opinion. Also assuming the packet size is fairly random and not line -  one flow is almost packet size is almost 1500 and other is very light like 100 ...

HTH

Cheers!!

Subodh

Review Cisco Networking products for a $25 gift card