BFD

Manage BFD endpoints

BFD

Manage BFD (Bidirectional Forwarding Detection) endpoints in the switch. The BFD sessions are run by a BFD application on the switch’s embedded microcontroller. Type keywords in full; abbreviations are not accepted. An unknown sub-command prints Invalid BFD subcommand: <word>.

On a SONiC Trident 3 switch the BFD module is not set up, and the commands fail with Command failed. Feature unavailable followed by Failed to execute the diagnostic command. Error: Operation failed. (bcmcmd still exits 0). SONiC runs BFD in software on the host, not through this module.

The built-in help does not match the shell for endpoint add and endpoint update. The help shows [V6] [IP=<val>], but there is no IP key. Give the source and destination addresses as numbers with SIP= and DIP=. V6 takes a value (V6=1), and an MPLS label can be given with LABEL=. IP=… is rejected with Invalid option: …. All values are plain numbers.

endpoint show and trace are read-only. init and endpoint add|update|delete change BFD state in the switch. Do not run bfd init on a switch whose SAI uses BFD offload.

BFD init

Initialise the BFD module. Prints BFD module initialized..

Unvalidated

drivshell> bfd init
BFD endpoint add [ID=<id>] [GPORT=<n>] [TYPE=<n>] [VRF=<n>] INTPRI=<n> [CPUPRI=<n>] [DISCRIMINATOR=<n>] [V6=<0|1>] [SIP=<n>] [DIP=<n>] [LABEL=<n>]

Create an endpoint, with the given ID if one is given. GPORT is a local port number. TYPE is the numeric BFD encapsulation type. INTPRI is required (An internal priority is required.). On success the shell prints BFD endpoint <id> created..

BFD endpoint update takes the same keys, with ID naming the endpoint to change.

Unvalidated

drivshell> bfd endpoint add GPORT=1 TYPE=1 INTPRI=0 DISCRIMINATOR=100 SIP=0x0a000001 DIP=0x0a000002
BFD endpoint delete ID=<id>

Delete an endpoint.

Unvalidated

drivshell> bfd endpoint delete ID=1
BFD endpoint show [ID=<id>]

Show one endpoint. bfd endpoint with nothing after it does the same. Give ID; without it no endpoint is found. The output is a header and one row:

ID  Type  VRF  GPORT V6  IPADDR  DISCRIMINATOR  CpuPri  IntPri
--  ----  ---  ----- --  ------  -------------  ------  ------

The row prints both the source and the destination address, in hex, under the single IPADDR heading.

On a SONiC switch it fails with Feature unavailable, as shown below.

Hardware-validated

drivshell> bfd endpoint show ID=1
Command failed. Feature unavailable

Failed to execute the diagnostic command. Error: Operation failed.
BFD trace

Print the BFD application’s trace buffer. Read-only.

Unvalidated

drivshell> bfd trace

Built-in help

bfd init
bfd endpoint add [GPORT=<id>] [TYPE=<type>] [VRF=<id>] [INTPRI=<intpri>]
                 [CPUPRI=<qid>] [DISCRIMINATOR=<id>] [V6] [IP=<val>]
bfd endpoint update [ID=<id>] [TYPE=<type>] [VRF=<id>] [INTPRI=<intpri>]
                     [CPUPRI=<qid>] [DISCRIMINATOR=<id>] [V6] [IP=<val>]
bfd endpoint delete [ID=<id>]
bfd endpoint show [ID=<id>]
bfd trace