Global module (formerly known as GlobalNodeList) that supports the node bootstrap process and contains node specific underlay parameters, malicious node states, etc... More...
#include <GlobalNodeList.h>
Public Types | |
typedef std::vector< OverlayKey > | KeyList |
holds all OverlayKeys | |
Public Member Functions | |
void | addPeer (const IPvXAddress &ip, PeerInfo *info) |
Adds new peers to the peer set. | |
void | sendNotificationToAllPeers (int category) |
Sends a NotificationBoard message to all registered peers. | |
virtual void | killPeer (const IPvXAddress &ip) |
Removes a peer from the peerSet. | |
virtual const NodeHandle & | getRandomNode (int32_t nodeType=-1, bool bootstrappedNeeded=true, bool inoffensiveNeeded=false) |
Returns a random NodeHandle. | |
virtual const NodeHandle & | getBootstrapNode (const NodeHandle &node=NodeHandle::UNSPECIFIED_NODE) |
Returns a random NodeHandle. | |
virtual void | registerPeer (const TransportAddress &peer) |
Bootstraps peers in the peer set. | |
virtual void | registerPeer (const NodeHandle &peer) |
Bootstraps peers in the peer set. | |
virtual void | refreshEntry (const TransportAddress &peer) |
Update entry to real port without having bootstrapped. | |
virtual void | removePeer (const TransportAddress &peer) |
Debootstraps peers in the peer set. | |
virtual KeyList * | getKeyList (uint32_t maximumKeys) |
Returns a keylist. | |
virtual const OverlayKey & | getRandomKeyListItem () |
Returns random key from list. | |
virtual void | setOverlayReadyIcon (const TransportAddress &address, bool ready) |
Colors module-icon blue (ready), green (ready, malicious) or red (not ready). | |
virtual PeerInfo * | getPeerInfo (const TransportAddress &peer) |
Searches the peerSet for the specified node. | |
virtual void | setMalicious (const TransportAddress &address, bool malicious) |
Set a node to be malicious. | |
virtual bool | isMalicious (const TransportAddress &address) |
Check if a node is malicious. | |
virtual cObject ** | getContext (const TransportAddress &address) |
void | setPreKilled (const TransportAddress &address) |
Mark a node for deletion. | |
TransportAddress * | getRandomAliveNode (int32_t nodeType=-1) |
Selects a random node from the peerSet, which is not already marked for deletion. | |
virtual PeerInfo * | getRandomPeerInfo (int32_t nodeType=-1, bool bootstrapNeeded=false) |
Selects a random node from the peerSet. | |
virtual PeerInfo * | getPeerInfo (const IPvXAddress &ip) |
Searches the peerSet for the specified node. | |
size_t | getNumNodes () |
bool | areNodeTypesConnected (int32_t a, int32_t b) |
void | connectNodeTypes (int32_t a, int32_t b) |
void | disconnectNodeTypes (int32_t a, int32_t b) |
void | mergeBootstrapNodes (int toPartition, int fromPartition, int numNodes) |
void | incLandmarkPeerSize () |
uint16_t | getLandmarkPeerSize () |
void | incLandmarkPeerSizePerType (uint16_t type) |
Protected Member Functions | |
virtual void | initialize () |
Init member function of module. | |
virtual void | handleMessage (cMessage *msg) |
HandleMessage member function of module. | |
virtual void | createKeyList (uint32_t size) |
Member function to create keylist. | |
Protected Attributes | |
KeyList | keyList |
the keylist | |
uint16_t | landmarkPeerSize |
uint16_t | landmarkPeerSizePerType [MAX_NODETYPES] |
uint32_t | preKilledNodes |
number of nodes marked for deletion in the peer set | |
double | maliciousNodeRatio |
ratio of current malicious nodes when changing the ratio dynamically | |
cOutVector | maliciousNodesVector |
vector that records the cange of malicious node rate | |
PeerStorage | peerStorage |
Set of nodes participating in the overlay. | |
uint32_t | maxNumberOfKeys |
parameter used by createKeyList() | |
double | keyProbability |
probability of keys to be owned by nodes | |
bool | isKeyListInitialized |
Private Attributes | |
GlobalStatistics * | globalStatistics |
pointer to GlobalStatistics module in this node | |
bool | connectionMatrix [MAX_NODETYPES][MAX_NODETYPES] |
matrix specifices with node types (partitions) can communication |
Global module (formerly known as GlobalNodeList) that supports the node bootstrap process and contains node specific underlay parameters, malicious node states, etc...
Definition at line 52 of file GlobalNodeList.h.
typedef std::vector<OverlayKey> GlobalNodeList::KeyList |
holds all OverlayKeys
Definition at line 58 of file GlobalNodeList.h.
void GlobalNodeList::addPeer | ( | const IPvXAddress & | ip, | |
PeerInfo * | info | |||
) |
Adds new peers to the peer set.
Called automatically by the underlay, when new peers are created.
ip | IPvXAddress of the peer to add | |
info | underlay specific info of the peer to add |
Definition at line 212 of file GlobalNodeList.cc.
Referenced by SimpleUnderlayConfigurator::createNode(), ReaSEUnderlayConfigurator::createNode(), InetUnderlayConfigurator::createNode(), SingleHostUnderlayConfigurator::initializeUnderlay(), SimpleUnderlayConfigurator::migrateNode(), ReaSEUnderlayConfigurator::migrateNode(), InetUnderlayConfigurator::migrateNode(), InetUnderlayConfigurator::setUpIPv4(), and InetUnderlayConfigurator::setUpIPv6().
{ BootstrapEntry temp; temp.node = new TransportAddress(ip); temp.info = info; temp.info->setPreKilled(false); peerStorage.insert(std::make_pair(temp.node->getIp(), temp)); if (uniform(0, 1) < (double) par("maliciousNodeProbability") || (par("maliciousNodeChange") && uniform(0, 1) < maliciousNodeRatio)) { setMalicious(*temp.node, true); } if (peerStorage.size() == 1) { // we need at least one inoffensive bootstrap node setMalicious(*temp.node, false); } }
bool GlobalNodeList::areNodeTypesConnected | ( | int32_t | a, | |
int32_t | b | |||
) |
Definition at line 409 of file GlobalNodeList.cc.
Referenced by SimpleUDP::processMsgFromApp(), and SimpleTCPConnection::sendToIP().
{ if ((a > MAX_NODETYPES) || (b > MAX_NODETYPES)) { throw cRuntimeError("GlobalNodeList::areNodeTypesConnected(): nodeType " "bigger then MAX_NODETYPES"); } return connectionMatrix[a][b]; }
void GlobalNodeList::connectNodeTypes | ( | int32_t | a, | |
int32_t | b | |||
) |
Definition at line 419 of file GlobalNodeList.cc.
Referenced by GlobalTraceManager::handleMessage().
{ if ((a > MAX_NODETYPES) || (b > MAX_NODETYPES)) { throw cRuntimeError("GlobalNodeList::connectNodeTypes(): nodeType " "bigger then MAX_NODETYPES"); } connectionMatrix[a][b]=true; EV << "[GlobalNodeList::connectNodeTypes()]\n" << " Connecting " << a << "->" << b << endl; }
void GlobalNodeList::createKeyList | ( | uint32_t | size | ) | [protected, virtual] |
Member function to create keylist.
size | size of new keylist |
Definition at line 462 of file GlobalNodeList.cc.
Referenced by getKeyList(), and getRandomKeyListItem().
{ for (uint32_t i = 0; i < size; i++) keyList.push_back(OverlayKey::random()); }
void GlobalNodeList::disconnectNodeTypes | ( | int32_t | a, | |
int32_t | b | |||
) |
Definition at line 434 of file GlobalNodeList.cc.
Referenced by GlobalTraceManager::handleMessage().
{ if ((a > MAX_NODETYPES) || (b > MAX_NODETYPES)) { throw cRuntimeError("GlobalNodeList::disconnectNodeTypes(): nodeType " "bigger then MAX_NODETYPES"); } connectionMatrix[a][b]=false; EV << "[GlobalNodeList::disconnectNodeTypes()]\n" << " Disconnecting " << a << "->" << b << endl; }
const NodeHandle & GlobalNodeList::getBootstrapNode | ( | const NodeHandle & | node = NodeHandle::UNSPECIFIED_NODE |
) | [virtual] |
Returns a random NodeHandle.
Returns a random NodeHandle of an already bootstrapped node from the peerSet if at least one peer has been registered, an empty TransportAddress otherwise. If the optional node parameter is given, try to return a bootstrap node with the same TypeID.
node | Find a bootstrap node with the same TypeID (partition) as node |
Definition at line 143 of file GlobalNodeList.cc.
Referenced by KBRTestApp::handleTimerEvent(), Gia::handleTimerEvent(), and PubSubMMOG::initializeOverlay().
{ uint32_t nodeType; PeerHashMap::iterator it; // always prefer boot node from the same TypeID // if there is no such node, go through all // connected partitions until a bootstrap node is found if (!node.isUnspecified()) { it = peerStorage.find(node.getIp()); // this should never happen if (it == peerStorage.end()) { return getRandomNode(0, true); } nodeType = it->second.info->getTypeID(); const NodeHandle &tempNode1 = getRandomNode(nodeType, true); if (tempNode1.isUnspecified()) { for (uint32_t i = 0; i < MAX_NODETYPES; i++) { if (i == nodeType) continue; if (connectionMatrix[nodeType][i]) { const NodeHandle &tempNode2 = getRandomNode(i, true); if (!tempNode2.isUnspecified()) return tempNode2; } } return NodeHandle::UNSPECIFIED_NODE; } else { return tempNode1; } } else { return getRandomNode(0, true); } }
cObject ** GlobalNodeList::getContext | ( | const TransportAddress & | address | ) | [virtual] |
Definition at line 376 of file GlobalNodeList.cc.
Referenced by BaseOverlay::handleMessage(), and BaseOverlay::join().
{ PeerInfo* peer = getPeerInfo(address); if (peer != NULL) { return peer->getContext(); } return NULL; }
GlobalNodeList::KeyList * GlobalNodeList::getKeyList | ( | uint32_t | maximumKeys | ) | [virtual] |
Returns a keylist.
maximumKeys | maximum number of keys in new keylist |
Definition at line 468 of file GlobalNodeList.cc.
Referenced by GIASearchApp::handleTimerEvent().
{ if( !isKeyListInitialized ) createKeyList(maxNumberOfKeys); if (maximumKeys > keyList.size()) { maximumKeys = keyList.size(); } // copy keylist to temporary keylist KeyList tmpKeyList; tmpKeyList.clear(); for (uint32_t i=0; i < keyList.size(); i++) { tmpKeyList.push_back(keyList[i]); } KeyList* returnList = new KeyList; for (uint32_t i=0; i < ((float)maximumKeys * keyProbability); i++) { uint32_t index = intuniform(0, tmpKeyList.size()-1); returnList->push_back(tmpKeyList[index]); tmpKeyList.erase(tmpKeyList.begin()+index); } return returnList; }
uint16_t GlobalNodeList::getLandmarkPeerSize | ( | ) | [inline] |
Definition at line 238 of file GlobalNodeList.h.
Referenced by Nps::enoughLandmarks(), and Nps::getLandmarks().
{ return landmarkPeerSize; }
size_t GlobalNodeList::getNumNodes | ( | ) | [inline] |
Definition at line 230 of file GlobalNodeList.h.
Referenced by TCPExampleApp::handleTimerEvent(), DHTTestApp::handleTimerEvent(), and TCPExampleApp::initializeApp().
{ return peerStorage.size(); };
PeerInfo * GlobalNodeList::getPeerInfo | ( | const IPvXAddress & | ip | ) | [virtual] |
Searches the peerSet for the specified node.
ip | IPvXAddress of the specified node |
Definition at line 307 of file GlobalNodeList.cc.
{ PeerHashMap::iterator it = peerStorage.find(ip); if (it == peerStorage.end()) return NULL; else return it->second.info; }
PeerInfo * GlobalNodeList::getPeerInfo | ( | const TransportAddress & | peer | ) | [virtual] |
Searches the peerSet for the specified node.
peer | TransportAddress of the specified node |
Definition at line 302 of file GlobalNodeList.cc.
Referenced by TopologyVis::deleteOverlayNeighborArrow(), getContext(), Nps::getLandmarks(), SimpleUnderlayConfigurator::handleTimerEvent(), ReaSEUnderlayConfigurator::handleTimerEvent(), InetUnderlayConfigurator::handleTimerEvent(), isMalicious(), SimpleUnderlayConfigurator::migrateNode(), ReaSEUnderlayConfigurator::migrateNode(), InetUnderlayConfigurator::migrateNode(), SimpleUnderlayConfigurator::preKillNode(), ReaSEUnderlayConfigurator::preKillNode(), InetUnderlayConfigurator::preKillNode(), SimpleUDP::processMsgFromApp(), SimpleTCPConnection::sendToIP(), setOverlayReadyIcon(), Nps::setOwnLayer(), setPreKilled(), and TopologyVis::showOverlayNeighborArrow().
{ return getPeerInfo(peer.getIp()); }
TransportAddress * GlobalNodeList::getRandomAliveNode | ( | int32_t | nodeType = -1 |
) |
Selects a random node from the peerSet, which is not already marked for deletion.
nodeType | If != -1, return a node of that type |
Definition at line 341 of file GlobalNodeList.cc.
Referenced by Nps::getLandmarks(), TCPExampleApp::handleTimerEvent(), SimpleUnderlayConfigurator::preKillNode(), ReaSEUnderlayConfigurator::preKillNode(), and InetUnderlayConfigurator::preKillNode().
{ if (peerStorage.size() <= preKilledNodes) { // all nodes are already marked for deletion; return NULL; } else { PeerHashMap::iterator it = peerStorage.getRandomNode(nodeType, false, false); while (it != peerStorage.end()) { if (!it->second.info->isPreKilled()) { return it->second.node; } else { it = peerStorage.getRandomNode(nodeType, false, false); } } return NULL; } }
const OverlayKey & GlobalNodeList::getRandomKeyListItem | ( | ) | [virtual] |
Returns random key from list.
Definition at line 494 of file GlobalNodeList.cc.
Referenced by GIASearchApp::handleTimerEvent().
{ if( !isKeyListInitialized ) createKeyList(maxNumberOfKeys); return keyList[intuniform(0,keyList.size()-1)]; }
const NodeHandle & GlobalNodeList::getRandomNode | ( | int32_t | nodeType = -1 , |
|
bool | bootstrappedNeeded = true , |
|||
bool | inoffensiveNeeded = false | |||
) | [virtual] |
Returns a random NodeHandle.
Returns a random NodeHandle from the peerSet if at least one peer has been registered, an empty TransportAddress otherwise.
nodeType | If != -1, return a node of that type | |
bootstrappedNeeded | does the node need to be bootstrapped? | |
inoffensiveNeeded | does the node need to be inoffensive? |
Definition at line 182 of file GlobalNodeList.cc.
Referenced by KBRTestApp::createDestKey(), getBootstrapNode(), BootstrapList::getBootstrapNode(), NTree::getRandomNode(), handleMessage(), and mergeBootstrapNodes().
{ PeerHashMap::iterator it = peerStorage.getRandomNode(nodeType, bootstrappedNeeded, inoffensiveNeeded); if (it == peerStorage.end()) { return NodeHandle::UNSPECIFIED_NODE; } if (dynamic_cast<NodeHandle*>(it->second.node)) { return *dynamic_cast<NodeHandle*>(it->second.node); } else { return NodeHandle::UNSPECIFIED_NODE; } }
PeerInfo * GlobalNodeList::getRandomPeerInfo | ( | int32_t | nodeType = -1 , |
|
bool | bootstrapNeeded = false | |||
) | [virtual] |
Selects a random node from the peerSet.
nodeType | If != -1, return a node of that type | |
bootstrapNeeded | does the node need to be bootstrapped? |
Definition at line 317 of file GlobalNodeList.cc.
Referenced by mergeBootstrapNodes(), ReaSEUnderlayConfigurator::migrateNode(), and InetUnderlayConfigurator::migrateNode().
{ PeerHashMap::iterator it = peerStorage.getRandomNode(nodeType, bootstrappedNeeded, false); if (it == peerStorage.end()) { return NULL; } else { return it->second.info; } }
void GlobalNodeList::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
HandleMessage member function of module.
msg | messag to handle |
Definition at line 102 of file GlobalNodeList.cc.
{ if (msg->isName("maliciousNodeChange")) { double newRatio = maliciousNodeRatio + (double) par("maliciousNodeChangeRate"); // ratio to obtain if (maliciousNodeRatio < (double) par("maliciousNodeChangeStartValue")) newRatio = (double) par("maliciousNodeChangeStartValue"); if (newRatio < (double) par("maliciousNodeChangeStopValue")) // schedule next event scheduleAt(simTime() + (int) par("maliciousNodeChangeInterval"), msg); int nodesNeeded = (int) (((double) par("maliciousNodeChangeRate")) * peerStorage.size()); EV << "[GlobalNodeList::handleMessage()]\n" << " Changing " << nodesNeeded << " nodes to be malicious" << endl; for (int i = 0; i < nodesNeeded; i++) { // search a node that is not yet malicious NodeHandle node; do { node = getRandomNode(0, false); } while (isMalicious(node)); setMalicious(node, true); } maliciousNodesVector.record(newRatio); maliciousNodeRatio = newRatio; return; } else if (msg->isName("oracleTimer")) { RECORD_STATS(globalStatistics->recordOutVector( "GlobalNodeList: Number of nodes", peerStorage.size())); scheduleAt(simTime() + 50, msg); } else { opp_error("GlobalNodeList::handleMessage: Unknown message type!"); } }
void GlobalNodeList::incLandmarkPeerSize | ( | ) | [inline] |
Definition at line 237 of file GlobalNodeList.h.
Referenced by Nps::setOwnLayer().
{ landmarkPeerSize++; }
void GlobalNodeList::incLandmarkPeerSizePerType | ( | uint16_t | type | ) | [inline] |
Definition at line 239 of file GlobalNodeList.h.
Referenced by Nps::setOwnLayer().
{ landmarkPeerSizePerType[type]++; }
void GlobalNodeList::initialize | ( | ) | [protected, virtual] |
Init member function of module.
Definition at line 61 of file GlobalNodeList.cc.
{ maxNumberOfKeys = par("maxNumberOfKeys"); keyProbability = par("keyProbability"); isKeyListInitialized = false; WATCH_UNORDERED_MAP(peerStorage.getPeerHashMap()); WATCH_VECTOR(keyList); WATCH(landmarkPeerSize); landmarkPeerSize = 0; for (int i = 0; i < MAX_NODETYPES; i++) { landmarkPeerSizePerType[i] = 0; } preKilledNodes = 0; if (par("maliciousNodeChange")) { if ((double) par("maliciousNodeProbability") > 0) error("maliciousNodeProbability and maliciousNodeChange are not supported concurrently"); cMessage* msg = new cMessage("maliciousNodeChange"); scheduleAt(simTime() + (int) par("maliciousNodeChangeStartTime"), msg); maliciousNodesVector.setName("MaliciousNodeRate"); maliciousNodesVector.record(0); maliciousNodeRatio = 0; } for (int i=0; i<MAX_NODETYPES; i++) { for (int j=0; j<MAX_NODETYPES; j++) { connectionMatrix[i][j] = true; } } globalStatistics = GlobalStatisticsAccess().get(); cMessage* timer = new cMessage("oracleTimer"); scheduleAt(simTime(), timer); }
bool GlobalNodeList::isMalicious | ( | const TransportAddress & | address | ) | [virtual] |
Check if a node is malicious.
address | TransportAddress of the node |
Definition at line 365 of file GlobalNodeList.cc.
Referenced by handleMessage(), BaseOverlay::isMalicious(), and setOverlayReadyIcon().
{ PeerInfo* peer = getPeerInfo(address); if (peer != NULL) { return peer->isMalicious(); } return false; }
void GlobalNodeList::killPeer | ( | const IPvXAddress & | ip | ) | [virtual] |
Removes a peer from the peerSet.
Called automatically by the underlay, when peers are removed.
ip | IPvXAddress of the peer to remove |
Definition at line 282 of file GlobalNodeList.cc.
Referenced by SimpleUnderlayConfigurator::handleTimerEvent(), ReaSEUnderlayConfigurator::handleTimerEvent(), InetUnderlayConfigurator::handleTimerEvent(), SimpleUnderlayConfigurator::migrateNode(), ReaSEUnderlayConfigurator::migrateNode(), and InetUnderlayConfigurator::migrateNode().
{ PeerHashMap::iterator it = peerStorage.find(ip); if (it != peerStorage.end()) { if (it->second.info->isPreKilled()) { it->second.info->setPreKilled(false); preKilledNodes--; } // if valid NPS landmark: decrease landmarkPeerSize PeerInfo* peerInfo = it->second.info; if (peerInfo->getNpsLayer() > -1) { landmarkPeerSize--; landmarkPeerSizePerType[it->second.info->getTypeID()]--; } peerStorage.erase(it); } }
void GlobalNodeList::mergeBootstrapNodes | ( | int | toPartition, | |
int | fromPartition, | |||
int | numNodes | |||
) |
Definition at line 449 of file GlobalNodeList.cc.
Referenced by GlobalTraceManager::handleMessage().
{ BootstrapList* bootstrapList = check_and_cast<BootstrapList*>(simulation.getModule( getRandomPeerInfo(toPartition, false)->getModuleID())-> getSubmodule("bootstrapList")); bootstrapList->insertBootstrapCandidate(getRandomNode(fromPartition, true), DNSSD); }
void GlobalNodeList::refreshEntry | ( | const TransportAddress & | peer | ) | [virtual] |
Update entry to real port without having bootstrapped.
peer | node to refresh |
Definition at line 260 of file GlobalNodeList.cc.
Referenced by Landmark::initializeApp(), and Nps::setOwnLayer().
{ PeerHashMap::iterator it = peerStorage.find(peer.getIp()); if (it == peerStorage.end()) { throw cRuntimeError("GlobalNodeList::refreshEntry(): " "Peer is not in peer set"); } else { delete it->second.node; it->second.node = new TransportAddress(peer); } }
void GlobalNodeList::registerPeer | ( | const NodeHandle & | peer | ) | [virtual] |
Bootstraps peers in the peer set.
peer | node to register |
Definition at line 246 of file GlobalNodeList.cc.
{ PeerHashMap::iterator it = peerStorage.find(peer.getIp()); if (it == peerStorage.end()) { throw cRuntimeError("GlobalNodeList::registerPeer(): " "Peer is not in peer set"); } else { delete it->second.node; it->second.node = new NodeHandle(peer); peerStorage.setBootstrapped(it, true); } }
void GlobalNodeList::registerPeer | ( | const TransportAddress & | peer | ) | [virtual] |
Bootstraps peers in the peer set.
peer | node to register |
Definition at line 232 of file GlobalNodeList.cc.
Referenced by Vast::changeState(), Quon::changeState(), SingleHostUnderlayConfigurator::initializeUnderlay(), and BootstrapList::registerBootstrapNode().
{ PeerHashMap::iterator it = peerStorage.find(peer.getIp()); if (it == peerStorage.end()) { throw cRuntimeError("GlobalNodeList::registerPeer(): " "Peer is not in peer set"); } else { delete it->second.node; it->second.node = new TransportAddress(peer); peerStorage.setBootstrapped(it, true); } }
void GlobalNodeList::removePeer | ( | const TransportAddress & | peer | ) | [virtual] |
Debootstraps peers in the peer set.
peer | node to remove |
Definition at line 273 of file GlobalNodeList.cc.
Referenced by Vast::changeState(), Quon::changeState(), Vast::finishOverlay(), SimpleUnderlayConfigurator::preKillNode(), ReaSEUnderlayConfigurator::preKillNode(), InetUnderlayConfigurator::preKillNode(), and BootstrapList::removeBootstrapNode().
{ PeerHashMap::iterator it = peerStorage.find(peer.getIp()); if (it != peerStorage.end()) { peerStorage.setBootstrapped(it, false); } }
void GlobalNodeList::sendNotificationToAllPeers | ( | int | category | ) |
Sends a NotificationBoard message to all registered peers.
category | Type of notification |
Definition at line 200 of file GlobalNodeList.cc.
{ PeerHashMap::iterator it; for (it = peerStorage.begin(); it != peerStorage.end(); it++) { NotificationBoard* nb = check_and_cast<NotificationBoard*>( simulation.getModule(it->second.info->getModuleID()) ->getSubmodule("notificationBoard")); nb->fireChangeNotification(category); } }
void GlobalNodeList::setMalicious | ( | const TransportAddress & | address, | |
bool | malicious | |||
) | [virtual] |
Set a node to be malicious.
address | TransportAddress of the node | |
malicious | state to set |
Definition at line 360 of file GlobalNodeList.cc.
Referenced by addPeer(), handleMessage(), and BaseOverlay::handleMessage().
{ peerStorage.setMalicious(peerStorage.find(address.getIp()), malicious); }
void GlobalNodeList::setOverlayReadyIcon | ( | const TransportAddress & | address, | |
bool | ready | |||
) | [virtual] |
Colors module-icon blue (ready), green (ready, malicious) or red (not ready).
address | TransportAddress of the specified node | |
ready | state to visualize |
Definition at line 387 of file GlobalNodeList.cc.
Referenced by BaseOverlay::initialize(), Landmark::initializeApp(), and BaseOverlay::setOverlayReady().
{ if (ev.isGUI()) { const char* color; if (ready) { // change color if node is malicious color = isMalicious(address) ? "green" : ""; } else { color = isMalicious(address) ? "yellow" : "red"; } PeerInfo* info = getPeerInfo(address); if (info != NULL) { simulation.getModule(info->getModuleID())-> getDisplayString().setTagArg("i2", 1, color); } } }
void GlobalNodeList::setPreKilled | ( | const TransportAddress & | address | ) |
Mark a node for deletion.
address | TransportAddress of the node |
Definition at line 330 of file GlobalNodeList.cc.
Referenced by SimpleUnderlayConfigurator::preKillNode().
{ PeerInfo* peer = getPeerInfo(address); if ((peer != NULL) && !(peer->isPreKilled())) { preKilledNodes++; peer->setPreKilled(true); } }
bool GlobalNodeList::connectionMatrix[MAX_NODETYPES][MAX_NODETYPES] [private] |
matrix specifices with node types (partitions) can communication
Definition at line 276 of file GlobalNodeList.h.
Referenced by areNodeTypesConnected(), connectNodeTypes(), disconnectNodeTypes(), getBootstrapNode(), and initialize().
GlobalStatistics* GlobalNodeList::globalStatistics [private] |
pointer to GlobalStatistics module in this node
Definition at line 275 of file GlobalNodeList.h.
Referenced by handleMessage(), and initialize().
bool GlobalNodeList::isKeyListInitialized [protected] |
Definition at line 272 of file GlobalNodeList.h.
Referenced by getKeyList(), getRandomKeyListItem(), and initialize().
KeyList GlobalNodeList::keyList [protected] |
the keylist
Definition at line 261 of file GlobalNodeList.h.
Referenced by createKeyList(), getKeyList(), getRandomKeyListItem(), and initialize().
double GlobalNodeList::keyProbability [protected] |
probability of keys to be owned by nodes
Definition at line 271 of file GlobalNodeList.h.
Referenced by getKeyList(), and initialize().
uint16_t GlobalNodeList::landmarkPeerSize [protected] |
Definition at line 262 of file GlobalNodeList.h.
Referenced by getLandmarkPeerSize(), incLandmarkPeerSize(), initialize(), and killPeer().
uint16_t GlobalNodeList::landmarkPeerSizePerType[MAX_NODETYPES] [protected] |
Definition at line 263 of file GlobalNodeList.h.
Referenced by incLandmarkPeerSizePerType(), initialize(), and killPeer().
double GlobalNodeList::maliciousNodeRatio [protected] |
ratio of current malicious nodes when changing the ratio dynamically
Definition at line 265 of file GlobalNodeList.h.
Referenced by addPeer(), handleMessage(), and initialize().
cOutVector GlobalNodeList::maliciousNodesVector [protected] |
vector that records the cange of malicious node rate
Definition at line 266 of file GlobalNodeList.h.
Referenced by handleMessage(), and initialize().
uint32_t GlobalNodeList::maxNumberOfKeys [protected] |
parameter used by createKeyList()
Definition at line 270 of file GlobalNodeList.h.
Referenced by getKeyList(), getRandomKeyListItem(), and initialize().
PeerStorage GlobalNodeList::peerStorage [protected] |
Set of nodes participating in the overlay.
Definition at line 267 of file GlobalNodeList.h.
Referenced by addPeer(), getBootstrapNode(), getNumNodes(), getPeerInfo(), getRandomAliveNode(), getRandomNode(), getRandomPeerInfo(), handleMessage(), initialize(), killPeer(), refreshEntry(), registerPeer(), removePeer(), sendNotificationToAllPeers(), and setMalicious().
uint32_t GlobalNodeList::preKilledNodes [protected] |
number of nodes marked for deletion in the peer set
Definition at line 264 of file GlobalNodeList.h.
Referenced by getRandomAliveNode(), initialize(), killPeer(), and setPreKilled().