OverSim
|
Base class for configurators of different underlay models. More...
#include <UnderlayConfigurator.h>
Public Member Functions | |
UnderlayConfigurator () | |
virtual | ~UnderlayConfigurator () |
bool | isInInitPhase () |
still in initialization phase? | |
bool | isSimulationEndingSoon () |
Is the simulation ending soon? | |
simtime_t | getGracefulLeaveDelay () |
Return the gracefulLeaveDelay. | |
bool | isTransitionTimeFinished () |
virtual TransportAddress * | createNode (NodeType type, bool initialize=false)=0 |
Creates an overlay node. | |
virtual void | preKillNode (NodeType type, TransportAddress *addr=NULL)=0 |
Notifies and schedules overlay nodes for removal. | |
virtual void | migrateNode (NodeType type, TransportAddress *addr=NULL)=0 |
Migrates overlay nodes from one access net to another. | |
void | initFinished () |
ChurnGenerator * | getChurnGenerator (int typeID) |
uint8_t | getChurnGeneratorNum () |
int | getOverlayTerminalCount () |
Protected Member Functions | |
int | numInitStages () const |
OMNeT number of init stages. | |
virtual void | initialize (int stage) |
OMNeT init methods. | |
virtual void | initializeUnderlay (int stage)=0 |
Init method for derived underlay configurators. | |
virtual void | handleTimerEvent (cMessage *msg) |
void | finish () |
Cleans up configurator. | |
virtual void | finishUnderlay () |
Cleans up concrete underlay configurator. | |
virtual void | setDisplayString ()=0 |
Sets display string. | |
void | handleMessage (cMessage *msg) |
Node mobility simulation. |
Protected Attributes | |
int | overlayTerminalCount |
current number of overlay terminals | |
int | firstNodeId |
the Id of the overlayTerminal created first in the overlay | |
simtime_t | gracefulLeaveDelay |
delay until scheduled node is removed from overlay | |
double | gracefulLeaveProbability |
probability that node is notified befor removal | |
GlobalNodeList * | globalNodeList |
pointer to GlobalNodeList | |
GlobalStatistics * | globalStatistics |
pointer to GlobalStatistics | |
std::vector< ChurnGenerator * > | churnGenerator |
pointer to the ChurnGenerators | |
cMessage * | endSimulationTimer |
timer to signal end of simulation | |
cMessage * | endSimulationNotificationTimer |
timer to notify nodes that simulation ends soon | |
cMessage * | endTransitionTimer |
timer to signal end of transition time | |
struct timeval | initFinishedTime |
timestamp at end of init phase | |
struct timeval | initStartTime |
timestamp at begin of init phase | |
simtime_t | transitionTime |
time to wait before measuring after init phase is finished | |
simtime_t | measurementTime |
duration of the simulation after init and transition phase |
Static Protected Attributes | |
static const int | NUM_COLORS = 8 |
static const char * | colorNames [] |
Private Member Functions | |
void | consoleOut (const std::string &text) |
Private Attributes | |
bool | init |
bool | simulationEndingSoon |
bool | transitionTimeFinished |
unsigned int | initCounter |
Base class for configurators of different underlay models.
Definition at line 53 of file UnderlayConfigurator.h.
UnderlayConfigurator::UnderlayConfigurator | ( | ) |
Definition at line 36 of file UnderlayConfigurator.cc.
|
virtual |
Definition at line 45 of file UnderlayConfigurator.cc.
|
private |
Definition at line 215 of file UnderlayConfigurator.cc.
Referenced by handleMessage(), and initFinished().
|
pure virtual |
Creates an overlay node.
type | NodeType of the node to create |
initialize | are we in init phase? |
Implemented in ReaSEUnderlayConfigurator, SimpleUnderlayConfigurator, InetUnderlayConfigurator, and SingleHostUnderlayConfigurator.
Referenced by LifetimeChurn::createNode(), ParetoChurn::createNode(), RandomChurn::handleMessage(), and NoChurn::handleMessage().
|
protected |
Cleans up configurator.
Definition at line 205 of file UnderlayConfigurator.cc.
|
protectedvirtual |
Cleans up concrete underlay configurator.
Reimplemented in ReaSEUnderlayConfigurator, InetUnderlayConfigurator, SimpleUnderlayConfigurator, and SingleHostUnderlayConfigurator.
Definition at line 210 of file UnderlayConfigurator.cc.
Referenced by finish().
ChurnGenerator * UnderlayConfigurator::getChurnGenerator | ( | int | typeID | ) |
Definition at line 246 of file UnderlayConfigurator.cc.
Referenced by GlobalTraceManager::createNode(), GlobalTraceManager::deleteNode(), and GlobalTraceManager::getAppGateById().
uint8_t UnderlayConfigurator::getChurnGeneratorNum | ( | ) |
Definition at line 253 of file UnderlayConfigurator.cc.
|
inline |
Return the gracefulLeaveDelay.
Definition at line 73 of file UnderlayConfigurator.h.
Referenced by LifetimeChurn::createNode(), and ParetoChurn::createNode().
|
inline |
Definition at line 108 of file UnderlayConfigurator.h.
Referenced by GlobalViewBuilder::spreadGlobalView().
|
protected |
Node mobility simulation.
msg | timer-message |
Definition at line 185 of file UnderlayConfigurator.cc.
|
protectedvirtual |
Reimplemented in ReaSEUnderlayConfigurator, InetUnderlayConfigurator, SimpleUnderlayConfigurator, and SingleHostUnderlayConfigurator.
Definition at line 200 of file UnderlayConfigurator.cc.
Referenced by handleMessage().
void UnderlayConfigurator::initFinished | ( | ) |
Definition at line 156 of file UnderlayConfigurator.cc.
Referenced by RandomChurn::handleMessage(), LifetimeChurn::handleMessage(), NoChurn::handleMessage(), ParetoChurn::handleMessage(), and SingleHostUnderlayConfigurator::handleTimerEvent().
|
protectedvirtual |
OMNeT init methods.
Definition at line 57 of file UnderlayConfigurator.cc.
|
protectedpure virtual |
Init method for derived underlay configurators.
Implemented in ReaSEUnderlayConfigurator, SimpleUnderlayConfigurator, InetUnderlayConfigurator, and SingleHostUnderlayConfigurator.
Referenced by initialize().
|
inline |
still in initialization phase?
Definition at line 63 of file UnderlayConfigurator.h.
Referenced by GlobalViewBuilder::checkOverlayReady(), SingleHostUnderlayConfigurator::finishUnderlay(), InetUnderlayConfigurator::finishUnderlay(), ReaSEUnderlayConfigurator::finishUnderlay(), MyOverlay::handleTimerEvent(), MyApplication::handleTimerEvent(), GIASearchApp::handleTimerEvent(), KBRTestApp::handleTimerEvent(), and NeighborCache::prepareOverlay().
|
inline |
Is the simulation ending soon?
Definition at line 68 of file UnderlayConfigurator.h.
Referenced by KBRTestApp::handleTimerEvent().
|
inline |
Definition at line 76 of file UnderlayConfigurator.h.
|
pure virtual |
Migrates overlay nodes from one access net to another.
type | NodeType of the node to migrate |
addr | NULL for random node |
Implemented in ReaSEUnderlayConfigurator, SimpleUnderlayConfigurator, InetUnderlayConfigurator, and SingleHostUnderlayConfigurator.
Referenced by RandomChurn::handleMessage().
|
protected |
OMNeT number of init stages.
Definition at line 52 of file UnderlayConfigurator.cc.
|
pure virtual |
Notifies and schedules overlay nodes for removal.
type | NodeType of the node to remove |
addr | NULL for random node |
Implemented in ReaSEUnderlayConfigurator, SimpleUnderlayConfigurator, InetUnderlayConfigurator, and SingleHostUnderlayConfigurator.
Referenced by LifetimeChurn::deleteNode(), ParetoChurn::deleteNode(), and RandomChurn::handleMessage().
|
protectedpure virtual |
Sets display string.
Implemented in ReaSEUnderlayConfigurator, InetUnderlayConfigurator, SimpleUnderlayConfigurator, and SingleHostUnderlayConfigurator.
|
protected |
pointer to the ChurnGenerators
Definition at line 158 of file UnderlayConfigurator.h.
Referenced by InetUnderlayConfigurator::createNode(), ReaSEUnderlayConfigurator::createNode(), getChurnGenerator(), getChurnGeneratorNum(), initFinished(), initialize(), InetUnderlayConfigurator::preKillNode(), and ReaSEUnderlayConfigurator::preKillNode().
|
staticprotected |
Definition at line 171 of file UnderlayConfigurator.h.
Referenced by InetUnderlayConfigurator::createNode(), and ReaSEUnderlayConfigurator::createNode().
|
protected |
timer to notify nodes that simulation ends soon
Definition at line 161 of file UnderlayConfigurator.h.
Referenced by handleMessage(), initFinished(), initialize(), UnderlayConfigurator(), and ~UnderlayConfigurator().
|
protected |
timer to signal end of simulation
Definition at line 160 of file UnderlayConfigurator.h.
Referenced by handleMessage(), initFinished(), initialize(), UnderlayConfigurator(), and ~UnderlayConfigurator().
|
protected |
timer to signal end of transition time
Definition at line 162 of file UnderlayConfigurator.h.
Referenced by handleMessage(), initFinished(), initialize(), UnderlayConfigurator(), and ~UnderlayConfigurator().
|
protected |
the Id of the overlayTerminal created first in the overlay
Definition at line 152 of file UnderlayConfigurator.h.
Referenced by initialize().
|
protected |
pointer to GlobalNodeList
Definition at line 156 of file UnderlayConfigurator.h.
Referenced by InetUnderlayConfigurator::createNode(), ReaSEUnderlayConfigurator::createNode(), InetUnderlayConfigurator::handleTimerEvent(), ReaSEUnderlayConfigurator::handleTimerEvent(), initialize(), SingleHostUnderlayConfigurator::initializeUnderlay(), InetUnderlayConfigurator::migrateNode(), ReaSEUnderlayConfigurator::migrateNode(), InetUnderlayConfigurator::preKillNode(), ReaSEUnderlayConfigurator::preKillNode(), InetUnderlayConfigurator::setUpIPv4(), and InetUnderlayConfigurator::setUpIPv6().
|
protected |
pointer to GlobalStatistics
Definition at line 157 of file UnderlayConfigurator.h.
Referenced by handleMessage(), and initialize().
|
protected |
delay until scheduled node is removed from overlay
Definition at line 153 of file UnderlayConfigurator.h.
Referenced by getGracefulLeaveDelay(), initFinished(), initialize(), InetUnderlayConfigurator::preKillNode(), and ReaSEUnderlayConfigurator::preKillNode().
|
protected |
probability that node is notified befor removal
Definition at line 154 of file UnderlayConfigurator.h.
Referenced by initialize(), InetUnderlayConfigurator::preKillNode(), and ReaSEUnderlayConfigurator::preKillNode().
|
private |
Definition at line 174 of file UnderlayConfigurator.h.
Referenced by initFinished(), initialize(), and isInInitPhase().
|
private |
Definition at line 177 of file UnderlayConfigurator.h.
Referenced by initFinished(), and initialize().
|
protected |
timestamp at end of init phase
Definition at line 164 of file UnderlayConfigurator.h.
Referenced by SingleHostUnderlayConfigurator::finishUnderlay(), InetUnderlayConfigurator::finishUnderlay(), ReaSEUnderlayConfigurator::finishUnderlay(), initFinished(), and UnderlayConfigurator().
|
protected |
timestamp at begin of init phase
Definition at line 165 of file UnderlayConfigurator.h.
Referenced by consoleOut(), and initialize().
|
protected |
duration of the simulation after init and transition phase
Definition at line 168 of file UnderlayConfigurator.h.
Referenced by initFinished(), and initialize().
|
staticprotected |
Definition at line 170 of file UnderlayConfigurator.h.
Referenced by InetUnderlayConfigurator::createNode(), and ReaSEUnderlayConfigurator::createNode().
|
protected |
current number of overlay terminals
Definition at line 151 of file UnderlayConfigurator.h.
Referenced by InetUnderlayConfigurator::createNode(), ReaSEUnderlayConfigurator::createNode(), getOverlayTerminalCount(), initialize(), SingleHostUnderlayConfigurator::initializeUnderlay(), InetUnderlayConfigurator::initializeUnderlay(), ReaSEUnderlayConfigurator::initializeUnderlay(), InetUnderlayConfigurator::preKillNode(), ReaSEUnderlayConfigurator::preKillNode(), SingleHostUnderlayConfigurator::setDisplayString(), InetUnderlayConfigurator::setDisplayString(), and ReaSEUnderlayConfigurator::setDisplayString().
|
private |
Definition at line 175 of file UnderlayConfigurator.h.
Referenced by handleMessage(), initialize(), and isSimulationEndingSoon().
|
protected |
time to wait before measuring after init phase is finished
Definition at line 167 of file UnderlayConfigurator.h.
Referenced by initFinished(), and initialize().
|
private |
Definition at line 176 of file UnderlayConfigurator.h.
Referenced by isTransitionTimeFinished().