BaseOverlay Class Reference

#include <BaseOverlay.h>

Inheritance diagram for BaseOverlay:

RpcListener Chord Gia List of all members.

Detailed Description

Base class for overlays.

Base class for overlay modules, with KBR-API, statistics and pointers to the BootstrapOracle and the UnderlayConfigurator. A minimal overlay has to implement numInitStages(), route(), handleUDPMessage() and receiveChangeNotification(). Derived classes must use BaseOverlayMessage as base class for own message types.

Author:
Bernhard Heep (initial)

Sebastian Mies (rpc, lookup)


Public Member Functions

virtual ~BaseOverlay ()
 Virtual destructor.
virtual void setMalicious (bool malicious)
 Sets node to a malicious state.
bool isMalicious ()
 Returns true, if node is malicious.
NodeHandlegetThisNode ()
 Returns the NodeHandle of this node.
void sendMessageToUDP (const NodeHandle &dest, BaseOverlayMessage *msg)
 Sends message to underlay.
uint32_t sendRpcMessage (const NodeHandle &dest, BaseCallMessage *msg, RpcListener *rpcListener=NULL, const OverlayKey &destKey=OverlayKey::UNSPECIFIED_KEY, int rpcId=-1, simtime_t timeout=-1, int retries=0)
 Sends a Remote-Procedure-Call message to the underlay.
void cancelRpcMessage (uint32_t nonce)
 Cancels a Remote-Procedure-Call.
void sendToKey (const OverlayKey &key, BaseOverlayMessage *message, uint numNeighbors=0, const NodeHandle &nextHop=NodeHandle::UNSPECIFIED_NODE)
 Sends a message to a overlay node, with the generic routing algorithm.

Protected Types

typedef hash_set< AbstractLookup *,
lookupHashFcn, lookupHashFcn
LookupSet

Protected Member Functions

int numInitStages () const
 Sets init stage.
virtual void initializeOverlay (int stage)
 Initializes derived-class-attributes.
virtual void finishOverlay ()
 collects statistical data in derived class
virtual void route (const OverlayKey &key, cMessage *msg, const NodeHandle &hint=NodeHandle::UNSPECIFIED_NODE)
 Routes message through overlay.
virtual bool isResponsible (const OverlayKey &key)
 Query if the node is responsible for a key.
void callDeliver (BaseOverlayMessage *msg)
 Calls deliver function in application.
void callForward (OverlayKey &key, BaseRouteMessage *msg, NodeHandle *hint=NULL)
 Calls forward function in application.
virtual void handleUDPMessage (BaseOverlayMessage *msg)=0
 Processes messages from underlay.
virtual void handleTimerEvent (cMessage *msg)
 Processes "timer" self-messages.
virtual void handleAppMessage (cMessage *msg)
 Processes non-commonAPI messages.
void setReadyIcon (bool ready)
 Colors module-icon blue (ready) or red (not ready).
void showOverlayNeighborArrow (const NodeHandle &neighbor, bool flush=true, char *displayString=NULL)
 Draws an arrow from this node to neighbor.
void deleteOverlayNeighborArrow (const NodeHandle &neighbor)
 Removes an arrow from this node to neighbor.
void sendRpcResponse (BaseCallMessage *call, BaseResponseMessage *response)
 Send Remote-Procedure response message and deletes call message.
virtual void handleRpc (BaseCallMessage *msg)
 Processes Remote-Procedure-Call invokation messages.
virtual AbstractLookupcreateLookup ()
 Creates a abstract iterative lookup instance.
virtual void removeLookup (AbstractLookup *lookup)
 Removes the abstract lookup instance.
virtual OverlayKey distance (const OverlayKey &x, const OverlayKey &y) const
 This method should implement the distance between two keys.
virtual NodeVectorfindNode (const OverlayKey &key, BaseOverlayMessage *msg=NULL)
 Implements the find node call.
virtual PingResponseping (PingCall *call)
 Implements a ping call.

Protected Attributes

int numForwarded
 number of forwarded packets
int bytesForwarded
 number of forwarded bytes at out-gate
int numSignalingForwarded
 number of forwarded signaling packets
int bytesSignalingForwarded
 number of forwarded signaling bytes at out-gate
cModule * thisTerminal
 pointer to corresponding node
NodeHandle thisNode
 NodeHandle to this node.
BootstrapOraclebootstrapOracle
 pointer to BootstrapOracle in this node
NotificationBoard * notificationBoard
 pointer to NotificationBoard in this node
UnderlayConfiguratorunderlayConfigurator
 pointer to UnderlayConfigurator in this node
bool debugOutput
 debug output ?
bool measureNetwInitPhase
 fetch statistics in init phase ?
bool onlyCommonAPIMessages
 drop non-commonAPIMessages ?
bool useBaseLookup
 use the base lookup class
bool iterativeLookup
 do iterative instead of recursive lookups
int localPort
 used UDP-port
int hopCountMax
 maximum hop count
int numDropped
 number of dropped packets
int bytesDropped
 number of dropped bytes
bool malicious
 true, if node is malicious
cOutVector delayVector
 statistical output vector for packet-delays
cOutVector hopCountVector
 statistical output vector for hop-counts
BaseLookupConfiguration baseLookupConfig
LookupSet lookups

Private Types

typedef hash_map< int, RpcStateRpcStates
 IN
 OUT
enum  Direction { IN, OUT }

Private Member Functions

void initialize (int stage)
 initializes base-class-attributes
void finish ()
 collects statistical data
void handleMessage (cMessage *msg)
 Checks for message type and calls corresponding method.
void handleBaseOverlayMessage (BaseOverlayMessage *msg)
 Handles a BaseOverlayMessage
.
void compactGateArray (cModule *terminal, enum Direction dir)
 compacts arrow gate-array
void internalHandleRpcMessage (BaseRpcMessage *msg)
 Handles incoming rpc messages and delegates them to the corresponsing listeners or handlers.
bool internalHandleRpc (BaseCallMessage *msg)
 Handles internal rpc requests.
void initRpcs ()
 Initializes Remote-Procedure state.
void finishRpcs ()
 Deinitializes Remote-Procedure state.
void initLookups ()
void finishLookups ()
void internalRoute (const OverlayKey &key, cMessage *msg, const NodeHandle &hint=NodeHandle::UNSPECIFIED_NODE)
void findNodeRpc (FindNodeCall *call)
void pingRpc (PingCall *call)

Private Attributes

int numSent
 number of sent packets (incl. forwarded packets)
int bytesSent
 number of sent bytes (incl. forwarded bytes)
int numSignalingSent
 number of sent signaling packets (incl. forwarded packets)
int bytesSignalingSent
 number of sent signaling bytes (incl. forwarded bytes)
int numReceived
 number of received packets (incl. packets to be forwarded )
int bytesReceived
 number of received bytes (incl. bytes to be forwarded)
int numSignalingReceived
 number of received signaling packets (incl. packets to be forwarded)
int bytesSignalingReceived
 number of received signaling bytes (incl. bytes to be forwarded)
cGate * thisOutGateArray
 out-gate array for vis. overlay topology
cGate * thisInGateArray
 in-gate array for vis. overlay topology
bool drawOverlayTopology
 draw overlay topology?
int rpcsPending
RpcListenerdefaultRpcListener
RpcStates rpcStates

Friends

class BaseLookup

Classes

class  lookupHashFcn
class  RpcState


Member Typedef Documentation

typedef hash_set<AbstractLookup*, lookupHashFcn, lookupHashFcn> BaseOverlay::LookupSet [protected]

typedef hash_map<int,RpcState> BaseOverlay::RpcStates [private]


Member Enumeration Documentation

enum BaseOverlay::Direction [private]

Enumerator:
IN 
OUT 
00349 { IN, OUT };


Constructor & Destructor Documentation

BaseOverlay::~BaseOverlay (  )  [virtual]

Virtual destructor.

00041 {
00042     finishLookups();
00043     finishRpcs();
00044 }


Member Function Documentation

void BaseOverlay::callDeliver ( BaseOverlayMessage msg  )  [protected]

Calls deliver function in application.

Encapsulates messages in KBRdeliver messages and sends them to application.

Parameters:
msg delivered message
00219 {
00220     KBRdeliver* deliverMsg = new KBRdeliver();
00221 
00222     OverlayCtrlInfo* overlayCtrlInfo =
00223         check_and_cast<OverlayCtrlInfo*>
00224         (msg->removeControlInfo());
00225 
00226     deliverMsg->setControlInfo(overlayCtrlInfo);
00227 
00228     deliverMsg->encapsulate(msg->decapsulate());
00229 
00230     send(deliverMsg, "to_app");
00231 
00232     delete msg;
00233 }

void BaseOverlay::callForward ( OverlayKey key,
BaseRouteMessage msg,
NodeHandle hint = NULL 
) [protected]

Calls forward function in application.

Encapsulates messages in KBRforward messages and sends them to application.
the message to be sent through the API must be encapsulated in msg.

Parameters:
key destination key
msg message to forward
hint next hop (usually unused)
00237 {
00238     KBRforward* forwardMsg = new KBRforward();
00239     forwardMsg->encapsulate(msg->decapsulate());
00240 
00241     OverlayCtrlInfo* overlayCtrlInfo =
00242         new OverlayCtrlInfo();
00243     overlayCtrlInfo->setThisNode(thisNode);
00244     overlayCtrlInfo->setHopCount(msg->getHopCount());
00245     overlayCtrlInfo->setDestKey(msg->getDestKey());
00246     overlayCtrlInfo->setSrcNode(msg->getSrcNode());
00247 
00248     forwardMsg->setControlInfo(overlayCtrlInfo);
00249 
00250     send(forwardMsg, "to_app");
00251 
00252     delete msg;
00253 }

void BaseOverlay::cancelRpcMessage ( uint32_t  nonce  ) 

Cancels a Remote-Procedure-Call.

Parameters:
nonce The nonce of the RPC
00730 {
00731     if (rpcStates.count(nonce)==0)
00732         return;
00733     RpcState state = rpcStates[nonce];
00734     rpcStates.erase(nonce);
00735     cancelAndDelete(state.callMsg);
00736     cancelAndDelete(state.timeoutMsg);
00737 }

void BaseOverlay::compactGateArray ( cModule *  terminal,
enum Direction  dir 
) [private]

compacts arrow gate-array

Parameters:
terminal node
dir in- or out-array?
00559 {
00560     cGate* gateArray = (dir == OUT ? terminal->gate("overlayNeighborArrowOut")
00561                         : terminal->gate("overlayNeighborArrowIn"));
00562     const char* gateName = (dir == OUT ? "overlayNeighborArrowOut"
00563                             : "overlayNeighborArrowIn");
00564 
00565     for (int j = 0; j < gateArray->size() - 1; j++) {
00566         if (terminal->gate(gateName, j)->isConnectedOutside())
00567             continue;
00568 
00569         cGate* tempGate = NULL;
00570         int k = 1;
00571         while ((tempGate == NULL) && ((j + k) != gateArray->size())) {
00572             tempGate = (dir == OUT ? terminal->gate(gateName, j + k)->toGate()
00573                         : terminal->gate(gateName, j + k)->fromGate());
00574             k++;
00575         }
00576 
00577         if (tempGate == NULL)
00578             break;
00579 
00580         if (dir == OUT) {
00581             terminal->gate(gateName, j + k - 1)->disconnect();
00582             terminal->gate(gateName, j)->connectTo(tempGate);
00583         } else {
00584             tempGate->disconnect();
00585             tempGate->connectTo(terminal->gate(gateName, j));
00586         }
00587     }
00588 
00589     int nullGates = 0;
00590     for (int j = 0; j < gateArray->size(); j++)
00591         if (!terminal->gate(gateName, j)->isConnectedOutside())
00592             nullGates++;
00593 
00594     terminal->setGateSize(gateName, gateArray->size() - nullGates);
00595 }

AbstractLookup * BaseOverlay::createLookup (  )  [protected, virtual]

Creates a abstract iterative lookup instance.

Returns:
AbstractLookup* The new lookup instance.
01018 {
01019     AbstractLookup* newLookup = new BaseLookup( this, baseLookupConfig );
01020     lookups.insert( newLookup );
01021     return newLookup;
01022 }

void BaseOverlay::deleteOverlayNeighborArrow ( const NodeHandle neighbor  )  [protected]

Removes an arrow from this node to neighbor.

Parameters:
neighbor neighbor to remove arrow to
Todo:
add neighbor's kind to distinguish arrows pointing to the same neighbor
00522 {
00523     if (!ev.isGUI() || !drawOverlayTopology)
00524         return;
00525 
00526     //does neighbor module exist anymore?
00527     if (simulation.module(neighbor.moduleId) == NULL)
00528         return;
00529 
00530     cModule* neighborTerminal
00531         = simulation.module(neighbor.moduleId)->parentModule();
00532 
00533     //find gate
00534     bool compactOut = false;
00535     bool compactIn = false;
00536     for (int i = 0; i < thisOutGateArray->size(); i++) {
00537         // NULL-Gate?
00538         if (thisTerminal->gate("overlayNeighborArrowOut", i)->toGate() == NULL) {
00539             compactOut = true;
00540             continue;
00541         }
00542 
00543         if (thisTerminal->gate("overlayNeighborArrowOut", i)->toGate()->ownerModule()->id() == neighborTerminal->id()) {
00544             thisTerminal->gate("overlayNeighborArrowOut", i)->disconnect();
00545             compactOut = true;
00546             compactIn = true;
00547         }
00548     }
00549 
00550     //compact OUT-array
00551     if (compactOut)
00552         compactGateArray(thisTerminal, OUT);
00553     //compact IN-array
00554     if (compactIn)
00555         compactGateArray(neighborTerminal, IN);
00556 }

OverlayKey BaseOverlay::distance ( const OverlayKey x,
const OverlayKey y 
) const [protected, virtual]

This method should implement the distance between two keys.

It may be overloaded to implement a new metric. The default implementation uses the standard-metric d = abs(x-y).

Parameters:
x Left-hand-side Key
y Right-hand-side key
Returns:
OverlayKey Distance between x and y
01032 {
01033     return x > y ? x-y : y-x;
01034 }

NodeVector * BaseOverlay::findNode ( const OverlayKey key,
BaseOverlayMessage msg = NULL 
) [protected, virtual]

Implements the find node call.

This method simply returns the closest nodes known in the corresponding routing topology.

Parameters:
key The lookup key.
msg A pointer to the BaseRouteMessage or FindNodeCall message of this lookup.
Returns:
NodeVector with closest nodes.

Reimplemented in Chord.

01039 {
01040     opp_error( "findNode: Not implemented!" );
01041     return NULL;
01042 }

void BaseOverlay::findNodeRpc ( FindNodeCall call  )  [private]

01052 {
01053     FindNodeResponse* findNodeResponse =
01054         new FindNodeResponse("FindNodeResponse");
01055 
01056     NodeVector* nextHops = findNode(call->getLookupKey(), call);
01057 
01058     findNodeResponse->setClosestNodesArraySize(nextHops->size());
01059 
01060     for (uint i=0; i < nextHops->size(); i++) {
01061         findNodeResponse->setClosestNodes(0, (*nextHops)[i]);
01062     }
01063 
01064     if (isResponsible(call->getLookupKey()))
01065         findNodeResponse->setNeighbors(true);
01066 
01067     findNodeResponse->setLength(FINDNODERESPONSE_L(findNodeResponse));
01068 
01069     if (call->hasObject("findNodeExt")) {
01070         findNodeResponse->addObject(call->removeObject("findNodeExt"));
01071     }
01072 
01073     delete nextHops;
01074 
01075     sendRpcResponse( call, findNodeResponse );
01076 }

void BaseOverlay::finish (  )  [private]

collects statistical data

00145 {
00146     finishOverlay();
00147     finishLookups();
00148     finishRpcs();
00149 
00150     recordScalar("BaseOverlay: Sent User Messages", numSent);
00151     recordScalar("BaseOverlay: Sent User Bytes", bytesSent);
00152     recordScalar("BaseOverlay: Sent Signaling Messages", numSignalingSent);
00153     recordScalar("BaseOverlay: Sent Signaling Bytes", bytesSignalingSent);
00154     recordScalar("BaseOverlay: Sent Total Messages", numSent + numSignalingSent);
00155     recordScalar("BaseOverlay: Sent Total Bytes", bytesSent + bytesSignalingSent);
00156 
00157     recordScalar("BaseOverlay: Received User Messages", numReceived);
00158     recordScalar("BaseOverlay: Received User Bytes", bytesReceived);
00159     recordScalar("BaseOverlay: Received Signaling Messages", numSignalingReceived);
00160     recordScalar("BaseOverlay: Received Signaling Bytes", bytesSignalingReceived);
00161     recordScalar("BaseOverlay: Received Total Messages", numReceived
00162                  + numSignalingReceived);
00163     recordScalar("BaseOverlay: Received Total Bytes", bytesReceived
00164                  + bytesSignalingReceived);
00165     recordScalar("BaseOverlay: Forwarded User Messages", numForwarded);
00166     recordScalar("BaseOverlay: Forwarded User Bytes", bytesForwarded);
00167     recordScalar("BaseOverlay: Forwarded Signaling Messages", numSignalingForwarded);
00168     recordScalar("BaseOverlay: Forwarded Signaling Bytes", bytesSignalingForwarded);
00169     recordScalar("BaseOverlay: Forwarded Total Messages", numForwarded
00170                  + numSignalingForwarded);
00171     recordScalar("BaseOverlay: Forwarded Total Bytes", bytesForwarded
00172                  + bytesSignalingForwarded);
00173 
00174     recordScalar("BaseOverlay: Dropped Messages", numDropped);
00175     recordScalar("BaseOverlay: Dropped Bytes", bytesDropped);
00176 }

void BaseOverlay::finishLookups (  )  [private]

00868 {
00869     while (lookups.size()!=0)
00870         delete *lookups.begin();
00871     lookups.clear();
00872 }

void BaseOverlay::finishOverlay (  )  [protected, virtual]

collects statistical data in derived class

Reimplemented in Chord, and Gia.

00179 {
00180     // ...
00181 }

void BaseOverlay::finishRpcs (  )  [private]

Deinitializes Remote-Procedure state.

00655 {
00656     // stop all rpcs
00657     for (RpcStates::iterator i = rpcStates.begin();
00658          i != rpcStates.end(); i++) {
00659         cancelAndDelete(i->second.callMsg);
00660         cancelAndDelete(i->second.timeoutMsg);
00661     }
00662     rpcStates.clear();
00663 
00664     // delete default rpc listener
00665     if (defaultRpcListener!=NULL) {
00666         delete defaultRpcListener;
00667         defaultRpcListener = NULL;
00668     }
00669 }

NodeHandle & BaseOverlay::getThisNode (  ) 

Returns the NodeHandle of this node.

Returns:
the NodeHandle of this node.
00198 {
00199     return thisNode;
00200 }

void BaseOverlay::handleAppMessage ( cMessage *  msg  )  [protected, virtual]

Processes non-commonAPI messages.


Processes non-commonAPI messages if parameter "onlyCommonAPIMessages" is false.

Parameters:
msg non-commonAPIMessage

Reimplemented in Gia.

00413 {
00414     delete msg;
00415 }

void BaseOverlay::handleBaseOverlayMessage ( BaseOverlayMessage msg  )  [private]

Handles a BaseOverlayMessage
.

Handles BaseOverlayMessages of type OVERLAYSIGNALING, RPC, APPDATA or OVERLAYROUTE.

Parameters:
msg The message to be handled
00330 {
00331     switch(msg->getType()) {
00332     case OVERLAYSIGNALING:
00333         handleUDPMessage(msg);
00334         return;
00335 
00336     case RPC: {
00337             // process rpc-messages
00338             BaseRpcMessage* rpcMessage =
00339                 check_and_cast<BaseRpcMessage*>(msg);
00340             internalHandleRpcMessage(rpcMessage);
00341             return;
00342         }
00343 
00344     case APPDATA: {
00345             BaseAppDataMessage* baseAppDataMsg =
00346                 check_and_cast<BaseAppDataMessage*>(msg);
00347             callDeliver(baseAppDataMsg);
00348             return;
00349         }
00350 
00351     case OVERLAYROUTE: {
00352             BaseRouteMessage* baseRouteMsg =
00353                 check_and_cast<BaseRouteMessage*>(msg);
00354 
00355             OverlayCtrlInfo* overlayCtrlInfo =
00356                 check_and_cast<OverlayCtrlInfo*>(msg->removeControlInfo());
00357 
00358             // increase hop count if message is not a UDP "self message"
00359             if (overlayCtrlInfo->getLastHopAddr() != thisNode.ip)
00360                 baseRouteMsg->setHopCount(baseRouteMsg->getHopCount() + 1);
00361 
00362             if (baseRouteMsg->getDestKey().isUnspecified())
00363                 opp_error("BaseOverlay: No destination key in ROUTE msg");
00364 
00365             if (isResponsible(baseRouteMsg->getDestKey())) {
00366 
00367                 overlayCtrlInfo->setThisNode(thisNode);
00368                 overlayCtrlInfo->setHopCount(baseRouteMsg->getHopCount());
00369                 overlayCtrlInfo->setDestKey(baseRouteMsg->getDestKey());
00370                 overlayCtrlInfo->setSrcNode(baseRouteMsg->getSrcNode());
00371 
00372                 BaseOverlayMessage* tmpMsg
00373                     = check_and_cast<BaseOverlayMessage*>
00374                     (baseRouteMsg->decapsulate());
00375                 tmpMsg->setControlInfo(overlayCtrlInfo);
00376 
00377                 handleBaseOverlayMessage(tmpMsg);
00378                 delete msg;
00379                 return;
00380             } else {
00381                 // forward msg if this node is not responsible for the key
00382                 if (baseRouteMsg->getSignaling() == false) {
00383                     RECORD_STATS(numForwarded++; bytesForwarded +=
00384                                      baseRouteMsg->byteLength());
00385                 } else {
00386                     RECORD_STATS(numSignalingForwarded++;
00387                                  bytesSignalingForwarded +=
00388                                      baseRouteMsg->byteLength());
00389                 }
00390                 sendToKey(baseRouteMsg->getDestKey(), baseRouteMsg, 1);
00391                 delete overlayCtrlInfo;
00392                 return;
00393             }
00394             break;
00395         }
00396 
00397     default:
00398         EV << "BaseOverlay::handleMessage(): received unknown message "
00399         << "from UDP of type " << msg->name() << endl;
00400         break;
00401     }
00402 }

void BaseOverlay::handleMessage ( cMessage *  msg  )  [private]

Checks for message type and calls corresponding method.


Checks for message type (from UDP/App or selfmessage) and calls corresponding method like route(), get(), put(), remove(), handleTimerEvent(), handleAppMessage() and handleUDPMessage().

Parameters:
msg The message to be handled
00262 {
00263     // process self-messages
00264     if (msg->isSelfMessage()) {
00265         // process rpc self-messages
00266         BaseRpcMessage* rpcMessage = dynamic_cast<BaseRpcMessage*>(msg);
00267         if (rpcMessage!=NULL) {
00268             internalHandleRpcMessage(rpcMessage);
00269             return;
00270         }
00271         // process all other self-messages
00272         handleTimerEvent(msg);
00273     }
00274 
00275     // process messages from UDP
00276     else if (msg->arrivedOn("from_udp")) {
00277         UDPControlInfo* udpControlInfo =
00278             check_and_cast<UDPControlInfo*>(msg->removeControlInfo());
00279         OverlayCtrlInfo* overlayCtrlInfo = new OverlayCtrlInfo;
00280         overlayCtrlInfo->setLastHopAddr(udpControlInfo->srcAddr());
00281         overlayCtrlInfo->setLastHopPort(udpControlInfo->srcPort());
00282         msg->setControlInfo(overlayCtrlInfo);
00283         delete udpControlInfo;
00284 
00285         BaseOverlayMessage* baseOverlayMsg =
00286             dynamic_cast<BaseOverlayMessage*>(msg);
00287 
00288         if (baseOverlayMsg == NULL) {
00289             delete msg;
00290             return;
00291         }
00292 
00293         // records stats if message is not a UDP "self message"
00294         if (overlayCtrlInfo->getLastHopAddr() != thisNode.ip) {
00295             if (baseOverlayMsg->getSignaling() == false)
00296                 RECORD_STATS(numReceived++; bytesReceived +=
00297                                  baseOverlayMsg->byteLength());
00298             else
00299                 RECORD_STATS(numSignalingReceived++;bytesSignalingReceived
00300                              += baseOverlayMsg->byteLength());
00301         }
00302 
00303         handleBaseOverlayMessage(baseOverlayMsg);
00304     }
00305 
00306     // process CommonAPIMessages from App
00307     else if (dynamic_cast<CommonAPIMessage*>(msg) != NULL) {
00308         OverlayCtrlInfo* overlayCtrlInfo =
00309             check_and_cast<OverlayCtrlInfo*>
00310             (msg->removeControlInfo());
00311 
00312         if (dynamic_cast<KBRroute*>(msg) != NULL)
00313             internalRoute(overlayCtrlInfo->getDestKey(), msg->decapsulate());
00314 
00315         delete msg;
00316         delete overlayCtrlInfo;
00317     }
00318 
00319     // process other messages from App
00320     else if (msg->arrivedOn("from_app") && onlyCommonAPIMessages == false)
00321         handleAppMessage(msg);
00322 
00323     else {
00324         RECORD_STATS(numDropped++; bytesDropped += msg->byteLength());
00325         delete msg;
00326     }
00327 }

void BaseOverlay::handleRpc ( BaseCallMessage msg  )  [protected, virtual]

Processes Remote-Procedure-Call invokation messages.


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

Reimplemented in Chord.

00834 {
00835     opp_error( "handleRpc: Not implemented!" );
00836     delete msg;
00837 }

void BaseOverlay::handleTimerEvent ( cMessage *  msg  )  [protected, virtual]

Processes "timer" self-messages.

Parameters:
msg A self-message

Reimplemented in Chord, and Gia.

00407 {
00408     // timer...
00409 }

virtual void BaseOverlay::handleUDPMessage ( BaseOverlayMessage msg  )  [protected, pure virtual]

Processes messages from underlay.

Parameters:
msg Message from UDP

Implemented in Chord, and Gia.

void BaseOverlay::initialize ( int  stage  )  [private]

initializes base-class-attributes

Parameters:
stage the init stage
00052 {
00053     if(stage == MIN_STAGE_OVERLAY) {
00054         OverlayKey::setKeyLength(par("keyLength"));
00055 
00056         // fetch some parameters
00057         debugOutput                     = par("debugOutput");
00058         measureNetwInitPhase            = par("measureNetwInitPhase");
00059         localPort                       = par("localPort");
00060         hopCountMax                     = par("hopCountMax");
00061         drawOverlayTopology             = par("drawOverlayTopology");
00062         useBaseLookup                   = par("useBaseLookup");
00063         iterativeLookup                 = par("iterativeLookup");
00064         onlyCommonAPIMessages           = true;
00065 
00066         // set base lookup parameters
00067         baseLookupConfig.numNextHops    = par("lookupNumberNextHops");
00068         baseLookupConfig.parallelPaths  = par("lookupParallelPaths");
00069         baseLookupConfig.parallelRpcs   = par("lookupParallelRpcs");
00070         baseLookupConfig.secure         = par("lookupSecure");
00071         baseLookupConfig.merge          = par("lookupMerge");
00072 
00073         // statistics
00074         numSent = 0;
00075         bytesSent = 0;
00076         numSignalingSent = 0;
00077         bytesSignalingSent = 0;
00078         numReceived = 0;
00079         bytesReceived = 0;
00080         numSignalingReceived = 0;
00081         bytesSignalingReceived = 0;
00082         numForwarded = 0;
00083         bytesForwarded = 0;
00084         numSignalingForwarded = 0;
00085         bytesSignalingForwarded = 0;
00086         numDropped = 0;
00087         bytesDropped = 0;
00088 
00089         WATCH(numSent);
00090         WATCH(bytesSent);
00091         WATCH(numSignalingSent);
00092         WATCH(bytesSignalingSent);
00093         WATCH(numReceived);
00094         WATCH(bytesReceived);
00095         WATCH(numSignalingReceived);
00096         WATCH(bytesSignalingReceived);
00097         WATCH(numForwarded);
00098         WATCH(bytesForwarded);
00099         WATCH(numSignalingForwarded);
00100         WATCH(bytesSignalingForwarded);
00101         WATCH(numDropped);
00102         WATCH(bytesDropped);
00103 
00104         // set up UDP
00105         bindToPort(localPort);
00106 
00107         // find friend modules
00108         bootstrapOracle = BootstrapOracleAccess().get();
00109         underlayConfigurator = UnderlayConfiguratorAccess().get();
00110         notificationBoard = NotificationBoardAccess().get();
00111 
00112         thisTerminal = parentModule()->parentModule();
00113 
00114         // set up local nodehandle
00115         thisNode.moduleId = parentModule()->id();
00116         thisNode.ip = IPAddressResolver().
00117                       addressOf(parentModule()->parentModule()).get4();
00118         thisNode.port = localPort;
00119         thisNode.key = OverlayKey::UNSPECIFIED_KEY;
00120 
00121         // set up arrow-gates
00122         thisOutGateArray = thisTerminal->gate("overlayNeighborArrowOut");
00123         thisInGateArray = thisTerminal->gate("overlayNeighborArrowIn");
00124         thisTerminal->setGateSize("overlayNeighborArrowOut" ,1);
00125         thisTerminal->setGateSize("overlayNeighborArrowIn" ,1);
00126 
00127         // subscribe to the notification board
00128         notificationBoard->subscribe( this,NF_HOSTPOSITION_UPDATED);
00129 
00130         // init rpcs
00131         initRpcs();
00132         initLookups();
00133     }
00134 
00135     if(stage >= MIN_STAGE_OVERLAY && stage <= MAX_STAGE_OVERLAY)
00136         initializeOverlay(stage);
00137 }

void BaseOverlay::initializeOverlay ( int  stage  )  [protected, 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 in Chord, and Gia.

00140 {
00141     // ...
00142 }

void BaseOverlay::initLookups (  )  [private]

00863 {
00864     lookups = LookupSet();
00865 }

void BaseOverlay::initRpcs (  )  [private]

Initializes Remote-Procedure state.

00646 {
00647     rpcsPending = 0;
00648     rpcStates.clear();
00649 
00650     defaultRpcListener = new RpcListener();
00651 }

bool BaseOverlay::internalHandleRpc ( BaseCallMessage msg  )  [private]

Handles internal rpc requests.


This method is used to implement basic functionionality in the BaseOverlay.

Parameters:
msg The call message
Returns:
bool true, if call has been handled.
00820 {
00821     // call rpc stubs
00822     RPC_SWITCH_START( msg );
00823     RPC_DELEGATE( FindNode, findNodeRpc );
00824     RPC_SWITCH_END( );
00825 
00826     // check if rpc has been handled
00827     IF_RPC_HANDLED return true;
00828     else
00829         return false;
00830 }

void BaseOverlay::internalHandleRpcMessage ( BaseRpcMessage msg  )  [private]

Handles incoming rpc messages and delegates them to the corresponsing listeners or handlers.

Parameters:
msg The message to handle.
00741 {
00742     // check if this is a rpc call message
00743     BaseCallMessage* rpCall = dynamic_cast<BaseCallMessage*>(msg);
00744     if (rpCall != NULL) {
00745         if (!internalHandleRpc(rpCall))
00746             handleRpc(rpCall);
00747         return;
00748     }
00749 
00750     // get nonce
00751     int nonce = msg->getNonce();
00752 
00753     // nonce known? no -> delete message and return
00754     if (rpcStates.count(nonce)==0) {
00755         EV << "RPC: Nonce Unknown!" << endl;
00756         delete msg;
00757         return;
00758     }
00759 
00760     // get state and remove from map
00761     RpcState state = rpcStates[nonce];
00762     rpcStates.erase(nonce);
00763 
00764     // is timeout message?
00765     if ( msg->isSelfMessage() ) { // yes-> inform listener
00766 
00767         // retry?
00768         state.retries--;
00769         simtime_t timeout = simulation.simTime() - state.timeSent;
00770         if (state.retries>=0) {
00771             if (state.dest.key.isUnspecified()) {
00772                 sendMessageToUDP( state.dest, state.callMsg );
00773             } else {
00774                 // send message to key
00775                 sendToKey( state.dest.key, state.callMsg, 1, state.dest );
00776             }
00777             if (timeout!=0)
00778                 scheduleAt( simulation.simTime() + timeout, msg );
00779             rpcStates[nonce] = state;
00780             return;
00781         }
00782 
00783         // inform listener
00784         if ( state.listener != NULL )
00785             state.listener->handleRpcTimeout( state.callMsg, state.dest,
00786                                               state.id );
00787 
00788         // inform overlay
00789         handleRpcTimeout( state.callMsg, state.dest, state.id );
00790 
00791     } else { // no-> handle rpc response
00792 
00793         // get parameters
00794         simtime_t rtt = simulation.simTime() - state.timeSent;
00795         BaseResponseMessage* response
00796             = dynamic_cast<BaseResponseMessage*>(msg);
00797 
00798         // inform listener
00799         if ( state.listener != NULL )
00800             state.listener->handleRpcResponse( response, state.id, rtt );
00801 
00802         // inform overlay
00803         handleRpcResponse( response, state.id, rtt );
00804 
00805         // delete response
00806         delete response;
00807     }
00808 
00809     // delete messages
00810     cancelAndDelete(state.callMsg);
00811     cancelAndDelete(state.timeoutMsg);
00812 
00813     // clean up pointers
00814     state.callMsg = NULL;
00815     state.timeoutMsg = NULL;
00816 }

void BaseOverlay::internalRoute ( const OverlayKey key,
cMessage *  msg,
const NodeHandle hint = NodeHandle::UNSPECIFIED_NODE 
) [private]

00915 {
00916     // check if base lookup should be used
00917     if (!useBaseLookup) {
00918         route(key,msg,hint);
00919         return;
00920     }
00921 
00922     if(key.isUnspecified())
00923         error("route(): key unspecified!");
00924 
00925     // create base route message
00926     BaseAppDataMessage* baseAppDataMsg =
00927         new BaseAppDataMessage("BaseAppDataMessage");
00928     baseAppDataMsg->setType(APPDATA);
00929     baseAppDataMsg->setLength(BASEAPPDATA_L(baseAppDataMsg));
00930     baseAppDataMsg->setSignaling(false);
00931     baseAppDataMsg->encapsulate(msg);
00932 
00933     // debug output
00934     if (debugOutput) {
00935         EV << "BaseOverlay: Node " << thisNode.ip << " received message from "
00936         "application." << endl;
00937     }
00938 
00939     sendToKey( key, baseAppDataMsg, 1 );
00940 }

bool BaseOverlay::isMalicious (  ) 

Returns true, if node is malicious.

Returns:
true, if node is malicious.
00193 {
00194     return malicious;
00195 }

bool BaseOverlay::isResponsible ( const OverlayKey key  )  [protected, virtual]

Query if the node is responsible for a key.

Query if the node currently is responsible for the given key. Usually this means, that the nodeId of this node is close to the key.

Parameters:
key destination key
Returns:
bool true, if the node is responsible for the key.

Reimplemented in Chord.

00212 {
00213     opp_error( "isResponsible: Not implemented!" );
00214     return false;
00215 }

int BaseOverlay::numInitStages (  )  const [protected]

Sets init stage.

See also:
InitStages.h
00047 {
00048     return MAX_STAGE_OVERLAY + 1;
00049 }

PingResponse * BaseOverlay::ping ( PingCall call  )  [protected, virtual]

Implements a ping call.


This method implementts a simple ping call.

Parameters:
call The ping message
Returns:
The ping response or NULL if no response should be sent.
01046 {
01047     return new PingResponse();
01048 }

void BaseOverlay::pingRpc ( PingCall call  )  [private]

01080 {
01081     sendRpcResponse( call, ping(call) );
01082 }

void BaseOverlay::removeLookup ( AbstractLookup lookup  )  [protected, virtual]

Removes the abstract lookup instance.

Parameters:
lookup 
01025 {
01026     lookups.erase(lookup);
01027 }

void BaseOverlay::route ( const OverlayKey key,
cMessage *  msg,
const NodeHandle hint = NodeHandle::UNSPECIFIED_NODE 
) [protected, virtual]

Routes message through overlay.

The default implementation uses FindNode to determine next hops and a generic greedy routing algorithm provides with SendToKey.

Parameters:
key destination key
msg message to route
hint next hop (usually unused)

Reimplemented in Gia.

00209 {}

void BaseOverlay::sendMessageToUDP ( const NodeHandle dest,
BaseOverlayMessage msg 
)

Sends message to underlay.

Parameters:
dest destination node
msg message to send
00603 {
00604     if(msg->removeControlInfo())
00605         error("removeControl");
00606 
00607 
00608     // debug message
00609     if (debugOutput) {
00610         EV << "BaseOverlay: Node " << thisNode.ip << ": sends "
00611         << msg->name() << " to " << dest.ip << "." << endl;
00612     }
00613 
00614 
00615     //      sendToUDP bugs: doesn't set srcAddr and has ugly debug output
00616     //      sendToUDP(msg, thisNode.port, dest.ip, dest.port);
00617 
00618     msg->setKind(UDP_C_DATA);
00619     UDPControlInfo* udpControlInfo = new UDPControlInfo();
00620     udpControlInfo->setSrcAddr(thisNode.ip);
00621     udpControlInfo->setSrcPort(thisNode.port);
00622     udpControlInfo->setDestAddr(dest.ip);
00623     udpControlInfo->setDestPort(dest.port);
00624     msg->setControlInfo(udpControlInfo);
00625 
00626     send(msg, "to_udp");
00627 
00628     if (dest != thisNode) {
00629         // record statistics, if message is not local
00630         if (msg->getSignaling() == false) {
00631             RECORD_STATS(numSent++; bytesSent += msg->byteLength());
00632         } else {
00633             RECORD_STATS(numSignalingSent++; bytesSignalingSent +=
00634                              msg->byteLength());
00635         }
00636     }
00637 }

uint32_t BaseOverlay::sendRpcMessage ( const NodeHandle dest,
BaseCallMessage msg,
RpcListener rpcListener = NULL,
const OverlayKey destKey = OverlayKey::UNSPECIFIED_KEY,
int  rpcId = -1,
simtime_t  timeout = -1,
int  retries = 0 
)

Sends a Remote-Procedure-Call message to the underlay.


If no timeout is provided, a default value of 1.0 for underlay and 5.0 for a overlay rpc is used. After a timeout the message gets retransmitted for at maximum retries times.

The destKey attribute is kept untouched.

Parameters:
dest Destination node handle
msg RPC Call Message
rpcListener RPC Listener
destKey first route the RPC to the node that is responsible for kestkey
rpcId RPC id
timeout RPC timeout
retries How often we try to resent rpc call, if it gets lost
Returns:
The nonce of the RPC
00678 {
00679 
00680     // create nonce, timeout and set default parameters
00681     uint nonce;
00682     do {
00683         nonce = intuniform( 0, 2147483647);
00684     } while (rpcStates.count(nonce) > 0);
00685 
00686 
00687     if (timeout == -1)
00688         timeout = destKey.isUnspecified() ? 1.0 : 5.0;
00689     if (rpcListener == NULL)
00690         rpcListener = defaultRpcListener;
00691 
00692     // create state
00693     RpcState state;
00694     state.id = rpcId;
00695     state.timeSent = simulation.simTime();
00696     state.dest = dest;
00697     state.listener = rpcListener;
00698     state.timeoutMsg = new RpcTimeoutMessage();
00699     state.timeoutMsg->setNonce(nonce);
00700     state.callMsg = dynamic_cast<BaseCallMessage*>(msg->dup());
00701     state.retries = retries;
00702 
00703     if (rpcStates.count(nonce) > 0)
00704         error("RPC nonce collision");
00705 
00706     // register state
00707     rpcStates[nonce] = state;
00708 
00709     // set message parameters
00710     msg->setNonce( nonce );
00711     msg->setSrcNode( thisNode );
00712     msg->setType(RPC);
00713 
00714     // schedule timeout message
00715     if (timeout!=0)
00716         scheduleAt( simulation.simTime() + timeout, state.timeoutMsg);
00717 
00718     if (destKey.isUnspecified()) {
00719         sendMessageToUDP( dest, msg );
00720     } else {
00721         // send message to key
00722         sendToKey( destKey, msg, 1, dest );
00723     }
00724 
00725     return nonce;
00726 }

void BaseOverlay::sendRpcResponse ( BaseCallMessage call,
BaseResponseMessage response 
) [protected]

Send Remote-Procedure response message and deletes call message.


The destKey attribute is kept untouched. If call or reponse is NULL no reponse will be sent.

Parameters:
call The corresponding call message to the reponse
response The call return value
00842 {
00843     if (call==NULL || response==NULL) {
00844         if ( call!=NULL )
00845             delete call;
00846         return;
00847     }
00848     response->setSrcNode( thisNode );
00849     response->setType( RPC );
00850     response->setNonce( call->getNonce() );
00851     sendMessageToUDP( call->getSrcNode(), response );
00852     delete call;
00853 }

void BaseOverlay::sendToKey ( const OverlayKey key,
BaseOverlayMessage message,
uint  numNeighbors = 0,
const NodeHandle nextHop = NodeHandle::UNSPECIFIED_NODE 
)

Sends a message to a overlay node, with the generic routing algorithm.

Parameters:
key The destination key
message Message to be sent
numNeighbors number of neighbors to send message to (multicast)
nextHop If nextHop is given, the message gets sent to this node before it is routed (nextHop is used as a proxy)
00944 {
00945     BaseRouteMessage* routeMsg = NULL;
00946 
00947     if (key.isUnspecified())
00948         error("BaseOverlay::sendToKey(): unspecified destination key!");
00949 
00950     if (msg->getType() != OVERLAYROUTE) {
00951         routeMsg = new BaseRouteMessage("BaseRouteMessage");
00952         routeMsg->setType(OVERLAYROUTE);
00953         routeMsg->setDestKey(key);
00954         routeMsg->setSrcNode(thisNode);
00955         routeMsg->setSignaling(msg->getSignaling());
00956         // copy the name of the inner message
00957         routeMsg->setName(msg->name());
00958         routeMsg->setLength(BASEROUTE_L(routeMsg));
00959         routeMsg->encapsulate(msg);
00960     } else {
00961         routeMsg = check_and_cast<BaseRouteMessage*>(msg);
00962     }
00963 
00964     if (!nextHop.isUnspecified()) {
00965         // send msg to nextHop if specified (used for join rpcs)
00966         sendMessageToUDP(nextHop, routeMsg);
00967         return;
00968     }
00969 
00970     if (iterativeLookup) {
00971         // create lookup and sent to key
00972         AbstractLookup* lookup = createLookup();
00973         lookup->lookup( routeMsg->getDestKey(), numNeighbors,
00974                         new SendToKeyListener( this, routeMsg ) );
00975     } else  {
00976         // local delivery
00977         if(isResponsible(routeMsg->getDestKey())) {
00978             sendMessageToUDP(thisNode, routeMsg);
00979             return;
00980         }
00981 
00982         NodeVector* nextHops = findNode(routeMsg->getDestKey(), routeMsg);
00983 
00984         if (nextHops->size() == 0) {
00985 
00986             EV <<   "BaseOverlay::sendToKey(): findNode() returned NULL "
00987             "- dropping message" << endl;
00988             // statistics
00989             RECORD_STATS(numDropped++; bytesDropped += routeMsg->byteLength());
00990             delete routeMsg;
00991         } else {
00992             // delete message if the hop count maximum is exceeded
00993             if (routeMsg->getHopCount() >= hopCountMax) {
00994                 if (debugOutput) {
00995                     EV << "BaseOverlay: Node " << thisNode.ip << " discards "
00996                     << routeMsg->name() << " from "
00997                     << routeMsg->getSrcNode().ip
00998                     << ". The hop count maximum has been exceeded. ("
00999                     << routeMsg->getHopCount() << ">="
01000                     << hopCountMax << ")" << endl;
01001                 }
01002 
01003                 // statistics
01004                 RECORD_STATS(numDropped++;
01005                              bytesDropped += routeMsg->byteLength());
01006                 delete routeMsg;
01007                 return;
01008             }
01009 
01010             sendMessageToUDP((*nextHops)[0], routeMsg);
01011         }
01012         delete nextHops;
01013     }
01014 }

void BaseOverlay::setMalicious ( bool  malicious  )  [virtual]

Sets node to a malicious state.

This method can be overloaded to manage the state change.

Parameters:
malicious true, if node behaves maliciously
00188 {
00189     this->malicious = malicious;
00190 }

void BaseOverlay::setReadyIcon ( bool  ready  )  [protected]

Colors module-icon blue (ready) or red (not ready).

Parameters:
ready state to visualize
00424 {
00425     if (ev.isGUI()) {
00426         if (ready) {
00427             thisTerminal->displayString().setTagArg("i2", 1, "");
00428             displayString().setTagArg("i", 1, "");
00429         } else {
00430             thisTerminal->displayString().setTagArg("i2", 1, "red");
00431             displayString().setTagArg("i", 1, "red");
00432         }
00433     }
00434 }

void BaseOverlay::showOverlayNeighborArrow ( const NodeHandle neighbor,
bool  flush = true,
char *  displayString = NULL 
) [protected]

Draws an arrow from this node to neighbor.

Parameters:
neighbor neighbor to point to
flush delete all previous drawn arrows starting at this node?
displayString display string to define the arrow drawing style
Todo:
add neighbor's kind to distinguish arrows pointing to the same neighbor
00438 {
00439     if (!ev.isGUI() || !drawOverlayTopology)
00440         return;
00441 
00442     char red[] = "o=red,1";
00443     if (displayString == NULL)
00444         displayString = red;
00445 
00446     cModule* neighborTerminal;
00447     cGate* neighborInGateArray;
00448 
00449     // flush
00450     if (flush) {
00451         for (int l = 0; l < thisOutGateArray->size(); l++) {
00452             cGate* tempGate
00453                 = thisTerminal->gate("overlayNeighborArrowOut", l)->toGate();
00454             thisTerminal->gate("overlayNeighborArrowOut", l)->disconnect();
00455             if (tempGate != NULL)
00456                 compactGateArray(tempGate->ownerModule(), IN);
00457         }
00458         thisTerminal->setGateSize("overlayNeighborArrowOut" ,0);
00459     }
00460 
00461     if (simulation.module(neighbor.moduleId) != NULL) {
00462         neighborTerminal
00463             = simulation.module(neighbor.moduleId)->parentModule();
00464         neighborInGateArray = simulation.module(neighbor.moduleId)->
00465                               parentModule()->gate("overlayNeighborArrowIn");
00466     } else
00467         return;
00468 
00469     if (thisTerminal == neighborTerminal)
00470         return;
00471 
00472     //do not draw double
00473     for (int i = 0; i < thisOutGateArray->size(); i++)
00474         if (thisTerminal->gate("overlayNeighborArrowOut", i)->toGate() != NULL
00475                 && neighborTerminal
00476             == thisTerminal->gate("overlayNeighborArrowOut", i)->
00477                 toGate()->ownerModule())
00478             return;
00479 
00480     // IN
00481     int i = 0;
00482     if (neighborInGateArray->size() == 0)
00483         neighborTerminal->setGateSize("overlayNeighborArrowIn", 1);
00484     else {
00485         for (i = 0; i < neighborInGateArray->size() - 1; i++) {
00486             if (!(neighborTerminal->gate("overlayNeighborArrowIn", i)
00487                   ->isConnectedOutside()))
00488                 break;
00489         }
00490         if (neighborTerminal->gate("overlayNeighborArrowIn", i)
00491             ->isConnectedOutside()) {
00492             neighborTerminal->setGateSize("overlayNeighborArrowIn", i + 2);
00493             i++;
00494         }
00495     }
00496 
00497     // OUT
00498     int j = 0;
00499     if (thisOutGateArray->size() == 0)
00500         thisTerminal->setGateSize("overlayNeighborArrowOut", 1);
00501     else {
00502         for (j = 0; j < (thisOutGateArray->size() - 1); j++) {
00503             if (!(thisTerminal->gate("overlayNeighborArrowOut", j)
00504                   ->isConnectedOutside()))
00505                 break;
00506         }
00507         if (thisTerminal->gate("overlayNeighborArrowOut", j)
00508             ->isConnectedOutside()) {
00509             thisTerminal->setGateSize("overlayNeighborArrowOut", j + 2);
00510             j++;
00511         }
00512     }
00513 
00514     thisTerminal->gate("overlayNeighborArrowOut", j)->
00515     connectTo(neighborTerminal->gate("overlayNeighborArrowIn", i));
00516 
00517     thisTerminal->gate("overlayNeighborArrowOut", j)->
00518     setDisplayString(displayString);
00519 }


Friends And Related Function Documentation

friend class BaseLookup [friend]


Member Data Documentation

BaseLookupConfiguration BaseOverlay::baseLookupConfig [protected]

BootstrapOracle* BaseOverlay::bootstrapOracle [protected]

pointer to BootstrapOracle in this node

int BaseOverlay::bytesDropped [protected]

number of dropped bytes

int BaseOverlay::bytesForwarded [protected]

number of forwarded bytes at out-gate

int BaseOverlay::bytesReceived [private]

number of received bytes (incl. bytes to be forwarded)

int BaseOverlay::bytesSent [private]

number of sent bytes (incl. forwarded bytes)

int BaseOverlay::bytesSignalingForwarded [protected]

number of forwarded signaling bytes at out-gate

int BaseOverlay::bytesSignalingReceived [private]

number of received signaling bytes (incl. bytes to be forwarded)

int BaseOverlay::bytesSignalingSent [private]

number of sent signaling bytes (incl. forwarded bytes)

bool BaseOverlay::debugOutput [protected]

debug output ?

RpcListener* BaseOverlay::defaultRpcListener [private]

cOutVector BaseOverlay::delayVector [protected]

statistical output vector for packet-delays

bool BaseOverlay::drawOverlayTopology [private]

draw overlay topology?

int BaseOverlay::hopCountMax [protected]

maximum hop count

cOutVector BaseOverlay::hopCountVector [protected]

statistical output vector for hop-counts

bool BaseOverlay::iterativeLookup [protected]

do iterative instead of recursive lookups

int BaseOverlay::localPort [protected]

used UDP-port

LookupSet BaseOverlay::lookups [protected]

bool BaseOverlay::malicious [protected]

true, if node is malicious

bool BaseOverlay::measureNetwInitPhase [protected]

fetch statistics in init phase ?

NotificationBoard* BaseOverlay::notificationBoard [protected]

pointer to NotificationBoard in this node

int BaseOverlay::numDropped [protected]

number of dropped packets

int BaseOverlay::numForwarded [protected]

number of forwarded packets

int BaseOverlay::numReceived [private]

number of received packets (incl. packets to be forwarded )

int BaseOverlay::numSent [private]

number of sent packets (incl. forwarded packets)

int BaseOverlay::numSignalingForwarded [protected]

number of forwarded signaling packets

int BaseOverlay::numSignalingReceived [private]

number of received signaling packets (incl. packets to be forwarded)

int BaseOverlay::numSignalingSent [private]

number of sent signaling packets (incl. forwarded packets)

bool BaseOverlay::onlyCommonAPIMessages [protected]

drop non-commonAPIMessages ?

int BaseOverlay::rpcsPending [private]

RpcStates BaseOverlay::rpcStates [private]

cGate* BaseOverlay::thisInGateArray [private]

in-gate array for vis. overlay topology

NodeHandle BaseOverlay::thisNode [protected]

NodeHandle to this node.

Reimplemented in Gia.

cGate* BaseOverlay::thisOutGateArray [private]

out-gate array for vis. overlay topology

cModule* BaseOverlay::thisTerminal [protected]

pointer to corresponding node

UnderlayConfigurator* BaseOverlay::underlayConfigurator [protected]

pointer to UnderlayConfigurator in this node

bool BaseOverlay::useBaseLookup [protected]

use the base lookup class


The documentation for this class was generated from the following files:
Generated on Fri Dec 15 17:50:30 2006 for ITM OverSim by  doxygen 1.4.7