# Classification

**Classification** organizes network traffic (packets) into traffic classes (categories).

Classification is fundamental to QoS. To give priority to certain types of traffic, you have to identify which types of traffic to give priority to.

There are many methods of classifying traffic. Some examples:

* An ACL. Traffic which is permitted by the ACL will be given certain treatment, other traffic will not.
* **NBAR** (Network Based Application Recognition) performs a _deep packet inspection_, looking beyond the Layer 3 and Layer 4 information up to Layer 7 to identify the specific kind of traffic.
* In the Layer 2 and Layer 3 headers there are specific fields used for this purpose.

The **PCP** (Priority Code Point) field of the 802.1Q tag (in the Ethernet header) can be used to identify high/low priority traffic.

* Only when there is a dot1q tag!

The DSCP (Differentiated Services Code Point) field of the IP header can also be used to identify high/low priority traffic.

## PCP/CoS

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FrtG4Rn1koGXeShlgINzO%2FScreenshot%20from%202023-08-28%2012-55-13.png?alt=media&#x26;token=b323fa6b-833a-47bd-a05a-ebda0bc498e8" alt=""><figcaption></figcaption></figure>

PCP is also known as CoS (Class of Service). Its use is defined by IEEE 802.1.p

3 bits = 8 possible values.



<table><thead><tr><th width="159">PCP value</th><th>Traffic types</th></tr></thead><tbody><tr><td>0</td><td>Best effort (default)</td></tr><tr><td>1</td><td>Background</td></tr><tr><td>2</td><td>Excellent effort</td></tr><tr><td>3</td><td>Critical applications</td></tr><tr><td>4</td><td>Video</td></tr><tr><td>5</td><td>Voice</td></tr><tr><td>6</td><td>Internetwork control</td></tr><tr><td>7</td><td>Network control</td></tr></tbody></table>

{% hint style="info" %}
´Best effort' delivery means there is no guarantee that data is delivered or that it meets any QoS standard. This is regular traffic, not high-priority.
{% endhint %}

{% hint style="info" %}
IP phones **mark** call signalling traffic (used to establish calls) as PCP3. They **mark** the actual voice traffic as PCP5.
{% endhint %}

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FhVjcc1ScsLuBlh4cImtD%2FScreenshot%20from%202023-08-28%2013-06-08.png?alt=media&#x26;token=c0970352-e619-4db8-88af-822f9ab07828" alt=""><figcaption></figcaption></figure>

Because PCP is found in the dot1q header, it can only be used over the following connections:

* trunk links.
* access links with a voice VLAN.

In the diagram below, traffic between R1 and R2, or between R2 and external destinations will not have a dot1q tag. So, traffic over those links PCP cannot be marked with a PCP value.

## The IP ToS Byte

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2F7PrG9OKY5G5tcqbnKuSd%2FScreenshot%20from%202023-08-28%2014-35-45.png?alt=media&#x26;token=ad9f1590-df96-4070-ae9e-3cfec14ae60f" alt=""><figcaption></figcaption></figure>
