Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This script maintains a stack (array) of registered motes that have sent a discovery packet to it.  It maintains a pointer which rotates through the stack.

Analysis

Here is a screenshot of wireshark whilst the ringmaster and simulator is running at some point in time

Image Added

 

Notice some interesting packets:

packet #13 - A CoAP packet is captured from the localhost to mote bbbb::1415:92cc:0:2 (mote 2 in simulation).  This is the packet that is sent when sending a GET request to the 'rt' resource of mote 2 through Firefox Copper (CoAP Interaction#CoAPdiscovery).  In the context of ringmaster, this triggers the mote to be online

packet #17 - a UDP packet headed for localhost from mote 2.  This packet has the simple message 'D' in its payload, representing Discovery. Notice the Source port is 5683, the default port for COAP communication, while the destination is 15000, the hardcoded port I chose for the ringmaster to listen on.

packet #22 - A CoAP PUT packet telling the mote that it has been confirmed as registered by the ringmaster

packet #28 - ringmaster tells packet 2 to perform action 'B' - in this case, blink

 

Here is a simple ringmaster output, as of this writing:

Image Added

The output here is fairly arbitrarily, used just for demonstration purposes.  First, the ringmaster is started, where it waits for incoming messages.  At some point, it received a discovery message from mote 2, after which it sends a confirmation message via CoAP PUT. Then, it sends an action B to the same mote, as it now has a mote queue to work with.  When the mote blinks, it notifies the ringmaster.  Seeing as there is only one mote in the queue at the time, the ringmaster tells mote 2 to forward an action to another ipv6, which in this case is the same one.  Only after mote 3 gets registered can we start seeing oscillation between the two motes performing actions.