[Asterisk-Users] Cisco QoS Howto

Rich Adamson radamson at routers.com
Mon Apr 5 17:53:02 MST 2004


> Can anyone point me to some sample Cisco QoS configurations suitable for
> IAX2?  I've looked through Cisco's site, and get overwhelmed with the level
> of documentation (too much of a good thing).
> 
> My PSTN gateway and PBX (both *) are connected via 2xT1 (per-packet load
> balancing) between a Cisco  7206 and a 3640.  When the total bandwidth
> pushes much past 50%, I start getting some crazy distrotion (jitter?),
> making it impossible for one or both parties to understand the other.

There are several different ways to do it, some with better results then others,
and most highly dependent up specific IOS versions, etc.  Here's one way
based on a policy map:

In iax.conf, 
tos=lowdelay
(Note: that sets the TOS bits in the IP header. If you're not familiar with
that, use a packet sniffer to check it out.)

If you want to mess with sip, then in sip.conf set
tos=0x18  ;lowdelay     ;sets ip tos bits (=lowdelay and throughput)

In the Cisco, use the following:
class-map match-all voice-rtp
  match access-group 103
class-map match-all www-traffic
  match access-group 105

policy-map voice-policy
  class voice-rtp
    priority 80
  class www-traffic
   bandwidth 80
  class class-default
   fair-queue

Interface <whatever your outbound is>
 service-policy output voice-policy

access-list 103 permit ip any any tos min-delay
access-list 103 permit ip any any tos 12
access-list 105 permit tcp any eq www any

The above policy map essentially places any packets matching access list 103
in the "priority" queue, while packets matching 105 are placed in the next
lower queue. All other protocols/ports/etc fall into the "default" queue.
Pay close attention to those words in the above statements. If I recall
correctly, you can have up to something like eight queues.

When its functional, then do:
 show policy-map int <whatever your interface is>

to see how many packets fell into each queue. Adjust the "priority 80"
and "bandwidth 80" statements to influence the amount of bandwidth allocated
to each queue. The 80 represents 80,000 bits/second, the total does not have
to add up to your actual circuit bandwidth. Its an "influence", not a fixed
value.

The approach only addresses outbound packets, not inbound. To address the
in-bound traffic one has to go to the opposite end of the link and set the
same type of config. The above has no impact on packets flowing through
ISP routers (or anyone else's routers) for which you do not have control
and an equivalent policy map.

The above works fine on v12.2(4)T7, however you'll want to check to see
which exact versions actually support policy maps, etc.

As I'm sure others will point out, there are lots of other considerations
to engineering this including switches, etc, etc.

Rich





More information about the asterisk-users mailing list