Saturday, February 25, 2012

GLBP

GLBP

  • Gateway load balancing Protocol  Cisco Propetiary
  • Extends HRSP functionality to natively support load balancing
  • We can load balance in VRRP or HRSP by configuring multiple groups on interfaces
  • But GLBP provides native inbuilt load balancing forUp to 4 devices
  • There is 2 election first election is for AVG (Active Virtual Gateway) this is based on priority and highest ip as tie breaker
  • The AVG will then look at all possible forwarders if there is more than 4 it will elect forwarders and standby devices.
  • This election is based on weight. The weight will also decipher traffic share of load balancing given to each gateway. It is not exact but provides some level of weight
  • When a client arp for the gateway address the AVG will reply with the mac of one of the forwarder it will go throught them in weighted round robin way
  • As client keep arp cache and will not arp every time for the gateway address so the load balancing is not exact
  • 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)
  • We can manipulate to weight in conjuction with the likes of ip sla and enhanced object tracking to say if a particualr happens the weight will be decremented.
  • We configure upper and lower limit if we go below the lower limit we lose our avf status the upper limit is the weight we must be at the regain our avf status
  • default priority is 100
Commands

int fa0/0
glbp 10 ip 10.10.10.1
glbp 10 priority 110
glbp 10 weighting 110 lower 85 upper 105
glbp 10 track 20 decrement 30

ip sla 18
icmp echo 10.9.9.9
ip sla schedule 18 start now life forever

track 20 rtr 18 state

so in the abover we track the reachability from this layer 3 switch to 10.9.9.9 if it is not reachable we decrement our weight by 30 this would have us at weight 80 below the lower limit so we would lose our avf status

LAB
----

r6
---
r6(config-subif)#int fa0/0.146
r6(config-subif)#glbp 10 ip 155.0.146.254
r6(config-subif)#
*Feb 25 13:48:26.962: GLBP: joining IPv4 multicast on Fa0/0.146
*Feb 25 13:48:26.962: GLBP: joining IPv6 multicast on Fa0/0.146
*Feb 25 13:48:26.962: GLBP: Fa0/0.146 API 155.0.146.254 is not a GLBP address in table 0
*Feb 25 13:48:26.962: GLBP: Fa0/0.146 10 Disabled: a/GLBP IP address configured
*Feb 25 13:48:26.962: GLBP: Fa0/0.146 10 Disabled -> Init
r6(config-subif)#
*Feb 25 13:48:36.966: GLBP: Fa0/0.146 Interface up
*Feb 25 13:48:36.966: GLBP: Fa0/0.146 10 Init: d/GLBP enabled
*Feb 25 13:48:36.966: GLBP: Fa0/0.146 10 Init -> Listen
*Feb 25 13:48:39.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Listen  pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:39.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:39.966:     UDP src=3222, dst=3222
*Feb 25 13:48:42.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Listen  pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:42.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:42.966:     UDP src=3222, dst=3222
*Feb 25 13:48:45.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Listen  pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:45.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:45.966:     UDP src=3222, dst=3222
*Feb 25 13:48:46.966: GLBP: Fa0/0.146 10 Listen: g/Active timer expired (unknown)
*Feb 25 13:48:46.966: GLBP: Fa0/0.146 10 Listen -> Speak
*Feb 25 13:48:46.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Speak   pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:46.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:46.966:     UDP src=3222, dst=3222
*Feb 25 13:48:49.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Speak   pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:49.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:49.966:     UDP src=3222, dst=3222
*Feb 25 13:48:52.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Speak   pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:52.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:52.966:     UDP src=3222, dst=3222
*Feb 25 13:48:55.874: IP: s=155.0.67.1 (FastEthernet0/0.67), d=224.0.0.1, len 28, rcvd 0, proto=2
*Feb 25 13:48:55.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Speak   pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:55.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:55.966:     UDP src=3222, dst=3222
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10 Speak: f/Standby timer expired (unknown)
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10 Standby router is local
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10 Speak -> Standby
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 Grp 10 Hello  out VG Standby pri 100 vIP 155.0.146.254 hello 3000, hold 10000
*Feb 25 13:48:56.966: IP: s=155.0.146.6 (local), d=224.0.0.102 (FastEthernet0/0.146), len 68, sending broad/multicast
*Feb 25 13:48:56.966:     UDP src=3222, dst=3222
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10 Standby: g/Active timer expired (unknown)
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10 Active router IP is local
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10 Standby router is unknown, was local
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10 Standby -> Active
*Feb 25 13:48:56.966: %GLBP-6-STATECHANGE: FastEthernet0/0.146 Grp 10 state Standby -> Active
*Feb 25 13:48:56.966: GLBP: Fa0/0.146 10.1 Disabled: a/Forwarder MAC address acquired

we can see we are multicasting out 224.0.0.102 over protocol udp 3222
we go through VG (virtual gateway) listen and speak this is where would be doing the election if other gateways where online none are so we become active as the AVG


r6#sh glbp
FastEthernet0/0.146 - Group 10
  State is Active
    2 state changes, last state change 00:02:54
  Virtual IP address is 155.0.146.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.308 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption disabled
  Active is local
  Standby is unknown
  Priority 100 (default)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin
  Group members:
    0013.80e4.901a (155.0.146.6) local
  There is 1 forwarder (1 active)
  Forwarder 1
    State is Active
      1 state change, last state change 00:02:44
    MAC address is 0007.b400.0a01 (default)
    Owner ID is 0013.80e4.901a
    Redirection enabled
    Preemption enabled, min delay 30 sec
    Active is local, weighting 100
r6#

There is 2 parts to this output mainly the first part is referencing the active gateway and the 2nd part is refernecing the forwarders


r4
---
r4(config)#int fa0/1
r4(config-if)#glbp 10 ip 155.0.146.254


r4#sh glbp
FastEthernet0/1 - Group 10
  State is Standby
    1 state change, last state change 00:00:01
  Virtual IP address is 155.0.146.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.572 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption disabled
  Active is 155.0.146.6, priority 100 (expires in 9.928 sec)
  Standby is local
  Priority 100 (default)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin
  Group members:
    0012.d993.728d (155.0.146.4) local
    0013.80e4.901a (155.0.146.6)
  There are 2 forwarders (1 active)
  Forwarder 1
    State is Listen
    MAC address is 0007.b400.0a01 (learnt)
    Owner ID is 0013.80e4.901a
    Time to live: 14399.928 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 155.0.146.6 (primary), weighting 100 (expires in 9.452 sec)
  Forwarder 2
    State is Active
      1 state change, last state change 00:00:11
    MAC address is 0007.b400.0a02 (default)
    Owner ID is 0012.d993.728d
    Preemption enabled, min delay 30 sec
    Active is local, weighting 100
r4#
so we are in standby for the AVG as r6 is the AVG
there is 2 forwarders on the link

r6
---
r6(config-subif)#int fa0/0.146
r6(config-subif)#glbp 10 priority 90

the priority is in relation to active gateway not forwarding
preemption is disabled by default

r4
----
r4(config)#int fa0/1
r4(config-if)#glbp 10 preempt
r4(config-if)#
*Feb 25 13:45:44.866: %GLBP-6-STATECHANGE: FastEthernet0/1 Grp 10 state Standby -> Active

now i am the active gateway so i am responding to the arp request

if we look at this command on r4
r4(config)#int fa0/1
r4(config-if)#glbp 10 weighting 110 lower 85 upper 105

so the lower limit if my weighting goes below 85 i will no longer forward for the segement
but if my weighting comes back up to 105 i will be allowed forward for the segment
r4(config-if)#glbp 1 weighting track 1

We can get into complex ip sla so say if one ip is unreachable decrement 20 if another is down decrement by 10 so like we can be very specfic on what conditions we forwarder undert by messing around with the weights

we also tell r4 we want to load balance based on weighting
r4(config-if)#glbp 10 load-balancing weighted

1 comment: