|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrouting.MessageRouter
routing.ActiveRouter
routing.MaxPropRouterWithEstimation
public class MaxPropRouterWithEstimation
Implementation of MaxProp router as described in MaxProp: Routing for Vehicle-Based Disruption-Tolerant Networks by John Burgess et al. but with parameter estimation for finding an alpha based on timescale definition: Extension of the protocol by adding a parameter alpha (default 1) By new connection, the delivery likelihood is increased by alpha and divided by 1+alpha. Using the default results in the original algorithm. Refer to Karvo and Ott, Time Scales and Delay-Tolerant Routing Protocols Chants, 2008 This version tries to estimate a good value of alpha from a timescale parameter given by the user, and from the encounters the node sees during simulation.
Field Summary | |
---|---|
static int |
BYTES_TRANSFERRED_AVG_SAMPLES
Over how many samples the "average number of bytes transferred per transfer opportunity" is taken |
static double |
DEFAULT_ALPHA
The default value for alpha |
static java.lang.String |
MAXPROP_NS
MaxPROP router's setting namespace ("MaxPropRouterWithEstimation") |
static java.lang.String |
TIME_SCALE_S
|
Fields inherited from class routing.ActiveRouter |
---|
DELETE_DELIVERED_S, deleteDelivered, RESPONSE_PREFIX, sendingConnections, TTL_CHECK_INTERVAL |
Fields inherited from class routing.MessageRouter |
---|
B_SIZE_S, DENIED_NO_SPACE, DENIED_OLD, DENIED_TTL, DENIED_UNSPECIFIED, MSG_TTL_S, msgTtl, Q_MODE_FIFO, Q_MODE_RANDOM, RCV_OK, SEND_QUEUE_MODE_S, TRY_LATER_BUSY |
Constructor Summary | |
---|---|
protected |
MaxPropRouterWithEstimation(MaxPropRouterWithEstimation r)
Copy constructor. |
|
MaxPropRouterWithEstimation(Settings settings)
Constructor. |
Method Summary | |
---|---|
int |
calcThreshold()
Calculates and returns the current threshold value for the buffer's split based on the average number of bytes transferred per transfer opportunity and the hop counts of the messages in the buffer. |
void |
changedConnection(Connection con)
Called when a connection's state changes. |
double |
getCost(DTNHost from,
DTNHost to)
Returns the message delivery cost between two hosts from this host's point of view. |
protected Message |
getOldestMessage(boolean excludeMsgBeingSent)
Returns the next message that should be dropped, according to MaxProp's message ordering scheme (see MaxPropTupleComparator ). |
RoutingInfo |
getRoutingInfo()
Returns routing information about this router. |
Message |
messageTransferred(java.lang.String id,
DTNHost from)
This method should be called (on the receiving host) after a message was successfully transferred. |
MessageRouter |
replicate()
Creates a replicate of this router. |
protected void |
transferDone(Connection con)
Method is called just before a transfer is finalized at ActiveRouter.update() . |
void |
update()
Checks out all sending connections to finalize the ready ones and abort those whose connection went down. |
protected boolean |
updateEstimators(DTNHost host)
Updates the MaxPROP estimators |
protected void |
updateParam()
update the alpha parameter based on the estimators |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int BYTES_TRANSFERRED_AVG_SAMPLES
public static final java.lang.String MAXPROP_NS
public static final java.lang.String TIME_SCALE_S
public static final double DEFAULT_ALPHA
Constructor Detail |
---|
public MaxPropRouterWithEstimation(Settings settings)
settings
- The settings objectprotected MaxPropRouterWithEstimation(MaxPropRouterWithEstimation r)
r
- The router prototype where setting values are copied fromMethod Detail |
---|
public void changedConnection(Connection con)
ActiveRouter
changedConnection
in class ActiveRouter
con
- The connection that changedprotected boolean updateEstimators(DTNHost host)
host
- protected void updateParam()
public Message messageTransferred(java.lang.String id, DTNHost from)
MessageRouter
messageTransferred
in class ActiveRouter
id
- Id of the transferred messagefrom
- Host the message was from (previous hop)
protected void transferDone(Connection con)
ActiveRouter.update()
. MaxProp makes book keeping of the
delivered messages so their IDs are stored.
transferDone
in class ActiveRouter
con
- The connection whose transfer was finalizedprotected Message getOldestMessage(boolean excludeMsgBeingSent)
MaxPropTupleComparator
).
getOldestMessage
in class ActiveRouter
excludeMsgBeingSent
- If true, excludes message(s) that are
being sent from the next-to-be-dropped check (i.e., if next message to
drop is being sent, the following message is returned)
public void update()
ActiveRouter
update
in class ActiveRouter
ActiveRouter.addToSendingConnections(Connection)
public double getCost(DTNHost from, DTNHost to)
from
- The host where a message is coming fromto
- The host where a message would be destined to
public int calcThreshold()
public RoutingInfo getRoutingInfo()
MessageRouter
getRoutingInfo
in class MessageRouter
public MessageRouter replicate()
MessageRouter
replicate
in class MessageRouter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |