QoS Issues - Issue 3 QoS Implementation - Simple Traffic Classification and Re-marking Highlighted

Created: Apr 10, 2017 09:54:01Latest reply: Apr 10, 2017 17:50:23 4742 1 0 0

QoS Implementation - Simple Traffic Classification and Re-marking

Issue 2 describes Modular QoS Command-Line Interface (MQC). A traffic classifier can classify packets and a traffic behavior can re-mark packets to implement fine-grained differentiated services. Priority mapping is another method of packet classification and marking. It can classify packets based on 802.1p priorities, DSCP priorities, and local priorities.

1 Background of Priority Mapping

Priority mapping is a method of translating QoS precedence fields carried in packets into internal priorities on a switch (also called local priorities, which are used to differentiate classes of service for packets). Priority mapping allows the switch to provide differentiated services for packets based on the internal priorities.

After packets that carry the QoS priority reach the switch, the switch maps the external priority (for example, 802.1p or DSCP priority) to the local priority so that the switch can determine how to process the packets. When packets leave the switch, the switch maps the local priority to the external priority so that the downstream device can provide differentiated services based on the packet priority. That is, priority mapping is the basis for classifying packets and is the prerequisite for implementing differentiated services.

Packets carry different types of precedence fields depending on the network type. For example, packets carry the 802.1p field in a VLAN, the EXP field on an MPLS network, and the DSCP field on an IP network.

This issue describes priority mapping on Layer 2 and Layer 3 networks.

2 QoS Precedence Fields

The following describes the fields that identify priorities in packets.

2.1 802.1p Priority in the Ethernet Frame Header

As defined in IEEE 802.1Q, the PRI field (802.1p priority) in the Ethernet frame header, also called Class of Service (CoS), identifies the QoS requirement. Figure 2-1 shows the PRI field.

Figure 2-1 802.1p priority in the Ethernet frame header

20170410095334123001.png

 

The 802.1Q header contains a 3-bit PRI field. The PRI field defines eight service priority values 7, 6, 5, 4, 3, 2, 1 and 0, in descending order of priority.

2.2 IP Precedence Field and DSCP Field in the IP Packet Header

As defined in RFC 791, bits 0 to 2 of the Type of Service (ToS) field in an IP packet header constitute the Precedence field, representing precedence values 7, 6, 5, 4, 3, 2, 1 and 0, in descending order of priority. Apart from the Precedence field, a ToS field also contains bits D, T, and R. Bit D, T, and R represent the delay, throughput, and reliability, respectively.

RFC 1349 initially defined the ToS field in IP packets and later added bit C that indicates the monetary cost.

RFC 2474 changed the ToS field to the DS field. In the DS field, bits 0 to 5 are the DS CodePoint (DSCP) and bits 6 and 7 (flow control) are reserved.

Figure 2-2 IP Precedence and DSCP fields

20170410095335096002.png

 

3 Priority Mapping in a DiffServ Domain

3.1 Principles

The switch uses the Differentiated Service (DiffServ) domain to manage and record the mapping between QoS priorities and CoS values and the mapping between QoS priorities and colors:

1.         When packets enter the switch, QoS priorities of packets are mapped to internal CoS values (internal or local priorities) and colors.

2.         The switch implements congestion avoidance based on CoS values and colors of packets.

3.         When packets leave the switch, internal CoS values and colors are mapped to QoS priorities. The switch determines the queues that packets enter based on the mapping between internal CoS values and QoS priorities, and performs operations such as traffic shaping, congestion avoidance, and queue scheduling for packets. The switch can re-mark priorities of outgoing packets so that the downstream device can provide differentiated QoS based on packet priorities.

The switch maps QoS priorities to CoS values and colors for incoming packets and maps CoS values and colors to QoS priorities for outgoing packets.

Figure 3-1 QoS priority mapping

20170410095336015003.png

 

3.1.1 CoS Value

The CoS represents the service quality of packets in a switch and determines the type of queues to which packets belong. The CoS is represented by the Per Hop Behavior (PHB).

An action taken for packets on each DS node is called a PHB. The PHB is a forwarding behavior applied to a DS node. The PHB can be defined based on priorities or QoS specifications such as the delay, jitter, and packet loss ratio. The PHB defines some forwarding behaviors but does not specify the implementation mode.

The IETF defines four types of PHBs: Class Selector (CS), Expedited Forwarding (EF), Assured Forwarding (AF), and best-effort (BE). BE is the default PHB.

RFC 2474 classifies CS into CS6 and CS7.

RFC 2597 classifies AF into four classes: AF1 to AF4. Each AF level has three drop priorities and is represented in the format of AF1x to AF4x. x represents the drop priority, and values 1 to 3 are in ascending order of priority.

There are eight classes of PHBs: CS7, CS6, EF, AF4, AF3, AF2, AF1, and BE in descending order of priority. The following table describes the mapping between PHBs and DSCP priorities.

Table 3-1 Mapping between PHBs and DSCP priorities

PHB

DSCP Priority

CS7

56

CS6

48

EF

46

AF4

34, 36, and 38 (corresponding to AF41, AF42, and AF43)

AF3

26, 28, and 30 (corresponding to AF31, AF32, and AF33)

AF2

18, 20, and 22 (corresponding to AF21, AF22, and AF23)

AF1

10, 12, and 14 (corresponding to AF11, AF12, and AF13)

BE

0

 

CS6 and CS7 PHBs are used for protocol packets by default, such as STP BPDUs, LLDPDUs, and LACPDUs. If these packets are not forwarded, protocol services are interrupted.

The EF PHB is used for transmitting VoIP traffic or data flows of enterprise internal video conferences. Voice services require a short delay, low jitter, and low packet loss ratio, and are second only to protocol packets in terms of importance.

The AF4 PHB is used for transmitting signaling traffic of voice services, that is, protocol packets of VoIP services.

The AF3 PHB is used for Telnet and FTP services of remote devices. The services require medium bandwidth, reliable transmission, and zero packet loss, but are sensitive to the delay and jitter.

The AF2 PHB is used for transmitting flows of enterprise IPTV live programs and ensures smooth transmission of online video services. Live services are real-time services and require continuous bandwidth and a large throughput guarantee, but allow less packet loss.

The AF1 PHB is used for common data services such as emails. Common data services require only zero packet loss, and do not require high real-time performance and jitter.

The BE PHB applies to best-effort services on the Internet, such as HTTP web page browsing services.

3.1.2 Color

The color represents the internal drop priority in a switch and determines the sequence in which packets in one queue are dropped when traffic congestion occurs. The Institute of Electrical and Electronics Engineers (IEEE) defines three colors: green, yellow, and red.

The drop priority depends on parameter settings. For example, green packets can use a maximum of 50% buffer and red packets can use a maximum of 100% buffer. Green packets have a higher drop priority than red packets. That is, red packets may not have a higher drop priority than green packets.

3.2 Priority Mapping

In a DiffServ domain, priority mapping refers to the mapping between priorities and PHBs or colors. The DiffServ domain default defines the mapping between priorities and PHBs or colors by default. The DiffServ domain default can be modified but cannot be deleted. In addition to the DiffServ domain default, you can create a DiffServ domain and specify the mapping between packet priorities and PHBs or colors as needed.

3.2.1 802.1p Priority Mapping

Table 3-2 Default mapping from 802.1p priorities of incoming VLAN packets to PHBs and colors in a DiffServ domain

802.1p Priority

PHB

Color

0

BE

Green

1

AF1

Green

2

AF2

Green

3

AF3

Green

4

AF4

Green

5

EF

Green

6

CS6

Green

7

CS7

Green

 

Table 3-3 Default mapping from PHBs and colors to 802.1p priorities of outgoing VLAN packets in a DiffServ domain

PHB

Color

802.1p Priority

BE

Green, yellow, and red

0

AF1

Green, yellow, and red

1

AF2

Green, yellow, and red

2

AF3

Green, yellow, and red

3

AF4

Green, yellow, and red

4

EF

Green, yellow, and red

5

CS6

Green, yellow, and red

6

CS7

Green, yellow, and red

7

 

According to Table 3-2 and Table 3-3, the default settings are as follows:

l   For incoming VLAN packets in a DiffServ domain, 802.1 priorities (ascending order) correspond to PHBs (BE to CS7) and packet colors are all green.

l   For outgoing VLAN packets in a DiffServ domain, PHBs (BE to CS7) correspond to 802.1 priorities (ascending order) regardless of whether packets are green, yellow, and red.

3.2.2 DSCP Priority Mapping

Table 3-4 Default mapping from DSCP priorities of incoming IP packets to PHBs and colors in a DiffServ domain

DSCP Priority

PHB

Color

DSCP Priority

PHB

Color

8

AF1

Green

28

AF3

Yellow

10

AF1

Green

30

AF3

Red

12

AF1

Yellow

32

AF4

Green

14

AF1

Red

34

AF4

Green

16

AF2

Green

36

AF4

Yellow

18

AF2

Green

38

AF4

Red

20

AF2

Yellow

40

EF

Green

22

AF2

Red

48

CS6

Green

24

AF3

Green

56

CS7

Green

26

AF3

Green

Value in the range of 0 to 63, excluding the preceding values

BE

Green

 

Table 3-5 Default mapping from PHBs and colors to DSCP priorities of outgoing IP packets in a DiffServ domain

PHB

Color

DSCP Priority

BE

Green, yellow, and red

0

AF1

Green

10

AF1

Yellow

12

AF1

Red

14

AF2

Green

18

AF2

Yellow

20

AF2

Red

22

AF3

Green

26

AF3

Yellow

28

AF3

Red

30

AF4

Green

34

AF4

Yellow

36

AF4

Red

38

EF

Green, yellow, and red

46

CS6

Green, yellow, and red

48

CS7

Green, yellow, and red

56

3.3 Local Priority

According to Table 3-2 and Table 3-3, packets colors are green regardless of 802.1p priorities of VLAN packets in the inbound direction, but packets use different colors in the outbound direction by default. Why? The possible causes are as follows:

l   When configuring priority mapping in the inbound direction, you can run the 8021p-inbound 8021p-value phb service-class [ green | yellow | red ] command to specify the packet color. If the packet color is not specified, the default packet color is green.

l   After a packet enters a switch through inbound priority mapping and before the packet leaves the switch through outbound priority mapping, the packet is processed locally. In this process, the switch identifies the packet by local priority. You can run the remark local-precedence { local-precedence-name | local-precedence-value } [ green | yellow | red ] command to re-mark the local priority and specify the packet color. Therefore, packets use different colors in the outbound direction.

On a switch, one local priority corresponds to one interface queue.

Table 3-6 Mapping between local priorities and interface queues (supported by fixed switches and some cards of modular switches)

Local Priority

Queue Index

BE

0

AF1

1

AF2

2

AF3

3

AF4

4

EF

5

CS6

6

CS7

7

 

Table 3-7 Mapping between local priorities and interface queues (supported by some cards of modular switches)

Local Priority

Queue Index

BE (unknown unicast packets)

0

AF1 (unknown unicast packets)

1

AF2 (unknown unicast packets)

1

AF3 (unknown unicast packets)

1

AF4 (unknown unicast packets)

2

EF (unknown unicast packets)

2

CS6 (unknown unicast packets)

6

CS7 (unknown unicast packets)

6

BE (known unicast packets)

0

AF1 (known unicast packets)

1

AF2 (known unicast packets)

2

AF3 (known unicast packets)

3

AF4 (known unicast packets)

4

EF (known unicast packets)

5

CS6 (known unicast packets)

6

CS7 (known unicast packets)

7

 

note

l  Local priorities of VLAN packets and IP packets can be re-marked.

l  Re-marking internal priorities of packets affects only QoS processing of packets on the switch.

l  Re-marking internal priorities of packets also causes scheduling queues to be changed.

l  Re-marking internal priorities of packets is valid for only incoming packets.

4 Priority Mapping Based on the Mapping Table

4.1 Principles

When the mapping table is used, priority mapping implements the mapping from IP priorities to 802.1p priorities or IP priorities and the mapping from DSCP priorities to 802.1p priorities, drop priorities, or DSCP priorities.

1.         When packets reach the switch, the switch maps DSCP or IP priorities in packets trusted by an interface to 802.1p priorities based on the mapping table.

2.         The switch determines the queues that packets enter based on the default mapping between 802.1p priorities and local priorities, and performs operations such as traffic shaping, congestion avoidance, and queue scheduling for packets.

3.         When packets leave the switch, the switch changes priorities of outgoing packets so that the downstream device can provide differentiated QoS based on packet priorities.

note

Some fixed switches support only priority mapping based on the mapping table but not priority mapping in a DiffServ domain.

When the mapping table is used, the mapping between DSCP or IP priorities and other priorities is the core configuration. The switch provides the default mapping table.

4.2 Mapping from DSCP Priorities to Other Priorities

When the mapping table is used, DSCP priorities can be mapped to 802.1p priorities, drop priorities, or DSCP priorities.

Table 4-1 Default mapping from DSCP priorities to 802.1p priorities and drop priorities

Input DSCP Priority

Output 802.1p Priority

Output Drop Priority

0-7

0

0

8-15

1

0

16-23

2

0

24-31

3

0

32-39

4

0

40-47

5

0

48-55

6

0

56-63

7

0

 

By default, one DSCP priority corresponds to one DSCP priority.

4.3 Mapping from IP Priorities to Other Priorities

When the mapping table is used, IP priorities can be mapped to 802.1p priorities or IP priorities.

Table 4-2 Default mapping from IP priorities to 802.1p priorities and IP priorities

Input IP Priority

Output 802.1p Priority

Output IP Priority

0

0

0

1

1

1

2

2

2

3

3

3

4

4

4

5

5

5

6

6

6

7

7

7

4.4 Mapping from 802.1p Priorities to Local Priorities

When the mapping table is used, the switch maps DSCP or IP priorities in received packets to other priorities when the packets leave the switch.

Actually, packets are processed locally on the switch. The priorities of all the packets entering the switch are mapped to 802.1p priorities, and then are mapped to local priorities based on 802.1p priorities. The switch schedules packets into queues based on local priorities.

Table 4-3 Default mapping from 802.1.1p priorities to local priorities

802.1p Priority

Local Priority

0

BE

1

AF1

2

AF2

3

AF3

4

AF4

5

EF

6

CS6

7

CS7

 

note

The switch uses the default mapping from 802.1p priorities to local priorities, which cannot be changed.

5 Configuration Examples of Priority Mapping

This section provides configuration examples of priority mapping based on a DiffServ domain or the mapping table.

5.1 Example for Configuring Priority Mapping Based on a DiffServ Domain

User Requirements

In Figure 5-1, SwitchA is connected to SwitchB through GE0/0/3, and SwitchB is connected to the router. Department 1 and department 2 can access the WAN through SwitchA, SwitchB, and the router. Department 1 and department 2 belong to VLAN 100 and VLAN 200, respectively.

The 802.1p priorities of packets from the department 1 and 2 are both 0, but department 1 has a higher service level and needs to obtain better QoS guarantee. To provide differentiated services, the enterprise defines DiffServ domains to map the priorities of data packets from departments 1 and 2 to 4 and 2, respectively.

Figure 5-1 Priority mapping based on a DiffServ domain

20170410095338652005.png

 

Configuration Roadmap

The configuration roadmap is as follows:

1.         Create VLANs and configure interfaces so that departments 1 and 2 can connect to the WAN through switches.

2.         Create DiffServ domains to map 802.1p priorities to PHBs and colors.

3.         Bind DiffServ domains to inbound interfaces GE1/0/1 and GE1/0/2 of SwitchA.

Procedure

Key configuration on SwitchA:

# On SwitchA, create DiffServ domains domain1 and domain2 to map 802.1p priorities of packets from department 1 and department 2 to local priorities.

[SwitchA] diffserv domain domain1

[SwitchA-dsdomain-domain1] 8021p-inbound 0 phb af4 green

[SwitchA-dsdomain-domain1] quit

[SwitchA] diffserv domain domain2

[SwitchA-dsdomain-domain2] 8021p-inbound 0 phb af2 green

[SwitchA-dsdomain-domain2] quit

# Bind DiffServ domains domain1 and domain2 to GE1/0/1 and GE1/0/2, respectively.

[SwitchA] interface gigabitethernet 0/0/1

[SwitchA-GigabitEthernet0/0/1] trust upstream domain1

[SwitchA-GigabitEthernet0/0/1] quit

[SwitchA] interface gigabitethernet 0/0/2

[SwitchA-GigabitEthernet0/0/2] trust upstream domain2

[SwitchA-GigabitEthernet0/0/2] quit

After the configuration is complete, you can run the display diffserv domain [ all | name ds-domain-name ] command to check the configuration.

Verification

Use a tester to simulate department 1 and department 2 to send packets to GE0/0/1 and GE0/0/2 of SwitchA. The sent packets belong to VLAN 100 and VLAN 200 and carry the 802.1p priority of 0.

Packets received on GE0/0/1:

20170410095338905006.png

Packets received on GE0/0/2:

20170410095339141007.png

 

When packets reach interfaces, SwitchA performs priority mapping and sends packets to SwitchB through GE0/0/3. Obtain packets on SwitchB.

l   The 802.1p priority of packets from VLAN 100 is mapped to 4.

20170410095340591008.png

 

l   The 802.1p priority of packets from VLAN 200 is mapped to 2.

20170410095341873009.png

 

Subsequently, other QoS functions can be configured based on 802.1p priorities to provide differentiated services.

Packet receiving on GE0/0/1 of SwitchA is used as an example to describe the priority mapping process.

1.         GE0/0/1 receives packets with the 802.1p priority of 0 from VLAN 100. The PHB is mapped to AF4 based on the 8021p-inbound 0 phb af4 green command.

2.         The mapping between local priorities and queues is not changed, so SwitchA sends packets to queue 4 based on the default mapping.

3.         SwitchA forwards the packets to SwitchB through queue 4 on GE0/0/3. You can run the display qos queue statistics command to verify the configuration. The display of only queue 4 on GE0/0/3 of SwitchA is provided here, and the display of other queues is not provided.

[SwitchA] display qos queue statistics interface GigabitEthernet 0/0/3

------------------------------------------------------------

  Queue ID          : 4

  CIR(kbps)         : 0

  PIR(kbps)         : 1,000,000

  Used Length(byte) : 0

  Passed Packets    : 123,706,860

  Passed Rate(pps)  : 412,356

  Passed Bytes      : 12,865,511,178

  Passed Rate(bps)  : 343,080,272

  Dropped Packets   : 0

  Dropped Rate(pps) : 0

  Dropped Bytes     : 0

  Dropped Rate(bps) : 0

------------------------------------------------------------

You can see that the number of packets sent by SwitchA to SwitchB through queue 4 of GE0/0/3 approximates the number of packets received by GE0/0/1 of SwitchA from the tester.

20170410095342642010.png

 

If the qos local-precedence-queue-map local-precedence queue-index command is used on SwitchA to change the mapping between local priorities and queues, the queue that packets enter on GE0/0/3 will be changed. For example, when the qos local-precedence-queue-map af4 7 command is configured on SwitchA, SwitchA sends packets to SwitchB through queue 7 on GE0/0/3.

[SwitchA] display qos queue statistics interface GigabitEthernet 0/0/3

------------------------------------------------------------

  Queue ID          : 7

  CIR(kbps)         : 0

  PIR(kbps)         : 1,000,000

  Used Length(byte) : 0

  Passed Packets    : 124,574,406

  Passed Rate(pps)  : 349,039

  Passed Bytes      : 15,928,667,594

  Passed Rate(bps)  : 290,400,352

  Dropped Packets   : 0

  Dropped Rate(pps) : 0

  Dropped Bytes     : 0

  Dropped Rate(bps) : 0 ------------------------------------------------------------

You can see that the number of packets sent by SwitchA to SwitchB through queue 7 of GE0/0/3 approximates the number of packets received by GE0/0/1 of SwitchA from the tester.

20170410095343408011.png

 

5.2 Example for Configuring Priority Mapping Based on the Mapping Table

User Requirements

In Figure 5-2, SwitchC is connected to the router. Department 1 and department 2 can access the network through SwitchA and SwitchB. Department 1 and department 2 belong to VLAN 100 and VLAN 200, respectively.

Department 1 requires better QoS guarantee; therefore, the DSCP priorities of data packets from department 1 and department 2 are mapped to 45 and 30, respectively. The switch trusts the DSCP priority of packets. When congestion occurs, the switch preferentially processes packets with a higher DSCP priority.

Figure 5-2 Priority mapping based on the mapping table

20170410095344067012.png

 

Configuration Roadmap

The configuration roadmap is as follows:

1.         Create VLANs and configure interfaces so that the enterprise can access the network.

2.         Configure priority mapping to map DSCP priorities of data packets from department 1 and department 2 are mapped to 45 and 30, respectively.

Procedure

Key configuration on SwitchA:

# Configure interfaces to trust the DSCP priority of packets.

[SwitchA] interface gigabitethernet 0/0/1

[SwitchA-GigabitEthernet0/0/1] trust dscp

[SwitchA-GigabitEthernet0/0/1] quit

[SwitchA] interface gigabitethernet 0/0/2

[SwitchA-GigabitEthernet0/0/2] trust dscp

[SwitchA-GigabitEthernet0/0/2] quit

# Configure priority mapping.

[SwitchA] qos map-table dscp-dscp

[SwitchA-dscp-dscp] input 0 to 63 output 45

[SwitchA-dscp-dscp] quit

Key configuration on SwitchB:

# Configure interfaces to trust the DSCP priority of packets.

[SwitchB] interface gigabitethernet 0/0/1

[SwitchB-GigabitEthernet0/0/1] trust dscp

[SwitchB-GigabitEthernet0/0/1] quit

[SwitchB] interface gigabitethernet 0/0/2

[SwitchB-GigabitEthernet0/0/2] trust dscp

[SwitchB-GigabitEthernet0/0/2] quit

# Configure priority mapping.

[SwitchB] qos map-table dscp-dscp

[SwitchB-dscp-dscp] input 0 to 63 output 30

[SwitchB-dscp-dscp] quit

After the configuration is complete, run the display qos map-table dscp-dscp command to check the configured mapping table.

Verification

Use a tester to simulate department 1 and department 2 to send packets to GE0/0/1 interfaces of SwitchA and SwitchB. The sent packets belong to VLAN 100 and VLAN 200 and carry the DSCP priority of 0.

On GE0/0/2 interfaces of SwitchA and SwitchB, the DSCP priorities of packets are changed to 45 and 30, respectively.

The verification process is similar to section 5.1. Obtain packets and check DSCP priorities of packets. The details are not mentioned here.

6 Summary

The priority mapping mode depends on device models.

After priority mapping is used for packet classification, you can configure other QoS functions such as traffic policing, traffic shaping, and queue scheduling, so as to provide differentiated services.

Issue 4 will describe traffic policing, traffic shaping, and interface-based rate limiting.

This article contains more resources

You need to log in to download or view. No account?Register

x
  • x
  • convention:

gululu     Created Apr 10, 2017 17:50:23 Helpful(0) Helpful(0)

good,thanks!
  • x
  • convention:

Come on!

Reply

Reply
You need to log in to reply to the post Login | Register

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Fast reply Scroll to top