]> git.proxmox.com Git - mirror_frr.git/commit - lib/bfd.h
Support for multi-client and client reg msg
authorradhika <radhika@cumulusnetworks.com>
Wed, 9 Mar 2016 07:31:32 +0000 (23:31 -0800)
committerradhika <radhika@cumulusnetworks.com>
Wed, 9 Mar 2016 07:31:32 +0000 (23:31 -0800)
commit055c4dfcde153e658aad1834e82e43777cf490c4
tree768cb640d80f64a8f75006bf502eb9fea88a55f9
parent8386ac4390f8fbe8daee8240766019f457fa0483
Support for multi-client and client reg msg

Ticket: CM-7615, CM-7773
Reviewed By: CCR-3610, CCR-3708
Testing Done: Unit, BGP Smoke and OSPF Smoke

Changes (70790261926b17200c8c9377c4576cd3b486fcef) ported from 2.5

Issue (related to CM-7615): 1. CM-7615: There is mismatch in the client name between ptm display of client BFD sessions and the zebra logs. For example, if bgpd added BFD session, zebra logs will show the client as “bgp” but the ptm display will show it as “quagga”
2. Bigger problem is when 2 clients (for example OSPF and BGP) from Quagga register for same BFD session and only one client de-registers the BFD session. This results in BFD session deletion from PTM even though other client still has the BFD registration.

Root Cause: Even though BGP, OSPF and OSPF6 are 3 different clients from Quagga that are trying to register/deregister BFD sessions with PTM, all 3 are represented as one client “quagga” from zebra. This makes it hard for PTM/BFD to distinguish between all three when BFD peer registration/deregistration happens from the clients.

Fix: Send the actual client name bgp, ospf or ospf6 from zebra with BFD reg/dereg messages instead of one unified client name “quagga”

CM-7773: BFD sessions are not getting cleaned from PTM even though no BGP peering exists in Quagga.

Root Cause: PTM cleans up stale BFD sessions from a client when it finds a change in seq id advertised by the client. But, if PTM never detects a change in the seq id then the stale BFD sessions never get cleaned up. The test restarts the quagga without saving the configuration, which results in no BGP peering. No BGP peers are registered with PTM after restart and PTM does not detect a client seq id change resulting in stale BFD sessions.

Fix: New client registration message was added in PTM. Every client that is interested in BFD monitoring will register with PTM with the client seq id. Client will register with a different seq id (typically pid) every time it restarts. This will help in detecting the change in seq id and cleanup of stale BFD sessions for a client.

Code Changes: To support the new client registration message following changes have been made
  - Added support for client registration messaging in zebra for sending messages to PTM.
  - Added support for client registration messaging between zebra and clients (BGP, OSPF and OSPF6) in BFD library.
  - Expanded the reg/de reg peer messaging between zebra and clients to support client specific seq id to distinguish between multiple clients registering for BFD peer rather than one “quagga” client.
  - Changes in bgpd, ospfd and ospf6d to send client registrations at the time of daemon initialization and on receiving BFD peer replay message.
bgpd/bgp_bfd.c
lib/bfd.c
lib/bfd.h
lib/log.c
lib/zebra.h
ospf6d/ospf6_bfd.c
ospfd/ospf_bfd.c
zebra/zebra_ptm.c
zebra/zebra_ptm.h
zebra/zserv.c
zebra/zserv.h