How to Configure QOS for VOIP Traffic on Cisco Router

Configure QoS for VOIP Voice Traffic:

By using quality of service (QoS) on Cisco network devices helps provide both bandwidth and priority to certain types of network traffic. The network administrator tells the network devices which traffic requires what bandwidth and priority. It’s important to understand the difference between bandwidth and priority. Priority means network device like Cisco Router or Switch give that traffic priority by sending it before than other traffic and they give the traffic bandwidth by sending more of it than other traffic.

QoS configuration is very complex. There are many different ways of implement QoS on Cisco Routers. Follow the step by step QoS configuration on a Cisco router.

Step 1: Define the VOIP traffic in ACL

You have to define the traffic on Router which traffic you want to give QoS (Priority or dedicated Bandwidth), which you can accomplish either using an access control list (ACL) or using Network Based Application Recognition (NBAR). An ACL is the traditional way to define any traffic for a router. With NBAR, however, the router just recognizes the traffic traveling through the router–it knows that HTTP is HTTP etc. But there’s a limited list of protocols and applications that the router recognizes.

Cisco Router won’t recognize every single application, each IOS upgrade adds more to the list. In below example i created access-list for VOIP traffic.

Router(config)#access-list 105 remark access list for voip traffic for QOS
Router(config)#access-list 105 permit udp any any eq 5060
Router(config)#access-list 105 permit udp any any eq 5061
Router(config)#access-list 105 permit udp any any range 5000 10000
Router(config)#access-list 105 permit udp any any range 10000 20000
Router(config)#access-list 105 permit ip host 127.0.0.1 any
Router(config)#access-list 105 permit ip any host 127.0.0.1
Router(config)#access-list 105 permit ip host VOIP-host-here any
Router(config)#access-list 105 permit ip any host VOIP-host-any

Now you can find ,  i added VOIP  traffic in access list 105  like SIP server traffic (5060, 5061) ,  RTP traffic,  VOIP hosts here to any and any to VOIP hosts here to add match in class-map for QOS.

Step 2: Create a class-map for VOIP traffic:

A class-map defines the traffic into groups. In this example, i created a class-map called voice and put all VoIP protocols under it.

Router(config)#class-map match-all voice
Router(config-cmap)#?
QoS class-map configuration commands:
description  Class-Map description
exit            Exit from QoS class-map configuration mode
match           classification criteria
no              Negate or set default values of a command
rename          Rename this class-map
Router(config-cmap)#match access-group 105

Step 3: Create a policy-map for VOIP traffic:

A policy-map matches the classes from the class-map with how much bandwidth or priority you want to give this traffic. I created policy-map called voice-policy and defined class-map voice under policy-map voice-policy.

Router(config)#policy-map voice-policy
Router(config-pmap)#?
QoS policy-map configuration commands:
class               policy criteria
description    Policy-Map description
exit                Exit from QoS policy-map configuration mode
no                  Negate or set default values of a command
rename            Rename this policy-map
Router(config-pmap)#class voice
Router(config-pmap-c)#?
QoS policy-map    class configuration commands:
bandwidth            Bandwidth
compression          Activate Compression
drop                Drop all packets
exit                 Exit from QoS class action configuration mode
netflow-sampler    NetFlow action
no                   Negate or set default values of a command
police               Police
priority             Strict Scheduling Priority for this Class
queue-limit          Queue Max Threshold for Tail Drop
random-detect       Enable Random Early Detection as drop policy
service-policy        Configure Flow Next
set                   Set QoS values
shape                 Traffic Shaping

Router(config-pmap-c)#priority 1024
Router(config-pmap)#class class-default
Router(config-pmap-c)#fair-queue

Step 4: Apply the policy-map of  VOIP traffic on the Router  interface

Like an ACL, you must apply the policy-map to the specific interface then only it will affective. You can apply the policy-map in either output or input mode using below command:

service-policy output|input {name of policy-map}

If you’re using NBAR to recognize the traffic, you must also use the ip nbar protocol-discovery command on the interface. This enables NBAR to begin looking at the traffic.

Router(config)#interface FastEthernet0/0
Router(config-if)service-policy output voice-policy
Router(config)#interface Serial0/2/1
Router(config-if)service-policy output voice-policy

Filed Under: QOS

Tags:

About the Author:

RSSComments (1)

Leave a Reply | Trackback URL

  1. Ravi says:

    hey i checked quite a few of your pages out 🙂 This is nicely covered about QOS configuration for VOIP traffic on Cisco Router, Thanks for sharing.

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.