OverSim
Broose Class Reference

Broose overlay module. More...

#include <Broose.h>

Inheritance diagram for Broose:
BaseOverlay BaseRpc BaseTcpSupport TopologyVis RpcListener

Public Member Functions

 Broose ()
 ~Broose ()
virtual void initializeOverlay (int stage)
 Initializes derived-class-attributes.
virtual void finishOverlay ()
 collects statistical data in derived class
virtual bool isSiblingFor (const NodeHandle &node, const OverlayKey &key, int numSiblings, bool *err)
 Query if a node is among the siblings for a given key.
virtual void joinOverlay ()
 Join the overlay with a given nodeID in thisNode.key.
virtual void recordOverlaySentStats (BaseOverlayMessage *msg)
 Collect overlay specific sent messages statistics.
virtual bool handleRpcCall (BaseCallMessage *msg)
 Processes Remote-Procedure-Call invocation messages.
virtual void handleTimerEvent (cMessage *msg)
void updateTooltip ()
 updates information shown in tk-environment
- Public Member Functions inherited from BaseOverlay
 BaseOverlay ()
virtual ~BaseOverlay ()
 Virtual destructor.
States getState ()
bool isMalicious ()
 Returns true, if node is malicious.
bool isInSimpleMultiOverlayHost ()
 Returns true if overlay is one in an array, inside a SimpleMultiOverlayHost.
const simtime_t & getCreationTime ()
void join (const OverlayKey &nodeID=OverlayKey::UNSPECIFIED_KEY)
 Join the overlay with a given nodeID.
virtual NodeVectorlocal_lookup (const OverlayKey &key, int num, bool safe)
 finds nodes closest to the given OverlayKey
virtual NodeVectorneighborSet (int num)
void sendMessageToUDP (const TransportAddress &dest, cPacket *msg, simtime_t delay=SIMTIME_ZERO)
 Sends message to underlay.
void sendToKey (const OverlayKey &key, BaseOverlayMessage *message, int numSiblings=1, const std::vector< TransportAddress > &sourceRoute=TransportAddress::UNSPECIFIED_NODES, RoutingType routingType=DEFAULT_ROUTING)
 Sends a message to an overlay node, with the generic routing algorithm.
virtual OverlayKey distance (const OverlayKey &x, const OverlayKey &y, bool useAlternative=false) const
 This method should implement the distance between two keys.
void registerComp (CompType compType, cModule *module)
cModule * getCompModule (CompType compType)
cGate * getCompRpcGate (CompType compType)
void sendMessageToAllComp (cMessage *msg, CompType srcComp)
bool providesKbr ()
virtual uint8_t getBitsPerDigit ()
bool getMeasureAuthBlock ()
BootstrapListgetBootstrapList () const
virtual OverlayKey estimateMeanDistance ()
 returns mean distance between OverlayKeys in the network
virtual uint32_t estimateOverlaySize ()
 estimates the current number of nodes online
- Public Member Functions inherited from BaseRpc
 BaseRpc ()
const NodeHandlegetThisNode ()
 Returns the NodeHandle of this node.
simtime_t getUdpTimeout ()
- Public Member Functions inherited from RpcListener
virtual ~RpcListener ()
 destructor
- Public Member Functions inherited from BaseTcpSupport
virtual void socketDataArrived (int connId, void *yourPtr, cPacket *msg, bool urgent)
virtual void socketEstablished (int connId, void *yourPtr)
virtual void socketPeerClosed (int connId, void *yourPtr)
virtual void socketFailure (int connId, void *yourPtr, int code)
virtual void socketStatusArrived (int connId, void *yourPtr, TCPStatusInfo *status)
- Public Member Functions inherited from TopologyVis
 TopologyVis ()
void showOverlayNeighborArrow (const NodeHandle &neighbor, bool flush=true, const char *displayString=NULL)
 Draws an arrow from this node to neighbor.
void deleteOverlayNeighborArrow (const NodeHandle &neighbor)
 Removes an arrow from this node to neighbor.

Protected Member Functions

void handleJoinTimerExpired (cMessage *msg)
 handles a expired join timer
void handleBucketTimerExpired (cMessage *msg)
 handles a expired bucket refresh timer
int getRoutingDistance (const OverlayKey &key, const OverlayKey &node, int dist)
 calculates the de-buijn distance between a key and a nodeId
bool routingAdd (const NodeHandle &node, bool isAlive, simtime_t rtt=MAXTIME)
 Adds a node to the routing table.
void changeState (int state)
 changes the node's state
NodeVectorfindNode (const OverlayKey &key, int numRedundantNodes, int numSiblings, BaseOverlayMessage *msg)
 Implements the find node call.
int getMaxNumSiblings ()
 Query the maximum number of siblings (nodes close to a key) that are maintained by this overlay protocol.
int getMaxNumRedundantNodes ()
 Query the maximum number of redundant next hop nodes that are returned by findNode().
void displayBucketState ()
 debug function which output the content of the node's buckets
void handleRpcResponse (BaseResponseMessage *msg, const RpcState &rpcState, simtime_t rtt)
 This method is called if an RPC response has been received.
void handleRpcTimeout (const RpcState &rpcState)
 This method is called if an RPC timeout has been reached.
void handleFindNodeTimeout (FindNodeCall *findNode, const TransportAddress &dest, const OverlayKey &destKey)
 This method is called if an Find Node Call timeout has been reached.
void handleBucketRequestRpc (BucketCall *msg)
 handles a received Bucket request
void handleBucketResponseRpc (BucketResponse *msg, const RpcState &rpcState)
 handles a received Bucket response
void handleBucketTimeout (BucketCall *msg)
 handles a received Bucket timeout
void routingTimeout (const BrooseHandle &handle)
virtual void pingResponse (PingResponse *pingResponse, cPolymorphic *context, int rpcId, simtime_t rtt)
virtual void pingTimeout (PingCall *pingCall, const TransportAddress &dest, cPolymorphic *context, int rpcId)
void setLastSeen (const NodeHandle &node)
 updates the timestamp of a node in all buckets
void addNode (const NodeHandle &node)
 adds a node to all buckets
void resetFailedResponses (const NodeHandle &node)
 resets the counter of failed responses
void setRTT (const NodeHandle &node, simtime_t rtt)
 sets the rtt to a node in all buckets
- Protected Member Functions inherited from BaseOverlay
int numInitStages () const
 Sets init stage.
void bindToPort (int port)
 Tells UDP we want to get all packets arriving on the given port.
virtual void route (const OverlayKey &key, CompType destComp, CompType srcComp, cPacket *msg, const std::vector< TransportAddress > &sourceRoute=TransportAddress::UNSPECIFIED_NODES, RoutingType routingType=DEFAULT_ROUTING)
 Routes message through overlay.
void callDeliver (BaseOverlayMessage *msg, const OverlayKey &destKey)
 Calls deliver function in application.
void callForward (const OverlayKey &key, BaseRouteMessage *msg, const NodeHandle &nextHopNode)
 Calls forward function in application.
void callUpdate (const NodeHandle &node, bool joined)
 Informs application about state changes of nodes or newly joined nodes.
void handleMessage (cMessage *msg)
 Checks for message type and calls corresponding method.
void handleBaseOverlayMessage (BaseOverlayMessage *msg, const OverlayKey &destKey=OverlayKey::UNSPECIFIED_KEY)
 Handles a BaseOverlayMessage

virtual void handleUDPMessage (BaseOverlayMessage *msg)
 Processes messages from underlay.
virtual void handleAppMessage (cMessage *msg)
 Processes "timer" self-messages.
virtual void receiveChangeNotification (int category, const cPolymorphic *details)
 callback-method for events at the NotificationBoard
virtual void handleTransportAddressChangedNotification ()
 This method gets call if the node has a new TransportAddress (IP address) because he changed his access network.
virtual void handleNodeLeaveNotification ()
 This method gets call **.gracefulLeaveDelay seconds before it is killed.
virtual void handleNodeGracefulLeaveNotification ()
 This method gets call **.gracefulLeaveDelay seconds before it is killed if this node is among the gracefulLeaveProbability nodes.
void setOverlayReady (bool ready)
 Sets the overlay ready icon and register/deregisters the node at the GlobalNodeList.
virtual AbstractLookupcreateLookup (RoutingType routingType=DEFAULT_ROUTING, const BaseOverlayMessage *msg=NULL, const cPacket *findNodeExt=NULL, bool appLookup=false)
 Creates an abstract iterative lookup instance.
virtual void removeLookup (AbstractLookup *lookup)
 Removes the abstract lookup instance.
virtual void joinForeignPartition (const NodeHandle &node)
 Join another overlay partition with the given node as bootstrap node.
virtual bool handleFailedNode (const TransportAddress &failed)
 Handles a failed node.
virtual void lookupRpc (LookupCall *call)
virtual void nextHopRpc (NextHopCall *call)
void countFindNodeCall (const FindNodeCall *call)
void countFailedNodeCall (const FailedNodeCall *call)
bool internalHandleRpcCall (BaseCallMessage *msg)
 Handles internal rpc requests.
void internalHandleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt)
 Handles rpc responses internal in base classes

void internalHandleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey)
 Handles rpc timeouts internal in base classes

void internalSendRouteRpc (BaseRpcMessage *message, const OverlayKey &destKey, const std::vector< TransportAddress > &sourceRoute, RoutingType routingType)
CompType getThisCompType ()
 Return the component type of this module.
- Protected Member Functions inherited from BaseRpc
void initRpcs ()
 Initializes Remote-Procedure state.
void finishRpcs ()
 Deinitializes Remote-Procedure state.
virtual void internalHandleRpcMessage (BaseRpcMessage *msg)
 Handles incoming rpc messages and delegates them to the corresponding listeners or handlers.
uint32_t sendRouteRpcCall (CompType destComp, const TransportAddress &dest, const OverlayKey &destKey, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Routes a Remote-Procedure-Call message to an OverlayKey.
uint32_t sendRouteRpcCall (CompType destComp, const OverlayKey &destKey, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Routes a Remote-Procedure-Call message to an OverlayKey.
uint32_t sendRouteRpcCall (CompType destComp, const TransportAddress &dest, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Sends a Remote-Procedure-Call message using the overlay's UDP port
This replaces ROUTE_DIRECT calls!
uint32_t sendUdpRpcCall (const TransportAddress &dest, BaseCallMessage *msg, cPolymorphic *context=NULL, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Sends a Remote-Procedure-Call message to the underlay

uint32_t sendInternalRpcCall (CompType destComp, BaseCallMessage *msg, cPolymorphic *context=NULL, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Sends an internal Remote-Procedure-Call between two tiers

void cancelRpcMessage (uint32_t nonce)
 Cancels a Remote-Procedure-Call.
void cancelAllRpcs ()
 Cancels all RPCs.
void sendRpcResponse (TransportType transportType, CompType destComp, const TransportAddress &dest, const OverlayKey &destKey, BaseCallMessage *call, BaseResponseMessage *response)
 Send Remote-Procedure response message and deletes call message.
void sendRpcResponse (BaseCallMessage *call, BaseResponseMessage *response)
 Send Remote-Procedure response message to UDP and deletes call message.
int pingNode (const TransportAddress &dest, simtime_t timeout=-1, int retries=0, cPolymorphic *context=NULL, const char *caption="PING", RpcListener *rpcListener=NULL, int rpcId=-1, TransportType transportType=INVALID_TRANSPORT)
 ping a node by its TransportAddress
bool internalHandleMessage (cMessage *msg)
- Protected Member Functions inherited from RpcListener
virtual void handleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt)
 This method is called if an RPC response has been received.
virtual void handleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey)
 This method is called if an RPC timeout has been reached.
- Protected Member Functions inherited from BaseTcpSupport
void handleTCPMessage (cMessage *msg)
 Member function to handle incoming TCP messages.
void bindAndListenTcp (int port)
 Member function to bind service to the specified port and listen afterwards.
bool isAlreadyConnected (TransportAddress address)
 Member function to check if the service is already connected.
void establishTcpConnection (TransportAddress address)
 Member function to establish a connection to the specified node.
void sendTcpData (cPacket *msg, TransportAddress address)
 Member function to send TCP data to the specified node.
virtual void handleConnectionEvent (EvCode code, TransportAddress address)
 Member function to handle passive connection events.
virtual void handleDataReceived (TransportAddress address, cPacket *msg, bool urgent)
 Member function to handle incoming data.
virtual void handleIncomingConnection (TransportAddress address)
 Member function to handle newly opened connections.
void closeTcpConnection (TransportAddress address)
 Member function to close an established connection.
void setTcpOut (cGate *gate)
 Member function to set local gate towards the TCP module during init phase.
cGate * getTcpOut ()
 Member function to get local gate towards the TCP module.
- Protected Member Functions inherited from TopologyVis
void initVis (cModule *terminal)

Protected Attributes

int chooseLookup
 decides which kind of lookup (right/left shifting) is used
simtime_t joinDelay
 time interval between two join tries
int receivedJoinResponse
 number of received join response messages
int receivedBBucketLookup
 number of received lookup responses for the B bucket
int numberBBucketLookup
 maximal number of lookup responses for the B bucket
int receivedLBucketLookup
 number of received lookup responses for the L bucket
int numberLBucketLookup
 maximal number of lookup responses for the L bucket
int shiftingBits
 number of bits shifted in/out each step
int powShiftingBits
 2^{variable shiftingBits}
uint32_t bucketSize
 maximal number of bucket entries
uint32_t rBucketSize
 maximal number of entries in the r buckets
int keyLength
 length of the node and data IDs
simtime_t refreshTime
 idle time after which a node is pinged
uint32_t userDist
 how many hops are added to the estimated hop count
int numberRetries
 number of retries in case of timeout
int bucketRetries
 number of bucket retries for a successful join
bool stab1
bool stab2
int bucketCount
 number of Bucket messages
int bucketBytesSent
 length of all Bucket messages
int numFailedPackets
 number of packets which couldn't be routed correctly
BrooseBucketlBucket
BrooseBucketbBucket
BrooseBucket ** rBucket
std::vector< BrooseBucket * > bucketVector
 vector of all Broose buckets
cMessage * join_timer
cMessage * bucket_timer
 timer to reconstruct all buckets
TransportAddress bootstrapNode
 node handle holding the bootstrap node
- Protected Attributes inherited from BaseOverlay
int numAppDataForwarded
 number of forwarded app data packets
int bytesAppDataForwarded
 number of forwarded app data bytes at out-gate
int numAppLookupForwarded
 number of forwarded app lookup packets
int bytesAppLookupForwarded
 number of forwarded app lookup bytes at out-gate
int numMaintenanceForwarded
 number of forwarded maintenance packets
int bytesMaintenanceForwarded
 number of forwarded maintenance bytes at out-gate
int numFindNodeSent
int bytesFindNodeSent
int numFindNodeResponseSent
int bytesFindNodeResponseSent
int numFailedNodeSent
int bytesFailedNodeSent
int numFailedNodeResponseSent
int bytesFailedNodeResponseSent
std::vector< HopDelayRecord * > singleHopDelays
simtime_t creationTime
 simtime when the node has been created
GlobalNodeListglobalNodeList
 pointer to GlobalNodeList in this node
NotificationBoard * notificationBoard
 pointer to NotificationBoard in this node
UnderlayConfiguratorunderlayConfigurator
 pointer to UnderlayConfigurator in this node
BootstrapListbootstrapList
 pointer to the BootstrapList module
GlobalParametersglobalParameters
 pointer to the GlobalParameters module
uint32_t overlayId
 identifies the overlay this node belongs to (used for multiple overlays)
bool debugOutput
 debug output ?
RoutingType defaultRoutingType
bool useCommonAPIforward
 forward messages to applications?
bool collectPerHopDelay
 collect delay for single hops
bool routeMsgAcks
 send ACK when receiving route message
uint32_t recNumRedundantNodes
 numRedundantNodes for recursive routing
bool recordRoute
 record visited hops on route
bool drawOverlayTopology
bool rejoinOnFailure
bool sendRpcResponseToLastHop
 needed by KBR protocols for NAT support
bool dropFindNodeAttack
 if node is malicious, it tries a findNode attack
bool isSiblingAttack
 if node is malicious, it tries a isSibling attack
bool invalidNodesAttack
 if node is malicious, it tries a invalidNode attack
bool dropRouteMessageAttack
 if node is malicious, it drops all received BaseRouteMessages
int localPort
 used UDP-port
int hopCountMax
 maximum hop count
bool measureAuthBlock
 if true, measure the overhead of signatures in rpc messages
bool restoreContext
 if true, a node rejoins with its old nodeId and malicious state
int numDropped
 number of dropped packets
int bytesDropped
 number of dropped bytes
cOutVector delayVector
 statistical output vector for packet-delays
cOutVector hopCountVector
 statistical output vector for hop-counts
States state
IterativeLookupConfiguration iterativeLookupConfig
RecursiveLookupConfiguration recursiveLookupConfig
LookupSet lookups
bool kbr
 set this to true, if the overlay provides KBR services
- Protected Attributes inherited from BaseRpc
NodeHandle thisNode
 NodeHandle to this node.
BaseOverlayoverlay
bool debugOutput
 debug output ?
GlobalStatisticsglobalStatistics
 pointer to GlobalStatistics module in this node
CompType thisCompType
NeighborCacheneighborCache
 pointer to the neighbor cache
CryptoModulecryptoModule
 pointer to CryptoModule
int numPingSent
int bytesPingSent
int numPingResponseSent
int bytesPingResponseSent
- Protected Attributes inherited from TopologyVis
cModule * thisTerminal
GlobalNodeListglobalNodeList
 pointer to corresponding node

Friends

class BrooseBucket

Additional Inherited Members

- Public Types inherited from BaseOverlay
enum  States {
  INIT = 0, BOOTSTRAP = 1, DISCOVERY = 2, PREJOIN = 3,
  JOIN = 4, POSTJOIN = 5, READY = 6, REFRESH = 7,
  SHUTDOWN = 8, FAILED = 9, RSET = JOIN, BSET = POSTJOIN
}
- Protected Types inherited from BaseOverlay
typedef UNORDERED_SET
< AbstractLookup
*, lookupHashFcn,
lookupHashFcn
LookupSet

Detailed Description

Broose overlay module.

Implementation of the Broose KBR overlay as described in "Broose: A Practical Distributed Hashtable Based on the De-Bruijn Topology" by Anh-Tuan Gai and Laurent Viennot

Author
Jochen Schenk
See Also
Bucket

Definition at line 52 of file Broose.h.

Constructor & Destructor Documentation

Broose::Broose ( )

Definition at line 51 of file Broose.cc.

{
join_timer = NULL;
bucket_timer = NULL;
rBucket = NULL;
lBucket = NULL;
bBucket = NULL;
}
Broose::~Broose ( )

Definition at line 59 of file Broose.cc.

{
// delete timers
cancelAndDelete(join_timer);
cancelAndDelete(bucket_timer);
}

Member Function Documentation

void Broose::addNode ( const NodeHandle node)
protected

adds a node to all buckets

Parameters
nodenode handle which should be added

Definition at line 1116 of file Broose.cc.

{
// add node to all buckets
for (size_t i = 0; i < bucketVector.size(); i++) {
bucketVector[i]->add(node);
}
}
void Broose::changeState ( int  state)
protected

changes the node's state

Parameters
statethe state to which a node is changing

Definition at line 145 of file Broose.cc.

{
switch (toState) {
case INIT: {
// find a new bootstrap node and enroll to the bootstrap list
cancelEvent(join_timer);
scheduleAt(simTime(), join_timer);
// initialize respectively clear the buckets
for (int i = 0; i < powShiftingBits; i++) {
}
this);
bBucket->initializeBucket(0, 0, 7*bucketSize, this, true);
// if we have restarted the join protocol reset parameters
getParentModule()->getParentModule()->bubble("Enter INIT state.");
break;
}
case RSET: {
BrooseBucket* tmpBucket = new BrooseBucket();
tmpBucket->initializeBucket(0, 0, powShiftingBits*rBucketSize, this);
for (int i = 0; i < powShiftingBits; i++) {
int size = rBucket[i]->getSize();
for (int j = 0; j < size; j++) {
tmpBucket->add(rBucket[i]->get(j));
}
}
BucketCall** bCall = new BucketCall*[tmpBucket->getSize()];
for (uint32_t i = 0; i < tmpBucket->getSize(); i++) {
bCall[i] = new BucketCall("LBucketCall");
bCall[i]->setBucketType(LEFT);
bCall[i]->setProState(PRSET);
bCall[i]->setBitLength(BUCKETCALL_L(bcall[i]));
sendUdpRpcCall(tmpBucket->get(i), bCall[i], NULL,
10);
}
// half of the calls must return for a state change
numberBBucketLookup = ceil((double)tmpBucket->getSize() / 2);
delete tmpBucket;
getParentModule()->getParentModule()->bubble("Enter RSET state.");
break;
}
case BSET: {
// half of the calls must return for a state change
numberLBucketLookup = ceil((double)bBucket->getSize() / 2);
// send messages to all entries of the B Bucket
int size2 = bBucket->getSize();
BucketCall** bCall2 = new BucketCall*[size2];
for (int i = 0; i < size2; i++) {
bCall2[i] = new BucketCall("LBucketCall");
bCall2[i]->setBucketType(LEFT);
bCall2[i]->setProState(PBSET);
bCall2[i]->setBitLength(BUCKETCALL_L(bcall2[i]));
sendUdpRpcCall(bBucket->get(i), bCall2[i], NULL,
10);
}
getParentModule()->getParentModule()->bubble("Enter BSET state.");
break;
}
case READY: {
// fill the bucket also with this node
for (size_t i = 0; i < bucketVector.size(); i++) {
}
// to disable the ping protocol a pingDelay or
// refreshTime of zero was given
if (refreshTime != 0) {
cancelEvent(bucket_timer);
scheduleAt(simTime() + (refreshTime / 2.0), bucket_timer);
}
getParentModule()->getParentModule()->bubble("Enter READY state.");
break;
}
}
}
void Broose::displayBucketState ( )
protected

debug function which output the content of the node's buckets

Definition at line 805 of file Broose.cc.

{
EV << "[Broose::displayBucketState() @ " << thisNode.getIp()
<< " (" << thisNode.getKey().toString(16) << ")]" << endl;
for (int i = 0; i < powShiftingBits; i++) {
EV << " Content of rBucket[" << i << "]: ";
rBucket[i]->output();
}
EV << " Content of lBucket: ";
EV << " Content of bBucket: ";
EV << endl;
}
NodeVector * Broose::findNode ( const OverlayKey key,
int  numRedundantNodes,
int  numSiblings,
BaseOverlayMessage msg 
)
protectedvirtual

Implements the find node call.

This method simply returns the closest nodes known in the corresponding routing topology. If the node is a sibling for this key (isSiblingFor(key) = true), this method returns all numSiblings siblings, with the closest neighbor to the key first.

Parameters
keyThe lookup key.
numRedundantNodesMaximum number of next hop nodes to return.
numSiblingsnumber of siblings to return
msgA pointer to the BaseRouteMessage or FindNodeCall message of this lookup.
Returns
NodeVector with closest nodes.

Reimplemented from BaseOverlay.

Definition at line 574 of file Broose.cc.

{
if ((state == INIT) || (state == RSET) || (state == FAILED))
return new NodeVector();
BrooseFindNodeExtMessage *findNodeExt = NULL;
bool err;
bool isSibling = isSiblingFor(thisNode, key, numSiblings, &err);
int resultSize;
if (numSiblings < 0) {
// exhaustive iterative doesn't care about siblings
resultSize = numRedundantNodes;
} else {
resultSize = isSibling ? (numSiblings ? numSiblings : 1)
: numRedundantNodes;
}
assert(numSiblings || numRedundantNodes);
NodeVector* result = new NodeVector(resultSize);
if (isSibling) {
//return the closest nodes
// sort with XOR distance to key
result->setComparator(comp);
bBucket->fillVector(result);
result->add(thisNode);
delete comp;
/*
std::cout << "key: " << key.toString(2).substr(0, 8)
<< " ThisNode: " << thisNode.getKey().toString(2).substr(0, 8);
if (result->size() > 0) {
std::cout << " next hop (final): " << (*result)[0].getKey().toString(2).substr(0, 8);
} else {
std::cout << " no next hop! (final)";
}
std::cout << std::endl << std::endl;
*/
return result;
}
if (msg != NULL) {
if (!msg->hasObject("findNodeExt")) {
findNodeExt = new BrooseFindNodeExtMessage("findNodeExt");
OverlayKey routeKey = thisNode.getKey();
// estimate distance
int dist = max(rBucket[0]->longestPrefix(),
rBucket[1]->longestPrefix()) + 1 + userDist;
if ((dist % shiftingBits) != 0)
dist += (shiftingBits - (dist % shiftingBits));
if (dist > keyLength) {
if ((keyLength % shiftingBits) == 0) {
dist = keyLength;
} else {
}
}
if ((chooseLookup++) % 2 == 0) {
// init left shifting lookup
findNodeExt->setRightShifting(false);
int prefix = 0;
for (int i = 0; i < dist; i++) {
prefix += thisNode.getKey().getBit(thisNode.getKey().getLength() - i - 1) << (dist - i - 1);
}
OverlayKey pre(prefix);
routeKey = key >> dist;
routeKey += (pre << key.getLength() - dist);
dist = -dist;
} else {
// init right shifting lookup
findNodeExt->setRightShifting(true);
}
//add contact for next Hop
findNodeExt->setLastNode(thisNode);
findNodeExt->setRouteKey(routeKey);
findNodeExt->setStep(dist);
findNodeExt->setBitLength(BROOSEFINDNODEEXTMESSAGE_L);
msg->addObject( findNodeExt );
}
findNodeExt = (BrooseFindNodeExtMessage*) msg->getObject("findNodeExt");
}
// update buckets with last hop
addNode(findNodeExt->getLastNode());
setLastSeen(findNodeExt->getLastNode());
// replace last hop contact information with
// this hop contact information
findNodeExt->setLastNode(thisNode);
// brother lookup
if (findNodeExt->getStep() == 0) {
// return the closest nodes sorted by XOR distance to key
result->setComparator(comp);
bBucket->fillVector(result);
result->add(thisNode);
delete comp;
return result;
}
if (findNodeExt->getRightShifting() == false) {
// Left Shifting Lookup
// can't handle left shifting lookup in BSET-State
if (state == BSET)
return result;
// calculate routing key
findNodeExt->setRouteKey((findNodeExt->getRouteKey()) << shiftingBits);
findNodeExt->setStep(findNodeExt->getStep() + shiftingBits);
findNodeExt->getRouteKey());
result->setComparator(comp);
lBucket->fillVector(result);
result->add(thisNode);
delete comp;
/*
std::cout << "key: " << key.toString(2).substr(0, 8)
<< " dist: " << findNodeExt->getStep()
<< " rtkey: " << findNodeExt->getRouteKey().toString(2).substr(0, 8)
<< " ThisNode: " << thisNode.getKey().toString(2).substr(0, 8);
if (result->size() > 0) {
std::cout << " next hop: " << (*result)[0].getKey().toString(2).substr(0, 8);
} else {
std::cout << " no next hop!";
}
std::cout << std::endl << std::endl;
*/
} else {
// Right Shifting Lookup
// calculate routing key
int prefix = 0;
int dist = findNodeExt->getStep();
OverlayKey routeKey = findNodeExt->getRouteKey() >> shiftingBits;
for (int i = 0; i < shiftingBits; i++)
prefix += ((int)key.getBit(key.getLength() - dist + i) << i);
OverlayKey pre(prefix);
routeKey += (pre << (routeKey.getLength()-shiftingBits));
findNodeExt->setRouteKey(routeKey);
findNodeExt->setStep(dist - shiftingBits);
result->setComparator(comp);
rBucket[prefix]->fillVector(result);
result->add(thisNode);
delete comp;
/*
std::cout << "key: " << key.toString(2).substr(0, 8)
<< " dist: " << findNodeExt->getStep()
<< " rtkey: " << findNodeExt->getRouteKey().toString(2).substr(0, 8)
<< " ThisNode: " << thisNode.getKey().toString(2).substr(0, 8);
if (result->size() > 0) {
std::cout << " next hop: " << (*result)[0].getKey().toString(2).substr(0, 8);
} else {
std::cout << " no next hop!";
}
std::cout << std::endl << std::endl;
*/
}
if ((*result)[0] == thisNode) {
delete result;
return (findNode(key, numRedundantNodes, numSiblings, msg));
} else
return result;
}
void Broose::finishOverlay ( )
virtual

collects statistical data in derived class

Reimplemented from BaseOverlay.

Definition at line 772 of file Broose.cc.

{
// store statistics
if (time < GlobalStatistics::MIN_MEASURED) return;
globalStatistics->addStdDev("Broose: Number of non-routable packets/s", numFailedPackets / time);
globalStatistics->addStdDev("Broose: Sent BUCKET Messages/s", bucketCount / time);
globalStatistics->addStdDev("Broose: Sent BUCKET Byte/s", bucketBytesSent / time);
globalStatistics->addStdDev("Broose: Bucket retries at join", bucketRetries);
}
int Broose::getMaxNumRedundantNodes ( )
protectedvirtual

Query the maximum number of redundant next hop nodes that are returned by findNode().

Returns
int number of redundant nodes returned by findNode().

Reimplemented from BaseOverlay.

Definition at line 351 of file Broose.cc.

{
return bucketSize;
}
int Broose::getMaxNumSiblings ( )
protectedvirtual

Query the maximum number of siblings (nodes close to a key) that are maintained by this overlay protocol.

Returns
int number of siblings.

Reimplemented from BaseOverlay.

Definition at line 346 of file Broose.cc.

{
return bucketSize;
}
int Broose::getRoutingDistance ( const OverlayKey key,
const OverlayKey node,
int  dist 
)
protected

calculates the de-buijn distance between a key and a nodeId

Parameters
keythe overlay key
nodethe nodeId
distthe estimated maximum distance based on the number of nodes in the system
Returns
the number of routing steps to the destination (negative for left shifting lookups)

Definition at line 356 of file Broose.cc.

{
for (uint i = 0; i < (uint)abs(dist); i++) {
if (node.sharedPrefixLength(key << i) >= (abs(dist) - i)) {
return i; // right shifting
}
if (key.sharedPrefixLength(node << i) >= (abs(dist) - i)) {
return -i; // left shifting
}
}
if (((chooseLookup++) % 2) == 0) {
return -dist;
} else {
return dist;
}
}
void Broose::handleBucketRequestRpc ( BucketCall msg)
protected

handles a received Bucket request

Parameters
msgthe message to process

Definition at line 962 of file Broose.cc.

{
if (msg->getBucketType() == LEFT) {
// TODO: dependent on the churn scenarios this may give better
// or worse results
if (stab1 && (state == BSET)) {
// can't handle LBucketRequest in BSET-State
delete msg;
return;
}
// return L-Bucket
int size = lBucket->getSize();
BucketResponse* bResponse = new BucketResponse("LBucketResponse");
bResponse->setNodesArraySize(size);
for (int i = 0; i < size; i++) {
bResponse->setNodes(i, lBucket->get(i));
}
bResponse->setBitLength(BUCKETRESPONSE_L(bResponse));
// only add, if the originator is already in the BSET state
// in which the node already is able to do right shifting lookups
// TODO: this leads to lower lookup success rates in some scenarios
// but helps to prevent deadlock situations with high churn rates
if (stab2 || (msg->getProState() == PBSET)) {
routingAdd(msg->getSrcNode(), true);
}
sendRpcResponse(msg, bResponse);
} else if (msg->getBucketType() == BROTHER) {
// return B-Bucket
int size = bBucket->getSize();
BucketResponse* bResponse = new BucketResponse("BBucketResponse");
bResponse->setNodesArraySize(size);
for (int i = 0; i < size; i++) {
bResponse->setNodes(i, bBucket->get(i));
}
bResponse->setBitLength(BUCKETRESPONSE_L(bResponse));
sendRpcResponse(msg, bResponse);
} else
error("Broose::handleBucketRequestRpc() - Wrong Bucket Type!");
}
void Broose::handleBucketResponseRpc ( BucketResponse msg,
const RpcState rpcState 
)
protected

handles a received Bucket response

Parameters
msgthe message to process
rpcStatethe state object for the received RPC

Definition at line 1009 of file Broose.cc.

{
BucketCall* call = check_and_cast<BucketCall*>(rpcState.getCallMsg());
for (uint i = 0; i < msg->getNodesArraySize(); i++) {
routingAdd(msg->getNodes(i), false);
}
if (call->getBucketType() == LEFT) {
switch (state) {
case RSET:
if (call->getProState() == PRSET) {
}
break;
case BSET:
if (call->getProState() == PBSET) {
}
break;
default:
break;
}
} else if (call->getBucketType() == BROTHER) {
switch(state) {
case INIT:
if (call->getProState() == PINIT) {
}
default:
break;
}
} else
error("Broose::handleBucketRequestRpc() - unknown error.");
}
void Broose::handleBucketTimeout ( BucketCall msg)
protected

handles a received Bucket timeout

Parameters
msgthe message to process

Definition at line 1055 of file Broose.cc.

{
if (state == READY)
return;
else {
}
}
void Broose::handleBucketTimerExpired ( cMessage *  msg)
protected

handles a expired bucket refresh timer

Parameters
msgthe bucket refresh self-message

Definition at line 318 of file Broose.cc.

{
BrooseBucket* tmpBucket = new BrooseBucket();
tmpBucket->initializeBucket(0, 0,
this);
for (size_t i = 0; i < bucketVector.size(); i++) {
for(uint32_t j = 0; j < bucketVector[i]->getSize(); j++) {
if ((simTime() - bucketVector[i]->getLastSeen(
bucketVector[i]->get(j))) > refreshTime
|| bucketVector[i]->getRTT(bucketVector[i]->get(j)) == -1) {
tmpBucket->add(BrooseHandle(bucketVector[i]->get(j)));
}
}
}
for (uint32_t i = 0; i < tmpBucket->getSize(); i++) {
pingNode(tmpBucket->get(i));
}
delete tmpBucket;
scheduleAt(simTime() + (refreshTime / 2.0), bucket_timer);
}
void Broose::handleFindNodeTimeout ( FindNodeCall findNode,
const TransportAddress dest,
const OverlayKey destKey 
)
protected

This method is called if an Find Node Call timeout has been reached.

Parameters
findNodeThe original FindNodeCall
destthe destination node
destKeythe destination OverlayKey

Definition at line 1083 of file Broose.cc.

{
routingTimeout(dynamic_cast<const NodeHandle&>(dest));
}
void Broose::handleJoinTimerExpired ( cMessage *  msg)
protected

handles a expired join timer

Parameters
msgthe timer self-message

Definition at line 268 of file Broose.cc.

{
if (state == READY)
return;
// create new lookup message
#if 0
BucketCall* bCall = new BucketCall();
bCall->setBitLength(BUCKETCALL_L(call));
bCall);
BucketCall* lCall = new BucketCall();
lCall->setBucketType(BROTHER);
lCall->setProState(FAILED);
lCall->setBitLength(BUCKETCALL_L(call));
#endif
// do lookups for key >> shiftingBits for each prefix
for (int i = 0; i < powShiftingBits; i++) {
OverlayKey add(i);
add = add << (keyLength - shiftingBits);
add += newKey;
bCallArray[i] = new BucketCall("BBucketCall");
bCallArray[i]->setBucketType(BROTHER);
bCallArray[i]->setBucketIndex(i);
bCallArray[i]->setProState(PINIT);
bCallArray[i]->setBitLength(BUCKETCALL_L(bCallArray[i]));
// restart join protocol if one call times out
// otherwise the node might be isolated
bCallArray[i]);
}
//createLookup()->lookup(getThisNode().getKey() + 1, 0, 0, 0,
// new BrooseLookupListener(this));
} else {
// if the bootstrap node is unspecified we are the only node in the network
// so we can skip the "normal" join protocol
}
}
bool Broose::handleRpcCall ( BaseCallMessage msg)
virtual

Processes Remote-Procedure-Call invocation messages.


This method should be overloaded when the overlay provides RPC functionality.

Returns
true, if rpc has been handled

Reimplemented from BaseRpc.

Definition at line 873 of file Broose.cc.

{
if (state == BSET || state == READY) {
// delegate messages
RPC_ON_CALL(Ping) {
// add pinging node to all buckets and update lastSeen of node
routingAdd(msg->getSrcNode(), true);
return false;
break;
}
RPC_ON_CALL(FindNode) {
// add pinging node to all buckets and update lastSeen of node
routingAdd(msg->getSrcNode(), true);
return false;
break;
}
return RPC_HANDLED;
} else {
// don't answer PING and FIND_NODE calls, if the node can't route yet
RPC_ON_CALL(Ping) {
delete msg;
return true;
break;
}
RPC_ON_CALL(FindNode) {
delete msg;
return true;
break;
}
return RPC_HANDLED;
}
}
void Broose::handleRpcResponse ( BaseResponseMessage msg,
const RpcState rpcState,
simtime_t  rtt 
)
protectedvirtual

This method is called if an RPC response has been received.

Parameters
msgThe response message.
rpcStateReference to an RpcState object containing e.g. the original call message, the destination (TransportAddress and/or OverlayKey), a context pointer, ...
rttThe round-trip time of this RPC

Reimplemented from RpcListener.

Definition at line 911 of file Broose.cc.

{
// add sender to all buckets and update lastSeen of node
routingAdd(msg->getSrcNode(), true, rtt);
RPC_ON_RESPONSE( Bucket ) {
handleBucketResponseRpc(_BucketResponse, rpcState);
EV << "[Broose::handleRpcResponse() @ " << thisNode.getIp()
<< " (" << thisNode.getKey().toString(16) << ")]\n"
<< " Bucket RPC Response received: id=" << rpcState.getId() << "\n"
<< " msg=" << *_BucketResponse << " rtt=" << rtt
<< endl;
break;
}
RPC_ON_RESPONSE(FindNode)
{
// add inactive nodes
for (uint32_t i=0; i<_FindNodeResponse->getClosestNodesArraySize(); i++)
routingAdd(_FindNodeResponse->getClosestNodes(i), false);
break;
}
}
void Broose::handleRpcTimeout ( const RpcState rpcState)
protectedvirtual

This method is called if an RPC timeout has been reached.

Parameters
rpcStateReference to an RpcState object containing e.g. the original call message, the destination (TransportAddress and/or OverlayKey), a context pointer, ...

Reimplemented from RpcListener.

Definition at line 938 of file Broose.cc.

{
RPC_ON_CALL(FindNode) {
handleFindNodeTimeout(_FindNodeCall, rpcState.getDest(), rpcState.getDestKey());
EV << "[Broose::handleRpcTimeout() @ " << thisNode.getIp()
<< " (" << thisNode.getKey().toString(16) << ")]\n"
<< " Find Node RPC Call timed out: id=" << rpcState.getId() << "\n"
<< " msg=" << *_FindNodeCall
<< endl;
break;
}
RPC_ON_CALL(Bucket) {
handleBucketTimeout(_BucketCall);
EV << "[Broose::handleRpcTimeout() @ " << thisNode.getIp()
<< " (" << thisNode.getKey().toString(16) << ")]\n"
<< " Bucket RPC Call timed out: id=" << rpcState.getId() << "\n"
<< " msg=" << *_BucketCall
<< endl;
break;
}
}
void Broose::handleTimerEvent ( cMessage *  msg)
virtual

Reimplemented from BaseRpc.

Definition at line 258 of file Broose.cc.

{
if (msg == join_timer)
else if (msg == bucket_timer)
else
error("Broose::handleTimerEvent - no other timer currently in use!");
}
void Broose::initializeOverlay ( int  stage)
virtual

Initializes derived-class-attributes.


Initializes derived-class-attributes, called by BaseOverlay::initialize(). By default this method is called once. If more stages are needed one can overload numInitStages() and add more stages.

Parameters
stagethe init stage

Reimplemented from BaseOverlay.

Definition at line 66 of file Broose.cc.

{
// because of IPAddressResolver, we need to wait until interfaces
// are registered, address auto-assignment takes place etc.
if (stage != MIN_STAGE_OVERLAY)
return;
// Broose provides KBR services
kbr = true;
// fetch some parameters
bucketSize = par("bucketSize"); // = k
rBucketSize = par("rBucketSize"); // = k'
joinDelay = par("joinDelay");
shiftingBits = par("brooseShiftingBits");
userDist = par("userDist");
refreshTime = par("refreshTime");
numberRetries = par("numberRetries");
stab1 = par("stab1");
stab2 = par("stab2");
//statistics
//init local parameters
// add some watches
WATCH(state);
// get module pointers for all buckets
for (int i = 0; i < powShiftingBits; i++) {
rBucket[i] = check_and_cast<BrooseBucket*>
(getParentModule()->getSubmodule("rBucket",i));
bucketVector.push_back(rBucket[i]);
}
lBucket = check_and_cast<BrooseBucket*>
(getParentModule()->getSubmodule("lBucket"));
bucketVector.push_back(lBucket);
bBucket = check_and_cast<BrooseBucket*>
(getParentModule()->getSubmodule("bBucket"));
bucketVector.push_back(bBucket);
// create join and bucket timer
join_timer = new cMessage("join_timer");
bucket_timer = new cMessage("bucket_timer");
}
bool Broose::isSiblingFor ( const NodeHandle node,
const OverlayKey key,
int  numSiblings,
bool *  err 
)
virtual

Query if a node is among the siblings for a given key.

Query if a node is among the siblings for a given key. This means, that the nodeId of this node is among the closest numSiblings nodes to the key and that by a local findNode() call all other siblings to this key can be retrieved.

Parameters
nodethe NodeHandle
keydestination key
numSiblingsThe nodes knows all numSiblings nodes close to this key
errreturn false if the range could not be determined
Returns
bool true, if the node is responsible for the key.

Reimplemented from BaseOverlay.

Definition at line 823 of file Broose.cc.

{
// TODO: node != thisNode doesn't work yet
if (key.isUnspecified())
error("Broose::isSiblingFor(): key is unspecified!");
if (node != thisNode)
error("Broose::isSiblingsFor(): "
"node != thisNode is not implemented!");
if (numSiblings > getMaxNumSiblings()) {
opp_error("Broose::isSiblingFor(): numSiblings too big!");
}
// set default number of siblings to consider
if (numSiblings == -1) numSiblings = getMaxNumSiblings();
if (numSiblings == 0) {
*err = false;
return (node.getKey() == key);
}
if (state != READY) {
*err = true;
return false;
}
// TODO: handle numSibling parameter
return bBucket->keyInRange(key);
}
void Broose::joinOverlay ( )
virtual

Join the overlay with a given nodeID in thisNode.key.

Join the overlay with a given nodeID in thisNode.key. This method may be called by an application to join the overlay with a specific nodeID. It is also called if the node's IP address changes.

Reimplemented from BaseOverlay.

Definition at line 133 of file Broose.cc.

{
// if the bootstrap node is unspecified we are the only node in the network
// so we can skip the "normal" join protocol
}
}
void Broose::pingResponse ( PingResponse pingResponse,
cPolymorphic *  context,
int  rpcId,
simtime_t  rtt 
)
protectedvirtual

Reimplemented from BaseRpc.

Definition at line 1065 of file Broose.cc.

{
// if node respond reset failedResponses and add lastSeen to node
routingAdd(pingResponse->getSrcNode(), true, rtt);
}
void Broose::pingTimeout ( PingCall pingCall,
const TransportAddress dest,
cPolymorphic *  context,
int  rpcId 
)
protectedvirtual

Reimplemented from BaseRpc.

Definition at line 1090 of file Broose.cc.

{
routingTimeout(dynamic_cast<const NodeHandle&>(dest));
}
void Broose::recordOverlaySentStats ( BaseOverlayMessage msg)
virtual

Collect overlay specific sent messages statistics.

This method is called from BaseOverlay::sendMessageToUDP() for every overlay message that is sent by a node. Use this to collect statistical data for overlay protocol specific message types.

Parameters
msgThe overlay message to be sent to the UDP layer

Reimplemented from BaseOverlay.

Definition at line 785 of file Broose.cc.

{
BaseOverlayMessage* innerMsg = msg;
while (innerMsg->getType() != APPDATA &&
innerMsg->getEncapsulatedPacket() != NULL) {
innerMsg =
static_cast<BaseOverlayMessage*>(innerMsg->getEncapsulatedPacket());
}
switch (innerMsg->getType()) {
case RPC:
if ((dynamic_cast<BucketCall*>(innerMsg) != NULL) ||
(dynamic_cast<BucketResponse*>(innerMsg) != NULL)) {
msg->getByteLength());
}
break;
}
}
void Broose::resetFailedResponses ( const NodeHandle node)
protected

resets the counter of failed responses

Parameters
nodenode handle of the responding node

Definition at line 1124 of file Broose.cc.

{
for (size_t i = 0; i < bucketVector.size(); i++) {
bucketVector[i]->resetFailedResponses(node);
}
}
bool Broose::routingAdd ( const NodeHandle node,
bool  isAlive,
simtime_t  rtt = MAXTIME 
)
protected

Adds a node to the routing table.

Parameters
nodeNodeHandle to add
isAlivetrue, if it is known that the node is alive
rttmeasured round-trip-time to node
Returns
true, if the node was known or has been added

Definition at line 1097 of file Broose.cc.

{
bool added = false;
for (size_t i = 0; i < bucketVector.size(); i++) {
added |= bucketVector[i]->add(node, isAlive, rtt);
}
return added;
}
void Broose::routingTimeout ( const BrooseHandle handle)
protected

Definition at line 1071 of file Broose.cc.

{
for (size_t i = 0; i < bucketVector.size(); i++) {
if (bucketVector[i]->getFailedResponses(handle) == numberRetries)
bucketVector[i]->remove(handle);
else
bucketVector[i]->increaseFailedResponses(handle);
}
// TODO: if we loose the last node (despite ourself) from the
// B bucket, we should call join() to rejoin the network
}
void Broose::setLastSeen ( const NodeHandle node)
protected

updates the timestamp of a node in all buckets

Parameters
nodenode handle which should be updated

Definition at line 1109 of file Broose.cc.

{
for (size_t i = 0; i < bucketVector.size(); i++) {
bucketVector[i]->setLastSeen(node, simTime());
}
}
void Broose::setRTT ( const NodeHandle node,
simtime_t  rtt 
)
protected

sets the rtt to a node in all buckets

Parameters
nodenode handle to which a rtt is added/updated
rttround trip time to the node

Definition at line 1131 of file Broose.cc.

{
for (size_t i = 0; i < bucketVector.size(); i++) {
bucketVector[i]->setRTT(node, rtt);
}
}
void Broose::updateTooltip ( )

updates information shown in tk-environment

Definition at line 856 of file Broose.cc.

{
if (ev.isGUI()) {
std::stringstream ttString;
// show our ip and key in tooltip
ttString << thisNode.getIp() << " " << thisNode.getKey();
getParentModule()->getParentModule()->getDisplayString().
setTagArg("tt", 0, ttString.str().c_str());
getParentModule()->getDisplayString().
setTagArg("tt", 0, ttString.str().c_str());
getDisplayString().setTagArg("tt", 0, ttString.str().c_str());
}
}

Friends And Related Function Documentation

friend class BrooseBucket
friend

Definition at line 273 of file Broose.h.

Member Data Documentation

BrooseBucket * Broose::bBucket
protected

Definition at line 114 of file Broose.h.

TransportAddress Broose::bootstrapNode
protected

node handle holding the bootstrap node

Definition at line 124 of file Broose.h.

cMessage* Broose::bucket_timer
protected

timer to reconstruct all buckets

Definition at line 121 of file Broose.h.

int Broose::bucketBytesSent
protected

length of all Bucket messages

Definition at line 110 of file Broose.h.

int Broose::bucketCount
protected

number of Bucket messages

Definition at line 109 of file Broose.h.

int Broose::bucketRetries
protected

number of bucket retries for a successful join

Definition at line 104 of file Broose.h.

uint32_t Broose::bucketSize
protected

maximal number of bucket entries

Definition at line 98 of file Broose.h.

std::vector<BrooseBucket*> Broose::bucketVector
protected

vector of all Broose buckets

Definition at line 117 of file Broose.h.

int Broose::chooseLookup
protected

decides which kind of lookup (right/left shifting) is used

Definition at line 89 of file Broose.h.

cMessage* Broose::join_timer
protected

Definition at line 120 of file Broose.h.

simtime_t Broose::joinDelay
protected

time interval between two join tries

Definition at line 90 of file Broose.h.

int Broose::keyLength
protected

length of the node and data IDs

Definition at line 100 of file Broose.h.

BrooseBucket* Broose::lBucket
protected

Definition at line 114 of file Broose.h.

int Broose::numberBBucketLookup
protected

maximal number of lookup responses for the B bucket

Definition at line 93 of file Broose.h.

int Broose::numberLBucketLookup
protected

maximal number of lookup responses for the L bucket

Definition at line 95 of file Broose.h.

int Broose::numberRetries
protected

number of retries in case of timeout

Definition at line 103 of file Broose.h.

int Broose::numFailedPackets
protected

number of packets which couldn't be routed correctly

Definition at line 111 of file Broose.h.

int Broose::powShiftingBits
protected

2^{variable shiftingBits}

Definition at line 97 of file Broose.h.

BrooseBucket** Broose::rBucket
protected

Definition at line 115 of file Broose.h.

uint32_t Broose::rBucketSize
protected

maximal number of entries in the r buckets

Definition at line 99 of file Broose.h.

int Broose::receivedBBucketLookup
protected

number of received lookup responses for the B bucket

Definition at line 92 of file Broose.h.

int Broose::receivedJoinResponse
protected

number of received join response messages

Definition at line 91 of file Broose.h.

int Broose::receivedLBucketLookup
protected

number of received lookup responses for the L bucket

Definition at line 94 of file Broose.h.

simtime_t Broose::refreshTime
protected

idle time after which a node is pinged

Definition at line 101 of file Broose.h.

int Broose::shiftingBits
protected

number of bits shifted in/out each step

Definition at line 96 of file Broose.h.

bool Broose::stab1
protected

Definition at line 105 of file Broose.h.

bool Broose::stab2
protected

Definition at line 106 of file Broose.h.

uint32_t Broose::userDist
protected

how many hops are added to the estimated hop count

Definition at line 102 of file Broose.h.


The documentation for this class was generated from the following files: