################################################################################ # Version 1.1 $Revision: 0 $ # $Author: Florin Barbuceanu $ # # Copyright © 1997 - 2013 by IXIA # All Rights Reserved. # # Revision Log: # # ################################################################################ ################################################################################ # # # LEGAL NOTICE: # # ============== # # The following code and documentation (hereinafter "the script") is an # # example script for demonstration purposes only. # # The script is not a standard commercial product offered by Ixia and have # # been developed and is being provided for use only as indicated herein. The # # script [and all modifications, enhancements and updates thereto (whether # # made by Ixia and/or by the user and/or by a third party)] shall at all times # # remain the property of Ixia. # # # # Ixia does not warrant (i) that the functions contained in the script will # # meet the user's requirements or (ii) that the script will be without # # omissions or error-free. # # THE SCRIPT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, AND IXIA # # DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, # # INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF MERCHANTABILITY AND FITNESS FOR # # A PARTICULAR PURPOSE OR OF NON-INFRINGEMENT. # # THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SCRIPT IS WITH THE # # USER. # # IN NO EVENT SHALL IXIA BE LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING # # OUT OF THE USE OF, OR THE INABILITY TO USE THE SCRIPT OR ANY PART THEREOF, # # INCLUDING BUT NOT LIMITED TO ANY LOST PROFITS, LOST BUSINESS, LOST OR # # DAMAGED DATA OR SOFTWARE OR ANY INDIRECT, INCIDENTAL, PUNITIVE OR # # CONSEQUENTIAL DAMAGES, EVEN IF IXIA HAS BEEN ADVISED OF THE POSSIBILITY OF # # SUCH DAMAGES IN ADVANCE. # # Ixia will not be required to provide any software maintenance or support # # services of any kind (e.g., any error corrections) in connection with the # # script or any part thereof. The user acknowledges that although Ixia may # # from time to time and in its sole discretion provide maintenance or support # # services for the script, any such services are subject to the warranty and # # damages limitations set forth herein and will not obligate Ixia to provide # # any additional maintenance or support services. # # # ############################################################################### ################################################################################ # # # Description: # # This template creates and starts an IGMPv2, an IGMPv3 and # # IGMPv1 queriers. Also it creates an IGMPv3, IGMPv2 and IMGPv3 # # hosts and multicast groups pools that will be assigned to the hosts. # # # # Module: # # The sample was tested on a TXS4 module. # # # ################################################################################ package require Ixia set test_name [info script] set chassis_ip ixro-hlt-xm2-01 set tcl_server ixro-hlt-xm2-01 set ixnetwork_tcl_server 127.0.0.1:8009 set port_list [list 2/1 2/2] # Connect to the chassis, reset to factory defaults and take ownership # When using P2NO HLTSET, for loading the IxTclNetwork package please # provide –ixnetwork_tcl_server parameter to ::ixia::connect set connect_status [::ixia::connect \ -reset \ -device $chassis_ip \ -port_list $port_list \ -ixnetwork_tcl_server $ixnetwork_tcl_server \ -tcl_server $tcl_server \ ] if {[keylget connect_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget connect_status log]" return 0 } set port_1 [keylget connect_status port_handle.$chassis_ip.[lindex $port_list 0]] set port_2 [keylget connect_status port_handle.$chassis_ip.[lindex $port_list 1]] set port_handle [list $port_1 $port_2] ################################################## # Configure interfaces and create IGMP sessions # ################################################## puts "Configure IGMP v2 hosts" set ip_router_alert 1 set host 90.34.1.1 set query 90.34.1.2 set vlan_id 10 set vlan_id_step 1 set vlan_user_priority 4 #Configure IGMPv2 host set igmp_status [::ixia::emulation_igmp_config \ -port_handle $port_1 \ -reset \ -mode create \ -msg_interval 167 \ -igmp_version v2 \ -ip_router_alert $ip_router_alert \ -general_query 0 \ -group_query 0 \ -filter_mode exclude \ -count 1 \ -intf_ip_addr $host \ -neighbor_intf_ip_addr $query \ -intf_prefix_len 24 \ -vlan_id_mode increment \ -vlan_id $vlan_id \ -vlan_id_step $vlan_id_step \ -vlan_user_priority $vlan_user_priority \ -max_response_time 0 \ -max_response_control 1 \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } set host_handle_v2 [keylget igmp_status handle] puts "Create v2 IGMP group" #Configure IGMPv2 groups set session_handle 90.34.1.1 set mgroup_params [list 226.0.2.1/0.0.0.1/5 226.0.2.6/0.0.0.2/4] set msource_params [list 90.34.1.2/0.0.0.2/2,100.0.2.2/0.0.0.1/3 200.0.2.2/0.0.0.1/5,140.0.2.2/0.0.0.1/5,150.0.2.2/0.0.0.1/5] set group_status_0 [::ixia::emulation_igmp_group_config \ -mode create \ -session_handle $session_handle \ -group_pool_handle $mgroup_params \ -source_pool_handle $msource_params \ ] if {[keylget group_status_0 status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget group_status_0 log]" return 0 } set group1_handle [keylget group_status_0 group_pool_handle] puts "Configure IGMPv3 hosts" #Confgiure IGMPv3 hosts set ip_router_alert 1 set host 100.0.1.2 set query 100.0.1.1 set vlan_id 10 set vlan_id_step 1 set vlan_user_priority 4 set igmp_status [::ixia::emulation_igmp_config \ -port_handle $port_1 \ -mode create \ -msg_interval 167 \ -igmp_version v3 \ -ip_router_alert $ip_router_alert \ -general_query 0 \ -group_query 0 \ -filter_mode exclude \ -count 1 \ -intf_ip_addr $host \ -neighbor_intf_ip_addr $query \ -intf_prefix_len 20 \ -vlan_id_mode increment \ -vlan_id $vlan_id \ -vlan_id_step $vlan_id_step \ -vlan_user_priority $vlan_user_priority \ -max_response_time 0 \ -max_response_control 1 \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } set host_handle_v3 [keylget igmp_status handle] puts "Create IGMPv3 group" #Configure IGMPv3 pool group set session_handle 100.0.1.2 set mgroup_params [list 226.0.1.1/0.0.0.1/5 226.0.1.6/0.0.0.2/4] set msource_params [list 100.0.1.2/0.0.0.2/2,110.0.1.2/0.0.0.1/3 120.0.1.2/0.0.0.1/5,130.0.1.2/0.0.0.1/5,140.0.1.2/0.0.0.1/5] set group_status_0 [::ixia::emulation_igmp_group_config \ -mode create \ -session_handle $session_handle \ -group_pool_handle $mgroup_params \ -source_pool_handle $msource_params \ ] if {[keylget group_status_0 status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget group_status_0 log]" return 0 } set group2_handle [keylget group_status_0 group_pool_handle] puts "Configure IGMP v1 hosts" set ip_router_alert 1 set host 40.0.1.2 set query 40.0.1.1 set vlan_id 20 set vlan_id_step 1 set vlan_user_priority 5 set igmp_status [::ixia::emulation_igmp_config \ -port_handle $port_1 \ -mode create \ -msg_interval 167 \ -igmp_version v1 \ -ip_router_alert $ip_router_alert \ -general_query 0 \ -group_query 0 \ -filter_mode exclude \ -count 1 \ -intf_ip_addr $host \ -neighbor_intf_ip_addr $query \ -intf_prefix_len 20 \ -vlan_id_mode increment \ -vlan_id $vlan_id \ -vlan_id_step $vlan_id_step \ -vlan_user_priority $vlan_user_priority \ -max_response_time 0 \ -max_response_control 1 \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } set host_handle_v1 [keylget igmp_status handle] puts "Configure IGMP v1 group" # Configure IGMPv1 group pool set session_handle 40.0.1.2 set mgroup_params [list 226.0.3.1/0.0.0.1/5 226.0.3.6/0.0.0.2/4] set msource_params [list 100.0.3.2/0.0.0.2/2,110.0.3.2/0.0.0.1/3 120.0.3.2/0.0.0.1/5,130.0.3.2/0.0.0.1/5,140.0.3.2/0.0.0.1/5] set group_status_0 [::ixia::emulation_igmp_group_config \ -mode create \ -session_handle $session_handle \ -group_pool_handle $mgroup_params \ -source_pool_handle $msource_params \ ] if {[keylget group_status_0 status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget group_status_0 log]" return 0 } set group3_handle [keylget group_status_0 group_pool_handle] ############################################################################## # Create IGMP queriers # ############################################################################## puts "Configure IGMPv2 querier..." #Confgiure IGMP querier set ip_router_alert 1 set host 90.34.1.1 set query 90.34.1.2 set vlan_id 10 set vlan_id_step 1 set vlan_user_priority 4 set igmp_status [::ixia::emulation_igmp_querier_config \ -port_handle $port_2 \ -mode create \ -reset \ -specific_query_response_interval 300 \ -robustness_variable 2 \ -support_older_version_host 1 \ -support_older_version_querier 1 \ -support_election 1 \ -specific_query_transmission_count 2 \ -startup_query_count 2 \ -igmp_version v2 \ -discard_learned_info 0 \ -general_query_response_interval 600 \ -msg_count_per_interval 0 \ -msg_interval 0 \ -count 1 \ -intf_ip_addr $query \ -neighbor_intf_ip_addr $host \ -intf_prefix_len 20 \ -vlan_id_mode increment \ -vlan_id $vlan_id \ -vlan_id_step 0 \ -vlan_user_priority $vlan_user_priority \ -ip_router_alert 1 \ -mac_address_init 0002.c1cc.ddd0 \ -mac_address_step 0000.0000.0001 \ -override_existence_check 1 \ -override_tracking 1 \ -vci 3400 \ -vci_step 535 \ -vpi 100 \ -vpi_step 90 \ -query_interval 450 \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } set query_handle_v2 [keylget igmp_status handle] puts "Configure IGMPv3 querier..." #Configure IGMPv3 querier set ip_router_alert 1 set host 100.0.1.2 set query 100.0.1.1 set vlan_id 10 set vlan_id_step 1 set vlan_user_priority 4 set igmp_status [::ixia::emulation_igmp_querier_config \ -port_handle $port_2 \ -mode create \ -specific_query_response_interval 300 \ -robustness_variable 4 \ -support_older_version_host 1 \ -support_older_version_querier 1 \ -support_election 1 \ -specific_query_transmission_count 4 \ -startup_query_count 1 \ -igmp_version v3 \ -discard_learned_info 0 \ -general_query_response_interval 4200 \ -msg_count_per_interval 9 \ -msg_interval 4 \ -count 1 \ -intf_ip_addr $query \ -neighbor_intf_ip_addr $host \ -intf_prefix_len 24 \ -vlan_id_mode increment \ -vlan_id $vlan_id \ -vlan_id_step $vlan_id_step \ -vlan_user_priority $vlan_user_priority \ -ip_router_alert 1 \ -mac_address_init 00ab.cccc.ddd0 \ -mac_address_step 0000.0000.0001 \ -override_existence_check 1 \ -override_tracking 1 \ -vci 3400 \ -vci_step 535 \ -vpi 100 \ -vpi_step 90 \ -query_interval 30 \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } set query_handle_v3 [keylget igmp_status handle] puts "Configure IGMPv1 querier..." #Confgiure IGMPv1 querier set ip_router_alert 1 set host 40.0.1.2 set query 40.0.1.1 set vlan_id 20 set vlan_id_step 1 set vlan_user_priority 5 set igmp_status [::ixia::emulation_igmp_querier_config \ -port_handle $port_2 \ -mode create \ -specific_query_response_interval 100 \ -robustness_variable 4 \ -support_older_version_host 1 \ -support_older_version_querier 1 \ -support_election 1 \ -specific_query_transmission_count 4 \ -startup_query_count 1 \ -igmp_version v1 \ -discard_learned_info 0 \ -general_query_response_interval 4200 \ -msg_count_per_interval 9 \ -msg_interval 4 \ -count 1 \ -intf_ip_addr $query \ -neighbor_intf_ip_addr $host \ -intf_prefix_len 24 \ -vlan_id_mode increment \ -vlan_id $vlan_id \ -vlan_id_step $vlan_id_step \ -vlan_user_priority $vlan_user_priority \ -ip_router_alert 1 \ -mac_address_init 00ac.c1cc.ddd0 \ -mac_address_step 0000.0000.0001 \ -override_existence_check 1 \ -override_tracking 1 \ -vci 3400 \ -vci_step 335 \ -vpi 200 \ -vpi_step 40 \ -query_interval 20 \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } set query_handle_v1 [keylget igmp_status handle] ############################################################################## # Start IGMP hosts and queriers # ############################################################################## puts "Starting IGMP" #Add host and querier handle to a single list to start all hosts and queriers with one command set host_handle [list $host_handle_v3 $host_handle_v2 $host_handle_v1] set query_handle [list $query_handle_v1 $query_handle_v2 $query_handle_v3] #Start IGMP host set igmp_status [::ixia::emulation_igmp_control \ -mode start \ -handle $host_handle \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } #Start IGMP queriers set igmp_status [::ixia::emulation_igmp_control \ -mode start \ -handle $query_handle \ ] if {[keylget igmp_status status] != $::SUCCESS} { puts "FAIL - $test_name - [keylget igmp_status log]" return 0 } return "SUCCESS - $test_name - [clock format [clock seconds]]"