ON THIS PAGE
Example: Applying Scheduling and Shaping to VLANs
This example shows how to apply schedulers to individual logical interfaces.
Requirements
This example uses the following hardware and software components:
Junos OS Release 7.4 or later running on router line cards that support Intelligent Queuing (IQ).
Junos OS Release 13.2 or later running on MX Series routers containing 16x10GE MPC or MPC3E line cards.
Junos OS Release 13.3 or later running on MX Series routers containing MPC4E line cards.
Junos OS Release 15.1 or later running on MX Series routers containing MPC6E line cards.
Overview
By default, output scheduling is not enabled on logical interfaces. Logical interfaces without shaping configured share a default scheduler. Logical interface scheduling (also called per-unit scheduling) allows you to enable multiple output queues on a logical interface and associate customized scheduling and shaping for each queue.
To enable per-unit scheduling, include the per-unit-scheduler
statement at the [edit interfaces interface name]
hierarchy level. When per-unit schedulers are enabled, you
can define dedicated schedulers for logical interfaces by including
the scheduler-map
statement at the [edit class-of-service
interfaces interface name unit logical
unit number]
hierarchy level. Alternatively, you
can include the scheduler-map
statement at the [edit
class-of-service traffic-control-profiles traffic control
profile name]
hierarchy level and then include the output-traffic-control-profile
statement at the [edit
class-of-service interfaces interface name unit logical unit number]
hierarchy level.
This example shows how to define schedulers for logical interfaces through the use of traffic control profiles.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the
following commands, paste them into a text file, remove any line breaks,
change any details necessary to match your network configuration,
and then copy and paste the commands into the CLI at the [edit]
hierarchy level.
set interfaces xe-9/0/3 per-unit-scheduler set interfaces xe-9/0/3 vlan-tagging set interfaces xe-9/0/3 unit 1 vlan-id 101 set interfaces xe-9/0/3 unit 1 family inet address 10.1.1.1/24 set interfaces xe-9/0/3 unit 2 vlan-id 102 set interfaces xe-9/0/3 unit 2 family inet address 10.2.1.1/24 set class-of-service classifiers inet-precedence c8 forwarding-class be loss-priority low code-points 000 set class-of-service classifiers inet-precedence c8 forwarding-class ef loss-priority low code-points 001 set class-of-service classifiers inet-precedence c8 forwarding-class af loss-priority low code-points 010 set class-of-service classifiers inet-precedence c8 forwarding-class nc loss-priority low code-points 011 set class-of-service classifiers inet-precedence c8 forwarding-class be1 loss-priority low code-points 100 set class-of-service classifiers inet-precedence c8 forwarding-class ef1 loss-priority low code-points 101 set class-of-service classifiers inet-precedence c8 forwarding-class af1 loss-priority low code-points 110 set class-of-service classifiers inet-precedence c8 forwarding-class nc1 loss-priority low code-points 111 set class-of-service forwarding-classes queue 0 be set class-of-service forwarding-classes queue 1 ef set class-of-service forwarding-classes queue 2 af set class-of-service forwarding-classes queue 3 nc set class-of-service forwarding-classes queue 4 be1 set class-of-service forwarding-classes queue 5 ef1 set class-of-service forwarding-classes queue 6 af1 set class-of-service forwarding-classes queue 7 nc1 set class-of-service traffic-control-profiles tcp_ifd shaping-rate 2500000000 set class-of-service traffic-control-profiles tcp_ifd overhead-accounting bytes -20 set class-of-service traffic-control-profiles tcp_gold scheduler-map gold set class-of-service traffic-control-profiles tcp_gold shaping-rate 2500000000 set class-of-service traffic-control-profiles tcp_gold overhead-accounting bytes -20 set class-of-service traffic-control-profiles tcp_gold guaranteed-rate 1g set class-of-service traffic-control-profiles tcp_silver scheduler-map silver set class-of-service traffic-control-profiles tcp_silver shaping-rate 1g set class-of-service traffic-control-profiles tcp_silver overhead-accounting bytes -20 set class-of-service traffic-control-profiles tcp_silver guaranteed-rate 500m set class-of-service interfaces xe-9/0/3 output-traffic-control-profile tcp_ifd set class-of-service interfaces xe-9/0/3 unit 1 output-traffic-control-profile tcp_gold set class-of-service interfaces xe-9/0/3 unit 2 output-traffic-control-profile tcp_silver set class-of-service scheduler-maps gold forwarding-class be1 scheduler gold_internet set class-of-service scheduler-maps gold forwarding-class ef1 scheduler gold_video set class-of-service scheduler-maps gold forwarding-class af1 scheduler gold_voice set class-of-service scheduler-maps gold forwarding-class nc1 scheduler gold_reserved set class-of-service scheduler-maps silver forwarding-class be scheduler silver_internet set class-of-service scheduler-maps silver forwarding-class ef scheduler silver_video set class-of-service scheduler-maps silver forwarding-class af scheduler silver_voice set class-of-service scheduler-maps silver forwarding-class nc scheduler silver_reserved set class-of-service schedulers gold_internet excess-rate percent 40 set class-of-service schedulers gold_internet buffer-size percent 20 set class-of-service schedulers gold_internet priority low set class-of-service schedulers gold_video transmit-rate percent 50 set class-of-service schedulers gold_video buffer-size percent 50 set class-of-service schedulers gold_voice shaping-rate percent 10 set class-of-service schedulers gold_voice buffer-size percent 10 set class-of-service schedulers gold_voice priority strict-high set class-of-service schedulers gold_reserved excess-rate percent 20 set class-of-service schedulers gold_reserved buffer-size percent 10 set class-of-service schedulers gold_reserved priority low set class-of-service schedulers silver_internet excess-rate percent 40 set class-of-service schedulers silver_internet buffer-size percent 20 set class-of-service schedulers silver_internet priority low set class-of-service schedulers silver_video transmit-rate percent 50 set class-of-service schedulers silver_video buffer-size percent 50 set class-of-service schedulers silver_voice shaping-rate percent 10 set class-of-service schedulers silver_voice buffer-size percent 10 set class-of-service schedulers silver_voice priority strict-high set class-of-service schedulers silver_reserved excess-rate percent 20 set class-of-service schedulers silver_reserved buffer-size percent 10 set class-of-service schedulers silver_reserved priority low
Procedure
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see the Junos OS CLI User Guide.
Configure the device interfaces.
[edit interfaces]
user@PE1# set xe-9/0/3 per-unit-scheduler user@PE1# set xe-9/0/3 vlan-tagging user@PE1# set xe-9/0/3 unit 1 vlan-id 101 user@PE1# set xe-9/0/3 unit 1 family inet address 10.1.1.1/24 user@PE1# set xe-9/0/3 unit 2 vlan-id 102 user@PE1# set xe-9/0/3 unit 2 family inet address 10.2.1.1/24Configure the classifiers.
[edit class-of-service]
user@PE1# set classifiers inet-precedence c8 forwarding-class be loss-priority low code-points 000 user@PE1# set classifiers inet-precedence c8 forwarding-class ef loss-priority low code-points 001 user@PE1# set classifiers inet-precedence c8 forwarding-class af loss-priority low code-points 010 user@PE1# set classifiers inet-precedence c8 forwarding-class nc loss-priority low code-points 011 user@PE1# set classifiers inet-precedence c8 forwarding-class be1 loss-priority low code-points 100 user@PE1# set classifiers inet-precedence c8 forwarding-class ef1 loss-priority low code-points 101 user@PE1# set classifiers inet-precedence c8 forwarding-class af1 loss-priority low code-points 110 user@PE1# set classifiers inet-precedence c8 forwarding-class nc1 loss-priority low code-points 111Configure the forwarding classes.
[edit class-of-service]
user@PE1# set forwarding-classes queue 0 be user@PE1# set forwarding-classes queue 1 ef user@PE1# set forwarding-classes queue 2 af user@PE1# set forwarding-classes queue 3 nc user@PE1# set forwarding-classes queue 4 be1 user@PE1# set forwarding-classes queue 5 ef1 user@PE1# set forwarding-classes queue 6 af1 user@PE1# set forwarding-classes queue 7 nc1Configure the traffic control profiles.
[edit class-of-service]
user@PE1# set traffic-control-profiles tcp_ifd shaping-rate 2500000000 user@PE1# set traffic-control-profiles tcp_ifd overhead-accounting bytes -20 user@PE1# set traffic-control-profiles tcp_gold scheduler-map gold user@PE1# set traffic-control-profiles tcp_gold shaping-rate 2500000000 user@PE1# set traffic-control-profiles tcp_gold overhead-accounting bytes -20 user@PE1# set traffic-control-profiles tcp_gold guaranteed-rate 1g user@PE1# set traffic-control-profiles tcp_silver scheduler-map silver user@PE1# set traffic-control-profiles tcp_silver shaping-rate 1g user@PE1# set traffic-control-profiles tcp_silver overhead-accounting bytes -20 user@PE1# set traffic-control-profiles tcp_silver guaranteed-rate 500mMap the traffic control profiles to their respective physical or logical interface.
[edit class-of-service]
user@PE1# set interfaces xe-9/0/3 output-traffic-control-profile tcp_ifd user@PE1# set interfaces xe-9/0/3 unit 1 output-traffic-control-profile tcp_gold user@PE1# set interfaces xe-9/0/3 unit 2 output-traffic-control-profile tcp_silverConfigure the scheduler maps.
[edit class-of-service]
user@PE1# set scheduler-maps gold forwarding-class be1 scheduler gold_internet user@PE1# set scheduler-maps gold forwarding-class ef1 scheduler gold_video user@PE1# set scheduler-maps gold forwarding-class af1 scheduler gold_voice user@PE1# set scheduler-maps gold forwarding-class nc1 scheduler gold_reserved user@PE1# set scheduler-maps silver forwarding-class be scheduler silver_internet user@PE1# set scheduler-maps silver forwarding-class ef scheduler silver_video user@PE1# set scheduler-maps silver forwarding-class af scheduler silver_voice user@PE1# set scheduler-maps silver forwarding-class nc scheduler silver_reservedConfigure the schedulers.
[edit class-of-service]
user@PE1# set schedulers gold_internet excess-rate percent 40 user@PE1# set schedulers gold_internet buffer-size percent 20 user@PE1# set schedulers gold_internet priority low user@PE1# set schedulers gold_video transmit-rate percent 50 user@PE1# set schedulers gold_video buffer-size percent 50 user@PE1# set schedulers gold_voice shaping-rate percent 10 user@PE1# set schedulers gold_voice buffer-size percent 10 user@PE1# set schedulers gold_voice priority strict-high user@PE1# set schedulers gold_reserved excess-rate percent 20 user@PE1# set schedulers gold_reserved buffer-size percent 10 user@PE1# set schedulers gold_reserved priority low user@PE1# set schedulers silver_internet excess-rate percent 40 user@PE1# set schedulers silver_internet buffer-size percent 20 user@PE1# set schedulers silver_internet priority low user@PE1# set schedulers silver_video transmit-rate percent 50 user@PE1# set schedulers silver_video buffer-size percent 50 user@PE1# set schedulers silver_voice shaping-rate percent 10 user@PE1# set schedulers silver_voice buffer-size percent 10 user@PE1# set schedulers silver_voice priority strict-high user@PE1# set schedulers silver_reserved excess-rate percent 20 user@PE1# set schedulers silver_reserved buffer-size percent 10 user@PE1# set schedulers silver_reserved priority low
Results
From configuration mode, confirm your configuration
by entering the show interfaces
and show class-of-service
commands. If the output does not display the intended configuration,
repeat the instructions in this example to correct the configuration.
user@PE1# show interfaces interfaces { xe-9/0/3 { per-unit-scheduler; vlan-tagging; unit 1 { vlan-id 101; family inet { address 10.1.1.1/24; } } unit 2 { vlan-id 102; family inet { address 10.2.1.1/24; } } } }
user@PE1# show class-of-service class-of-service { classifiers { inet-precedence c8 { forwarding-class be { loss-priority low code-points 000; } forwarding-class ef { loss-priority low code-points 001; } forwarding-class af { loss-priority low code-points 010; } forwarding-class nc { loss-priority low code-points 011; } forwarding-class be1 { loss-priority low code-points 100; } forwarding-class ef1 { loss-priority low code-points 101; } forwarding-class af1 { loss-priority low code-points 110; } forwarding-class nc1 { loss-priority low code-points 111; } } } forwarding-classes { queue 0 be; queue 1 ef; queue 2 af; queue 3 nc; queue 4 be1; queue 5 ef1; queue 6 af1; queue 7 nc1; } traffic-control-profiles { tcp_ifd { shaping-rate 2500000000; overhead-accounting bytes -20; } tcp_gold { scheduler-map gold; shaping-rate 2500000000; overhead-accounting bytes -20; guaranteed-rate 1g; } tcp_silver { scheduler-map silver; shaping-rate 1g; overhead-accounting bytes -20; guaranteed-rate 500m; } } interfaces { xe-9/0/3 { output-traffic-control-profile tcp_ifd; unit 1 { output-traffic-control-profile tcp_gold; } unit 2 { output-traffic-control-profile tcp_silver; } } } scheduler-maps { gold { forwarding-class be1 scheduler gold_internet; forwarding-class ef1 scheduler gold_video; forwarding-class af1 scheduler gold_voice; forwarding-class nc1 scheduler gold_reserved; } silver { forwarding-class be scheduler silver_internet; forwarding-class ef scheduler silver_video; forwarding-class af scheduler silver_voice; forwarding-class nc scheduler silver_reserved; } } schedulers { gold_internet { excess-rate percent 40; buffer-size percent 20; priority low; } gold_video { transmit-rate percent 50; buffer-size percent 50; } gold_voice { shaping-rate percent 10; buffer-size percent 10; priority strict-high; } gold_reserved { excess-rate percent 20; buffer-size percent 10; priority low; } silver_internet { excess-rate percent 40; buffer-size percent 20; priority low; } silver_video { transmit-rate percent 50; buffer-size percent 50; } silver_voice { shaping-rate percent 10; buffer-size percent 10; priority strict-high; } silver_reserved { excess-rate percent 20; buffer-size percent 10; priority low; } } }
If you are done configuring the device, enter commit from configuration mode.