Description

This article explains that the OID bfdSessIndex value changes after a corresponding interface flap as per Junos OS design. Since this is expected behavior, no action is required on the part of the user. 

Symptoms

Customers may want to monitor BFD session status by using Simple Network Management Protocol (SNMP).

Solution

To get other BFD related data, you would need to know the OID bfdSessEntry value. That is, each OID that is under bfdSessEntry would need to add bfdSessIndex to get a value.

If the BFD session is working in single-hop mode and an interface flaps, the bfdSessIndex will change, which is as per design.

The following command shows the SNMP OIDs that correspond to BFD session status:

user@router>show snmp mib walk ascii bfdSessState
bfdSessState.20 = 4
The meaning of the output value can be determined based on the following values:
  • adminDown = 1

  • down = 2

  • init = 3

  • up = 4

Using these values, the above SNMP result would indicate that the state of BFD session(index 20) is up.

Refer to the CLI output for the same BFD session:

user@router>show bfd session
                                                  Detect   Transmit
Address                  State     Interface      Time     Interval  Multiplier
100.0.0.2                Up        ge-0/0/0.0     30.000    10.000       3

1 sessions, 1 clients
Cumulative transmit rate 0.1 pps, cumulative receive rate 0.1 pps

Now when the physical interface goes down, the BFD session gets deleted.

user@router>show interfaces ge-0/0/0 terse
Interface               Admin Link Proto    Local                 Remote
ge-0/0/0                up    down
ge-0/0/0.0              up    down inet     100.0.0.1/24
                                   multiservice
user@router>show bfd session

0 sessions, 0 clients
Cumulative transmit rate 0.0 pps, cumulative receive rate 0.0 pps

And when the physical interface comes back up, a new BFD session is created.

user@router>show interfaces ge-0/0/0 terse
Interface               Admin Link Proto    Local                 Remote
ge-0/0/0                up    up
ge-0/0/0.0              up    up   inet     100.0.0.1/24
                                   multiservice

user@router>show bfd session
                                                  Detect   Transmit
Address                  State     Interface      Time     Interval  Multiplier
100.0.0.2                Up        ge-0/0/0.0     30.000    10.000       3

1 sessions, 1 clients
Cumulative transmit rate 0.1 pps, cumulative receive rate 0.1 pps

Following this, the new BFD session's index (bfdSessIndex) will change. In the example, the value changed from 20 to 21.

user@router>show snmp mib walk ascii bfdSessState
bfdSessState.21 = 4

"bfdSessIndex" is used to represent a unique BFD session on the device. When a new BFD session is created, an unused value for bfdSessIndex is used. For example, if there is a single session, the new bfdSessIndex would increment by 1. If there are two sessions: one session index is 16 and the other session index is 17 and if session 1 flaps, the new session index would use 18, that is “16+2”. That is, the new BFD session index will always use the minimum unused value.

In Junos OS, "bfdSessIndex" is always the same as the local discriminator of the BFD session.

user@router>show snmp mib walk ascii bfdSessDiscriminator
bfdSessDiscriminator.21 = 21

user@router>show bfd session extensive | match discri
 Local discriminator 21, remote discriminator 18