This section provides an example of how to configure simple traffic classification in the context of priority mappings for VLAN packets.
On the network shown in Figure 1, Switch A forwards frames from VLAN 10 to Device A. Device A maps the priorities of the VLAN frames to the priorities of IP packets based on the configured priority mappings in the DS domain set on Device A. Device A then forwards the packets to the IP network.
Interface 1 and interface 2 stand for GE 0/1/0 and GE 0/1/8, respectively.
When configuring priority mappings for VLAN packets based on simple traffic classification on Layer 2 interfaces, note the following point:
The configuration roadmap is as follows:
Configure a VLAN on Device A.
Configure the inbound interface of Device A to trust the priorities of packets from an upstream device.
Configure priority mappings based on simple traffic classification on the inbound interface of Device A.
Configure priority mappings for packets on the outbound interface of Device A.
To complete the configuration, you need the following data:
VLAN ID
802.1p priorities, service classes and colors of the packets on the router, and DSCP values of IP packets
# Create a VLAN.
<DeviceA> system-view [~DeviceA] vlan batch 10 [*DeviceA] commit [~DeviceA] interface gigabitethernet 0/1/0 [~DeviceA-GigabitEthernet0/1/0] portswitch [*DeviceA-GigabitEthernet0/1/0] port trunk allow-pass vlan 10 [*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] trust upstream default vlan 10 [*DeviceA-GigabitEthernet0/1/0] trust 8021p vlan 10 [*DeviceA-GigabitEthernet0/1/0] commit [~DeviceA-GigabitEthernet0/1/0] quit
[~DeviceA] diffserv domain default [*DeviceA-dsdomain-default] 8021p-inbound 2 phb ef green [*DeviceA-dsdomain-default] ip-dscp-outbound ef green map 34 [*DeviceA-dsdomain-default] commit [~DeviceA-dsdomain-default] quit [~DeviceA] interface gigabitethernet 0/1/8 [*DeviceA-GigabitEthernet0/1/8] portswitch [*DeviceA-GigabitEthernet0/1/8] port trunk allow-pass vlan 10 [*DeviceA-GigabitEthernet0/1/8] trust upstream default vlan 10 [*DeviceA-GigabitEthernet0/1/8] trust 8021p vlan 10 [*DeviceA-GigabitEthernet0/1/8] commit [~DeviceA-GigabitEthernet0/1/8] quit
After you complete these configurations, Device A maps the VLAN frames with the 802.1p priority of 2 from an upstream device to IP packets with the service classes of EF, and the packet colors of green. Device A maps the other 802.1p priorities of VLAN frames to the corresponding DSCP values of IP packets based on the default mappings.
Run the display port-queue statistics interface gigabitethernet 0/1/8 outbound command on Device A. The statistics about AF2 packets are not displayed because the mapping from the 802.1p priority of 2 to the IP service priority of EF is configured on the inbound interface.
<DeviceA> display port-queue statistics interface gigabitethernet 0/1/8 outbound
GigabitEthernet0/1/8 outbound traffic statistics: [be] Current usage percentage of queue: 0 Total pass: 1,003,905,621 packets, 90,351,505,260 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 0 pps, 0 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps [af1] Current usage percentage of queue: 0 Total pass: 0 packets, 0 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 0 pps, 0 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps [af2] Current usage percentage of queue: 0 Total pass: 0 packets, 0 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 0 pps, 0 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps [af3] Current usage percentage of queue: 0 Total pass: 0 packets, 0 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 0 pps, 0 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps [af4] Current usage percentage of queue: 0 Total pass: 0 packets, 0 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 0 pps, 0 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps [ef] Current usage percentage of queue: 0 Total pass: 27,167,382 packets, 3,477,424,896 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 844,397 pps, 864,661,792 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps [cs6] Current usage percentage of queue: 0 Total pass: 335 packets, 25,502 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 0 pps, 0 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps [cs7] Current usage percentage of queue: 0 Total pass: 0 packets, 0 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 0 pps, 0 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 0000-00-00 00:00:00 0 bps
Configuration file of Device A
# sysname DeviceA # diffserv domain default 8021p-inbound 2 phb ef green ip-dscp-outbound ef green map 34 # vlan 10 # interface GigabitEthernet 0/1/0 portswitch undo shutdown port trunk allow-pass vlan 10 trust upstream default vlan 10 trust 8021p vlan 10 # interface GigabitEthernet0/1/8 portswitch undo shutdown port trunk allow-pass vlan 10 trust upstream default vlan 10 trust 8021p vlan 10 # return