IGMP Tool: mhost

# IGMP tool: mhost (Multicast Host)

## Overview:

Mhost aims at testing IGMP router/host interaction. Mhost can send IGMP Join/Leave as a multicast host, and emulate situation which multiple hosts join or leave group on same subnet.
Mhost generate and send IGMP packets by using command describing below. It is possible to specify command interactively or from a configuration file that describing a stream of commands (like a script).

## Running:

To run mhost, you must be a 'root'. Starting mhost is as follows:

  mhost [-f <config_file>]

  -f <config_file> : Specifies configuration file. By default, mhost run in interaction mode.

## Command:

### host-list

Configure (virtual) multicast host.

  host-list <list_id> addr <host_addr> [v1]
  host-list <list_id> tracefile <file>

  list_id : Specifies host-list ID. This ID is used by other commands.
  addr <host_addr> : Specifies host's IP address. You must set the specified IP address to machine on running mhost.
  v1 : Specifies IGMP V1 host.
  tracefile <tracefile> : Specifies the output file for trace information of sending/receiving packets.

### config-file

Specifies a configuration file. You can write part of the configuration in a different file and include it by this command.

  config-file <file_name>

### host

Specifies behavior of host.

  host join | leave <host-list> group <group_addr>
  host up | down <host-list>

  <host-list> : Specifies the host-list ID.
  join | leave : Specifies group join or group leave.
  group <group_addr> : Specifies join/leave group address.
  up | down : Specifies host state.Default is up state.If down state,don't reply Query.

### report/leave

Sending IGMP Membership Report or IGMP Group Leave.

  report send <interface> [src <src_addr>] group <grp_addr> [v1] [ noalert ]
  leave send <interface> [src <src_addr>] group <grp_addr> [ noalert ]

  <interface> : Specifies interface name to send packet.
  src <src_addr> : Specifies source address of IGMP packet. By default, outgoing interface's address.
  group <grp_addr> : Specifies join or leave group address.
  v1 : Specifies sending IGMP v1 Membership Report.
  noalert : Specifies sending Report without IP Router Alert option.

### query

Receiving IGMP Membership Query.

  query recv <interface> [ group <group> ] timeout <time>

  <interface> : Specifies interface name to receive packet.
  group <grp_addr> : Specifies group address. When receive Specific-Query,specifies group address. By default, receive General-Query.
  timeout <time> : Specifies waiting time(sec) until receive Query.

### dump

Dump specified host's information.

  dump <host-list> <file-name>

### debug/nodebug

Control output trace information to terminal.

  debug [detail] [tty <tty_name>]
  nodebug

  debug : Enable output trace information(src/dest address and type of sending or receiving IGMP packet).
  nodebug: Disable output trace information.
  detail : If specifies, output content of each packet.
  tty <tty_name>: Specifies output terminal. Default is current terminal.

### wait

Specifies wait time(sec) until execute next command.

  wait <time>

### quit

Stop the evaluation of this script.

  quit

## Example:

                        +-----+                         +-----+
                        |  R  |                         |  R  |
                        +--+--+                         +--+--+
          192.168.3.0      |                               |
              ---+---------+----------+---            -----+-----
                 |         |          |                    |
              +--+--+   +--+--+    +--+--+              +--+--+
              | H1  |   | H2  |    | H3  |              |mhost|
              +-----+   +-----+    +-----+              +-----+
           224.1.1.1   224.1.1.1   225.10.2.1
           225.10.2.1                                 mhost as H1,H2,H3

                  <Test Topology>               <Test Network System>

      # Define  multicast host
      host-list 1 addr 192.168.3.4
      host-list 2 addr 192.168.3.5
      host-list 3 addr 192.168.3.6
      # All host join each group
      host join 1 group 224.1.1.1
      host join 2 group 224.1.1.1
      wait 10
      host join 3 group 225.10.2.1
      wait 60
      host leave 1 group 224.1.1.1
      wait 20
      host join 1 group 225.10.2.1
      wait 30
      host leave 2 group 224.1.1.1
      wait 10
      host leave 3 225.10.2.1
      quit