Summary of CDN (Content Delivery Network) Technical Principles

Introduction

  1. CDN (Content Delivery Network) is a content distribution network, relying on edge servers deployed in various places, through the load balancing, content distribution, scheduling and other functions of the central platform, so that users can obtain the desired content nearby, and improve user access response speed and hit rate. ---- From: CDN Baidu Encyclopedia
    Take a simple example: the request that the browser in Shanghai wants to access the content of the main website in Beijing will be handled by the cache deployed in Shanghai or other places, so that the requested data only needs to be It can reach the requesting end after a short distance, effectively use the bandwidth and reduce the pressure on the main site

working principle

  1. CDN networks are generally divided into central nodes and edge nodes
    1. Central node function: monitor the status of edge nodes (availability, congestion level), global load balancing management, and data synchronization with the main site
  2. How CDNs work:
    the steps a browser takes to access a website
    1. Websites that are not cached by CDN
      1. The user enters the domain name to be accessed in the browser address bar
      2. The browser resolves the domain name to obtain the corresponding IP address, and then sends an access request to the server with this IP address
      3. The browser displays the content of the web page based on what the server returns
    2. Website with CDN cache
      1. The user enters the domain name to be accessed in the browser
      2. The browser parses the domain name (the CDN has adjusted the domain name resolution process) to obtain the CNAME record of the domain name, and then uses the global load balancing DNS to parse to obtain the actual IP address
      3. After the browser gets the actual IP address (the IP of the cache server), it sends an access request to the cache server
      4. The cache server obtains the actual IP address corresponding to the domain name through DNS resolution according to the domain name to be accessed provided by the browser, and then the cache server submits an access request to the actual IP address
      5. After the cache server gets the content from the actual IP address, it performs two operations:
        1. Save the resulting content locally for later use
        2. Return the acquired content to the client to complete the data service process
  3. Example:
    1. as the picture shows:
      How CDNs Work
    2. Steps to access the site in a browser:
      1. The user enters www.web.com in the address bar of the browser, and then presses Enter. The browser finds that there is no DNS cache locally, and requests the DNS server of the website.
      2. The DNS domain name resolver of the website is set with a CNAME, pointing to www.web.51cdn.com (CDN can only use load balancing system)
      3. Only the DNS load balancing system can resolve the domain name and return the IP node with the fastest response to the user to the user
      4. The browser sends a request to the IP node
      5. When accessing for the first time, the CDN server requests the original web site, and after obtaining the content, on the one hand, it caches the obtained content locally; If available, the original web site will not be requested again)
  4. CDN key technologies CDN key
    technologies include: content routing technology, content distribution technology, content storage technology, content management technology
    1. Content routing capabilities
      1. The CDN's load balancing system implements the content routing function of the CDN. The function of CDN content routing enables user requests to reach the best node in the CDN network
      2. The main purpose of global load balancing is to allow user requests to reach the nearest node in the CDN network
      3. Local load balancing looks for a suitable node to provide services within a specific range (taking into account the node's health, load, supported media formats, etc.)
    2. Content distribution technology
      Content distribution technology is mainly PUSH and PULL
      1. PUSH is an active distribution technology, usually initiated by the content management system, to publish content from the source or central media resource library to the Cache nodes (HTTP/FTP) at each edge
      2. PULL is a passive distribution technology. When the content requested by the user is not on the node of the edge cache reached by the request, the node will PULL the required content from the content source or other nodes (on-demand distribution)
    3. content storage technology
      1. The storage of content sources
        usually adopts a mass storage architecture (large scale and throughput of content)
      2. Storage in the Cache node The storage of the
        Cache node should be considered:
        1. Functionally, support for various content formats, support for partial caching
        2. In terms of performance, capacity, throughput, reliability and stability
    4. Content Management Technology
      The goal of local content management (for Cache nodes) is to improve the efficiency of content services and improve the storage utilization of local nodes.
      1. Local content indexing is the key to implementing content-aware scheduling
      2. Copy of local content. Usually, in order to improve the storage efficiency, only one copy of the same content is stored in a specific node. When the access to the content exceeds the capacity of the node, the content is distributed to other nodes.
      3. Collection of local content access status. Collect the statistical information of each content access on each node, the available service capacity of the node and the change of the content

Here is just a brief introduction to these technologies, not particularly detailed, first from the overall point of view, to have a general impression of these, which is convenient for future learning.

Note: This article refers to CDN and the four key technologies
of CDN. If you need to reprint, please indicate the source: http://www.cnblogs.com/zhuchenglin/p/8978600.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325248654&siteId=291194637