ON THIS PAGE
Example: Configuring Hierarchical CoS on vMX
This example describes how to configure hierarchical CoS on vMX with eight queues.
Requirements
This example uses the following hardware and software components:
Junos OS Release 16.2
vMX Release 16.2
Overview
This example configures two-level hierarchical schedulers with specified transmission rates.
Configuration
Configuring the Chassis
CLI Quick Configuration
[edit] set chassis fpc 0 flexible-queuing-mode
Step-by-Step Procedure
To enable hierarchical CoS on the chassis:
Enable flexible queuing mode on the chassis.
[edit] user@vmx# set chassis fpc 0 flexible-queuing-mode
Once you commit the configuration, the FPC is restarted.
Applying Shaping and Scheduling to VLANs
CLI Quick Configuration
[edit] set class-of-service forwarding-classes class voice1 queue-num 0 set class-of-service forwarding-classes class video1 queue-num 1 set class-of-service forwarding-classes class data1 queue-num 2 set class-of-service forwarding-classes class data2 queue-num 3 set class-of-service forwarding-classes class data3 queue-num 4 set class-of-service forwarding-classes class data4 queue-num 5 set class-of-service forwarding-classes class voice2 queue-num 6 set class-of-service forwarding-classes class video2 queue-num 7 set interfaces ge-0/0/0 hierarchical-scheduler maximum-hierarchy-levels 2 set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 100 vlan-id 100 set interfaces ge-0/0/0 unit 100 family inet address 10.2.2.1/24 set interfaces ge-0/0/1 hierarchical-scheduler maximum-hierarchy-levels 2 set interfaces ge-0/0/1 vlan-tagging set interfaces ge-0/0/1 unit 100 vlan-id 100 set interfaces ge-0/0/1 unit 100 family inet address 10.1.1.1/24 set class-of-service classifiers inet-precedence vlan_tos forwarding-class voice1 loss-priority low code-points 000 set class-of-service classifiers inet-precedence vlan_tos forwarding-class video1 loss-priority low code-points 001 set class-of-service classifiers inet-precedence vlan_tos forwarding-class data1 loss-priority low code-points 010 set class-of-service classifiers inet-precedence vlan_tos forwarding-class data2 loss-priority low code-points 011 set class-of-service classifiers inet-precedence vlan_tos forwarding-class data3 loss-priority low code-points 100 set class-of-service classifiers inet-precedence vlan_tos forwarding-class data4 loss-priority low code-points 101 set class-of-service classifiers inet-precedence vlan_tos forwarding-class voice2 loss-priority low code-points 110 set class-of-service classifiers inet-precedence vlan_tos forwarding-class video2 loss-priority low code-points 111 set class-of-service traffic-control-profiles ge_0_0_1_vlan_100_tcp shaping-rate 50m set class-of-service traffic-control-profiles ge_0_0_1_vlan_100_tcp scheduler-map vlan_smap set class-of-service interfaces ge-0/0/1 unit 100 output-traffic-control-profile ge_0_0_1_vlan_100_tcp set class-of-service interfaces ge-0/0/0 unit 100 classifiers inet-precedence vlan_tos set class-of-service scheduler-maps vlan_smap forwarding-class voice1 scheduler sched_voice1 set class-of-service scheduler-maps vlan_smap forwarding-class video1 scheduler sched_video1 set class-of-service scheduler-maps vlan_smap forwarding-class data1 scheduler sched_data1 set class-of-service scheduler-maps vlan_smap forwarding-class data2 scheduler sched_data2 set class-of-service scheduler-maps vlan_smap forwarding-class data3 scheduler sched_data3 set class-of-service scheduler-maps vlan_smap forwarding-class data4 scheduler sched_data4 set class-of-service scheduler-maps vlan_smap forwarding-class voice2 scheduler sched_voice2 set class-of-service scheduler-maps vlan_smap forwarding-class video2 scheduler sched_video2 set class-of-service schedulers sched_voice1 transmit-rate 15m set class-of-service schedulers sched_video1 transmit-rate 15m set class-of-service schedulers sched_data1 transmit-rate 5m set class-of-service schedulers sched_data2 transmit-rate 5m set class-of-service schedulers sched_data3 transmit-rate 5m set class-of-service schedulers sched_data4 transmit-rate 5m set class-of-service schedulers sched_voice2 transmit-rate 10m set class-of-service schedulers sched_video2 transmit-rate 10m
Step-by-Step Procedure
To apply shaping and scheduling:
Map the forwarding classes to their respective queues.
[edit] user@vmx# set class-of-service forwarding-classes class voice1 queue-num 0 user@vmx# set class-of-service forwarding-classes class video1 queue-num 1 user@vmx# set class-of-service forwarding-classes class data1 queue-num 2 user@vmx# set class-of-service forwarding-classes class data2 queue-num 3 user@vmx# set class-of-service forwarding-classes class data3 queue-num 4 user@vmx# set class-of-service forwarding-classes class data4 queue-num 5 user@vmx# set class-of-service forwarding-classes class voice2 queue-num 6 user@vmx# set class-of-service forwarding-classes class video2 queue-num 7
Configure the interfaces to enable two-level hierarchical scheduling and apply scheduling to the VLANs.
[edit] user@vmx# set interfaces ge-0/0/0 hierarchical-scheduler maximum-hierarchy-levels 2 user@vmx# set interfaces ge-0/0/0 vlan-tagging user@vmx# set interfaces ge-0/0/0 unit 100 vlan-id 100 user@vmx# set interfaces ge-0/0/0 unit 100 family inet address 10.2.2.1/24 user@vmx# set interfaces ge-0/0/1 hierarchical-scheduler maximum-hierarchy-levels 2 user@vmx# set interfaces ge-0/0/1 vlan-tagging user@vmx# set interfaces ge-0/0/1 unit 100 vlan-id 100 user@vmx# set interfaces ge-0/0/1 unit 100 family inet address 10.1.1.1/24
Configure the classifiers.
[edit] user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class voice1 loss-priority low code-points 000 user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class video1 loss-priority low code-points 001 user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class data1 loss-priority low code-points 010 user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class data2 loss-priority low code-points 011 user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class data3 loss-priority low code-points 100 user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class data4 loss-priority low code-points 101 user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class voice2 loss-priority low code-points 110 user@vmx# set class-of-service classifiers inet-precedence vlan_tos forwarding-class video2 loss-priority low code-points 111
Configure the traffic control profiles.
[edit] user@vmx# set class-of-service traffic-control-profiles ge_0_0_1_vlan_100_tcp shaping-rate 50m user@vmx# set class-of-service traffic-control-profiles ge_0_0_1_vlan_100_tcp scheduler-map vlan_smap
Map the traffic control profiles to their respective interface.
[edit] user@vmx# set class-of-service interfaces ge-0/0/1 unit 100 output-traffic-control-profile ge_0_0_1_vlan_100_tcp user@vmx# set class-of-service interfaces ge-0/0/0 unit 100 classifiers inet-precedence vlan_tos
Configure the scheduler maps.
[edit] user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class voice1 scheduler sched_voice1 user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class video1 scheduler sched_video1 user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class data1 scheduler sched_data1 user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class data2 scheduler sched_data2 user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class data3 scheduler sched_data3 user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class data4 scheduler sched_data4 user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class voice2 scheduler sched_voice2 user@vmx# set class-of-service scheduler-maps vlan_smap forwarding-class video2 scheduler sched_video2
Configure the schedulers.
[edit] user@vmx# set class-of-service schedulers sched_voice1 transmit-rate 15m user@vmx# set class-of-service schedulers sched_video1 transmit-rate 15m user@vmx# set class-of-service schedulers sched_data1 transmit-rate 5m user@vmx# set class-of-service schedulers sched_data2 transmit-rate 5m user@vmx# set class-of-service schedulers sched_data3 transmit-rate 5m user@vmx# set class-of-service schedulers sched_data4 transmit-rate 5m user@vmx# set class-of-service schedulers sched_voice2 transmit-rate 10m user@vmx# set class-of-service schedulers sched_video2 transmit-rate 10m