English

Traffic Policy

Updated on Aug 23, 2024 by
109

What Is Traffic Policy?

Traffic policy technology is a mechanism for managing network traffic. It groups packets that share similar characteristics into classes and offers the same service to all of these classes of packets. By setting up traffic policies, you can create rules for traffic classification, which will process traffic that matches the rules individually and minimize network congestion loss.

Why Are Traffic Policies Necessary?

In everyday life, traffic regulations categorize vehicles and define specific behaviors for each type to alleviate congestion and enhance the flow of traffic. For instance, vehicles turning right must stay in the right lane, and emergency vehicles are given priority to move swiftly. These are common examples of traffic regulations. Similarly, in telecommunications, traffic policy technology acts as a network traffic management mechanism and is part of the Modular Quality of Service (QoS) Command-Line Interface (MQC) within QoS technologies. Traffic policies function as traffic regulations for network data, helping maintain orderly data transmission without increasing bandwidth usage. This approach effectively mitigates network congestion and ensures the smooth operation of real-time network services.

Classification and management of vehicle behavior by traffic rules

Implementing a traffic policy for network data is analogous to applying traffic rules for vehicles. Traffic classification functions are used to group data based on specific criteria, and traffic behavior functions define how each group should be handled. For instance, data can be classified according to service priority, with high-priority data being transmitted first, while low-priority data is queued for later. This method maximizes the efficiency of data transmission across the network.

Traffic policies define traffic classification and traffic behavior

Implementation of a Traffic Policy

To implement a traffic policy, follow these steps:

  • 1. Set Up a Traffic Classifier: Effective traffic management starts with identifying the traffic. This is done by defining a set of traffic matching rules, a process known as traffic classification.

  • 2. Define Traffic Behavior: Next, configure traffic behavior to provide different services for different types of traffic. For example, you can assign a high priority to VIP traffic by re-marking its packets.

  • 3. Configure and Bind Traffic Policy: Once the traffic classifier and traffic behavior are set, bind them together in a traffic policy.

  • 4. Apply the Traffic Policy: Finally, apply the traffic policy in the relevant view, such as a VLAN or physical interface.

Putting a traffic policy into effect

Traffic Classifier

When creating a traffic classifier, you must specify:

  • Name: This is used to bind the classifier to a traffic behavior. Use the traffic classifier command to create it.

  • Traffic Rules: Using the if-match command to define a traffic classification rule. This command allows you to establish various types of rules, such as link-layer (Layer 2), network-layer (Layer 3), and ACL rules. The table below outlines common traffic classification rules.

Traffic Classification Type
Matching Criteria
Layer 2 Rule (Link-layer)
MAC address, VLAN ID, 802.1p priority
Layer 3 Rule (Network-layer)
DSCP priority, IP precedence
ACL Rule
Access Control List (ACL)

In a traffic classifier, you can define multiple matching rules, which can be linked by either an AND or OR logical relationship.

  • OR: A packet matches the classifier if it meets any one of the defined rules.

  • AND: If the classifier includes ACL rules, the packet must match one ACL rule and all non-ACL rules to be considered a match. If there are no ACL rules, the packet must satisfy all the rules in the classifier.

Example: To create a rule for VLAN ID 120, use the following commands:

  • Step 1: traffic classifier c1 (Create classifier c1)

  • Step 2: if-match vlan-id 120 (Match VLAN ID 120)

Traffic Behavior

When creating traffic behavior, you must specify:

  • Name: This name links the behavior to a traffic classifier. Use the traffic behavior command to create it.

  • Actions: The goal of classifying packets using traffic classifiers is to enable differentiated services for various types of packets. These services are determined by defining specific traffic behaviors, where one or more actions can be assigned to each traffic behavior. The table below outlines common actions associated with traffic behaviors.

Action in Traffic Behavior
Description
Packet Filtering
Determines whether to discard or forward packets based on the results of traffic classification.
Packet Re-marking
Re-marks the priority of packets to ensure high-priority services are preferentially scheduled or forwarded.
Packet Redirection/Policy-Based Routing
Redirects packets to a specified location for processing based on traffic classification results.
Traffic Statistics Collection
Gathers statistics on packets to aid in fault diagnosis and troubleshooting.
Traffic Policing
Controls traffic rate within a bandwidth limit and discards excess traffic if the rate exceeds the limit.

Example: To limit traffic to 4096 kbit/s and collect statistics:

  • Step 1: traffic behavior b1 (Create behavior b1)

  • Step 2: car cir 4096 (Limit rate to 4096 kbit/s)

  • Step 3: statistics enable (Enable traffic statistics)

Traffic Policy

The traffic classifier and traffic behavior, though configured separately, need to be linked for effective operation. A traffic policy serves as the binding mechanism, ensuring that the actions defined in the traffic behavior are applied to packets that match the criteria of the traffic classifier. Additionally, a traffic policy can associate multiple classifier-behavior pairs, allowing for more comprehensive traffic management across different types of network traffic.

Connecting several pairs of traffic behaviors and classifiers to a traffic policy

Example: To bind classifier c1 to behavior b1:

  • Step 1: vlan 10 (Enter VLAN 10 view)

  • Step 2: traffic-policy p1 inbound (Apply policy to inbound traffic of VLAN 10)

Typical Application of a Traffic Policy

In the scenario illustrated, voice, video, and data services are transmitted across a network. When a large volume of traffic enters the network, congestion may occur due to limited bandwidth. Therefore, different levels of bandwidth guarantees are required for voice, video, and data services, arranged in descending order of priority. Specifically, voice traffic is transmitted in VLAN 120, video traffic in VLAN 110, and data traffic in VLAN 100. To manage this traffic, a traffic policy can be configured to perform traffic policing and packet re-marking. Voice packets are given the highest bandwidth and priority to ensure they are transmitted first, while video packets receive medium bandwidth and priority, and data packets receive the least. Additionally, Device2, which is connected to Device1’s uplink interface, processes the packets based on their priorities, thereby maintaining the quality of each service.

Processing various service traffic types using a traffic policy

The following configuration steps are required:

  • 1. Configure Traffic Classifiers on Device1: Classify voice, video, and data packets based on their VLAN IDs.

  • 2. Configure Traffic Behaviors on Device1: Implement traffic policing and re-mark the priorities of different service flows.

  • 3. Bind and Apply the Traffic Policy: Associate the configured traffic behaviors and traffic classifiers with a traffic policy, and apply this policy to the inbound direction of Device1.

Configuration Steps

Step 1: Configure Traffic Classifiers

  • 1. traffic classifier c1 — Create a traffic classifier named c1.

  • 2. if-match vlan-id 120 — Create a rule in c1 to identify voice traffic based on VLAN ID 120.

  • 3. traffic classifier c2 — Create a traffic classifier named c2.

  • 4. if-match vlan-id 110 — Create a rule in c2 to identify video traffic based on VLAN ID 110.

  • 5. traffic classifier c3 — Create a traffic classifier named c3.

  • 6. if-match vlan-id 100 — Create a rule in c3 to identify data traffic based on VLAN ID 100.

Step 2: Configure Traffic Behaviors

  • 1. traffic behavior b1 — Create a traffic behavior named b1.

  • car cir 3000 — Allocate the highest bandwidth.

  • remark 8021p 6 — Set the highest priority.

  • 2. traffic behavior b2 — Create a traffic behavior named b2.

  • car cir 2000 — Allocate medium bandwidth.

  • remark 8021p 4 — Set a medium priority.

  • 3. traffic behavior b3 — Create a traffic behavior named b3.

  • car cir 1000 — Allocate the lowest bandwidth.

  • remark 8021p 2 — Set the lowest priority.

Step 3: Configure the Traffic Policy

  • 1. traffic policy p1 — Create a traffic policy named p1.

  • 2. classifier c1 behavior b1 — Bind traffic classifier c1 to traffic behavior b1.

  • 3. classifier c2 behavior b2 — Bind traffic classifier c2 to traffic behavior b2.

  • 4. classifier c3 behavior b3 — Bind traffic classifier c3 to traffic behavior b3.

Step 4: Apply the Traffic Policy

  • 1. traffic-policy p1 inbound — Apply the traffic policy to the inbound interface of Device1.

Videos
Global Delivery Service | FS
01:11
Jun 26, 2024
87
Global Delivery Service | FS
Solutions