Thursday, November 11, 2010


Basic QoS configuration on Cisco router
By
J Sanchez– September 1, 2010Posted in: Networking, Technology
So you have VOIP deployed in your entire organization and you recently opened a couple of branches offices and your boss wants you deploy IP phones at branch locations. The branches are hanging off of a T1 and all traffic transverses that circuit. As an engineer you need deploy a reliable solution, but you know your bandwidth is limited. It is well known that the solution to such dilemma is the implementation of QoS. In fact, if you have VOIP deployed through out your entire organization you probably have QoS turned on in some form or fashion. I found myself in the same situation a few weeks ago. I had a new branch connected to our central location over MPLS, and we needed to install VOIP phones in the remote location. In this case a very simple VOIP configuration will do. Keep in mind that QoS is very complex. I will not go over every detail of QoS here. I will simply try provide you with a sample configuration and a brief explanation as to how QoS works. Let’s look at following network:
Network Diagram













Scenario
As you can see we have a central VOIP network with two branch offices in S1 and S2. The IP Phones have to go trough the MPLS cloud for their VOIP service. The problem is that Active Directory, DNS and file and print services also transverse the same link. We need to setup QoS, so that whenever the link is saturated the VOIP traffic will get priority over any of the other traffic. We want to allocate 30% of our T1′s bandwidth to VOIP traffic in order to ensure that our voice traffic will always get prioritize over all the other traffic.
Tagging the packets
There are multiple ways to configure QoS. The three main ways are to use IP Precedence, DiffServ, or using access-lists to tag packets. In our case we will assume that the IP Phones – as most ip phones do – tag packets with an ip precedence of 5.
How QoS works
QoS or Quality of Service works by prioritizing packets based on a configured set of rules. I find it much easier to understand by explaining the different components of QoS. There are three components to that need to be configured for QoS to work.
Class Maps – Class maps match packets based on IP Precedence tags, DiffServ tags, access-list, interfaces and even protocols.
Policy Maps – Policy maps determine how the packets defined on a Class Map are policed.
Service Policy – Service Policies apply Policy Maps to an interface.
Let’s configure our sample network to make sense of this whole thing.
Configuration
Looking back at our network, we know we need to prioritize VOIP traffic going out of the S1 and S2 routers going to the HQ routers. We also need to prioritize traffic going out of the HQ router to the S1 and S2 routers. The configuration would be as follows:
HQ Router
HQ(config)# class-map VOIP – This creates a class map named VOIPHQ(config-cmap)#match ip precedence 5 – This adds all packets tagged with an ip precedence of 5 to the VOIP class map.HQ(config-cmap)#exit – This gets us back to global configuration mode.HQ(config)#policy-map WAN_VOIP – This creates a policy map called WAN_VOIPHQ(config-pmap)#class VOIP – This tells out policy map to police the VOIP class mapHQ(config-pmap-c)#bandwith percent 30 – This tells our policy map to allocate 30 of the bandwidth for our VOIP class map.HQ(config-pmap-c)#exit – Do this twice to get back to global configuration mode.HQ(config)#int s0/0 – To get us into interface configuration mode.HQ(config-if)# service-policy output WAN_VOIP – This will apply the policy map WAN_VOIP for all outgoing traffic to the interface.
The configuration is the same for all three routers. They all are using the same interface id’s. If you want to learn more about QoS, head over to this article. For more information on IP Precedence and Diffserv read RFC1349 and RFC2475, respectively.
Feel free to leave any questions in the comments.