NetServ: Extending ActiveCDN with SMIL

Dhruva L Batni
Columbia University
New York
dlb2155@columbia.edu

Abstract

The aim of the project is to demonstrate the use of SMIL (Synchronized Multimedia Integration Language) as a part of ActiveCDN module to integrate different media objects.

Introduction

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 NetServ application. ActiveCDN module 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 some content. The NetServ router also caches the content. Subsequent requests to content server results in redirection to the NetServ router where the content is cached.

SMIL [2] is a multimedia integration, html like language. It is typically used for multimedia presentations which integrate audio, video with images, text or any other media type. In this project, we demonstrate how SMIL can be used to integrate different media objects on a NetServ router. This is done by extending the current ActiveCDN module implementation. In the current implementation Xuggler [3], a Java library, is used to do text overlay. Instead of this, we generate a SMIL presentation file which integrates different media along with the original video requested.

Architecture

The module which serves the SMIL file is implemented as a Java servlet process. It receives the video requests and serves a SMIL file. It also fetches the video from the content server and caches it.

The architecture is a bit different from the actual NetServ architecture. The following are the differences -
1) There is no on path signalling.
2) The request for the video is sent directly to the NetServ node.

This deviation however, does not matter too much as we will see later it is a simple task to integrate the changes into the actual NetServ code.

The main components are a content server, a NetServ node running a servlet process, Ambulant plugin to Firefox browser using which the user requests for videos. Ambulant[4] is an open source SMIL player which supports SMIL 3.0 standard. The NetServ node stores a repository of text and video advertisements. For each video request, it fetches the local weather information and also latest news feed from BBC. IP address to geo location conversion is done by using IP address geo location service provided by IPInfoDb. The latitude and longitude information from IPInfoDb is then used to fetch zipcode for the geo location using the service provided by Yahoo!. The zip code is then used to fetch weather information using weather.com XML APIs. Sample requests are shown below -

1) BBC news feed - http://www.bbc.co.uk/news/rss.xml
2) IP address to geo location - http://api.ipinfodb.com/v2/ip_query.php?key=<api-key>
3) latitude / longitude to ZIP code - http://where.yahooapis.com/geocode?location=40.7619-73.9763&gflags=R&appid=<appid>
4) ZIP code to weather data - WeatherGateway.getFullForecast() API.

All XML data are parsed with SAXBuilder class of JDOM Java library.[5]

Control flow

A. Handling of the first request for the video

  1. First request is when the video is not in the NetServ node's cache. The servlet process in this case takes two actions explained below.
  2. It generates a straight forward SMIL file which just points to the video on the content server and responds to the user with the file.
  3. It downloads the video from the content server and caches it.

B. Handling of the subsequent requests for the video

  1. When the requested video is found in the cache, the servlet process generates a SMIL file pointing to the video found in cache. Along with this, it also fetches weather data and latest scrolling news feed and adds them to the SMIL presentation. It also adds a video advertisement.
  2. The video advertisement is randomly selected from a set of videos and inserted at a particular position in the original video.
  3. NetServ node runs a lighttpd server to serve the cached video when the request comes from Ambulant.
  4. The final presentation is as listed below

Simplified psuedocode

Server() {

  video = recieveRequest()

  if (video NOT in cache) {

   GET(content-server/video)

   return (generateSMIL(content-server/video))

  }

  else {

   news = GET("www.bbc.co.uk/news/rss.xml")

   weather = WeatherGateway.getFullForecast()

   advt = SELECT-RANDOM(ad-videos)

   return (generateSMIL(cached-video/video, news, weather, advt))

  }

}

Important SMIL tags

  1. <video src> - URL of the video to be played. This is used for both original video and video advt.
  2. <text src> - URL of the text file to be displayed.
  3. <par> - Play the media objects parallely.
  4. <region> - To control the position, size and scaling of media object elements.
  5. <smilText> - Supports inline text elements in a SMIL presentation.
  6. <textStyle> - Defines a style to display texts.

Integration into NetServ

To integrate into NetServ code, all we need to do is replace the ActiveCDN module in NetServ with this code minus the servlet process. Everything else remains same. When the on path signal is received from the content server, the new ActiveCDN with SMIL generation capability is installed.

Sample SMIL output

The below shown sample SMIL file is generated when the video is found in the cache of the NetServ node. As we can see, all the media objects mentioned previously are present in the SMIL file.
Note: News feed has been deprecated to create a smaller image.

Testing

Testing was done with 1 physical machine running Ubuntu 10.04 and 2 virtual machines running the same version of Ubuntu. Virtual Box was used to run virtual machines. The physical machine was used as the user machine running Ambulant plugin on Firefox browser. One of the virtual machines hosted the content server and the other virtual machine hosted the NetServ node running servlet process.

Screenshots

  1. Initial part of the video with weather information overlaid.

  2. Video advertisement being played.

  3. Rest of the video with latest BBC news feed scrolling.

Future work

  1. Generate more dynamic SMIL files. Right now the position of the text displayed (i.e. weather data and news feed) is fixed. This can be made dynamic as in depending on the video requested, the position of the text can be adjusted based on the video resolution. Video resolution data can be obtained by using a Java library like Xuggler [3].
  2. Use different weather API to reduce the number of dependencies.

Acknowledgments

I would like to thank Prof. Henning Schulzrinne for giving me an opportunity to work on this project and also guiding all along. I would also like to thank Suman Srinivasan for supervising and also providing valuable inputs whenever required.

References

[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] SMIL
[3] Xuggler
[4] Ambulant
[5] JDOM