Resource Paths

Resource paths are used in any section of the ED.

A resource path allows the access and the value assignment of a specific configuration parameter of a resource.

Resource paths follow a hierarchical organization, and have the following syntax:

<resource_selector>.<hierarchical_path>

For example, some valid resource paths are:

allGroups.net.w0.type                 # where the selector is 'allGroups'
group("myGroupOfNodes").net.w0.mode   # where the selector is 'group("myGroupOfNodes")'
node.net.w0.ip                        # where the selector is the variable 'node'

In the above first example, allGroups is the <resource_selector> and net.w0.type is the <hierarchical_path>.

Please refer to the descriptions of the 'group' command and 'allGroups' command for detailed information on how to use them.

Let us focus on the first example: allGroups.net.w0.type

  • The resource selector allGroups means that we want to access a specific parameter for all the resources in all the groups declared in this experiment.
  • The hierarchical path net.w0.type defines this specific parameter we are interested in:
    • the 1st part: net means that we are interested in a network parameter of the resource(s)
    • the 2nd part: w0 means that we are interested in a specific network parameter of the first 802.11 wireless card of the resource(s)
    • the 3rd part: type means that we are interested in the type attribute of this specific 802.11 card

Therefore, the following usage of this same resource path example:

allGroups.net.w0.type = g 

means that we want all the first 802.11 wireless network card of all the resources in all the declared group, to be configured in 'g' type (i.e. 802.11g type).

The following table provide the full list of existing valid hierarchical paths:

Hierachical Path Desciptions Usage Examples
1st part 2nd part 3rd part
net This specifies that this path is accessing a network parameter on the resource(s)
e0, e1, w0, w1 This specifies that this path is accessing a parameter of the 1st or 2nd Ethernet or 802.11 wireless interface on the resource(s)
ip The IP Address to use for this interface. net.e0.ip = "10.0.0.1"
netmask The netmask to use for this interface. net.e0.netmask = "255.0.0.0"
down Turn this interface off. net.e1.down
up Turn this interface up. net.w0.up
mtu Set the MTU for this interface net.w1.mtu = "1024"
mac Set the MAC address for this interface (only if supported by the driver) net.e1.mac = "01:23:45:56:78:9a"
route Set an IP route rule, which will be associated with this interface.
The IP rule is given as a Hash with the following keys:

- :op   the operation to perform 
        'add' or 'del' (delete) a route
- :net  the network or host IP address to route to
- :gw   the gateway IP address to use (optional)
- :mask the IP mask touse (optional)

Examples:

  net.e1.route({:op => 'add', :net => '10.42.0.0', 
                :gw => '10.40.0.20', :mask => '255.255.0.0'})

  net.e1.route({:op => 'del', :net => '10.43.0.0'})
filter Set an packet filtering rule, which will be associated with this interface.
The filter rule is given as a Hash with the following keys:

- :op     the operation to perform 
          = 'add' to add a filter
          = 'del' to delete a filter
          = 'clear' to delete all filters

- :chain  the chain for this filter 
            (only 'input' is supported now)

- :target what to do with matching packets 
          (only 'drop' is supported now)

- :proto  the protocol on which to filter (optional)
          = 'mac' to filter based on the packet's MAC header
                 :src  = the MAC source to filter (required!)
          = 'tcp' or 'udp' to filter TCP or UDP packets
                 :src   = source IP address (optional)
                 :dst   = destination IP address (optional)
                 :sport = source port (optional)
                 :dport = destination port (optional)

Examples:

  net.e1.filter({:op => 'add', 
                 :chain => "input", 
                 :target => "drop"})

  net.e0.filter({:op => 'clear'})

  net.e1.filter({:op => 'del', 
                 :chain => "input", 
                 :target => "drop",
                 :proto => "mac", 
                 :src => "00:23:6c:8d:f8:9a"})

  net.e0.filter({:op => 'add', 
                 :chain => "input", 
                 :target => "drop",
                 :proto => "tcp", 
                 :src => "192.168.0.1", 
                 :sport => "5000",
                 :dst => "192.168.0.2", 
                 :dport => "6000"})
w0, w1 This specifies that this path is accessing a parameter of the 1st or 2nd 802.11 wireless interface on the resource(s)
mode The operation mode of this 802.11 wireless interface, valid values are: adhoc, master, managed net.w0.mode = 'a'
type The type of this 802.11. wireless interface, valid values are: a, b, g net.w1.mode = 'g'
rts Request this 802.11. wireless interface to add an RTS/CTS handshake before each packet transmission to make sure that the channel is clear. The valid values are: aSize, auto, fixed, off. Using an integer for aSize sets the size of the smallest packet for which the node sends RTS; a value equal to the maximum packet size disables the mechanism.
rate The bitrate to use for this 802.11 interface.
essid The 'Extended Service Set Identifier' to use for this 802.11 interface, i.e. the identifying name for the given wireless network to which this 802.11 interface should associate. net.w0.essid = 'MyNet'
channel The channel number to use for this 802.11 interface. The range of valid channel numbers depend on the working type of this interface (i.e. 802.11a and 802.11b use different channels number). net.w1.channel = '6'
tx_power The transmission power to use for this 802.11 interface.
enforce_link The system tool to use to enforce a previously define MAC filtering table for this 802.11 interface. Valid tool names are: iptable, ebtable, mackill. For more information on how to use this feature, please refer to this tutorial A detailed example in this tutorial