1. 15 Dec, 2003 1 commit
    • Shashi Guruprasad's avatar
      Distributed NSE changes. In other words, simulation resources are · d266bd71
      Shashi Guruprasad authored
      now mapped to more than one PC if required. The simnode_capacity
      column in the node_types table determines how many sim nodes can
      be packed on one PC. The packing factor can also be controlled via
      tb-set-colocate-factor to be smaller than simnode_capacity.
      
      - No frontend code changes. To summarize:
        $ns make-simulated {
          ...
        }
        is still the easy way to put a whole bunch of Tcl code to be
        in simulation.
        One unrelated fix in the frontend code is to fix the
        xmlencode() function which prior to this would knock off
        newlines from columns in the XML output. This affected
        nseconfigs since it is one of the few columns with embedded
        newlines. Also changed the event type and event object type
        in traffic.tcl from TRAFGEN/MODIFY to NSE/NSEEVENT.
      
      - More Tcl code in a new directory tbsetup/nseparse
        -> Runs on ops similar to the main parser. This is invoked
           from assign_wrapper in the end if there are simnodes
        -> Partitions the Tcl code into multiple Tcl specifications
           and updates the nseconfigs table via xmlconvert
        -> Comes with a lot of caveats. Arbitrary Tcl code such as user
           specified objects or procedures will not be re-generated. For
           example, if a user wanted a procedure to be included in Tcl
           code for all partitions, there is no way for code in nseparse
           to do that. Besides that, it needs to be tested more thoroughly.
      
      - xmlconvert has a new option -s. When invoked with this option,
        the experiments table is not allowed to be modified. Also,
        virtual tables are just updated (as opposed to deleting
        all rows in the first invocation before inserting new rows)
      
      - nse.patch has all the IP address related changes committed in
        iversion 1.11 + 2 other changes. 1) MTU discovery support in
        the ICMP agent 2) "$ns rlink" mechanism for sim node to real
        node links
      
      - nseinput.tcl includes several client side changes to add IP
        routes in NSE and the kernel routing table for packets crossing
        pnodes. Also made the parsing of tmcc command output more robust
        to new changes. Other client side changes in libsetup.pm and other
        scripts to run nse, are also in this commit
      
      - Besides the expected changes in assign_wrapper for simulated nodes,
        the interfaces and veth_interfaces tables are updated with
        routing table identifiers (rtabid). The tmcd changes are already
        committed. This field is used only by sim hosts on the client side.
        Of course, they can be used by jails as well if desired.
      d266bd71
  2. 18 Nov, 2003 1 commit
    • Leigh B. Stoller's avatar
      Minor additions for Shashi: · def28c32
      Leigh B. Stoller authored
      * Make the NS file an optional argument to swapexp modify; when not
        given the prerun phase is skipped. Instead, go directly to tbswap
        (run assign, etc).
      
      * Add NSESWAP event so that Shashi can fire off the above modify using
        tevc from an experimental node.
      
      	tevc -e pid/eid now ns nseswap
      
      * Change event scheduler to react to above event, and fire off:
      
      	nseswap pid eid
      
        as the user. The script should do its thing, and *exec* swapexp with
        the proper args as quickly as possible (so that the event scheduler
        is not hung up for too long. The script is invoked as the user,
        since the event scheduler is running as the user.
      def28c32
  3. 05 Nov, 2003 1 commit
    • Leigh B. Stoller's avatar
      Middle part of the event system changes. The main part of this change · 54bc15c4
      Leigh B. Stoller authored
      is to add HMACs to events to ensure they that events cannot be
      injected into an experiment by an unauthorized client.
      
      * The frontend now generates a secret key for each experiment and
        stores that into a file and in the DB.
      
      * Each of the event clients, as well as the event producers
        (scheduler, tevc) have a new -k option to specify the name of the
        file. Two new event library functions were added for clients to give
        the key:
      
          event_handle_t
          event_register_withkeyfile(char *name, int threaded, char *keyfile);
      
          event_handle_t
          event_register_withkeydata(char *name, int threaded,
      	   		       unsigned char *keydata, int keylen);
      
      * When the library is in possesion of a key, it will generate an HMAC
        and attach it to outgoing notifications. A client receiving a
        notification will compute an HMAC and compare it against the HMAC in
        the notification. If they do not compare, the notification is
        dropped with a warning message printed (the client callback never
        gets the notification). If the client has not provided a key, then
        the HMAC in the incoming notification is ignored.
      
      * The scheduler also takes a -k option, and will compute HMACs for all
        of the static events ahead of time. That keeps it off the critical
        path.
      
      * The tevc client also takes a -k option. However, tevc will always
        try to find the keyfile (default path) so that it can attach the
        HMAC to dynamic events before sending them to the scheduler (which
        will check to make sure it matches). The scheduler will not accept
        dynamic events without unless the HMAC is present and matches.
      
      * I have rebuilt the elvin librarys, removing all of the X goop and
        the SSL goop. Smaller binaries. So, I had to add -lcrypto to all of
        the client makefiles to that programs link.
      
      * The program-agent got a few more changes. The command string is no
        longer passed inside the event; it comes in when the program agent
        is started, via a config file generated from tmcd data. This gets
        rid of our mostly insecure remote execution facility.
      54bc15c4
  4. 01 Aug, 2003 1 commit
  5. 01 May, 2003 2 commits
    • Leigh B. Stoller's avatar
      Fix minor bug. · 758ff8f8
      Leigh B. Stoller authored
      758ff8f8
    • Leigh B. Stoller's avatar
      Add the long desired halt/swap event directives. You can now put this · 5116cd33
      Leigh B. Stoller authored
      in your NS file:
      
      	$ns at 2000.0 "$ns halt"
      or
      	$ns at 2000.0 "$ns swapout"
      
      The first causes the experiment to terminate, the later causes it to
      swap out. I know some wiseass is going to ask for a swapin event!
      You can also send these events from tevc:
      
      	tevc -e testbed/stopme now ns halt
      or
      	tevc -e testbed/stopme now ns swapout
      
      Does it need to be said that this is insecure? That we could get swap
      wars going on as people try to get nodes for their experiments by
      swapping out someone else? Well, if that happens we will apply the big
      hammer and squash their nuts.
      
      Details: I added an SIMULATOR "agent", and HALT/SWAPOUT event types in
      the usual places. In the event scheduler, SIMULATOR events are treated
      specially (not actually sent anywhere), but handled internally. Very
      convenient, cause the scheduler runs as the person who swapped the
      experiment in, and so I just run either swapexp or endexp, right from
      the scheduler. At some point we need to give the permission issue some
      thought.
      5116cd33
  6. 15 Apr, 2003 1 commit
  7. 28 Feb, 2003 1 commit
    • Leigh B. Stoller's avatar
      Allow for the vnode in the virt_agents entries to be a "wildcard" · 494c0610
      Leigh B. Stoller authored
      (okay, a "*") in which case it means to not insert a specific node_id
      into the event, but rather leave it to the subscribers to specify
      what they need (in the case of the delay agent pid/eid/lan/lan-vnode.
      The new assign_wrapper inserts these entries like this. Old stuff will
      continue to work of course.
      494c0610
  8. 12 Sep, 2002 1 commit
  9. 10 Jul, 2002 1 commit
  10. 07 Jun, 2002 1 commit
  11. 23 May, 2002 1 commit
  12. 06 May, 2002 2 commits
  13. 23 Apr, 2002 1 commit
    • Leigh B. Stoller's avatar
      Fix original source error; A dynamic event with a shorter timeout did not · fec09f29
      Leigh B. Stoller authored
      interupt the current next up event cause Ian's code just grabbed it
      off the queue and went into select. I converted this code to use a
      condition variable and a timed wait. If a new event comes in, signal
      the waiter who can recheck to see of the head of the queue has
      changed. Seems to work, but not well tested. This bug reported by Rob!
      fec09f29
  14. 22 Mar, 2002 1 commit
    • Leigh B. Stoller's avatar
      Add code to the parser to populate a new virt_agents table, which · 2917542a
      Leigh B. Stoller authored
      provides a mapping from an object ($cbr0) to the node on which the
      agent is running ($nodeA). It also includes the type of agent
      (TRAFGEN, LINK, etc). There were a number of reasons for adding this
      table:
      
      * To avoid a series of specialized table lookups in the event
        scheduler to map from a name (link0) to the node on which the agent
        is running. Previously, it was looking the delays table and the
        virt_trafgens table. Well, now it just needs to look at this one
        table and store the mapping internally. When a dynamic event comes
        in, we can figure out where to send it easily.
      
      * For NSE traffic generation. Unlike the simple TG based CBRs, Shashi
        wants to be able to send events to any of the objects in the config
        (udp0, telnet0, ftp0, etc). Well, the virt_trafgens table certainly
        does not store that info, and it would have been painful to work
        this into it. For every agent/application, just add an entry in the
        virt_agents table and the scheduler knows where to send the events.
      
      * It nicely supports the new program object; just plug an entry in the
        virt_agents table.
      
      Okay, there is one messy aspect; delays nodes! Delay nodes are not
      computed until after assign wrapper runs, so in addition to munging
      the static event list in assign_wrapper, we now munge the virt_agents
      table as well. Not much to do about this; delay nodes are handled
      outside the normal path everywhere.
      2917542a
  15. 18 Mar, 2002 1 commit
    • Leigh B. Stoller's avatar
      First cut at dynamic events. Current status is this: · bf806164
      Leigh B. Stoller authored
      1. The tevc client can run on either a client node or on users. The
         command line syntax is like this:
      
      	Usage: ./tevc [-s server] [-c] event
      	       ./tevc [-s server] -e pid/eid time objname event [args ...]
      	       time: 'now' or '+seconds' or [[[[yy]mm]dd]HH]MMss
      	Examples:
      	       ./tevc -e pid/eid now cbr0 set interval_=0.2
      	       ./tevc -e pid/eid +10 cbr0 start
      	       ./tevc -e pid/eid +20 cbr0 stop
      
         The -s arg defaults to BOSSNODE when not given. Only root can send
         TBCONTROL events (-c), but that part of tevc is probably going to be
         killed off when we convert to sending TBCONTROL via tmcc/tmcd (Rob
         is working on that). The -e option is required for dynamic events,
         and is not defaulted yet.
      
      2. There is no real checking of arguments. The event is sent over to
         the scheduler, which tries to map it into an agent running on a
         node. If the map fails (say, no such trafgen, or no delay node on
         that link), or if the event makes no sense for that agent, the
         event fails and the user never hears about it. The solution for
         this is a back channel so that the scheduler can generate an error
         condition that the user sees.
      
      3. To facilitate better checking, I think we need to change the DB
         tables so that there is a mapping between the type of agent
         (object) and the kinds of events it can take. This would replace
         the flat event_eventtypes table. The event_scheduler could load
         this table at init time so that it can do a quick check on dynamic
         events when they arrive and return an error when we support error
         values.
      
      4. The scheduler initialization phase tries to determine what agents
         are valid for an experiment (thats where you can send events) so
         that when a user sends an event to cbr3, the event scheduler can
         determine what/where that is. My method for determining this is
         totally ad-hoc right now; read the virt_trafgens and delays table.
         These are the only two types of configurable agents we support.
         This is rather bogus! I think assign_wrapper or some other script
         in the front end needs to collect this data into a single table for
         the scheduler to read. Not sure yet; needs more thought. Anyway, I
         build a mapping table that can be searched when a dynamic event
         comes in; this avoids a DB table lookup in the critical path.
      bf806164
  16. 06 Mar, 2002 1 commit
  17. 05 Mar, 2002 1 commit
  18. 26 Feb, 2002 2 commits
  19. 25 Feb, 2002 1 commit
  20. 21 Feb, 2002 1 commit
    • Leigh B. Stoller's avatar
      Some whacking of the event system. I have implemented the addressing · 8305021f
      Leigh B. Stoller authored
      scheme that we discussed in email. Notifications and subscriptions now
      take an "address_tuple" argument (I know, crappy name) that is a
      structure that looks like this:
      
      	char		*site;		/* Which Emulab site. God only */
      	char		*expt;		/* Project and experiment IDs */
      	char		*group;		/* User defined group of nodes */
      	char		*host;		/* A specific host */
      	char		*objtype;	/* LINK, TRAFGEN, etc ... */
              char		*objname;	/* link0, cbr0, cbr1, etc ... */
              char		*eventtype;	/* START, STOP, UP, DOWN, etc ... */
      
      These can be a specific value, ADDRESSTUPLE_ANY if you are a
      subscriber, or ADDRESSTUPLE_ALL if you are a producer. The reason for
      the distinction is that you can optimize the match expression with the
      extra bit of information, and the above structure can make for a
      fairly lengthy match expression, which takes more time of course.
      You should use address_tuple_alloc() and address_tuple_free() rather
      than allocating them yourself. Note that host above is actually the
      ipaddr of control interface. This turns out to be more convenient
      since free nodes do not have virtual names.
      
      Also added a new tbgen directly. This directory includes 3 programs in
      the making:
      
      tbmevd: Is the Testbed Master Event Daemon, to be run on boss and will
      handle TBCONTROL events (reboot, reload, etc). It is just a shell of a
      program right now, that takes the events but does not do anything
      useful with them. Have not defined what the events are, and what DB
      state will be modified.
      
      tbmevc: Is the Testbed Master Event Client (akin to tmcc). It
      generates TBCONTROL events which the tbmevd will pick up and do
      something useful with. This program is intended to be wrapped by a
      perl script that will ask the tmcd for the name of the boss (running
      the event daemon).
      
      sample-client: This is a little client to demonstrate how to connect
      to the event system and use the address tuple to subscribe to events,
      and then how to get information out of notifications.
      
      Note that I have not created a proper build environment yet, so new
      programs should probably go in the event dir for now, and link using
      the same approach as in tbgen/GNUmakefile.in.
      8305021f
  21. 19 Feb, 2002 2 commits
  22. 29 Jan, 2002 1 commit
    • Ian Murdock's avatar
      Rewrote event scheduler. Event system clients may now call · 29563eb0
      Ian Murdock authored
      event_schedule (see event library), which essentially operates as a
      deferred event_notify. event_schedule accepts a notification and a
      firing time, alters the notification to change the type attribute to
      EVENT_SCHEDULE and add a firing time attribute, and then sends the
      altered notification using event_notify.  The event scheduler
      subscribes to EVENT_SCHEDULE notifications. As they arrive,
      it restores the type in the notification to that of the
      original event and enqueues the notification in a priority queue
      for firing at the indicated time. When the time arrives, the
      scheduler removes the notification from the queue and resends it
      using event_notify.
      
      With these changes, the event system now supports dynamic events.
      29563eb0
  23. 04 Dec, 2001 1 commit
  24. 06 Nov, 2001 1 commit
  25. 01 Nov, 2001 1 commit