2.
Using these time stamps we can calculate the offset between coordinator and end point time, and the round
trip delay due to the ZigBee communication.
● ffset θ ) (t )] / 2O = = [(t1 − t0 − 2 − t3
● elay δ t ) (t ) D = = ( 3 − t0 − 2 − t1
With these calculated statistics, we can come up with a plan on synchronizing an event between BeagleBone
Black boards over the ZigBee network.
Implementation details
To implement our authentication system we utilize two BeagleBone Blacks (BBB) and two Zigbee Xstick usb
modules to enable a wireless serial link between the two BBB. Our system is written using the GO language
platform and utilize the time, format, OS, syscall, unsafe, and a C library for getting cycle counts. For simplicity,
the two BBB are set to run at 1 Ghz, which results in a 1 nanosecond clock period. Using this simplification, we
can easily convert number of cycles to a time duration in nanoseconds.
The first thing our two node system does is synchronize their times with each other. This is described in the
previous section under “Analyzing time synchronization through delay and offset statistics.” Once the two BBB
have been synced with each other, one board sends the request for key authentication to be received
sometime in the future from now. Prior to sending the request, the coordinating board will begin a cycle timer
to enforce the lower bound requirement within the acceptance window. The cycle timer is implemented
through constantly calculating the difference in cycle counter values until the difference is equal or greater
than the necessary time. If the key is received before the timer expires then the authentication fails. On the
other end, the second BBB in our system receives the key request and will wait until the appropriate amount
of time based on the time synchronized information of the system before sending the key over to the
coordinating BBB. The waiting is implemented through the same methodology as the cycle timer in the
coordinating board. Calculating the difference between cycle counter reads proved to be significantly more
accurate than using any kind of sleep function provided by either the C language environment or the Go
language environment. The coordinating BBB then checks to make sure that the key is received within the
upper bound of the acceptance window. If the key is not received during the specified period (as enforced
through the lower bound timer and the upper bound timer), the authentication mechanism fails. More
information concerning window size and other system characteristics can be found in the characterization
sections.
In our implementation, we have determined that the offset that was calculated during time synchronization is
unnecessary for coordinating our synchronized event of key authentication. This simplification is due to the
timing characteristics of the two BBB. Because each BBB is set to run at the same frequency, the time
progression is identical in each of the boards. Therefore a fixed delay in one board represents the same fixed
delay in the other board. The only corrections that have to be applied in the receiving board is to account for
the delays of transmitting information wirelessly from one BBB to another BBB through the Zigbee stack.
The demo portion of our application involves triggering an event of some kind depending on the success of the
authentication. Our demonstration uses two LEDs through two GPIO ports on the coordinating BBB. When the
application is locked, one of the two LEDs will be on. When the application is unlocked through authentication,
6.
each of the Zigbee modules was set to correspond to the address of the other module, a point to point link
was established and performance should improve.
Characterization of final optimized implementation
One issue that is still unresolved is related to starting up the Zigbee stick on the endpoint board. After the
board powers up, the Zigbee stick maintains a solid LED. However, once our application is executed for the
first time the LED turns off for some undefined duration before powering back on. We currently do not have
an explanation for this particular behavior between the USB module and the BBB.
TTYUSB0
(VCP)‐broadcast
TTYUSB0 (VCP)‐P2P D2XX
Average Round Trip
Delay
259222500 ns / 259.223
ms
42118500 ns / 42.119 ms 63595000 ns / 63.595 ms
Average Jitter to Round
Trip Delay
55505158 ns / 55.505 ms 6755530 ns / 6.756 ms 2326480 ns / 2.326 ms
Window Size 500 ms 100 ms 100 ms