What Are Usage Scenarios of a Traffic Policy and What Is the Procedure for Confi

m7g
m7g  Diamond  (1)
7 years 10 months ago  View: 2857  Reply: 1
1F
        A traffic policy can be associated with traffic classifiers containing ACLs and traffic behaviors to filter traffic, implement access control, and redirect and mirror packets. The procedure for configuring a traffic policy is as follows:
  •  Configure ACL rules.
  •  Configure traffic classifiers.
  •  Configure traffic behaviors.
  •  Configure a traffic policy.
  •  Apply a traffic policy to an interface, a VLAN, or the system.
For details on how to configure a traffic policy, see Configuration Guide - QoS Configuration.
m7g
m7g  Diamond 
7 years 10 months ago
2F

Example for Configuring Traffic Policing Based on a Traffic Classifier


The Switch provides different bandwidth by configuring traffic policing based on a traffic classifier and setting different CAR parameters.

Networking Requirements

The Switch is connected to the router through GE 0/0/3; enterprise and individual users can access the network through the Switch and router. SeeTable 1.

  • The voice services of enterprise and individual users belong to VLANs 120 and 220.
  • The video services of enterprise and individual users belong to VLANs 110 and 210.
  • The data services of enterprise and individual users belong to VLANs 100 and 200.

On the Switch, packets of different services need to be policed, and the total traffic of enterprise and individual users needs to be controlled in a proper range.

The DSCP priorities carried in service packets sent from the user side are unreliable and services require different QoS in actual applications; therefore, you need to re-mark DSCP priorities of different service packets on the Switch. In this manner, the downstream router can process packets according to different priorities.

The requirements are as follows:

Table 1 QoS provided by the Switch for upstream traffic

User Type

Traffic Type

CIR (Mbit/s)

PIR (Mbit/s)

DSCP Priority

Enterprise users

Voice

10

15

46

Video

50

75

30

Data

40

60

14

Individual users

Voice

10

15

46

Video

40

60

30

Data

30

45

14



Figure 1 Networking diagram for configuring traffic policing based on a traffic classifier 

http://127.0.0.1:52199/hedex/pages/DE107063/01%20(2010-06-28)/DE107063/01%20(2010-06-28)/resources/s/images/fig_dc_s_cfg_x0162301.png


Configuration Roadmap

The configuration roadmap is as follows:
  1. Create VLANs and configure interfaces so that enterprise and individual users can access the network through the Switch.
  2. Create traffic classifiers based on the VLAN ID on the Switch.
  3. Create traffic behaviors on the Switch to police the traffic received from the user side and re-mark DSCP priorities of packets, and police the traffic sent to the user side.
  4. Create traffic policies on the Switch, bind traffic behaviors to traffic classifiers in the traffic policies, and apply the traffic policies to the interfaces that packets pass through.

Data Preparation

To complete the configuration, you need the following data:
  • Re-marked priorities of packets with different VLAN IDs
  • Parameters for packets with different VLAN IDs: CIR and PIR
  • Type, direction, and number of the interface on which a traffic policy needs to be applied

Procedure

  1. Create VLANs and configure interfaces.

    # Configure the access types of GE0/0/1, GE0/0/2, and GE0/0/3 to trunk, add GE0/0/1 to VLAN 100, VLAN 110, and VLAN 120, add GE0/0/2 to VLAN 200, VLAN 210, and VLAN 220, and add GE0/0/3 to VLAN 100, VLAN 110, VLAN 120, VLAN 200, VLAN 210, and VLAN 220.


  2. # Create traffic classifiers c1 to c6 on the Switch to classify incoming and outgoing user packets based on the VLAN ID.

     	
  3. # Create traffic behaviors b1 to b6 on the Switch to police user packets and re-mark priorities of the packets.

     	
  4. Create traffic policies and apply them on interfaces.

    # Create traffic policy p1 on the Switch, bind traffic classifiers to traffic behaviors in the traffic policy, and apply the traffic policy to GE 0/0/1 and GE 0/0/2 in the inbound direction to police the packets received from the user side and re-mark priorities of these packets.

     
  5. Verify the configuration.


    # Check the configuration of the traffic classifier.

    # Check the configuration of the traffic policy applied on an interface. Here, the configuration of the traffic policy applied on GE 0/0/1 is displayed.
    [Switch] display traffic policy statistics interface gigabitethernet 0/0/1 inbound Interface: GigabitEthernet0/0/1  Traffic policy inbound: p1  Rule number: 1  Current status: OK! Item                              Packets                       Bytes --------------------------------------------------------------------- Matched                                 10                           10000   +--Passed                             8                            8000   +--Dropped                            2                            2000     +--Filter                           2                            2000     +--URPF                             -                            -     +--CAR                              2                            2000
     
     

Configuration file of the Switch

#  sysname Switch #  vlan batch 100 110 120 200 210 220 # traffic classifier c6 operator and  if-match 5 vlan-id 200 traffic classifier c4 operator and  if-match 5 vlan-id 220 traffic classifier c2 operator and  if-match 5 vlan-id 110 traffic classifier c5 operator and  if-match 5 vlan-id 210 traffic classifier c3 operator and  if-match 5 vlan-id 100 traffic classifier c1 operator and  if-match 5 vlan-id 120 # traffic behavior b1  car cir 10000 pir 15000 cbs 1250000 pbs 1875000 green pass yellow pass red discard  remark dscp ef  statistic enable traffic behavior b3  car cir 40000 pir 60000 cbs 5000000 pbs 7500000 green pass yellow pass red discard  remark dscp af13  statistic enable traffic behavior b5  car cir 40000 pir 60000 cbs 5000000 pbs 7500000 green pass yellow pass red discard  remark dscp af33  statistic enable traffic behavior b2  car cir 50000 pir 75000 cbs 6250000 pbs 9375000 green pass yellow pass red discard  remark dscp af33  statistic enable traffic behavior b4  car cir 10000 pir 15000 cbs 1250000 pbs 1875000 green pass yellow pass red discard  remark dscp ef  statistic enable traffic behavior b6  car cir 30000 pir 45000 cbs 3750000 pbs 5625000 green pass yellow pass red discard  remark dscp af13  statistic enable # traffic policy p1  classifier c1 behavior b1  classifier c2 behavior b2  classifier c3 behavior b3  classifier c4 behavior b4  classifier c5 behavior b5  classifier c6 behavior b6 # interface GigabitEthernet0/0/1  port link-type trunk  port trunk allow-pass vlan 100 110 120  traffic-policy p1 inbound # interface GigabitEthernet0/0/2  port link-type trunk  port trunk allow-pass vlan 200 210 220  traffic-policy p1 inbound # interface GigabitEthernet0/0/3  port link-type trunk  port trunk allow-pass vlan 100 110 120 200 210 220  # return