SourceForge.net Logo

RTP Streaming Guide for Nodezilla

This is preliminary documentation and software. Please report any problems or questions directly to the Contact address.

Table Of Contents

Introduction to the streaming module

What is RTP ?

RTP stands for Realtime Transport Protocol, and some infos are available here. With this protocol we are able to stream sound and video in an interoperable manner using UDP protocol.

What is the Nodezilla streaming module ?

This module, available since 0.4.2, is a way to achieve "hierarchical streaming". This kind of streaming allows for someone with small outbound (or upload) bandwidth (like standard xDSL or Cable users) to broadcast a video (webcams) and/or sound streams to a very high number of people.

In classical "one-to-many" streaming over the public internet (i.e. no IP multicast available) if you want to have N clients watching your stream, you must have N*X KBps of upload bandwidth (where X is the bandwidth of your stream).
With hierarchical streaming, you only need X Kbps (but of course bigger is better, as always) to feed an unlimited number of clients.

This is achieved by making clients become servers as needed. If client A connects to the streaming server (you for instance), it will start to receive the stream, occupying your upload bandwidth. But his upload bandwidth can also be used to feed someone else (or several clients, if his upload bandwidth is big enough), so another client can connect to him ... and so on.

Hierarchical Streaming Mesh

How do I use it ?

First of all, you will need the following components:

I want to create a channel

Once the Java Client has started, go to the streaming tab:

Screenshot

And click the Broadcast/Subscribe Button, and select the Create a stream Button. You will then be prompted to enter details about your channel:

Screenshot

If you're using NAT or PAT on your private LAN, then you can use the corresponding fields in this dialog box to set your public IP and PATed UDP port.

The UDP Parameters let you specify the two UDP ports where the RTP module will listen to on the machine where the Nodezilla Network Agent is running. Be sure that if you create multiple channels, they all use differents ports, and that these ports are not already used by other services on your computer.

Now click OK, and if everything goes fine, you will end up with your new stream created:

Screenshot

It is displayed in red because it's a master stream (i.e.: you created it, you're the owner) but it doesn't receive data.
Let's fix this.

We need to feed data to our relay, this is achieved using a RTP stream maker. In this guide we will use Videolan. Open Videolan, and select File->Streaming Wizard, you will end with this dialog:

Screenshot

By clicking the Open Button, you'll be allowed to select the data source for your stream (it could be mp3 playlists, or live webcam capture or sound capture ...), then you'll have to tell Videolan where to send the RTP data, that is where our master relay is waiting.

Screenshot

The UDP port to specify here, is the Stream Port used to create the master stream.

You can use the Videolan transcoding options to reencode on-the-fly your streams (i.e. reencode full quality Xvid stream to low bandwidth mpeg1 stream for instance). See the Videolan documentation for help.

You can then click Start and see what happens in the Nodezilla Client, your master stream shouldn't be red anymore, and stats should be updated with current bandwidth.

You will then need to advertise your stream through it's Magnet Link (which is a permanent link, see StreamID on the Advanced chapter for details). Right-click on your newly created stream, and select Copy as Magnet Link to retrieve the magnet on your clipboard. You can then send it to anyone, or publish it through web. A typical magnet looks like this:

magnet:?xt=urn:sha1:4f6aa7de5d1803030b2ca53ba5594f7cf4dbeb16&dn=My+New+Radio

You can also change (only on streams you created) the metainformatons (name, url, info, and metadata) and propagate updates by clicking the Broadcast Info button.

The metadata panel supports basic html syntax.

Now how to listen/watch your newly created Streams ?

Setting up Global Options

By clicking the Global Options button, you will se this dialog:

Screenshot

Here you can set where your RTP client is located on your machine, and what UDP port it will listen to for the received data. The variable ${udpPort} can be used in the command line options, it will be replaced by the specified UDP port.

You can also specify a maximum upload bandwidth that will be used by ALL relayed (master and not master) streams, 0 means no limits.

I want to listen/watch a channel

Once the Java Client started, go to the streaming tab:

Screenshot

And click the Broadcast/Subscribe Button, and select the Subscribe to a stream Button. You will then be prompted to enter a Magnet Link to an existing channel:

Screenshot

If you have a magnet to the stream you want to listen, paste it and then click OK, otherwise try through the search utility by clicking the ... button. It will display some streams actually active (or at least that has been active since the last 15 minutes) for you to select.

Once you subscirbed to a stream, it will be available on the stream manager:

Screenshot

From now on, you can also accept clients for the stream you just subscribed, depending on your available upload bandwidth.

You can then right click on it, and select the Listen option in the contextual menu. If your Global Options are configured properly, your RTP client should start and you should be able to listen to the stream.

Advanced topics

This chapter will cover some technical details of the streaming module

What are Control Port/Stream Port

The streaming module listen on two UDP ports:
  • The Control Port: It is used by the streaming core to communicate with other modules to exchange keep alive, peer informations, metadata update ... You will probably never have to deal with this port.
  • The Stream Port: It is used to received RTP data. Received data will be relayed to all connected peers. This is this port that you must use in your RTP maker software to send RTP data to the streaming module.

What is this StreamID ?

The StreamID is a unique identifier assigned to each stream at creation time. This is what is referenced by Magnet Links. It is derived from the RSA key pair created at channel's creation time. This guarantees that a given StreamID can't be hijacked by someone else. In clear, if someone you trust gave you a magnet to a stream you can be sure, that when using this magnet you will always connect to the intended stream.

If you want to be able to restore all your created streams keeping their StreamID after a disk crash for instance, be sure to backup your evl_data/rtpstream directory, as it holds your RSA keys.

Are my created channels persistant ?

Until you manually destroy a channel you created (by using the corresponding item in the contextual menu), your streams will exist when your Network Agent is started. The StreamID will be the same accross runs, and that will allow you to run your streams from different nodes (if you experience a system crash for instance), without Magnet Links to be modified.

How about anonymity ?

As you have probably guessed, the RTP Streaming Module is not anonymous, as there is a need for direct connections to peers for performance, it's quite esasy to know the IP of someone broadcasting a channel.
But, this doesn't mean that this compromise the Grid Anonymity, i.e. if you use both FileSharing service and Streaming Service, you still be anonymous on FileSharing, streaming objects published on the grid especially use different RSA keys from your node keys to avoid linking IP to IDs.