ON THIS PAGE
Example: Configuring Queuing and Shaping on Logical Interfaces in PTX Series Packet Transport Routers
You can enable per-logical interface queuing on interfaces on PTX Series Packet Transport Routers and specify a scheduler map and traffic-shaping rate for each logical interface.
Requirements
This example uses the following hardware and software components:
-
Junos OS Evolved Release 24.2R1 or later.
-
One PTX10004 router with LC1201 or LC1202 line card.
Overview
This example shows how to configure six VLANs on six logical interfaces, enable per-logical interface queuing, and specify a scheduler map and traffic-shaping rate for each logical interface. The total traffic-shaping rate combined for all logical interfaces cannot exceed 100 Gbps.
Configuration
CLI Quick Configuration
To configure logical interface queuing and traffic shaping on the PTX10004 router, copy the following commands and paste them into the terminal window of the router:
[edit] set interfaces et-2/0/0 vlan-tagging set interfaces et-2/0/0 per-unit-scheduler set interfaces et-2/0/0 unit 0 vlan-id 0 set interfaces et-2/0/0 unit 1 vlan-id 1 set interfaces et-2/0/0 unit 2 vlan-id 2 set interfaces et-2/0/0 unit 3 vlan-id 3 set interfaces et-2/0/0 unit 4 vlan-id 4 set interfaces et-2/0/0 unit 5 vlan-id 5 set class-of-service classifiers dscp dscp_v4 forwarding-class GOLD loss-priority low code-points 000000 set class-of-service classifiers dscp dscp_v4 forwarding-class SILVER loss-priority low code-points 000001 set class-of-service classifiers dscp dscp_v4 forwarding-class BRONZE loss-priority low code-points 000010 set class-of-service classifiers dscp dscp_v4 forwarding-class BE loss-priority low code-points 000011 set class-of-service classifiers dscp dscp_v4 forwarding-class BE1 loss-priority low code-points 000100 set class-of-service classifiers dscp dscp_v4 forwarding-class BE2 loss-priority low code-points 000101 set class-of-service classifiers dscp dscp_v4 forwarding-class BE3 loss-priority low code-points 000110 set class-of-service classifiers dscp dscp_v4 forwarding-class BE4 loss-priority low code-points 000111 set class-of-service forwarding-classes class GOLD queue-num 0 set class-of-service forwarding-classes class SILVER queue-num 1 set class-of-service forwarding-classes class BRONZE queue-num 2 set class-of-service forwarding-classes class BE queue-num 3 set class-of-service forwarding-classes class BE1 queue-num 4 set class-of-service forwarding-classes class BE2 queue-num 5 set class-of-service forwarding-classes class BE3 queue-num 6 set class-of-service forwarding-classes class BE4 queue-num 7 set class-of-service schedulers GOLD transmit-rate percent 20 set class-of-service schedulers SILVER transmit-rate percent 20 set class-of-service schedulers BRONZE transmit-rate percent 10 set class-of-service schedulers BE transmit-rate percent 10 set class-of-service schedulers GOLD priority high set class-of-service schedulers SILVER priority medium-high set class-of-service schedulers BRONZE priority medium-low set class-of-service schedulers BE priority low set class-of-service scheduler-maps OUT forwarding-class GOLD scheduler GOLD set class-of-service scheduler-maps OUT forwarding-class SILVER scheduler SILVER set class-of-service scheduler-maps OUT forwarding-class BRONZE scheduler BRONZE set class-of-service scheduler-maps OUT forwarding-class BE scheduler BE set class-of-service scheduler-maps OUT forwarding-class BE1 scheduler BE set class-of-service scheduler-maps OUT forwarding-class BE2 scheduler BE set class-of-service scheduler-maps OUT forwarding-class BE3 scheduler BE set class-of-service scheduler-maps OUT forwarding-class BE4 scheduler BE set class-of-service interfaces et-2/0/0 unit 0 scheduler-map OUT set class-of-service interfaces et-2/0/0 unit 1 scheduler-map OUT set class-of-service interfaces et-2/0/0 unit 2 scheduler-map OUT set class-of-service interfaces et-2/0/0 unit 3 scheduler-map OUT set class-of-service interfaces et-2/0/0 unit 4 scheduler-map OUT set class-of-service interfaces et-2/0/0 unit 5 scheduler-map OUT set class-of-service interfaces et-2/0/0 unit 0 shaping-rate 20g set class-of-service interfaces et-2/0/0 unit 1 shaping-rate 16g set class-of-service interfaces et-2/0/0 unit 2 shaping-rate 16g set class-of-service interfaces et-2/0/0 unit 3 shaping-rate 16g set class-of-service interfaces et-2/0/0 unit 4 shaping-rate 16g set class-of-service interfaces et-2/0/0 unit 5 shaping-rate 16g
Procedure
Step-by-Step Procedure
To configure the PTX10004 router:
Enable the reception and transmission of 8021.q VLAN-tagged frames on the interface:
[edit interfaces] user@host# set et-2/0/0 vlan-tagging
Enable per-logical interface scheduling on the interface:
[edit interfaces] user@host# set et-2/0/0 per-unit-scheduling
Specify a VLAN identifier for each logical interface:
[edit interfaces] user@host# set et-2/0/0 unit 0 vlan-id 0 user@host# set et-2/0/0 unit 1 vlan-id 1 user@host# set et-2/0/0 unit 2 vlan-id 2 user@host# set et-2/0/0 unit 3 vlan-id 3 user@host# set et-2/0/0 unit 4 vlan-id 4 user@host# set et–2/0/0 unit 5 vlan-id 5
Define classifiers to assign incoming packets to forwarding classes based on each packet's code point value and loss priority:
[edit class-of-service classifiers] user@host# set dscp dscp_v4 forwarding-class GOLD loss-priority low code-points 000000 user@host# set dscp dscp_v4 forwarding-class SILVER loss-priority low code-points 000001 user@host# set dscp dscp_v4 forwarding-class BRONZE loss-priority low code-points 000010 user@host# set dscp dscp_v4 forwarding-class BE loss-priority low code-points 000011 user@host# set dscp dscp_v4 forwarding-class BE1 loss-priority low code-points 000100 user@host# set dscp dscp_v4 forwarding-class BE2 loss-priority low code-points 000101 user@host# set dscp dscp_v4 forwarding-class BE3 loss-priority low code-points 000110 user@host# set dscp dscp_v4 forwarding-class BE4 loss-priority low code-points 000111
Assign each forwarding class to a queue:
[edit class-of-service forwarding-classes] user@host# set class GOLD queue-num 0 user@host# set class SILVER queue-num 1 user@host# set class BRONZE queue-num 2 user@host# set class BE queue-num 3 user@host# set class BE1 queue-num 4 user@host# set class BE2 queue-num 5 user@host# set class BE3 queue-num 6 user@host# set class BE4 queue-num 7
Define schedulers, each with their own transmit rate and priority:
[edit class-of-service schedulers] user@host# set GOLD transmit-rate percent 20 user@host# set SILVER transmit-rate percent 20 user@host# set BRONZE transmit-rate percent 10 user@host# set BE transmit-rate percent 10 user@host# set GOLD priority high user@host# set SILVER priority medium-high user@host# set BRONZE priority medium-low user@host# set BE priority low
Define a scheduler map that maps a scheduler to each forwarding class (and therefore queue):
[edit class-of-service scheduler-maps] user@host# set OUT forwarding-class GOLD scheduler GOLD user@host# set OUT forwarding-class SILVER scheduler SILVER user@host# set OUT forwarding-class BRONZE scheduler BRONZE user@host# set OUT forwarding-class BE scheduler BE user@host# set OUT forwarding-class BE1 scheduler BE user@host# set OUT forwarding-class BE2 scheduler BE user@host# set OUT forwarding-class BE3 scheduler BE user@host# set OUT forwarding-class BE4 scheduler BE
Assign the scheduler map to each logical interface:
[edit class-of-service interfaces] user@host# set et-2/0/0 unit 0 scheduler-map OUT user@host# set et-2/0/0 unit 1 scheduler-map OUT user@host# set et-2/0/0 unit 2 scheduler-map OUT user@host# set et-2/0/0 unit 3 scheduler-map OUT user@host# set et-2/0/0 unit 4 scheduler-map OUT user@host# set et-2/0/0 unit 5 scheduler-map OUT
Note:Keep in mind, with per-logical interface queueing, each logical interface has eight queues and can have its own scheduler map for its own service profile.
Specify the amount of bandwidth to allocate to each logical interface:
[edit class-of-service interfaces] user@host# set et-2/0/0 unit 0 shaping-rate 20g user@host# set et-2/0/0 unit 1 shaping-rate 16g user@host# set et-2/0/0 unit 2 shaping-rate 16g user@host# set et-2/0/0 unit 3 shaping-rate 16g user@host# set et-2/0/0 unit 4 shaping-rate 16g user@host# set et-2/0/0 unit 5 shaping-rate 16g
Results
Confirm your results by entering the show interfaces
and
show class-of-service
commands:
user@host# show interfaces et-2/0/0 { per-unit-scheduling vlan-tagging; unit 0 { vlan-id 0; } unit 1 { vlan-id 1; } unit 2 { vlan-id 2; } unit 3 { vlan-id 3; } unit 4 { vlan-id 4; } unit 5 { vlan-id 5; } }
user@host# show class-of-service classifiers { dscp dscp_v4 { forwarding-class BE { loss-priority low code-points 000011; } forwarding-class BE1 { loss-priority low code-points 000100; } forwarding-class BE2 { loss-priority low code-points 000101; } forwarding-class BE3 { loss-priority low code-points 000110; } forwarding-class BE4 { loss-priority low code-points 000111; } forwarding-class BRONZE { loss-priority low code-points 000010; } forwarding-class GOLD { loss-priority low code-points 000000; } forwarding-class SILVER { loss-priority low code-points 000001; } } } forwarding-classes { class BE queue-num 3; class BE1 queue-num 4; class BE2 queue-num 5; class BE3 queue-num 6; class BE4 queue-num 7; class BRONZE queue-num 2; class GOLD queue-num 0; class SILVER queue-num 1; }interfaces { et-2/0/0 { unit 0 { scheduler-map OUT; shaping-rate 20g; } unit 1 { scheduler-map OUT; shaping-rate 16g; } unit 2 { scheduler-map OUT; shaping-rate 16g; } unit 3 { scheduler-map OUT; shaping-rate 16g; } unit 4 { scheduler-map OUT; shaping-rate 16g; } unit 5 { scheduler-map OUT; shaping-rate 16g; } } } scheduler-maps { OUT { forwarding-class BE scheduler BE; forwarding-class BE1 scheduler BE; forwarding-class BE2 scheduler BE; forwarding-class BE3 scheduler BE; forwarding-class BE4 scheduler BE; forwarding-class BRONZE scheduler BRONZE; forwarding-class GOLD scheduler GOLD; forwarding-class SILVER scheduler SILVER; } } schedulers { BE { transmit-rate percent 10; priority low; } BRONZE { transmit-rate percent 10; priority medium-low; } GOLD { transmit-rate percent 20; priority high; } SILVER { transmit-rate percent 20; priority medium-high; } }