Skip to content

Multicast

Ondrej Lichtner edited this page Oct 10, 2013 · 2 revisions

1. Basic Description

This module is a python wrapper for the multicast test tools that are distributed along with LNST. The tool set includes programs that can send and receive multicast data in a variety of circumstances and also several conformance tests of the kernel interface with the appropriate standards. The tools are available in test_tools/multicast. They are written in C to make sure the proper kernel interfaces are used during the testing.

2. Options

This test module accepts these options:

  • setup can be one of the following. Note that the behaviour of the setup can be very different. This option basically says which tool from the multicast tools set should be used. There are three groups:
    • Sender setups: send_simple, send_igmp_query
    • Receiver setups: recv_simple, recv_membership, recv_block_source, recv_source_membership
    • Conformance tests: max_groups, sockopt_block_source, sockopt_if, sockopt_loop, sockopt_membership, sockopt_source_membership, sockopt_ttl

2.1 Generic Options

These can be used for all above mentioned setups:

  • multicast_address in which group should the setup operate (i.e., where to listen or to send data).
    • Example: 239.0.0.1
  • port the port number at which the communication will be.
    • Example: 1337
  • interface devname of the interface which should be used for listening/sending the data.
    • Example: eth45
  • duration For how long should the test run in seconds (0=unlimited).
    • Example: 10

2.2 Sender-specific Options

These options are limited for the sender setups only.

  • loop -- set the IP_MULTICAST_LOOP option to the socket (either 0 or 1).
  • ttl -- set the TTL of the outgoing packets.
  • delay -- the delay between sending individual packets in seconds (for instance 0.1, 5, 2)

2.3 Only for send_igmp_query

The following options are only valid for the send_igmp_query setup.

  • query_type -- IGMP version of the query (1, 2, 3)
  • dest_address -- destination address of the query
  • max_resp_time -- maximum response time of the query

2.4 Receiver-specific Options

Receivers has one more specific option:

  • source_address -- when source-specific multicast is used to allow or block a source

3. Usage Example

There is a whole library of command sequences and recipes for LNST using this type of test module available in the package with it under the recipes/multicast/ directory. Here is a simple example sending a stream of multicast data and acknowledging that some of it reached the destination:

<task>
    <run bg_id="1" host="1" timeout="30" module="Multicast">
        <options>
            <option name="setup" value="send_simple"/>
            <option name="address" value="{$multicast_group}"/>
            <option name="port" value="{$port}"/>
            <option name="duration" value="{$test_duration}"/>
            <option name="delay" value="{$send_delay}"/>
            <option name="interface" value="{ip(1,testiface)}"/>
        </options>
    </run>

    <run host="2" timeout="30" module="Multicast">
        <options>
            <option name="setup" value="recv_simple"/>
            <option name="address" value="{$multicast_group}"/>
            <option name="port" value="{$port}"/>
            <option name="duration" value="{$test_duration}"/>
            <option name="interface" value="{ip(2,testiface)}"/>

            <option name="condition" value="packets_received > 0"/>
        </options>
    </run>
    <wait host="1" bg_id="1"/>
</task>

Each of the setups can return even multiple values. These can be checked using the condition option (as it is shown in the second command here). Evaluation must be done as a simple predicate (e.g. a == b, a != b, a < b, a >= b, and so on). For the names that are returned by each individual setup, please refer to the implementation of the tools.

4. Results

A successful run of these commands will give you results similar to these:

2013-07-02 15:36:51        (127.0.0.1)     INFO: Executing command: [type (test), machine_id (1), value (Multicast), timeout (30), bg_id (1)]
2013-07-02 15:36:51        (127.0.0.1)     INFO: Executing command: [type (test), machine_id (2), value (Multicast), timeout (30)]
2013-07-02 13:36:49   (192.168.122.10)     INFO: Started Multicast test setup send_simple
2013-07-02 15:36:49   (192.168.122.12)     INFO: Started Multicast test setup recv_simple
2013-07-02 15:36:59   (192.168.122.12)     INFO: Test result: packets_received = 91
2013-07-02 15:36:59   (192.168.122.12)     INFO: Condition evaluated True: packets_received > 0
2013-07-02 15:37:00        (127.0.0.1)     INFO: Result data: {'packets_received': '91'}
2013-07-02 15:37:00        (127.0.0.1)     INFO: Executing command: [type (wait), machine_id (1), value (1)]
2013-07-02 13:36:59   (192.168.122.10)     INFO: Test result: packets_sent = 100
2013-07-02 15:37:01        (127.0.0.1)     INFO: Result data: {'packets_sent': '100'}
2013-07-02 13:36:59   (192.168.122.10)     INFO: Restoring system configuration
2013-07-02 15:36:59   (192.168.122.12)     INFO: Restoring system configuration
2013-07-02 13:36:59   (192.168.122.10)     INFO: Killing all forked processes.
2013-07-02 13:36:59   (192.168.122.10)     INFO: Cleaning up 'bond' device class.
2013-07-02 13:36:59   (192.168.122.10)     INFO: Cleaning up 'eth' device class.
2013-07-02 13:36:59   (192.168.122.10)     INFO: Restoring system configuration
2013-07-02 15:37:00   (192.168.122.12)     INFO: Killing all forked processes.
2013-07-02 15:37:00   (192.168.122.12)     INFO: Cleaning up 'eth' device class.
2013-07-02 15:37:00   (192.168.122.12)     INFO: Restoring system configuration
2013-07-02 15:37:01        (127.0.0.1)     INFO: ==================== SUMMARY ====================
2013-07-02 15:37:01        (127.0.0.1)     INFO:  rpp2.xml                                   PASS 
2013-07-02 15:37:01        (127.0.0.1)     INFO:      cmd_seq: 1  
2013-07-02 15:37:01        (127.0.0.1)     INFO:          test          Multicast bg_id: 1   PASS 
2013-07-02 15:37:01        (127.0.0.1)     INFO:          test          Multicast            PASS 
2013-07-02 15:37:01        (127.0.0.1)     INFO:          wait          id: 1                PASS 
2013-07-02 15:37:01        (127.0.0.1)     INFO: =================================================