IGMP Querier Functions¶
sth::emulation_igmp_querier_config¶
Purpose¶
The emulation_igmp_querier_config command configures an IGMP router on the specified test port.
Querier is a multicast router that maintains a list of multicast group memberships for each attached network. There is normally only one querier per physical network. The querier sends out Query messages to determine the multicast group memberships for hosts on the attached network.
The Internet Group Management Protocol (IGMP) is a protocol that provides a way for a host computer to report its multicast group membership to adjacent routers. A multicast group is configured to receive voice, video, or data traffic sent from a multicast server. IGMP is a stateful protocol. The router sends periodic queries to the receivers to verify that the hosts want to continue to participate in the multicast groups. These queries are transmitted to a well-known multicast address (224.0.0.1) that is monitored by all systems. If the receivers are still interested in that particular multicast group, they respond with a Membership Report message. When the router stops seeing responses to queries, it deletes the appropriate group from its forwarding table. For more details on IGMP, please refer to RFC 1112, RFC 2236, or RFC 3376.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_igmp_querier_config [-mode {create|modify|delete} M] [-port_handle <port_handle>] [-handle <device_handle>|<igmp_host_handle>] [-count <1-65535>] [-intf_ip_addr <a.b.c.d>] [-intf_ip_addr_step <a.b.c.d>] [-intf_prefix_len <1-32>] [-source_mac <aa:bb:cc:dd:ee:ff>] [-source_mac_step <aa:bb:cc:dd:ee:ff>] [-neighbor_intf_ip_addr <a.b.c.d>] [-neighbor_intf_ip_addr_step <a.b.c.d>] [-igmp_version {v1 | v2 | v3}] [-ignore_v1_reports {true | false}] [-ipv4_dont_fragment {true | false}] [-ipv4_tos <0-255>] [-last_member_query_count <0-255>] [-last_member_query_interval <0-4294967295>] [-qinq_incr_mode {inner | outer | both}] [-query_interval <0-4294967295>] [-query_response_interval <0-4294967295>] [-robustness_variable <2-255>] [-startup_query_count <2-255>] [-tos_type {tos | diffserv}] [-use_partial_block_state {true | false}] [-vlan_cfi {0 1}] [-vlan_id <0-4095>] [-vlan_id_mode {fixed | increment}] [-vlan_id_step <0-32767>] [-vlan_id_count <1-4095>] [-vlan_user_priority <0-7>] [-vlan_outer_cfi {0 1}] [-vlan_id_outer <0-4095>] [-vlan_id_outer_mode {fixed | increment}] [-vlan_id_outer_step <0-32767>] [-vlan_id_outer_count <1-4095>] [-vlan_outer_user_priority <0-7>]
Arguments¶
-
-mode
¶
Specifies the action to perform. Possible values are create, modify, and delete. This argument is Mandatory . The modes are described below:
create - Starts emulating IGMP routers on the specified port or handle. modify - Changes the configuration parameters for the IGMP router identified by the -handle argument. delete - Clears all IGMP group sessions information on the port and restarts the connection.
-
-port_handle
¶
The handle of the port on which to create the emulated IGMP session. When -mode is set to create, it is Mandatory that you specify -port_handle or -handle, but not both.
-
-handle
¶
The handle of the IGMP host configured on the port to use. You must specify -handle when -mode is set to modify or delete. When you use -mode create, it is Mandatory that you specify -port_handle or -handle, but not both. If you define -handle and -mode create, Spirent HLTAPI creates an IGMP device on the given device.
-
-count
¶
Defines the number of IGMP routers to create on the interface. Applicable only in mode create. Possible values range from 1 to 65535. The default value is 1
-
-intf_ip_addr
¶
Specifies the starting IPv4 address of the emulated devices. The default value is 0.0.0.0.
-
-intf_ip_addr_step
¶
Specifies the difference between interface IP addresses of consecutive routers when multiple IGMP hosts are created. Applicable only in mode create. The value must be in IPv4 format. The default value is 0.0.0.1.
-
-intf_prefix_len
¶
Specifies the address prefix length on the emulated host. Possible values range from 1 to 32. The default value is 24.
-
-source_mac
¶
Defines the first MAC address to use when emulating IGMP routers. Each client must have a unique source MAC address. The value must be in MAC format. The default value is 00:10:94:00:00:02
-
-source_mac_step
¶
Specifies the increment by which to generate additional MAC addresses for IGMP routers. Applicable only in mode create. The default value is 00:00:00:00:00:01
-
-neighbor_intf_ip_addr
¶
Specifies the IP address of the interface for the IGMP neighbor (next hop) that will establish an adjacency with the DUT. The value must be in IPv4 format. The default value is 192.85.1.1
-
-neighbor_intf_ip_addr_step
¶
Specifies the difference between the IP addresses of IGMP neighbor’s interfaces when creating multiple IGMP routers. Applicable only in create mode. The value must be in IPv4 format. The default value is 0.0.0.0.
-
-igmp_version
¶
Specifies the version of IGMP to use for the querier. Possible values are:
v1 - The second version of IGMP (supercedes IGMPv0), specified in RFC 1112. v2 - IGMP version specified in RFC 2236. Improved IGMP version that adds "leave" messages, shortening the amount of time :mandatory:`Mandatory` for a router to determine that no stations are in a particular group. This version includes the ability for the receivers to gracefully exit from a multicast group. v3 - Specified in RFC 3376, this major revision of the IGMP protocol adds the ability to specify the source(s) to which a receiver is willing to listen. Sources can be stipulated with "include" filters in the "join" and "report" messages, or sources can be specifically rejected with "exclude" filters.
The default value is v2.
-
-ignore_v1_reports
¶
Specifies whether to ignore IGMPv1 messages on the interface. This argument is only valid for IGMPv2. Possible values are true and false. The default value is false.
-
-ipv4_dont_fragment
¶
Determines whether to use fragment the IP packets larger than the MTU (Maximum Transmission Unit) size. Possible values are true and false. The default value is false.
-
-ipv4_tos
¶
Specifies the value of the TOS field in the IPv4 header. Possible values range from 0 to 255. The default value is 192.
-
-last_member_query_count
¶
Value for the Max Response Time field (in milliseconds) that is inserted in to Group-Specific and Group-and-Source-Specific Query messages in response to Leave Group messages. Possible values range from 0 to 255. The default value is 2. Note that this argument does not work for IGMPv1.
-
-last_member_query_interval
¶
Maximum amount of time between group-specific query messages, including those sent in response to leave-group messages. Possible values range from 0 to 4294967295. The default value is 1000. Note that this argument does not work for IGMPv1.
-
-query_interval
¶
Specifies the duration (in seconds) between transmissions of General Query messages. General Query messages are used to learn which multicast groups have members on a connected network. Possible values range from 0 to 4294967295. The default value is 125.
-
-query_response_interval
¶
Specifies the value for the Max Response Time field (in milliseconds), which is inserted into the General Query messages. This time is the maximum amount allowed for a host to send a responding report to the General Query message. The interval must be less than the Query Interval. This argument does not apply to IGMPv1. Possible values range from 0 to 4294967295. The default value is 10000.
-
-qinq_incr_mode
¶
Determines which VLAN ID to increment first. Possible values are:
inner - Increments the inner VLAN ID before the outer VLAN ID outer - Increments the outer VLAN ID before the inner VLAN ID both - Increment both the inner and outer VLAN ID at the same time.
The default value is both. Applicable only in mode create.
-
-robustness_variable
¶
Specifies the variable used in the calculation of default values for various timers and counters. Possible values range from 2 to 255. The default value is 2. Note that this argument does not work for IGMPv1.
-
-startup_query_count
¶
Number of queries sent out on startup, separated by the Startup Query Interval. Possible values range from 2 to 255. The default value is 2.
-
-tos_type
¶
Specifies the formatting of the TOS value. Possible values are:
tos - Type of Service diffserv - Differentiated services
The default value is tos.
-
-use_partial_block_state
¶
Determines whether to use partial block state. Possible values are true and false. The default value is false.
-
-vlan_cfi
¶
Sets the Canonical Format Indicator (CFI) field in VLAN for the emulated router node. Possible values are 0 (Ethernet) and 1 (Token Ring). If it is set to 0, it indicates Token Ring and packets are dropped by Ethernet ports. If set to 0, it indicates the network is Ethernet. The default value is 0.
-
-vlan_id
¶
Defines the VLAN ID of the first VLAN sub-interface. Possible values range from 0 to 4095. The default value is 100.
-
-vlan_id_mode
¶
Specifies the VLAN generating method when you configure more than one interface on Spirent HLTAPI with VLAN. You can choose to either automatically increment the VLAN tag (mode increment) or leave it idle for each interface (mode fixed), in which case the VLAN ID is the same for all packets. If you set this argument to increment, you can specify the -vlan_id_step argument to indicate the step size. The default value is fixed. Applicable only in mode create.
-
-vlan_id_step
¶
Defines the step size by which the VLAN value is incremented when you set -vlan_id_mode to increment. Possible values range from 0 to 32767. The default value is 1. Applicable only in create mode.
-
-vlan_id_count
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the number of VLAN IDs to use when generating IGMP sessions. Possible values range from 1 to 4096. The default value is 1. Applicable only in mode create.
-
-vlan_user_priority
¶
Defines the VLAN priority for the VLANs on this port. Possible values range from 0 to 7. The default value is 7.
-
-vlan_outer_cfi
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies whether to set the CFI value for the VLAN outer header. Possible values are 0 and 1. If you set it to 1, a CFI value will be automatically assigned. The default value is 0.
-
-vlan_id_outer
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the VLAN ID for a particular outer header. Possible values range from 0 to 4095. The default value is 100.
-
-vlan_id_outer_mode
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies how Spirent HLTAPI will assign VLAN tags to packets in the specified outer header. Possible values are:
fixed - The outer VLAN ID is the same for all packets increment - For all packets, the outer VLAN tag ID increments by the step specified in the -vlan_id_outer_step argument.
The default value is fixed. Applicable only in mode create.
-
-vlan_id_outer_step
¶
The amount by which to increment the specified outer VLAN ID (-vlan_id_outer) for subsequent packets. Possible values range from 0 to 32767. The default value is 1. Applicable only in mode create.
-
-vlan_id_outer_count
¶
Spirent Extension (for Spirent HLTAPI only).
The number of outer VLAN IDs to use when generating IGMP routers. Possible values range from 1 to 4096. The default value is 1. Applicable only in create mode.
-
-vlan_outer_user_priority
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the VLAN priority to assign to the outer VLAN header. Possible values range from 0 to 7. The default value is 7.
Arguments Unsupported by Save as HLTAPI¶
The following Spirent HLTAPI arguments are currently not supported by the Save as HLTAPI function:
-qinq_incr_mode
Vendor Specific Arguments Processed by Spirent HLTAPI Wrapper¶
-
-igmp_querier_type
¶
The version of IGMP to be used. Valid for -mode create. Possible values are:
v1 Version 1 v2 Version 2 v3 Version 3
Vendor Specific Arguments Ignored by Spirent HLTAPI Wrapper¶
-device_type
Note
For more information about Spirent HLTAPI Wrapper, refer to Chapter 4 Spirent HLTAPI Wrapper in Spirent HLTAPI Programmer’s Reference.
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
-handle The IGMP router handle
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
Description
The sth::emulation_igmp_querier_config
function creates, modifies, or deletes
IGMP routers for the specified Spirent HLTAPI port or handle. Use the -mode
argument to specify the action to perform. (See the -mode argument description
for information about the actions.)
When you create an IGMP router, use the -port_handle argument to specify the
Spirent HLTAPI port that the emulated IGMP router will use for IGMP
communication. (The port handle value is contained in thekeyed list returned by
the sth::connect
function.)
Spirent HLTAPI supports the use of IGMPv1, V2 and V3. For details of the IGMP protocal, see RFC 1112, RFC 2236 and RFC 3376.
Examples¶
#### HLTAPI for Tcl ####
The following example creates and configures an IGMP router:
set returnedString [sth::emulation_igmp_querier_config \
-mode "create" \
-port_handle $hltPort \
-count 1 \
-igmp_version v2 \
-intf_ip_addr 1.1.1.40 \
-intf_ip_addr_step "0.0.0.1" \
-neighbor_intf_ip_addr 1.1.1.10 \
-neighbor_intf_ip_addr_step "0.0.0.1" \
-vlan_id 111\
-vlan_id_count 3 \
-vlan_id_step 2\
-vlan_id_mode increment\
-vlan_id_outer 101\
-vlan_id_outer_count 5 \
-vlan_id_outer_step 2\
-vlan_id_outer_mode increment\
-ignore_v1_reports true\
-last_member_query_count 10\
-query_interval 5]
The following example modifies the created IGMP router:
set returnedString [sth::emulation_igmp_querier_config \
-mode "modify" \
-handle $igmpQuerierRouter\
-vlan_id 222 \
-vlan_id_outer 333\
-ignore_v1_reports true\
-last_member_query_count 10\
-query_interval 5]
The following example deletes emulated IGMP routers:
set returnedString [sth::emulation_igmp_querier_config \
-mode delete\
-handle $igmpQuerierRouterList]
Sample Output:
{handle {router1}} {status 1}
#### HLTAPI for Python ####
The following example creates and configures an IGMP router:
device_ret0 = sth.emulation_igmp_querier_config (
mode = 'create',
port_handle = port_handle[0],
ipv4_tos = '192',
query_interval = '125',
ipv4_dont_fragment = 'false',
igmp_version = 'v2',
last_member_query_interval= '1000',
robustness_variable = '2',
startup_query_count = '2',
query_response_interval= '10000',
last_member_query_count= '2',
ignore_v1_reports = 'false',
use_partial_block_state= 'false',
source_mac = '00:10:94:00:00:01',
neighbor_intf_ip_addr= '192.85.1.1',
intf_ip_addr = '192.85.1.3',
intf_prefix_len = '24',
tos_type = 'tos');
Sample Output:
{'status': '1', 'handle': 'router1'}
#### HLTAPI for Perl ####
The following example creates and configures an IGMP router:
my %device_ret0 = sth::emulation_igmp_querier_config (
mode => 'create',
port_handle => "$hport[1]",
ipv4_tos => '192',
query_interval => '125',
ipv4_dont_fragment => 'false',
igmp_version => 'v2',
last_member_query_interval=> '1000',
robustness_variable => '2',
startup_query_count => '2',
query_response_interval=> '10000',
last_member_query_count=> '2',
ignore_v1_reports => 'false',
use_partial_block_state=> 'false',
source_mac => '00:10:94:00:00:01',
neighbor_intf_ip_addr=> '192.85.1.1',
intf_ip_addr => '192.85.1.3',
intf_prefix_len => '24',
tos_type => 'tos');
Sample Output:
$VAR1 = 'handle';
$VAR2 = 'router1';
$VAR3 = 'status';
$VAR4 = '1';
End of Procedure Header
sth::emulation_igmp_querier_control¶
Purpose¶
Starts or stops sending Query messages from the selected queriers to attached hosts on the specified port.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_igmp_querier_control [-mode {start|stop} M] [-port_handle <port_handle_list>] [-handle <handle_list>]
Arguments¶
-
-mode
¶
Specifies the action to perform on the specified handle. If you provide a handle (-handle), this argument performs the specified action on all groups on this session. If you do not provide a handle, this argument performs the specified action on all groups on all sessions. Possible values are:
start - Starts sending Query message from the selected queriers to attached hosts.. stop - Stops sending Query message from the selected queriers to attached hosts. The queriers also stop responding to Report and Leave messages from attached hosts.
This argument is Mandatory .
-
-port_handle
¶
Identifies a list of ports on which to perform the action. This is the port on which IGMP emulation has been configured. This value is returned by the
sth::emulation_igmp_querier_config
function. This argument is Mandatory when -handle is not used.
-
-handle
¶
Specifies a list of devices on which to perform the action. You must specify -port_handle or handle, but not both.
Vendor Specific Arguments Processed by Spirent HLTAPI Wrapper¶
-
-action
¶
Stops or starts the protocol. This argument is Mandatory . The modes are described below:
start Enable the IGMP Querier session stop Disable the IGMP Querier session
Vendor Specific Arguments Ignored by Spirent HLTAPI Wrapper¶
-query_type
Note
For more information about Spirent HLTAPI Wrapper, refer to Chapter 4 Spirent HLTAPI Wrapper in Spirent HLTAPI Programmer’s Reference.
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
status Success (1) or failure (0) of the operation. log An error message (if the operation failed).
Description¶
The sth::emulation_igmp_querier_control
function starts or stops sending Query
message from the selected queriers to attached hosts on the specified port.
When you call sth::emulation_igmp_querier_control, you must specify either a port handle or a device handle, on which Spirent HLTAPI applies the specified action.
Examples¶
#### HLTAPI for Tcl ####
The following example starts the IGMP Queriers on port $portHandle:
set returnedString [ sth:: emulation_igmp_querier_control \
-port_handle $portHandle \
-action start]
The following example stops the IGMP Queriers just started:
set returnedString [ sth:: emulation_igmp_querier_control \
-port_handle $portHandle \
-action stop]
Sample Output:
{status 1}
#### HLTAPI for Python ####
The following example starts the specified IGMP Queriers on the specified ports:
ctrl_ret1 = sth.emulation_igmp_querier_control (
port_handle = [port_handle[0],port_handle[1]],
mode = 'start');
Sample Output:
{'status': '1'}
#### HLTAPI for Perl ####
The following example starts the specified IGMP Queriers on the specified ports:
my %ctrl_ret1 = sth::emulation_igmp_querier_control (
port_handle => "$hport[1] $hport[2] ",
mode => 'start');
Sample Output:
$VAR1 = 'status';
$VAR2 = '1';
End of Procedure Header
sth::emulation_igmp_querier_info¶
Purpose¶
Retrieves statistics for the IGMP Routers configured on the specified test ports.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_igmp_querier_info [-port_handle <port_handle>] [-handle <handle>]
Arguments¶
-
-port_handle
¶
Specifies the port on which to retrieve statistics.
-
-handle
¶
Specifies the handle of the device on which to retrieve statistics.
Note
Both handle and port_handle are optional, but at least one should be specified. If both are specified, then handle is prioritized.
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
status Success (1) or failure (0) of the operation. log An error message (if the operation failed). host_state State of the IGMP/MLD host block[JOINING, LEAVING, MEMBER, NON_MEMBER, UNDEFINED] if_handle IL interface handle mcast_compatiblity_mode IGMP version the router block is currently operating as.[V1, V2, V3] router_state State of the IGMP/MLD querier block.[NOT_STARTED, UNDEFINED, UP] frame_count_rx Total number of IGMP frames received igmp_check_sum_error_count_rx Total number of IGMP messages received with checksum errors igmp_length_error_count_rx Total number of IGMP messages received with length errors unknown_type_count_rx Total number of frames of unknown type received time_stamp Timestamp, in seconds, of last statistic update frame_count_tx Total number of IGMP frames transmitted
Description¶
The sth::emulation_igmp_querier_info
function returns statistics of the IGMP
router on the specified port. Statistics include the router status and number and
type of messages sent and received from the specified port.
Examples¶
#### HLTAPI for Tcl ####
The following example retrieves statistics on port $portHandle:
set returnedString [ sth:: emulation_igmp_querier_info \
-port_handle $portHandle]
Sample Output:
{status 1} {results {{router1 {{igmp_check_sum_error_count_rx 0}
{unknown_type_count_rx 0} {mcast_compatiblity_mode V2}
{igmp_length_error_count_rx 0} {router_state NOT_STARTED} {if_handle 0}
{time_stamp 0} {frame_count_rx 0} {host_state NON_MEMBER} {frame_count_tx 0}}}}}
#### HLTAPI for Python ####
The following example retrieves statistics on the specified ports:
results_ret1 = sth.emulation_igmp_querier_info (
port_handle = [port_handle[0],port_handle[1]]);
Sample Output:
{'status': '1', 'results': {'router1': {'igmp_length_error_count_rx': '0',
'frame_count_rx': '0', 'igmp_check_sum_error_count_rx': '0',
'host_state': 'UNDEFINED', 'if_handle': '7', 'unknown_type_count_rx': '0',
'router_state': 'UP', 'mcast_compatiblity_mode': 'V2', 'frame_count_tx': '1',
'time_stamp': '0'}}}
#### HLTAPI for Perl ####
The following example retrieves statistics on the specified ports:
my %results_ret1 = sth::emulation_igmp_querier_info (
port_handle => "$hport[1] $hport[2] ");
Sample Output:
$VAR1 = 'status';
$VAR2 = '1';
$VAR3 = 'results';
$VAR4 = {
'router1' => {
'time_stamp' => '0',
'igmp_length_error_count_rx' => '0',
'if_handle' => '2',
'router_state' => 'UP',
'frame_count_rx' => '1',
'frame_count_tx' => '1',
'mcast_compatiblity_mode' => 'V2',
'host_state' => 'UNDEFINED',
'igmp_check_sum_error_count_rx' => '0',
'unknown_type_count_rx' => '0'
},
'router2' => {
'time_stamp' => '0',
'igmp_length_error_count_rx' => '0',
'if_handle' => '7',
'router_state' => 'UP',
'frame_count_rx' => '3',
'frame_count_tx' => '1
',
'mcast_compatiblity_mode' => 'V2',
'host_state' => 'UNDEFINED',
'igmp_check_sum_error_count_rx' => '0',
'unknown_type_count_rx' => '0'
}
};
End of Procedure Header