CDN Scheduling Systems are a set of algorithms and mechanisms that manage user requests within a Content Delivery Network (CDN). These systems play a crucial role in ensuring optimal performance, fast content delivery, and a high-quality user experience. They consider several factors when routing requests, such as the geographic location of the user, the server's current load, and the health status of the server. CDN scheduling systems also manage and balance network traffic, preventing a single server from becoming overloaded with too many requests, which could potentially slow down or disrupt service.
In addition to traffic control and quality control, CDN scheduling systems are responsible for cost control and fault handling. They can direct traffic in a way that minimizes bandwidth usage and reduces operational costs. Furthermore, these systems can handle fault tolerance by automatically rerouting requests to another healthy server, ensuring uninterrupted service when a server goes down or experiences issues. Overall, CDN scheduling systems are a critical component of Content Delivery Networks, contributing to efficient content delivery and seamless user experience.
Before explaining the scheduling principle, let's take a look at how customers access CDN, or how the customer's traffic input and switching to CDN. (Assuming the customer's domain name is: www.test.com, there are roughly the following ways.)
The CNAME method is the most common access method, that is, the CDN manufacturer provides a scheduling domain name to the customer, and the customer sets the CNAME of their business domain name to this scheduling domain name, thereby realizing the request to be guided to the CDN.
Tencent Cloud provides customers with CDN as $domain.cdn.dnsv1.com, and the customer's domain name is www.test.com. If you need to switch the request to Tencent Cloud CDN, you only need to set the CNAME of www.test.com to www.test.cdn.dnsv1.com.
This mode is mainly for some agent customers, that is, using Tencent Cloud CDN to accept customers and want to hide the CDN manufacturer they use at the DNS level. The general practice is for the customer to provide their domain name, such as gslb.mycdn.com, and Tencent Cloud also provides a neutral and unregistered platform scheduling domain name glsb.mycdn-platform.com. The real customer domain name www.test.com is CNAME to glsb.mycdn.com, and the latter is CNAME to Tencent Cloud's scheduling domain name glsb.mycdn-platform.com. In this way, the entire resolution cache has no trace of Tencent Cloud.
This mode is uncommon. Taking the domain name www.test.com as an example, if the customer needs to switch the request to CDN, they need to change the NS record of test.com to the NS authoritative server provided by the CDN manufacturer. At this time, the CDN manufacturer plays the role of both the DNS service provider and the CDN service provider.
DNS Scheduling | DNS scheduling is based on the exit IP attribution and operator attributes of the requested local DNS. |
302 Scheduling | 302 redirect scheduling based on the client IP attribution and operator attributes. |
Routing Scheduling | Data center traffic scheduling based on Anycast technology. (BGP routing). |
The scheduling server of the CDN is the NS authoritative server for the scheduling domain, and the TTL of the scheduling domain is deliberately set to be very short. (e.g., three minutes). This ensures that all requests frequently trigger the client's local DNS to resolve a new IP address from the CDN's scheduling server. At this point, the scheduling server relies on the exit address of the local DNS. The DNS scheduling process is as follows:
Scenario:
Access URL | http://p73.ping.dnsv1.com/a.php |
Test machine exit IP | 113.87.117.154 |
DNS server | 202.96.134.133 / 202.96.128.166 |
DNS exit address | 202.96.136.240 |
Target domain name resolution | The DNS resolution of p73.ping.dnsv1.com is as follows: p73.ping.dnsv1.com
|
DNS Scheduling Principle:
Advantages and Disadvantages of DNS Scheduling:
Advantages | Simple and easy to use |
Transparent to users | |
Good client compatibility | |
Disadvantages | Non-real-time scheduling policy implementation. (DNS is a tree-like distributed system and all nodes cache based on the domain name's TTL.) |
Inaccurate scheduling. (A large number of local DNS servers do not support the EDNS protocol, so they cannot obtain the client's real IP address; most of the time, CDN can only make decisions based on the local DNS IP, which is sometimes unreliable.) |
Now let's see what's different between the 302 mode and the previous DNS scheduling.
(http://p73.ping.dnsv1.com/a.php)
In the DNS resolution scheduling mode, when the browser accesses the above URL, under normal circumstances, it will receive a return code 200 and file content from the CDN node, which means the IP resolved by DNS will directly act as the file server responding to the browser request. It's similar to:
HTTP/1.1 200 OK
Server: NWS_S1
Connection: keep-alive
Date: Sun, 11 Dec 2018 19:44:02 GMT
Transfer-Encoding: chunked
Keep-Alive: timeout=120
X-Daa-Tunnel: hop_count=2
X-NWS-LOG-UUID:750246221628030518 0be2170ce2df3d9f634cd70470120401
\r\r\r\n File Content
However, in the 302 redirect mode, when accessing the above URL, the browser will receive a response with a status code of 302:
HTTP/1.1 302 Moved Temporarily
Server: stgw/1.3.6.2_1.13.5
Date: Sun, 16 Dec 2018 19:38:58 GMT
Content-Type: text/html
Content-Length: 168
Connection: keep-alive
Location: http://61.142.166.245/p73.ping.dnsv1.com/a.php
This means telling the browser that it needs to continue to request the actual file content from the URL in the Location. So the browser initiates the second request:
http://61.142.166.245/p73.ping.dnsv1.com/a.php
The IP address in this URL is the CDN node allocated by the CDN scheduling system. Let's see how this IP is obtained.
The process of domain name resolution in 302 redirect mode is the same as DNS-based scheduling, and a group of IPs will be obtained in the end. There are two possible situations for the target IP: 1) The target IP is not the actual edge node of the CDN, but the IP of the 302 scheduling cluster; 2) The IP is a common edge node IP of the CDN.
Advantages | Real-time scheduling (the final IP obtained each time is the result of real-time calculations, so the scheduling strategy takes effect in real time). |
High accuracy (can obtain the exit IP of the request, which makes the client's location closer to the actual situation when not considering NAT or small ISP exit drift, and is not affected by the user's DNS configuration). | |
Disadvantages | Business compatibility (requires the client of the customer's business to support 302 redirects, such as mobile phone firmware or app downloads; if the download client does not recognize the HTTP 302 response code, the download will fail). |
Not suitable for latency-sensitive businesses (each request will involve an additional HTTP interaction, causing the loading time to increase significantly, which is not suitable for web static small resources). |
Therefore, 302 is only suitable for large file download services with good client compatibility.
At this point, you might wonder, what are the benefits of real-time scheduling? After consulting with technical experts from Tencent EdgeOne, it was found that real-time scheduling can:
Anycast routing technology allows physically distributed servers across the globe or different regions to have the same IP address. Client requests for this IP will be guided to the nearest physical server at the routing level.
Anycast BGP routing scheduling mode is similar in appearance to DNreal timeS scheduling:
However, there are also unique features:
Advantages and disadvantages of Anycast routing scheduling:
Advantages | Low DNS resolution performance requirements for CDN authoritative servers (few fixed IPs, long TTL). |
More resistant to interference than DNS and has better compatibility than 302. (CDN nearby access is completed at the routing level.) | |
Fast route policy change implementation, is better than DNS scheduling. | |
When under a DDOS attack, you only need to adjust the route to guide the attack traffic to a high-bandwidth cleaning data center, without removing IPs from the network. | |
Disadvantages | Complex solution (complex network-wide networking, tedious BGP route optimization, prone to network disconnection, longer request latency). |
The high cost (Anycast implementation requires a complete IPC segment and severe IP waste, and to achieve good results and withstand attacks, global data centers need to have sufficient bandwidth). |
Tencent EdgeOne, as a next-generation CDN, not only provides acceleration but also offers advanced CDN and scheduling policies. These allow for a flexible and efficient way to manage network traffic, which ultimately contributes to a more reliable and faster user experience. Here's an extension of more CDN Scheduling services EdgeOne can provide combined with the provided information:
The above Traffic Scheduling Policies will make the overall CDN management and load balancing a breeze with EdgeOne, making it a truly next-generation provider of CDN services. EdgeOne ensures your content is both readily accessible and resonates with your audience, no matter where they are in the world. If you are interested in experiencing these benefits firsthand, feel free to contact us to learn more about Tencent EdgeOne and its features. You can also click here to get started free and experience its benefits firsthand.