• Leigh B. Stoller's avatar
    The core of the wireless support code. · 86155d03
    Leigh B. Stoller authored
    * ptopgen:
       1. Change to using interface_capabilities table to get the default
          speed for an interface type.
       2. The wrinkle is that an interface can have multiple speeds,
          depending on the protocol that is requested. In the wireless case the
          table looks like:
    	| type             | capkey            | capval               |
    	| ath              | protocols         | 80211a,80211b,80211g |
    	| ath              | 80211a_defspeed   | 54000                |
    	| ath              | 80211b_defspeed   | 11000                |
    	| ath              | 80211g_defspeed   | 54000                |
       3. We use the above info to tell us the default speed for links, based
          on the particular protocol.
       4. And lastly, create "air" switches for each of 80211a, 80211b, 80211g,
          and specify links from the switches to the nodes that have interfaces
          that support those protocols. At the moment, there is a hardwired
          list of 80211a, 80211b, 80211g in ptopgen, so create 3 new air
          switches and links from each of the nodes to each of the switches.
          Rob says that assign can handle this just fine (using the same
          interface on a node to connect to three different air switches, at
          different speeds).
    * assign_wrapper:
       1. First off, I had to increase the bogousity factor of how we determine
          that a delay node is required (requires_delay() routine) on a link or
          lan. Using the interface_capabilities table, I determine the default
          speed for each protocol on each interface type.
       2. When calling requires_delay() I now the pass the lan so that we can
          get the "protocol" of the link/lan and use that to find the default
          speed. The main reason for all this crud is that if a user specifies
          a bandwidth of 54Mb on a wired ethernet, we want to make sure we
          insert a delay node, but not if the user is using 80211g. As it was,
          delay nodes would be skipped cause there are now nodes with
          interfaces that support those speeds. This change also allows to know
          that a delay node should be inserted on a wireless link, if we ever
          wanted to do something as silly as that!
       3. Okay, so now onto the actual wireless support!  Whenever the protocol
          for a lan is not "ethernet" spit out links to fake lan nodes, sorta
          like we used to do with ethernet lans before Rob made all those great
          changes to assign. So, a lan with protocol 80211a will get fake links
          to the 80211a air switch that ptopgen spits out (see above).  We
          currently bypass all delay node processing on wireless lans, and in
          fact we avoid most post-processing (after assign) of wireless lans
          (no vlans, veths, etc). At some point we can bring certain things
          back in (like emulated links) but that will be some time! See
          comments above about ptopgen.
       4. Added a section to copy over the virt_lan_settings and
          virt_lan_member_settings to the interface_settings table, for each
          node's interfaces in the mapped experiment. I also make up the ssid
          for the lan, and add the protocol to the settings so that the client
          side knows what it is supposed to do. I also set the acesspoint since
          that requires MAC addresses, and this is easiest place to get and set
          the MAC (all of the nodes in a lan need to know the MAC of the node
          acting as the access point). In the virtual topology, the accesspoint
          is specified as a node name.
    * tbsetup/ns2ir:
       1. Add tb-set-lan-protocol(lan, protocol) to set the protocol to one of
          ethernet, 80211a, 80211b, 80211g. Defaults to ethernet.
       2. Add tb-set-lan-accesspoint(lan, accesspoint) to set the name of the
          access point for a lan. Obviously this makes sense for only wireless
          links; ignored for wired links.
       3. Add tb-set-lan-setting(lan, setting, value) to specify a setting that
          applies to the entire lan. At present, these are ignored for wired
          lans. Both setting and value are strings.
       4. Add tb-set-node-lan-setting(lan, node, setting, value) to specify a
          setting that applies to a particular node in a lan. At present, these
          are ignored for wired lans. Both setting and value are strings.