Broose Class Reference

#include <Broose.h>

Inheritance diagram for Broose:

BaseOverlay BaseRpc TopologyVis RpcListener

List of all members.

Public Member Functions

 ~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 handleUDPMessage (BaseOverlayMessage *msg)
 Processes messages from underlay.
virtual void recordOverlaySentStats (BaseOverlayMessage *msg)
 Collect overlay specific sent messages statistics.
virtual bool handleRpc (BaseCallMessage *msg)
 Processes Remote-Procedure-Call invokation messages.
virtual void handleTimerEvent (cMessage *msg)
 Processes "timer" self-messages.
void updateTooltip ()
 updates information shown in tk-environment

Protected Member Functions

void handleJoinTimerExpired (cMessage *msg)
 handles a expired join timer
void handleBucketTimerExpired (cMessage *msg)
 handles a expired bucket refresh timer
void changeState (int state)
 changes the node's state
NodeVectorfindNode (const OverlayKey &key, int numRedundantNodes, int numSiblings, BaseOverlayMessage *msg)
 Implements the find node call.
bool keyBelongsToNode (const OverlayKey &key)
 decides if a specific key is managed by this node
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 binaryOutput (const OverlayKey &key)
 outputs an Overlay key in the binary system
void handleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt)
 This method is called if an RPC response has been received.
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.
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)
 handles a received Bucket response
void handleBucketTimeout (BucketCall *msg)
 handles a received Bucket timeout
void handleBroosePingRequestRpc (BroosePingCall *msg)
 handles a received Ping request
void handleBroosePingResponseRpc (BroosePingResponse *msg, simtime_t rtt)
 handles a received Ping response
void handleBroosePingTimeout (BroosePingCall *msg, const TransportAddress &dest, const OverlayKey &destKey)
 handles a received Ping timeout
void setLastSeen (NodeHandle node)
 updates the timestamp of a node in all buckets
void addNode (NodeHandle node, int bucket=0)
 adds a node to all buckets
void resetFailedResponses (NodeHandle node)
 resets the counter of failed responses
void setRTT (NodeHandle node, simtime_t rtt)
 sets the rtt to a node in all buckets

Protected Attributes

int chooseLookup
 decides which kind of lookup (right/left shifting) is used
int joinDelay
 time interval between two join tries
int protoState
 the state in which a node currently is
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 reponses for the B bucket
int receivedLBucketLookup
 number of received lookup responses for the L bucket
int numberLBucketLookup
 maximal number of lookup reponses for the L bucket
int shiftingBits
 number of bits shifted in/out each step
int powShiftingBits
 2^{variable shiftingBits}
uint bucketSize
 maximal number of bucket entries
uint rBucketSize
 maximal number of entries in the r buckets
int parallelRequests
 number ob parallel requests
int keyLength
 length of the node and data IDs
bool refresh
 is the node restarting the bootstrap protocol or is it a new node
int pingDelay
 time intervall between bucket refreshs
int refreshTime
 time intervall after which a ping is done
uint userDist
 how many hops are added to the estimated hop count
int numPings
 actual number of received ping messages
int maxPings
 total number of ping messages
int numberRetries
 number of retries in case of timeout
int bucketCount
 number of Bucket messages
int bucketBytesSent
 length of all Bucket messages
int broosePingCount
 number of Ping messages
int broosePingBytesSent
 length of all Ping messages
int numFailedPackets
 number of packets which couldn't be routed correctly
BrooseBucketlBucket
BrooseBucketbBucket
BrooseBucket ** rBucket
cMessage * join_timer
cMessage * bucket_timer
 timer to reconstruct all buckets
NodeHandle bootstrapNode
 node handle holding the bootstrap node
BrooseHandle thisBrooseNode
 this is a BrooseHandle of the current node like thisNode

Friends

class BrooseBucket


Constructor & Destructor Documentation

Broose::~Broose (  ) 

00036 {
00037     // delete timer
00038     cancelEvent(join_timer);
00039     delete join_timer;
00040 
00041     cancelEvent(bucket_timer);
00042     delete bucket_timer;
00043 }


Member Function Documentation

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:
stage the init stage

Reimplemented from BaseOverlay.

00046 {
00047     // because of IPAddressResolver, we need to wait until interfaces
00048     // are registered, address auto-assignment takes place etc.
00049     if(stage != MIN_STAGE_OVERLAY)
00050         return;
00051 
00052     // Broose provides KBR services
00053     kbr = true;
00054 
00055     // fetch some parameters
00056     bucketSize = par("bucketSize"); // = k
00057     rBucketSize = par("rBucketSize"); // = k'
00058     parallelRequests = par("parallelRequests"); // not implemented yet
00059     joinDelay = par("joinDelay");
00060     shiftingBits = par("brooseShiftingBits");
00061     pingDelay = par("pingDelay");
00062     userDist = par("userDist");
00063     refreshTime = par("refreshTime");
00064     numberRetries = par("numberRetries");
00065 
00066     //statistics
00067     bucketCount = 0;
00068     bucketBytesSent = 0;
00069     broosePingCount = 0;
00070     broosePingBytesSent = 0;
00071 
00072     //init local parameters
00073     chooseLookup = 0;
00074     receivedJoinResponse = 0;
00075     receivedBBucketLookup = 0;
00076     numberBBucketLookup = 0;
00077     receivedLBucketLookup = 0;
00078     numberLBucketLookup = 0;
00079     powShiftingBits = (int) pow(2.0, shiftingBits);
00080     keyLength = OverlayKey::getLength();
00081     numFailedPackets = 0;
00082     refresh = false;
00083     numPings = 0;
00084     maxPings = 0;
00085 
00086     // add some watches
00087     WATCH(receivedJoinResponse);
00088     WATCH(receivedBBucketLookup);
00089     WATCH(numberBBucketLookup);
00090     WATCH(receivedLBucketLookup);
00091     WATCH(numberLBucketLookup);
00092     WATCH(numPings);
00093     WATCH(maxPings);
00094 
00095     // get module references - these are references to the buckets
00096     // each node have in order to get a lookup done
00097     rBucket = new BrooseBucket*[powShiftingBits];
00098 
00099     for (int i = 0; i < powShiftingBits; i++) {
00100         rBucket[i] = check_and_cast<BrooseBucket*>
00101                      (parentModule()->submodule("rBucket",i));
00102     }
00103 
00104     lBucket = check_and_cast<BrooseBucket*>
00105               (parentModule()->submodule("lBucket"));
00106 
00107     bBucket = check_and_cast<BrooseBucket*>
00108               (parentModule()->submodule("bBucket"));
00109 
00110     // create join and bucket timer
00111     join_timer = new cMessage("join_timer");
00112     bucket_timer = new cMessage("bucket_timer");
00113 }

void Broose::finishOverlay (  )  [virtual]

collects statistical data in derived class

Reimplemented from BaseOverlay.

00552 {
00553     // print out statistics and delete pointers
00554 
00555     // remove this node from the bootstrap list
00556     bootstrapList->removeBootstrapNode(thisNode);
00557 
00558     simtime_t time = globalStatistics->calcMeasuredLifetime(creationTime);
00559     if(time == 0) return;
00560 
00561     globalStatistics->addStdDev("Broose: Number of non-routable packets/s", numFailedPackets / time);
00562 
00563     globalStatistics->addStdDev("Broose: Sent BUCKET Messages/s", bucketCount / time);
00564     globalStatistics->addStdDev("Broose: Sent BUCKET Byte/s", bucketBytesSent / time);
00565 
00566     globalStatistics->addStdDev("Broose: Sent BROOSEPING Messages/s", broosePingCount / time);
00567     globalStatistics->addStdDev("Broose: Sent BROOSEPING Bytes/s", broosePingBytesSent / time);
00568 }

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:
node the NodeHandle
key destination key
numSiblings The nodes knows all numSiblings nodes close to this key
err return false if the range could not be determined
Returns:
bool true, if the node is responsible for the key.

Reimplemented from BaseOverlay.

Referenced by findNode().

00616 {
00617 // TODO: node != thisNode doesn't work yet
00618     if (key.isUnspecified())
00619         error("Broose::isSiblingFor(): key is unspecified!");
00620 
00621     if (node != thisNode)
00622         error("Broose::isSiblingsFor(): "
00623               "node != thisNode is not implemented!");
00624 
00625     if (numSiblings > getMaxNumSiblings()) {
00626         opp_error("Broose::isSiblingFor(): numSiblings too big!");
00627     }
00628     // set default number of siblings to consider
00629     if (numSiblings == -1) numSiblings = getMaxNumSiblings();
00630 
00631     if (protoState != READY) {
00632         *err = true;
00633         return false;
00634     }
00635 
00636     return bBucket->keyInRange(key);
00637 }

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.

00116 {
00117     changeState(INIT);
00118 
00119     // if the bootstrap node is unspecified we are the only node in the network
00120     // so we can skip the "normal" join protocol
00121     if (bootstrapNode.isUnspecified()) {
00122         changeState(READY);
00123     }
00124 }

void Broose::handleUDPMessage ( BaseOverlayMessage *  msg  )  [virtual]

Processes messages from underlay.

Parameters:
msg Message from UDP

Reimplemented from BaseOverlay.

00267 {
00268     error("Broose::handleUDPMessage called!");
00269 }

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:
msg The overlay message to be sent to the UDP layer

Reimplemented from BaseOverlay.

00571 {
00572     BaseOverlayMessage* innerMsg;
00573 
00574     if (msg->getType() == OVERLAYROUTE)
00575         innerMsg = dynamic_cast<BaseOverlayMessage*>(msg->encapsulatedMsg());
00576     else
00577         innerMsg = msg;
00578 
00579     switch (innerMsg->getType()) {
00580 
00581     case RPC: {
00582         if ((dynamic_cast<BucketCall*>(innerMsg) != NULL) ||
00583                 (dynamic_cast<BucketResponse*>(innerMsg) != NULL)) {
00584             RECORD_STATS(bucketCount++; bucketBytesSent +=
00585                              msg->byteLength());
00586         } else if ((dynamic_cast<BroosePingCall*>(innerMsg) != NULL) ||
00587                    (dynamic_cast<BroosePingResponse*>(innerMsg) != NULL)) {
00588             RECORD_STATS(broosePingCount++; broosePingBytesSent +=
00589                              msg->byteLength());
00590         }
00591         break;
00592     }
00593     }
00594 }

bool Broose::handleRpc ( BaseCallMessage *  msg  )  [virtual]

Processes Remote-Procedure-Call invokation messages.


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

Returns:
true, if rpc has been handled

Reimplemented from BaseRpc.

00672 {
00673     if (protoState == BSET || protoState == READY) {
00674         // delegate messages
00675         RPC_SWITCH_START( msg )
00676         // RPC_DELEGATE( <messageName>[Call|Response], <methodToCall> )
00677         RPC_DELEGATE(Bucket, handleBucketRequestRpc);
00678         RPC_DELEGATE(BroosePing, handleBroosePingRequestRpc);
00679         RPC_SWITCH_END( )
00680         return RPC_HANDLED;
00681     } else {
00682 //        EV << "[Broose::handleRpc() @ " << thisNode.ip
00683 //           << " (" << thisNode.key.toString(16) << ")]\n"
00684 //           << "    Received RPC call and state != READY || BSET!"
00685 //           << endl;
00686         return false;
00687     }
00688 }

void Broose::handleTimerEvent ( cMessage *  msg  )  [virtual]

Processes "timer" self-messages.

Parameters:
msg A self-message

Reimplemented from BaseOverlay.

00272 {
00273     if(msg->isName("join_timer"))
00274         handleJoinTimerExpired(msg);
00275     else if (msg->isName("bucket_timer"))
00276         handleBucketTimerExpired(msg);
00277     else
00278         error("Broose::handleTimerEvent - no other timer currently in use!");
00279 }

void Broose::updateTooltip (  ) 

updates information shown in tk-environment

Referenced by changeState().

00640 {
00641     if (ev.isGUI()) {
00642         std::stringstream ttString;
00643 
00644         // show our ip and key in tooltip
00645         ttString << thisNode.ip << " " << thisNode.key;
00646 
00647         parentModule()->parentModule()->displayString().
00648         setTagArg("tt", 0, ttString.str().c_str());
00649         parentModule()->displayString().
00650         setTagArg("tt", 0, ttString.str().c_str());
00651         displayString().setTagArg("tt", 0, ttString.str().c_str());
00652 
00653     }
00654 }

void Broose::handleJoinTimerExpired ( cMessage *  msg  )  [protected]

handles a expired join timer

Parameters:
msg the timer self-message

Referenced by handleTimerEvent().

00282 {
00283     if (protoState == READY)
00284         return;
00285 
00286     if (!bootstrapNode.isUnspecified()) {
00287         // create new lookup message
00288         BucketCall* bCallArray[powShiftingBits];
00289 
00290         // do lookups for key >> shiftingBits for each prefix
00291         OverlayKey newKey = thisNode.key >> shiftingBits;
00292         for (int i = 0; i < powShiftingBits; i++) {
00293             OverlayKey add(i);
00294             add = add << (keyLength - shiftingBits);
00295             add += newKey;
00296 
00297             bCallArray[i] = new BucketCall("BBucketCall");
00298             bCallArray[i]->setBucketType(BROTHER);
00299             bCallArray[i]->setBucketIndex(i);
00300             bCallArray[i]->setProState(PINIT);
00301             bCallArray[i]->setLength(BUCKETCALL_L(bCallArray[i]));
00302 
00303             // restart join protocol if one call times out
00304             // otherwise the node might be isolated
00305             sendRouteRpcCall(OVERLAY_COMP, bootstrapNode, add,
00306                              bCallArray[i]);
00307         }
00308     } else {
00309         // if the bootstrap node is unspecified we are the only node in the network
00310         // so we can skip the "normal" join protocol
00311         changeState(READY);
00312     }
00313 }

void Broose::handleBucketTimerExpired ( cMessage *  msg  )  [protected]

handles a expired bucket refresh timer

Parameters:
msg the bucket refresh self-message

Referenced by handleTimerEvent().

00316 {
00317     BrooseBucket* tmpBucket = new BrooseBucket();
00318     tmpBucket->initializeBucket (0, 0, thisBrooseNode,
00319                                  (2*powShiftingBits*rBucketSize + 7*bucketSize),
00320                                  this);
00321 
00322     for (int i = 0; i < powShiftingBits; i++) {
00323         for(uint j = 0; j < rBucket[i]->getSize(); j++) {
00324             if ((simulation.simTime() - rBucket[i]->getLastSeen(
00325                         rBucket[i]->get(j))) > refreshTime
00326                     || rBucket[i]->getRTT(rBucket[i]->get(j)) == -1) {
00327 
00328                 tmpBucket->add(BrooseHandle(rBucket[i]->get(j)));
00329             }
00330         }
00331     }
00332 
00333     for (uint i = 0; i < lBucket->getSize(); i++) {
00334         if ((simulation.simTime() - lBucket->getLastSeen(
00335                     lBucket->get(i))) > refreshTime
00336                 || lBucket->getRTT(lBucket->get(i)) == -1) {
00337 
00338             tmpBucket->add(BrooseHandle(lBucket->get(i)));
00339         }
00340     }
00341 
00342     for (uint i = 0; i < bBucket->getSize(); i++) {
00343         if ((simulation.simTime() - bBucket->getLastSeen(
00344                     bBucket->get(i))) > refreshTime
00345                 || bBucket->getRTT(bBucket->get(i)) == -1 ) {
00346 
00347             tmpBucket->add(BrooseHandle(bBucket->get(i)));
00348         }
00349     }
00350 
00351     maxPings = tmpBucket->getSize();
00352 
00353     if (maxPings != 0) {
00354         BroosePingCall** array = new BroosePingCall*[tmpBucket->getSize()];
00355 
00356         for (uint i = 0; i < tmpBucket->getSize(); i++) {
00357             array[i] = new BroosePingCall("PingCall");
00358             array[i]->setLength(BROOSEPINGCALL_L(array[i]));
00359 
00360             sendUdpRpcCall(tmpBucket->get(i), array[i]);
00361         }
00362     } else {
00363         numPings = 0;
00364         scheduleAt(simulation.simTime() + pingDelay, bucket_timer);
00365     }
00366     delete tmpBucket;
00367 }

void Broose::changeState ( int  state  )  [protected]

changes the node's state

Parameters:
state the state to which a node is changing

Referenced by handleBucketResponseRpc(), handleBucketTimeout(), handleJoinTimerExpired(), and joinOverlay().

00128 {
00129     switch (state) {
00130     case INIT: {
00131         protoState = INIT;
00132 
00133         if (!refresh) {
00134             // Calculate node's id by hashing its IP address
00135             thisNode.key = OverlayKey::sha1(
00136                                const_cast<char*>(thisNode.ip.str().c_str()));
00137             callUpdate(thisNode, true);
00138             thisBrooseNode = BrooseHandle(thisNode);
00139             updateTooltip();
00140         } else {
00141             bootstrapList->removeBootstrapNode(thisNode);
00142         }
00143 
00144         // find a new bootstrap node and enroll to the bootstrap list
00145         bootstrapNode = bootstrapList->getBootstrapNode();
00146 
00147         cancelEvent(join_timer);
00148         scheduleAt(simulation.simTime(), join_timer);
00149 
00150         // initialize respectively clear the buckets
00151         for (int i = 0; i < powShiftingBits; i++) {
00152             rBucket[i]->initializeBucket(shiftingBits, i,
00153                                          thisBrooseNode, rBucketSize, this);
00154         }
00155 
00156         lBucket->initializeBucket(-shiftingBits, 0, thisBrooseNode,
00157                                   powShiftingBits*rBucketSize, this);
00158         bBucket->initializeBucket(0, 0, thisBrooseNode, 7*bucketSize,
00159                                   this, true);
00160 
00161         // if we have restarted the join protocol reset parameters
00162         refresh = false;
00163         receivedBBucketLookup = 0;
00164         receivedLBucketLookup = 0;
00165         receivedJoinResponse = 0;
00166 
00167         assert(parentModule()->parentModule());
00168         parentModule()->parentModule()->bubble("Enter INIT state.");
00169         break;
00170     }
00171 
00172     case RSET: {
00173         protoState = RSET;
00174 
00175         BrooseBucket* tmpBucket = new BrooseBucket();
00176         tmpBucket->initializeBucket(0, 0, thisNode,
00177                                     powShiftingBits*rBucketSize, this);
00178 
00179         for (int i = 0; i < powShiftingBits; i++) {
00180             int size = rBucket[i]->getSize();
00181 
00182             for (int j = 0; j < size; j++) {
00183                 tmpBucket->add(rBucket[i]->get(j));
00184             }
00185         }
00186 
00187         BucketCall** bCall = new BucketCall*[tmpBucket->getSize()];
00188         for (uint i = 0; i < tmpBucket->getSize(); i++) {
00189             bCall[i] = new BucketCall("LBucketCall");
00190             bCall[i]->setBucketType(LEFT);
00191             bCall[i]->setProState(PRSET);
00192             bCall[i]->setLength(BUCKETCALL_L(bcall[i]));
00193 
00194             sendUdpRpcCall(tmpBucket->get(i), bCall[i], NULL,
00195                            numberRetries, joinDelay);
00196         }
00197 
00198         // half of the calls must return to init a state change
00199         numberBBucketLookup = tmpBucket->getSize();
00200         numberBBucketLookup = (numberBBucketLookup == 1) ?
00201                               numberBBucketLookup : (numberBBucketLookup/2);
00202 
00203         delete tmpBucket;
00204 
00205         assert(parentModule()->parentModule());
00206         parentModule()->parentModule()->bubble("Enter RSET state.");
00207         break;
00208     }
00209 
00210     case BSET: {
00211         protoState = BSET;
00212 
00213         // half of the calls must return to init a state change
00214         numberLBucketLookup = bBucket->getSize();
00215         numberLBucketLookup = (numberLBucketLookup == 1) ?
00216                               numberLBucketLookup : (numberLBucketLookup/2);
00217 
00218         // send messages to all entries of the B Bucket
00219         int size2 = bBucket->getSize();
00220         BucketCall** bCall2 = new BucketCall*[size2];
00221         for (int i = 0; i < size2; i++) {
00222             bCall2[i] = new BucketCall("LBucketCall");
00223             bCall2[i]->setBucketType(LEFT);
00224             bCall2[i]->setProState(PBSET);
00225             bCall2[i]->setLength(BUCKETCALL_L(bcall2[i]));
00226 
00227             sendUdpRpcCall(bBucket->get(i), bCall2[i], NULL,
00228                            numberRetries, joinDelay);
00229         }
00230 
00231         assert(parentModule()->parentModule());
00232         parentModule()->parentModule()->bubble("Enter BSET state.");
00233         break;
00234     }
00235 
00236     case READY: {
00237         protoState = READY;
00238 //        bootstrapList->registerBootstrapNode(thisNode);
00239 
00240         //fill the bucket also with this node
00241         for (int i = 0; i < powShiftingBits; i++) {
00242             rBucket[i]->add(thisBrooseNode);
00243         }
00244 
00245         lBucket->add(thisBrooseNode);
00246         bBucket->add(thisBrooseNode);
00247 
00248         // to disable the ping protocol a pingDelay or
00249         // refreshTime of zero was given
00250         if (!(pingDelay == 0 || refreshTime == 0)) {
00251             cancelEvent(bucket_timer);
00252             scheduleAt(simulation.simTime() + pingDelay, bucket_timer);
00253         }
00254 
00255         assert(parentModule()->parentModule());
00256         parentModule()->parentModule()->bubble("Enter READY state.");
00257 
00258         updateTooltip();
00259         break;
00260     }
00261 
00262     }
00263     setOverlayReady(protoState == READY);
00264 }

NodeVector * Broose::findNode ( const OverlayKey key,
int  numRedundantNodes,
int  numSiblings,
BaseOverlayMessage *  msg 
) [protected, virtual]

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:
key The lookup key.
numRedundantNodes Maximum number of next hop nodes to return.
numSiblings number of siblings to return
msg A pointer to the BaseRouteMessage or FindNodeCall message of this lookup.
Returns:
NodeVector with closest nodes.

Reimplemented from BaseOverlay.

00385 {
00386     NodeVector* nextHop = new NodeVector(1);
00387     BrooseFindNodeExtMessage *findNodeExt = NULL;
00388     bool err;
00389 
00390     //return the closest nodes
00391     if (isSiblingFor(thisNode, key, numSiblings, &err)) {
00392         BrooseBucket* tmpBBucket = new BrooseBucket();
00393         BrooseHandle node;
00394         node.key = key;
00395         tmpBBucket->initializeBucket(0, 0, node, bucketSize, this);
00396         int size;
00397 
00398         if (bBucket->getSize() > bucketSize)
00399             size = bucketSize;
00400         else
00401             size = bBucket->getSize();
00402 
00403         for (uint i= 0; i < bBucket->getSize();i++)
00404             tmpBBucket->add(bBucket->get(i));
00405 
00406         // todo: this has to be returned, if IterativeLookup can deal
00407         // with the complete vector:
00408         for (int i = 0; i < size; i++)
00409             nextHop->push_back(tmpBBucket->get(i));
00410 
00411 //        nextHop->push_back(tmpBBucket->get(0));
00412 
00413         delete tmpBBucket;
00414         return nextHop;
00415     }
00416 
00417     if (msg != NULL) {
00418         if (!msg->hasObject("findNodeExt")) {
00419             findNodeExt = new BrooseFindNodeExtMessage("findNodeExt");
00420 
00421             OverlayKey routeKey = thisNode.key;
00422             // estimate distance
00423             int dist = max(rBucket[0]->longestPrefix(),
00424                            rBucket[1]->longestPrefix()) + 1 + userDist;
00425 
00426             if ((dist % shiftingBits) != 0)
00427                 dist += (shiftingBits - (dist % shiftingBits));
00428 
00429             if (dist > keyLength) {
00430                 if ((keyLength % shiftingBits) == 0) {
00431                     dist = keyLength;
00432                 } else {
00433                     dist = (keyLength - keyLength % shiftingBits);
00434                 }
00435             }
00436 
00437             if ((chooseLookup++) % 2 == 0) {
00438                 // init left shifting lookup
00439                 findNodeExt->setRightShifting(false);
00440 
00441                 int prefix = 0;
00442                 for (int i = 0; i < dist; i++) {
00443                     prefix += thisNode.key.getBitRange(thisNode.key.getLength() - i - 1, 1) << (dist - i - 1);
00444                 }
00445 
00446                 OverlayKey pre(prefix);
00447                 routeKey = key >> dist;
00448                 routeKey += (pre << key.getLength() - dist);
00449 
00450                 dist = -dist;
00451             } else {
00452                 // init right shifting lookup
00453                 findNodeExt->setRightShifting(true);
00454             }
00455 
00456             //add contact for next Hop
00457             findNodeExt->setLastNode(thisNode);
00458             findNodeExt->setRouteKey(routeKey);
00459             findNodeExt->setStep(dist);
00460             findNodeExt->setLength(BROOSEFINDNODEEXTMESSAGE_L);
00461 
00462             msg->addObject( findNodeExt );
00463         }
00464 
00465         findNodeExt = (BrooseFindNodeExtMessage*) msg->getObject("findNodeExt");
00466     }
00467 
00468 
00469     // check for messages which couldn't be routed
00470     if (findNodeExt->getStep() == 0) {
00471         if (!isSiblingFor(thisNode, key, numSiblings, &err)) {
00472             //      cout << "Message failed - destKey " << key << "@ simtime " << simulation.simTime()
00473             // << " @node " << thisNode.ip << " lastNode " << findNodeExt->getLastNode().ip << endl;
00474             numFailedPackets++;
00475         } else
00476             error("Broose::findNode - unexpected Error");
00477         return nextHop;
00478     }
00479 
00480     if (findNodeExt->getRightShifting() == false) {
00481         // Left Shifting Lookup
00482 
00483         // can't handle left shifting lookup in BSET-State
00484         if (protoState == BSET)
00485             return nextHop;
00486 
00487         // update buckets with last hop
00488         addNode(findNodeExt->getLastNode());
00489         setLastSeen(findNodeExt->getLastNode());
00490 
00491         // replace last hop contact information with
00492         // this hop contact information
00493         findNodeExt->setLastNode(thisNode);
00494 
00495 
00496         // calculate routing key
00497         findNodeExt->setRouteKey((findNodeExt->getRouteKey()) << shiftingBits);
00498         findNodeExt->setStep(findNodeExt->getStep() + shiftingBits);
00499 
00500         // On last hop exchange routeKey for destKey especially
00501         // useful when using lookupNodeIds
00502         NodeHandle nextNode;
00503 
00504         if (findNodeExt->getStep() == 0)
00505             nextNode = lBucket->getClosestNode(key);
00506         else
00507             nextNode = lBucket->getClosestNode(findNodeExt->getRouteKey());
00508 
00509         nextHop->push_back(nextNode);
00510     } else {
00511         // Right Shifting Lookup
00512 
00513         // update buckets with last hop
00514         addNode(findNodeExt->getLastNode());
00515         setLastSeen(findNodeExt->getLastNode());
00516 
00517         // replace last hop contact information with
00518         // this hop contact information
00519         findNodeExt->setLastNode(thisNode);
00520 
00521         // calculate routing key
00522         int prefix = 0;
00523         int dist = findNodeExt->getStep();
00524         OverlayKey routeKey = findNodeExt->getRouteKey() >> shiftingBits;
00525         for (int i = 0; i < shiftingBits; i++)
00526             prefix += ((int)key.getBit(key.getLength() - dist + i) << i);
00527         OverlayKey pre(prefix);
00528         routeKey += (pre << (routeKey.getLength()-shiftingBits));
00529 
00530         findNodeExt->setRouteKey(routeKey);
00531         findNodeExt->setStep(dist - shiftingBits);
00532 
00533         // On last hop exchange routeKey for destKey especially
00534         // useful when using lookupNodeIds
00535         NodeHandle nextNode;
00536 
00537         if (findNodeExt->getStep() == 0)
00538             nextNode = rBucket[prefix]->getClosestNode(key);
00539         else
00540             nextNode = rBucket[prefix]->getClosestNode(routeKey);
00541 
00542         nextHop->push_back(nextNode);
00543     }
00544 
00545     if ((*nextHop)[0] == thisNode) {
00546         return (findNode(key, numRedundantNodes, numSiblings, msg));
00547     } else
00548         return nextHop;
00549 }

bool Broose::keyBelongsToNode ( const OverlayKey key  )  [protected]

decides if a specific key is managed by this node

Parameters:
key the key
Returns:
bool value, if the key is managed by this node

int Broose::getMaxNumSiblings (  )  [protected, virtual]

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.

Referenced by isSiblingFor().

00371 {
00372     return bucketSize;
00373 }

int Broose::getMaxNumRedundantNodes (  )  [protected, virtual]

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.

00376 {
00377     return bucketSize;
00378 }

void Broose::displayBucketState (  )  [protected]

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

00597 {
00598     EV << "[Broose::displayBucketState() @ " << thisNode.ip
00599     << " (" << thisNode.key.toString(16) << ")]" << endl;
00600     for (int i = 0; i < powShiftingBits; i++) {
00601         EV << "    Content of rBucket[" << i << "]: ";
00602         rBucket[i]->output();
00603     }
00604     EV << "    Content of lBucket: ";
00605     lBucket->output();
00606     EV << "    Content of bBucket: ";
00607     bBucket->output();
00608     EV << endl;
00609 }

void Broose::binaryOutput ( const OverlayKey key  )  [protected]

outputs an Overlay key in the binary system

Parameters:
key the key to output
00657 {
00658     EV << "[Broose::binaryOutput() @ " << thisNode.ip;
00659     if (key.isUnspecified()) {
00660         EV << " (<unspec>)]"
00661         << endl;
00662     } else {
00663         EV << " (";
00664         for (unsigned int i = 1; i <= key.getLength(); i++) {
00665             EV << key.getBit(key.getLength() - i);
00666         }
00667         EV << ")]" << endl;
00668     }
00669 }

void Broose::handleRpcResponse ( BaseResponseMessage *  msg,
cPolymorphic *  context,
int  rpcId,
simtime_t  rtt 
) [protected, virtual]

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

Parameters:
msg The response message.
context Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code
rpcId The RPC id.
rtt The Round-Trip-Time of this RPC

Reimplemented from RpcListener.

00693 {
00694     RPC_SWITCH_START(msg)
00695     RPC_ON_RESPONSE( BroosePing ) {
00696         handleBroosePingResponseRpc(_BroosePingResponse, rtt);
00697         EV << "[Broose::handleRpcResponse() @ " << thisNode.ip
00698         << " (" << thisNode.key.toString(16) << ")]\n"
00699         << "    Ping RPC Response received: id=" << rpcId << "\n"
00700         << "    msg=" << *_BroosePingResponse << " rtt=" << rtt
00701         << endl;
00702         break;
00703     }
00704     RPC_ON_RESPONSE( Bucket ) {
00705         handleBucketResponseRpc(_BucketResponse);
00706         EV << "[Broose::handleRpcResponse() @ " << thisNode.ip
00707         << " (" << thisNode.key.toString(16) << ")]\n"
00708         << "    Bucket RPC Response received: id=" << rpcId << "\n"
00709         << "    msg=" << *_BucketResponse << " rtt=" << rtt
00710         << endl;
00711         break;
00712     }
00713     RPC_SWITCH_END( )
00714 }

void Broose::handleRpcTimeout ( BaseCallMessage *  msg,
const TransportAddress dest,
cPolymorphic *  context,
int  rpcId,
const OverlayKey destKey 
) [protected, virtual]

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

Parameters:
msg The original RPC message.
dest The destination node
context Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code
rpcId The RPC id.
destKey the destination OverlayKey

Reimplemented from RpcListener.

00720 {
00721     RPC_SWITCH_START(msg)
00722     RPC_ON_CALL( BroosePing ) {
00723         handleBroosePingTimeout(_BroosePingCall, dest, destKey);
00724         EV << "[Broose::handleRpcTimeout() @ " << thisNode.ip
00725         << " (" << thisNode.key.toString(16) << ")]\n"
00726         << "    Ping RPC Call timed out: id=" << rpcId << "\n"
00727         << "    msg=" << *_BroosePingCall
00728         << endl;
00729         break;
00730     }
00731     RPC_ON_CALL( FindNode ) {
00732         handleFindNodeTimeout(_FindNodeCall, dest, destKey);
00733         EV << "[Broose::handleRpcTimeout() @ " << thisNode.ip
00734         << " (" << thisNode.key.toString(16) << ")]\n"
00735         << "    Find Node RPC Call timed out: id=" << rpcId << "\n"
00736         << "    msg=" << *_FindNodeCall
00737         << endl;
00738         break;
00739     }
00740     RPC_ON_CALL( Bucket ) {
00741         handleBucketTimeout(_BucketCall);
00742         EV << "[Broose::handleRpcTimeout() @ " << thisNode.ip
00743         << " (" << thisNode.key.toString(16) << ")]\n"
00744         << "    Bucket RPC Call timed out: id=" << rpcId << "\n"
00745         << "    msg=" << *_BucketCall
00746         << endl;
00747         break;
00748     }
00749     RPC_SWITCH_END( )
00750 }

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:
findNode The original FindNodeCall
dest the destination node
destKey the destination OverlayKey

Referenced by handleRpcTimeout().

00756 {
00757     for (int i = 0; i < powShiftingBits; i++) {
00758         if (rBucket[i]->getFailedResponses(BrooseHandle(dest, destKey)) == numberRetries)
00759             rBucket[i]->remove
00760             (BrooseHandle(dest, destKey));
00761         else
00762             rBucket[i]->increaseFailedResponses(BrooseHandle(dest, destKey));
00763     }
00764 
00765     if (lBucket->getFailedResponses(BrooseHandle(dest, destKey)) == numberRetries)
00766         lBucket->remove
00767         (BrooseHandle(dest, destKey));
00768     else
00769         lBucket->increaseFailedResponses(BrooseHandle(dest, destKey));
00770 
00771     if (bBucket->getFailedResponses(BrooseHandle(dest, destKey)) == numberRetries)
00772         bBucket->remove
00773         (BrooseHandle(dest, destKey));
00774     else
00775         bBucket->increaseFailedResponses(BrooseHandle(dest, destKey));
00776 }

void Broose::handleBucketRequestRpc ( BucketCall *  msg  )  [protected]

handles a received Bucket request

Parameters:
msg the message to process

Referenced by handleRpc().

00778 {
00779     if (msg->getBucketType() == LEFT) {
00780         // can't handle LBucketRequest in BSET-State
00781         if (protoState == BSET) {
00782             delete msg;
00783             return;
00784         }
00785 
00786         // return L-Bucket
00787         int size = lBucket->getSize();
00788         BucketResponse* bResponse = new BucketResponse("LBucketResponse");
00789         bResponse->setBucketType(msg->getBucketType());
00790         bResponse->setProState(msg->getProState());
00791         bResponse->setNodeNum(size);
00792         bResponse->setNodesArraySize(size);
00793 
00794         for (int i = 0; i < size; i++) {
00795             bResponse->setNodes(i, lBucket->get(i));
00796         }
00797 
00798         bResponse->setLength(BUCKETRESPONSE_L(bResponse));
00799 
00800         addNode(msg->getSrcNode());
00801         setLastSeen(msg->getSrcNode());
00802 
00803         sendRpcResponse(msg, bResponse );
00804     } else if(msg->getBucketType() == BROTHER) {
00805         // return B-Bucket
00806         int size = bBucket->getSize();
00807         BucketResponse* bResponse = new BucketResponse("BBucketResponse");
00808         bResponse->setBucketType(msg->getBucketType());
00809         bResponse->setBucketIndex(msg->getBucketIndex());
00810         bResponse->setProState(msg->getProState());
00811         bResponse->setNodeNum(size);
00812         bResponse->setNodesArraySize(size);
00813 
00814         for (int i = 0; i < size; i++) {
00815             bResponse->setNodes(i, bBucket->get(i));
00816         }
00817         bResponse->setLength(BUCKETRESPONSE_L(bResponse));
00818 
00819         sendRpcResponse(msg, bResponse );
00820     } else
00821         error("Broose::handleBucketRequestRpc() - Wrong Bucket Type!");
00822 }

void Broose::handleBucketResponseRpc ( BucketResponse *  msg  )  [protected]

handles a received Bucket response

Parameters:
msg the message to process

Referenced by handleRpcResponse().

00825 {
00826     if (msg->getBucketType() == LEFT) {
00827         switch (protoState) {
00828         case RSET:
00829             if (msg->getProState() == PRSET) {
00830                 for (int i = 0; i < msg->getNodeNum(); i++) {
00831                     bBucket->add(BrooseHandle(msg->getNodes(i)));
00832                 }
00833                 receivedBBucketLookup++;
00834 
00835                 if (receivedBBucketLookup == numberBBucketLookup)
00836                     changeState(BSET);
00837             }
00838             break;
00839         case BSET:
00840             if (msg->getProState() == PBSET) {
00841                 for (int i = 0; i < msg->getNodeNum(); i++) {
00842                     lBucket->add(BrooseHandle(msg->getNodes(i)));
00843                 }
00844                 receivedLBucketLookup++;
00845 
00846                 if(receivedLBucketLookup == numberLBucketLookup)
00847                     changeState(READY);
00848             }
00849             break;
00850         }
00851     } else if(msg->getBucketType() == BROTHER) {
00852         switch(protoState) {
00853         case INIT:
00854             if (msg->getProState() == PINIT) {
00855                 int k = msg->getBucketIndex();
00856 
00857                 for (int i = 0; i < msg->getNodeNum(); i++) {
00858                     rBucket[k]->add(msg->getNodes(i));
00859                 }
00860 
00861                 receivedJoinResponse++;
00862                 if (receivedJoinResponse == powShiftingBits)
00863                     changeState(RSET);
00864             }
00865         }
00866     } else
00867         error("Broose::handleBucketRequestRpc() - unknown error.");
00868 }

void Broose::handleBucketTimeout ( BucketCall *  msg  )  [protected]

handles a received Bucket timeout

Parameters:
msg the message to process

Referenced by handleRpcTimeout().

00872 {
00873     if (protoState == READY)
00874         return;
00875     else {
00876         refresh = true;
00877         changeState(INIT);
00878     }
00879 }

void Broose::handleBroosePingRequestRpc ( BroosePingCall *  msg  )  [protected]

handles a received Ping request

Parameters:
msg the message to process

Referenced by handleRpc().

00883 {
00884     BroosePingResponse* pingResponse = new BroosePingResponse("PingResponse");
00885     pingResponse->setLength(BROOSEPINGRESPONSE_L(pingResponse));
00886 
00887     // add pinging node to all buckets and update lastSeen of node
00888     addNode(msg->getSrcNode());
00889     setLastSeen(msg->getSrcNode());
00890 
00891     sendRpcResponse(msg, pingResponse);
00892 }

void Broose::handleBroosePingResponseRpc ( BroosePingResponse *  msg,
simtime_t  rtt 
) [protected]

handles a received Ping response

Parameters:
msg the message to process
rtt the round trip time of the message

Referenced by handleRpcResponse().

00896 {
00897     // if node respond reset failedResponses and add lastSeen to node
00898     setLastSeen(msg->getSrcNode());
00899     resetFailedResponses(msg->getSrcNode());
00900     setRTT(msg->getSrcNode(), rtttime);
00901 
00902     numPings++;
00903 
00904     if (numPings == maxPings) {
00905         numPings = 0;
00906         scheduleAt(simulation.simTime() + pingDelay, bucket_timer);
00907     }
00908 }

void Broose::handleBroosePingTimeout ( BroosePingCall *  msg,
const TransportAddress dest,
const OverlayKey destKey 
) [protected]

handles a received Ping timeout

Parameters:
msg the message to process
dest the destination node
destKey the destination OverlayKey

Referenced by handleRpcTimeout().

00913 {
00914     for (int i = 0; i < powShiftingBits; i++) {
00915         if (rBucket[i]->getFailedResponses(BrooseHandle(dest, destKey)) == numberRetries)
00916             rBucket[i]->remove(BrooseHandle(dest, destKey));
00917         else
00918             rBucket[i]->increaseFailedResponses(BrooseHandle(dest, destKey));
00919     }
00920 
00921     if (lBucket->getFailedResponses(BrooseHandle(dest, destKey)) == numberRetries) {
00922         lBucket->remove(BrooseHandle(dest, destKey));
00923     } else {
00924         lBucket->increaseFailedResponses(BrooseHandle(dest, destKey));
00925     }
00926 
00927     if (bBucket->getFailedResponses(BrooseHandle(dest, destKey)) == numberRetries) {
00928         bBucket->remove(BrooseHandle(dest, destKey));
00929     } else {
00930         bBucket->increaseFailedResponses(BrooseHandle(dest, destKey));
00931     }
00932 
00933     numPings++;
00934 
00935     if (numPings == maxPings) {
00936         numPings = 0;
00937         scheduleAt(simulation.simTime() + pingDelay, bucket_timer);
00938     }
00939 }

void Broose::setLastSeen ( NodeHandle  node  )  [protected]

updates the timestamp of a node in all buckets

Parameters:
node node handle which should be updated

Referenced by findNode(), handleBroosePingRequestRpc(), handleBroosePingResponseRpc(), and handleBucketRequestRpc().

00942 {
00943     for (int i = 0; i < powShiftingBits; i++) {
00944         rBucket[i]->setLastSeen(BrooseHandle(node), simulation.simTime());
00945     }
00946 
00947     lBucket->setLastSeen(BrooseHandle(node), simulation.simTime());
00948     bBucket->setLastSeen(BrooseHandle(node), simulation.simTime());
00949 }

void Broose::addNode ( NodeHandle  node,
int  bucket = 0 
) [protected]

adds a node to all buckets

Parameters:
node node handle which should be added
bucket reserved

Referenced by findNode(), handleBroosePingRequestRpc(), and handleBucketRequestRpc().

00952 {
00953     if (bucket == 0) {
00954         // add node to all buckets
00955         for (int i = 0; i < powShiftingBits; i++) {
00956             rBucket[i]->add
00957             (BrooseHandle(node));
00958         }
00959 
00960         lBucket->add(BrooseHandle(node));
00961         bBucket->add(BrooseHandle(node));
00962     } else
00963         error("Broose::addNode() - not implemented");
00964 }

void Broose::resetFailedResponses ( NodeHandle  node  )  [protected]

resets the counter of failed responses

Parameters:
node node handle of the responding node

Referenced by handleBroosePingResponseRpc().

00967 {
00968     for (int i = 0; i < powShiftingBits; i++) {
00969         rBucket[i]->resetFailedResponses(BrooseHandle(node));
00970     }
00971 
00972     lBucket->resetFailedResponses(BrooseHandle(node));
00973     bBucket->resetFailedResponses(BrooseHandle(node));
00974 }

void Broose::setRTT ( NodeHandle  node,
simtime_t  rtt 
) [protected]

sets the rtt to a node in all buckets

Parameters:
node node handle to which a rtt is added/updated
rtt round trip time to the node

Referenced by handleBroosePingResponseRpc().

00977 {
00978     for (int i = 0; i < powShiftingBits; i++) {
00979         rBucket[i]->setRTT(BrooseHandle(node), rtttime);
00980     }
00981 
00982     lBucket->setRTT(BrooseHandle(node), rtttime);
00983     bBucket->setRTT(BrooseHandle(node), rtttime);
00984 }


Friends And Related Function Documentation

friend class BrooseBucket [friend]


Member Data Documentation

int Broose::chooseLookup [protected]

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

Referenced by findNode(), and initializeOverlay().

int Broose::joinDelay [protected]

time interval between two join tries

Referenced by changeState(), and initializeOverlay().

int Broose::protoState [protected]

number of received join response messages

Referenced by changeState(), handleBucketResponseRpc(), and initializeOverlay().

number of received lookup responses for the B bucket

Referenced by changeState(), handleBucketResponseRpc(), and initializeOverlay().

int Broose::numberBBucketLookup [protected]

maximal number of lookup reponses for the B bucket

Referenced by changeState(), handleBucketResponseRpc(), and initializeOverlay().

number of received lookup responses for the L bucket

Referenced by changeState(), handleBucketResponseRpc(), and initializeOverlay().

int Broose::numberLBucketLookup [protected]

maximal number of lookup reponses for the L bucket

Referenced by changeState(), handleBucketResponseRpc(), and initializeOverlay().

int Broose::shiftingBits [protected]

number of bits shifted in/out each step

Referenced by changeState(), findNode(), handleJoinTimerExpired(), and initializeOverlay().

int Broose::powShiftingBits [protected]

uint Broose::bucketSize [protected]

uint Broose::rBucketSize [protected]

maximal number of entries in the r buckets

Referenced by changeState(), handleBucketTimerExpired(), and initializeOverlay().

int Broose::parallelRequests [protected]

number ob parallel requests

Referenced by initializeOverlay().

int Broose::keyLength [protected]

length of the node and data IDs

Referenced by findNode(), handleJoinTimerExpired(), and initializeOverlay().

bool Broose::refresh [protected]

is the node restarting the bootstrap protocol or is it a new node

Referenced by changeState(), handleBucketTimeout(), and initializeOverlay().

int Broose::pingDelay [protected]

int Broose::refreshTime [protected]

time intervall after which a ping is done

Referenced by changeState(), handleBucketTimerExpired(), and initializeOverlay().

uint Broose::userDist [protected]

how many hops are added to the estimated hop count

Referenced by findNode(), and initializeOverlay().

int Broose::numPings [protected]

actual number of received ping messages

Referenced by handleBroosePingResponseRpc(), handleBroosePingTimeout(), handleBucketTimerExpired(), and initializeOverlay().

int Broose::maxPings [protected]

int Broose::numberRetries [protected]

number of retries in case of timeout

Referenced by changeState(), handleBroosePingTimeout(), handleFindNodeTimeout(), and initializeOverlay().

int Broose::bucketCount [protected]

number of Bucket messages

Referenced by finishOverlay(), initializeOverlay(), and recordOverlaySentStats().

int Broose::bucketBytesSent [protected]

length of all Bucket messages

Referenced by finishOverlay(), initializeOverlay(), and recordOverlaySentStats().

int Broose::broosePingCount [protected]

number of Ping messages

Referenced by finishOverlay(), initializeOverlay(), and recordOverlaySentStats().

int Broose::broosePingBytesSent [protected]

length of all Ping messages

Referenced by finishOverlay(), initializeOverlay(), and recordOverlaySentStats().

int Broose::numFailedPackets [protected]

number of packets which couldn't be routed correctly

Referenced by findNode(), finishOverlay(), and initializeOverlay().

cMessage* Broose::join_timer [protected]

cMessage* Broose::bucket_timer [protected]

node handle holding the bootstrap node

Referenced by changeState(), handleJoinTimerExpired(), and joinOverlay().

this is a BrooseHandle of the current node like thisNode

Referenced by changeState(), and handleBucketTimerExpired().


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

Generated on Fri Sep 19 13:05:06 2008 for ITM OverSim by  doxygen 1.5.5