Ensuring service quality is one of the most advanced topics in the network technology field. Packet Switching is an inevitable trend in the development of network technology, as it overpowers circuit switching and IP networks over traditional telecom networks. However, the telecom network is connection-oriented, and its advantage is to transmit real-time services such as voice/video. The IP network itself is connectionless and requires new technologies, in order to take over the burden of traditional telecom networks. Cos is such a technology.
The basic idea of cos (class of service) is to distinguish different priorities of services on the network. In every aspect of the network, data packets with high real-time requirements are prioritized. To implement cos technology, you must start with network hardware and network management software. The server should support policy-based Management. Policy Management allows different applications in different departments to set different priorities at different times. The policy is stored in the ldap database or directory on the server. The Client Support Program (for example, dynamicaccess of 3com) perceives the priority of an application when it starts. On each node of the network, the priority is set to 802.1 p on the LAN and iptos on the wan. The Hardware Design of A vswitch must support multiple queues, and services with different priorities are queued separately. For example, a data packet with a higher priority can pass through directly. Normal data packets with a higher priority are cached and transmitted when they are idle. On the wide area network, cos must be mapped to qos (quality of service) or ip tos (type of service ).
Different from cos, the basic idea of qos is to reserve a certain amount of bandwidth for real-time services, so as to control the packet loss rate, delay, throughput, congestion, and other data to an acceptable level. Qos technology has two basic measures: (1) connect admission control and traffic shaping must be implemented for data sources; (2) Before data streams enter the network, the impact of this data stream on the entire network must be estimated.
The essence of cos is to increase bandwidth to improve service quality. Cos has the following advantages: (1) Simple Network, (2) low cost, and (3) compatibility with earlier devices. But there are also several disadvantages: (1) it is still a best-effort transmission; (2) there is no service area score; (3) bandwidth needs to be increased frequently; (4) Occasional congestion. Cos is mainly applicable to enterprise networks or campus networks.
Qos improves service quality by improving management. It has the following advantages: (1) better service quality assurance; (2) basic standards; (3) reduced the cost of excessive bandwidth supply; (4) applicable to man and wan. It has the following Disadvantages: (1) complicated management; (2) a policy-aware switch and server are required for the entire network; (3) existing devices may not support qos.
From the current situation, although all vendors talk about qos, qos must be implemented within a large range. First, this involves multiple manufacturers' devices. Second, the total bandwidth of the network is too small. Therefore, francois tournesac, enterprise marketing director of 3com Asia Pacific, said, "internet/Wan has no qos ".
3com is the advocate of cos. As we all know, the advantage of 3com lies in the enterprise network. To implement the unified network proposed by eric, 3com is committed to providing real-time services on the enterprise network. For example, it proposed the lan telephony solution for the first time ). To provide real-time services, the bandwidth on the enterprise network is not a problem. You only need to simply classify the services, and the cost is not high, this is the technical background of cos proposed by 3com. At the same time, service classification brings complexity to network management. 3com's policy-driven networking (ppn) can solve this problem. All devices must be set according to the definition of the Policy directory. For example, if an application on the user side sets a higher priority, the edge side needs to set the corresponding 802.1p. If the center end is Ethernet, 802.1p is set; if the center end is atm, qos is set. In the wan, you need to set the bandwidth or other settings for the wan. When an application requires a higher priority, the technology used by the application in different places through the network may be different. However, as long as there are policies, you can set them in different places and define different service levels in advance. Once a policy is formed, the network device is combined with the policy directory to automatically execute the policy.
Of course, cos is only one of the functions of policy management, policy services also include Bandwidth Reservation, security control, network monitoring, network control management, sla, Service Level feedback, network configuration, and network operation.
QoS is implemented based on the DiffServ System of IETF. The DiffServ system requires that each transmission packet be classified into different categories in the network, and the classification information is included in the IP packet header, the DiffServ system uses the first six bits in the ToS (type of service) in the IP packet header to carry the classification information of packets. Of course, classification information can also be carried on link layer packets. Generally, the classification information included in the packet includes:
The first three bits in the tag control information of a frame header contain priority information of eight categories. Generally, these three bits are called user priority bits.
2. The first three bits of the TOS field in the packet header are called IP precedence value, or the first six bits of the TOS field carried in the IP Message Header are called Differentiated Services Code Point (dscp) values. In a network that complies with the DiffServ system, each vswitch and router adopt the same transmission service policy for packets containing the same classification information, and adopt different transmission service policies for packets containing different classification information. The classified information of packets can be assigned to hosts, switches, routers, or other network devices on the network. You can assign category information to messages based on different application policies or based on different message content. To identify the content of a packet so that the packet can be assigned with category information, a large amount of processing resources of network devices are often required. To reduce the processing overhead of the backbone network, generally, this type of information is used on the network boundary.
A vswitch or router can provide different transmission priorities for various traffic flows based on the type information carried by the packets, or reserve bandwidth for a certain traffic flow, or discard messages of low importance, or take other operations. This behavior of these independent devices is called Per-hop behavior in the DiffServ system ). If all devices on the network provide consistent hop behavior, the network can constitute end-to-end QoS solution for the DiffServ system.
The following sections describe the QoS model provided by the vswitch Based on the DiffServ system.
QoS entry-side actions include classifying, sorting, and marking.
Classifying: Make sure that the network traffic flow is divided into various data flows marked with DSCP values. Then, the vswitch implements different QoS policies for each data stream based on the DSCP value. For more information about classification, see the Classifying chapter.
Caching ing: Used to constrain the transmission bandwidth occupied by a stream. Based on the configured receiver, it determines which part of the stream exceeds the Limited transmission bandwidth, and pass the result to the next stage of the Marking action. For more information about grouping, see grouping.
Marking: determines how to process the portion of the data stream that exceeds the quota action. Possible processing actions include discarding the over-limit part and marking the over-limit part with another DSCP value. For more information about Marking, see the Marking chapter.
QoS egress actions include Queueing and Scheduling: Queueing: Determine the output queue to which the packet is sent to the Port Based on the DSCP value attached to each packet in the data stream. For more information about Queueing, see the Queueing chapter. Scheduling: Determine how messages are processed in the output queues sent to the port. For more information about Scheduling, see Scheduling. The following section describes the actions of each phase of the QoS model.
Classifying
Classifying refers to classification. The process is to classify these packets into various data streams represented by DSCP values based on the trust policy or the content of each packet analyzed, therefore, the core task of classification is to determine the DSCP value of input packets. Classification occurs when a port receives input packets. When a port is associated with a policy-map indicating the QoS policy, the classification takes effect on the port, it acts on all packets input from this port.
For general non-IP packets, the switch will classify the packets according to the following rules:
1.1 If the packet itself does not contain QoS information, that is, the second-layer packet header does not contain user priority bits, the QoS information of the packet can be obtained based on the default cos value of the packet input port. The default cos value of the port is the same as the userpriority bits value of the packet. The value range is 0 ~ 7. After obtaining the COs value of the message, convert COs to dscp value based on the COs-to-dscp map configured on the switch.
2.2 If the packet itself contains QoS information and the second-layer packet header contains user priority bits, the CoS value can be obtained directly from the packet, then convert COs to dscp value based on the COs-to-dscp map configured on the switch. Note that the preceding two classification rules work only when the QoS trust mode of the port is enabled. Enabling the QoS trust mode on the port means that the QoS information of the packet is obtained directly from the packet or the input port of the packet without analyzing the packet content, so as to obtain the dscp value.
2 3. if the policy-map associated with the port uses an ACLs Classification Based on Mac access-list extended, the source MAC address, destination MAC address, and ethertype domain of the packet are extracted to match the associated ACLs to determine the dscp value of the packet. Note that if a port is associated with a policy-map but no corresponding dscp value is set for it, the switch will assign priority to packets that conform to this classification according to the default behavior: that is, based on the priority information contained in the second packet header or the default port priority.
Note that the preceding three classification rules may apply to a port at the same time. In this case, the above three classification criteria take effect based on the priority of 3, 2, and 1. That is, the classification criteria 2 and 1 can be selected only when the classification fails according to ACLs. At this time, if the QoS trust mode of the port is enabled, then, QoS information is obtained directly from the message or from the port according to rules 2 and 1. If the QoS trust mode of the port is disabled, the packets that fail to be classified will be assigned the default value 0 of dscp.
IP packets can be classified according to the following rules:
1.1 extract the DSCP value directly from the TOS field of the IP Message. IETF specifies the first six bits in the TOS field of the IP Message as the DSCP value. The value range is 0 ~ 63, one-to-one correspondence with the DSCP values used inside the vswitch.
2.2 determine the DSCP value of the packet according to the non-IP packet processing rules 1 and 2 described above. Note that the preceding classification rules take effect only when the QoS trust mode of the port is enabled. Enabling the QoS trust mode on the port means that, without analyzing the content of the IP packet, QoS information is obtained directly from the TOS field of the IP packet or the input port of the packet, and the DSCP value is obtained.
2 3. if the policy-map associated with the port uses an ACLs Classification Based on ip access-list (extended, the related ACLs will be matched by extracting the source IP address, destination IP address, Protocol field, and layer-4 TCP/UDP port field of the packet to determine the DSCP value of the packet. Note that if a port is associated with a policy-map but no corresponding DSCP value is set for it, the switch will assign priority to packets that conform to this classification according to the default behavior: that is, based on the priority information contained in the second packet header or the default port priority. Like non-IP packet classification rules, the preceding classification rules can act on a port at the same time. In this case, the classification rules above take effect based on the priority values of 3, 2, and 1. That is, the classification criteria 2 and 1 can be selected only when the classification fails Based on ACLs. At this time, if the port is set to QoS Trust mode, Trust IP-precedence, then criterion 1 takes effect. If the port selects the QoS Trust mode Trust CoS, then Criterion 2 takes effect. A detailed description of the CoS-to-DSCP map and IP-precedence-to-DSCP map tables mentioned above.
Processing ing
The grouping action takes place after the data stream classification is complete. It is used to constrain the transmission bandwidth occupied by the classified data stream. The grouping action checks each packet in the classified data stream. If the packet exceeds the bandwidth limit allowed by the receiver acting on the data stream, the packet will be specially processed, it may be discarded or assigned another DSCP value. In QoS processing, the padding action is optional. If there is no grouping action, the DSCP value of the packets in the classified data stream will not be modified, and the packets will not be discarded before being sent to the Marking action.
Marking
After processing the Classifying and tracing actions, to ensure that the DSCP value corresponding to the classified packets can be transmitted to the next hop device on the network, QoS information must be written to the packets through the Marking action, you can use the Trust method to directly retain the QoS Information in the message. For example, you can select Trust Cos to retain the CoS Information in the Tag Control Information of the 802.1Q message header. By default, marking always converts the corresponding DSCP value to QoS information, and then writes it to the CoS field (for non-IP packets), DSCP field, or IP-precedence field (for IP packets.
Queueing
The Queueing action is used to send packets from data streams to the output queue of the port. messages from different output queues sent to the port receive transmission service policies of different levels and properties. Each port has eight output queues, the DSCP-to-CoS Map and Cos-to-Queue Map ing tables configured on the vswitch are used to convert the DSCP values of packets into output Queue numbers, in order to determine the output queue to which the message should be sent.
Scheduling
The last step of the QoS process during Scheduling. After the packets are sent to different output queues on the port, the switch uses WRR or SP Rotation Algorithm to send the packets in the eight queues. You can set the weight of the Rotation Algorithm to configure the transmission bandwidth occupied by each output queue when outputting packets.
Cos service category
Do not confuse CoS with QOS. CoS is a priority queue and has been used in a large number of communication and connection protocols. It is based on the application type (voice, video, file transmission, transaction processing), user type (CEO, Secretary) or other methods used to differentiate data groups by category and their priority.
CoS is a queuing rule, and QOS includes a wider range of technologies used to manage bandwidth and network resources. CoS checks the data group parameters or CoS tags to differentiate data groups, and puts data groups in queues with different priorities based on predefined standards. QOS involves ensuring a certain level of network performance to meet service contracts or support real-time communication. For QoS, you need to use some methods to reserve bandwidth on the network before the data group is sent.
Note:
For example, CoS is classified as a parcel to be delivered by normal mail, delivery by the second or third day. QOS is what shipping companies need to do to ensure that your package is submitted on time (such as package tracking, air transportation, door-to-door collection, and mail delivery ).
Although CoS technology can give some communications higher priority than other communications, if there is no QOS, there will be no way to prevent high-priority communications from being delayed or lost data groups. In fact, real QOS is only available for ATM. Because ATM has fixed cells, it can provide predictable services. For ATM communication companies and service providers, they know exactly how many 53-byte cells can be sent within their network capacity. This predictability allows communication companies to sign service level agreements at guaranteed service levels.
In addition, CoS technology can reduce the waiting time and ensure that important communications are completed within a reasonable period of time. CoS is very practical on the enterprise network. It is possible to over-supply a network (providing more than the average bandwidth required) and prioritize communications to reach an acceptable service level. By prioritizing communication, network devices can put down the least important communication before performing the highest-priority communication.
CoS technology is listed later and described elsewhere in this book. For more information about QOS, see it QOS (Service Quality) and IntServ.
· 802. 1 pAn IEEE Standard that uses three bits in the Ethernet frame header to divide communication into eight priorities. It basically gives the switch and other 2nd-layer connected devices the ability to prioritize communication. This is discussed in "network communication priority" and "QoS (Service Quality.
· Diff-ServA rule used to prioritize IP communication. The TOS (service type) field in the IP header is set using the method that can distinguish the communication priorities on the IP network. It specifies the method. Diff-Serv is important because it can be used across networks and [Internet. See "DiffServ" and "network communication priority ".
· ATM service categoryATM has its own communication classification methods, such as CBR (constant bit rate), VBR (variable bit rate), UBR (no bit rate specified), and ABR (Available Bit Rate) and (to ensure the frame rate ). For more information, see "ATM (asynchronous transmission mode )".
The President of Acuitive provided an interesting view of CoS in a paper (see the link at the end of this topic ). He claims that CoS can reduce the wait time, but as the link speed increases, the CoS importance will decrease. For example, latency below MS is almost imperceptible. The waiting time for a fast Ethernet link is about 2.4 ms. He explained that even if users notice a slight increase in wait time, data groups need to "go through almost 100 Fast Ethernet switches, on each switch, 20 Ethernet frames with the maximum size are postponed before they arrive ". He estimates that CoS is most important for WAN, not Ethernet LAN.
IP QoS dscp and TOS Classification
In RFC 791, the IP Precedence of the OS bit is divided into eight priorities, which can be applied to stream classification. A larger value indicates a higher priority.
0 1 2 3 4 5 6 7
+ ----- +
| PRECEDENCE | t3 | t2 | t1 | t0 | m
----- +
111-Network Control
110-Internetwork Control
101-CRITIC/ECP
100-Flash Override
011-Flash
010-Immediate
001-Priority
000-Routine
However, during actual deployment in the network, these eight priorities are far from enough, so the TOS is redefined in RFC 2474. Define the first six digits as DSCP, and the last two digits are retained.
0 1 2 3 4 5 6 7
+ --- +
| DSCP | CU |
+ --- +
DSCP: differentiated services codepoin
CU: currently unused
However, because DSCP and ip precedence coexist, some compatibility problems exist, and DSCP is less readable. For example, DSCP 43 does not know what values correspond to ip precedence, therefore, DSCP is further classified. DSCP is divided into four categories.
Class Selector (CS) aaa 000
Expedited for warding (EF) 101 110
Assured Forwarding (AF) aaa bb0
Default (BE) 000
1. The default DSCP is 000 000.
2. The last three digits of cs dscp are 0, that is to say, CS still follows the ip precedence, but CS defines DSCP = ip precedence * 8, for example, CS6 = 6*8 = 48, CS7 = 7*8 = 56
3. EF indicates accelerated forwarding. It can also be viewed as an IP address PRECEDENCE of 5, which is a relatively high priority with a value of 101110 (46 ), however, the RFC does not define why the EF value is 46.
4. AF is divided into two parts: Part a and Part B. If Part a is 3 bits, it can still correspond to ip precedence. If Part B is 2 bits, it indicates discarding and three discarding priorities, it can be applied to RED or WRED. Currently, Part a has a maximum value of 8 for three bits, but currently only 1 ~ 4. In order to quickly convert to the 10th order, you can use the following method to first divide the 10th order value into an integer (AF), and convert the remainder to a binary value. The first two digits indicate the discard priority, for example, if the remainder of 34/8 = 4 is and the binary value is 010, 34 indicates that AF4 discards the datagram whose priority is middle.
If you arrange cs ef af and BE, you can find an interesting phenomenon, as shown in the following table. This table is the queue with the most application in reality. According to the PRECEDENCE priority of the IP address, CS7 is ranked at the highest order to BE the lowest. Generally, the Usage of these queues depends on the Usage field of the table.
Corresponding service IPv4 priority/EXP/802.1 p dscp (Binary) DSCP [dec] [Hex] TOS (hexadecimal) application packet loss rate
BE 0 0 0 0 Internet
AF1 Green 1 001 010 10 [0x0a] 40 [0x28] Leased Line L
AF1 Green 1 001 100 12 [0x0c] 48 [0x30] Leased Line M
AF1 Green 1 001 110 14 [0x0e] 56 [0x38] Leased Line H
AF2 Green 2 010 010 18 [0x12] 72 [0x48] IPTV VOD L
AF2 Green 2 010 100 20 [0x14] 80 [0x50] IPTV VOD M
AF2 Green 2 010 110 22 [0x16] 88 [0x58] IPTV VOD H
Af3 green 3 011 010 26 [0 A] 104 [0x68] IPTV broadcast L
Af3 green 3 011 100 28 [0x1c] 112 [0x70] IPTV broadcast m
Af3 green 3 011 110 30 [0x1e] 120 [0x78] IPTV broadcast H
AF4 Green 4 100 010 34 [0x22] 136 [0x88] NGN/3G Singaling L
AF4 Green 4 100 100 36 [0x24] 144 [0x90] NGN/3G Singaling M
AF4 Green 4 100 110 38 [0x26] 152 [0x98] NGN/3G Singaling H
EF 5 101 110 46 [0x2e] 184 [0xb8] NGN/3G voice
CS6 (INC) 6 110 000 48 [0x30] 192 [0xc0] Protocol
Cs7 (NC) 7 111 000 56 [0x38] 224 [0xe0] Protocol
1. CS6 and cs7 are used for protocol packets by default. For example, OSPF packets and BGP packets should be guaranteed first, Because protocol interruption may occur if these packets cannot be received. It is also the highest priority message in most manufacturers' hardware queues.
2. EF is used to carry voice traffic. Because voice requires low latency, low jitter, and low packet loss rate, it is the most important packet after Protocol packets.
3. af4 is used to carry the signaling traffic of speech. Here you may wonder why the voice here takes precedence over the signaling traffic? In fact, the signaling here is the call control of the phone, you can endure waiting for several seconds during the connection, but it is absolutely not allowed to interrupt the call. Therefore, voice must take precedence over signaling.
4. af3 can be used to carry the live video traffic of IPTV. the live video has a strong sense of continuity and high throughput.
5. af4 can be used to carry VOD traffic. Compared with live video VOD, af4 requires a low latency or buffer.
6. af5 can carry leased line services that are not very important, because compared with IPTV and voice, IPTV and voice are the most critical services of carriers and must be guaranteed first. Of course, for banks and other businesses that require diamond-level assurance, af4 or even EF can be arranged.
7. The least important business is Internet services, which can be transmitted in the be model.
In the hardware queue, how does one ensure that Protocol packets (data in CS6 and cs7) are transmitted preferentially? When creating a router, data in CS6 and cs7 is usually processed with PQ, which means that the data in the two queues must be transmitted with priority no matter whether or not the following data exists. Other ef-to-AF1 queues use wfq to ensure that all queues can receive bandwidth for transmission.