One article helps you clearly know what is CDN
659 2023-04-19

1. What is a CDN

The full name of CDN is Content Delivery Network, that is, content distribution network. Its purpose is to add a new layer of CACHE (caching) layer to the existing Internet, and publish the content of the website to the node closest to the user‘s network "edge", so that users can obtain the required content nearby and improve the user experience. Responsiveness of access to the website. Technically solve the reasons such as small network bandwidth, large number of user visits, uneven distribution of outlets, etc., and improve the response speed of users visiting the website.

 

To put it simply, the working principle of CDN is to cache the resources of your source site on CDN nodes located all over the world. When users request resources, they will return the resources cached on the nearest node, instead of requiring each user‘s request to return to your Obtaining from the source site avoids network congestion, relieves the pressure on the source site, and ensures the speed and experience of users accessing resources.

 

CDN

 

The optimization effect of CDN on the network is mainly reflected in the following aspects
  • Solving the "first mile" problem on the server side
  • Mitigate or even eliminate the impact of interconnection bottlenecks between different operators
  • Ease the export bandwidth pressure of the provinces
  • Alleviate the pressure on the backbone network
  • Optimized the distribution of hot content on the Internet

2. Working principle of CDN

CDN 002

As can be seen from the figure above, the process for a user to access a website that does not use CDN caching is as follows:
  • The user enters the domain name to visit, and the operating system queries LocalDns for the IP address of the domain name
  • LocalDns queries ROOT DNS for the authoritative server of the domain name (this assumes that the LocalDns cache expires)
  • ROOT DNS responds to the domain name authorization dns record to LocalDns
  • After LocalDns obtains the authorized dns record of the domain name, it continues to query the IP address of the domain name from the authorized dns of the domain name
  • After the domain name authorization dns queries the domain name record, it responds to LocalDns
  • LocalDns will get the domain name ip address and respond to the client
  • After the user gets the IP address of the domain name, he visits the site server
  • The site server responds to the request and returns the content to the client

CDN access process

CDN 003

From the above figure, we can see that the access process of the website after using the CDN cache becomes:

  • The user enters the domain name to visit, and the operating system queries LocalDns for the IP address of the domain name.
  • LocalDns queries ROOT DNS for the authoritative server of the domain name (this assumes that the LocalDns cache expires)
  • ROOT DNS responds to the domain name authorization dns record to LocalDns
  • After LocalDns obtains the authorized dns record of the domain name, it continues to query the IP address of the domain name from the authorized dns of the domain name
  • After the domain name authorization dns queries the domain name record (usually CNAME), it responds to LocalDns
  • After LocalDns obtains the domain name record, it queries the IP address of the domain name from the intelligent scheduling DNS
  • Smart Scheduling DNS Responds to LocalDns with the most suitable CDN node ip address according to certain algorithms and strategies (such as static topology, capacity, etc.)
  • LocalDns will get the domain name ip address and respond to the client
  • After the user obtains the IP address of the domain name, he visits the site server
  • The CDN node server responds to the request and returns the content to the client. (On the one hand, the cache server saves it locally for later use, and on the other hand, returns the acquired data to the client to complete the data service process)

 

Through the above analysis, we can conclude that in order to achieve transparent access to ordinary users (the user client does not need to make any settings after using the cache), it is necessary to use DNS (Domain Name Resolution) to guide users to access the Cache server to achieve transparent acceleration services. Since the first step for users to visit a website is domain name resolution, it is the simplest and most effective way to guide users to visit by modifying DNS.

Components of a CDN network

For ordinary Internet users, each CDN node is equivalent to a web server placed around it.

 

Through DNS takeover, the user‘s request is transparently directed to the nearest node, and the CDN server in the node will respond to the user‘s request just like the original server of the website. Since it is closer to the user, the response time is necessarily faster.

 

The piece circled by the dotted circle in the figure above is the CDN layer, which is located between the client and the site server.

 

Intelligent scheduling DNS (such as f5‘s 3DNS)

  • Smart Scheduling DNS is a key system in CDN service. When a user visits a website that joins CDN service, the domain name resolution request will be finally handled by "Smart Scheduling DNS".
  • Through a set of pre-defined policies, it provides the user with the node address closest to the user at that time, so that the user can get fast service.
  • At the same time, it needs to maintain communication with the CDN nodes distributed in various places, track the health status, capacity and other information of each node, and ensure that the user‘s request is allocated to the nearest available node.

 

Cache function service

  • Load balancing equipment (such as lvs, BIG/IP of F5)
  • Content Cache server (such as squid)
  • shared storage

 

3. Explanation of terms

CNAME record

CNAME is an alias (Canonical Name); it can be used to resolve a domain name to another domain name. When the DNS system queries the name on the left side of the CNAME, it will turn to the name on the right side of the CNAME and then query, all the way to the last PTR or A Name, it will respond only after a successful query, otherwise it will fail.

 

For example, if you have a lot of data stored on a server, you use docs.example.comto access these resources, but you documents.example.comalso want to access these resources, then you can add a CNAME record to your DNS resolution service provider, point to documents.example.com, docs.example.comadd After this CNAME record, all access documents.example.comrequests will be forwarded docs.example.comto obtain the same content.

CNAME domain name

When accessing the CDN, after adding the accelerated domain name in the CDN provider console, you will get a CNAME domain name assigned to you by the CDN. You need to add a CNAME record to your DNS resolution service provider to point your accelerated domain name to this CNAME Domain name, so that all requests for this domain name will be transferred to the CDN node to achieve the acceleration effect.

DNS

DNS stands for Domain Name System, which means domain name resolution service. Its role in the Internet is to convert the domain name into an IP address that can be recognized by the network. People are used to memorizing domain names, but machines only recognize IP addresses. There is a one-to-one correspondence between domain names and IP addresses. The conversion work between them is called domain name resolution. Domain name resolution needs to be completed by a dedicated domain name resolution server. The process is automatic. For example: www.baidu.com entered when surfing the Internet will be automatically converted to 220.181.112.143.

 

Common DNS resolution service providers include: Alibaba Cloud Resolution, Wanwang Resolution, DNSPod, Xinwang Resolution, Route53 (AWS), Dyn, Cloudflare, etc.

Back to source host

Back-to-origin host: The back-to-origin host determines the specific site on the origin site that the back-to-origin request accesses.

Example 1: The source site is a domain name. The source site www.a.comis , and the back-to-source host is www.b.com. Then the actual back-to-source request is the IP resolved to `www.a.com, and the site www.b.com on the corresponding host

Example 2: The source site is the IP source site is 1.1.1.1, and the back-to-source host is www.b.com, then the actual back-to-source is the site www.b.com on the host corresponding to 1.1.1.1

Protocol back to source

The protocol used when referring back to the source is consistent with the protocol used when the client accesses the resource, that is, if the client uses HTTPS to request the resource, if the resource is not cached on the CDN node, the node will use the same HTTPS method to return to the source to obtain the resource; Similarly, if the client requests using the HTTP protocol, the CDN node also uses the HTTP protocol when returning to the source.

 

Recommend the data centers, dedicated network, metro-politan network, leased line, dark fiber network interconnections device,

DWDM OTN platform, HT6000 and HT6800.

 

2U Chassis 1

HT6800 DCI box

 

 

 

 

 

 

 

 

 

 

 

 

003 WhatsApp