Using Content Delivery Networks


Most businesses that create content for the Internet use a third-party hosting service to handle distribution to end users. This includes both businesses that use their Internet presence as an extension of their primary business and e-businesses that rely entirely on the Internet. In the early days of the Internet, site owners often built and maintained their own servers. Today, however, the Internet is very different: there are many more sites, bandwidth requirements are higher, the technology required to construct a site is more complex, businesses demand reliability and more security, there are many more end users, and they demand low latency and rich content. It is still possible to do it yourself, but it often makes more sense to delegate that task to a service that specializes in the delivery of content.

The business of delivering content has grown and become specialized. Most commercial sites are no longer hosted on a single server, but employ a hosting service that uses many servers interconnected to provide reliability and speed. They also use other devices, like firewalls, to improve security. There are specialized servers that handle only certain types of applications, such as e-commerce, licensing, and streaming media. There are specialized storage devices that hold large amounts of data, and backbones that transfer billions of bits per second. In order to compete as a hosting service today, a business must make huge investments in hardware and infrastructure and needs a team of professionals with the expertise to plan and build reliable solutions. For a business focused on creating content, it is more cost-effective and productive to contract with a service that has the hardware and infrastructure, and that understands the complex business of hosting large volumes of data on the Internet. These services are often called content delivery networks (CDNs).

CDN Concepts

Possibly the greatest recent advance in distribution technology has been in the development of systems that decentralize the hosting of content. The concept of decentralization is easy to grasp. The closer a client is to a server, the faster and more reliably the client will be able to access and receive content, and the less it will impact network resources. Decreasing the distance between client and server is good for the network and the end user. Decentralized distribution is often called “edge serving” because the servers are located closer to the edge of the network—closer to the users.

The traditional approach to hosting content is the centralized configuration shown in figure 12.4. The route that data must take to get from server to client can be very long and can pass through many routing devices on the way. Every device that data must be routed through, and every mile of cable that data must travel, adds to the potential latency a client experiences. Also, it is more likely that data will be received with missing or corrupt packets. These problems can be very annoying for end users, especially when attempting to stream a video, for example.

click to expand
Figure 12.4: A traditional, centralized network.

Figure 12.5 shows how decentralizing distribution solves these problems. In a decentralized solution, multiple servers are located at the edges of the network. By delivering data from an edge server, problems that occur in the first mile, with backbone devices and ISP peering, are greatly reduced. Multiple servers also help balance server load. End users are more likely to receive a high-quality stream if it is coming from a computer that is servicing fewer clients.

click to expand
Figure 12.5: A decentralized content delivery network.

Edge serving has been combined with other technologies and given the umbrella name “content delivery network.” A true CDN is a business that provides a large-scale deployment of edge servers, such as nationally or globally, and provides technology, often referred to as intelligence, that redirects clients based on a number of criteria, in order to optimize server and network load.

Streaming with CDNs

CDNs are particularly advantageous for the delivery of streaming media content. When streaming, a server must maintain a continuous connection with a client, not only sending each client a steady stream of packets, but resending packets that are not received properly and handling client requests, such as changing streams, pausing, and seeking.

By using the decentralized design and intelligent redirection of a CDN, network congestion and server load can be managed. Also, problems that occur in one area do not affect other areas. The job of the main (or origin) server is no longer to host content for all clients. The origin server is used primarily to distribute content to the edge servers, and to host light content, such as small files. The heavy content, such as large, high-bit-rate streaming media files and images, are delivered from the edge. Network resource usage is minimized and the end user experience is improved. By locating numerous edge servers in areas that handle a heavy volume of Internet traffic, the amount of traffic can be reduced and end users receive content faster and more reliably.

A number of processes are used for redirecting client requests to edge servers. A common way to do this is to use the client IP address to find the closest edge server. CDNs also use a number of techniques, many of them proprietary, for locating the closest server and redirecting clients to the server with the least load and best network conditions.

If you are a content provider, you can think of the CDN that is hosting your content as a black box. All you need to care about is that the content you create gets to the client, and the end user experience is the best it can be. However, there are three concepts that will help you understand how a CDN does its job, so you will understand how to better work with your CDN.

  • Cache/proxy servers intercept client requests and stream content locally.

  • Prestuffing enables you to copy content to edge servers in anticipation of playback requests.

  • Stream splitting enables you to deliver broadcast content.

Cache/Proxy Servers

Edge servers are a type of cache/proxy server: they cache content and proxy requests. By “proxy” we mean the server intercepts requests from clients and attempts to handle them locally. By “cache” we mean the cache/proxy server saves content locally.

A typical cache/proxy server scenario works like this:

  1. An end user requests content from the origin server.

  2. The cache/proxy server intercepts the request and attempts to deliver the content from its cache.

  3. If the content is not cached, the cache/proxy server directs the request to the origin server.

  4. As the origin server streams the content to the end user, the cache/proxy server adds a copy to its own cache.

  5. A second end user requests the same content from the origin server.

  6. The cache/proxy server intercepts the request and streams the content from its local cache.

Prestuffing

If it is known that a file will receive a high number of plays, it can be preloaded (or prestuffed) on the edge servers before a client requests it. By prestuffing content, the CDN can head-off client requests and minimize streaming from the origin servers. It is even possible to have a very simple origin server configuration on a relatively slow connection, and plan on prestuffing all content automatically. Using this system, the origin server is accessed from the Internet only one time, to copy the files on it to the edge servers.

Stream Splitting

The caching system only works if the digital media or other content is a file. To handle live streaming, another approach is needed because it would not make sense for edge servers to cache a broadcast. For example, caching the stream from a movie info channel or a 24-hour news service would not be the right solution for hosting a live stream from an edge server. This is not to say there is no value in a content provider archiving a broadcast so that it can be streamed on-demand as a file afterwards. However, in that case, the archived file would be handled like any other file.

To handle a broadcast stream, edge servers use a system called stream splitting. The system is patterned after the cache/proxy system described earlier, except the stream is not cached; it is split so that one stream from the origin server feeds multiple clients.

A typical stream-splitting scenario works like this:

  1. An end user requests a broadcast from the origin server.

  2. The cache/proxy server intercepts the request.

  3. If this is the first request for the broadcast, the cache/proxy server sends the request to the origin server and then redistributes the stream to the client.

  4. A second end user requests the same broadcast from the origin server.

  5. The cache/proxy server intercepts the request and splits the stream, thereby serving both clients.




Microsoft Windows Media Resource Kit
Microsoft Windows Media Resource Kit (Pro-Resource Kit)
ISBN: 0735618070
EAN: 2147483647
Year: 2005
Pages: 258

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net