CoS and DSCP are only standards of classification. You can set which one you trust. Besides, CoS and DSCP are mapped to each other, which only identifies the packet priority. Different outgoing queues are selected based on the packet priority, and the bandwidth resources occupied by different outgoing queues are selected, the discarding ratio varies with congestion. To achieve the goal of service quality.
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. if the packet itself does not contain QoS information, that is, the second-layer packet header does not contain User Priority bits, you can obtain QoS information of the packet 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. if the packet itself contains QoS information and the second-layer packet header contains User Priority bits, you can obtain the CoS value 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. 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. 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.
Blog: http://blog.163.com/hlz_2599/blog/static/142378474201151265035648/