IP Precedence and DSCP Values

Hello Berthol

This lesson describes the components of the IP header, and specifically the ToS field, that is used to implement QoS. The values found within the ToS field are interpreted in specific ways using the logic described with the PHB, AF, EF, and so on.

Now at the end of the lesson, Rene explains what I think you are asking. He says that all of these values found in the ToS field will actually do nothing unless a router is configured to act upon those values. How it acts upon them, and how it interprets them are based on the network vendor of the device. Typically, they will conform to the industry standard. For example, for voice traffic, IP Precedence value 5 or DSCP EF will normally be used for voice traffic while IP precedence value 3 or DSCP CS3 or AF31 is used for call signaling. Different vendors may apply different behavior, but even so, you can configure the QoS to respond differently if you like.

I hope this has been helpful!

Laz

ok thank you for the intervention even as I am not really satisfied; my real issue was understanding how useful this is for the CCNP .

Hello Berthol

No need to apologize, that’s why we’re here… to answer questions!! :slight_smile:

When such questions arise, always go back to the official list of exam topics published by Cisco. For the CCNP 350-401 ENCOR Exam the only topic that includes anything about QoS or precedence or DSCP or any related topic is 1.6:

  • 1.6 Describe concepts of wired and wireless QoS
  • 1.6.a QoS components
  • 1.6.b QoS policy

For the CCNP 300-410 ENARSI Exam, there is no specific topic that covers QoS concepts.

However, Cisco’s exam blueprints are always accompanied by a disclaimer that indicates that related topics may be included in the exam that may not be explicitly listed in the topics list.

The truth is that it is not very likely that the content in this specific lesson will appear on the exam. However, because it is fundamental to understanding QoS, it’s a good idea to have at least a working knowledge of it.

I hope this has been helpful!

Laz

Thanks for the clarification.

1 Like

Hi Mr Rene AF31 = 0110101 then AF came from where as 001=3 and 001=1
i want to regarding AF

Hello Sulthan

AF31 is equal to 011 010. However, the value of 31 in the name AF31 does not come from the value of the bits, but from the class and drop probability. To understand this further, here’s the table once again, as in the lesson, but this time I’ve added row numbers:

image

  • AF11 is in class 1 and row 1 (low), therefore, it is AF11
  • AF12 is in class 1 and row 2 (medium), therefore, it is AF12
  • AF31 is in class 3 and row 1 (low), therefore, it is AF31
  • AF23 is in class 2 and row 3 (high), therefore, it is AF23

So the numbers in the AF notation denote class and drop probability.

I hope this has been helpful!

Laz

1 Like

Hi Laz,

I’m a bit confused by the answer here compared the what has been explained in this lesson.
my understanding : AF21, x=2 and y=1 so the math is 8 * 2 + 2 * 1 = 18 in decimal
and if we want to convert it directly from binary to decimal: AF21 = 010010 = 18 in decimal

so I 'm not sure how AF21 = 20 in decimal.

Please let me know if my understanding is incorrect.

Thanks,
Samer

Hello Samer

Thanks for catching that error. I have since corrected the post. I plugged in the wrong Y value, it should have been 1 and not 2. So the correct wording is:

decimal value = 8x + 2y where X=class value and Y=drop value.

So in your case of AF21 where X = 2 and Y = 1.

So the decimal value of AF21 = 8 * 2 + 1 * 2 = 18. Looking at the table we see that the binary value of AF21 is 010010 which is indeed 18.

Thanks for pointing that out!

Laz

1 Like

Hi Rene,

In this case would it be best practice to use LLQ for EFs and CBWFQs + WREDS for AFs?
A bit confusing with how the queues should actually work.

Thanks

Hi @champ ,

It’s up to you to decide what DSCP values, queues, and queue management you want to use but many vendors follow the recommendations from RFC 4594:

https://www.rfc-editor.org/rfc/rfc4594

This document defines different “service classes” and recommends what DSCP values to use, whether you should use policing or queue management (like WRED). Here is one example from this document:

Service Class DSCP Conditioning at DS Edge PHB Used Queuing AQM
Network Control CS6 See Section 3.1 RFC2474 Rate Yes
Telephony EF Police using sr+bs RFC3246 Priority No
Signaling CS5 Police using sr+bs RFC2474 Rate No
Multimedia AF41 Using two-rate, Yes
Conferencing AF42 three-color marker RFC2597 Rate per
AF43 (such as RFC 2698) DSCP
Real-Time CS4 Police using sr+bs RFC2474 Rate No
Interactive
Multimedia AF31 Using two-rate, Yes
Streaming AF32 three-color marker RFC2597 Rate per
AF33 (such as RFC 2698) DSCP
Broadcast Video CS3 Police using sr+bs RFC2474 Rate No
Low-Latency AF21 Using single-rate, Yes
Data AF22 three-color marker RFC2597 Rate per
AF23 (such as RFC 2697) DSCP
OAM CS2 Police using sr+bs RFC2474 Rate Yes
High-Throughput AF11 Using two-rate, Yes
Data AF12 three-color marker RFC2597 Rate per
AF13 (such as RFC 2698) DSCP
Standard DF Not applicable RFC2474 Rate Yes
Low-Priority CS1 Not applicable RFC3662 Rate Yes
Data

You can see the different DSCP values they recommend, whether you should police it or not. Use active queue management, etc.

Many vendors use RFC 4594 as a baseline, but sometimes use different DSCP values or recommendations.

Here is an example from Cisco:

Cisco uses CS5 for “Broadcast Video” instead of CS3 from RFC 4594. If you look at the traffic on your network, you’ll see many packets marked with these recommendations.

Does this help?

Rene

Thanks Renee,

Understood.

Where does Hierarchical QoS come into the picture? and can you do a lesson on a scenario on how we can apply on this concepts together, please? i.e policing, queuing, marking, classifying etc

Hello Champion

Take a look at this NetworkLessons note on QoS Hierarchical Queuing Framework (HQF) which also includes a link to more information.

Concerning your suggestion for a lesson on HQF, I suggest you visit the Member Ideas page below. There you can make your suggestion. You may find that others have suggested similar lessons, and you can add your voice to theirs.

I hope this has been helpful!

Laz

Hi,

Can we use DSCP values and IP precedence with 802.1q? type priority field?

Hello Gustavo

First of all, keep in mind that IP precedence and DSCP values are those found within the appropriate field in the IP header. The 802.1Q priority field is part of the VLAN tag that is found in the Layer 2 Ethernet header. These tags are only present for frames traversing a trunk link. Each of these operates at a different layer of the OSI model.

Now both of these features can be used in QoS mechanisms. For example, the Class of Service or CoS can be derived from the 802.1Q priority field. The CoS can then be used to classify frames traversing a trunk. The frames arriving at a trunk port can then be queued and prioritized accordingly.

For the DSCP and IP precedence values, these can be used to classify and mark IP packets that can then subsequently be used by QoS mechanisms to ensure the correct prioritization.

Because DSCP/IP precedence and 802.1Q priorities are constructs that belong to different layers, and are applied and used separately, there is no direct relationship between them. However, it is possible to create a “cos-to-dscp” or a “dscp-to-cos” mapping that will allow an 802.1Q priority field to adopt the priorities indicated in the DSCP of the IP header or visa versa. You can either use a default mapping or create your own. More about this can be found in the following lesson:

I hope this has been helpful!

Laz

1 Like

Taking for example the DSCP value 010010 = AF21

I know the 1st 2 is from the class value (1st 3 bits) so 010 = 2 , then 010 will be 2 but converting to AF value we must ignore the 6th bit (i dont know why) so we use 01 = 1 then the AF value is 21

Converting to decimal i use the classic bin to dec 010010 mapping 32 16 8 4 2 1 0 so the bits mapping 16 and 2 are “ON” = 18
But i dont get the algebraic deduction of the “quick method” 8x + 2y , ive been thinking about it for several minutes and i cant get it … why the 8 as a multiplier for the first octal (class value) and the 2 as a multiplier for the 2nd octal (drop probability)

EDIT : I think i was tricked by the 1st octal, due the least significant bit isnt used , you choose the minimum least value you can get in this octal = 2, the 2nd octal however you use the 3 bits, and the min lst value is 8, if we had a 3rd octal the multiplier will be 64 x AF dec (hundred value position)… i don’t know if im right but i apologize because i guess this could be and off topic and not directly related to the QoS lesson.

Hello Juan

Yes, you got it. Remember the structure of the DS field:
image

Classes range from 1 to 4 with the following possible values of the class bits:

  • Class 1: 001 (1 in decimal)
  • Class 2: 010 (2 in decimal)
  • Class 3: 011 (3 in decimal)
  • Class 4: 100 (4 in decimal)

Drop probability ranges from 1 to 3 with the three drop probability bits having these possible values:

  • Low: 010 (2 in decimal)
  • Medium: 100 (4 in decimal)
  • High: 110 (6 in decimal)

Now when the AF notation is used, we have AFXY, where X is the class and Y is the drop probability. However, the value used for X and Y is not intuitive. The values for X range from 1 to 4 which are the decimal values of the three-bit class field. However, the values for Y range from 1 to 3, where we use 1 for Low, 2 for Medium, and 3 for High. But these values are not the actual decimal values represented by the bits which we see to be 2, 4, and 6. And this is the reasoning behind the use of the number “2” in the formula.

As for the number 8, as you said, we use it because we use the three bits, and the minimum first value is indeed 8.

So the 8x + 2y formula works because the “y” value is not the value in decimal, but the value that corresponds to Low, Medium, and High in the AF notation. That’s why we need the “2” there. The final bit is always 0 as you can see from the table in the lesson.

I hope this has been helpful!

Laz

2 Likes

Question about the Prioritization in AF classes:
Hello NetworkLessons Team,
Im a bit confused about the differences between different AF classes, for example AFxy over AFxy.
From the things I’ve read I know that first they shouldn’t be put in the same queue and second that there is no precedence over a class for example AF3y over AF2y (x = 3 or 2). But here’s the thing where I have problems understanding that. I don’t care about the y (drop probability) here atm cause I get that.

When looking at the 3 it means, that the bits 16+8 are set. So that is 24 (shortcut is 8x3). Now when doing this with a 2 its (8x2) = 16.

So when comparing those values to each other, from the decimals perspective 24 should be preferred cause its a higher value. For example with CoS a 5 is viewed “higher” then a 4 or a 3.

So for me it means, that if I would put those AF classes in the same queue…I would actually prefer AF3x over AF2x. Or is that not correct? And yes Im aware that we shouldn’t do that, but im curious.

The thing why im stumbling here is, the OCG says that the AF classes have no presedence over each other, but from a Decimals perspective they would. Or at least I think so, compared to the IPP or CoS values.

Every answer is appreciated!

Thanks in advance!
Addendum:
I basically think I figured it out.
Its just a recommendation of how to implement this. But in fact, its the choice of the Administrator.
The Administrator can do the policing like that AF22 is “better” than AF34 for example. It’s just that it would be against the “recommendation” in the standard. Basically the numbers don’t have any meaning unless the Administrator is giving them a meaning trought policing and other QoS mechanisms.

Kind regards,
Mirko

Hello Mirko

Yes, you got it! Assured Forwarding is simply a way of defining particular values within the DS field. Those values have recommended priorities, and in some devices, those recommended priorities are the default configuration, based on the related RFC. However, as an administrator, you can assign whatever meaning you want to each.

Remember the AF values are simply the markings that are assigned to particular packets. For QoS to operate, it must act upon those markings, and the QoS mechanisms that do so can be configured by the admin.

Take a look at these NetworkLessons notes on QoS marking, and applying QoS policies for more info.

I hope this has been helpful!

Laz

i had the same doubt

queues only exist when shaping, typically a parent qos policy-map shapping at CIR , then a child policy-map that has all queues. If we have 4 queues , 1 llq that is served inmediatly in case of congestion but configuring a limiit (policer), and then 3 queues passing through a scheduler, AF11, AF21, and AF31 because the first digit, AF31 (class 3) would have precedende over the other thow (AF11 and AF21) but you’ve said is a recomendation. In MQC if i want AF31 to have serving preference over AF21, how can i configure it ?
For my own understanding , one class = one queue (for ex AF11 would be only one queue) but it could have up to 3 drop values, it is also configurable ?

Hello Juan

The values found within the ToS field of the IP header can be used for a whole series of QoS features. When used with queueing, such as WFQ, CBWFQ, and LLQ, these mechanisms tend to use the specific traffic classes by default. Some of these queues can be tweaked using MQC.

WFQ is an automatic method of traffic prioritization and does not depend upon MQC, it is essentially hard-wired. However, both CBWFQ and LLQ can be tweaked in the way they deal with each class/drop probability.

WIth CBWFQ using the class-map, you classify traffic, and with the policy-map, you can allocate specific bandwidth to that class using the bandwidth command. By setting up CBWFQ, you’re essentially overriding the default WFQ mechanism and defining your own queueing behavior. More info can be found here.

Similarly, you can adjust the behavior of an LLQ. Using MQC, you can assign any class to the priority queue and allocate a specific amount of bandwidth to it. The priority command creates a priority queue and assigns bandwidth to it. This means the designated class (whichever one you choose) will receive strict priority up to the defined bandwidth. Traffic exceeding the allocated bandwidth might be dropped if congestion occurs. More info on this can be found here.

Now beyond queuing, the ToS is used in other QoS mechanisms such as class-based marking, policing and shaping, congestion avoidance, and others, and all of these have mechanisms (via class maps, route maps, and others) through which you can granularly define how different ToS markings are interpreted and subsequently applied.

I hope this has been helpful!

Laz

1 Like