Ejemplo n.º 1
0
def initialize_experiment():
    """Initialize the wlan_exp experiment."""
    global nodes

    # Print initial message
    print("\nInitializing experiment\n")

    # Create an object that describes the network configuration of the host PC
    network_config = config.WlanExpNetworkConfiguration(network=NETWORK, 
                                                        jumbo_frame_support=USE_JUMBO_ETH_FRAMES)

    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config   = config.WlanExpNodesConfiguration(network_config=network_config,
                                                      serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This will initialize all of the networking and gather the necessary
    #   information to control and communicate with the nodes
    nodes = util.init_nodes(nodes_config, network_config)

    # Initialize the time on all nodes to zero
    util.broadcast_cmd_set_mac_time(0, network_config)

    # Set the promiscuous counts mode
    for node in nodes:
        node.set_radio_channel(CHANNEL)
        node.reset(txrx_counts=True)
def initialize_experiment():
    """Initialize the WLAN Exp experiment."""
    global nodes

    # Print initial message
    print("\nInitializing experiment\n")

    # Create a NetworkConfiguration
    #   This describes the netwokr configuration.
    network_config = config.WlanExpNetworkConfiguration(network=NETWORK)
    
    # Create a WnNodesConfiguration
    #   This describes each node to be initialized
    nodes_config   = config.WlanExpNodesConfiguration(network_config=network_config,
                                                      serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This will initialize all of the networking and gather the necessary
    #   information to control and communicate with the nodes
    nodes = wlan_exp_util.init_nodes(nodes_config, network_config)

    # Initialize the time on all nodes to zero
    wlan_exp_util.broadcast_cmd_set_time(0.0, network_config)

    # Set the promiscuous statistics mode
    for node in nodes:
        node.stats_configure_txrx(promisc_stats=PROMISCUOUS_STATISTICS)
        node.reset(txrx_stats=True)
Ejemplo n.º 3
0
def initialize_experiment():
    """Initialize the wlan_exp experiment."""
    global nodes

    # Print initial message
    print("\nInitializing experiment\n")

    # Create an object that describes the network configuration of the host PC
    network_config = config.WlanExpNetworkConfiguration(
        network=NETWORK, jumbo_frame_support=USE_JUMBO_ETH_FRAMES)

    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config = config.WlanExpNodesConfiguration(
        network_config=network_config, serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This will initialize all of the networking and gather the necessary
    #   information to control and communicate with the nodes
    nodes = util.init_nodes(nodes_config, network_config)

    # Initialize the time on all nodes to zero
    util.broadcast_cmd_set_mac_time(0, network_config)

    # Set the promiscuous counts mode
    for node in nodes:
        node.reset(txrx_counts=True)
Ejemplo n.º 4
0
def init_experiment():
    """Initialize WLAN Experiment."""
    global network_config, nodes, attr_dict

    print("\nInitializing experiment\n")

    # Log attributes about the experiment
    attr_dict['exp_start_time'] = log_util.convert_datetime_to_log_time_str(
        datetime.datetime.utcnow())

    # Create an object that describes the network configuration of the host PC
    network_config = wlan_exp_config.WlanExpNetworkConfiguration(
        network=NETWORK)

    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config = wlan_exp_config.WlanExpNodesConfiguration(
        network_config=network_config, serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This command will fail if either WARP v3 node does not respond
    nodes = wlan_exp_util.init_nodes(nodes_config, network_config)

    # Do not set the node into a known state.  This example will just read
    # what the node currently has in the log.  However, the below code could
    # be used to initialize all nodes into a default state:
    #
    # Set each node into the default state
    for tmp_node in nodes:
        #     # Issue a reset command to stop current operation / initialize components
        tmp_node.reset(log=True, txrx_stats=True, ltg=True,
                       queue_data=True)  # Do not reset associations/bss_info
        #
        #     # Configure the log
        tmp_node.log_configure(log_full_payloads=True)
Ejemplo n.º 5
0
def init_experiment():
    """Initialize the experiment."""
    global n_sta1, n_sta2, n_ap, rate_info, network_config, network_config, nodes, attr_dict, s

    print("\nInitializing experiment\n")

    # Print attributes about the experiment - Changed by Rebecca
    print(log_util.convert_datetime_to_log_time_str(datetime.datetime.utcnow()))

    # Create an object that describes the network configuration of the host PC
    network_config = wlan_exp_config.WlanExpNetworkConfiguration(network=NETWORK,
                                                                 jumbo_frame_support=USE_JUMBO_ETH_FRAMES)

    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config   = wlan_exp_config.WlanExpNodesConfiguration(network_config=network_config,
                                                               serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This command will fail if either WARP v3 node does not respond
    nodes = wlan_exp_util.init_nodes(nodes_config, network_config, network_reset=False)

    # Set the time of all the nodes to zero
    #wlan_exp_util.broadcast_cmd_set_mac_time(0, network_config)

    # Extract the different types of nodes from the list of initialized nodes
    #     - This will work for both 'DCF' and 'NOMAC' mac_low projects
    n_ap_l  = wlan_exp_util.filter_nodes(nodes=nodes, mac_high='AP',  serial_number=NODE_SERIAL_LIST)    
    n_sta_l = wlan_exp_util.filter_nodes(nodes=nodes, mac_high='STA', serial_number=NODE_SERIAL_LIST)

    # Check that setup is valid
    if len(n_ap_l) == 1 and len(n_sta_l) == 2:
        # Extract the two nodes from the lists for easier referencing below
        n_ap  = n_ap_l[0]
        n_sta1 = n_sta_l[0]
        n_sta2 = n_sta_l[1]
    elif len(n_ap_l) == 1 and len(n_sta_l) == 1:
        n_ap  = n_ap_l[0]
        n_sta1 = n_sta_l[0]

    # Do not set the node into a known state.  This example will just read
    # what the node currently has in the log.  However, the below code could
    # be used to initialize all nodes into a default state:
    #
    # Set each node into the default state
#    for tmp_node in nodes:
#         # Issue a reset command to stop current operation / initialize components
#         tmp_node.reset(log=True, txrx_counts=True, ltg=True, queue_data=True) # Do not reset associations/bss_info
    
#         # Configure the log
#         tmp_node.log_configure(log_full_payloads=True)

    if sock_on:
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # replaced SOCK_STREAM with SOCK_DGRAM
Ejemplo n.º 6
0
def init_experiment():
    print("\nInitializing experiment\n")
    
    global n_ap, n_sta, rate_info, network_config
    
    # Create an object that describes the network configuration of the host PC
    network_config = config.WlanExpNetworkConfiguration(network=NETWORK,
                                                        jumbo_frame_support=USE_JUMBO_ETH_FRAMES)
    
    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config   = config.WlanExpNodesConfiguration(network_config=network_config,
                                                      serial_numbers=NODE_SERIAL_LIST)
    
    # Initialize the Nodes
    #   This command will fail if either WARP v3 node does not respond
    nodes = util.init_nodes(nodes_config, network_config)
    
    # Set the time of all the nodes to zero
    util.broadcast_cmd_set_mac_time(0, network_config)
    
    # Extract the different types of nodes from the list of initialized nodes
    #     - This will work for both 'DCF' and 'NOMAC' mac_low projects
    n_ap_l  = util.filter_nodes(nodes=nodes, mac_high='AP',  serial_number=NODE_SERIAL_LIST)
    n_sta_l = util.filter_nodes(nodes=nodes, mac_high='STA', serial_number=NODE_SERIAL_LIST)
    
    # Check that setup is valid
    if len(n_ap_l) == 1 and len(n_sta_l) == 1:
        # Extract the two nodes from the lists for easier referencing below
        n_ap  = n_ap_l[0]
        n_sta = n_sta_l[0]
    
        # Configure the AP to reject authentication requests from wireless clients
        #     - Uncomment this line to block any wireless associations during the experiment
        # n_ap.set_authentication_address_filter(allow='NONE')
    
        # Configure AP BSS
        n_ap.configure_bss(ssid=SSID, channel=CHANNEL, beacon_interval=BEACON_INTERVAL)
    
        # Establish the association state between nodes
        #     - This will change the STA to the appropriate channel
        n_ap.add_association(n_sta)
    else:
        print("ERROR: Node configurations did not match requirements of script.\n")
        print("    Ensure two nodes are ready, one using the AP design, one using the STA design\n")
        sys.exit(0)
    
    # Check that the nodes are part of the same BSS.  Otherwise, the LTGs below will fail.
    if not util.check_bss_membership([n_ap, n_sta]):
        print("\nERROR: Nodes are not part of the same BSS.")
        util.check_bss_membership([n_ap, n_sta], verbose=True)
        print("Ensure that both nodes are part of the same BSS.")
        sys.exit(0)
def init_experiment():
    """Initialize WLAN Experiment."""
    global network_config, nodes, attr_dict
    
    print("\nInitializing experiment\n")

    # Log attributes about the experiment
    attr_dict['exp_start_time'] = str(datetime.datetime.now())
    
    # Create an object that describes the network configuration of the host PC
    network_config = wlan_exp_config.WlanExpNetworkConfiguration(network=NETWORK)
    
    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config   = wlan_exp_config.WlanExpNodesConfiguration(network_config=network_config,
                                                               serial_numbers=NODE_SERIAL_LIST)
    
    # Initialize the Nodes
    #   This command will fail if either WARP v3 node does not respond
    nodes = wlan_exp_util.init_nodes(nodes_config, network_config)
def init_experiment():
    """Initialize WLAN Experiment."""
    global host_config, nodes, attr_dict

    print("\nInitializing experiment\n")

    # Log attributes about the experiment
    attr_dict['exp_start_time'] = str(datetime.datetime.now())

    # Create an object that describes the configuration of the host PC
    host_config = wlan_exp_config.WlanExpHostConfiguration(
        host_interfaces=HOST_INTERFACES)

    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config = wlan_exp_config.WlanExpNodesConfiguration(
        host_config=host_config, serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #  This command will fail if either WARP v3 node does not respond
    nodes = wlan_exp_util.init_nodes(nodes_config, host_config)
Ejemplo n.º 9
0
def init_experiment():
    """Initialize WLAN Experiment."""
    global network_config, nodes, attr_dict

    print("\nInitializing experiment\n")

    # Log attributes about the experiment
    attr_dict['exp_start_time'] = log_util.convert_datetime_to_log_time_str(
        datetime.datetime.utcnow())

    # Create an object that describes the network configuration of the host PC
    network_config = wlan_exp_config.WlanExpNetworkConfiguration(
        network=NETWORK)

    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config = wlan_exp_config.WlanExpNodesConfiguration(
        network_config=network_config, serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This command will fail if either WARP v3 node does not respond
    nodes = wlan_exp_util.init_nodes(nodes_config, network_config)
Ejemplo n.º 10
0
def initialize_experiment():
    """Initialize the WLAN Exp experiment."""
    global nodes

    # Print initial message
    print("\nInitializing experiment\n")

    # Create a WnConfiguration
    #   This describes the Host configuration.
    host_config  = config.WlanExpHostConfiguration(host_interfaces=HOST_INTERFACES)
    
    # Create a WnNodesConfiguration
    #   This describes each node to be initialized
    nodes_config = config.WlanExpNodesConfiguration(host_config=host_config,
                                                    serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This will initialize all of the networking and gather the necessary
    #   information to control and communicate with the nodes
    nodes = wlan_exp_util.init_nodes(nodes_config, host_config)

    # Initialize the time on all nodes to zero
    wlan_exp_util.broadcast_cmd_set_time(0.0, host_config)
NODE_SERIAL_LIST = ['W3-a-00001']

#-------------------------------------------------------------------------
#  Initialization
#
# Create an object that describes the network configuration of the host PC
network_config = config.WlanExpNetworkConfiguration(
    network=NETWORK, jumbo_frame_support=USE_JUMBO_ETH_FRAMES)

# Create an object that describes the WARP v3 nodes that will be used in this experiment
nodes_config = config.WlanExpNodesConfiguration(
    network_config=network_config, serial_numbers=NODE_SERIAL_LIST)

# Initialize the Nodes
#  This command will fail if any WARP v3 node does not respond
nodes = util.init_nodes(nodes_config, network_config)

print("\nInitialized nodes:")
# Put each node in a known, good state
for node in nodes:
    msg = "    {0} ".format(repr(node))

    print(msg)

print("\n\n")
print("*********************************************************************")
print("Starting interactive console. The initialized wlan_exp node instances")
print(" are stored in the list variable 'nodes', indexed in order of node ID")
print("Example: blink LEDs at node ID 0: 'nodes[0].identify()'")
print("*********************************************************************")
print("\n\n")
Ejemplo n.º 12
0
#-----------------------------------------------------------------------------
# Initialize the experiment
#-----------------------------------------------------------------------------
print("\nInitializing experiment\n")

# Create an object that describes the configuration of the host PC
network_config = wlan_exp_config.WlanExpNetworkConfiguration(network=NETWORK)

# Create an object that describes the WARP v3 nodes that will be used in this experiment
nodes_config = wlan_exp_config.WlanExpNodesConfiguration(
    network_config=network_config, serial_numbers=NODE_SERIAL_LIST)

# Initialize the Nodes
#  This command will fail if either WARP v3 node does not respond
nodes = wlan_exp_util.init_nodes(nodes_config, network_config)

# Set the time of all the nodes to zero
wlan_exp_util.broadcast_cmd_set_time(0.0, network_config)

# Extract the different types of nodes from the list of initialized nodes
#   NOTE:  This will work for both 'DCF' and 'NOMAC' mac_low projects
n_ap_l = wlan_exp_util.filter_nodes(nodes=nodes,
                                    mac_high='AP',
                                    serial_number=NODE_SERIAL_LIST)
n_sta_l = wlan_exp_util.filter_nodes(nodes=nodes,
                                     mac_high='STA',
                                     serial_number=NODE_SERIAL_LIST)

# Check that we have a valid AP and STA
if (((len(n_ap_l) == 1) and (len(n_sta_l) == 1))):
#-----------------------------------------------------------------------------
# Experiment Script
#-----------------------------------------------------------------------------
print("\nInitializing experiment\n")

# Create an object that describes the configuration of the host PC
host_config  = wlan_exp_config.WlanExpHostConfiguration(host_interfaces=HOST_INTERFACES)

# Create an object that describes the WARP v3 nodes that will be used in this experiment
nodes_config = wlan_exp_config.WlanExpNodesConfiguration(host_config=host_config,
                                                         serial_numbers=NODE_SERIAL_LIST)

# Initialize the Nodes
#  This command will fail if either WARP v3 node does not respond
nodes = wlan_exp_util.init_nodes(nodes_config, host_config)

# Set the time of all the nodes to zero
wlan_exp_util.broadcast_cmd_set_time(0.0, host_config)

# Extract the AP and STA nodes from the list of initialized nodes
n_ap_l  = wlan_exp_util.filter_nodes(nodes, 'node_type', 'AP')
n_sta_l = wlan_exp_util.filter_nodes(nodes, 'node_type', 'STA')


# Check that we have a valid AP and STA
if (((len(n_ap_l) == 1) and (len(n_sta_l) == 1))):
    # Extract the two nodes from the lists for easier referencing below
    n_ap = n_ap_l[0]
    n_sta = n_sta_l[0]
else:
Ejemplo n.º 14
0
#-------------------------------------------------------------------------
#  Initialization
#
print("\nInitializing experiment\n")

# Create an object that describes the network configuration of the host PC
network_config = config.WlanExpNetworkConfiguration(network=NETWORK,
                                                    jumbo_frame_support=USE_JUMBO_ETH_FRAMES)

# Create an object that describes the WARP v3 nodes that will be used in this experiment
nodes_config   = config.WlanExpNodesConfiguration(network_config=network_config,
                                                  serial_numbers=NODE_SERIAL_LIST)

# Initialize the Nodes
#   This command will fail if either WARP v3 node does not respond
nodes = util.init_nodes(nodes_config, network_config)

# Reset all (optional)
# for node in nodes:
#     node.reset_all()

# Extract the different types of nodes from the list of initialized nodes
#     - This will work for both 'DCF' and 'NOMAC' mac_low projects
n_ap_l   = util.filter_nodes(nodes=nodes, mac_high='AP',   serial_number=NODE_SERIAL_LIST, warn=False)
n_sta_l  = util.filter_nodes(nodes=nodes, mac_high='STA',  serial_number=NODE_SERIAL_LIST, warn=False)
n_ibss_l = util.filter_nodes(nodes=nodes, mac_high='IBSS', serial_number=NODE_SERIAL_LIST, warn=False)

# Check that setup is valid:
#     1) AP and STA
#     2) Two IBSS nodes
if len(n_ap_l) == 1 and len(n_sta_l) == 1:
#-----------------------------------------------------------------------------
# Experiment Script
#-----------------------------------------------------------------------------
print("\nInitializing experiment\n")

# Create an object that describes the network configuration of the host PC
network_config = wlan_exp_config.WlanExpNetworkConfiguration(network=NETWORK)

# Create an object that describes the WARP v3 nodes that will be used in this experiment
nodes_config   = wlan_exp_config.WlanExpNodesConfiguration(network_config=network_config,
                                                           serial_numbers=NODE_SERIAL_LIST)

# Initialize the Nodes
#   This command will fail if either WARP v3 node does not respond
nodes = wlan_exp_util.init_nodes(nodes_config, network_config)

# Set the time of all the nodes to zero
wlan_exp_util.broadcast_cmd_set_time(0.0, network_config)

# Extract the different types of nodes from the list of initialized nodes
#   NOTE:  This will work for both 'DCF' and 'NOMAC' mac_low projects
n_ap_l  = wlan_exp_util.filter_nodes(nodes=nodes, mac_high='AP',  serial_number=NODE_SERIAL_LIST)
n_sta_l = wlan_exp_util.filter_nodes(nodes=nodes, mac_high='STA', serial_number=NODE_SERIAL_LIST)

# Check that we have a valid AP and STA
if (((len(n_ap_l) == 1) and (len(n_sta_l) == 1))):
    # Extract the two nodes from the lists for easier referencing below
    n_ap  = n_ap_l[0]
    n_sta = n_sta_l[0]
else:
Ejemplo n.º 16
0
#-------------------------------------------------------------------------
#  Initialization
#
print("\nInitializing experiment\n")

# Create an object that describes the configuration of the host PC
host_config = wlan_exp_config.WlanExpHostConfiguration(
    host_interfaces=HOST_INTERFACES)

# Create an object that describes the WARP v3 nodes that will be used in this experiment
nodes_config = wlan_exp_config.WlanExpNodesConfiguration(
    host_config=host_config, serial_numbers=NODE_SERIAL_LIST)

# Initialize the Nodes
#  This command will fail if either WARP v3 node does not respond
nodes = wlan_exp_util.init_nodes(nodes_config, host_config)

# Extract the AP and STA nodes from the list of initialized nodes
n_ap_l = wlan_exp_util.filter_nodes(nodes, 'node_type', 'AP')
n_sta_l = wlan_exp_util.filter_nodes(nodes, 'node_type', 'STA')

# Check that we have a valid AP and STA
if (((len(n_ap_l) == 1) and (len(n_sta_l) == 1))):
    # Extract the two nodes from the lists for easier referencing below
    n_ap = n_ap_l[0]
    n_sta = n_sta_l[0]
else:
    print("ERROR: Node configurations did not match requirements of script.\n")
    print(
        " Ensure two nodes are ready, one using the AP design, one using the STA design\n"
    )
Ejemplo n.º 17
0
def init_experiment():
    """Initialize the experiment."""
    global n_ap, n_sta1, n_sta2, network_config, nodes, attr_dict

    print("\nInitializing experiment\n")

    # Log attributes about the experiment
    attr_dict['exp_start_time'] = log_util.convert_datetime_to_log_time_str(datetime.datetime.utcnow())

    # Create an object that describes the network configuration of the host PC
    network_config = wlan_exp_config.WlanExpNetworkConfiguration(network=NETWORK,
                                                                 jumbo_frame_support=USE_JUMBO_ETH_FRAMES)

    # Create an object that describes the WARP v3 nodes that will be used in this experiment
    nodes_config   = wlan_exp_config.WlanExpNodesConfiguration(network_config=network_config,
                                                               serial_numbers=NODE_SERIAL_LIST)

    # Initialize the Nodes
    #   This command will fail if either WARP v3 node does not respond
    nodes = wlan_exp_util.init_nodes(nodes_config, network_config)

    n_ap_l = wlan_exp_util.filter_nodes(nodes=nodes, mac_high='AP', serial_number=NODE_SERIAL_LIST)
    n_sta_l = wlan_exp_util.filter_nodes(nodes=nodes, mac_high='STA', serial_number=NODE_SERIAL_LIST)

    # Check that setup is valid
    if len(n_ap_l) == 1 and len(n_sta_l) == 2:
        # Extract the two nodes from the lists for easier referencing below
        n_ap  = n_ap_l[0]
        n_sta1 = n_sta_l[0]
        n_sta2 = n_sta_l[1]
    elif len(n_ap_l) == 1 and len(n_sta_l) == 1:
        n_ap  = n_ap_l[0]
        n_sta1 = n_sta_l[0]

        # Configure the AP to reject authentication requests from wireless clients
        #     - Uncomment this line to block any wireless associations during the experiment
        # n_ap.set_authentication_address_filter(allow='NONE')

        # Configure AP BSS
        n_ap.configure_bss(ssid=SSID, channel=CHANNEL, beacon_interval=BEACON_INTERVAL)

        # Establish the association state between nodes
        #     - This will change the STA to the appropriate channel
        n_ap.add_association(n_sta1)
        n_ap.add_association(n_sta2)
    else:
        print("ERROR: Node configurations did not match requirements of script.\n")
        print("    Ensure two nodes are ready, one using the AP design, one using the STA design\n")
        sys.exit(0)

    # Check that the nodes are part of the same BSS.  Otherwise, the LTGs below will fail.
    if not wlan_exp_util.check_bss_membership([n_ap, n_sta1]) | wlan_exp_util.check_bss_membership([n_ap, n_sta2]):
        print("\nERROR: Nodes are not part of the same BSS.")
        wlan_exp_util.check_bss_membership([n_ap, n_sta1], verbose=True)
        wlan_exp_util.check_bss_membership([n_ap, n_sta2], verbose=True)
        print("Ensure that both nodes are part of the same BSS.")
        sys.exit(0)

    # Do not set the node into a known state.  This example will just read
    # what the node currently has in the log.  However, the below code could
    # be used to initialize all nodes into a default state:
    #
    # Set each node into the default state
    for tmp_node in nodes:
        # Issue a reset command to stop current operation / initialize components
        tmp_node.reset(log=True, txrx_counts=True, ltg=True, queue_data=True) # Do not reset associations/bss_info

        # Configure the log
        tmp_node.log_configure(log_full_payloads=True)