MCProxy

Version 144 (modified by woelke, 13 years ago) (diff)

--

Startup

In the Startup Guide we describe how to use the mcproxy, how to configurate and check the functionality. We describe three scenarios and discusses where problems could arise.


Tables, Flags and useful Tools

We offer an overview of the used Linux-Kernel tables and flags by the mcproxy. Also we make mention of a few useful tools to test and analyze the mcproxy.

Tables (IPv4 | IPv6)

The following tables can be found under the path /proc/net/.The IPv6 tables show the same content like the IPv4 tables. But they are only available if you configure and compile your own Linux-Kernel. For more details see here.

  • igmp | igmp6
    • This table shows the multicast group subscriptions of your system for every interface. The multicast group addresses are written in hexadecimal and network byte order (only for IPv4). For example an IP address like FEDCBA98 means 152.186.220.254. The mcproxy subscribe a multicast group on the upstream interface for every subscription heard on the downstream side. This can be seen in the igmp table.
  • ip_mr_vif | ip6_mr_vif
    • This table shows interfaces which are registered to forward multicast traffic. These interfaces are identified by an virtual interface index (vif). All interfaces used by the mcproxy registered here.
  • ip_mr_cache | ip6_mr_cache
    • This table shows the multicast forwarding rules. All interfaces used in this table associated with a vif.

Flags

MRT-Flag
If the multicast routing flag is set, then the Linux-Kernel is initialize to forward multicast traffic. Only one program at the same time can set the MRT-Flag to use the multicast routing tables. To set the flag you need root privileges. To change the flag manual you can overwrite the following file:
/proc/sys/net/ipv<X>/conf/default/mc_forwarding
RP-Filter
The Reverse Path Filter check the source IP of each packet received on an interface against the routing table. If the best route for the source IP address does not use the same interface that the packet was received on the packet is dropped. If the multicast path is not similar to the IP path, the flag must be turned off. This is imported for the multicast client and for the mcproxy itself and can be done in the following file:
 /proc/sys/net/ipv4/conf/<interface>/rp_filter

Tools

smcroute
Smcroute is a command line tool to manipulate the multicast routes of the Linux kernel and it can send join and leave messages to subscribe multicast groups. Attention! Smcroute is a daemon and set the MRT-Flag. So you cannot run smcroute and mcproxy on the same system. Here is a link to the project page.
iperf
Iperf is a commonly used network testing tool that can create TCP and UDP data streams and measure the throughput of a network that is carrying them. You can use it to send multicast test messages. To install it use the following line of code:
 apt-get install iperf
wireshark/tcpdump
Wireshark and tcpdump are packet analyzer. They are used for network troubleshooting and analysis. They can be installed with the following command:
 apt-get install wireshark
 apt-get install tcpdump

Scenarios

1. Easiest Scenario

This is the easiest scenario. You have one upstream und one downstream interface. For example it can be used to forward a multicast IPTV stream from a service provider to your pc or to your flat network. The configuration file of the mcproxy have to look like this:

 protocol IGMPv2
 eth0 ==> eth1

Or for IPv6:

 protocol MLDv1
 eth0 ==> eth1

This means the mcproxy use the Groupmembership Protocol IGMPv2 (IPv4) or MLDv1 (IPv6) to manage the multicast groups and set as upstream the interface eth0 and as downstream eth1. So the mcproxy will forward all multicast streams of the upstream to the downstream if a client in this network subscribe the specific group. On the other side the multicast streams of the downstream will automatically forward to the upstream.

Then you can start the mcproxy with the following command:

 sudo mcproxy -svv -c <configfile>

with this option the mcproxy print many status information like this:

 alvie time: 1
 ##-- instance upstream eth0 [vif=0] --##
         group addr
         [0] 239.99.99.99         
                src addr | robustness_counter | flag
                [0] 141.22.86.5       2         CACHED_SRC

         -- downstream eth1 [vif=1] --
                group addr | robustness_counter | flag
                [0] 239.99.99.99      2           RUNNING
                [1] 239.99.99.98      2           RUNNING

 alvie time: 2
 ##-- instance upstream eth0 [vif=0] --##
 ...

Your upstream interface get the vif number zero and you have one downstream configurated with the vif number one. You can compare this information with the file ip_mr_vif. Some multicast clients subscribe the group 239.99.99.99 and 239.99.99.99. The robustness_counter is at the moment uninteresting and the flag RUNNING means everything is okay. The mcproxy received on the upstream interface a multicast stream with the same group address of a subscribed group on a downstream and with the source IP 141.22.86.5. So the mcproxy make a entry in the multicast forwarding table ip_mr_cache. This mean the flag CACHED_SRC.

If you don't need the status information and you want run the mcproxy in the background start it with the following command:

 sudo nohup mcproxy -c <configfile> &

2. Multi Instantiation and Tunnel Interfaces

If you need more then one multicast proxy on your system, than you have to configurate the configuration file of the mcproxy like this:

 protocol IGMPv1
 eth0 ==> eth1 tun0
 eth2 ==> eth3

Because you cannot run the mcproxy more than one time (see MRT-Flag). In this example we used a tunnel interface as second downstream. This is legitimate but you must ensure that the tunnel support multicast. An normal ip2ip tunnel doesn't support this (use a gre or tap tunnel).

3. Hierarchization

You can concatenate multicast proxies and create a shared tree. But If you use IPv4 and the multicast path is not similar to the IP path, you have to turn off the rp_filter (see RP-Filter). The mcproxy can do it automatically with the following command:

 sudo mcproxy -f -c <configfile>

And of course you have to do it on the client systems with the following commands:

 echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter
 echo "0" > /proc/sys/net/ipv4/conf/<interface>/rp_filter

Attachments (3)

Download all attachments as: .zip