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/terms/term/conditions/ipv4/config/dscp 
  • /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

openconfig-qos:qos {
    classifiers {
        classifier {
            name DSCP;
            terms {
                term {
                    id 0;
                    conditions {
                        ipv4 {
                            config {
                                dscp 000000;
                            }
                        }
                    }
                    actions {
                        config {
                            target-group best-effort;
                        }
                    }
                }
            }
        }
    }
}
class-of-service {
    classifiers {
        dscp DSCP {
            forwarding-class best-effort {
                loss-priority low code-points 000000;
            }
        }
    }
}

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. For example:

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

The OpenConfig value term id is the same as the queue-num value which the forwarding group represents. For example, if best-effort is attached to queue 0, then the term id value is 0.

When streaming the telemetry state value, the Junos queue-num value to which the OpenConfig target-group value is mapped will be exported as the term id value. For example:

set openconfig-qos:qos classifiers classifier DSCP terms term 0 actions config target-group best-effort

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.

The OpenConfig value term id is the same as the queue-num value which the forwarding group represents. For example, if best-effort is attached to queue 0, then the term id value is 0.

When streaming the telemetry state value, the Junos queue-num value to which the OpenConfig target-group value is mapped will be exported as the term id value.

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/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/

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 <> {
       schedulers scheduler <> {
	   inputs {
	       input <> {
                 config id <>;
	          input-type <>;
	          queue <>;
	          weight <>;
	       }
	   }
       }
   }
}
class-of-service {
    scheduler-maps <> {
        forwarding-class <> scheduler <> input-id <> weight <>;
    }
}

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 value 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 queue leaf to a collector.

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 {
          scheduler-map <>;
        }
  }
}

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/config
  • /qos/interfaces/interface/interface-ref/config interface/output queues/queue/config/queue-management-profiles/queue-management-profile

  • /qos/scheduler-policies/scheduler-policy/schedulers/config priority

Table 8: Drop Profile Configuration

OpenConfig Configuration

Junos Configuration

qos {
   queue-management-profiles {
       queue-management-profile <> {
           wred {
               uniform {
                   config {
                       min-threshold;
                       max-threshold;
                       enable-ecn <true | false>;
                       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-profiles {
        queue-management-profile {
            config {
	     name <>; 
	 }
	 wred {
	     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 <> { 
            config priority STRICT;
        }
    }
}
class-of-service {
    schedulers {
        <scheduler> {
            priority strict-high;
        }
    }
}

When binding the queue-management profile to the queue under interface, the Junos OS class of service model attaches the drop profile to the scheduler map (already present under the same interface). In order for the drop profile to be attached, the OpenConfig path /qos/interfaces/interface/output/scheduler-policy/ must include a scheduler-policy for the interface.