Example for Configuring Priority Mappings for VLAN Packets Based on Simple Traffic Classification on Layer 2 Interfaces

This section provides an example of how to configure simple traffic classification in the context of priority mappings for VLAN packets.

Networking Requirements

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.

Figure 1 Networking diagram for configuring priority mappings for VLAN packets based on simple traffic classification on Layer 2 interfaces

Precautions

When configuring priority mappings for VLAN packets based on simple traffic classification on Layer 2 interfaces, note the following point:

  • Before running the trust 8021p vlan command on an interface, use the trust upstream vlan command to bind a DS domain to the interface. Otherwise, the trust 8021p vlan configuration does not take effect.

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a VLAN on Device A.

  2. Configure the inbound interface of Device A to trust the priorities of packets from an upstream device.

  3. Configure priority mappings based on simple traffic classification on the inbound interface of Device A.

  4. Configure priority mappings for packets on the outbound interface of Device A.

Data Preparation

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

Procedure

  1. Create a VLAN on Device A.

    # 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

  2. Enable simple traffic classification on GE 0/1/0 of Device A to map the priorities of IP packets to the priorities of VLAN frames based on the default mappings.

    [~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

  3. On GE 0/1/8 of Device A, configure the mapping from 802.1p priorities to IP DSCP values.

    [~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.

  4. Verify the configuration.

    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 Files

  • 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >