The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Поиск:  Каталог документации

Next Previous Contents

2. Overview of the existing streaming solutions

In this section, we assume that :

2.1 Unicast

What is unicast and why use it ?

Unicast is a simple protocol : the packets are sent directly from one machine to another. With VideoLAN, this mean that the source IP address is the one for the server machine, and the destination IP address is the one for the client machine. With unicast, the stream can go through routers without any problem.

Unicast should be used when you want to send the stream to one client machine only. It is also used for Video on Demand.

Network hardware required

No special feature or configuration of your network hardware is required.

The only problem is the bandwidth. As explained in the introduction , an MPEG 1 or 2 stream needs between 3 and 9 Mbit/s. So a 10 Mbit/s Ethernet network should be enough. 100 Mbit/s would be needed if you want to stream several videos at the same time or stream one big DVD stream (a DVD stream can go up to 11 Mbit/s if there are many languages, subtitles and multiple angles).

Server configuration

You can either use vlms or vls to do unicast.

vlms

vlms can only stream valid MPEG PS files stored on a hard drive.

You can download this streamable MPEG 2 PS file for your tests : ftp://ftp.videolan.org/pub/videolan/streams/presentation/presentation_short.vob.

In the example below, the IP address of the client machine is 10.0.0.2. The name of the MPEG file is called MPEG_file_name.

Run vlms :

% vlms -d 10.0.0.2 MPEG_file_name

If you want the server to stream the file continuously, you can use the -l option :

% vlms -d 10.0.0.2 -l MPEG_file_name
or if you want to send it 3 times use the option -n 3 :
% vlms -d 10.0.0.2 -n 3 MPEG_file_name

vls

Modify the configuration file vls.cfg by adding the following :

BEGIN "Channels"
   net1 = "network"
END

BEGIN "net1"
    Domain = "Inet4"
    Type = "unicast"
    DstHost = "10.0.0.2"
    DstPort = "1234"
END

Then, restart vls and start to stream a video to "net1".

Client configuration

On the client, run vlc with this command line :

% vlc udp:

You can also use the interface :

% vlc
and then click on "Net" and select "UDP".

2.2 Broadcast

What is broadcast and why use it ?

Broadcast is a very dirty method to stream video : the stream is sent to all the machines of a subnet at the same time. With VideoLAN, this means that the source IP address is the IP address of the server, and the destination IP address is the broadcast IP address of the subnet. Broadcast is considered a dirty method because all the machines of the subnet receive the stream, even the machine that don't want to watch the stream. It creates a lot of pollution on the network and some devices don't like to receive too much broadcast.

So broadcast should be used to stream video to multiple clients at the same time only if your network hardware doesn't support multicast (see next subsection).

Network hardware requirements

No special feature or configuration of your network hardware is required. It only needs to have the necessary bandwidth, as for unicast.

Server configuration

You can either use vlms or vls to do broadcast.

vlms

In the example below, the broadcast IP address of the subnet is 10.0.0.255. The name of the MPEG file is called MPEG_file_name.

Run vlms :

% vlms -d 10.0.0.255 MPEG_file_name

If you want the server to stream the file continuously, do :

% vlms -l -d 10.0.0.255 MPEG_file_name

vls

Modify the configuration file vls.cfg by adding the following :

BEGIN "Channels"
   net1 = "network"
END

BEGIN "net1"
    Domain = "Inet4"
    Type = "broadcast"
    DstHost = "10.0.0.255"
    DstPort = "1234"
END

Then, restart vls and start to stream a video to "net1".

Client configuration

On the client, run vlc with this command line :

% vlc udp:

You can also use the interface :

% vlc 
and then click on "Net" and select "UDP".

2.3 Multicast

What is multicast and why use it ?

When you use unicast or broadcast, you can encounter the following problems :

The above problems are why the multicast protocol was invented. With multicast, the packets are sent on the network to a multicast IP group which is designated by its IP address. Multicast IP addresses belong to the Class D : 224.0.0.0 -> 239.255.255.255.

The machines can join or leave a multicast group by sending a request to the network. The request is usually sent by the kernel of the operating system. Linux (if the option "IP multicast" in the category "Networking options" is activated in the configuration of the kernel), Windows (at least 98, 2000 and XP) and MacOS X support multicast. The vlc takes care of asking the kernel of the operating system to send the join request.

The network devices do everything necessary to keep in memory which machine belongs to which group and forwards the stream to the client. It is possible for one client to belong to several groups.

Below is a scenario given as an example :

  1. vls sends a stream to the multicast IP address 239.255.12.42. Client n╟1 and n╟2 already joined the multicast group and receive the stream.
    Server (vls)            Network                 Clients (vlc)
    
    stream  --------------> 239.255.12.42 ----------> client n╟1
                                            |
                                            --------> client n╟2
    
  2. Client n╟3 sends a "join" request to the multicast group in order to receive the stream.
    Server (vls)            Network                 Clients (vlc)
    
                                    <-------------- client n╟3
                                    join 239.255.12.42
    
  3. Client n╟3 now receives the stream.
    Server (vls)            Network                 Clients (vlc)
    
                                            --------> client n╟1
                                            |
    stream  --------------> 239.255.12.42-----------> client n╟2
                                            |
                                            --------> client n╟3
    
  4. Client n╟1 sends a "leave" request to the multicast group.
    Server (vls)            Network                 Clients (vlc)
    
                                    <-------------- client n╟1
                                    leave 239.255.12.42
    
  5. Client n╟1 doesn't receive the stream any more.
    Server (vls)            Network                 Clients (vlc)
    
    stream  --------------> 239.255.12.42 ----------> client n╟2
                                            |
                                            --------> client n╟3
    

Network hardware required

Be careful ! Make sure that your network devices support multicast.

If they do not, you will have the same effect as broadcast. For example, hubs do not support multicast : if a machine connected to a hub joins a multicast group, all the machines connected to the hub will receive the stream.

Please refer to the management guide of your switches and routers to see if they support multicast. All the recent manageable switches and routers of the big network hardware manufacturers support multicast. This document does not explain how to configure your network because it is specific to each manufacturer.

Server configuration

You can either use vlms or vls to do multicast.

vlms

Put the multicast IP address as the destination address :

% vlms -d 239.255.12.42 MPEG_file_name

Increase the TTL (Time To Live) value if you want your multicasted stream to go through several routers. Every router decreases the TTL by 1, and a stream can't go through a router if its TTL is 1. For this, use the -t option :

% vlms -d 239.255.12.42 -t 12 MPEG_file_name

vls

In the configuration file vls.cfg, put the multicast IP address in the DstHost field and "multicast" in the Type field.

Do not forget to increase the TTL (Time To Live) if you want your multicasted stream to go through several routers.

BEGIN "Channels"
   net1 = "network"
END

BEGIN "net1"
    Domain = "Inet4"
    Type = "multicast"
    TTL = "1"
    DstHost = "239.255.12.42"
    DstPort = "1234"
END

Then, restart vls and start to stream a video to "net1".

Client configuration

On the client, run vlc with this command line :

% vlc udp:@239.255.12.42

You can also use the interface :

% vlc 
and then click on "Net" and select "UDP Multicast" and write the multicast IP address "239.255.12.42".

2.4 Unicast IPv6

Basics

You should already have IPv6 configured on the client and server machines and on your network. For more information see the Linux IPv6 howto.

Unicast IPv6 was only tested under Linux, so we cannot tell if it works on other platforms. If you use another operating system with IPv6, please send us your feedback.

Server configuration

IPv6 is NOT supported by vlms. You must use vls.

In the configuration file vls.cfg, you have to change the destination IP address to an IPv6 address, and tell the system that you want to stream using IPv6. Here is sample partial vls.cfg :

BEGIN "Channels"
   net1 = "network"
END

BEGIN "net1"
   Domain = "Inet6"
   DstPort = "1234"
   DstHost = "3ffe::12"
END

In this example :

Then, restart vls and start to stream a video to "net1".

Client configuration

On the client, run vlc with this command line :

% vlc udp6:
or
% vlc --ipv6 udp:

If you want to specify the port on the command line of vlc, for example port 4321 :

% vlc udp6:@:4321


Next Previous Contents


Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру