Page tree
Skip to end of metadata
Go to start of metadata

This article discusses considerations in regard to VoIP optimization on customer networks and provides examples of configuration for various hardware vendors

What is Quality of Service

Quality of Service (QoS) is a concept typically framed in regard to performance of the network - the important applications and activities are being addressed quickly and nothing falls over the wayside. Everyone wants everything, but the reality is resource - in the case of Quality of Service, bandwidth or volume over time (Gbps or gigabits per second is an example) - has scarcity.

The question of how to achieve or maintain Quality of Service is already a concern at the overall network level, but what about VoIP? How do we ensure Quality of Service for a user service that requires low latency and reliable transport and delivery of voice data?

Essentially it boils down to traffic prioritization and addressed with two broad questions:

  • What traffic needs to be forwarded first?
  • What traffic can be put off and to what extent?

Without framing QoS in terms of priority, all traffic would otherwise be forwarded on a best-effort basis. That is, all traffic is treated the same regardless of whether it’s voice data that will exhibit noticeable degradation of quality or a mundane ping check to check in on another host elsewhere on the network.

While an end to end concern for network performance, organizations have only finite control over QoS - typically limited to their own networks at the switch and router level and varying levels of QoS implementation in hops between end to end propagation (out of company’s ISP(s), X network hops, other end’s ISP(s), other end network). With different scopes of QoS come different varieties of approaches and standards, such as CoS and DSCP (also referred to as DiffServ) that attempt to achieve QoS in different applications.

Since VoIP operates over the internet, we will necessarily focus on DSCP when analyzing QoS. In its basic definition, DSCP (DiffServ) is a protocol for managing bandwidth allocation for internet media connections occupying 6 bit services codes specifying different behaviors for applicable traffic. The DSCP (differentiated services code point) is in the IP header for packet classification.

As a base rule of thumb given the myriad options for prioritization through DSCP, NocTel recommends that SIP be set to the CS3 class and RTP set to EF. We can generally safely set SIP to CS3 as it isn’t as sensitive to latency as RTP is while maintaining some tolerance for packet loss with re-transmission. EF, or Expedited Forwarding, designates traffic as being high priority and very undesirable for packet loss. In RTP’s case, since the communication is effectively streaming re-transmission of data isn’t possible as it operates off UDP hence we set it to EF.

In the following sections QoS configuration examples are provided.

Cisco QoS Configuration Example

Cisco QoS Example
!!! Cisco QoS for NocTel
!!! ©2011 NocTel Communications, Inc.
class-map match-all voice-traffic
 match access-group 118
!
!
policy-map qos-voice
 class voice-traffic
  priority 2048 1024    !!! Size reserved for VoIP
 class class-default
  fair-queue
policy-map qos-parent
 class class-default
  shape average 4000000  !!! Size of WAN link
  shape max-buffers 4096
  service-policy qos-voice
!
interface FastEthernet0/0
 description "WAN"
 ip address dhcp         !!! Set IP Address
 ip nat outside
 ip virtual-reassembly
 speed 100               !!! Ensure link speed and duplex are correct for switch
 full-duplex
 service-policy output qos-voice   !!! Use qos-parent if there is a sub-interface
!
access-list 118 remark NocTel
access-list 118 permit udp any 192.69.24.0 0.0.7.255 range 1024 65534
!!!  Monitor the queues
show policy-map interface FastEthernet0/0

Juniper QoS Configuration Example

Juniper Router QoS Example
firewall {
    filter voip-ef {
        term voip {
            from {
                protocol udp;
                port 1024-65534;
            }
            then {
                count voip-expedited;   
                forwarding-class expedited-forwarding;
                accept;
            }
        }
        term other-traffic {
            from {
                forwarding-class-except expedited-forwarding;
            }
            then {
                count other-traffic;
                forwarding-class best-effort;
                accept;
            }
        }
    }
}

The above would be applied to an interface like this:

Juniper QoS Example - Interface Application
 family inet {
                filter {
                    output voip-ef;
                }
            }

Juniper Typical Switch QoS Configuration Example

Juniper Switch QoS Example
ethernet-switching-options {
    voip {
        interface Internal {
            vlan voip;
            forwarding-class expedited-forwarding;
        }
    }
}

If you find a syntax error in any of the above examples, let us know! Also feel free to contribute your own examples to grow the knowledgebase!

Final Considerations

While building solid QoS configurations internally can help optimize VoIP service, it is not a panacea that ensures every call is perfect as an ISP could be operating with congested ports, which is unfortunately generally outside of locus of control. Though this article outlines QoS primarily in the vein of VoIP, it can be applied to the rest of your network. However, do this sparingly and do not try to micromanage traffic priority through DSCP as it will likely cause contrasting results from attempting to involve too many service levels. Keep things simple: determine what needs to be delivered consistently and with minimal loss and determine what is not a priority. Everything else will fall into the "best effort" bucket of priority.