Part 1: VoIP in a Cloud

(This is the first of a two-part series on using Amazon’s cloud services to meet your business telephony needs. In this part, we look at Amazon EC2 and how it is used in a VoIP setting. In Part 2, we’ll cover all the steps necessary in getting the open-source Asterisk PBX to work on Amazon’s cloud.) 
2004_04_10-012-1280
Businesses looking to upgrade their telephony systems to more cost-effective and powerful IP-based PBXes generally limit their choice to two approaches: in-house and out-sourced.

An in-house solution is often more powerful, gives the business much more control, is more secure and is less costly on an on-going basis to  maintain. On the down side, an on-premise PBX, however, requires some specialized knowledge, is tricky to scale as your needs grow and requires a significant up-front investment.  

An out-sourced service, often called a “virtual PBX,” is much easier to use and manage, can easily scale and costs less up front. The trade-off comes in the form of reduced customizability and significantly higher on-going costs.

With the recent growth in use of cloud computing, internet based pools of servers that can be dynamically configured to meet a businesses variable needs (i.e.: an office telecommunications system gets much greater use during business hours than on a weekend), an interesting third option for the office PBX has developed.

Why would I want to run my server in the cloud?

Cloud computing has lower upfront capital costs.  Rather than spend a few thousand dollars on a Dell server that will take weeks to arrive and days to configure, you can configure a virtual machine in the cloud, pay for the server as you use it, and be up and running in under an hour.

As an example, imagine a retailer planning for the 2008 holiday season by ordering new servers to handle the expected holiday call volume.  Due to the economic downturn, 2008  holiday sales where down significantly — and those servers ended up sitting idle.

If the retailer had used the cloud, servers could have been added or removed on the fly as needed to cover the actual call volume.

Probably the best-known of the cloud services is Amazon EC2, an innovative and useful offering by the web retail giant that offers an interesting way to greatly reduce  phone system and telephony application server costs.  

What is Amazon EC2?

The Amazon Elastic Compute Cloud (Amazon EC2) is a virtual machine web service that provides dynamic resizable compute capacity in the cloud.  Amazon EC2 provides a virtual computing environment,enabling an easy increase or decrease in capacity within minutes.  

Need more voice channels, for the holiday rush?  Turn on another virtual machine instance.  Less calls after business hours, turn off an unneeded virtual machine instance.  The process can even be automated with the EC2 API, and the servers can figure out when they should shut down or add another instance.  

Regions and availability zones

Amazon EC2 instances can run in multiple locations.  Amazon EC2 locations are divided into Regions and Availability Zones. 

Amazon EC2 is available in two regions — the US and Europe —  each consisting of one or more Availability Zones, distinct locations insulated from failures in other similar server locations.  

Launching instances in separate Availability Zones can protect your system from a failure in a single location.   The Amazon EC2 Service Level Agreement commitment is 99.95% availability for each Amazon EC2 Region. 

By setting up redundant instances closer to your physical location, you significantly reduce call latency.

Instance types

Amazon offers a variety of instance types.   Until you know how your setup will perform, the small virtual machine instance is the best place to start; it has the following performance specifications:

  • 1.7 GB memory;
  • EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit);
  • 160 GB instance storage (150 GB plus 10 GB root partition) additional storage available via Amazon EBS;
  • 32-bit platform;
  • I/O Performance: Moderate;
  • Price: $0.10US ($0.11EU) per instance hour.

One EC2 Compute Unit is roughly the equivalent of a high-end computer purchased three years ago. By optimizing certain parameters (i.e.: transcoding, which we’ll cover in more detail Part 2), this is plenty of firepower to handle the needs of 50 or more employees working in multiple locations.  

Data transfer

The beauty of the Amazon EC2 pricing model is that there are no minimum monthly fees for the service.  You only pay for what you use.  Running a test machine for three hours costs $0.30 in the US or $0.33 in Europe,  or less than $80 a month.

The Internet data transfer rates are also reasonable.  Inbound data costs $0.10 per GB/month and outbound data costs $0.17 per GB for the first 10TB/month.  Data transfer between two Amazon Web Services within the same region is free of charge. Be aware that voice media traffic is generally two-way, traffic in and out of Amazon EC2.  To keep data transfer costs down, when possible, route RTP traffic between end-points (we’ll show you how in Part 2). 

Before choosing Amazon EC2, compare your dedicated hosting bandwidth usage and costs with Amazon EC2’s costs.  Unlike some hosting providers with capped bandwidth and excessive overage charges, the Amazon EC2 has no bandwidth caps or overage charges.  Amazon offers a calculator tool to estimate your monthly costs.

Elastic Block Store (EBS)

Until recently, Amazon EC2 didn’t offer persistent disk storage.  If an instance was shut down, the data was lost, unless it was backed up into Amazon S3 or off-site.  Most telephony platforms don’t have support for Amazon S3 and this storage limitation was an impediment to using Amazon EC2 service for the storage of call logs and voice mail.  Amazon addressed the storage limitation with Amazon Elastic Block Store (EBS).

Amazon EBS provides block level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes are off-instance storage that live independently from the life of an instance.  Shut down an instance, start a new one, reattach the storage and your data is still there, like a removable hard drive.

You create a volume, specify the size, then mount the volume on your server.  Each volume can be 1GB-1TB in size and a single instance can have multiple volumes mounted.  Voice mail and log storage can easily scale.  Need more space? It’s as easy as adding another volume.  It’s an ideal approach for those who never delete voicemail or want their voicemails back after they delete them.  Voice mail and log volumes can also be separated for improved performance.

Amazon EBS also provides the ability to create point-in-time snapshots of volumes, which are stored in Amazon S3. These snapshots can be used to protect data for long-term durability. 

Volume storage is charged by the amount you allocate until you release it, and is priced at a rate of $0.10 US ($0.11 EU) per allocated GB/month.  Amazon EBS also charges $0.10US ($0.11EU) per 1 million I/O requests you make to your volume.

Elastic IP Addresses

Another early complaint about Amazon EC2 was that the IP address and hostname of an instance was never the same. This was problematic because whenever an instance was shut down and a new one turned on, the hostname and IP address would be different.  For many applications, this added an extra burden and users had to implement a variety of DNS workarounds.  
Amazon addressed this problem with Elastic IP address.  You can now get and keep an IP address and assign it to any one of your instances.  If your telephony server instance goes down, you can bring up a new one and assign the existing IP address to the new server.  There’s no need to update configuration files, track down hard coded IP addresses, or modify DNS records.  
Elastic IP addresses are free while they are assigned to an instance.  To prevent wasted IP addresses, Amazon charges for $0.01/hour for unassigned IP addresses.
Be Sociable, Share!
  • Pingback: Using Asterisk On Amazon's EC2 Service()

  • Pingback: New Apps Let You Manage the Cloud from Anywhere()

  • Great post! Looking forward to part 2.

  • Pingback: Part 2: Asterisk in a Cloud()

  • Great intro to EC2, too bad it wasn’t available when I started off. Check out my EC2 testing at http://www.simionovich.com, and the world’s biggest Asterisk+EC2 based dialer (over 2500 concurrent channels).

  • Pingback: Graves On SOHO VoIP » A Talk In The Clouds: Asterisk on EC2()

  • Brooks

    I can’t imagine any business running their phone system over the public internet. VoIP means Voice over IP but does not necessarily mean over the Internet. There is no quality of service in this model.

  • Rich

    Isnt it just the call manager in the cloud..
    So once call setup has been established…the voice traffic would be redirected (direct connect between VOIP clients) and go via the internal business network where hopefully QOS has been implemented….

    Or am I wrong

  • VoIP runs quite well over the Internet. It is how most customers reach their VoIP provider.

    Also consider a virtual office scenario where everyone works from home. The PBX is in the cloud and the extensions are at people’s homes.

    QoS is nice but not a requirement for VoIP.

  • Pingback: John Brandis()