Programs in Java for testing and simulations of RBO.

RBO is a simple and robust broadcast-scheduling protocol minimizing 'tuning-time/energy' of the receiver. It's idea is based on an interesting property of the bit-reversal permutation. The broadcast cycle is a sorted sequence of keys of length 2^k, permuted by k-bit-reversal permutation. The broadcast cycle is broadcast in 'round-robin' fashion by the sender. The receiver wants to receive some key from the broadcast cycle. It uses a simple RBO protocol that listens to some samples of the broadcast cycle. It may start at any time during the broadcasting and, due to the properties of bit-reversal, the number of samples to be received is very low, thus saving the energy consumed by the radio receptions.

Informal description of the protocol with references to the technical reports can be found at: https://sites.google.com/site/rboprotocol/

This directory contains a prototype of the RBO protocol with a simple test application (and some other code in Java used for testing RBO).

The files Rbo*.java contain implementation of the modules of the protocol.

The files Tiny*.java contain emulations of the TinyOS components used by RBO.

The files *Events.java are specifications (parts of module's interfaces) of the events signalled by the corresponding modules.

To compile the programs run in this directory:

javac *.java

SIMPLE TEST APPLICATION:

To start simple test application of the protocol run:

java TestApplication logSequenceLength timeSlotLength

where logSequenceLength is logarithm of the length of the transmitted sequence (here it should be less than 30 - we are using Java type int) and timeSlotLength is the time between transmissions of consecutive elements (in milliseconds) This program creates two windows: for the sender and for the receiver. (* Note that, initially, one window may be covered by the other. Use the mouse to relocate them. *) The keys in the sequence broadcast by the sender are consecutive positive odd numbers (starting from 1), while the receiver selects as the searched key a random integer between 0 and 1+(maximum of the broadcast sequence). There is also simple menu in the terminal for printing statistics and stopping/restarting the receiver/sender.

The messages in the receivers' window are printed after completion of each search. They look like this:

50.searchDone: ERR:2 MSG: H:ID=2 LSL=13 TSL=2 KEY=15769 RNK=7884 P:7884

ERR - status of the result ( 0 - SUCCESS, 1 - TIME_OUT, 2 - KEY_NOT_PRESENT) ID - sequence ID LSL - logarithm of sequence length TSL - time of sequence length KEY - the key in last received message RNK - rank of the key P - payload

The messages in the senders' window are printed after each round of sequence transmission.

The time in statistics is given in milliseconds.

(* Note that it is 'real-time' simulation. Hence, the time intervals between subsequent messages may be quite long for large broadcast cycles. *)

The author can be reached at: Marcin.Kik@pwr.wroc.pl or mki1967@gmail.com