Introduction to CDN: Principles, Functions, and Global Load Balancing
This article provides a comprehensive overview of Content Delivery Networks (CDN), explaining their definition, core principles, key functionalities, service models, and the mechanisms of global server load balancing (GSLB) including DNS‑based, HTTP‑redirect, and IP‑spoofing approaches, along with common selection strategies.
CDN Overview
CDN stands for Content Delivery Network, a smart virtual network built on top of the existing Internet infrastructure. By deploying edge servers worldwide and using load balancing, content distribution, and scheduling modules, a CDN enables users to retrieve content from the nearest server, reducing congestion and improving response speed and hit rate.
In simple terms, data is placed on geographically distributed servers, and load‑balancing technology directs users to the nearest server.
CDN Principles
The basic principle of a CDN is to use many cache servers distributed in regions where user traffic is concentrated. Global load‑balancing directs user requests to the nearest healthy cache server, which then serves the content directly.
Global Load Balancing allows sites with servers in multiple regions to be accessed via a single IP address or domain name, ensuring users connect to the nearest server for the fastest access.
The core idea is to avoid Internet bottlenecks that affect transmission speed and stability, delivering content faster and more reliably by routing requests to the nearest node based on network traffic, node load, distance, and response time.
CDN Functions
Save backbone bandwidth and reduce bandwidth demand.
Provide server‑side acceleration, preventing overload from high traffic.
Cache web pages and objects locally, reducing outbound bandwidth and improving response time.
Mitigate uneven site distribution and lower construction and maintenance costs.
Reduce the impact of traffic spikes and improve network stability.
CDN Service Model
A CDN is a strategically deployed system comprising distributed storage, load balancing, request redirection, and content management. Content management and global traffic management are the core components. By evaluating user proximity and server load, the CDN delivers content efficiently.
The caching server (or surrogate) sits at the network edge, typically one hop from the user, acting as a transparent mirror of the origin server.
Global Server Load Balancing (GSLB)
GSLB balances traffic among server groups located in different geographic locations. It enables global users to access the nearest server using a single IP or domain name.
Server‑Group Selection
The key to GSLB is selecting the appropriate server group for a client, based on proximity and load.
Proximity is measured by physical distance or hop count, using static IP mapping or dynamic detection. Load assessment considers overall group load, connection limits, average response time, and service quality.
Common GSLB implementations include DNS round‑robin, HTTP redirection, and IP spoofing (triangular routing), each directing users to the optimal service IP.
DNS‑Based GSLB
Users first resolve the domain via DNS. The DNS query may traverse multiple name servers before returning an IP. A GSLB device can act as the authoritative DNS server, returning the IP of the best server group.
DNS‑Based GSLB Pros and Cons
Pros: Simple implementation, low cost.
Cons: Accuracy depends on the client’s DNS resolver location, which may not reflect the actual user’s position.
HTTP‑Redirect GSLB
To improve accuracy, GSLB can use HTTP 302 redirects. After DNS resolves the GSLB device’s IP, the device selects the optimal server and redirects the client to that server’s IP, capturing the client’s real IP address.
Pros: Accurate client IP, solves DNS‑based inaccuracy.
Cons: Works only for HTTP traffic.
IP‑Spoofing (Triangular Routing) GSLB
For non‑HTTP protocols, IP‑spoofing redirects traffic at the IP layer. The GSLB device receives the client’s request, forwards it to the chosen server, and rewrites the source IP to its own before sending the response back, making the client unaware of the intermediate hop.
Pros: Supports all protocols (HTTP, FTP, etc.).
Cons: Slightly higher latency due to additional hop.
Server‑Group Selection Strategies
Typical GSLB selection strategies include:
Geographic or custom user regions: map IP prefixes to regions and assign users to healthy sites based on their DNS resolver IP.
IP‑address weighting: assign traffic weights to each IP in DNS responses.
Round‑Trip Time (RTT): measure latency to each server group, using either active (DNS/ICMP probes) or passive (observing TCP handshake times) methods.
Active RTT may be blocked by security policies and generates extra traffic, while passive RTT measures actual user experience without additional probes.
IT Architects Alliance
Discussion and exchange on system, internet, large‑scale distributed, high‑availability, and high‑performance architectures, as well as big data, machine learning, AI, and architecture adjustments with internet technologies. Includes real‑world large‑scale architecture case studies. Open to architects who have ideas and enjoy sharing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.