This document describes NetServ ActiveStreaming module for live streaming of media with simple cache management implementation in NetServ routers.
NetServ is a signal driven modular network router. It breaks up the functions provided by Internet services and make these functionalities available as modular building blocks for network services. The project was conceived to address the limitations of services in the current Internet. It presents a clean state Internet architecture based on the concepts of service virtualization [1].
ActiveCDN is a video on demand (VoD) module developed on top of NetServ. For supporting live streaming we have implemented ActiveStreaming module which is installed on a NetServ router on getting a signal from the content server. Content server sends a signal to install the module when it receives a request to serve live streaming content. The NetServ router caches the content based upon the popularity of the content. Subsequent requests to content server results in redirection to the NetServ node.
The report is organized as follows:
The module is written in Java, it is divided into two main parts:
Content server contains an embedded VLC streaming server, and a servlet listening for live streaming requests. Embedded VLC streaming server is supported only on systems which support libVLC library, we have tested it on Ubuntu Linux. On Mac and Windows we can use VLC player to stream media over the network as well. With no NetServ node the requests are directly handled by streaming server.
NetServ ActiveStreaming Module is an OSGI bundle, which gets installed when content server sends a signal. When the client requests for a live stream, the request is redirected to the NetServ node, which serves the cached stream to the clients. We have implemented a simple threshold (number of active connections) based cache management scheme.
NetServ serves the client request directly from the streaming server until the threshold number of clients are reached. Once the threshold is crossed, a writer thread is spawned, which caches the stream in the file system.The client that triggers the caching and all the subsequent clients view the stream from the beginning and can switch to live stream by clicking a "Live Mode" hyperlink.
We need a VLC browser plug-in installed on the client machine to render all the live streams. There are two viewing modes in the application, by default all the live stream requests start from the beginning if the local storage at NetServ node is activated. User can go to Live Mode by clicking "View Live" button.
Control flow for 3 clients use cases, with following settings:
ContentServer():
map = NetServNodeMap
file = getFileRequest()
client = getClient()
node = checkNodes(client)
if (node is not present):
start a new thread:
node = initialize netserv setup
if(node):
map.add(node)
return directURL(file)
else:
return sendRedirect(node)
NetServNode():
T = Threshold value
map = cacheVideo map
url = recieveRequest()
if (url NOT in map):
cv = new VideoCache(url)
map.add(cv)
cv.activeConnections += 1
if (cv.activeConnections < T):
return URLReader(url)
else if (cv.activeConnections == T):
start writer thread and start saving to local
cache.
return URLReader(url)
else if (cv.activeConnections > T):
return FileReader(url)
Testing is done with 1 physical machine running Mac OS X 10.6 and 2
Ubuntu 10.10 virtual machines running on
Virtual Box
. The physical machine is used as the streaming server & content server. One of
the virtual machines is used as a netserv node and the other virtual
machine is used as client.
New technologies that can be tested on top of NetServ architecture.
[1] Srinivasan S, Lee J W, Liu E, Kester M, Schulzrinne H, Hilt V, Seetharaman S, Khan A, "NetServ: Dynamically Deploying In-network Services", ACM ReArch '09 (CoNEXT workshop), December 2009.
[2] Meeyoung Cha, Haewoon Kwak, Pablo Rodriguez, Yong-Yeol Ahn, Sue Moon, "I Tube, You Tube, Everybody Tubes: Analyzing the World’s Largest User Generated Content Video System"
[3] Phillipa Gill, Martin Arlittz, Zongpeng Li, Anirban Mahanti, "YouTube Traffic Characterization: A View From the Edge"
[4] VLC Java Bindings - http://code.google.com/p/vlcj/
[5] VLC Http Streaming - http://www.videolan.org/doc/streaming-howto/en/ch02.html