In this article we will be using the Modular Quality of Service CLI (MQC). This article will be useful for CCNP (ONT) or CCIP (QoS) studies.With MQC you first define traffic classes, then you build a policy map in which the actions are applied to your classes, finally you apply the policy to an interface. This is a 20/2 cable connection, before implementing QoS my P2P traffic was really beating up on all my other traffic.

First we’ll go over class maps. Class maps are used to match traffic. Here are my class maps:

class-map match-any NNTP
 description This is the Newsgroups traffic.
 match access-group name MATCH_NNTP
 match protocol nntp
class-map match-any BT
 description This is the Bittorrent traffic.
 match protocol bittorrent
 match access-group name BT_PORT
class-map match-any PRIORITY
 description This is all the traffic that gets priority.
 match protocol http
 match protocol dns
 match protocol secure-http
 match protocol ssh
 match access-group name MATCH_RDP

Class map NNTP is matching the port for newsgroups traffic using ACL MATCH_NNTP:

ip access-list extended MATCH_NNTP
 permit tcp any eq nntp any
 deny   ip any any

Class map BT is matching my bitttorrent traffic using NBAR and the port specified in ACL BT_PORT:

ip access-list extended BT_PORT
 permit tcp any eq 32547 any
 deny   ip any any

Class map PRIORITY is matching a lot of traffic, most of it is using Network Based Application Recognition (NBAR) (match protocol ______), we’re also using MATCH_RDP for Microsoft remote desktop traffic: