Apr
24

GLBP, an acronym for Gateway Load Balancing Protocol, is a virtual gateway protocol similar to HSRP and VRRP. However, unlike its little brothers, GLBP is capable of using multiple physical gateways at the same time. As we know, a single HSRP or VRRP group represents one virtual gateway, with single virtual IP and MAC addresses. Only one physical gateway in a standby/redundancy group is responsible for packet forwarding, others remain inactive in standby/backup state. If you have R1, R2, R3 sharing the segment 174.X.123.0/24 with the physical IP addresses 174.X.123.1, 174.X.123.2 and 174.X.123.3 you may configure them to represent one single virtual gateway with an IP address 174.X.123.254. The physical gateway priority settings will determine which physical gateway takes the role of the active packet forwarder. The hosts on the segment will set their default gateway to 174.X.123.254, staying isolated of the physical gateway failures.

GLBP brings this idea to new level, by allowing multiple physical gateways to participate in packet forwarding simultaneously. Considering the example above, imagine you need the hosts on the segments to fully utilize all existing physical gateways, yet provide recovery from a gateway failure. For instance, you may want 50% of outgoing packets to be sent up to R1, 30% to R2 and 20% to R3. At the same time, you want to ensure, that hosts using either of the gateways will automatically switch to another if their gateway fails. On top of that, all hosts in the segment should reference to the virtual gateway using the same IP address 174.X.123.254. This is a complicated task, which has being addressed by GLBP protocol design.

To begin with, we should recall that every host on the segment needs to resolve the virtual gateway IP address 174.X.123.254 to the MAC address using ARP protocol. When we use HSRP or VRRP, the ARP response will be the virtual MAC addresses, which is assigned to the active physical gateway. At this point, GLBP responds with different virtual MAC addresses of the physical gateways in the GLBP group. So the key idea with GLBP is accomplishing load-balancing by responding to ARP requests with different virtual MAC addresses.

Here are the implementation details. One of the routers in a GLBP group is elected as an AVG – Active Virtual Gateway. There is only one active AVG in a group, and its task is to respond to ARP requests sent to the virtual gateway IP address (e.g. 174.X.123.254) replying different virtual MAC addresses in response packets. The AVG will also implement load-sharing algorithm, e.g. by sending the replies in proportion to weights configured for physical gateways. Aside from AVG, the other logical component of GLBP implementation is AVF – Active Virtual Forwarder. Any physical gateway in a GLBP group may act as AVF – in fact all physical gateways are usually AVFs. Every AVF has a virtual MAC address assigned by an AVG and a weight value configured by an operator.

Now let’s discuss redundancy – the primary goal of any virtual router protocol. There are two logical entities used to build a GLBP group: AVGs and AVFs, and each of them needs a backup scheme. Since there is just one AVG per a GLBP group, the procedure is pretty simple: each candidate AVG has a priority value assigned; the highest priority router becomes an active AVG, the next by priority becomes a standby AVG. You may configure AVG preemption, so that a newly configured router with highest priority value becomes AVG, preemption the old one.

What about AVF redundancy? First, we need to understand that AVFs are always “active” in the sense that they are always used by a load-balancing algorithm. (However, by setting an AVG weight value below threshold, we may effectively take the AVF out of service. The weight value could be combined with object tracking to bring powerful traffic manipulation options). Next, with respect to redundancy, all AVFs backup each other. For instance, take any AVF: with respect to the other AVFs it is “Active”, and the remaining AVFs are in “Listen” state. If the AVF would fail, other gatewyas will detect the event using Hold timer expiration, and immediately try to take over the failed AVF virtual MAC address. Among the competitors, the AVF with highest weight value would win, and the remaining AVFs will switch back to “Listen” state. At this point, the “winner” will start accepting packets for two virtual MAC addresses: it’s own, and the one it has obtained from the failed AVF. At the same moment, two timers would start: Redirect and Secondary Hold. The Redirect timer determines how long will AVG continue to respond to ARP requests with the virtual MAC of the failed AVF. The Secondary Hold timer sets the amount of time the backup AVF will continue to accept packet for the virtual MAC address taken from the failed AVF.

This is basically how GLBP works. Different load-balancing algorithms are supported – the default one is round robin, with options for weighted load balancing and source-MAC based. The last one will always respond with the same vMAC to the same source MAC address, thereby defining sort of host-gateway “stickiness”. Now for a sample GLBP configuration, for the above mentioned R1, R2 and R3:

!
!  We set load-balancing to weighted only on R1
!  So if R2 will become the AVG, it will use round-robin
!  load-balancing technique
!
R1:
interface FastEthernet0/0
 ip address 174.1.123.1 255.255.255.0
 glbp 123 ip 174.1.123.254
 glbp 123 preempt
 glbp 123 weighting 50
 glbp 123 load-balancing weighted
!
!
!
R2:
interface FastEthernet0/0
 ip address 174.1.123.2 255.255.255.0
 glbp 123 ip 174.1.123.254
 glbp 123 priority 50
 glbp 123 preempt
 glbp 123 weighting 30
!
!
!
R3:
interface Ethernet0/0
 ip address 174.1.123.3 255.255.255.0
 glbp 123 ip 174.1.123.254
 glbp 123 priority 25
 glbp 123 preempt
 glbp 123 weighting 20

Some show output:

Rack1R1#show glbp
FastEthernet0/0 - Group 123
  State is Active
    2 state changes, last state change 03:12:05
  Virtual IP address is 174.1.123.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.916 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption enabled, min delay 0 sec
  Active is local
  Standby is 174.1.123.2, priority 50 (expires in 8.936 sec) <-- Standby AVG
  Priority 100 (default)
  Weighting 50 (configured 50), thresholds: lower 1, upper 50 <--
<-- Should the weight go below thresh, AVF is taken offline
  Load balancing: weighted
  Group members:
    ca00.0156.0000 (174.1.123.1) local <--   Hardware MACs
    ca01.0156.0000 (174.1.123.2)
    cc02.0156.0000 (174.1.123.3)
  There are 3 forwarders (1 active)
  Forwarder 1
    State is Listen <--  All other AVFs Listen to us
    MAC address is 0007.b400.7b01 (learnt) <--  Virtual MAC 
    Owner ID is ca01.0156.0000 <--  This is R2
    Redirection enabled, 598.928 sec remaining (maximum 600 sec) <--
<-- ARP replies with this vMAC are being sent by AVG
    Time to live: 14398.376 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 174.1.123.2 (primary), weighting 30 (expires in 8.368 sec) <--
   <--  The AVF reports it’s own IP as active
    Arp replies sent: 1
  Forwarder 2
    State is Active <--  Active mean it’s us
      1 state change, last state change 03:12:45
    MAC address is 0007.b400.7b02 (default)
    Owner ID is ca00.0156.0000 <--  R1 MAC address
    Redirection enabled
    Preemption enabled, min delay 30 sec
    Active is local, weighting 50
    Arp replies sent: 1
  Forwarder 3
    State is Listen <--  All other AVFs Listen to us
    MAC address is 0007.b400.7b03 (learnt)
    Owner ID is cc02.0156.0000 <--  This is R3
    Redirection enabled, 597.916 sec remaining (maximum 600 sec)
    Time to live: 14397.916 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 174.1.123.3 (primary), weighting 20 (expires in 7.916 sec)

Rack1R2#show glbp
FastEthernet0/0 - Group 123
  State is Standby
    4 state changes, last state change 03:16:56
  Virtual IP address is 174.1.123.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.236 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption enabled, min delay 0 sec
  Active is 174.1.123.1, priority 100 (expires in 9.148 sec)
  Standby is local <-- We are the standby AVG
  Priority 50 (configured)
  Weighting 30 (configured 30), thresholds: lower 1, upper 30
  Load balancing: round-robin
  Group members:
    ca00.0156.0000 (174.1.123.1)
    ca01.0156.0000 (174.1.123.2) local
    cc02.0156.0000 (174.1.123.3)
  There are 3 forwarders (1 active)
  Forwarder 1
    State is Active
      1 state change, last state change 03:18:06
    MAC address is 0007.b400.7b01 (default)
    Owner ID is ca01.0156.0000 <-- This is R2
    Preemption enabled, min delay 30 sec
    Active is local, weighting 30
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.7b02 (learnt)
    Owner ID is ca00.0156.0000
    Time to live: 14398.644 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 174.1.123.1 (primary), weighting 50 (expires in 8.636 sec)
  Forwarder 3
    State is Listen
    MAC address is 0007.b400.7b03 (learnt)
    Owner ID is cc02.0156.0000
    Time to live: 14399.260 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 174.1.123.3 (primary), weighting 20 (expires in 9.260 sec)

Now let’s check how ARP redirection works:

Rack1SW1#ping 174.1.123.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 174.1.123.254, timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 8/12/16 ms

Rack1SW1#sh ip arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  174.1.123.254           0   0007.b400.7b01  ARPA   Vlan1
Internet  174.1.123.7             -   cc06.0156.0000  ARPA   Vlan1
Internet  174.1.123.2             0   ca01.0156.0000  ARPA   Vlan1
Rack1SW1#clear arp-cache 

Rack1SW1#ping 174.1.123.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 174.1.123.254, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 4/13/32 ms

Rack1SW1#sh ip arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  174.1.123.254           0   0007.b400.7b02  ARPA   Vlan1
Internet  174.1.123.7             -   cc06.0156.0000  ARPA   Vlan1
Internet  174.1.123.2             0   ca01.0156.0000  ARPA   Vlan1

Repeat the above actions a few more times

Rack1SW1#sh ip arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  174.1.123.254           0   0007.b400.7b03  ARPA   Vlan1
Internet  174.1.123.7             -   cc06.0156.0000  ARPA   Vlan1
Internet  174.1.123.2             0   ca01.0156.0000  ARPA   Vlan1
Internet  174.1.123.3             0   cc02.0156.0000  ARPA   Vlan1

To summarize, GLBP is a virtual gateway protocol, with built-in load-balancing capabilities. Load balancing is based on manipulating ARP responses to the requests sent to the virtual gateway IP address. AVG role is used to load-balance and respond to ARP requests. AVF role manages one or more virtual MACs and is responsible for packet forwarding. AVG redundancy is controlled by GLBP priority and AVF redundancy is implemented using AVF weight value and two additional timers.

Further reading:

GLBP Overview

About Petr Lapukhov, 4xCCIE/CCDE:

Petr Lapukhov's career in IT begain in 1988 with a focus on computer programming, and progressed into networking with his first exposure to Novell NetWare in 1991. Initially involved with Kazan State University's campus network support and UNIX system administration, he went through the path of becoming a networking consultant, taking part in many network deployment projects. Petr currently has over 12 years of experience working in the Cisco networking field, and is the only person in the world to have obtained four CCIEs in under two years, passing each on his first attempt. Petr is an exceptional case in that he has been working with all of the technologies covered in his four CCIE tracks (R&S, Security, SP, and Voice) on a daily basis for many years. When not actively teaching classes, developing self-paced products, studying for the CCDE Practical & the CCIE Storage Lab Exam, and completing his PhD in Applied Mathematics.

Find all posts by Petr Lapukhov, 4xCCIE/CCDE | Visit Website


You can leave a response, or trackback from your own site.

29 Responses to “GLBP Explained”

 
  1. Souliouz says:

    Another great article Petr; thank you.

  2. Khamees Elkhateeb says:

    GREAT article, helped me allot, keep the good work

  3. Pieter says:

    Does GLBP work with ICMP re-direct ?

    This will allow the traffic to use the optimal GW.

  4. Hi Petr,

    During 2006 in my previous job, I tested GLBP in a Cat6500/Sup720-3B environment, and while the protocol worked perfectly, at the time there was no SNMP MIB available for it. The result was that we had to decide against using GLBP on the production network since it couldn’t be managed. I was just wondering whether a GLBP management MIB has since been published?

    Nicely written article, by the way!

    Cheers,
    Rob.

  5. Ciscozine says:

    GLBP provides load balancing over multiple routers (gateways) using a single virtual IP address and multiple virtual MAC addresses. Each host is configured with the same virtual IP address, and all routers in the virtual router group participate in forwarding packets. GLBP members communicate between each other through hello messages sent every 3 seconds to the multicast address 224.0.0.102, User Datagram Protocol (UDP) port 3222 (source and destination).

    http://www.ciscozine.com/2008/11/18/configuring-redundancy-with-glbp/

  6. Ashish says:

    Nice article..keep up the good work.

  7. Paulus says:

    Ok. Here’s the question.
    Does the interface having AVF in listen state forward a received frame if it has destination mac of this AVF. GLBP should make sure that it will never happen but lets say some downstream switch mistake caused a frame being switched towards the wrong router (not towards ‘active’ AVF but ‘listen’ one ?
    (will try to test)

    • Andre Costa says:

      “Listen” state is related to listen the other AVFs status.

      A AVF in listen state will continue to forward packets normally

  8. michash says:

    Nice one there. keep up the good work.
    Certainly enjoyed the verification part.

    kudos.

  9. Raman says:

    Default mode of glbp is round-robin not weighted

  10. Bill says:

    Question? Preempt delay minimum timer. The default is 30 secs, what variables would need be considered to make the minimum delay longer? Three router 100 Mbps flat network.

    Thanks.

  11. ryan@lan says:

    Does my mac adresse change if I upgrade my computer with some other hardware? For example change the graphic card?

  12. empisko says:

    Thanks a lot. good article to understand glbp.

  13. John Walshaw says:

    GLBP… works great for upstream (first hop) raffic. I’m having dificulty engineering the return path of the traffic as it seems that all traffic comes back via one of the routers (last hop). Any tips?

  14. Really Too Good I AM IN LOVE IT.

    CAN U PROVIDE YOUR ADDRESS AT AHEMEDABAD INDIA
    I WANT TO LEARN CCNP FROM U.

  15. Salih Bin Waleed says:

    Network Topology
    ==============

    Clietns >> Proxy Server >> Firewall (PIX 515e) >> GLBP devices (3 adsl routers).

    I need to set up an Internet pipe of 6MB downstream and 1.5MB upstream using the GLBP feature in three Cisco 871 ADSL routers. I’m based in the United Arab Emirates and the only ISP in the country will NOT give me ADSL lines in excess of 2MB with 512 upstream.

    Above network topology, so technically the technologies am trying to put together aren’t cooperating the way I’d like them to. Will have ARP caching issues.

    Appreciate letting me know whether below configuration will work.

    R1

    Int vlan 1
    ip add [add]
    glbp 100 ip 192.168.1.36
    glbp 100 preempt
    glbp 100 weighting 40
    glbp 100 load-balacing weighted

    R2

    Int vlan 1
    ip add [add]
    glbp 100 ip 192.168.1.36
    glbp 100 preempt
    glbp 100 priority 50
    glbp 100 weighting 30

    R3

    Int vlan 1
    ip add [add]
    glbp 100 ip 192.168.1.36
    glbp 100 preempt
    glbp 100 priority 40
    glbp 100 weighting 25

  16. James Kinney says:

    How do the glbp weighting lower and upper variables work? How do they impact a configuration?

  17. hsalgado says:

    I realize that you may be going for simplicity but why is it that there is only one active AVG in a group. Wouldn’t it be more beneficial to have these allocated dynamically? Is it really that much more of a design impact otherwise?

    • @hsalgado,

      There is only one active AVG, but it is fully redundnant. As soon as the other members of GLBP group miss some hello packets from the active AVG, they elect another one based on the priority scheme, very much similar to HSRP/VRRP.

  18. Nizar Makarem says:

    Well, actually this is the best explanation I’ve read about GLBP, but my concern is this, think of layer 2:
    Imagine you have 4 routers connected to a switch, every router to a different port on the switch, when the AVG responds to ARP requests with the virtual MAC of the AVF, the switch port that is connected to the AVG update its MAC table, and the switch thinks that this MAC address is associated with the port where the ARP response was received, in this case, the port where is connected the AVG, and not where it really is the AVF, it happens beacuse the switches associates the source MAC address of frames with the ports where they are received.
    So, what am i missing? How does the AVG do for the switch to forward frames to ports which AVF are connected to?

  19. milk says:

    @Nizar Makarem

    AVG sends ARP reply using virtual MAC of its own as the frame’s source address.

  20. [...] #show glbp brief You can download my topolgy and config files here. Read more: Wikipedida , Cisco , INE CCIE Blog منبع: http://www.1cisco.com I Love Netw0rk —————– CCNP CCNA Security MCITP MCSE [...]

  21. [...] #show glbp #show glbp brief You can download my topolgy and config files here. Read more: Wikipedida , Cisco , INE CCIE Blog [...]

  22. Ranjan says:

    Again you proved…:)

  23. prasanth says:

    got a god idea about the topic.
    thanks

  24. Siddu says:

    Is Glbp use Per-paket or Per-destination method

  25. Diwa says:

    Hi ,

    One doubt i want to know how the GLBP knows the load balancing in the weighting , Suppose GLBP configured in 3 routers e.g .
    In R1 weighting configured as 50
    In R2 weighting 30
    In R3 weighting 20
    Suppose 100 PC in the network.how the AVG decide to whom need to assign the vMAC address.
    For e.g if first 50 PC will receive vMAC of R1 for the request then 30 receive vMAC of R2 the 20 PC receive vMAC of R3 ?

  26. [...] INE BLOG  :-  GLBP Explained [...]

 

Leave a Reply

Categories

CCIE Bloggers