com.sentilla.platform.tmote
Class CollectionProtocol

java.lang.Object
  extended by com.sentilla.system.DriverAdapter
      extended by com.sentilla.platform.tmote.Protocol
          extended by com.sentilla.platform.tmote.CollectionProtocol
All Implemented Interfaces:
Driver

public class CollectionProtocol
extends Protocol

Collection protocol for receiving multi-hop messages from a mote network.

This is the mote version of the collection protocol. Mote applications will use this to send messages to the host server.

This protocol requires the presence of a host server to operate. The host server will send messages periodically, allowing the motes to build routes back to that server. These routes will then be used to send messages to the server. Note that only one host server is permitted to exist in a network. If two or more host servers are present, unpredictable routing behavior will result.

The time to receive a message from a mote will vary with the number of hops in the network. It can take up to 60 seconds per hop for a message to be successfully transmitted. Care should be taken to account for this delay when developing mote applications. In addition, the when using the CollectionProtocol, the Sender.send command can take up to 60 seconds to return. This command block until a transmission is succesful, which will include all retries and backoffs. Note that if a route is not available, this command will block indefinitely until a route is available.

The maximum payload size availabe when using the collection protocol is 58 bytes. The default number of message retries is 9, the default neighbor timeout is 5 mins, the default backoff interval is 2s, and the default ACK timeout is 1.6s.

The only valid address for the collection protocol is the BroadcastAddress.

See Also:
Protocol, BroadcastAddress, Mac64Address

Nested Class Summary
static class CollectionProtocol.CSender
          Sender for the collection protocol.
 class CollectionProtocol.NeighborTable
          Data structure containing the known neighbors of a mote.
 class CollectionProtocol.RTable
          Table structure containing neighbor information.
 
Field Summary
static int ACK_TIMEOUT
          Time to wait for an ACK before retransmiting.
static int BACKOFF_INTERVAL
          Backoff interval for randomizing retransmission times.
static int BEACON_DELAY
          Max delay when forwarding the host messages.
static int COST_RATIO
          Max cost ratio
 int curHostSeq
           
static int MAX_RETRIES
          Number of times to retry sending a message.
static int MAX_SENDERS
          Max messages that can be forwarded at any time.
static int MAX_TIMEOUT
          Max timeout for neighbor table entries.
static int MTU
          Max serialized data size supported.
 short my_hash_id
           
 long my_id
           
 byte myHops
           
 
Fields inherited from class com.sentilla.system.DriverAdapter
m_nextDriver
 
Constructor Summary
CollectionProtocol()
          Creates a new CollectionProtocol object.
 
Method Summary
 short correlation(byte v)
          Calculates the LQI correlation cost.
 boolean doesInstanceMatch(Object obj)
          Returns true if the class of obj should be handled by this protocol.
 String getDriverName(int n)
          Returns the string "collect".
 void getNeighborTable(CollectionProtocol.RTable[] t)
          Copy the NeighborTable at this time into the input RTable array.
 Receiver newReceiver()
          Returns a new CollectionProtocol receiver.
 Sender newSender()
          Returns a new CollectionProtocol sender.
 void stackReceive(Receiver rcvr)
          Called by the system receive thread when a CollectionProtocol message is received.
 void stackSend(Sender s)
          Called by the system send thread when a message is sent with the CollectionProtocol.
 
Methods inherited from class com.sentilla.system.DriverAdapter
getNextDriver, setNextDriver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MTU

public static final int MTU
Max serialized data size supported.

See Also:
Constant Field Values

MAX_RETRIES

public static int MAX_RETRIES
Number of times to retry sending a message.


MAX_TIMEOUT

public static int MAX_TIMEOUT
Max timeout for neighbor table entries. Remove entries not heard from after this time.


BEACON_DELAY

public static int BEACON_DELAY
Max delay when forwarding the host messages.


BACKOFF_INTERVAL

public static int BACKOFF_INTERVAL
Backoff interval for randomizing retransmission times.


ACK_TIMEOUT

public static int ACK_TIMEOUT
Time to wait for an ACK before retransmiting.


MAX_SENDERS

public static int MAX_SENDERS
Max messages that can be forwarded at any time.


COST_RATIO

public static int COST_RATIO
Max cost ratio


my_id

public long my_id

my_hash_id

public short my_hash_id

curHostSeq

public int curHostSeq

myHops

public byte myHops
Constructor Detail

CollectionProtocol

public CollectionProtocol()
Creates a new CollectionProtocol object.

Method Detail

correlation

public short correlation(byte v)
Calculates the LQI correlation cost.


stackReceive

public void stackReceive(Receiver rcvr)
Called by the system receive thread when a CollectionProtocol message is received.

Specified by:
stackReceive in class Protocol
Parameters:
rcvr - the Receiver object containing the received data.
See Also:
Protocol, Receiver

stackSend

public void stackSend(Sender s)
Called by the system send thread when a message is sent with the CollectionProtocol.

Specified by:
stackSend in class Protocol
Parameters:
s - the Sender object containing the data to be transmitted.
See Also:
Protocol, Sender

newSender

public Sender newSender()
Returns a new CollectionProtocol sender.

Specified by:
newSender in class Protocol
Returns:
a new Sender object
See Also:
Sender

newReceiver

public Receiver newReceiver()
Returns a new CollectionProtocol receiver.

Specified by:
newReceiver in class Protocol
Returns:
a new Receiver object
See Also:
Receiver

doesInstanceMatch

public boolean doesInstanceMatch(Object obj)
Returns true if the class of obj should be handled by this protocol.

Specified by:
doesInstanceMatch in class Protocol
Parameters:
obj - object to be checked
Returns:
boolean true if object matches protocol classes
See Also:
Protocol

getDriverName

public String getDriverName(int n)
Returns the string "collect".

Specified by:
getDriverName in interface Driver
Specified by:
getDriverName in class DriverAdapter
Parameters:
n - index of driver name
Returns:
the string "collect"
See Also:
Drivers

getNeighborTable

public void getNeighborTable(CollectionProtocol.RTable[] t)
Copy the NeighborTable at this time into the input RTable array. The table contains RTable objects, with information about neighboring nodes. The array is of size TABLE_SIZE, and contains a snapshot of the neighboring nodes at the moment this method is called.

See Also:
CollectionProtocol.RTable, TABLE_SIZE


Copyright © 2007 Sentilla Corporation. All Rights Reserved.