There are differences in the responsiveness of users to websites in different geographies, in order to improve the responsiveness of user access and to optimize the flow of information in existing Internet, you need to join the middle tier CDNbetween users and servers. So that users can get the information they need from the nearest users, solve the network congestion and improve the response speed, which is the popular application scheme of the large-scale website nowadays.
1. CDN Overview
The full name of the CDN is the Content Delivery network, which is the contents distribution networks. The goal is to add a new layer of cache (cache) to the existing Internet, publish the content of the site to a node that is closest to the "Edge" of the user's network, so that users can get the content they need nearby, increasing the responsiveness of users to the site. From the technical comprehensive solution due to the network bandwidth is small, user access is large, dot distribution is not equal reasons, improve the response speed of users to visit the site.
Cache layer technology to eliminate node device congestion caused by peak data access. The cache server has caching capabilities, so most Web page objects (Web Page object), such as HTML, htm, PHP and other paging files, gif,tif,png,bmp and other file formats, in the validity period (TTL), for repeated access, You do not have to re-transfer the file entity from the original site, simply pass the simple authentication (freshness Validation)-transfer a dozens of-byte header to the local copy directly to the visitor. Because the cache server is usually deployed near the client side, it can obtain the response speed of the approximate LAN and reduce the bandwidth consumption of the wide area effectively. Not only can improve the response speed, save bandwidth, for accelerating the Web server, effectively reduce the load of the source server is very effective.
Depending on the acceleration object, it is divided into client acceleration and server acceleration
Client Acceleration : Caches are deployed at the network exit, caching frequently accessed content locally, improving responsiveness and saving bandwidth;
Server Acceleration : Cache is deployed in front of the server as the proxy cache for Web servers, improving the performance of the Web server and accelerating access speed
If more than one cache accelerates the server and distributes in different regions, it is necessary to manage the cache network through an effective mechanism, direct the user to the nearest access (for example, through the DNS to direct the user), the global load balanced traffic, which is the basic idea of CDN content transmission network.
The optimization of CDN to the network is mainly reflected in the following aspects-to solve the server-side "first kilometer" problem-mitigation or even eliminate the impact of the interconnection between the different operators-reduce the export bandwidth pressure of the provinces-relieve the pressure of the backbone network-optimize the distribution of hot content on the Internet
2. How the CDN works 2.1. Traditional access process (cache service not accelerated)
Let's look at the traditional access process for the non-cached service to see how the CDN cache access differs from the non-cached access:
By visible, the process by which a user accesses a site that is not using a CDN cache is:
The user enters the domain name to be accessed, and the operating system queries the IP address of the Localdns .
Localdns to ROOT DNS to query the domain name of the authorization server (this assumes Localdns cache expires)
ROOT DNS responds to Localdns for domain authorization DNS records
Localdns After obtaining the authoritative DNS record of the domain name, continue to authorize DNS query domain name IP address
Domain name authorization DNS query domain name record, response to Localdns
Localdns will get the domain name IP address that responds to the client
After the user gets the domain name IP address, access the site server
The site server answers the request and returns the content to the client.
2.2. CDN Access process (using the cache service)
The CDN network increases the cache layer between the user and the server, mainly by taking over the DNS implementation, directing the user's request to the cache to get the data from the source server.
Let's take a look at the process of accessing a website after using the CDN cache:
Through this, we can see that the access process of the site after the use of the CDN cache becomes:
The user enters the domain name to be accessed, and the operating system queries the IP address of the Localdns .
Localdns to ROOT DNS to query the domain name of the authorization server (this assumes Localdns cache expires)
ROOT DNS responds to Localdns for domain authorization DNS records
Localdns After obtaining the authoritative DNS record of the domain name, continue to authorize DNS query domain name IP address
Domain name authorization DNS query domain name record (usually CNAME), respond to Localdns
localdns get the domain name record, the IP address of the domain name is queried to the smart dispatch DNS
Intelligent dispatch DNS responds to the most appropriate CDN node IP address to Localdns based on certain algorithms and policies (such as static topology, capacity, etc.)
Localdns will get the domain name IP address that responds to the client
After the user gets the domain name IP address, access the site server
The CDN node server answers the request and returns the content to the client. (The cache server is stored locally for later use, two to return the retrieved data to the client to complete the data service process)
Through the above analysis we can get, in order to achieve transparent to ordinary users (using the cache after the user client does not have any settings) access, you need to use DNS (domain name resolution) to guide users to access the cache server, to achieve transparent acceleration services. Because the first step for a user to visit a website is domain name resolution , it is the simplest and most effective way to direct user access by modifying DNS.
Web site Acceleration CDN (Content Delivery Network) Technical principles