Tool of the week: p2pd
I came across p2pd and read it’s documentations briefly. I really like the idea behind it as it uses the p2p mindset and architecture to extend on video streaming either by using native HTTP or SPP (Streaming Peer-to-Peer Protocol).
I’m more interested in utilizing the using HTTP piece where clients are not required to install and utilize any special protocols/tools in order to take advantage of p2pd.
Overview
Problem description: A content provider wishes to build a CDN for hosting (large) high quality video files for VoD streaming, and is assumed to already have a generic HTTP server (such as Apache) for web pages which will handle all all non-video presentation. The p2pd based CDN is only to be used to distribute the video data, after video playback has been requested. A separate media player application will handle decoding of the video once it has been received at the client machine.
The p2pd based CDN can consist of two types of nodes; servers and caches (SCC nodes). The servers keep media files in the directory /mediafiles, which is used to publish files. The caches store downloaded files in the directory /cachefiles. All p2pd processes are here assumed to run on port 8080. A file movie.mpg distributed by the CDN would have the URL http://cdn.example.com:8080/movie.mpg.
The machines available for building the CDN are assumed to have IP addresses in the range 10.0.0.1 – 10.0.0.5, with the DNS name cdn.example.com pointing to the nodes that should be accessible by users.
Users should not be required to download any additional software, but be able to use any web browser that supports HTTP.
As described above in p2pd HTTP documentation, having Apache is sufficient out of the box to build a CDN environment to stream VoD (video-on-demand). it follows a model of server and caching servers. You’d have a single server containing the primary content and as many caching servers from which connections are made to internal server containing the content if assets are not in cache. The caching server IPs can be setup in DNS round-robin scenario to load balance them or a VIP on a hardware based device.
I think the above scenario can easily work for non-streaming purposes as well. I haven’t tested this tool but assuming the expansion of CDN works well, there is no difference serving progressive http download of mpeg assets or html/css/php etc. sites. The caching servers would use Apache and as long as that web server can run dynamic scripts (i.e php/perl etc), then building a large CDN using this same scenario would work for anything.