FRRouting / frr

The FRRouting Protocol Suite

Home Page:https://frrouting.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BGP BFD strict mode is not working

pbrisset opened this issue · comments

Description

Expectations: When BFD goes down or admin down, associated BGP session must go down and stay down until BFD is back up.
 
Outcome: Currently, associated BGP session goes down and gets re-established.
 
Debugging:
BGP FSM outputs:
 
2024/06/07 16:50:53.747 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] Receive_NOTIFICATION_message (Established->Clearing), fd 25
2024/06/07 16:50:53.757 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] Clearing_Completed (Clearing->Idle), fd -1
2024/06/07 16:50:55.758 BGP: [ZQTB5-H8522] 192.168.1.1 [FSM] Timer (start timer expire).
2024/06/07 16:50:55.758 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] BGP_Start (Idle->Connect), fd -1
2024/06/07 16:50:55.758 BGP: [G0837-S7QES] 192.168.1.1 [FSM] Non blocking connect waiting result, fd 25
2024/06/07 16:50:55.759 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] TCP_connection_open (Active->OpenSent), fd 27
2024/06/07 16:50:55.759 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] TCP_connection_open (Connect->OpenSent), fd 25
2024/06/07 16:50:55.759 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] BGP_Stop (OpenSent->Idle), fd 27
2024/06/07 16:50:55.760 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] Receive_OPEN_message (OpenSent->OpenConfirm), fd 25
2024/06/07 16:50:55.760 BGP: [ZWCSR-M7FG9] 192.168.1.1 [FSM] Receive_KEEPALIVE_message (OpenConfirm->Established), fd 25
2024/06/07 16:50:55.761 BGP: [P3D3N-3277A] 192.168.1.1 [FSM] Timer (routeadv timer expire)
2024/06/07 16:50:56.911 BGP: [P3D3N-3277A] 192.168.1.1 [FSM] Timer (routeadv timer expire)
 
BGP session goes in from Established to Clearing to Idle state.
Then a timer is launched. On expiry, BGP_START is triggered. As part of that function, there is no check about BFD or on any notification from peer routers keeping the FSM in Idle state. The only existing verification is about PEER_FLAG_PASSIVE.

Here is the messages from BFD:

2024/06/07 16:50:53.746 BGP: [Q4BCV-6FHZ5] zclient_bfd_session_update: 0.0.0.0/32 -> 192.168.1.1/32 (interface torm11-eth0) VRF default(0) (CPI bit no): Admin Down
2024/06/07 16:50:53.746 BGP: [MKVHZ-7MS3V] bfd_session_status_update: neighbor 192.168.1.1 vrf default(0) bfd state Up -> Admin Down
2024/06/07 16:50:53.746 BGP: [QFMSE-NPSNN] zclient_bfd_session_update: sessions updated: 1

2024/06/07 16:50:53.747 BGP: [HZN6M-XRM1G] %NOTIFICATION(Hard Reset): received from neighbor 192.168.1.1 6/10 (Cease/BFD Down) 0 bytes

Version

FRR 8.5.1

Problem seems also to be in master

How to reproduce

Using topotest,

I configure the BFD and BGP like this on B2B devices

bfd
profile foo
exit
!
peer 192.168.1.1 interface torm11-eth0
profile foo
receive-interval 299
exit
!
exit

router bgp 65011
bgp router-id 192.168.100.15
neighbor 192.168.1.1 remote-as external
neighbor 192.168.1.1 bfd
neighbor 192.168.1.1 bfd profile foo

Expected behavior

When adding "shutdown" command to "BDF profile foo", I'm expecting the BGP session to 192.168.1.1 to go down and remain down. Unfortunately, it only gets reset.

Actual behavior

As per description, FSM state transitions are shown.

Additional context

The only similar issue open found is: #14266

But it is not quite the same.

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.