# IP Precedence and DSCP

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2F038O5nXlkatgGfx4BfbR%2FScreenshot%20from%202023-08-28%2014-36-49.png?alt=media&#x26;token=aedbbc54-71e1-47a0-bf83-92c2116f5f50" alt=""><figcaption></figcaption></figure>

## IP Precedence

Standard IPP markings are similar to PCP:

* 6 and 7 are reserved for 'network control' traffic (ie. OSPF messages between routers).
* 5 = voice
* 4 = video
* 3 = voice signaling
* 0 = best effort

With 6 and 7 reserved, 6 possible values remain.

Although 6 values is sufficient for many networks, the QoS requirements of some networks demand more flexibility.

## DSCP

RFC 2474 (1998) defines the DSCP field, and other  'DiffServ' RFCs elaborate on its use.

With IPP updated to DSCP, new standard markings had to be decided upon.

* By having generally agreed upon standard markings for different kinds of traffic, QoS design & implementation is simplified, QoS works better between ISPs and enterprises, among other benefits.

You should be aware of the following standard markings:

* Default Forwarding (DF) - best effort traffic.
* Expedited Forwarding (EF) - low loss/latency/jitter traffic (usually voice).
* Assured Forwarding (AF) - A set of 12 standard values.
* Class Selector (CS) - A set of 8 standard values, provides backward compatibility with IPP.

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FO4HkKJ3UfOez12rsxPAu%2FScreenshot%20from%202023-08-28%2015-04-30.png?alt=media&#x26;token=45bef1af-67cc-4739-8f2d-fc4f706005da" alt=""><figcaption></figcaption></figure>

### DF (Default Forwarding)

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FQTMAtjWJ3sjdjZqarJkd%2FScreenshot%20from%202023-08-28%2015-06-00.png?alt=media&#x26;token=6789c640-4c03-4aeb-bec8-6284c032097d" alt=""><figcaption></figcaption></figure>

**DF** is used for best-effort traffic.

The DSCP marking for DF is 0.

### EF (Expedited Forwarding)

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FLD6mj4mYNHbFET1JAoVB%2FScreenshot%20from%202023-08-28%2015-06-30.png?alt=media&#x26;token=957b0510-e682-49dd-b319-da3ed12efc4a" alt=""><figcaption></figcaption></figure>

**EF** is used for traffic that requires low loss/latency/jitter.

The DSCP marking for EF is 46.

### AF (Assured Forwarding)

**AF** (Assured Forwarding) defines four traffic classes. All packets in a class have the same priority.

Within each class there are three levels of drop *precedence*.

* High drop precedence = more likely to drop the packet during congestion

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FOPbamjiRLdTYhG7vMRVJ%2FScreenshot%20from%202023-08-28%2015-09-51.png?alt=media&#x26;token=b2066040-fc1e-4fff-9561-0d835c186997" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FeZTD1zY9HoJPrrCJX1Q2%2FScreenshot%20from%202023-08-28%2015-10-40.png?alt=media&#x26;token=31a8566a-23b4-4b5f-b5db-432cc2410529" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2F19RJzgi8hyl4cMmGjaPJ%2FScreenshot%20from%202023-08-28%2015-12-48.png?alt=media&#x26;token=7d34f760-918b-4220-aa9d-522f9534bd13" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FpphsN5CnFNzBoimSpZxa%2FScreenshot%20from%202023-08-28%2015-13-16.png?alt=media&#x26;token=c494d564-13ed-41fe-b9c8-55a5fb7796dc" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FT6UCtyWzpe9BscF81qAZ%2FScreenshot%20from%202023-08-28%2015-13-43.png?alt=media&#x26;token=37f9a61d-1163-4b13-9837-21f188794866" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FSn3YxV8xRmNFhcca9Qe1%2FScreenshot%20from%202023-08-28%2015-14-30.png?alt=media&#x26;token=9f823d66-8f66-411d-840b-377f3c6ba738" alt=""><figcaption><p>Highest possible class value is 43</p></figcaption></figure>

{% hint style="info" %} <img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FTMKrFb7yauti0fyM0v4s%2FScreenshot%20from%202023-08-28%2015-15-24.png?alt=media&#x26;token=de5e2a15-0b2b-4932-9554-b442840852e6" alt="" data-size="original">\
Formula to convert from AF value to decimal DSCP value: 8**X** + 2**Y**
{% endhint %}

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FerHwCklFLM7OTNzk1cIk%2FScreenshot%20from%202023-08-28%2015-18-22.png?alt=media&#x26;token=6bb3d442-a57b-4ae7-b98f-1ac78816ccb7" alt=""><figcaption></figcaption></figure>

### CS (Class Selector)

**CS** defines eight DSCP values for backward compatibility with IPP.

The three bits that were added for DSCP are set to 0, and the original IPP bits are used to make 8 values.

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FqT8Iu1f40M6ONxhzVK5u%2FScreenshot%20from%202023-08-28%2015-22-08.png?alt=media&#x26;token=658bb59b-49eb-4766-9e66-14d337bc7261" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://davidjosearaujo.gitbook.io/online-courses/ccna-200-301/quality-of-service/ip-precedence-and-dscp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
