Showing posts with label VoIP. Show all posts
Showing posts with label VoIP. Show all posts

Tuesday, March 12, 2013

Cisco ASA QoS For VoIP

So the goal is simple, right? You have a hosted VoIP solution and you want to ensure that your data traffic does not delay the VoIP traffic or worst still, you don't want the edge firewall dropping any VoIP packets because of high data usage.

I have a few customers that have deployed hosted VoIP solutions from WaveStreet and 8x8 - the usual complaint from time to time is that "the voice quality is bad" or "I could not hear the other party". Now most of these folks have simple networks like the one depicted below and I have managed to eliminate their VoIP issues with QoS configurations on the ASA.



In this particular example, we have a Cisco ASA 5505, a layer 3 switch with two VLANs, one for data and one for voice. Not included in this blog are the configs for the switches. It is advised that you turn on QoS on the switches if they supported it.

Prioritizing VoIP traffic using a Cisco ASA is well documented but the problem is Cisco's documents tend to omit a few important facts. Their example always use just the outside interface (ISP facing). Now, because QoS only acts on the egress traffic when applied to an interface, this does nothing for the inbound traffic from the ISP - the more important direction!

The second critical detail omitted is that even after you have applied the QoS to the correct interfaces, it does not help when a really long download is saturating the ISP link. Those VoIP packets don't have a chance getting down in time from the Internet to your network over that saturated pipe!

So how do we correct these. I used a nested policy on both the outside and inside interfaces of the firewall. The policy on the inside acts on the egress interface and therefore will impact the inbound traffic from the Internet whereas the outside one impacts the outbound traffic toward the Internet. Unfortunately, you've got to sacrifice the data bandwidth for this solution to work but there is no way around it. In my opinion it's a small price to pay.

Each call takes up about 80Kbps in our example and we have had about 10 simultaneous calls in the past  so I reserved 1Mbps of our 3Mbps Internet pipe for voice traffic. This implies that the data traffic (or all but voip traffic) can share 2Mbps. To do this, you shape the default class to 2Mbps and nest the voice policy so that the voip traffic is omitted from shaping (or drops) which will give it the remaining 1Mbps. Since I had a symmetrical 3Mbps Internet connection, I applied 2Mbps of traffic shaping to both interfaces. Change the shape rate accordingly if you have asymmetrical speeds.

Here's the relevant ASA 5505 configs with some explanations.

interface Vlan1
 nameif inside
 security-level 100
 ip address 10.0.0.1 255.255.255.0
!
interface Vlan2
 nameif outside
 security-level 0
 ip address i.i.i.i 255.255.255.248
!
interface Ethernet0/0
 switchport access vlan 2
!
interface Ethernet0/1
!
!I expect you to limit the udp ports to just what your provider has recommended. !I opened up all udp just to keep things simple
!
access-list outside_access_in extended permit udp any any 
!
!Although I used the entire subnet to classify the voip packets, please
!feel free to use dscp, precedence or ports instead
!
!Inbound voip traffic classification
access-list voip_inside extended permit ip any 10.16.1.0 255.255.255.0
!
!outbound (toward Internet) voip traffic classification
access-list voip_outside extended permit ip 10.16.1.0 255.255.255.0 any
!
global (outside) 1 70.35.47.195 netmask 255.255.255.255 nat (inside) 1 10.0.0.0 255.0.0.0 ! access-group outside_access_in in interface outside route outside 0.0.0.0 0.0.0.0 i.i.i.a 1 !
!Enable the piority queues on both interfaces
priority-queue inside
priority-queue outside
!
!Define the class maps for both inbound and outbound voice traffic and prioritize
!the voice traffic
!
class-map voice-inside-class
 match access-list voip_inside
class-map voip-outside-class
 match access-list voip_outside
!
policy-map global_policy
 class inspection_default
  inspect dns migrated_dns_map_1
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect rsh
  inspect rtsp
  inspect sqlnet
  inspect skinny
  inspect sunrpc
  inspect xdmcp
  inspect netbios
  inspect tftp
!
policy-map outside-policy
 class voip-outside-class
  priority
policy-map inside-policy
 class voice-inside-class
  priority
!
!Nested policy. Shapes all but VoIP traffic inbound from ISP at 2Mbps.
policy-map ins-policy
 class class-default
  shape average 2000000 8192
  service-policy inside-policy
!
!Nested policy. Shapes all but VoIP traffic outbound to ISP at 2Mbps.
policy-map out-policy
 class class-default
  shape average 2000000 8192
  service-policy outside-policy
!
service-policy global_policy global
service-policy ins-policy interface inside
service-policy out-policy interface outside

This will protect those sensitive real time packets in both directions but remember the bandwidth sacrifice!

Friday, August 24, 2012

Cisco CME with ATA186 using FAX Pass Through mode


This finally worked after getting a bad ATA the first time round that would not respond to https. The first thing you want to do is point your browser to the ATAs IP address (https://IPAddr/dev) and make the following changes:

I configured ATA with static IP address and disabled TFTP.

Network Parameters
 UseTFTP=0
 DHCP=0
 StaticIP=172.17.100.9
 StaticRoute=172.17.100.1
 StaticNetMask=255.255.255.0

Audio Parameters
 LBRCodec=3
 AudioMode=0x00150015
 ConnectMode=0x90000404

On the CME I had the fax DID number 5552496501 first get translated to extension 101 using a profile. With the usual suspects of dial-peers and ephones referencing 101, the Fax call is placed to port 1 (determined by the MAC address) of the ATA.

CME Configs
voice service voip
  modem passthrough nse codec g711ulaw

voice translation-rule 9

 rule 1 /^55522672\(..\)$/ /1\1/
 rule 3 /^5552496501/ /101/  <---Fax number. Translates to 101

voice translation-profile SIP_IN

 translate calling 3
 translate called 9 <--Incoming SIP calls

tftp-server flash:ATA030203SCCP051201A.zup


dial-peer voice 101 voip

 destination-pattern 101
 modem passthrough nse codec g711ulaw
 session target ipv4:172.17.100.9
 codec g711ulaw
 fax rate disable
 no vad

telephony-service

 load ata ATA030203SCCP051201A.zup

ephone-dn  101

 number 101

ephone  28

 device-security-mode none
 mac-address 001D.4595.6401 <--MAC Address of Port 1 on ATA
 max-calls-per-button 2
 type ata
 button  1:101

Friday, August 27, 2010

Upgrading Cisco CUE from 3.1.1 to 7.0.5

Our current version was at 3.1.1 and we needed to fix the IMAP issue with Entourage by upgrading to 3.2.x but realized I could go all the way to 7.0.x! First login to the CUE and type show software version to check current version and check that your CME version supports by consulting the compatibility matrix. My CME was at 4.1(0) - I was good to go.


Download cue-vm-k9.nm.7.0.5.zip image form here (CCO login required). Ensure you pick the one that is appropriate for your hardware. I had an NM-CUE. Extract all files into a folder onto your FTP server. I also downloaded the language pack for the US separately and place this onto the FTP server too. At some point during the installation you will be asked to select the language and for some reason the install fails when it does not see that language file on your server.


You will need an FTP server to upgrade the CUE - I did a clean install. Once sessioned into the CUE you can follow these detailed steps but here is a quick summary.
  1. Backup all your files on the CUE (this is really important for a clean install). See below for instructions.
  2. Verify connectivity to your FTP server.
  3. Execute command on CUE: software download clean url ftp://192.168.1.1/cue-vm-k9.nm.3.2.4.pkg username xxx password yyy
  4. Check status: software download status
  5. Now install the software just downloaded: software install clean cue-vm-k9.nm.7.0.5.pkg
  6. The system will reload after the upgrade completes.
  7. Check new version: show software version
  8. Restore the files from your backup server. I have the detailed steps listed below.
If you picked the wrong version of the software you will get this error message below. I downloaded the nme version during my first attempt!

WARNING:: This command will download the necessary software to 
WARNING:: complete an upgrade.  It is recommended that a backup be done 
WARNING:: before installing software. 

WARNING:: The system will briefly be brought to an offline state
WARNING:: This will terminate any active call and prevent new calls
WARNING:: from being processed.

Would you like to continue? [n] y

Downloading ftp cue-vm-k9.nme.7.0.5.pkg
Bytes downloaded :  179928 

Validating package signature ... done

Downloading ftp cue-vm-installer-k9.nme.7.0.5.prt1
Bytes downloaded :  127198 

Installer does not recognize package file format.
Attempting to upgrade installer...
starting_phase:
install-files.sh /dwnld/pkgdata/.installer_wo
add_file /dwnld/pkgdata/cue-vm-installer-k9.nme.7.0.5.prt1 1 / tgz 
Installer upgrade successful
Restarting install process...
Validating package signature ... done
Validating installed manifests .............complete.
 - Parsing package manifest files... complete.
 - Checking Package dependencies... Service Engine Bootloader can not be installed on this platform/chassis combination.

CUE Backup Procedure 
  1. Config t on the CUE
  2. Configure the backup server with backup server url ftp://192.168.1.1/temp/ username xxx password yyy
  3. Verify with show backup server
  4. Go into offline mode - offline
  5. Do the back up. I normally get all the files - backup category all
  6. Exit offline mode - continue



CUE Restore Procedure
  1. show backup server will identify the backup ID number. Take note of this.
  2. Go into offline mode - offline
  3. Restore the files (my id number was 1) - restore id 1 category all
  4. reload