Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The code for handling the vrrp_garp_interval does not work properly #1760

Open
ziginet opened this issue Oct 18, 2020 · 0 comments
Open

The code for handling the vrrp_garp_interval does not work properly #1760

ziginet opened this issue Oct 18, 2020 · 0 comments

Comments

@ziginet
Copy link

ziginet commented Oct 18, 2020

Describe the bug
If I set vrrp_garp_interval to a value greater than 0.001, then Keepalived does not send the expected number of GARP messages. With the configuration below, Keepalived sends only 2 GARP messages per VIP address although it should send 5 (viz vrrp_garp_master_repeat 5).

Quentin Armitage:

I have looked at the code and the code for handling the vrrp_garp_interval does not work properly.

When the GARP messages are being sent, the code checks to see if vrrp_garp_interval has elapsed since the previous GARP message on the relevant interface has been sent. If it has not, the address gets marked as needing to send a GARP message, and a timer is set up. However, if multiple GARPs need to be sent for an address, that information is lost and only one more GARP will be sent.

The reason it appears to work properly when you set vrrp_garp_interval to 0.001 is that when the code is sending the second, third etc garp message, that time has elapsed since the previous GARP message was sent on the same interface, and so it is sent straight away.

The code for handling this is quite horrible and does not scale well to large configurations (since I wrote the code I can criticise it!).

Expected behavior
Keepalived will send the configured/required number of GARP messages.

Keepalived version
keepalived-1.3.5-16.el7.x86_64

Keepalived v1.3.5 (03/19,2017), git commit v1.3.5-6-g6fa32f2

Copyright(C) 2001-2017 Alexandre Cassen, acassen@gmail.com

Build options: PIPE2 LIBNL3 RTA_ENCAP RTA_EXPIRES RTA_PREF FRA_OIFNAME FRA_SUPPRESS_PREFIXLEN FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK LIBIPTC LIBIPSET_DYNAMIC LVS LIBIPVS_NETLINK VRRP VRRP_AUTH VRRP_VMAC SOCK_NONBLOCK SOCK_CLOEXEC FIB_ROUTING INET6_ADDR_GEN_MODE SNMP_V3_FOR_V2 SNMP SNMP_KEEPALIVED SNMP_CHECKER SNMP_RFC SNMP_RFCV2 SNMP_RFCV3 SO_MARK

Distro

  • Name: CentOS
  • Version: 7.8.2003
  • Architecture: x86_64

Details of any containerisation or hosted service (e.g. AWS)
virtual machine on VMware ESXi

Configuration file:

global_defs {
       router_id fw-1 / fw-2

       vrrp_garp_master_delay 5
       vrrp_garp_master_repeat 5

       vrrp_garp_lower_prio_delay 5
       vrrp_garp_lower_prio_repeat 5

       vrrp_garp_master_refresh 120
       vrrp_garp_master_refresh_repeat 2

       vrrp_garp_interval 0.2
       vrrp_gna_interval 0.2`
}

vrrp_instance VI_11 {
       priority 100 / priority 50
       state MASTER / state BACKUP

       interface int0
       virtual_router_id 11

       advert_int 1

       track_interface {
               net0
               dmz0
               int0
               ic0
       }

       virtual_ipaddress {
               10.1.1.1/24 dev net0
               10.2.2.1/24 dev dmz0
               10.3.3.1/24 dev int0
               10.4.4.1/24 dev ic0
        }

       include local.conf.d/VI_11_vroutes.conf

       smtp_alert
}

Additional context
viz https://groups.io/g/keepalived-users/message/313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant