OverSim
GlobalNodeList Class Reference

Global module (formerly known as BootstrapList) 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< OverlayKeyKeyList
 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 NodeHandlegetRandomNode (int32_t overlayId=-1, int32_t nodeType=-1, bool bootstrappedNeeded=true, bool inoffensiveNeeded=false)
 Returns a random NodeHandle.
virtual const NodeHandlegetBootstrapNode (int32_t overlayId=-1, const NodeHandle &node=NodeHandle::UNSPECIFIED_NODE)
 Returns a random NodeHandle.
virtual void registerPeer (const NodeHandle &peer, int32_t overlayId=0)
 Bootstraps peers in the peer set.
virtual void refreshEntry (const TransportAddress &peer, int32_t overlayId=0)
 Update entry to real port without having bootstrapped.
virtual void removePeer (const TransportAddress &peer, int32_t overlayId=0)
 Debootstraps peers in the peer set.
virtual KeyListgetKeyList (uint32_t maximumKeys)
 Returns a keylist.
virtual const OverlayKeygetRandomKeyListItem ()
 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 PeerInfogetPeerInfo (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.
TransportAddressgetRandomAliveNode (int32_t overlayId=-1, int32_t nodeType=-1)
 Selects a random node from the peerSet, which is not already marked for deletion.
virtual PeerInfogetRandomPeerInfo (int32_t overlayId=-1, int32_t nodeType=-1, bool bootstrapNeeded=false)
 Selects a random node from the peerSet.
virtual PeerInfogetPeerInfo (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)
std::vector< IPvXAddress > * getAllIps ()
NodeHandlegetNodeHandle (const IPvXAddress &address)

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

GlobalStatisticsglobalStatistics
 pointer to GlobalStatistics module in this node
bool connectionMatrix [MAX_NODETYPES][MAX_NODETYPES]
 matrix specifices with node types (partitions) can communication

Detailed Description

Global module (formerly known as BootstrapList) that supports the node bootstrap process and contains node specific underlay parameters, malicious node states, etc...

Author
Markus Mauch, Robert Palmer

Definition at line 52 of file GlobalNodeList.h.

Member Typedef Documentation

typedef std::vector<OverlayKey> GlobalNodeList::KeyList

holds all OverlayKeys

Definition at line 58 of file GlobalNodeList.h.

Member Function Documentation

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.

Parameters
ipIPvXAddress of the peer to add
infounderlay specific info of the peer to add

Definition at line 229 of file GlobalNodeList.cc.

Referenced by InetUnderlayConfigurator::createNode(), ReaSEUnderlayConfigurator::createNode(), SingleHostUnderlayConfigurator::initializeUnderlay(), InetUnderlayConfigurator::migrateNode(), ReaSEUnderlayConfigurator::migrateNode(), InetUnderlayConfigurator::setUpIPv4(), and InetUnderlayConfigurator::setUpIPv6().

{
temp.info = info;
temp.info->setPreKilled(false);
peerStorage.insert(std::make_pair(ip, temp));
if (uniform(0, 1) < (double) par("maliciousNodeProbability") ||
(par("maliciousNodeChange") && uniform(0, 1) < maliciousNodeRatio)) {
}
if (peerStorage.size() == 1) {
// we need at least one inoffensive bootstrap node
}
}
bool GlobalNodeList::areNodeTypesConnected ( int32_t  a,
int32_t  b 
)

Definition at line 423 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 433 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)
protectedvirtual

Member function to create keylist.

Parameters
sizesize of new keylist

Definition at line 477 of file GlobalNodeList.cc.

Referenced by getKeyList(), and getRandomKeyListItem().

{
for (uint32_t i = 0; i < size; i++)
}
void GlobalNodeList::disconnectNodeTypes ( int32_t  a,
int32_t  b 
)

Definition at line 448 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;
}
std::vector< IPvXAddress > * GlobalNodeList::getAllIps ( )

Definition at line 517 of file GlobalNodeList.cc.

{
std::vector<IPvXAddress>* ips = new std::vector<IPvXAddress>;
const PeerHashMap::iterator it = peerStorage.begin();
while (it != peerStorage.end()) {
ips->push_back(it->first);
}
return ips;
}
const NodeHandle & GlobalNodeList::getBootstrapNode ( int32_t  overlayId = -1,
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.

Parameters
nodeFind a bootstrap node with the same TypeID (partition) as node
overlayIdid of the overlay. Is used to support multiple disjoint overlays. -1 means any overlayId.
Returns
NodeHandle of the bootstrap node

Definition at line 146 of file GlobalNodeList.cc.

Referenced by I3BaseApp::bootstrapI3(), KBRTestApp::handleTimerEvent(), Gia::handleTimerEvent(), and I3BaseApp::refreshTriggers().

{
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(overlayId);
}
nodeType = it->second.info->getTypeID();
const NodeHandle &tempNode1 = getRandomNode(overlayId, nodeType);
if (tempNode1.isUnspecified()) {
for (uint32_t i = 0; i < MAX_NODETYPES; i++) {
if (i == nodeType)
continue;
if (connectionMatrix[nodeType][i]) {
const NodeHandle &tempNode2 = getRandomNode(overlayId, i);
if (!tempNode2.isUnspecified())
return tempNode2;
}
}
} else {
return tempNode1;
}
} else {
return getRandomNode(overlayId);
}
}
cObject ** GlobalNodeList::getContext ( const TransportAddress address)
virtual

Definition at line 390 of file GlobalNodeList.cc.

{
PeerInfo* peer = getPeerInfo(address);
if (peer != NULL) {
return peer->getContext();
}
return NULL;
}
GlobalNodeList::KeyList * GlobalNodeList::getKeyList ( uint32_t  maximumKeys)
virtual

Returns a keylist.

Parameters
maximumKeysmaximum number of keys in new keylist
Returns
pointer to new keylist

Definition at line 483 of file GlobalNodeList.cc.

Referenced by GIASearchApp::handleTimerEvent().

{
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 248 of file GlobalNodeList.h.

Referenced by Nps::enoughLandmarks(), and Nps::getLandmarks().

{ return landmarkPeerSize; }
NodeHandle * GlobalNodeList::getNodeHandle ( const IPvXAddress &  address)

Definition at line 530 of file GlobalNodeList.cc.

{
PeerHashMap::iterator it = peerStorage.find(address);
if (it == peerStorage.end()) {
throw cRuntimeError("GlobalNodeList::getNodeHandle(const IPvXAddress& address): "
"Peer is not in peer set");
}
BootstrapEntry* tempEntry = &(it->second);
if ((tempEntry == NULL) || (tempEntry->addrVector.empty()) ||
(tempEntry->addrVector[0].ta == NULL)) {
return NULL;
}
NodeHandle* ret = dynamic_cast<NodeHandle*> (tempEntry->addrVector[0].ta);
return ret;
}
size_t GlobalNodeList::getNumNodes ( )
inline

Definition at line 240 of file GlobalNodeList.h.

{ return peerStorage.size(); };
PeerInfo * GlobalNodeList::getPeerInfo ( const IPvXAddress &  ip)
virtual

Searches the peerSet for the specified node.

Parameters
ipIPvXAddress of the specified node
Returns
PeerInfo of the node or NULL if node is not in peerSet

Definition at line 311 of file GlobalNodeList.cc.

{
PeerHashMap::iterator it = peerStorage.find(ip);
if (it == peerStorage.end())
return NULL;
else
return it->second.info;
}
TransportAddress * GlobalNodeList::getRandomAliveNode ( int32_t  overlayId = -1,
int32_t  nodeType = -1 
)

Selects a random node from the peerSet, which is not already marked for deletion.

Parameters
nodeTypeIf != -1, return a node of that type
Returns
A pointer to the TransportAddress of a random alive node

Definition at line 347 of file GlobalNodeList.cc.

Referenced by Nps::getLandmarks(), KBRTestApp::handleTimerEvent(), InetUnderlayConfigurator::preKillNode(), and ReaSEUnderlayConfigurator::preKillNode().

{
// all nodes are already marked for deletion;
return NULL;
} else {
PeerHashMap::iterator it = peerStorage.getRandomNode(overlayId,
nodeType, false,
false);
while (it != peerStorage.end()) {
if (!it->second.info->isPreKilled()) {
// TODO: returns always the first node from addrVector
if (it->second.addrVector.size()) {
return it->second.addrVector[0].ta;
} else {
return NULL;
}
} else {
it = peerStorage.getRandomNode(overlayId, nodeType, false,
false);
}
}
return NULL;
}
}
const OverlayKey & GlobalNodeList::getRandomKeyListItem ( )
virtual

Returns random key from list.

Returns
the key

Definition at line 509 of file GlobalNodeList.cc.

Referenced by GIASearchApp::handleTimerEvent().

{
return keyList[intuniform(0,keyList.size()-1)];
}
const NodeHandle & GlobalNodeList::getRandomNode ( int32_t  overlayId = -1,
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.

Parameters
nodeTypeIf != -1, return a node of that type
bootstrappedNeededdoes the node need to be bootstrapped?
inoffensiveNeededdoes the node need to be inoffensive?
overlayIdid of the overlay. Is used to support multiple disjoint overlays. -1 means any overlayId.
Returns
NodeHandle of the node

Definition at line 187 of file GlobalNodeList.cc.

Referenced by KBRTestApp::createDestKey(), getBootstrapNode(), handleMessage(), and mergeBootstrapNodes().

{
PeerHashMap::iterator it = peerStorage.getRandomNode(overlayId,
nodeType,
bootstrappedNeeded,
inoffensiveNeeded);
if (it == peerStorage.end()) {
}
TransportAddress* addr = NULL;
if (overlayId >= 0) {
addr = it->second.addrVector.getAddrForOverlayId(overlayId);
} else {
// std::cout << "Info: " << *(it->second.info) << std::endl;
// std::cout << "Size: " << it->second.addrVector.size() << std::endl;
addr = it->second.addrVector[0].ta;
}
if (dynamic_cast<NodeHandle*>(addr)) {
return *dynamic_cast<NodeHandle*>(addr);
} else {
}
}
PeerInfo * GlobalNodeList::getRandomPeerInfo ( int32_t  overlayId = -1,
int32_t  nodeType = -1,
bool  bootstrapNeeded = false 
)
virtual

Selects a random node from the peerSet.

Parameters
nodeTypeIf != -1, return a node of that type
bootstrapNeededdoes the node need to be bootstrapped?
Returns
The peerInfo of a random node

Definition at line 321 of file GlobalNodeList.cc.

Referenced by mergeBootstrapNodes(), InetUnderlayConfigurator::migrateNode(), and ReaSEUnderlayConfigurator::migrateNode().

{
PeerHashMap::iterator it = peerStorage.getRandomNode(overlayId,
nodeType,
bootstrappedNeeded,
false);
if (it == peerStorage.end()) {
return NULL;
} else {
return it->second.info;
}
}
void GlobalNodeList::handleMessage ( cMessage *  msg)
protectedvirtual

HandleMessage member function of module.

Parameters
msgmessag to handle

Definition at line 105 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(-1, -1, false, true);
} while (isMalicious(node));
setMalicious(node, true);
}
maliciousNodesVector.record(newRatio);
maliciousNodeRatio = newRatio;
return;
}
else if (msg->isName("oracleTimer")) {
"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 247 of file GlobalNodeList.h.

Referenced by Nps::setOwnLayer().

void GlobalNodeList::incLandmarkPeerSizePerType ( uint16_t  type)
inline

Definition at line 249 of file GlobalNodeList.h.

Referenced by Nps::setOwnLayer().

void GlobalNodeList::initialize ( )
protectedvirtual

Init member function of module.

Definition at line 64 of file GlobalNodeList.cc.

{
maxNumberOfKeys = par("maxNumberOfKeys");
keyProbability = par("keyProbability");
WATCH_VECTOR(keyList);
for (int i = 0; i < MAX_NODETYPES; i++) {
}
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");
}
for (int i=0; i<MAX_NODETYPES; i++) {
for (int j=0; j<MAX_NODETYPES; j++) {
connectionMatrix[i][j] = true;
}
}
cMessage* timer = new cMessage("oracleTimer");
scheduleAt(simTime(), timer);
}
bool GlobalNodeList::isMalicious ( const TransportAddress address)
virtual

Check if a node is malicious.

Parameters
addressTransportAddress of the node
Returns
if the node is malicious

Definition at line 379 of file GlobalNodeList.cc.

Referenced by handleMessage(), 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.

Parameters
ipIPvXAddress of the peer to remove

Definition at line 286 of file GlobalNodeList.cc.

Referenced by InetUnderlayConfigurator::handleTimerEvent(), ReaSEUnderlayConfigurator::handleTimerEvent(), InetUnderlayConfigurator::migrateNode(), and ReaSEUnderlayConfigurator::migrateNode().

{
PeerHashMap::iterator it = peerStorage.find(ip);
if (it != peerStorage.end()) {
if (it->second.info->isPreKilled()) {
it->second.info->setPreKilled(false);
}
// if valid NPS landmark: decrease landmarkPeerSize
PeerInfo* peerInfo = it->second.info;
if (peerInfo->getNpsLayer() > -1) {
landmarkPeerSizePerType[it->second.info->getTypeID()]--;
}
}
}
void GlobalNodeList::mergeBootstrapNodes ( int  toPartition,
int  fromPartition,
int  numNodes 
)

Definition at line 463 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(-1, fromPartition,
true, false),
}
void GlobalNodeList::refreshEntry ( const TransportAddress peer,
int32_t  overlayId = 0 
)
virtual

Update entry to real port without having bootstrapped.

Parameters
peernode to refresh
overlayIdid of the overlay. Is used to support multiple disjoint overlays. Default is 0.

Definition at line 262 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 {
it->second.addrVector.setAddrForOverlayId(new TransportAddress(peer),
overlayId);
}
}
void GlobalNodeList::registerPeer ( const NodeHandle peer,
int32_t  overlayId = 0 
)
virtual

Bootstraps peers in the peer set.

Parameters
peernode to register
overlayIdid of the overlay. Is used to support multiple disjoint overlays. Default is 0.

Definition at line 248 of file GlobalNodeList.cc.

Referenced by Quon::changeState(), Vast::changeState(), PubSubLobby::initializeOverlay(), and SingleHostUnderlayConfigurator::initializeUnderlay().

{
PeerHashMap::iterator it = peerStorage.find(peer.getIp());
if (it == peerStorage.end()) {
throw cRuntimeError("GlobalNodeList::registerPeer(): "
"Peer is not in peer set");
} else {
peerStorage.registerOverlay(it, peer, overlayId);
peerStorage.setBootstrapped(it, overlayId, true);
}
}
void GlobalNodeList::removePeer ( const TransportAddress peer,
int32_t  overlayId = 0 
)
virtual

Debootstraps peers in the peer set.

Parameters
peernode to remove
overlayIdid of the overlay. Is used to support multiple disjoint overlays. Default is 0.

Definition at line 276 of file GlobalNodeList.cc.

Referenced by Quon::changeState(), Vast::changeState(), Vast::finishOverlay(), InetUnderlayConfigurator::preKillNode(), and ReaSEUnderlayConfigurator::preKillNode().

{
PeerHashMap::iterator it = peerStorage.find(peer.getIp());
if (it != peerStorage.end()) {
peerStorage.setBootstrapped(it, overlayId, false);
}
}
void GlobalNodeList::sendNotificationToAllPeers ( int  category)

Sends a NotificationBoard message to all registered peers.

Parameters
categoryType of notification

Definition at line 217 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.

Parameters
addressTransportAddress of the node
maliciousstate to set

Definition at line 374 of file GlobalNodeList.cc.

Referenced by addPeer(), and 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)

Parameters
addressTransportAddress of the specified node
readystate to visualize

Definition at line 401 of file GlobalNodeList.cc.

Referenced by Landmark::initializeApp().

{
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.

Parameters
addressTransportAddress of the node

Definition at line 336 of file GlobalNodeList.cc.

{
PeerInfo* peer = getPeerInfo(address);
if ((peer != NULL) && !(peer->isPreKilled())) {
peer->setPreKilled(true);
}
}

Member Data Documentation

bool GlobalNodeList::connectionMatrix[MAX_NODETYPES][MAX_NODETYPES]
private

matrix specifices with node types (partitions) can communication

Definition at line 289 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 288 of file GlobalNodeList.h.

Referenced by handleMessage(), and initialize().

bool GlobalNodeList::isKeyListInitialized
protected

Definition at line 285 of file GlobalNodeList.h.

Referenced by getKeyList(), getRandomKeyListItem(), and initialize().

KeyList GlobalNodeList::keyList
protected

the keylist

Definition at line 274 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 284 of file GlobalNodeList.h.

Referenced by getKeyList(), and initialize().

uint16_t GlobalNodeList::landmarkPeerSize
protected

Definition at line 275 of file GlobalNodeList.h.

Referenced by getLandmarkPeerSize(), incLandmarkPeerSize(), initialize(), and killPeer().

uint16_t GlobalNodeList::landmarkPeerSizePerType[MAX_NODETYPES]
protected

Definition at line 276 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 278 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 279 of file GlobalNodeList.h.

Referenced by handleMessage(), and initialize().

uint32_t GlobalNodeList::maxNumberOfKeys
protected

parameter used by createKeyList()

Definition at line 283 of file GlobalNodeList.h.

Referenced by getKeyList(), getRandomKeyListItem(), and initialize().

uint32_t GlobalNodeList::preKilledNodes
protected

number of nodes marked for deletion in the peer set

Definition at line 277 of file GlobalNodeList.h.

Referenced by getRandomAliveNode(), initialize(), killPeer(), and setPreKilled().


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