4,367.25ms respectively). The final stage of the process is the establishment of the data
communication streams, the World with three devices required 2,136.5ms while the
World of size two required 1,251ms. In the case of a World with two nodes the Master
was a Nokia 6680 and the Slave a Nokia 6630. The world with three nodes again had
the same device for the Master and both a 6680 and 6630 as the slave devices.
The creation of the data streams in the case of a World with three devices took
significantly longer than that of the World with two, this is due to the establishment of
additional Server and Client connections. This was necessary to create a fully connected
mesh network as opposed to the standard Bluetooth style (star) network topology of a
piconet. Hence the extra time represents the establishment of a Server connection on
device 1 and the communication to device 0 that it has been established. As each Client
can have many Server connections listening for Clients to connect, it is essential to
synchronize the establishment of these connections. The first step is for device 1 to
establish a Server connection. This device will then send a message back to the root
node. Included in the message is the address of the newly created Server connection.
The root will then forward the message to the required Client (Client 2). On receiving
the message Client 2 can then open a connection to the Server of Client 1.
2.4 Communication
In MMPI Point to Point communication is carried out using the send(. . .) , recv(. . .)
methods, in the same manner as MPI itself. The sending and receiving of data is carried
out by specifying the device number to which data is to be sent, and the device number
from where to data will be received from. In MPI programming a Send on one node
must match up with a Receive on the destination node. Hence if you send some data
from device 0 to device 1, device 1 must have a corresponding recv(. . .) method with
device 0 specified as the device to receive from. Data is sent in the form of an Array
of data which is in turn passed to the MMPI methods in the form of an standard java
Object. The parameters required by these methods include: the input or output buffers,
the starting position of the array, the number of elements to send or receive, the data
type and the identifier of the node with which data will be sent to or received from.
One can achieve global communication with all nodes of the world by using a for
loop and sending the data using the send(. . .) , recv(. . .) to each device. This is where
collective communication methods are of use where by a node can for example send
some data to all devices with just a single method call. This may be achieved by using
methods such as Scatter, Gather and Broadcast.
A Logical Link Control and Adaptation Protocol (L2CAP) packet can have a maxi-
mum of 2
16
− 1 bytes of data payload [21]. Asynchronous Connection Less (ACL) links
have a maximum payload size of 339 bytes [22]. The Radio Frequency Communication
(RFCOMM) (used in the MMPI library) layer emulates RS-232 serial ports and serial
data streams. RFCOMM relies on L2CAP for multiplexing multiple concurrent data
streams and handling connections to multiple devices. The majority of Bluetooth pro-
files use this protocol due to it ease of use over direct interaction with the L2CAP layer.
The testing of the communication times between two devices was carried out in two
differing manners. In the first example a flag is sent to the receiver device to indicate
that it should get the start time and begin receiving the actual data. On receipt of all the
79