Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Why the Internet speed is getting better and better, because the hero behind the network: CDN

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >

Share

Shulou(Shulou.com)11/24 Report--

The evil god of fire cloud said: the martial arts in the world can only be broken quickly. Similarly, in modern society, if you don't pay attention to speed, you are bound to lag behind others.

With the continuous development of Internet technology and multimedia technology, network services have been inseparable from our lives, such as mobile payment, video phone. With the development of media, short video service has become the first choice for every Internet user.

However, the capacity of the video website is limited, and when providing services to people in various regions, the network access distance is too long (for example, the video server is in Beijing and the users are in Nanjing, so the transmission distance is relatively long). The link between the user and the website is suddenly congested with heavy traffic data (for example, during the Spring Festival Gala, more than a billion people across the country are connected to the video server at the same time, too many links will lead to network channel congestion) Both will lead to a rapid increase in network load, which will seriously affect the access quality of users. For example: webpage login delay, video stutter.

So, in the online world, who provides us with speed guarantee? That's our hero behind the scenes: CDN.

01. What is CDNCDN:Content Delivery Network, that is, content delivery network.

Take it apart and explain:

Content: refers to static resources.

Static resources: front-end fixed pages, do not need to check the database, do not need program processing, can directly display the page. For example: pictures, videos, documents, JS, CSS, HTML.

Distribution network: refers to the distribution of static resources to servers in different geographic locations.

The class representative concluded that CDN is to distribute static resources to many different places to achieve nearest access, so as to speed up the access to static resources and reduce the burden on servers and bandwidth.

02. The access mechanism of CDN. Now, we have learned the content of CDN. So, after CDN is deployed on the network, how exactly does CDN function when users access the server?

The working mechanism of CDN is somewhat similar to JD.com 's warehousing system. That is, goods are stored in local warehouses in advance, and when the user places an order, the goods are delivered directly from the warehouse in the city where the user is located, which shortens the logistics time.

1. The client accesses the server through a browser.

two。 The browser calls the domain name resolution library to resolve the domain name to get the IP address of the CDN cache server (that is, the edge node).

3. The browser uses the obtained IP address to issue an access request to the cache server. (analogy: the document gentleman in Nanjing placed an order on JD.com to buy a commodity A)

4. The CDN cache server determines whether there is cached content and performs the corresponding operation. (analogy: JD.com systematically checks whether there are any goods An in the storage center in Nanjing)

There is content to be cached: return the corresponding data to the client. (if there is a commodity An in the warehouse center in Nanjing, the goods will be shipped directly from the Nanjing warehousing center to the document gentleman in Nanjing.)

There is no content to be cached or invalidated: the cache server gets the content from the actual IP address (that is, the central node). After obtaining the content, on the one hand, it is saved locally for later use, on the other hand, the obtained data is returned to the client to complete the data service process. (if there is no commodity An in the warehousing center in Nanjing, the goods will be shipped from the general warehousing center to the documentation gentleman in Nanjing)

Note: the content of the edge node cache can be maintained through the CDN cache configuration, and if the central node changes, the corresponding content in the cache server becomes invalid.

5. The "client" gets the data returned by the cache server and displays it and completes the whole data request process of browsing.

03. The architecture of CDN the network architecture of CDN is composed of nodes, and each node includes a cache server (Cache) and load balancing equipment.

Three nodes of the CDN network architecture:

Central node: the CDN network management center and the DNS redirect resolution center are responsible for global load balancing and content management, and the equipment system is installed in the computer room of the management center (that is, the main server of the video website). Store all the content and provide services for users who are missed by the edge node. For example: Shenzhen.

Regional central node: all or part of the content can be stored as required to provide services for users who have missed the edge node. For example: Nanjing.

Edge node: refers to the remote node, the carrier of CDN distribution, and provides streaming media services for users nearby. For example, Yuhuatai District in Nanjing.

The composition of each node:

Cache server (Cache): responsible for storing a large amount of information about a customer's website and responding to local users' access requests like a website server close to the user.

Load balancing equipment: responsible for the load balancing of each Cache in each node to ensure the work efficiency of the node; at the same time, the load balancing equipment is also responsible for collecting information between the node and the surrounding environment, maintaining communication with the global load DNS, and achieving load balancing of the whole system.

There are three modes of CDN's network architecture:

Two-tier architecture

Three-tier architecture

Hybrid architecture

Hybrid networking architecture is the combination of two-level networking architecture and three-level networking architecture.

The scale of user development in this region is relatively small, and the secondary architecture of edge node and central node is temporarily adopted to provide services.

With the development of the number of users, when the number of users in the region reaches a certain number, add regional central nodes to provide three-level architecture services for the region.

The conclusion is so much about CDN, which can be summed up in one sentence: CDN is actually a behind-the-scenes hero, who undertakes the work of a porter, that is, moving the content to our neighborhood in advance, so that we can get the corresponding content as soon as possible.

This article comes from the official account of Wechat: ZTE documents (ID:ztedoc)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

IT Information

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report