[CUWiN-Dev] simulation for testing & protocol verification

David Young dyoung at pobox.com
Wed Feb 9 18:36:28 CST 2005


Chase has been talking to me about plugging hslsd into a simulator
for testing, debugging, and protocol verification.  Here is a summary
of changes to be made to hslsd before we can run it in a simulator.
I am assuming throughout that each simulated router will consist of a
new hslsd instance, the simulator will control the passing of simulated
time in each hslsd instance through a UNIX-domain socket, and all of the
HSLS packets will be exchanged between hslsd instances and the simulator
(who may drop/forward/damage the packets) over UNIX-domain sockets.

        * gettimeofday(2) calls need to be replaced by calls to
          a hsls_time_gettime() method of a hsls_time object.  We need
          both gettimeofday(2) and simulator-time implementations.
          The simulator-time implementation has to read (from a AF_LOCAL
          socket?) the current time from the simulator.

        * Wherever hslsd expresses a timeout in an event(3) library call,
          we need to wrap that call in something that tells the simulator
          to schedule a timeout event, and we need to invoke the right
          callback when that simulator event occurs.  (Presumably the
          simulator will indicate the event on an AF_LOCAL socket.)

        * hslsd needs to support a third address family, AF_LOCAL.  hslsd
          needs to put a fake network header in front of the HSLS packets
          it sends over AF_LOCAL sockets.

        * hslsd needs to bind(2) UNIX paths given by -a options.
          It needs to understand UNIX paths in -p options.

        * hslsd may need to interpret prefix lengths differently for
          AF_LOCAL sockaddrs than for AF_INET{,6} sockaddrs.

        * The socket library needs improvements to deal with AF_LOCAL
          sockets.

The simulator has to change, also.  It has to connect with all of the
hslsd instances' sockets, it has to send them its notion of the current
time over sockets every simulator step, and so on.

There are other ways to approach this problem.  Chase suggested making
a library libhsls out of hslsd, linking that library with a simulator,
and letting the simulator instantiate hsls_router objects and hand them
references to "received" packets, etc.  My main concern with doing it
that way is that there is no isolation: if we have several instances of
a potentially buggy hslsd under test, and they run in the same address
space, then tripping over a bug in one instance might kill off one or
more other instances.  A secondary concern is that more invasive changes
may be necessary to turn hslsd into a library for simulation than to
run several hslsd instances.

Dave

-- 
David Young             OJC Technologies
dyoung at ojctech.com      Urbana, IL * (217) 278-3933


More information about the CU-Wireless-Dev mailing list