How does CDN work? Do you know?

How does CDN work? Do you know?

A content delivery network (CDN) is a set of servers (also called edge servers) distributed in different geographical locations that can quickly deliver static and dynamic content . Let's take a look at how it works.

Suppose Bob, who lives in New York, wants to access an e-commerce website deployed in London. If the request is sent to a server located in London, the response will be quite slow. Therefore, we deploy a CDN server near where Bob lives, and the content will be loaded from the nearby CDN server.

The following diagram illustrates this process.

picture

first step

Bob types www.myshop.com into his browser, and the browser looks up the domain name in its local DNS cache.

Step 2

If the domain name does not exist in the local DNS cache, the browser goes to the DNS resolver to resolve the domain name. The DNS resolver is usually located in the Internet Service Provider (ISP).

Step 3

The DNS resolver recursively resolves the domain name. Finally, it requests the authoritative name server to resolve the domain name.

Step 4

If you don't use CDN, the authoritative name server will return the IP address of www.myshop.com. But after using CDN, the authoritative name server will have an alias pointing to www.myshop.cdn.com (the domain name of the CDN server).

Step 5

The DNS resolver asks the authoritative name server to resolve www.myshop.cdn.com.

Step 6

The authoritative name server returns the domain name www.myshop.lb.com for the CDN load balancer.

Step 7

The DNS resolver asks the CDN load balancer to resolve www.myshop.lb.com. The load balancer selects the best CDN edge server based on the user's IP address, the user's ISP, the content of the request, and the server load.

Step 8

The CDN load balancer returns the IP address of the CDN edge server to www.myshop.lb.com.

Step 9

Now we finally have the actual IP address we want to access. The DNS resolver will return the IP address to the browser.

Step 10

The browser accesses the CDN edge server to load content. There are two types of content cached on the CDN server: static content and dynamic content. The former includes static pages, pictures, and videos; the latter includes the results of edge computing.

Step 11

If the edge CDN server does not have the content in its cache, it is uploaded to the regional CDN server. If the content is still not found, it goes up to the central CDN server or even to the origin - the London network server. This is called a CDN distribution network, where servers are deployed geographically.

How to prevent videos cached on CDN from being pirated?

  • Video encryption and watermarking

Encryption: Encrypt the video file so that only authorized clients can decrypt and play it. Standard encryption algorithms such as AES can be used.

Dynamic Watermark: Add traceable dynamic watermarks to videos, which change as the video plays, allowing the pirated version to be traced back to its source.

  • Signature and token verification

Use signatures and tokens to ensure that each request is authenticated. For example, add a timestamp and cryptographic signature to the video link to ensure that it is only valid within a specific time period and that unauthorized requests are rejected.

  • Limit cache duration

Set a shorter cache expiration time to avoid long-term storage of video content on CDN nodes. By controlling TTL (Time To Live) or cache clearing strategy, the cache survival time of the video can be reduced, thereby reducing the risk of piracy.

  • Anti-hotlink

Configure CDN and servers to restrict the sources of access to video content. For example, use HTTP Referer header check to ensure that only requests from legitimate websites or applications can access the video.

<<:  Telecommunications industry survey: AI will become the top investment area in 2025

>>: 

Recommend

Five-minute K8S practice - using Ingress

background Technology, life, opinions, originalit...

Huawei Releases B2B Private Line Strategy for Carriers to Enable New Growth

[Hangzhou, China, October 18, 2017] Today, the 4t...

The secrets of the black industry: the things about the "coding platform"

Introduction The rapid development of Internet bu...

2021 China Internet Haha List 4: Top Ten Figures

2021 is a year of rapid change in the field of sc...

Huawei: 5G+AI opens a new era of smart city twins

On November 15, the "Huawei Smart City Summi...

5G network construction 80%: 5G robots are about to usher in a new turning point

Recently, according to CCTV News, China had compl...

Do you know the characteristics of 5G core network (5GC)?

[[333327]] 3GPP defines the 5G core network as a ...

SD-WAN industry development requires VNF evolution

Like any successful technology, the Software Defi...

Several steps and tools for troubleshooting the network

Let me ask a question first. If one day you sudde...

What is the relationship between NFV and SDN?

NFV and SDN are popular technologies that have em...

Network Automation: The Core Competitiveness of Operators in the 5G Era

[[327272]] What is the core competitiveness of op...