jist.swans.route
Class RouteZrpBrp

java.lang.Object
  extended by jist.swans.route.RouteZrpBrp
All Implemented Interfaces:
Protocol, Timer, RouteInterface.Zrp.Brp

public class RouteZrpBrp
extends java.lang.Object
implements RouteInterface.Zrp.Brp, Timer

Zone Routing Protocol: Bordercast Resolution (sub)Protocol: Default implementation.

Since:
SWANS1.0
Version:
$Id: RouteZrpBrp.java,v 1.17 2004/04/06 16:07:50 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
private static class RouteZrpBrp.MessageBrp
          BRP (Bordercast Resolution Protocol) packet.
static class RouteZrpBrp.QueryCoverageEntry
          BRP query entry.
static class RouteZrpBrp.QueryKey
          BRP query key.
 
Field Summary
static long COVERAGE_LIFETIME
          query coverage expiration.
static long COVERAGE_REFRESH
          query coverage refresh timer (check for expiration).
static long JITTER
          brp delivery jitter.
static org.apache.log4j.Logger logBRP
          logger for BRP events.
private  java.util.HashMap queryCoverage
          bordercast supression table: QueryKey - QueryCoverageEntry.
private  RouteZrp zrp
          reference to zrp routing framework.
 
Constructor Summary
RouteZrpBrp(RouteZrp zrp)
          Create new "default" BRP (ZRP sub-protocol) handler.
RouteZrpBrp(RouteZrp zrp, java.lang.String config)
          Create new "default" BRP (ZRP sub-protocol) handler.
 
Method Summary
private  NetAddress[] bordercastNeighbours(java.util.Vector from)
          Compute first hop in bordercast tree (without minimization).
private  NetAddress[] bordercastNeighbours2(java.util.Vector from)
          Compute first hop in bordercast tree using greedy neighbour minimisation heuristic.
private  java.util.Map computeClosestNeighbours()
          For each node in the zone, compute the set of closest neighbours.
private  RouteZrpBrp.QueryCoverageEntry getQueryCoverageEntry(NetAddress src, short seq, boolean target)
          Return query coverage entry for given source and identifier.
private  java.util.Collection getUncoveredPeripheral(java.util.Vector from)
          Return all the uncovered peripheral nodes.
 void receive(RouteInterface.Zrp.MessageBrp msg, NetAddress from)
          Process incoming BRP packet.
 void send(RouteInterface.Zrp.MessageIerp msg)
          Bordercast a query.
 void start()
          Start running protocol.
 void timeout()
          Timer expiration processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logBRP

public static final org.apache.log4j.Logger logBRP
logger for BRP events.


COVERAGE_LIFETIME

public static final long COVERAGE_LIFETIME
query coverage expiration.

See Also:
Constant Field Values

COVERAGE_REFRESH

public static final long COVERAGE_REFRESH
query coverage refresh timer (check for expiration).

See Also:
Constant Field Values

JITTER

public static final long JITTER
brp delivery jitter.

See Also:
Constant Field Values

zrp

private RouteZrp zrp
reference to zrp routing framework.


queryCoverage

private java.util.HashMap queryCoverage
bordercast supression table: QueryKey - QueryCoverageEntry.

Constructor Detail

RouteZrpBrp

public RouteZrpBrp(RouteZrp zrp)
Create new "default" BRP (ZRP sub-protocol) handler.

Parameters:
zrp - object reference to zrp routing framework

RouteZrpBrp

public RouteZrpBrp(RouteZrp zrp,
                   java.lang.String config)
Create new "default" BRP (ZRP sub-protocol) handler.

Parameters:
zrp - object reference to zrp routing framework
config - configuration string
Method Detail

getUncoveredPeripheral

private java.util.Collection getUncoveredPeripheral(java.util.Vector from)
Return all the uncovered peripheral nodes.

Parameters:
from - source of bordercast
Returns:
list of uncovered peripheral nodes; null indicates all peripheral nodes are covered

bordercastNeighbours

private NetAddress[] bordercastNeighbours(java.util.Vector from)
Compute first hop in bordercast tree (without minimization).

Parameters:
from - sources that have already processed this query
Returns:
array of addresses of first hop neighbours on bordercast tree

bordercastNeighbours2

private NetAddress[] bordercastNeighbours2(java.util.Vector from)
Compute first hop in bordercast tree using greedy neighbour minimisation heuristic.

Parameters:
from - sources that have already processed this query
Returns:
array of addresses of first hop neighbours on bordercast tree

computeClosestNeighbours

private java.util.Map computeClosestNeighbours()
For each node in the zone, compute the set of closest neighbours.

Returns:
map of NetAddress to Set of neighbour addresses

getQueryCoverageEntry

private RouteZrpBrp.QueryCoverageEntry getQueryCoverageEntry(NetAddress src,
                                                             short seq,
                                                             boolean target)
Return query coverage entry for given source and identifier. Create a new query coverage entry if one does not exist.

Parameters:
src - query source address
seq - query source identifier
target - whether node was targetted in query broadcast
Returns:
query coverage

start

public void start()
Start running protocol.

Specified by:
start in interface Protocol

receive

public void receive(RouteInterface.Zrp.MessageBrp msg,
                    NetAddress from)
Process incoming BRP packet.

Specified by:
receive in interface RouteInterface.Zrp.Brp
Parameters:
msg - brp packet
from - source of incoming brp packet

send

public void send(RouteInterface.Zrp.MessageIerp msg)
Bordercast a query.

Specified by:
send in interface RouteInterface.Zrp.Brp
Parameters:
msg - query to bordercast

timeout

public void timeout()
Timer expiration processing.

Specified by:
timeout in interface Timer