Network| |CDN

CDN


CDN

CDN: Content Delivery Network, content delivery network, generally called cache server

A cache area is added between the client and the server, so that every time the client accesses a target server, it does not need to go directly to the source server to get content every time

The basic idea:

Try to avoid bottlenecks and links on the Internet that may affect the speed and stability of data transmission , so that content transmission is faster and more stable.

An intelligent virtual network based on the existing Internet is formed by placing node servers everywhere in the network .

The CDN system can redirect the user's request to the service node closest to the user based on comprehensive information such as network traffic and the connection of each node, load status, and the user's distance and response time in real time .

purpose

Enable users to obtain the required content nearby, solve the congestion of the Internet network, and improve the response speed and success rate of users visiting the website

  • Speed ​​up website access

  • Achieve cross-operator, cross-regional network coverage

  • Keep the website safe

    • CDN's load balancing and distributed storage technology can enhance the reliability of your website, and it is quite invisibly adding a protective umbrella to your website to deal with most Internet attacks. The anti-attack system can also avoid malicious attacks on websites.

  • Remote backup

    • When a server fails unexpectedly, the system will call other nearby healthy server nodes to provide services, thereby providing close to 100% reliability, which allows your website to never be down.

Infrastructure:

The CDN network is composed of a DNS server and several cache servers

  1. When the user clicks on the content URL on the website page, only the CNAME is obtained through local DNS resolution , and the DNS system will give the final domain name resolution to the CDN dedicated DNS server pointed to by the CNAME

  2. The DNS server of CDN returns the IP address of CDN's global load balancing device to the user (this global load balancing device can manage multiple regional load balancing devices)

  3. The user initiates a URL access request for content request to the CDN global load balancing device

  4. The CDN global load balancing device selects a regional load balancing device in the user 's area according to the user's IP address and the content URL requested by the user , and tells the user to initiate a request to this device

  5. The regional load balancing server will select a suitable cache server to provide services for the user .

    • The basis for selection includes:

    • According to the user's ip address, determine which cache server is closest to the user ;

    • According to the content name carried in the URL requested by the user, determine which server has the content required by the user ;

    • Query the current load status of each server and determine which server still has service capacity .

    According to the above comprehensive analysis, the regional load balancing device will return the IP address of a cache server to the global load balancing device

  6. The global load balancing device returns the IP address of the cache server to the user

  7. The user initiates a request to this cache server, and the cache server responds to the user request and transmits the content required by the user to the user terminal.

    • If there is no content that the user wants on this cache server , and the regional balance device still assigns it to the user, then the cache server will request the content from its upper level cache server until it is traced back to the source of the website The server pulls the content locally

Service model

CDN is a strategically deployed overall system, including distributed storage, load balancing, network request redirection and content management . Content management and global network traffic management are the core of CDN.

Instance

By adding a new network structure to the existing Internet, the content of the website is published to the cache server closest to the user, and the DNS load balancing technology is used to determine the source of the user to visit the nearest cache server to obtain the required content. Internet network congestion improves the response speed of users visiting websites, just like providing multiple accelerators distributed in various places to achieve the purpose of speeding up multiple websites quickly and redundantly.

Some nouns of CDN

1. Origin Server source station

Be the real server for customers before CDN.

2、User

Visitors are netizens who want to visit the website.

3. The last mile of the Last Mile is the path from the netizen to the CDN server he visited.

4. Domain Name A domain name is the name of a server or a network system on the Internet. There is no duplicate domain name in the whole world.

5. CNAME record

It is an alias record (Canonical Name); when the DNS system queries the name on the left of the CNAME, it will turn to the name on the right of the CNAME and then perform the query. It will trace to the last PTR or A name, and it will respond after a successful query. , Otherwise it fails.

6. CNAME domain name

CDN domain name acceleration requires CNAME records. After CDN acceleration is configured in the Alibaba Cloud console, you will get an accelerated domain name called CNAME domain name (this domain name must be *. * Kunlun.com ). Users need After you point your domain name as a CNAME to this *. * Kunlun.com domain name, the domain name resolution work will be officially transferred to Alibaba Cloud, and all requests for this domain name will be transferred to the node of Alibaba Cloud CDN.

CNAME domain name is an accelerated domain name, that is, add some domain names again after the original domain name, and supplement the original domain name

7、DNS

DNS stands for Domain Name System, which means domain name resolution service. Its role on the Internet is to convert the domain name into an IP address that the network can recognize. People are used to remembering domain names, but machines only recognize IP addresses. There is a one-to-one correspondence between domain names and IP addresses. The conversion 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, if you enter Baidu while surfing the Internet , you will know that it will automatically be converted to 220.181.112.143

8. Edge node

It is also called CDN node, Cache node, etc.; it is a concept proposed relative to the complex structure of the network. It refers to a network node with fewer intermediate links from the end user access, and has a better response ability and Connection speed. Its function is to store the content and objects of the most visited webpages on the dedicated cache device at the front end of the server to improve the speed and quality of website visits.

9、cache

cache A special memory subsystem in which frequently used data is copied to facilitate quick access. The cache memory of the memory stores the contents of frequently accessed RAM locations and the storage addresses of these data items. When the processor references an address in the memory, the cache memory checks whether the address is stored. If the address is stored, the data is returned to the processor; if the address is not stored, the conventional memory access is performed. Because the cache memory is always faster than the main RAM memory, it is often used when the access speed of the RAM is lower than that of the microprocessor.

The difference between CDN and traditional website visit:

Traditional visit visit:

 

 

Website visits using CDN:

 

 

Different from the traditional access method, the CDN network adds a cache layer between the user and the server to direct the user's access request to the optimal cache node instead of the server source site, thereby accelerating the access speed.

 

The complete CDN workflow:

Summarize the working principle of CDN: use the authoritative DNS server to select the optimal node, and reduce the pressure on the origin site through caching.

references:

  1. Knowing: Vision Cloud

  2. Knowing: Aliyun Yunqi Community

Guess you like

Origin blog.csdn.net/qq_40399012/article/details/88980736
cdn