Loading ...

Would you like to discuss your environment with a knowledgable engineer?

Preferred communication *

Thank you. We will be in touch with you shortly

AWS Route 53 configuration for aiCDN and aiProtect

Here we demonstrate how you can create your own Content Delivery Network with aiCDN running on Amazon EC2 and Amazon Route 53 DNS. Strictly speaking, aiCDN is actually an Application Delivery Network (ADN), altough the differences between ADN’s and CDN’s is rather arbitrary. This tutorial also works well for fighting off large DDoS attacks (20Gbit+), in which case it’s useful to (temporarily) distribute traffic to different data centers.

Amazon Web Services Route 53 allows you to send users to specific network resources based on their geography or latency. This means that you can route visitors to the fastest resource based on their location. For example, if you have a server in Dublin, Singapore, California Sydney.  You can send visitors from Europe to the Dublin server,  from Asia  to Singapore, from North America to California and from Australia to Sydney. You can use this service both for Amazon EC2 servers or for your own or other third party servers.

An aiCDN instance is actually identical to an aiScaler instance. aiCDN is a network of aiScaler instances, communicating with each other, and using Route53 for geographic load balancing. Sometimes we refer to the nodes in that network as  “aiCDN instances” and sometimes as “aiScaler instances”. Having aiScaler servers in different AWS regions with geo-routing creates your customized Content Delivery Network unique to your application, pretty cool huh? 🙂

The steps for this are:

I. Deploy aiCDN servers in the Amazon regions best suited to your customers.

II. Add records to Route 53 for each aiCDN server;

III. Add latency records to Route 53;

IV. Test your very own Content Delivery Network.

Now let’s take them one by one.

I. Create aiScaler servers in Amazon regions of your interest

This part is best described in another wiki article.

Once you’ve started the aiCDN instances in the regions you want, you can proceed with the next step. For this example I’ve created one in each AWS region.

II. Add records to Route 53 for each aiScaler server

To add records to Route 53, go to Amazon AWS console and select Route 53. You should have already added your domain there to be managed by Route 53, for this example I have used geo.aiscaler.com. So select the domain you want and click on Go to Record Sets, just like in the image below:

Go to Record Sets Route 53

then click on Create Record Set button: Create Record Set Route 53

Next you need to fill in the details, like in the following screenshot:

Route 53 record add

Now what those mean:

1. This is the name you want to give to the record, can be anything, but it is good to name it in a way that you will easily recognize it later, like here us-east-1.geo.aiscaler.com means that this is the aiScaler image from us-east-1 region.

2. This is the type of the record, it’s an A record, just to point the name us-east-1.geo.aiscaler.com to the IP address of the instance

3. TTL (Time-To-Live) this is the time for refreshing the value, you should set this to a bigger value if you don’t plan to change it in near future, but for my example here I might change it in near future, thus I’ve used 1 minute TTL.

4. The actual value, which is the IP address of the aiScaler instance in us-east-1 region.

5. Routing policy in this case is Simple, nothing fancy here yet.

6. Click on “Create Record Set” once everything is completed correctly.

Proceed with the same entries for each region, once you have entries for each region, you should have the Record Sets similar to the image below:

Route 53 Geo Location Records

Now we can proceed to the next step:

III. Add latency records to Route 53

In the same Console you’ll have to add another number of records – the latency records, that automatically will route your users to the lowest latency server for them. Thus click on Create Record Set Route 53 again and fill like in the image below:

Latency Record Route 53

To explain those above:

1. This is the actual URL we will use for our site, for this example I have used www.geo.aiscaler.com

2. Type of the record is CNAME, it is a kind of alias in DNS, there will be 8 aliases in my example, because I have 8 aiScaler servers in 8 different regions, all of them for www.geo.aiscaler.com and pointing to different AWS regions.

3. TTL  (Time-To-Live) this is the time for refreshing the value.

4. The actual value for the record, this is the respective entry from the entries we created at “Add records to Route 53 for each aiScaler server” step, so in this case we have the CNAME for the us-west-1 server, thus the value is us-west-1.geo.aiscaler.com.

5. Routing policy is Latency, this is the fancy part, it tells AWS to check for latency of the servers and reply to users DNS requests with the least latency server available, meaning the server which replied the fastest for the particular geo region, will be provided to the user.

6. Set the region to the the server location, in this case it’s us-west-1.

7. You can set any name here, but it has to be unique and best to set this to something that can be recognized easily in future.

Once all above is done, click on “Create Record Set”. Repeat this process for all of the regions and in the end you should have something like in the following image:

Final Record Sets Route 53

and that’s it, the Geo Routing configuration is complete and you now have your very own Content Delivery Network, wow, this sounds great 🙂

IV. Test your very own Content Delivery Network.

Now lets test this and see how it works in real life, for this visit something like http://cloudmonitor.ca.com/en/ping.php, enter there your domain and hit “Start” in couple of moments you should see the screen populating with different IP addresses of your servers depending on the region. Here are the results from my example:

Geo Ping Results

And you can clearly see the different IP addresses resolved based on region, cool stuff 😉

Now just configure your aiScaler instance to get the content from your origin server and let your users enjoy the faster site you just built in under 1 hour 🙂

US 1 (408) 744-6078   EU +44 20 7993 4587