Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Mapping OpenConfig QoS Commands to Junos Configuration

Note:

See OpenConfig Data Model Version for supported data model versions and corresponding Junos OS or Junos Evolved OS releases.

Forwarding Class Configuration

See Table 1 for configuration mappings of the following OpenConfig paths:

  • /qos/forwarding-groups/forwarding-group/name 
  • /qos/forwarding-groups/forwarding-group/config/name 
  • /qos/forwarding-groups/forwarding-group/config/fabric-priority 
  • /qos/forwarding-groups/forwarding-group/config/output-queue 
Table 1: Forwarding Class Configuration

OpenConfig Configuration

Junos Configuration

openconfig-qos:qos {
       forwarding-groups {
              forwarding-group {
                    name af1;
                    config {
                          name <>;
                          fabric-priority 0;
                          output-queue <>;
                    }
              }
              forwarding-group {
                    name nc;
                    config {
                          name <>;
                          fabric-priority 1;
                          output-queue <>;
                    }
              }
       }
}
class-of-service {
    forwarding-classes {
        class <name> queue-num <num> priority low;
        class <name> queue-num <num> priority high;
   }
}

An OpenConfig fabric-priority value of 0 indicates low priority. Any non-zero value indicates high priority. The fabric-priority value is not supported on the PTX platform.

BA Classifier Configuration

See for configuration mappings of the following OpenConfig paths:

  • /qos/classifiers/classifier/name 
  • /qos/classifiers/classifier/terms/term/id 
  • /qos/classifiers/classifier/config/name
  • /qos/classifiers/classifier/config/type
  • /qos/classifiers/classifier/terms/term/id
  • /qos/classifiers/classifier/terms/term/config
  • /qos/classifiers/classifier/terms/term/config/id
  • /qos/classifiers/classifier/terms/term/conditions/ipv4/config/dscp-set 
  • /qos/classifiers/classifier/terms/term/conditions/ipv6/config/dscp-set 
  • /qos/classifiers/classifier/terms/term/actions/config/target-group 
Note:

To more easily follow the OpenConfig examples below, variables are used in the OpenConfig configuration tree above.

Table 2: BA Classifier Configuration

OpenConfig Configuration

Junos Configuration

Open-Config-QoS:QoS:classifiers:classifier {
   name DSCP;
   terms {
      term {
         id 0;
         conditions {
            ipv6 {
               config {
                  dscp-set [ 2 3 ];                                                       }
         }
         actions {
            config {
               target-group best-effort;
            }
         }
      }
   }
}
[edit class-of-service]
classifiers {
   dscp DSCP {
term-id {
term-id 0;
   forwarding-class best-effort {
      loss-priority low code-points [ 000100 000010 ];
   }
}

Junos OS expects a loss-priority value. However, the OpenConfig configuration does not provide this. By default, the loss-priority value is considered as low.

The OpenConfig code-point value is provided using bit format as octets and decimal values as decimals. To avoid confusion, you can provide code-point values in decimal format and the script converts them into a 6-bit pattern and sends it to the management daemon. For example:

set openconfig-qos:qos classifiers classifier DSCP terms term 0 conditions ipv4 config dscp-set [2 3]

MPLS Classifier Configuration

See Table 3 for configuration mappings of the following OpenConfig paths:

  • /qos/classifiers/classifier/terms/term/conditions/mpls 
  • /qos/classifiers/classifier/terms/term/conditions/mpls/config 
  • /qos/classifiers/classifier/terms/term/conditions/mpls/config/traffic-class 
  • /qos/classifiers/classifier/terms/term/actions/config/target-group 
Table 3: MPLS Classifier Configuration

OpenConfig Configuration

Junos Configuration

openconfig-qos:qos {
    classifiers {
        classifier <> {
            config {
                name <>;
                type <>;
            }
            terms {
                term {
                    id <>;
                    conditions {
                        mpls {
                            config {
                                traffic-class <>;
                            }
                        }
                    }
                    actions {
                        config {
                            target-group <>;
                            }
                        }
                    }
                 }
                term {
                    id <>;
                    conditions {
                        mpls {
                            config {
                                traffic-class <>;
                            }
                        }
                    }
                    actions {
                        config {
                            target-group <>;
                            }
                        }
                    }
                 }
             }
         }
    }
}
class-of-service {
    classifiers {
        exp <> {
            forwarding-class <> {
                loss-priority low code-points <>;
            }
            forwarding-class <> {
                loss-priority low code-points <>;
            }
        }
    }
}

Junos OS expects a loss-priority value. The OpenConfig configuration does not provide this. By default, the loss-priority value is low.

The OpenConfig code-point value is provided using bit format as octets and decimal values as decimals. To avoid confusion, provide code-point values in decimal format.

Rewrite Rules Configuration

See Table 4 for configuration mappings of the following OpenConfig paths:

  • /qos/classifiers/classifier/terms/term/actions/remark
  • /qos/classifiers/classifier/terms/term/actions/remark/config
  • /qos/classifiers/classifier/terms/term/actions/remark/config/set-dscp
  • /qos/classifiers/classifier/terms/term/actions/remark/config/set-dot1p
  • /qos/classifiers/classifier/terms/term/actions/remark/config/set-mpls-tc
Table 4: Rewrite Rules Configuration

OpenConfig Configuration

Junos Configuration

openconfig-qos:qos {
    classifiers {
        classifier <> {
            config {
                name <>;
                type IPV4;
            }
            terms {
                term 0 {
                    actions {
                        config {
                            target-group <>;
                        }
                        remark {
                            config {
                                set-dscp 5;
                            }
                        }
                    }
                }
                term 1 {
                    actions {
                        config {
                            target-group <>;
                        }
                        remark {
                            config {
                                set-dscp 6;
                            }
                        }
                    }
                }
            }
        }
    }
}
class-of-service {
    rewrite-rules {
        dscp <> {
            forwarding-class <> {
                loss-priority low code-point 000101 term-id 0;
            }
            forwarding-class <> {
                loss-priority low code-point 000110 term-id 1;
            }
        }
    }
}
openconfig-qos:qos {
    classifiers {
        classifier <> {
            config {
                name <>;
                type IPV6;
            }
            terms {
                term 0 {
                    actions {
                        config {
                            target-group <>;
                        }
                        remark {
                            config {
                                set-dscp 7;
                            }
                        }
                    }
                }
                term 1 {
                    actions {
                        config {
                            target-group <>;
                        }
                        remark {
                            config {
                                set-dscp 8;
                            }
                        }
                    }
                }
            }
        }
    }
}
class-of-service {
    rewrite-rules {
        dscp-ipv6 <> {
            forwarding-class <> {
                loss-priority low code-point 000111 term-id 0;
            }
            forwarding-class <> {
                loss-priority low code-point 001000 term-id 1;
            }
        }
    }
}
openconfig-qos:qos {
    classifiers {
        classifier <> {
            config {
                name <>;
                type MPLS;
            }
            terms {
                term 0 {
                    actions {
                        config {
                            target-group <>;
                        }
                        remark {
                            config {
                                set-mpls-tc 5;
                            }
                        }
                    }
                }
                term 1 {
                    actions {
                        config {
                            target-group <>;
                        }
                        remark {
                            config {
                                set-mpls-tc 6;
                            }
                        }
                    }
                }
            }
        }
    }
}
class-of-service {
    rewrite-rules {
        exp <> {
            forwarding-class <> {
                loss-priority low code-point 101 term-id 0;
            }
            forwarding-class <> {
                loss-priority low code-point 110 term-id 1;
            }
        }
    }
}

The forwarding groups used for the rewrite rules configuration are shown below:

openconfig-qos:qos {
    forwarding-groups {
        forwarding-group <> {
            config {
                name <>;
                output-queue 0;
            }
        }
        forwarding-group <> {
              config {
                  name <>;
                  output-queue 1;
             }
        }
    }
}
class-of-service {
    forwarding-classes {
        class <> queue-num 0;
        class <> queue-num 1;
    }
}

Classifier Binding Configuration

See Table 5 for configuration mappings of the following OpenConfig paths:

  • /qos/interfaces/interface/interface-id 
  • /qos/interfaces/interface/interface-ref/config/interface
  • /qos/interfaces/interface/interface-ref/config/subinterface
  • /qos/interfaces/interface/input/classifiers/classifier/type 
  • /qos/interfaces/interface/input/classifiers/classifier/config/name
  • /qos/interfaces/interface/input/classifiers/classifier/config/type
Note:

To more easily follow the OpenConfig examples below, variables are used in the OpenConfig configuration tree.

Table 5: Classifier Binding Configuration

OpenConfig Configuration

Junos Configuration

openconfig-qos:qos {
    interfaces {
        interface {
            interface-id et-0/0/1.0;
                input {
                    classifiers {
                        classifier {
                            type <>;  
                            config {
                                name <>;
                                type <>;
                            }
                        }
                    }
                }
            }
        }
        interface {  
               interface-id ae0;  
            interface-ref { 
                config { 
                    subinterface <>; 
                } 
            } 
                 input {  
                        classifiers {  
                                classifier {  
                                    type <>;    
                                        config {  
                                            name <>;  
                                                type <>;
                                    }  
                              }
                        } 
            }
        }
    }
}
class-of-service {
    et-0/0/1 {
        unit 0 {
            classifiers {
                dscp <>;
             }
        }
    }
    ae0 { 
        unit <> { 
            classifiers { 
                exp <>;  
            } 
        } 
    }  
}

Classifier binding can be formed from the interfaces table by mapping classifier and interface.

This configuration also supports wild cards (*). For example:

set openconfig-qos:qos interfaces interface et-*/*/*.0 interface-ref config interface et-*/*/*

set openconfig-qos:qos interfaces interface et-*/*/*.0 interface-ref config subinterface 0

set openconfig-qos:qos interfaces interface et-*/*/*.0 input classifiers classifier IPV4 config name DSCP

openconfig-qos:qos {
   interfaces interface <> {
       interface-ref {
           config interface <>;
       }
       output scheduler-policy {
            config name <>;
       }
   }
}
class-of-service {
    interfaces <> {
        output-traffic-control-profile <>;
    }
}

Scheduler Configuration

See Table 6 for configuration mappings of the following OpenConfig paths:

  • /qos/scheduler-policies/scheduler-policy/name
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/sequence
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/config/priority
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/output/config/output-fwd-group
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/config/sequence
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/two-rate-three-color/config/bc
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/two-rate-three-color/config/cir
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/two-rate-three-color/config/cir-pct
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/two-rate-three-color/config/pir
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/two-rate-three-color/config/pir-pct
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/id
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/id
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/input-type
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/queue
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/weight
  • /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/config/priority
Note:

To more easily follow the OpenConfig examples below, variables are used in the OpenConfig configuration trees below.

Table 6: Scheduler Configuration

OpenConfig Configuration

Junos Configuration

openconfig-qos:qos { 
    scheduler-policies { 
        scheduler-policy { 
             name smap; 
             schedulers {
                 scheduler { 
                     sequence:4 
                     two-rate-three-color { 
                       config {
                          cir-pct:10
                       } 
                     } 
                 } 
                 scheduler { 
                     sequence:1 
                     two-rate-three-color { 
                      config {
                         cir-pct:1 
                      }
                     } 
                 }
                 scheduler { 
                     sequence:5  
                     two-rate-three-color { 
                       config {
                         cir-pct:1 
                       }
                     } 
                 }
                 scheduler { 
                     sequence:2 
                     priority: STRICT
                     two-rate-three-color { 
                      config {
                         cir-pct:1 
                       }
                     } 
                 }
                 scheduler { 
                     sequence:0 
                     two-rate-three-color { 
                       config {
                          cir-pct:1 
                      }
                     } 
                 }
                 scheduler { 
                     sequence:3 
                     two-rate-three-color { 
                       config {
                        cir-pct:1 
                      }
                     }
                 } 
           } 
       } 
    } 
} 
class-of-service {
 scheduler-maps { 
    smap { 
        forwarding-class af1 scheduler sched_af1; 
        forwarding-class af2 scheduler sched_af2; 
        forwarding-class af3 scheduler sched_af3; 
        forwarding-class af4 scheduler sched_af4; 
        forwarding-class be1 scheduler sched_be1; 
        forwarding-class nc1 scheduler sched_nc1; 
    } 
 } 
 schedulers { 
    sched_af1 { 
        transmit-rate percent 10; 
        buffer-size shared; 
        priority low; 
    } 
    sched_af2 { 
        transmit-rate percent 1; 
        buffer-size shared; 
        priority low; 
    } 
    sched_af3 { 
        transmit-rate percent 1; 
        buffer-size shared; 
        priority low; 
    } 
    sched_af4 { 
    transmit-rate percent 1; 
        buffer-size shared; 
        priority strict-high; 
    } 
    sched_be1 { 
        transmit-rate percent 1; 
        buffer-size shared; 
        priority low; 
    } 
    sched_nc1 { 
   transmit-rate percent 1; 
        buffer-size shared; 
        priority low; 
    } 
 } 
}

The OpenConfig parameters that are not supported under the scheduler command include buffer-size, excess-rates, and excess priorities. Only STRICT-HIGH priority is supported. If you configure a priority, it is treated as STRICT-HIGH. Otherwise, the priority is LOW by default.

The OpenConfig fields that are unsupported fields under scheduler command are cir-pct-remaining, pir-pct-remaining, be (excess burst size), and bc (committed burst size). These fields are unsupported on the PTX platform but are supported on the MX platform.

There is no parameter to configure a scheduler name in OpenConfig. Instead, the name is deduced by combining the Junos scheduler-map name and forwarding group. For example, the below parameters creates the scheduler name sched_smap_assured-forwarding.

<schedulers> {
       <name> “sched” _ “_” _$smap_name _ "_" _ $out_fwd_group;
   }
Note:

The scheduler name can be 64 characters in length. Since scheduler map and forwarding class names are concatenated in OpenConfig configurations, care must be taken when providing them.

The OpenConfig sequence number should be same as the queuenum value, which the forwarding group represents. For example, if assured-forwarding is attached to queue 2, then sequence number should be 2. While exporting state, the queuenum to which the target-group is attached is exported as the sequence number.

set openconfig-qos:qos scheduler-policies scheduler-policy smap schedulers scheduler 2 output config output-fwd-group assured-forwarding

openconfig-qos:qos { 
   scheduler-policies scheduler-policy sp1 {
       schedulers scheduler 0 {
	   inputs {
	       input AF4 {
                 config id AF4;
	          input-type QUEUE;
	          queue 2;
	          weight 60;
	       }
	   }
       }
   }
}
class-of-service {
    scheduler-maps sp1{
        forwarding-class AF4 scheduler sched_scheduler_AF4;
    }
    traffic-control-profiles {
        tcp_sp1
             schedule-map sp1;
        }
    }
}
// If STRICT priority is configured:
class-of-service {
    schedulers {
        scheduler_AF4{
            transmit-rate percent 100;
            excess-rate percent 60;
            priority high;
        }
    }
}
// If *not* STRICT priority, use Weighted Round Robin (WRR)mode:
class-of-service {
    schedulers {
        scheduler_AF4{
            transmit-rate percent 0;
            excess-rate percent 60;
            priority low;
        }
    }
}
Note: Values are added to the above configurations for a better understanding of the mapping.

The queue leaf value is translated as the equivalent forwarding class value in the scheduler map.

When you configure a strict scheduler priority:

  • Configure transmit-rate value as 100 percent for each forwarding class.

  • Forwarding class priority is based on the OpenConfig forwarding class weights in ascending order.

  • Forwarding class priority is assigned in the order of "strict-high:high:medium-high:medium-low:low:low:low:low.

In cases where strict scheduler priority is not configured (WRR mode):

  • Configure transmit-rate value as 0 percent for each forwarding class.

  • Configure excess-rate value with the same value as the weights for each OpenConfig forwarding class. A weight value over 100 is not permitted.

You can only use the QUEUE value for input-type with OpenConfig path /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/input/config/input-type because QUEUE is the only enumeration value that can be mapped to the Junos OS. Likewise, subscribing to the resource path /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/state/input-type will always stream the enumeration QUEUE leaf to a collector.

From the Junos OS, create a traffic control profile (TCP) for the scheduler map configuration and use the TCP to bind the configuration to the interface. The Junos OS configuration above uses TCP tcp_sp1 and scheduler map sp1.

Scheduler Map Configuration

See Table 7 for configuration mappings of the following OpenConfig paths:

  • /qos/interfaces/interface/interface-id 
  • /qos/interfaces/interface/output/scheduler-policy/config/name 
Note:

To more easily follow the OpenConfig examples below, variables are used in the OpenConfig configuration trees below.

Table 7: Scheduler Map Configuration

OpenConfig Configuration

Junos Configuration

openconfig-qos:qos {
   interfaces {
      interface {
         interface-id et-0/0/1;
            output {
               scheduler-policy {
                  config {
                     name <>;
                  }
               }
            }
         }
      }
   }
}
class-of-service {
   interfaces et-0/0/1{
      output-traffic-control-profile tcp_sp1;
   }
}

Scheduler-maps can be bound to physical (IFD) interfaces only.

Wild cards are also supported. For example:

set openconfig-qos:qos interfaces interface et-*/*/* interface-ref config interface et-*/*/*

set openconfig-qos:qos interfaces interface et-*/*/* output scheduler-policy config name smap

Drop Profile Configuration

See Table 8 for configuration mappings of the following OpenConfig paths:

  • /qos/queue-management-profiles/queue-management-profile/config/name
  • /qos/queue-management-profiles/queue-management-profile/wred/uniform/config/min-threshold
  • /qos/queue-management-profiles/queue-management-profile/wred/uniform/config/max-threshold
  • /qos/queue-management-profiles/queue-management-profile/wred/uniform/config/max-drop-probability-percent
  • /qos/queue-management-profiles/queue-management-profile/wred/uniform/config/enable-ecn
  • /qos/queue-management-profiles/queue-management-profile/wred/
  • /qos/interfaces/interface/output/queues/queue/config/name

  • /qos/interfaces/interface/output/queues/queue/config/queue-management-profile

Table 8: Drop Profile Configuration

OpenConfig Configuration

Junos Configuration

openconfig-qos:qos {
   queue-management-profiles {
      queue-management-profile <> {
         wred {
            uniform {
               config {
                  min-threshold; (not for MX Series)
                  max-threshold; (not for MX Series)
                  enable-ecn <true | false>; (not for MX Series)
                  max-drop-probability-percent <>;
               }
            }
         }
      }
   }
}
class-of-service {
   drop-profiles {
       <profile-name> {
           fill-level <> drop-probability <>;
       }
   schedulers {
      <scheduler-name> {
         explicit-congestion-notification;
      }
   }
}

In OpenConfig, you configure the minimum and maximum threshold levels in bytes. In Junos, you configure each threshold as a percentage of the queue fill level. You can repeat the fill-level statement, combined with the drop-probability statement, to configure the minimum and maximum thresholds.

openconfig-qos:qos { 
   queue-management-profile {
      config {
         name <>; 
   }
   wred {
      uniform {
         config {
           min-threshold-percent <>;
	    max-threshold-percent <>;
	    max-drop-probability-percent <>;
	 }
      }
   }
}
class-of-service {
    drop-profiles {
        <profile-name> {
        interpolate {
            fill-level [ <> <> ];
            drop-probability <>;
        }
    }
}
openconfig-qos:qos {
    interfaces interface <> {
        interface-ref {
            config interface <>;
        }
        output queues <> {
            config {
                name <>;
                queue-management-profile <>;
            }
        }
    }
}
interfaces {
    <interface-name>{
        scheduler-map <>;
    }
}
scheduler-maps {
    <scheduler-map-name> {
        forwarding-class best-effort scheduler <>;
    }
}
schedulers {
    <scheduler-name> {
        drop-profile-map loss-priority any protocol any drop-profile <>;
    }
} 
openconfig-qos:qos {
    scheduler-policies scheduler-policy <> {
        schedulers scheduler <> { 
    }
}
class-of-service {
    schedulers {
        <scheduler> {
            priority strict-high;
        }
    }
}

When binding the queue-management profile to the queue under the interface configuration, the Junos OS class of service model attaches the drop profile to the scheduler map which is already present under the same interface output. In order to attach a drop profile to the interface, the interface must have a scheduler-policy attached to it in the output under /qos/interfaces/interface/output/scheduler-policy/