Skip to content

Archive

Category: Routing

GLBP

Apr 23

Gateway Load Balancing Protocol (GLBP) is a Cisco proprietary protocol that attempts to overcome the limitations of existing redundant router protocols by adding basic load balancing functionality.

In addition to being able to set priorities on different gateway routers, GLBP allows a weighting parameter to be set. Based on this weighting (compared to others in the same virtual router group), ARP requests will be answered with MAC addresses pointing to different routers. Thus, load balancing is not based on traffic load, but rather on the number of hosts that will use each gateway router. By default GLBP load balances in round-robin fashion.

GLBP elects one AVG (Active Virtual Gateway) for each group. Other group members act as backup in case of AVG failure. In case there are more than two members, the second best AVG is placed in the Standby state and all other members are placed in the Listening state. This is monitored using hello and holdtime timers, which are 3 and 10 seconds by default. The elected AVG then assigns a virtual MAC address to each member of the GLBP group, including itself, thus enabling AVFs (Active Virtual Forwarders). Each AVF assumes responsibility for forwarding packets sent to its virtual MAC address. There could be up to four active AVFs at the same time.

By default, GLBP routers use the local multicast address 224.0.0.102 to send hello packets to their peers every 3 seconds over UDP 3222 (source and destination).

Lets now start with our topology. Here PC1,PC2,PC3 and PC4 routing is disabled with “no ip routing” and all are pointing towards the GLBP assigned address 10.0.0.254, which is assigned on the LAN interface of R1 and R2 pointing towards end hosts. Additionally R1(AS-12) is connected to ISP1(AS-501) and R2(AS-12) is connected to ISP2(502) . I have not configured R1 and R2 to be an IBGP neighbor, although R1 and R2 both receiving same routes from ISP1 and ISP2.

Pre-configurations of all devices.

PC1,PC2,PC3 and PC4 have addresses in range 10.0.0.0/24 and ip routing is disabled and default-gateway is configured to be 10.0.0.254(GLBP address) assigned on Fastethernet0/0 interface of R1 and R2.

Sample config of PC1

PC1#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
end
PC1#sh run | i default
ip default-gateway 10.0.0.254
PC1#sh ip route
Default gateway is 10.0.0.254

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty

R1

R1#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.101 255.255.255.0
glbp 1 ip 10.0.0.254
R1#sh run int S0/0
interface Serial0/0
ip address 11.11.11.1 255.255.255.0
R1#sh run | s bgp
router bgp 12
no synchronization
bgp log-neighbor-changes
neighbor 11.11.11.254 remote-as 501
no auto-summary
R1#sh ip bgp summ | b Nei
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.254    4   501      35      31                     5          0      0         00:28:31                    4
R1#sh ip bgp | b Network
Network          Next Hop            Metric LocPrf Weight Path
*> 33.33.33.1/32    11.11.11.254             0             0 501 i
*> 33.33.33.2/32    11.11.11.254             0             0 501 i
*> 33.33.33.3/32    11.11.11.254             0             0 501 i
*> 33.33.33.4/32    11.11.11.254             0             0 501 i

R2

R2#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.102 255.255.255.0
glbp 1 ip 10.0.0.254
R2#sh run int s0/0
interface Serial0/0
ip address 22.22.22.2 255.255.255.0
R2#sh run | s bgp
router bgp 12
no synchronization
bgp log-neighbor-changes
neighbor 22.22.22.254 remote-as 502
no auto-summary
R2#sh ip bgp summ | b Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.254    4   502      38      34                5               0    0       00:31:42                   4
R2#sh ip bgp  | b Network
Network          Next Hop            Metric LocPrf Weight Path
*> 33.33.33.1/32    22.22.22.254             0             0 502 i
*> 33.33.33.2/32    22.22.22.254             0             0 502 i
*> 33.33.33.3/32    22.22.22.254             0             0 502 i
*> 33.33.33.4/32    22.22.22.254             0             0 502 i

ISP1

ISP1#sh run int s0/0
interface Serial0/0
ip address 11.11.11.254 255.255.255.0
ISP1#sh run | s bgp
router bgp 501
no synchronization
bgp log-neighbor-changes
network 33.33.33.1 mask 255.255.255.255
network 33.33.33.2 mask 255.255.255.255
network 33.33.33.3 mask 255.255.255.255
network 33.33.33.4 mask 255.255.255.255
neighbor 11.11.11.1 remote-as 12
no auto-summary
ISP1#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 11.11.11.1

ISP2

ISP2#sh run int s0/0
interface Serial0/0
ip address 22.22.22.254 255.255.255.0
ISP2#sh run | s bgp
router bgp 502
no synchronization
bgp log-neighbor-changes
network 33.33.33.1 mask 255.255.255.255
network 33.33.33.2 mask 255.255.255.255
network 33.33.33.3 mask 255.255.255.255
network 33.33.33.4 mask 255.255.255.255
neighbor 22.22.22.2 remote-as 12
no auto-summary
ISP2#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 22.22.22.2

Now lets start with the verifications of GLBP. As we have not configured any fancy stuffs so far in GLBP , lets check the output of “show glbp” on R1 and R2 respectively.

R1#sh glbp
FastEthernet0/0 – Group 1
State is Standby                      —>>This is standby AVG as this has the lower ip address assigned similar to HSRP or VRRP.
1 state change, last state change 00:29:49
Virtual IP address is 10.0.0.254
Hello time 3 sec, hold time 10 sec
Next hello sent in 1.772 secs
Redirect time 600 sec, forwarder timeout 14400 sec
Preemption disabled     —>>Preemption is disabled by default similar to HSRP, only VRRP has preepmtion enabled by default.
Active is 10.0.0.102, priority 100 (expires in 7.136 sec) –>>This is pointing towards the Active Gateway that is R2.
Standby is local                     —>>R1 is  standby AVG.
Priority 100 (default)              —>>Default priority.
Weighting 100 (default 100), thresholds: lower 1, upper 100
Load balancing: round-robin
Group members:
c200.1550.0000 (10.0.0.101) local       —>>AVF’s and there respective MAC addresses.(R1)
c201.1550.0000 (10.0.0.102)                  —>>AVF’s and there respective MAC addresses.(R2)
There are 2 forwarders (1 active)
Forwarder 1
State is Listen
MAC address is 0007.b400.0101 (learnt)
Owner ID is c201.1550.0000       –>>AVF is R1, this is in listen state means this will answer the next ARP response.
Time to live: 14397.124 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is 10.0.0.102 (primary), weighting 100 (expires in 8.780 sec)
Forwarder 2
State is Active
1 state change, last state change 00:29:58
MAC address is 0007.b400.0102 (default)
    Owner ID is c200.1550.0000      —>>AVF is R2 and this is Active means this will answer the ARP.
Preemption enabled, min delay 30 sec
Active is local, weighting 100

R2#sh glbp
FastEthernet0/0 – Group 1
State is Active           —>>This is AVG as this has the higher ip address assigned similar to HSRP or VRRP.
2 state changes, last state change 00:30:42
Virtual IP address is 10.0.0.254
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.372 secs
Redirect time 600 sec, forwarder timeout 14400 sec
Preemption disabled     —>>Preemption is disabled by default similar to HSRP, only VRRP has preepmtion enabled by default.
Active is local             —>> This indicated that this is AVG for this group.
Standby is 10.0.0.101, priority 100 (expires in 9.024 sec)
Priority 100 (default)     —>>Priority of all FHRP’s by default is 100.
Weighting 100 (default 100), thresholds: lower 1, upper 100        —>>Default config of GLBP.
  Load balancing: round-robin                                                                         —>>Default load-balancing of GLBP.
Group members:
c200.1550.0000 (10.0.0.101)                               —>>AVF’s and there respective MAC addresses.(R1)
    c201.1550.0000 (10.0.0.102) local                    —>>AVF’s and there respective MAC addresses.(R2)
There are 2 forwarders (1 active)
Forwarder 1
State is Active
1 state change, last state change 00:30:32
MAC address is 0007.b400.0101 (default)
Owner ID is c201.1550.0000                                     —>>AVF is R2 and this is Active means this will answer the ARP.
Redirection enabled
Preemption enabled, min delay 30 sec
Active is local, weighting 100
Client selection count: 2
Forwarder 2
State is Listen
MAC address is 0007.b400.0102 (learnt)
Owner ID is c200.1550.0000   —>>AVF is R1,this is in listen state means this will answer the next ARP response.
Redirection enabled, 597.904 sec remaining (maximum 600 sec)
Time to live: 14397.904 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is 10.0.0.101 (primary), weighting 100 (expires in 7.900 sec)
Client selection count: 2

So far so good, so we are doing some Load balancing out here, but really are we doing, how can we check.The easy way to check is from pinging from our end hosts Pc1 through Pc4 and see do we actually distributing the load, as seen in the above output.

Lets start.

Pc1

PC1#ping 33.33.33.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/241/1080 ms
PC1#sh arp | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0101  ARPA   FastEthernet0/0      —>>AVF is R2.

PC2

PC2#ping 33.33.33.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/241/1064 ms
PC2#sh arp  | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0102  ARPA   FastEthernet0/0       —>>AVF is R1.

PC3

PC3#ping 33.33.33.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/231/1060 ms
PC3#sh arp | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0101  ARPA   FastEthernet0/0     —>>AVF is R2.

PC4

PC4#ping 33.33.33.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/233/1056 ms
PC4#sh arp | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0102  ARPA   FastEthernet0/0     —>>AVF is R1.

So the output is quite promising we have sent twenty packets as a whole towards our destinations and 10 packets are routed via R1 and 10 packets are routed via R2. As the default Load Balancing in GLBP is round-robin as we have seen in the output of “show glbp” it means the forwarding engine inside the GLBP will serve packets one after another in a round robin fashion. As evident from the output.

Now lets modify some of the outputs,Here our connections to ISP1 and ISP2 are both T1 means (BW 1544 Kbit), now lets say the connection to ISP1 from R1 is DS3 channel(45 Mbps), and now we want packets are more likely to be forwarded towards R1 in comparison to R2.Lets modify the weighting and watch the results.

For actually test the load-balancing we need to create an extended access-list on R1 and R2, that we can use for packet counters, and ping from our end hosts PC1 through PC4, and change configurations on R1 accordingly as this the faster link so i have increased weighting of R1 as double than R2 and decreased the Forwarder preempt delay from Default 30 seconds to 1 second on R1.So the final config on R1 is.

R1

R1#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.101 255.255.255.0
ip access-group 100 in
duplex auto
speed auto
glbp 1 ip 10.0.0.254
 glbp 1 weighting 210 lower 195 upper 205  —>>This side weighting is twice than R1(100 default).
 glbp 1 load-balancing weighted          —>>This will change the default LB from Round-Robin to Weighted.
 glbp 1 forwarder preempt delay minimum 1   —>>The forwarder preemtion delay is minimum to 1 sec.
end

R2

R2#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.102 255.255.255.0
ip access-group 100 in
duplex auto
speed auto
glbp 1 ip 10.0.0.254
glbp 1 load-balancing weighted          —>>This will change the default LB from Round-Robin to Weighted.
 glbp 1 forwarder preempt delay minimum 1   —>>The forwarder preemtion delay is minimum to 1 sec.
end

The access-list 100 is used as packet counter and applied inbound on R1 and R2, the config is below.

access-list 100 permit icmp any any echo
access-list 100 permit ip any any
access-list 100 deny   ip any any log

Now lets start pinging from PC1 through PC4 with repeat count of 1000 each.

PC1#ping 33.33.33.1 re 1000

PC2#ping 33.33.33.2 re 1000

PC3#ping 33.33.33.3 re 1000

PC4#ping 33.33.33.4 re 1000

Now lets see the result on R1 and R2 by using access-list that we have made for packet counters.

R1#sh access-l
Extended IP access list 100
10 permit icmp any any echo (3000 matches)
20 permit ip any any (195 matches)
30 deny ip any any log

R2#sh access-l
Extended IP access list 100
10 permit icmp any any echo (1000 matches)
20 permit ip any any (189 matches)
30 deny ip any any log

Voila, the results are quite good as we can see total 4000 packets sent out of which 3000 packets are forwarded by R1 and 1000 packets are forwarded by R2. Its really hard to simulate actual load-balancing in GLBP, also if we can refer to Cisco DOC-CD GLBP the load balancing algorithm is not well documented here.

We can configure authentication and tracking, same as we use in HSRP and VRRP, the configurations are almost same only we need to replace key word glbp in GLBP by standby in HSRP or vrrp in VRRP, rest are same.

Good resources to look for GLBP.

INE BLOG  :-  GLBP Explained

Cisco Site apart from DOC-Cd  :- GLBP

Here i have taken a simple topology R1 is connecting directly over Serial 0/0 link to BB1 , and as we know we dont have much access to Backbone routers in LAB , what if we dont know the EIGRP AS number of Neighbouring router.

R1 ——S0/0———BB1

The ip address used between R1 and BB1 is in range of 200.200.200.0/30

Lets start R1 by configuring it in AS 100 (wild guess) .

R1(config-if)#router eigrp 100
R1(config-router)#no auto
R1(config-router)#netw 0.0.0.0
R1(config-router)#end

It seems we are not lucky so the neighborship is still down , lets see the output of “sh ip protocols”.

R1#sh ip protocols
Routing Protocol is “eigrp 100”
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
Redistributing: eigrp 100
EIGRP NSF-aware route hold timer is 240s
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
0.0.0.0
Routing Information Sources:
Gateway         Distance      Last Update
Distance: internal 90 external 170

Here also it seems everything fine , so here starts our troubleshooting we will use Extended Access list 101 to limit the output of “debug ip packet details 101”

R1(config)#access-list 101 permit ip any host 224.0.0.10

R1#debug ip packet detail 101
IP packet debugging is on (detailed) for access list 101

*Mar  1 00:07:39.131: IP: s=200.200.200.1 (local), d=224.0.0.10 (Serial0/0), len 60, sending broad/multicast, proto=88
*Mar  1 00:07:39.219: IP: s=200.200.200.2 (Serial0/0), d=224.0.0.10, len 60, rcvd 2, proto=88

The output of the debug shows that we indeed sending and receiving Eigrp updates on IP protocol 88 port.But why our neighbor is still down and answer is we are in wrong EIGRP AS , so the Question is how do we figure out the correct EIGRP AS number of the neighbouring router BB1.

Here is the trick.

We use a hidden command in debug called as “DUMP” feature it will show the HEX characters received from the neighbouring router.

R1#debug ip packet detail 101 dump
IP packet debugging is on (detailed) (dump) for access list 101
R1#
*Mar  1 00:12:05.643: IP: s=200.200.200.2 (Serial0/0), d=224.0.0.10, len 60, rcvd 2, proto=88
07DFE7F0:          0F000800 45C0003C 00000000
07DFE800: 015847D5 C8C8C802 E000000A 0205DF27
07DFE810: 00000000 00000000 00000000 00000FA5

07DFE820: 0001000C 01000100 0000000F 00040008  …………….
07DFE830: 0C040102                             ….
*Mar  1 00:12:07.747: IP: s=200.200.200.1 (local), d=224.0.0.10 (Serial0/0), len 60, sending broad/multicast, proto=88

Here in the first highlighted part E000000A , if we translate this into binary it comes 224.0.0.10 the multicast address of the EIGRP , then we move five steps ahead of this HEX character we see 00000FA5 and this is our neighouring router AS number , we convert this HEX number into binary it comes “4005” and that is our AS number of the BB1.

Lets not assume and configure R1 with AS 4005 and see what results we see.

R1(config)#no router eigrp 100
R1(config)#router eigrp 4005
R1(config-router)#no auto
R1(config-router)#netw 0.0.0.0
R1(config-router)#
*Mar  1 00:23:39.883: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 4005: Neighbor 200.200.200.2 (Serial0/0) is up: new adjacency

So now it is confirmed that the BB1 AS number is 4005.

OSPF Cost Manipulation
======================
The equation used for cost manipulation in OSPF is :-

OSPF Cost=Reference Bandwidth/Interface Bandwidth

It simply means that we can manipulate any one of the three parameters to
adjust our OSPF cost.
First of all we can apply the OSPF cost straight by the “ip ospf cost [1-65535]”
to the particular interface.Example:-
R1#conf t
R1(conf)#interface Serial0/0
R1(conf-if)#ip ospf cost 20

Second way to accomplish this by changing the Reference Bandwidth and this is done
under OSPF process:-
R1(conf)#router ospf 1
R1(config-router)#auto-cost reference bandwidth 20000

By default,OSPF calculates the cost of an interface by dividing the bandwidth
of the interface into 100 million(10 to the power 8).
So now our formula look like this:-

OSPF Cost=100000000/interface BW in BPS

NOTE:-Whenever you change Reference Bandwidth make sure it should be same across

all routers in your OSPF domain,also the router will prompt for this:-

R1(config-router)#auto-cost reference-bandwidth 20000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.
R1(config-router)#end

Also by default router will take auto-cost reference bandwidth in MBPS.

Rack1R1(config-router)#auto-cost reference-bandwidth ?
  <1-4294967>  The reference bandwidth in terms of Mbits per second

So thus using the default value and your network has interfaces with the bandwidth
greater than 100 million is not recommended,the reason is simple because OSPF
cannot differentiate between 100 mbps interface and an interface greater than
100 mbps,as in the above example “ip ospf cost”command enables you to change the
OSPF cost for an interface,but the better way to do this is to change the default
reference value.But always change the default behaviour of any protocol with
caution,so here in our scenario we need to change the default Reference cost in
every OSPF router in our routing domain.

The third way is also simple as here we need to manipulate the interface bandwidth,
to get our desired OSPF cost,it is simply done by the command:-
R1(conf)#interface Serial 0/0
R1(conf-if)#bandwidth [the numerical value]

Some Common OSPF Costs:-
56k=1785
64k=1562
T1(1544)=64
E1(2048)=48
Ethernet=10
Fast Ethernet=1
Gig Ethernet=1
10 Gig Ethernet=1

Today while i was doing lab i was stuck in the scenario where i have to do unequal cost load balancing in the eigrp domain.After many hours i finally got the desired result , thought of sharing this , kindly tell me if i am wrong anywhere.

One of the most important factors in choosing EIGRP as an IGP in the Network is the ability of  doing unequal cost load balancing.To enable this feature into Eigrp we need to issue “Variance” command under the Eigrp process.In order for path to be considered for unequal cost load balancing it must be a feasible successor with a metric less than or equal to the successor’s metric times the Variance.

Feasible Distance= Local Distance + Advertised Distance

A path whose advertised distance is lower than the feasible distance of the successor is deemed as feasible successor

Note:-Only routes that are feasible successors can be used for unequal cost load
balancing.

The formula for Eigrp Metric calculation:-

Metric = [k1 * bandwidth + (k2 * bandwidth)/(256 – load) + k3 * delay] *[k5/(reliability + k4)]

The “k” values are derived from the metric weights command, where K1 and
K3 are 1 by default and all other values are 0. This essentially means that only
bandwidth and delay are taken into account. “Bandwidth” is the inverse
bandwidth in Kbps times 107 (107/BWKbps). “Delay” is delay in tens of microseconds (DLYusec/10). These values are added together and then scaled
by a factor of 256. The composite metric is therefore represented by default as:

Metric = (107/BWKbps + DLYusec/10) * 256

Note:-Try to use Delay instead of Bandwidth because by changing bandwidth and QoS is running in the network , it will effect the traffic drastically in the network.

In order to achieve the any desired ratio suppose we want to distribute traffic in a ratio of 3:1 among the successors and feasible successors, and we are using delay we can set our equation like BW1 and Delay1 for the one path and BW2 and Delay 2 for other path.Now the equation will look like this.

3*[107/BW1 in Kbps + Delay1 in usec/10) * 256]=(107/BW2 in Kbps + Delay2 in usec/10) * 256

Here in the above formula watchout for BW1 ,Delay1,BW2 and Delay2.

By taking BW1 and BW2 as it is from the interface , we can find the end result something like :- Delay1=something times Delay2 ,now we can put the value of Delay 2 to find out Delay 1.

Lastly we can apply this Delay to the interface and check and verify our configuration by :-

sh ip route [destination network address] | include frame|share

Check the ratio in the traffic share count to see the exact result between both the paths.Also dont forget to include the Variance command  in the  Eigrp process.

sh ip eigrp topology [destination network address]