Verifying Cisco router traffic load-sharing by CEF

Cisco Express Forwarding (CEF) is well-known Cisco advanced Layer 3 IP switching technology. This technology brings traffic load-sharing technique that is functionality in a router that distributes packets across multiple links based on layer 3 routing information. It has two modes; per-destination and per-packet. As you know, per-destination is default setting Cisco gear by Cisco. Some of circumstance, load-sharing by per-packet mode would be desirable, but most of case per-destination mode would be the best choice. One of famous reason would be out of sequence order on the hi-speed link. This happening will dramatically reduce end-to-end performance.

 

Traffic ratio wise, the per-packet mode will utilize all involved circuits in exact equal amount of traffic while the per-destination mode utilizes circuits in vary.

 

To verify traffic load-sharing per packet, try below command

 

Cisco_router#Show ip cef exact-route x.x.x.x y.y.y.y

 

 

 

Let’s check it thru the below example

 

Verifying traffic Load-sharing by cef

 

You must configure "ip cef" on global configuration mode and "ip load-sharing per-packet on each involved interface mode.

 

Router1

 

Router1#show run
Building configuration…
 
hostname Router1
!
ip cef   
!
interface Loopback0
 ip address 10.10.10.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.2.2.2 255.255.255.0
 duplex auto
 speed auto
!
interface Serial1/0
 ip address 1.0.0.1 255.255.255.252
 ip load-sharing per-packet
 serial restart-delay 0
!
interface Serial1/1
 ip address 1.1.1.1 255.255.255.252
 ip load-sharing per-packet
 serial restart-delay 0
!
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 10.2.2.0 mask 255.255.255.0
 neighbor 20.20.20.1 remote-as 2
 neighbor 20.20.20.1 ebgp-multihop 2
 neighbor 20.20.20.1 update-source Loopback0
 no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
ip route 20.20.20.1 255.255.255.255 1.1.1.2
ip route 20.20.20.1 255.255.255.255 1.0.0.2
!
line con 0
line aux 0
line vty 0 4
!
end

Router1#

 

Router2

Router2#sh run
!
hostname Router2
!
ip cef
!
interface Loopback0
 ip address 20.20.20.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.3.3.2 255.255.255.0
 duplex auto
 speed auto
!
interface Serial1/0
 ip address 1.0.0.2 255.255.255.252
 ip load-sharing per-packet
 serial restart-delay 0
 no fair-queue
!
interface Serial1/1
 ip address 1.1.1.2 255.255.255.252
 ip load-sharing per-packet
 serial restart-delay 0
!        
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 network 10.3.3.0 mask 255.255.255.0
 neighbor 10.10.10.1 remote-as 1
 neighbor 10.10.10.1 ebgp-multihop 2
 neighbor 10.10.10.1 update-source Loopback0
 no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
ip route 10.10.10.1 255.255.255.255 1.1.1.1
ip route 10.10.10.1 255.255.255.255 1.0.0.1
!
line con 0
line aux 0
line vty 0 4
!
end

Router1#

Router1#sh ip route 20.20.20.1
Routing entry for 20.20.20.1/32
  Known via "static", distance 1, metric 0
  Routing Descriptor Blocks:
  * 1.1.1.2
      Route metric is 0, traffic share count is 1
    1.0.0.2
      Route metric is 0, traffic share count is 1

Router1#

Verifying Cisco router traffic load-sharing

As you can see, equal amount of packets are sending each circuit. It makes exact 50/50 percent of traffic.

Router1#sh ip cef exact-route 10.10.10.1 20.20.20.1
10.10.10.1      -> 20.20.20.1     : Serial1/0 (next hop 1.0.0.2)
Router1#sh ip cef exact-route 10.10.10.1 20.20.20.1
10.10.10.1      -> 20.20.20.1     : Serial1/1 (next hop 1.1.1.2)
Router1#sh ip cef exact-route 10.10.10.1 20.20.20.1
10.10.10.1      -> 20.20.20.1     : Serial1/0 (next hop 1.0.0.2)
Router1#sh ip cef exact-route 10.10.10.1 20.20.20.1
10.10.10.1      -> 20.20.20.1     : Serial1/1 (next hop 1.1.1.2)
Router1#sh ip cef exact-route 10.10.10.1 20.20.20.1
10.10.10.1      -> 20.20.20.1     : Serial1/0 (next hop 1.0.0.2)
Router1#sh ip cef exact-route 10.10.10.1 20.20.20.1
10.10.10.1      -> 20.20.20.1     : Serial1/1 (next hop 1.1.1.2)
Router1#

 

Leave a Reply