Professional Documents
Culture Documents
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.
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.
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
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:
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.
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.
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
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
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.
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
NOTE
Local priorities of VLAN packets and IP packets can be re-marked.
Re-marking internal priorities of packets affects only QoS processing of packets on the switch.
Re-marking internal priorities of packets also causes scheduling queues to be changed.
Re-marking internal priorities of packets is valid for only incoming packets.
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.
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
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
NOTE
The switch uses the default mapping from 802.1p priorities to local priorities, which cannot be changed.
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:
802.1p priority
802.1p priority
When packets reach interfaces, SwitchA performs priority mapping and sends packets to SwitchB through
GE0/0/3. Obtain packets on SwitchB.
The 802.1p priority of packets from VLAN 100 is mapped to 4.
802.1p priority
802.1p priority
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.
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.
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
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.