Description

For all SRX platforms, by default, there are 4 forwarding-classes mapped to 4 queues as below:

Queue        Forwarding-class       
    0              best-effort  
    1     expedited-forwarding
    2       assured-forwarding   
    3          network-control

Currently, SRX does not support a customized queue for BFD packets. All BFD packets will always fall to queue 3 as a default behavior no matter how a user customizes their class of service queues.

This can cause BFD packets to get lost and flap routing protocols if a user customizes queue 3 to be a non-network-control class. We recommend keeping queue 3 as the Junos default network-control class when implementing class of service features. 

Symptoms

When implementing class of service feature on SRX platforms, a user may change all Junos default queues and their mapped forwarding-classes based on demands. 

Example:

There are 2 live BGP sessions on lab SRX device with BFD turned on:

root@lab-SRX> show bgp summary 
Groups: 2 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
10.11.1.1             64512         71         73       0       0       31:24 Establ
  inet.0: 0/0/0/0
10.11.2.1             64512         67         70       0       0       29:38 Establ
  inet.0: 0/0/0/0

forwarding-classes {
        queue 0 NC;
        queue 1 RT;
        queue 2 INT;
        queue 3 ST;
        queue 4 BE;

host-outbound-traffic {
        forwarding-class NC;
        dscp-code-point 110000;

In the example above, the user changed network-control queue from Junos default queue 3 to be queue 0. And marked all RE outbound packets to be NC class (queue 0).However, in the lab environment, the live BFD packets generated from RE did not fall in NC class (queue 0). It still falls in queue 3 with ST class. This will cause BFD packets to start droping if there's increased traffic load for ST forwarding class and may cause routing protocols to start flapping.

Queue: 3, Forwarding classes: ST
  Queued:
    Packets              :                  7739                     2 pps  <-- live BFD packet 2pps
    Bytes                :               1547300                  1120 bps
  Transmitted:
    Packets              :                  7739                     2 pps
    Bytes                :               1547300                  1120 bps
    Tail-dropped packets :                     0                     0 pps
    RL-dropped packets   :                     0                     0 pps
    RL-dropped bytes     :                     0                     0 bps
    RED-dropped packets  :                     0                     0 pps
     Low                 :                     0                     0 pps
     Medium-low          :                     0                     0 pps
     Medium-high         :                     0                     0 pps
     High                :                     0                     0 pps
    RED-dropped bytes    :                     0                     0 bps
     Low                 :                     0                     0 bps
     Medium-low          :                     0                     0 bps
     Medium-high         :                     0                     0 bps
     High                :                     0                     0 bps
  Queue Buffer Usage:
    Reserved buffer      :                375000 bytes
  Queue-depth bytes      : 
    Current              :                     0

Solution

For the current design in SRX, all packets sent from RE with a keepalive flag will fall to default queue 3.

In order to resolve possible BFD packet loss in queue 3, we recommend keeping queue 3 as the Junos default network-control class when implementing class of service features.