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

5G can be unleashed through chip innovation

The arrival of 5G has brought with it an unpreced...

Spain's 5G state subsidies may exclude Huawei, Huawei appeals

On October 10th, local time on Monday, Huawei app...

CloudCone: $16.3/year-1GB/55GB/3TB@1Gbps/Los Angeles data center

CloudCone has released several Easter packages, w...

HPE acquires Athonet to expand wireless connectivity leadership

HPE (NYSE: HPE) today announced the acquisition o...

5 Essential Predictions for Blockchain Trends in 2018

The potential for blockchain technology to bring ...

Servervy: €1.5/month-2GB/10GB SSD/100M unlimited traffic/Netherlands VPS

The whois query of the domain name Servervy.com s...

IDC: Global Ethernet switch and router markets mixed in the second quarter

According to the Ethernet Switch and Router Quart...

How far can a SaaS company go? Mainly determined by these two indicators

[[356547]] To see the current status of a SaaS co...

Can 5G save operators from negative growth at the beginning of the year?

Although work has not yet been fully resumed, the...