• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MBL204 Enhancing Quality & Performance for Vonage Mobile VOIP and Messaging Application using AWS - AWS re: Invent 2012
 

MBL204 Enhancing Quality & Performance for Vonage Mobile VOIP and Messaging Application using AWS - AWS re: Invent 2012

on

  • 1,735 views

Mobile communication applications have become a growing trend in the last few years. They allow users to build global virtual communities, reducing the need for the classic carrier while using ...

Mobile communication applications have become a growing trend in the last few years. They allow users to build global virtual communities, reducing the need for the classic carrier while using alternative data channels like WiFi or 4G. Such applications offer phone call features, interactive chats, SMS messages, video, and more for free or a very low cost. Companies are being challenged daily to provide best in class, high quality, over-the-top communication applications. In this session, we discuss the challenges in building a global quality network. We present how Vonage built a Mobile Global architecture using Amazon EC2, developed geo-location algorithms for optimal routing, and implemented iPhone/Android AWS SDKs for secure attachments storage using Amazon S3.

Statistics

Views

Total Views
1,735
Views on SlideShare
1,735
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MBL204 Enhancing Quality & Performance for Vonage Mobile VOIP and Messaging Application using AWS - AWS re: Invent 2012 MBL204 Enhancing Quality & Performance for Vonage Mobile VOIP and Messaging Application using AWS - AWS re: Invent 2012 Presentation Transcript

    • Enhancing Quality & Performance for Mobile VOIP & Messaging Apps Guy Fighel - Director of R&D Vonage Mobile
    • Vonage MobileOverview• High Quality Global VOIP & Messaging Mobile App• Phone calls to ANY Vonage user == Free!• Text Messages to ANY Vonage user == Free!• Phone call to any other destination == low cost• iPhone & Android
    • Software Architecture• Telephony • Vonage Proprietary SIP Proxies & Media Relays (C++) • Billing/Rating Engine (C++) • Real Time Call State Managers (C++)• Application APIs • REST APIs (JAVA) • Vonage Push Service to communicate with Apple Push & Google Cloud Messaging Service• Messaging APIs • REST APIs (JAVA) • Redis (with persistency)
    • Challenges• Delay/Low Bandwidth/Traffic Blocking for VOIP Calls• Global users - Peer to Peer vs. “Tromboning”• Messages Storage/Performance• Centralize Architecture for PSTN calls vs. Distributed Network• Providing Client Properties for multiple environments
    • USASingapore UK (over 3G)(over WiFi)
    • USAAttachments RTPSingapore UK (over 3G)(over WiFi)
    • Using EC2• Media Relays • Deployed our Relays in Ireland, Singapore, Virginia, California, Sao Paulo • In each zone, we are using ELB with Static IP • In each zone we start with 4 instances and dynamically can scale up (up to 10) • High-CPU Extra Large Instance 7 GiB of memory, 20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each), 1690 GB of local instance storage, 64-bit platform • Monitoring using CloudWatch (NOC dashboard) • All sites are connected back into Vonage’s Data Centers using VPC with ACLs & Encryption
    • Closer to the customer• Client sends SIP Registration Message to Proxy• Proxy determines client’s IP address (using STUN)• Proxy performs Geo Location query using external API• Based on Geo Location, Proxy chooses ELB Public IP in the relevant region• SIP continues to flow between Mobile client and Vonage’s DC, but Media flows directly into Amazon EC2 instance• (In Beta) - Client always puts IP address record using Route53 as the Relay. Dynamically gets best closest route• Override table has been implemented as well
    • Proxy Code - Choosing Relayvoid GetGeoRelayGroupIDList(RelayGroupList * apRelayGroupIDList, conststring& arEndPointIP){ string tCountry; string tRegion; // step 1 : MYSQL lookup in GeoRelayLocOverride table if (!GetLocationOverride(arEndPointIP, tCountry, tRegion)) { // step 2 : Geo IP lookup GetLocationFromGeoIPData(arEndPointIP, tCountry, tRegion); }
    • Maxmind APIhttps://github.com/maxmind/geoip-api-c1. Syncing the data file every day2. Loading the Data file into memory and map it using the locallibrary
    • Using S3• Mobile Messages API • Using S3 instances in US multiple regions (Always in full redundancy mode) • Messages are stored in Vonage internal Redis NoSQL DB • When Mobile client sends an attachment, it generates a unique ID for the file • Mobile Client uses S3 SDK for iPhone/Android in order to save the object, encrypt it and sends to Redis the attachment’s reference ID • When the Mobile client uses the ‘getMessage’ API, it fetches from Redis the S3 Attachment ID of a specific Message ID, and directly retrieves it from S3
    • Mobile Messages * saves a file into S3 storage using an input stream. * @param attachment the attachment to save * @return key the key used when sending to AWS * Note: this method should not close the input stream. * @throws MessagingException public String save(Attachment attachment) { FileMetaData metaData = attachment.getFileMetaData(); String key = makeKey(metaData); InputStream istream = attachment.getInputStream(); if (istream == null) throw new MessagingException("Unable to process attachment " +metaData.getFileName(), " - attachment meta data error: no stream" ); ObjectMetadata awsMetadata = new ObjectMetadata(); awsMetadata.setContentType(metaData.getMimeType()); awsMetadata.setContentLength(metaData.getSize());
    • Mobile Messages with Encryptionif (ServiceProperties.getBoolean(SERVER_SIDE_ENCRYPTION)) { awsMetadata.setServerSideEncryption(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION); } PutObjectRequest request = new PutObjectRequest(bucket, key, istream, awsMetadata); attachment.setStoreType(type); try { getAwsClient().putObject(request); } catch (Exception e) { throw new MessagingException("Unable to store attachment " +metaData.getFileName(), " - Aws S3 error: " + e.getMessage()); } return key; }
    • Retrieve Messagespublic InputStream get(FileMetaData metaData) { String key = metaData.getKey(); try { S3Object object = getAwsClient().getObject(new GetObjectRequest(bucket, key)); if (object == null) { throw new ClientRequestException("File " + metaData.getFileName() + " does notexist", " - Sws S3 returns null " + metaData.toString()); } return object.getObjectContent();
    • Client Properties Using SimpleDB• SimpleDB Domains per number of environmentsISO_CODE CLIENT_TAG DOMAIN1 BETA BetaDomain1 PROD ProdDomain1 QA QaDoamin44 PROD ProdDomain If mobile client has no ‘CLIENT_TAG’, then:‘DOMAIN’ always overrides
    • Client Properties Using SimpleDB - cont.• ProdDomainAttribute 1 Attribute 2 Client_TypeYES Server Address 1 iPhoneYES Server Address 2 AndroidNo Server Address 1 Windows Phone
    • SimpleDBpublic class SimpleDB { public static void main(String[] args) throws Exception { AmazonSimpleDB sdb = new AmazonSimpleDBClient(new PropertiesCredentials( SimpleDBSample.class.getResourceAsStream("AwsCredentials.properties"))); try { String myDomain = "Domain0"; // Select data from a domain String selectExpression = "select * from `" + myDomain + "`; SelectRequest selectRequest = new SelectRequest(selectExpression); for (Item item : sdb.select(selectRequest).getItems()) { System.out.println(" Item"); System.out.println(" Name: " + item.getName()); for (Attribute attribute : item.getAttributes()) { System.out.println(" Attribute"); System.out.println(" Name: " + attribute.getName()); System.out.println(" Value: " + attribute.getValue()); } } System.out.println();
    • www.vonagemobile.com@vonagemobile @guyfig/guyfig