Example: Configuring Traffic Class Maps
This example shows the configuration of traffic class maps on a T4000 router with Type 5 FPC. Beginning with Junos OS Release 17.2, this example is also valid on MX Series routers with MPCs. The example is organized in the following sections:
Requirements
This example uses the following hardware and software components:
One T4000 router running Junos OS Release 14.2 or later
One customer edge (CE) router
Before you configure the traffic class maps, be sure you have:
Installed a Type 5 FPC in the T4000 router.
Connected the CE router to the T4000 router.
Overview and Topology
This example shows the configuration of traffic class maps on a T4000 router that is connected to a CE router. The topology for this example consists of a T4000 router with Type 5 FPC connected to a CE router.
As shown in Figure 1, the CE router forwards the traffic to interface xe-4/0/0 and xe-4/0/1 on the T4000 router.
The traffic class maps need to be configured on the T4000 router with Type 5 FPC and associated with the interface xe-4/0/0 and the interface xe-4/0/1 so that the packets can be prioritized and classified based on the user-defined configuration. When ingress oversubscription occurs, the T4000 router uses the user-defined traffic class map to process the packets.
This example shows how to create the following traffic class maps with CoS code points and associate these code points with the traffic class.
IPv4 precedence traffic class map with code points 000 001, 010 011, and 100 101. Map these code points to the real-time, network-control, and best-effort traffic classes, respectively.
MPLS EXP traffic class map with code points 000 001, 010 011, and 100 101. Map these code points to the real-time, network-control, and best-effort traffic classes, respectively.
IEEE 802.1 traffic class map with code points 000 001, 010 011, and 100 101. Map these code points to the real-time, network-control, and best-effort traffic classes, respectively.
DSCP traffic class map with code points 100001 100010 100011, 010011 010100 010101, and 101001 101010 101011. Map these code points to the real-time, network-control, and best-effort traffic classes, respectively.
IEEE 802.1ad traffic class map with code points 0000 0001 1000 1001, 0010 0011 1010 1011, and 0100 0101 1100 1101. Map these code points to the real-time, network-control, and best-effort traffic classes, respectively.
The traffic class maps IPv4 precedence, MPLS EXP, and IEEE 802.1 are associated with the interface xe-4/0/0. The traffic class maps DSCP and IEEE 802.1ad are associated with the interface xe-4/0/1.
Configuration
To configure the traffic class map, perform the following tasks:
- CLI Quick Configuration
- Configuring Interfaces
- Configuring Traffic Class Maps for the Code Points and Mapping the Code Points to a Traffic Class
- Associating Interfaces with Traffic Class Maps
- Results
CLI Quick Configuration
To quickly configure this example, copy the
following commands, paste them in a text file, remove any line breaks,
change any details necessary to match your network configuration,
and paste the commands into the CLI at the [edit]
hierarchy
level.
[edit] set interfaces xe-4/0/0 unit 0 family inet address 198.51.100.0/24 set interfaces xe-4/0/1 vlan-tagging set interfaces xe-4/0/1 unit 0 vlan-id 111 set interfaces xe-4/0/1 unit 0 family inet address 198.51.100.1/24 set class-of-service traffic-class-map inet-precedence inetp traffic-class real-time code-points [ 000 001 ] set class-of-service traffic-class-map inet-precedence inetp traffic-class network-control code-points [ 010 011 ] set class-of-service traffic-class-map inet-precedence inetp traffic-class best-effort code-points [ 100 101 ] set class-of-service traffic-class-map exp mpls_exp traffic-class real-time code-points [ 000 001 ] set class-of-service traffic-class-map exp mpls_exp traffic-class network-control code-points [ 010 011 ] set class-of-service traffic-class-map exp mpls_exp traffic-class best-effort code-points [ 100 101 ] set class-of-service traffic-class-map ieee-802.1 802.1p traffic-class real-time code-points [ 000 001 ] set class-of-service traffic-class-map ieee-802.1 802.1p traffic-class network-control code-points [ 010 011 ] set class-of-service traffic-class-map ieee-802.1 802.1p traffic-class best-effort code-points [ 100 101 ] set class-of-service traffic-class-map dscp dscp_v4 traffic-class real-time code-points [ 100001 100010 100011 ] set class-of-service traffic-class-map dscp dscp_v4 traffic-class network-control code-points [ 010011 010100 010101 ] set class-of-service traffic-class-map dscp dscp_v4 traffic-class best-effort code-points [ 101001 101010 101011 ] set class-of-service traffic-class-map ieee-802.1ad 802.1ad traffic-class real-time code-points [ 0000 0001 1000 1001 ] set class-of-service traffic-class-map ieee-802.1ad 802.1ad traffic-class network-control code-points [ 0010 0011 1010 1011 ] set class-of-service traffic-class-map ieee-802.1ad 802.1ad traffic-class best-effort code-points [ 0100 0101 1100 1101 ] set interfaces xe-4/0/0 traffic-class-map inet-precedence inetp set interfaces xe-4/0/0 traffic-class-map exp mpls_exp set interfaces xe-4/0/0 traffic-class-map ieee-802.1 802.1p vlan-tag inner set interfaces xe-4/0/1 traffic-class-map dscp dscp_v4 set interfaces xe-4/0/1 traffic-class-map ieee-802.1ad 802.1ad vlan-tag inner
Configuring Interfaces
Step-by-Step Procedure
Configure the interfaces. These interfaces need to be associated with traffic class maps.
Configure the interface xe-4/0/0 with unit 0 as its logical interface, inet as protocol family, and 198.51.100.0/24 as the IP address.
[edit] user@host#set interfaces xe-4/0/0 unit 0 family inet address 198.51.100.0/24
Configure the interface xe-4/0/1 with unit 0 as its logical interface, inet as protocol family, and 198.51.100.1/24 as the IP address. Also, enable the VLAN tagging and configure a VLAN ID (for example, 111) to receive and transmit VLAN-tagged frames on the interface.
[edit] user@host#set interfaces xe-4/0/1 vlan-tagging user@host#set interfaces xe-4/0/1 unit 0 vlan-id 111 user@host#set interfaces xe-4/0/1 unit 0 family inet address 198.51.100.1/24
Configuring Traffic Class Maps for the Code Points and Mapping the Code Points to a Traffic Class
Step-by-Step Procedure
You can prioritize and classify the traffic entering a Packet Forwarding Engine by configuring a traffic class map based on the code points and associating the map with the traffic class.
Create an IPv4 precedence traffic class map inetp and map its code points 000 001, 010 011, and 100 101 to the real-time, network control, and best-effort traffic classes, respectively.
[edit class-of-service] user@host# set traffic-class-map inet-precedence inetp traffic-class real-time code-points [ 000 001 ] user@host# set traffic-class-map inet-precedence inetp traffic-class network-control code-points [ 010 011 ] user@host# set traffic-class-map inet-precedence inetp traffic-class best-effort code-points [ 100 101 ]
Create an MPLS EXP traffic class map mpls_exp and map the code points 000 001, 010 011, and 100 101 to the real-time, network control, and best-effort traffic classes, respectively.
[edit class-of-service] user@host# set traffic-class-map exp mpls_exp traffic-class real-time code-points [ 000 001 ] user@host# set traffic-class-map exp mpls_exp traffic-class network-control code-points [ 010 011 ] user@host# set traffic-class-map exp mpls_exp traffic-class best-effort code-points [ 100 101 ]
Create a IEEE 802.1 traffic class map 802.1p and map the code points 000 001, 010 011, and 100 101 to the real-time, network control, and best-effort traffic classes, respectively.
[edit class-of-service] user@host# set traffic-class-map ieee-802.1 802.1p traffic-class real-time code-points [ 000 001 ] user@host# set traffic-class-map ieee-802.1 802.1p traffic-class network-control code-points [ 010 011 ] user@host# set traffic-class-map ieee-802.1 802.1p traffic-class best-effort code-points [ 100 101 ]
Create a DSCP traffic class map dscp_v4 and map the code points 100001 100010 100011, 010011 010100 010101, and 101001 101010 101011 to the real-time, network control, and best-effort traffic classes, respectively.
[edit class-of-service] user@host# set traffic-class-map dscp dscp_v4 traffic-class real-time code-points [ 100001 100010 100011 ] user@host# set traffic-class-map dscp dscp_v4 traffic-class network-control code-points [ 010011 010100 010101 ] user@host# set traffic-class-map dscp dscp_v4 traffic-class best-effort code-points [ 101001 101010 101011 ]
Create a IEEE802.1ad traffic class map 802.1ad and map the code points 0000 0001 1000 1001,0010 0011 1010 1011, and 0100 0101 1100 1101 to the real-time, network control, and best-effort traffic classes, respectively.
[edit class-of-service] user@host# set traffic-class-map ieee-802.1ad 802.1ad traffic-class real-time code-points [ 0000 0001 1000 1001 ] user@host# set traffic-class-map ieee-802.1ad 802.1ad traffic-class network-control code-points [ 0010 0011 1010 1011 ] user@host# set traffic-class-map ieee-802.1ad 802.1ad traffic-class best-effort code-points [ 0100 0101 1100 1101 ]
Associating Interfaces with Traffic Class Maps
Step-by-Step Procedure
You need to associate the configured traffic class maps with the interfaces on which you want to prioritize and classify the input traffic.
Associate the traffic class maps inetp, mpls_exp, and 802.1p with the interface xe-4/0/0.
[edit class-of-service] user@host# set interfaces xe-4/0/0 traffic-class-map inet-precedence inetp user@host# set interfaces xe-4/0/0 traffic-class-map exp mpls_exp user@host# set interfaces xe-4/0/0 traffic-class-map ieee-802.1 802.1p vlan-tag inner
Associate the traffic class map dscp_v4 and 802.1ad with the interface xe-4/0/1.
[edit class-of-service] user@host# set interfaces xe-4/0/1 traffic-class-map dscp dscp_v4 user@host# set interfaces xe-4/0/1 traffic-class-map ieee-802.1ad 802.1ad vlan-tag inner
Results
interfaces { xe-4/0/0 { unit 0 { family inet { address 198.51.100.0/24; } } } xe-4/0/1 { vlan-tagging; unit 0 { vlan-id 111; family inet { address 198.51.100.1/24; } } } } class-of-service { traffic-class-map { inet-precedence inetp { traffic-class real-time code-points [ 000 001 ]; traffic-class network-control code-points [ 010 011 ]; traffic-class best-effort code-points [ 100 101 ]; } dscp dscp_v4 { traffic-class real-time code-points [ 100001 100010 100011 ]; traffic-class network-control code-points [ 010011 010100 010101 ]; traffic-class best-effort code-points [ 101001 101010 101011 ]; } exp mpls_exp { traffic-class real-time code-points [ 000 001 ]; traffic-class network-control code-points [ 010 011 ]; traffic-class best-effort code-points [ 100 101 ]; } ieee-802.1 802.1p { traffic-class real-time code-points [ 000 001 ]; traffic-class network-control code-points [ 010 011 ]; traffic-class best-effort code-points [ 100 101 ]; } ieee-802.1ad 802.1ad { traffic-class real-time code-points [ 0000 0001 1000 1001 ]; traffic-class network-control code-points [ 0010 0011 1010 1011 ]; traffic-class best-effort code-points [ 0100 0101 1100 1101 ]; } } interfaces { xe-4/0/0 { traffic-class-map { inet-precedence inetp; exp mpls_exp; ieee-802.1 802.1p vlan-tag inner; } } xe-4/0/1 { traffic-class-map { dscp dscp_v4; ieee-802.1ad 802.1ad vlan-tag inner; } } } }
Verification
- Verifying Mapping of Code Points to Input Traffic Classes
- Verifying Mapping of Interfaces to Traffic Class Maps
- Verifying Traffic Class Information on the Interface
Verifying Mapping of Code Points to Input Traffic Classes
Purpose
Verify that the code points of traffic class maps are mapped to the corresponding traffic classes.
Action
In operational mode, enter the show class-of-service
traffic-class-map
command.
user@host> show class-of-service traffic-class-map Traffic-class-map: inetp, Code-point type: inet-precedence, Index: 43854 Code point Traffic class 000 real-time 001 real-time 010 network-control 011 network-control 100 best-effort 101 best-effort Traffic-class-map: dscp_v4, Code-point type: dscp, Index: 37469 Code point Traffic class 010011 network-control 010100 network-control 010101 network-control 100001 real-time 100010 real-time 100011 real-time 101001 best-effort 101010 best-effort 101011 best-effort Traffic-class-map: mpls_exp, Code-point type: exp, Index: 39622 Code point Traffic class 000 real-time 001 real-time 010 network-control 011 network-control 100 best-effort 101 best-effort Traffic-class-map: 802.1p, Code-point type: ieee-802.1, Index: 13605 Code point Traffic class 000 real-time 001 real-time 010 network-control 011 network-control 100 best-effort 101 best-effort Traffic-class-map: 802.1ad, Code-point type: ieee-802.1ad, Index: 13677 Code point Traffic class 0000 real-time 0001 real-time 0010 network-control 0011 network-control 0100 best-effort 0101 best-effort 1000 real-time 1001 real-time 1010 network-control 1011 network-control 1100 best-effort 1101 best-effort
Meaning
The display output fields Traffic-class-map
and Code-point type
indicate the
configured traffic class map and the type of code point information,
respectively.
The fields Code point
and Traffic class
show the mapping between the code points
and the traffic class.
Verifying Mapping of Interfaces to Traffic Class Maps
Purpose
Verify that the configured interfaces are mapped to the corresponding traffic class maps.
Action
In operational mode, enter the show class-of-service
forwarding-table traffic-class-map mapping
command.
user@host> show class-of-service forwarding-table traffic-class-map mapping Interface Index Table Index Table type xe-4/0/0 162 43854 INET-Precedence 39622 MPLS EXP 13605 IEEE-802.1 xe-4/0/1 163 37469 DSCP 13677 IEEE-802.1AD
Meaning
The output shows that:
Interface
xe-4/0/0
is associated with the traffic class mapsINET-Precedence
,MPLS EXP
, andIEEE-802.1
.Interface
xe-4/0/1
is associated with the traffic class mapsDSCP
andIEEE-802.1AD
.
Verifying Traffic Class Information on the Interface
Purpose
Verify the packet information based on the configured traffic class map.
Action
In operational mode, enter the show interfaces
xe-4/0/0 extensive
and show interfaces xe-4/0/1 extensive
commands.
user@host> show interfaces xe-4/0/0 extensive Physical interface: xe-4/0/0, Enabled, Physical link is Up Interface index: 162, SNMP ifIndex: 541, Generation: 165 Link-level type: Ethernet, MTU: 1518, MRU: 0, LAN-PHY mode, Speed: 10Gbps, BPDU Error: None, MAC-REWRITE Error: None, Loopback: None, Source filtering: Disabled, Flow control: Enabled ... Preclassifier statistics: Traffic Class Received Packets Transmitted Packets Dropped Packets real-time 3000 3000 0 network-control 2000 2000 0 best-effort 2000 1000 1000 Interface transmit statistics: Enabled ... user@host> show interfaces xe-4/0/1 extensive Physical interface: xe-4/0/1, Enabled, Physical link is Up Interface index: 163, SNMP ifIndex: 525, Generation: 166 Link-level type: Ethernet, MTU: 1518, MRU: 0, LAN-PHY mode, Speed: 10Gbps, BPDU Error: None, MAC-REWRITE Error: None, Loopback: None, Source filtering: Disabled, Flow control: Enabled ... Preclassifier statistics: Traffic Class Received Packets Transmitted Packets Dropped Packets real-time 2000 2000 0 network-control 1000 1000 0 best-effort 1000 600 400 Interface transmit statistics: Enabled ...
Meaning
The Preclassifier statistics
field shows the information for received, transmitted, and dropped
packets for each of the configured traffic class map.
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.