본문 바로가기

Networking

BFD Overview

 

BFD는 Bidirectional Forwarding Direction은 Transport Node(Host 또는 Edge)의 TEP Interface, BGP Peer 간의 Forwarding Path Failure를 감지하기 위해서 사용됩니다.

 

BFD는 RFC5880에 정의되어 있습니다.

https://datatracker.ietf.org/doc/rfc5880/

 

BFD는 상태 확인을 위해서, BFD Control 이라는 Heartbeat과 유사한 Packet(UDP 3784)을 이용합니다.

 

또한, Transport Node(Host 또는 Edge)간의 TEP Interface간에 주고받는 BFD Packet는 VNI 0 값을 이용하여 GENEVE로 Encapsulation 되게 됩니다.

 

TEP Tunnel Interface 간에는 매 초마다 Packet을 보내며, 3초 동안 반대편으로 부터 수신되는 BFD Packet이 없는 경우 Down 상태로 변경됩니다.

 

BFD의 상태 정보는 BFD Control Packet 내에서 State field 값으로 Down, Init, Up으로 구분되며 상태가 변경된 상세 정보를 제공하기 위한 Diagnostic field도 존재합니다.

 

BFD State

   State (Sta)

      The current BFD session state as seen by the transmitting system.
      Values are:

         0 -- AdminDown
         1 -- Down
         2 -- Init
         3 -- Up

 

 

Down State는 양 방향의 Path에 문제가 있는 경우,

한 쪽이 Init State이고, 다른 한 쪽이 Down State인 경우, Init State 쪽 Interface는 반대편으로부터 BFD Packet을 정상적으로 수신하고 있다는 의미

Up State는 양 방향으로 BFD Packet을 주고받는데 문제가 없다는 의미

 

BFD Diagnotic

   Diagnostic (Diag)

      A diagnostic code specifying the local system's reason for the
      last change in session state.  Values are:

         0 -- No Diagnostic
         1 -- Control Detection Time Expired
         2 -- Echo Function Failed
         3 -- Neighbor Signaled Session Down
         4 -- Forwarding Plane Reset
         5 -- Path Down
         6 -- Concatenated Path Down
         7 -- Administratively Down
         8 -- Reverse Concatenated Path Down
      9-31 -- Reserved for future use

 

NSX UI에서 확인하는 방법은 다음과 같습니다.

System > Fabric > Nodes > Host or Edge Transport Nodes

 

ESXi Host의 경우

 

 

Edge의 경우

 

Tier-0 Gateway의 경우

 

Edge 상단 Router의 경우

vyos@vyos:~$ show protocols bfd peer
BFD Peers:
        peer 192.168.13.12 vrf default interface eth5.1613
                ID: 681435353
                Remote ID: 2163667405
                Status: up
                Uptime: 3 minute(s), 30 second(s)
                Diagnostics: ok
                Remote diagnostics: ok
                Peer Type: configured
                Local timers:
                        Detect-multiplier: 3
                        Receive interval: 300ms
                        Transmission interval: 500ms
                        Echo transmission interval: 50ms
                Remote timers:
                        Detect-multiplier: 3
                        Receive interval: 500ms
                        Transmission interval: 500ms
                        Echo transmission interval: 0ms
 
        peer 192.168.13.11 vrf default interface eth5.1613
                ID: 4052008042
                Remote ID: 3337763264
                Status: up
                Uptime: 3 minute(s), 30 second(s)
                Diagnostics: ok
                Remote diagnostics: ok
                Peer Type: configured
                Local timers:
                        Detect-multiplier: 3
                        Receive interval: 300ms
                        Transmission interval: 500ms
                        Echo transmission interval: 50ms
                Remote timers:
                        Detect-multiplier: 3
                        Receive interval: 500ms
                        Transmission interval: 500ms
                        Echo transmission interval: 0ms
 
        peer 192.168.12.12 vrf default interface eth4.1612
                ID: 3534864524
                Remote ID: 1639802836
                Status: up
                Uptime: 3 minute(s), 30 second(s)
                Diagnostics: ok
                Remote diagnostics: ok
                Peer Type: configured
                Local timers:
                        Detect-multiplier: 3
                        Receive interval: 300ms
                        Transmission interval: 500ms
                        Echo transmission interval: 50ms
                Remote timers:
                        Detect-multiplier: 3
                        Receive interval: 500ms
                        Transmission interval: 500ms
                        Echo transmission interval: 0ms
 
        peer 192.168.12.11 vrf default interface eth4.1612
                ID: 4233090250
                Remote ID: 322826468
                Status: up
                Uptime: 3 minute(s), 30 second(s)
                Diagnostics: ok
                Remote diagnostics: ok
                Peer Type: configured
                Local timers:
                        Detect-multiplier: 3
                        Receive interval: 300ms
                        Transmission interval: 500ms
                        Echo transmission interval: 50ms
                Remote timers:
                        Detect-multiplier: 3
                        Receive interval: 500ms
                        Transmission interval: 500ms
                        Echo transmission interval: 0ms

 

CLI에서 확인하는 방법은 다음과 같습니다.

Host의 경우

# nsxdp-cli bfd sessions list
Remote                        Local                         local_disc          remote_disc         recvd               sent                local_state         local_diag          client              flaps               bfd_type        
192.168.11.2                  192.168.10.5                  dc288d52            d32528e             294148              140439              up                  No Diagnostic       vdl2                1                   Tunnel          
192.168.11.4                  192.168.10.4                  f3d8853e            d799f5ab            294120              140385              up                  No Diagnostic       vdl2                1                   Tunnel          
192.168.11.5                  192.168.10.5                  fd071d              a790473             294154              140431              up                  No Diagnostic       vdl2                1                   Tunnel          
192.168.11.4                  192.168.10.5                  88d9bfce            a0cbec13            294304              140340              up                  No Diagnostic       vdl2                1                   Tunnel          
192.168.11.3                  192.168.10.4                  21b912da            e09429c9            294152              140375              up                  No Diagnostic       vdl2                1                   Tunnel          
192.168.11.3                  192.168.10.5                  4c55ee13            d2188adf            294126              140346              up                  No Diagnostic       vdl2                1                   Tunnel          
192.168.11.2                  192.168.10.4                  80594095            83e85c3f            294193              140411              up                  No Diagnostic       vdl2                1                   Tunnel          
192.168.11.5                  192.168.10.4                  9fe9e391            894e7374            294030              140371              up                  No Diagnostic       vdl2                1                   Tunnel

 

Edge의 경우

edge-node-01> get bfd-sessions
Sun Sep 24 2023 UTC 03:00:30.377
BFD Session
Dest_port                     : 4784
Diag                          : No Diagnostic
Encap                         : vlan
Forwarding                    : last true (current true)
Interface                     : 3b3a62f0-5190-50a3-bfa4-e788ed231115
Keep-down                     : false
Last_admin_down_diag_time     : 2023-09-21 08:14:24
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_cpath_down_diag_time     : 2023-09-21 08:14:25
Last_down_time                : 2023-09-21 08:11:23
Last_fwd_state                : NONE
Last_local_down_diag          : Control Detection Time Expired
Last_remote_admin_down_time   : 2023-09-21 08:14:24
Last_remote_down_diag         : Administratively Down
Last_up_time                  : 2023-09-21 08:14:24
Local_address                 : 192.168.11.4
Local_discr                   : 216713396
Min_rx_ttl                    : 1
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.11.2
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 420931353
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 4784
Diag                          : No Diagnostic
Encap                         : null
Forwarding                    : last true (current true)
Interface                     : 00000000-0000-0000-0000-000000000000
Keep-down                     : false
Last_admin_down_diag_time     : 2023-09-21 08:14:24
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_cpath_down_diag_time     : 2023-09-21 08:14:25
Last_down_time                : 2023-09-21 08:11:23
Last_fwd_state                : NONE
Last_local_down_diag          : Control Detection Time Expired
Last_remote_admin_down_time   : 2023-09-21 08:14:24
Last_remote_down_diag         : Administratively Down
Last_up_time                  : 2023-09-21 08:14:25
Local_address                 : 192.168.1.111
Local_discr                   : 2216966729
Min_rx_ttl                    : 1
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.1.112
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 1174441332
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : MGMT
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 3784
Diag                          : No Diagnostic
Encap                         : geneve
Forwarding                    : last true (current true)
Interface                     : 00523e2b-7462-5c81-b0fd-851280477cbe
Keep-down                     : false
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_fwd_state                : NONE
Last_local_down_diag          : No Diagnostic
Last_remote_down_diag         : No Diagnostic
Last_up_time                  : 2023-09-22 15:14:30
Local_address                 : 192.168.11.4
Local_discr                   : 3617191339
Min_rx_ttl                    : 255
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.10.4
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 4091053374
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 3784
Diag                          : No Diagnostic
Encap                         : geneve
Forwarding                    : last true (current true)
Interface                     : 795518a7-d9a5-56a3-a362-95b17e9fef35
Keep-down                     : false
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_fwd_state                : NONE
Last_local_down_diag          : No Diagnostic
Last_remote_down_diag         : No Diagnostic
Last_up_time                  : 2023-09-22 15:14:15
Local_address                 : 192.168.11.5
Local_discr                   : 175703155
Min_rx_ttl                    : 255
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.10.5
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 16582429
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 3784
Diag                          : No Diagnostic
Encap                         : geneve
Forwarding                    : last true (current true)
Interface                     : 00e6e21c-9f5a-5dc0-9cf1-0481561600c0
Keep-down                     : false
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_down_time                : 2023-09-21 08:11:23
Last_fwd_state                : NONE
Last_local_down_diag          : Control Detection Time Expired
Last_remote_down_diag         : Control Detection Time Expired
Last_up_time                  : 2023-09-21 08:14:25
Local_address                 : 192.168.11.4
Local_discr                   : 883874198
Min_rx_ttl                    : 255
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.11.3
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 3709788688
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 3784
Diag                          : No Diagnostic
Encap                         : geneve
Forwarding                    : last true (current true)
Interface                     : 57b791cd-f8dd-520a-8283-f694c22c1a9d
Keep-down                     : false
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_fwd_state                : NONE
Last_local_down_diag          : No Diagnostic
Last_remote_down_diag         : No Diagnostic
Last_up_time                  : 2023-09-22 15:14:15
Local_address                 : 192.168.11.4
Local_discr                   : 2697718803
Min_rx_ttl                    : 255
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.10.5
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 2295971790
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 3784
Diag                          : No Diagnostic
Encap                         : geneve
Forwarding                    : last true (current true)
Interface                     : e7574317-b354-5b2a-be6b-8dc8c3bedc3b
Keep-down                     : false
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_fwd_state                : NONE
Last_local_down_diag          : No Diagnostic
Last_remote_down_diag         : No Diagnostic
Last_up_time                  : 2023-09-22 15:14:30
Local_address                 : 192.168.11.5
Local_discr                   : 2303619956
Min_rx_ttl                    : 255
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.10.4
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 2682905489
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 3784
Diag                          : No Diagnostic
Encap                         : geneve
Forwarding                    : last true (current true)
Interface                     : f70db2bd-ef1c-5686-bdd9-25367ef7437a
Keep-down                     : false
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_down_time                : 2023-09-21 08:11:23
Last_fwd_state                : NONE
Last_local_down_diag          : Control Detection Time Expired
Last_remote_down_diag         : Control Detection Time Expired
Last_up_time                  : 2023-09-21 08:14:25
Local_address                 : 192.168.11.5
Local_discr                   : 1686145680
Min_rx_ttl                    : 255
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.11.2
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 1016056089
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4
 
BFD Session
Dest_port                     : 4784
Diag                          : No Diagnostic
Encap                         : vlan
Forwarding                    : last true (current true)
Interface                     : 09a0d694-e31f-52b6-b1ac-45fc3fbbd3b6
Keep-down                     : false
Last_admin_down_diag_time     : 2023-09-21 08:14:24
Last_cp_diag                  : No Diagnostic
Last_cp_rmt_diag              : No Diagnostic
Last_cp_rmt_state             : up
Last_cp_state                 : up
Last_cpath_down_diag_time     : 2023-09-21 08:14:25
Last_down_time                : 2023-09-21 08:11:23
Last_fwd_state                : NONE
Last_local_down_diag          : Control Detection Time Expired
Last_remote_admin_down_time   : 2023-09-21 08:14:24
Last_remote_down_diag         : Administratively Down
Last_up_time                  : 2023-09-21 08:14:24
Local_address                 : 192.168.11.5
Local_discr                   : 3959973419
Min_rx_ttl                    : 1
Multiplier                    : 3
Received_remote_diag          : No Diagnostic
Received_remote_state         : up
Remote_address                : 192.168.11.3
Remote_admin_down             : false
Remote_diag                   : No Diagnostic
Remote_discr                  : 3141462920
Remote_min_rx_interval        : 100
Remote_min_tx_interval        : 1000
Remote_multiplier             : 3
Remote_state                  : up
Router_down                   : false
Rx_cfg_min                    : 1000
Rx_interval                   : 1000
Session_type                  : TUNNEL
State                         : up
Tx_cfg_min                    : 100
Tx_interval                   : 1000
Type                          : IPv4