OverSim
|
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< 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 overlayId=-1, int32_t nodeType=-1, bool bootstrappedNeeded=true, bool inoffensiveNeeded=false) |
Returns a random NodeHandle. | |
virtual const NodeHandle & | getBootstrapNode (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 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 overlayId=-1, int32_t nodeType=-1) |
Selects a random node from the peerSet, which is not already marked for deletion. | |
virtual PeerInfo * | getRandomPeerInfo (int32_t overlayId=-1, 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) |
std::vector< IPvXAddress > * | getAllIps () |
NodeHandle * | getNodeHandle (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 | |
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 BootstrapList) 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 229 of file GlobalNodeList.cc.
Referenced by InetUnderlayConfigurator::createNode(), ReaSEUnderlayConfigurator::createNode(), SingleHostUnderlayConfigurator::initializeUnderlay(), InetUnderlayConfigurator::migrateNode(), ReaSEUnderlayConfigurator::migrateNode(), InetUnderlayConfigurator::setUpIPv4(), and InetUnderlayConfigurator::setUpIPv6().
bool GlobalNodeList::areNodeTypesConnected | ( | int32_t | a, |
int32_t | b | ||
) |
Definition at line 423 of file GlobalNodeList.cc.
Referenced by SimpleUDP::processMsgFromApp(), and SimpleTCPConnection::sendToIP().
void GlobalNodeList::connectNodeTypes | ( | int32_t | a, |
int32_t | b | ||
) |
Definition at line 433 of file GlobalNodeList.cc.
Referenced by GlobalTraceManager::handleMessage().
|
protectedvirtual |
Member function to create keylist.
size | size of new keylist |
Definition at line 477 of file GlobalNodeList.cc.
Referenced by getKeyList(), and getRandomKeyListItem().
void GlobalNodeList::disconnectNodeTypes | ( | int32_t | a, |
int32_t | b | ||
) |
Definition at line 448 of file GlobalNodeList.cc.
Referenced by GlobalTraceManager::handleMessage().
std::vector< IPvXAddress > * GlobalNodeList::getAllIps | ( | ) |
Definition at line 517 of file GlobalNodeList.cc.
|
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 |
overlayId | id of the overlay. Is used to support multiple disjoint overlays. -1 means any overlayId. |
Definition at line 146 of file GlobalNodeList.cc.
Referenced by I3BaseApp::bootstrapI3(), KBRTestApp::handleTimerEvent(), Gia::handleTimerEvent(), and I3BaseApp::refreshTriggers().
|
virtual |
Definition at line 390 of file GlobalNodeList.cc.
|
virtual |
Returns a keylist.
maximumKeys | maximum number of keys in new keylist |
Definition at line 483 of file GlobalNodeList.cc.
Referenced by GIASearchApp::handleTimerEvent().
|
inline |
Definition at line 248 of file GlobalNodeList.h.
Referenced by Nps::enoughLandmarks(), and Nps::getLandmarks().
NodeHandle * GlobalNodeList::getNodeHandle | ( | const IPvXAddress & | address | ) |
Definition at line 530 of file GlobalNodeList.cc.
|
inline |
Definition at line 240 of file GlobalNodeList.h.
|
virtual |
Searches the peerSet for the specified node.
peer | TransportAddress of the specified node |
Definition at line 306 of file GlobalNodeList.cc.
Referenced by SimpleUnderlayNCS::createNcsInfo(), TraceChurn::createNode(), TopologyVis::deleteOverlayNeighborArrow(), PubSubLobby::failedNode(), getContext(), Nps::getLandmarks(), InetUnderlayConfigurator::handleTimerEvent(), ReaSEUnderlayConfigurator::handleTimerEvent(), SimpleUnderlayNCS::init(), SimpleNcs::init(), isMalicious(), InetUnderlayConfigurator::migrateNode(), ReaSEUnderlayConfigurator::migrateNode(), InetUnderlayConfigurator::preKillNode(), ReaSEUnderlayConfigurator::preKillNode(), SimpleUDP::processMsgFromApp(), SimpleTCPConnection::sendToIP(), setOverlayReadyIcon(), Nps::setOwnLayer(), setPreKilled(), and TopologyVis::showOverlayNeighborArrow().
|
virtual |
Searches the peerSet for the specified node.
ip | IPvXAddress of the specified node |
Definition at line 311 of file GlobalNodeList.cc.
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.
nodeType | If != -1, return a node of that type |
Definition at line 347 of file GlobalNodeList.cc.
Referenced by Nps::getLandmarks(), KBRTestApp::handleTimerEvent(), InetUnderlayConfigurator::preKillNode(), and ReaSEUnderlayConfigurator::preKillNode().
|
virtual |
Returns random key from list.
Definition at line 509 of file GlobalNodeList.cc.
Referenced by GIASearchApp::handleTimerEvent().
|
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? |
overlayId | id of the overlay. Is used to support multiple disjoint overlays. -1 means any overlayId. |
Definition at line 187 of file GlobalNodeList.cc.
Referenced by KBRTestApp::createDestKey(), getBootstrapNode(), handleMessage(), and mergeBootstrapNodes().
|
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 321 of file GlobalNodeList.cc.
Referenced by mergeBootstrapNodes(), InetUnderlayConfigurator::migrateNode(), and ReaSEUnderlayConfigurator::migrateNode().
|
protectedvirtual |
HandleMessage member function of module.
msg | messag to handle |
Definition at line 105 of file GlobalNodeList.cc.
|
inline |
Definition at line 247 of file GlobalNodeList.h.
Referenced by Nps::setOwnLayer().
|
inline |
Definition at line 249 of file GlobalNodeList.h.
Referenced by Nps::setOwnLayer().
|
protectedvirtual |
Init member function of module.
Definition at line 64 of file GlobalNodeList.cc.
|
virtual |
Check if a node is malicious.
address | TransportAddress of the node |
Definition at line 379 of file GlobalNodeList.cc.
Referenced by handleMessage(), and setOverlayReadyIcon().
|
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 286 of file GlobalNodeList.cc.
Referenced by InetUnderlayConfigurator::handleTimerEvent(), ReaSEUnderlayConfigurator::handleTimerEvent(), InetUnderlayConfigurator::migrateNode(), and ReaSEUnderlayConfigurator::migrateNode().
void GlobalNodeList::mergeBootstrapNodes | ( | int | toPartition, |
int | fromPartition, | ||
int | numNodes | ||
) |
Definition at line 463 of file GlobalNodeList.cc.
Referenced by GlobalTraceManager::handleMessage().
|
virtual |
Update entry to real port without having bootstrapped.
peer | node to refresh |
overlayId | id 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().
|
virtual |
Bootstraps peers in the peer set.
peer | node to register |
overlayId | id 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().
|
virtual |
Debootstraps peers in the peer set.
peer | node to remove |
overlayId | id 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().
void GlobalNodeList::sendNotificationToAllPeers | ( | int | category | ) |
Sends a NotificationBoard message to all registered peers.
category | Type of notification |
Definition at line 217 of file GlobalNodeList.cc.
|
virtual |
Set a node to be malicious.
address | TransportAddress of the node |
malicious | state to set |
Definition at line 374 of file GlobalNodeList.cc.
Referenced by addPeer(), and handleMessage().
|
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 401 of file GlobalNodeList.cc.
Referenced by Landmark::initializeApp().
void GlobalNodeList::setPreKilled | ( | const TransportAddress & | address | ) |
Mark a node for deletion.
address | TransportAddress of the node |
Definition at line 336 of file GlobalNodeList.cc.
|
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().
|
private |
pointer to GlobalStatistics module in this node
Definition at line 288 of file GlobalNodeList.h.
Referenced by handleMessage(), and initialize().
|
protected |
Definition at line 285 of file GlobalNodeList.h.
Referenced by getKeyList(), getRandomKeyListItem(), and initialize().
|
protected |
the keylist
Definition at line 274 of file GlobalNodeList.h.
Referenced by createKeyList(), getKeyList(), getRandomKeyListItem(), and initialize().
|
protected |
probability of keys to be owned by nodes
Definition at line 284 of file GlobalNodeList.h.
Referenced by getKeyList(), and initialize().
|
protected |
Definition at line 275 of file GlobalNodeList.h.
Referenced by getLandmarkPeerSize(), incLandmarkPeerSize(), initialize(), and killPeer().
|
protected |
Definition at line 276 of file GlobalNodeList.h.
Referenced by incLandmarkPeerSizePerType(), initialize(), and killPeer().
|
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().
|
protected |
vector that records the cange of malicious node rate
Definition at line 279 of file GlobalNodeList.h.
Referenced by handleMessage(), and initialize().
|
protected |
parameter used by createKeyList()
Definition at line 283 of file GlobalNodeList.h.
Referenced by getKeyList(), getRandomKeyListItem(), and initialize().
|
protected |
Set of nodes participating in the overlay.
Definition at line 280 of file GlobalNodeList.h.
Referenced by addPeer(), getAllIps(), getBootstrapNode(), getNodeHandle(), getNumNodes(), getPeerInfo(), getRandomAliveNode(), getRandomNode(), getRandomPeerInfo(), handleMessage(), initialize(), killPeer(), refreshEntry(), registerPeer(), removePeer(), sendNotificationToAllPeers(), and setMalicious().
|
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().