< Home

Example for Configuring Traffic Shaping

Networking Requirements

The Switch is connected to the router through GE0/0/2. The voice, video, and data services, with 802.1p priorities of 6, 5, and 2, are transmitted to users through the router and Switch, as shown in Figure 1. The rate of traffic from the user LAN is higher than the interface rate on the router; therefore, jitter may occur on GE0/0/2. The following requirements must be met to reduce jitter and ensure bandwidth of services:

  • The CIR on GE0/0/2 is 10000 kbit/s.

  • The CIR and PIR for the voice service are 3000 kbit/s and 5000 kbit/s respectively.

  • The CIR and PIR for the video service are 5000 kbit/s and 8000 kbit/s respectively.

  • The CIR and PIR for the data service are 2000 kbit/s and 3000 kbit/s respectively.

Figure 1 Networking of traffic shaping

Configuration Roadmap

The configuration roadmap is as follows:
  1. Create VLANs and configure interfaces to enable the users to access the network through the Switch.
  2. Configure the inbound interface of service packets to trust 802.1p priorities in packets.

  3. Configure traffic shaping on the outbound interface of service packets to limit the bandwidth of the interface.

  4. Configure queue-based traffic shaping on the outbound interface to limit the CIR values of voice, video, and data services.

Procedure

  1. Configure VLANs and interfaces.

    # Create VLAN 10.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] vlan batch 10

    # Configure GE0/0/1 and GE0/0/2 as trunk interfaces, and add GE0/0/1 and GE0/0/2 to VLAN 10.

    [Switch] interface gigabitethernet 0/0/1
    [Switch-GigabitEthernet0/0/1] port link-type trunk
    [Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
    [Switch-GigabitEthernet0/0/1] quit
    [Switch] interface gigabitethernet 0/0/2
    [Switch-GigabitEthernet0/0/2] port link-type trunk
    [Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
    [Switch-GigabitEthernet0/0/2] quit

    # Create VLANIF 10 and assign IP address 10.10.10.2/24 to VLANIF 10.

    [Switch] interface vlanif 10
    [Switch-Vlanif10] ip address 10.10.10.2 255.255.255.0
    [Switch-Vlanif10] quit

    Assign IP address 10.10.10.1/24 to the router interface connected to Switch.

  2. Configure the inbound interface of service packets to trust packet priorities.

    For the priority mapping configuration of the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-S, S5731S-H, S5732-H, S5735-L, S5735S-L, S5735S-L-M, S5735-S, S5735S-S, S5735-S-I, S6720-EI, S6720S-EI, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S, refer to Configuring Priority Mapping. For the priority mapping configuration of the S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, S5720-SI, S5730S-EI, S5730-SI, S5735-L, S5735S-L, S5735S-L-M, S5735-S, S5735-S-I, S5735S-S, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI, refer to Configuring Priority Mapping.

    The configuration in this step is applicable to the S2720-EI, S5720-LI, S5720S-LI, S5720-SI, S5720S-SI, S5720I-SI, S5730-SI, S5730S-EI, S6720-LI, S6720S-LI, S6720-SI, and S6720S-SI.

    # Configure gigabitethernet0/0/1 to trust 802.1p priorities of packets.

    [Switch] interface gigabitethernet 0/0/1
    
    [Switch-GigabitEthernet0/0/1] trust 8021p
    [Switch-GigabitEthernet0/0/1] quit

  3. Configure traffic shaping on the outbound interface.

    # Configure traffic shaping on gigabitethernet 0/0/2 to limit the interface rate to 10000 kbit/s.

    [Switch] interface gigabitethernet 0/0/2
    [Switch-GigabitEthernet0/0/2] qos lr outbound cir 10000

  4. Configure queue-based traffic shaping.

    # Configure traffic shaping for queues on GigabitEthernet0/0/ to limit the CIR and PIR of the voice service to 3000 kbit/s and 5000 kbit/s, the CIR and PIR of the video service to 5000 kbit/s and 8000 kbit/s, and the CIR and PIR of the data service to 2000 kbit/s and 3000 kbit/s.

    [Switch-GigabitEthernet0/0/2] qos queue 6 shaping cir 3000 pir 5000
    [Switch-GigabitEthernet0/0/2] qos queue 5 shaping cir 5000 pir 8000
    [Switch-GigabitEthernet0/0/2] qos queue 2 shaping cir 2000 pir 3000
    [Switch-GigabitEthernet0/0/2] quit

  5. Verify the configuration.

    # After the configuration is complete, the committed bandwidth for the packets sent from GE0/0/2 is 10000 kbit/s; the transmission rate of the voice service ranges from 3000 kbit/s to 5000 kbit/s; the transmission rate of the video service ranges from 5000 kbit/s to 8000 kbit/s; the transmission rate of the data service ranges from 2000 kbit/s to 3000 kbit/s.

Configuration Files

  • Switch configuration file
    #
    sysname Switch
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address 10.10.10.2 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
     trust 8021p 
    #
    interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 10 
     qos lr outbound cir 10000 cbs 1250000
     qos queue 2 shaping cir 2000 pir 3000
     qos queue 5 shaping cir 5000 pir 8000
     qos queue 6 shaping cir 3000 pir 5000
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >