Complete Qos Analysis of HCIE Interview for Huawei Certified Datacom

Tengke Education will share with you the next data communication HCIE

PS: I hope you will finish reading this article in one go. Thank you!
First of all, what is QOS?
The document is defined as follows: QoS (Quality of Service) is used to evaluate the service party's ability to meet customer service requirements. By configuring QoS, the enterprise network traffic can be regulated, avoiding and managing network congestion, reducing message loss rate, and at the same time providing dedicated bandwidth for enterprise users or providing differentiated services for different services (voice, video, data, etc.) .
Summarize in a simple sentence: treat different businesses differently to achieve customer satisfaction!


Okay. Next, we use a picture to introduce our QOS (it is recommended that candidates remember this picture, and then practice according to this picture when practicing)
QOS_1

This picture is very good. A picture summarizes the general framework and logic of QOS. Next, let's explain them one by one.

First of all, our QOS is currently often used in the differentiated services model, so how many models does QOS have?

①Do your best model-------Simple and rude, don’t discriminate between whoever comes first and help whoever

②Comprehensive service model------Using RSVP protocol (resource reservation protocol) to reserve, for example, a 10M bandwidth for customers' special traffic alone. Advantages: Special traffic is treated differently. Disadvantages: 10M bandwidth is also available when the customer is not in use. Unable to use for other traffic, wasting bandwidth

③Differential service model-----this is what we are going to talk about now

PS: If you encounter OQS in the exam, we will talk about these three models from the beginning and quickly talk about the differential service model, and we will smoothly accept the following.

So how does our differentiated services model not only take into account the differentiated treatment, but also do not waste bandwidth? This is how it is. First of all

①Data, voice and video traffic enters the interface and then we classify and mark it ! What is the classification of the key points? How is the mark marked? Where is the mark? How does the switch or router recognize that this traffic is data, voice or video?

There are two categories.

One is simple flow classification: using the fields we marked in the vlan, mpls, and ip packets to classify is called simple flow classification

The second is the classification of complex flows: a five-tuple (source IP, destination IP, source port, destination port, transport layer protocol) is used to uniquely distinguish a flow.

OK, after sorting, what then? Of course it is our mark.

The mark can be marked in three places.

 

1. The pri field in the vlan tag (here, remember the vlan format + length)QOS2

2. The exp field in mpls (remember the same as above! The Mpls header is also a big topic, titled: What is the mpls header field and its function)QOS3

3. Tos field in IP packet

QOS4

IP Precedence has a total of 3 bits, so the precedence that can be defined is 7-0; afterwards, I felt that it was not enough and developed the D, T, and R bits called DSCP.

So the priority that can be defined is 0-63  

So use the first 3 digits as IPP and the first 5 digits as DSCP (there is still a bit of knowledge left here, we will talk about it later)

OK, let’s talk about traffic monitoring and speed limit later.

Let's talk about entering the queue first. Let's try our thoughts once again. Now our voice, data, and video traffic is classified and marked, and we are about to enter the switch or router. There is a virtual queue inside, and the high priority will enter the high queue. , Low priority enters the low queue.

So which protocol defines that the priority 7 we marked is better and better than priority 0?

Well, it’s our PHB (Per Hop Behavior) protocol, which sums up the role of this protocol in one sentence: it defines the service level, which is 7>6>5>4>3>2>1>0

Next, let’s take a look at a table. Let’s talk about our PHB protocol in detail.

PS: Just understand the PHB protocol.

In the PHB protocol, CS, EF, AF, and BE queues are defined in this way.

A is DSCP with a total of 0-63 priorities

B is IPP, mpls, vlan has 0-7 priority

Let's make a division, we call DSCP A, IPP, mpls, VLAN B, then

When B=0, A=0-7 CS0 When B=1, A=8-15 CS1 When B=2, A=16-23 CS2 When B=3, A=24-31 CS3

When B=4, A=32-39 CS4 When B=5, A=40-47 CS5 When B=6, A=48-55 CS6 When B=7, A=56-63 CS7

If you look at this table carefully, you can see the relationship between AB and CS, which means that PHB includes these priorities in the scope of CS, and what are EF, AF, and BE?

BE is a special name when DSCP in CS0 is 0 (if it is marked as 0, enter the BE queue and try its best to forward)

EF is a special name when the DSCP in CS4 is 46 (if it is marked as 46, it will enter the EF queue to accelerate forwarding)

AF1 is the special name when the DSCP in CS1 is 10, 12, 14 (if it is marked as 10, 12, 14 (corresponding to AF11, AF12, AF13), then enter the AF1 queue to ensure forwarding)

AF2 is the special name when the DSCP in CS1 is 18, 20, 22 (if it is marked as 18, 20, 22 (corresponding to AF21, AF22, AF23), then enter the AF2 queue to ensure forwarding)

AF3 is the special name when the DSCP in CS1 is 26, 28, 30 (if marked as 26, 28, 30 (corresponding to AF31, AF32, AF33), then enter the AF3 queue to ensure forwarding)

AF4 is the special name when the DSCP in CS1 is 34, 36, 38 (if marked as 34, 36, 38 (corresponding to AF41, AF42, AF43), enter the AF4 queue to ensure forwarding)

PS: CS7, CS6 are used by default for protocol messages, such as STP and other messages. Priority comparison: EF>AF4 3 2 1>BE

Here is one point: Why is the drop level of AF13>AF12>AF11 in AF1? Let's take a look at one of the knowledge points to make up for the previous DSCP.

AF11 is marked as 10 and written in 8bit binary is 001 010  00 (recall that the first 6 bits of the Tos field of a byte are reserved for DSCP and the last 2 bits are reserved)

AF12 is marked as 12 and written in 8-bit binary is 001 100  00

AF13 is marked as 14 and written in 8bit binary is 001 110  00

The first 3 bits of the OK Tos field are IPP and then the DTR bit. The more 1 in these three positions, the higher the probability of discarding. (The D, T, and R bits represent delay requirements, throughput, and reliability.) Therefore, AF11 is more important than AF12 and AF13. And AF21 is more important than AF11.

Okay, we have extended the PHB protocol to understand that PHB defines the service level and it’s OK 

Then, the three pieces of traffic of our voice and video data enter their respective queues, and then we perform a method called scheduling (congestion management) on them.

How to understand scheduling? It is how to arrange the incoming traffic to go out in an orderly, primary and secondary manner.

OK Our scheduling is divided into two types.

① Based on queue scheduling, everyone knows that there are 7 virtual queues inside the router or switch 

Suppose our voice enters queue 5, video queue 4, data queue 3. 

So let me talk about how queue-based scheduling works.

First, queue-based scheduling is divided into RR (round-robin)-WRR (weighted round-robin)-WFQ (weighted fairness)-PQ (outflow according to priority)

Obviously we are voice (queue 5)>video>data 

For RR, one packet for voice, one packet for video, and one packet for data, and then loop RR is very fair, but what we want is to treat it differently. High priority goes first, and low priority goes back.

 

 

 

So WRR was developed again. We added a weight value of 3 to the voice queue. Video 2 does not give data so that every loop voice will go 3 packets, and the video will go 2 data or 1 so that it will solve the problem of high priority slipping first. There is a problem, but there is another problem. In reality, we usually measure it by bandwidth. If a packet of data is 1500 bytes, and a packet of voice is 100 bytes, then such a cycle, the data will occupy more bandwidth. high

Therefore, WFQ was developed to be weighted and fair, based on bandwidth allocation. Voice is divided into 30M, video is divided into 20M, and data is divided into 10M. This solves the above problems.

 

QOS6

 

So what is PQ? PQ is reckless. It's the right thing to do. The voice priority is high. Then I will finish the voice traffic first, then use the video and then the data. Although the high-priority ones are very happy, if there is always traffic in the voice, then my video and data will not be sent out in one packet, which will cause the low-priority traffic to starve to death.

 

QOS7

 

But generally speaking, in reality, a combination method such as PQ+WRR, PQ+WFQ is generally used.

 

QOS8QOS9

After talking about queue-based scheduling, then next to class-based scheduling

 

②CBQ (Class-based Queueing) class-based weighted fair queue is an extension of the WFQ function and provides users with support for defining classes. CBQ first classifies messages according to rules such as IP priority or DSCP priority, input interface, and quintuple of IP messages, and then allows different types of messages to enter different queues. For packets that do not match any category, they are sent to the default category defined by the system.

 

 

The concept of class can be understood as one type of voice, one type of video, and one type of data. I match the voice packets and send them to the three queues planned by my CBQ.

 

 

EF queue---satisfy low latency  

 

AF queue-to meet the critical data services that require bandwidth guarantee

 

 

BE Queue: Satisfy best-effort delivery services that do not require strict QoS guarantees

PQ scheduling is used in the EF queue, WFQ is used in the AF queue, and WFQ is used in the BE 

So we will set a maximum bandwidth for the EF queue (after all, use PQ to prevent the BE traffic from starving to death) and set a minimum bandwidth for the AF queue (you have to send me a bit of everything) BE, and the remaining bandwidth will be given to BE use. There is also a special queue LLQ in EF. LLQ is better than EF.

In this way, we have finished scheduling the assignments and assigned them. Should we go out next? At this time, we can do traffic management at the outgoing interface. Before we talk about traffic management, let's think again. If the traffic is really a lot, how can I schedule it, all the queues are full, but the entrance is still getting traffic, what should I do at this time? Congestion will happen, right? Blocked, difficult to get in, and slow to get out. At this time, we will talk about congestion avoidance when congestion occurs.

When we are congested, what problems will a full queue cause? What does tail drop mean? That is, the traffic coming in behind is directly lost. So tail drop will cause 3 problems 

1. No partition loss  

2. TCP global synchronization  

Three. TCP traffic starved to death 

Next, let's enter TCP and talk about TCP.

We know that TCP is a reliable and secure transmission protocol, with a deterministic mechanism, and retransmissions after packet loss.

 

If TCP packets are lost, wait for the retransmission timer to expire, and then retransmit, which is called timeout retransmission .

 

If TCP loses a part of the packet, the receiver can determine that the data you sent is incomplete through parameters such as the sequence number. At this time, the receiver will immediately repeat three ACK packets, and the sender immediately realizes that the receiver has just confiscated I made a complete package, and immediately re-issued, said the fast retransmission .

Next, let's take a look at how our TCP starts and sends data in the network (a window of TCP)

 

QOS11

Let’s take a look at this picture, it doesn’t matter if it looks a bit ignorant, let’s explain some terms step by step.

The congestion window cwnd is a dynamically changing window called the congestion window for the sender. The size of the congestion window depends on the degree of network congestion.

Ssthresh is the slow start threshold (here we set it to 16) When cwnd=24, it is the threshold (the default is 56636B)

Slow start, also called slow start, refers to setting cwnd = 1 (536B) and then performing an exponential increase when establishing a TCP connection.

OK, then enter the focus:

Now there is a TCP connection-->start a slow start and reach the threshold when it starts exponential growth from cwnd=1 to cwnd=16, and starts congestion avoidance, does not increase exponentially, and enters an additive growth (if all sent messages are After receiving the ACK reply, cwnd will add +1+1+1) ----> Congestion is detected when the cwnd=24 threshold is reached----> Immediately reduce the ssthresh threshold to half of the threshold, which is 12, which is new The ssthresh=12 is ②+③ in the figure above, and there are two processing behaviors.

①: After congestion, if the packet loss is caused by timeout retransmission, cwnd=1, and ssthresh at this time is 12, which is ④+⑤ in the above figure.

②: If the packet loss is caused by fast retransmission after congestion, cwnd=12, and a congestion avoidance is as shown in the above figure ①

Everyone knows what does the TCP global synchronization mean after the above picture? The above picture is a TCP connection. If there are 100 N TCP connections in time, then the 100 TCP connections reach the threshold at the same time, and the threshold is reduced by half at the same time. This will cause a waste of bandwidth. If 50 of the first arrive at the threshold, decrease Half, and then start slowly, the other 50 can use the bandwidth of the previous 50.

So what is the starvation of TCP traffic? TCP traffic starvation means that when my TCP is very small in cwnd, if a large amount of UDP traffic continues to come in, it will cause the TCP cwnd to remain very small and finally TCP traffic cannot be sent out, it is called starvation.

So how do we solve these problems caused by congestion? In our congestion avoidance phase, we use a technology called wred (weighted early random detection) . This technology is that we configure a discard template for each queue. When the queue is not full, high priority discards 10 One packet, 20 packets are lost at low priority. Effectively solve the TCP global synchronization + TCP traffic starvation + indiscriminate packet loss.

Next, our traffic comes in from the inbound interface, is classified, marked, scheduled (congestion management), and congestion avoidance finally reaches the outbound interface. Here, we can do a traffic management on the outbound interface.

Traffic management is divided into three

TP (Traffic Policing) can monitor the rate of different traffic entering the network, and "punish" the excess traffic, so that the incoming traffic is restricted within a reasonable range, thereby protecting network resources and the interests of users.

Traffic Shaping (TS) is a measure to actively adjust the output rate of traffic. Traffic shaping cuts the peak and fills the valley of the irregular upstream traffic, so that the traffic output is relatively stable, thereby solving the congestion problem of the downstream equipment.

The interface rate limit LR (Line Rate) can limit the total rate of all packets sent or received on an interface. When there is no need to distinguish between packet types but to limit the rate of all traffic passing through the interface, the interface rate limit function can simplify the configuration.

Summarize in one sentence: the excess traffic will be discarded by monitoring, the excess traffic will be cached for shaping and will be sent again later, and the rate limit will be too lazy to configure and limit the rate directly on the interface.

Now there is a question, how does the router or switch know whether the traffic is exceeded? Here we are using the token bucket technology, let's talk about how the token bucket technology detects whether the traffic exceeds the specification.

Token bucket technology

We went straight to the subject, and we thought about some concepts as we understood them.

1. Single speed single barrel

CIR: Committed information rate, indicating the rate at which tokens are put into bucket C, that is, the average rate at which bucket C allows packets to be transmitted or forwarded

CBS: Commitment burst size, indicating the capacity of bucket C, that is, the committed burst traffic that bucket C can pass instantly

If you don’t understand these two concepts, it’s okay. Let’s take an example. For example, the scenario of the old husband measuring the alcohol consumption of his son-in-law is very suitable. Imagine that the token barrel is filled with wine. How does the old husband measure the alcohol consumption of his son-in-law? The old man puts 1ml of liquor into the barrel every second, puts 500S, and is full. At this time, the CBS (capacity) of the barrel is 500ml, CIR=1ml/s. We use Tc to indicate how much wine is in the barrel, and B to indicate the son-in-law. Drink every second, and then the son-in-law starts to drink, the son-in-law drinks 10ml in the first second, at this time B=10ml, B<Tc, there is still wine in the barrel, continue, mark you as green, which means continue to measure. CBS=500-10+1 (CIR)=489ml, in the second second, you take a sip of 500ml. At this time, B=500ml, Tc=489ml, B>Tc, too strong, the old man can’t drink so much. Marked in red, it means that you are overly showing your alcohol and asked you to spit the wine back into the barrel and replace it with a son-in-law.

In other words, we use Tc to represent the token in the token bucket, B represents the size of the message that has arrived so far, the system will drop tokens into the bucket at the CIR rate, and CBS is the capacity of the bucket. If B<Tc is marked Green and take away the token in the bucket. If B>Tc marks the red Tc without reducing the green, the message will pass, and the red will be discarded.

2. Single-speed dual-pass

Back to our old husband to measure the amount of alcohol for his son-in-law, this time the old father-in-law learned from the previous experience and put two barrels, C and E. The old man pours the wine into the C barrel at the rate of CIR. If the C barrel is full , Just pour some wine to barrel E, guard against one hand. The son-in-law is here, the son-in-law has a drink at first, green, then the son-in-law comes up, there is 10ml left in the C bucket, and the son-in-law said that it is full. Give me a glass of 50ml, which is very embarrassing. , Pour out 40ml and give it to the son-in-law to drink. At this time, the son-in-law is marked as yellow, and the son-in-law can still drink. This time I drink 100ml at a time, and there is not enough wine in the E barrel, which is marked as red. 

EBS (Excess Burst Size): Excess burst size, which represents the capacity of the E bucket, that is, the excess burst traffic that the E bucket can pass instantly.

Back to the topic, Tc=C bucket token, Te=E bucket token B=message size, Cbs=C bucket capacity, Ebs=E bucket capacity

If bucket C is full of CIR, give the token to bucket E to prevent burst traffic

B<Tc message is marked green

Tc<B<Te packets are marked yellow

B>Tc and>Te packets are marked red 

3. Two-speed two-barrel

Let’s go back to our old husband to measure his son-in-law’s drinking. This time the old father-in-law no longer pours two barrels by himself, he called his wife, and one person is responsible for one barrel.

PIR (Peak information rate): Indicates the rate at which tokens are put into the P bucket, and the PIR is greater than the CIR;

CIR: Committed information rate, which means the rate at which tokens are put into bucket C, that is, the average rate at which bucket C allows packets to be transmitted or forwarded;

PBS (Peak Burst Size): The peak burst size, which represents the capacity of the P bucket, that is, the peak burst traffic that the P bucket can pass instantly;

CBS: Commitment burst size, indicating the capacity of bucket C, that is, the committed burst traffic that bucket C can pass instantly

The examples will not be cited, we will go directly to the topic.

Tc=C bucket token, Tp=P bucket token B=message size, Cbs=C bucket capacity, Pbs=E bucket capacity

CIR drops tokens to bucket C, and PIR drops tokens to bucket P synchronously

Tp<B, the message is marked in red;

Tc<B≤Tp, the packet is marked as yellow, and Tp decreases by B;

B≤Tc, the message is marked as green, and both Tp and Tc decrease by B.

Okk, to summarize that is to say, through the token bucket technology, we mark the message in different colors to see if the traffic exceeds the specification.

Back to our traffic management

Traffic policing TP usually uses car to limit traffic. Using a double pass dual speed ** .

You can customize the behavior according to **, the default is green forwarding, yellow re-analyze and then mark, and red discard .

Traffic shaping TS usually uses gts to limit traffic. Use single barrel, single speed and dual color .

Green forwarding, red cache.

Interface speed limit LR usually uses lr +inbound/outbound to limit the traffic rate. Use single-speed single-pass dual-color .

Green forwarding, red (if it is buffered in the outgoing direction of the switch, it will be discarded in the incoming direction) 

Next, let’s talk about the difference between TP TS LR

On the router:

TP can be based on interfaces and classes

TS can be based on interfaces, queues and classes

LR only supports exits configured on WAN

switch

TP can be based on class

TS can be based on queue

LR can be based on the interface

Okay, then our QOS is over! Let's take a look again, the traffic enters from the ingress interface-classification mark-enters the queue-congestion management (scheduling mechanism)-congestion avoidance-traffic management! It is a general process of our QOS. I hope this article will be useful to candidates preparing for the test! If you want to learn QOS well, you need to configure and experiment more! Here are some common questions in the exam!

1. The difference between plastic surgery and supervision

2. Can the shaping on the switch be based on queues and MQC?

3. What is the difference between the shaping of switches and routers?

4. What happens when QOS is configured and not applied?

5. The problem of tail drop?

Thank you all, and I wish you all the research once!Qos complete analysis of datacom HCIE interview + common follow-up-3217740-12 Qos complete analysis of datacom HCIE interview + common follow-up-3217740-13 Qos complete analysis of datacom HCIE interview + common follow-up-3217740-14

Guess you like

Origin blog.csdn.net/qq_42726883/article/details/113244610