OverSim
InetUnderlayConfigurator Class Reference

Configurator module for the InetUnderlay. More...

#include <InetUnderlayConfigurator.h>

Inheritance diagram for InetUnderlayConfigurator:
UnderlayConfigurator

Public Member Functions

TransportAddresscreateNode (NodeType type, bool initialize=false)
 Creates an overlay node.
void preKillNode (NodeType type, TransportAddress *addr=NULL)
 Notifies and schedules overlay nodes for removal.
void migrateNode (NodeType type, TransportAddress *addr=NULL)
 Migrates overlay nodes from one access net to another.
- Public Member Functions inherited from UnderlayConfigurator
 UnderlayConfigurator ()
virtual ~UnderlayConfigurator ()
bool isInInitPhase ()
 still in initialization phase?
bool isSimulationEndingSoon ()
 Is the simulation ending soon?
simtime_t getGracefulLeaveDelay ()
 Return the gracefulLeaveDelay.
bool isTransitionTimeFinished ()
void initFinished ()
ChurnGeneratorgetChurnGenerator (int typeID)
uint8_t getChurnGeneratorNum ()
int getOverlayTerminalCount ()

Protected Member Functions

void initializeUnderlay (int stage)
 Sets up backbone, assigns ip addresses, calculates routing tables, sets some parameters and adds the initial number of nodes to the network.
void setUpIPv4 (cTopology &topo)
void setUpIPv6 (cTopology &topo)
void handleTimerEvent (cMessage *msg)
 process timer messages
void finishUnderlay ()
 Saves statistics, prints simulation time.
void setDisplayString ()
 Updates the statistics display string.
- Protected Member Functions inherited from UnderlayConfigurator
int numInitStages () const
 OMNeT number of init stages.
virtual void initialize (int stage)
 OMNeT init methods.
void finish ()
 Cleans up configurator.
void handleMessage (cMessage *msg)
 Node mobility simulation.

Protected Attributes

std::vector< cModule * > accessNode
 stores accessRouter
std::deque< IPvXAddress > killList
 stores nodes scheduled to be killed
std::set< int > scheduledID
 stores nodeIds to prevent migration of prekilled nodes
int numCreated
 number of overall created overlay terminals
int numKilled
 number of overall killed overlay terminals
- Protected Attributes inherited from UnderlayConfigurator
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
GlobalNodeListglobalNodeList
 pointer to GlobalNodeList
GlobalStatisticsglobalStatistics
 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

Private Attributes

int accessRouterNum
 number of access router
int overlayAccessRouterNum
 number of overlayAccessRouter
int overlayTerminalNum
 number of terminal in the overlay

Additional Inherited Members

- Static Protected Attributes inherited from UnderlayConfigurator
static const int NUM_COLORS = 8
static const char * colorNames []

Detailed Description

Configurator module for the InetUnderlay.

Author
Markus Mauch
Todo:
possibility to disable tier1-3 in overlay(access)routers

Definition at line 41 of file InetUnderlayConfigurator.h.

Member Function Documentation

TransportAddress * InetUnderlayConfigurator::createNode ( NodeType  type,
bool  initialize = false 
)
virtual

Creates an overlay node.

Parameters
typethe NodeType of the node to create
initializecreation during init phase?

Implements UnderlayConfigurator.

Definition at line 87 of file InetUnderlayConfigurator.cc.

{
Enter_Method_Silent();
// derive overlay node from ned
std::string nameStr = "overlayTerminal";
if( churnGenerator.size() > 1 ){
nameStr += "-" + convertToString<uint32_t>(type.typeID);
}
cModuleType* moduleType = cModuleType::get(type.terminalType.c_str());
cModule* node = moduleType->create(nameStr.c_str(), getParentModule(),
if (type.channelTypesTx.size() > 0) {
throw cRuntimeError("InetUnderlayConfigurator::createNode(): Setting "
"channel types via the churn generator is not allowed "
"with the InetUnderlay. Use **.accessNet.channelTypes instead!");
}
node->setGateSize("pppg", 1);
std::string displayString;
if ((type.typeID > 0) && (type.typeID <= NUM_COLORS)) {
((displayString += "i=device/wifilaptop_l,")
+= colorNames[type.typeID - 1])
+= ",40;i2=block/circle_s";
} else {
displayString = "i=device/wifilaptop_l;i2=block/circle_s";
}
node->finalizeParameters();
node->setDisplayString(displayString.c_str());
node->buildInside();
node->scheduleStart(simTime());
// create meta information
InetInfo* info = new InetInfo(type.typeID, node->getId(), type.context);
AccessNet* accessNet= check_and_cast<AccessNet*>
(accessNode[intuniform(0, accessNode.size() - 1)]
->getSubmodule("accessNet"));
info->setAccessNetModule(accessNet);
info->setNodeID(node->getId());
// add node to a randomly chosen access net and bootstrap oracle
globalNodeList->addPeer(accessNet->addOverlayNode(node), info);
// if the node was not created during startup we have to
// finish the initialization process manually
if (!initialize) {
for (int i = MAX_STAGE_UNDERLAY + 1; i < NUM_STAGES_ALL; i++) {
node->callInitialize(i);
}
}
churnGenerator[type.typeID]->terminalCount++;
IPAddressResolver().addressOf(node));
// update display
return address;
}
void InetUnderlayConfigurator::finishUnderlay ( )
protectedvirtual

Saves statistics, prints simulation time.

Reimplemented from UnderlayConfigurator.

Definition at line 324 of file InetUnderlayConfigurator.cc.

{
// statistics
recordScalar("Terminals added", numCreated);
recordScalar("Terminals removed", numKilled);
if (!isInInitPhase()) {
struct timeval now, diff;
gettimeofday(&now, NULL);
timersub(&now, &initFinishedTime, &diff);
printf("Simulation time: %li.%06li\n", diff.tv_sec, diff.tv_usec);
}
}
void InetUnderlayConfigurator::handleTimerEvent ( cMessage *  msg)
protectedvirtual

process timer messages

Parameters
msgthe received message

Reimplemented from UnderlayConfigurator.

Definition at line 283 of file InetUnderlayConfigurator.cc.

{
Enter_Method_Silent();
// get next scheduled node from the kill list
IPvXAddress addr = killList.back();
killList.pop_back();
AccessNet* accessNetModule = NULL;
int nodeID = -1;
InetInfo* info = dynamic_cast<InetInfo*>(globalNodeList->getPeerInfo(addr));
if(info != NULL) {
accessNetModule = info->getAccessNetModule();
nodeID = info->getNodeID();
} else {
opp_error("IPv4UnderlayConfigurator: Trying to kill node with nonexistant TransportAddress!");
}
scheduledID.erase(nodeID);
cModule* node = accessNetModule->removeOverlayNode(nodeID);
if(node == NULL)
opp_error("IPv4UnderlayConfigurator: Trying to remove node which is nonexistant in AccessNet!");
node->callFinish();
node->deleteModule();
delete msg;
}
void InetUnderlayConfigurator::initializeUnderlay ( int  stage)
protectedvirtual

Sets up backbone, assigns ip addresses, calculates routing tables, sets some parameters and adds the initial number of nodes to the network.

Parameters
stagethe phase of the initialisation

Implements UnderlayConfigurator.

Definition at line 43 of file InetUnderlayConfigurator.cc.

{
//backbone configuration
if (stage == MIN_STAGE_UNDERLAY) {
// Find all router modules.
cTopology topo("topo");
topo.extractByProperty("node");
if (par("useIPv6Addresses").boolValue()) {
setUpIPv6(topo);
//opp_error("IPv6 is not supported in this release but is coming soon.");
} else {
setUpIPv4(topo);
}
}
//access net configuration
else if(stage == MAX_STAGE_UNDERLAY) {
// fetch some parameters
accessRouterNum = getParentModule()->par("accessRouterNum");
overlayAccessRouterNum = getParentModule()->par("overlayAccessRouterNum");
// count the overlay clients
numKilled = 0;
// add access node modules to access node vector
cModule* node;
for (int i = 0; i < accessRouterNum; i++) {
node = getParentModule()->getSubmodule("accessRouter", i);
accessNode.push_back( node );
}
for (int i = 0; i < overlayAccessRouterNum; i++) {
node = getParentModule()->getSubmodule("overlayAccessRouter", i);
accessNode.push_back( node );
}
// debug stuff
WATCH_PTRVECTOR(accessNode);
}
}
void InetUnderlayConfigurator::migrateNode ( NodeType  type,
TransportAddress addr = NULL 
)
virtual

Migrates overlay nodes from one access net to another.

Parameters
typethe NodeType of the node to migrate
addrNULL for random node

Implements UnderlayConfigurator.

Definition at line 225 of file InetUnderlayConfigurator.cc.

{
Enter_Method_Silent();
AccessNet* accessNetModule = NULL;
int nodeID = -1;
InetInfo* info;
// If no address given, get random node
if(addr == NULL) {
info = dynamic_cast<InetInfo*>(globalNodeList->getRandomPeerInfo(type.typeID));
} else {
// get node information
info = dynamic_cast<InetInfo*>(globalNodeList->getPeerInfo(*addr));
}
if(info != NULL) {
accessNetModule = info->getAccessNetModule();
nodeID = info->getNodeID();
} else {
opp_error("IPv4UnderlayConfigurator: Trying to pre kill node with nonexistant TransportAddress!");
}
// do not migrate node that is already scheduled
if(scheduledID.count(nodeID))
return;
cModule* node = accessNetModule->removeOverlayNode(nodeID);//intuniform(0, accessNetModule->size() - 1));
if(node == NULL)
opp_error("IPv4UnderlayConfigurator: Trying to remove node which is nonexistant in AccessNet!");
//remove node from bootstrap oracle
globalNodeList->killPeer(IPAddressResolver().addressOf(node));
node->bubble("I am migrating!");
// connect the node to another access net
AccessNet* newAccessNetModule;
do {
newAccessNetModule = check_and_cast<AccessNet*>(accessNode[intuniform(0, accessNode.size() - 1)]->getSubmodule("accessNet"));
} while((newAccessNetModule == accessNetModule) && (accessNode.size() != 1));
// create meta information
InetInfo* newinfo = new InetInfo(type.typeID, node->getId(), type.context);
newinfo->setAccessNetModule(newAccessNetModule);
newinfo->setNodeID(node->getId());
//add node to a randomly chosen access net bootstrap oracle
globalNodeList->addPeer(newAccessNetModule->addOverlayNode(node, true), newinfo);
// inform the notification board about the migration
NotificationBoard* nb = check_and_cast<NotificationBoard*>(node->getSubmodule("notificationBoard"));
nb->fireChangeNotification(NF_OVERLAY_TRANSPORTADDRESS_CHANGED);
}
void InetUnderlayConfigurator::preKillNode ( NodeType  type,
TransportAddress addr = NULL 
)
virtual

Notifies and schedules overlay nodes for removal.

Parameters
typeNodeType of the node to remove
addrNULL for random node

Implements UnderlayConfigurator.

Definition at line 158 of file InetUnderlayConfigurator.cc.

{
Enter_Method_Silent();
AccessNet* accessNetModule = NULL;
int nodeID;
InetInfo* info;
// If no address given, get random node
if (addr == NULL) {
if (addr == NULL) {
// all nodes are already prekilled
std::cout << "all nodes are already prekilled" << std::endl;
return;
}
}
// get node information
info = dynamic_cast<InetInfo*>(globalNodeList->getPeerInfo(*addr));
if (info != NULL) {
accessNetModule = info->getAccessNetModule();
nodeID = info->getNodeID();
} else {
opp_error("IPv4UnderlayConfigurator: Trying to pre kill node "
"with nonexistant TransportAddress!");
}
uint32_t effectiveType = info->getTypeID();
// do not kill node that is already scheduled
if(scheduledID.count(nodeID))
return;
cModule* node = accessNetModule->getOverlayNode(nodeID);
globalNodeList->removePeer(IPAddressResolver().addressOf(node));
//put node into the kill list and schedule a message for final removal of the node
killList.push_front(IPAddressResolver().addressOf(node));
scheduledID.insert(nodeID);
churnGenerator[effectiveType]->terminalCount--;
// update display
// inform the notification board about the removal
NotificationBoard* nb = check_and_cast<NotificationBoard*>(
node->getSubmodule("notificationBoard"));
nb->fireChangeNotification(NF_OVERLAY_NODE_LEAVE);
double random = uniform(0, 1);
if (random < gracefulLeaveProbability) {
nb->fireChangeNotification(NF_OVERLAY_NODE_GRACEFUL_LEAVE);
}
cMessage* msg = new cMessage();
scheduleAt(simTime() + gracefulLeaveDelay, msg);
}
void InetUnderlayConfigurator::setDisplayString ( )
protectedvirtual

Updates the statistics display string.

Implements UnderlayConfigurator.

Definition at line 316 of file InetUnderlayConfigurator.cc.

Referenced by createNode(), and preKillNode().

{
char buf[80];
sprintf(buf, "%i overlay terminals\n%i access router\n%i overlay access router",
getDisplayString().setTagArg("t", 0, buf);
}
void InetUnderlayConfigurator::setUpIPv4 ( cTopology &  topo)
protected

Definition at line 338 of file InetUnderlayConfigurator.cc.

Referenced by initializeUnderlay().

{
// Assign IP addresses to all router modules.
std::vector<uint32> nodeAddresses;
nodeAddresses.resize(topo.getNumNodes());
// IP addresses for backbone
// Take start IP from config file
// FIXME: Make Netmask for Routers configurable!
uint32 lowIPBoundary = IPAddress(par("startIPv4").stringValue()).getInt();
// uint32 lowIPBoundary = uint32((1 << 24) + 1);
int numIPNodes = 0;
for (int i = 0; i < topo.getNumNodes(); i++) {
++numIPNodes;
uint32 addr = lowIPBoundary + uint32(numIPNodes << 16);
nodeAddresses[i] = addr;
// update ip display string
if (ev.isGUI()) {
topo.getNode(i)->getModule()->getDisplayString().insertTag("t", 0);
topo.getNode(i)->getModule()->getDisplayString().setTagArg("t", 0,
const_cast<char*>(IPAddress(addr).str().c_str()));
topo.getNode(i)->getModule()->getDisplayString().setTagArg("t", 1, "l");
topo.getNode(i)->getModule()->getDisplayString().setTagArg("t", 2, "red");
}
// find interface table and assign address to all (non-loopback) interfaces
IInterfaceTable* ift = IPAddressResolver().interfaceTableOf(topo.getNode(i)->getModule());
for ( int k = 0; k < ift->getNumInterfaces(); k++ ) {
InterfaceEntry* ie = ift->getInterface(k);
if (!ie->isLoopback()) {
ie->ipv4Data()->setIPAddress(IPAddress(addr));
// full address must match for local delivery
ie->ipv4Data()->setNetmask(IPAddress::ALLONES_ADDRESS);
}
}
}
// Fill in routing tables.
for (int i = 0; i < topo.getNumNodes(); i++) {
cTopology::Node* destNode = topo.getNode(i);
uint32 destAddr = nodeAddresses[i];
// calculate shortest paths from everywhere towards destNode
topo.calculateUnweightedSingleShortestPathsTo(destNode);
// add overlayAccessRouters and overlayBackboneRouters
// to the GlobalNodeList
if ((strcmp(destNode->getModule()->getName(), "overlayBackboneRouter") == 0) ||
(strcmp(destNode->getModule()->getName(), "overlayAccessRouter") == 0)) {
//add node to bootstrap oracle
PeerInfo* info = new PeerInfo(0, destNode->getModule()->getId(), NULL);
globalNodeList->addPeer(IPvXAddress(nodeAddresses[i]), info);
}
// If destNode is the outRouter, add a default route
// to outside network via the TunOutDevice and a route to the
// Gateway
if ( strcmp(destNode->getModule()->getName(), "outRouter" ) == 0 ) {
IPRoute* defRoute = new IPRoute();
defRoute->setHost(IPAddress::UNSPECIFIED_ADDRESS);
defRoute->setNetmask(IPAddress::UNSPECIFIED_ADDRESS);
defRoute->setGateway(IPAddress(par("gatewayIP").stringValue()));
defRoute->setInterface(IPAddressResolver().interfaceTableOf(destNode->getModule())->getInterfaceByName("tunDev"));
defRoute->setType(IPRoute::REMOTE);
defRoute->setSource(IPRoute::MANUAL);
IPAddressResolver().routingTableOf(destNode->getModule())->addRoute(defRoute);
IPRoute* gwRoute = new IPRoute();
gwRoute->setHost(IPAddress(par("gatewayIP").stringValue()));
gwRoute->setNetmask(IPAddress(255, 255, 255, 255));
gwRoute->setInterface(IPAddressResolver().interfaceTableOf(destNode->getModule())->getInterfaceByName("tunDev"));
gwRoute->setType(IPRoute::DIRECT);
gwRoute->setSource(IPRoute::MANUAL);
IPAddressResolver().routingTableOf(destNode->getModule())->addRoute(gwRoute);
}
// add route (with host=destNode) to every routing table in the network
for (int j = 0; j < topo.getNumNodes(); j++) {
// continue if same node
if (i == j)
continue;
// cancel simulation if node is not connected with destination
cTopology::Node* atNode = topo.getNode(j);
if (atNode->getNumPaths() == 0) {
error((std::string(atNode->getModule()->getName()) + ": Network is not entirely connected."
"Please increase your value for the "
"connectivity parameter").c_str());
}
//
// Add routes at the atNode.
//
// find atNode's interface and routing table
IInterfaceTable* ift = IPAddressResolver().interfaceTableOf(atNode->getModule());
IRoutingTable* rt = IPAddressResolver().routingTableOf(atNode->getModule());
// find atNode's interface entry for the next hop node
int outputGateId = atNode->getPath(0)->getLocalGate()->getId();
InterfaceEntry *ie = ift->getInterfaceByNodeOutputGateId(outputGateId);
// find the next hop node on the path towards destNode
cModule* next_hop = atNode->getPath(0)->getRemoteNode()->getModule();
IPAddress next_hop_ip = IPAddressResolver().addressOf(next_hop).get4();
// Requirement 1: Each router has exactly one routing entry
// (netmask 255.255.0.0) to each other router
IPRoute* re = new IPRoute();
re->setHost(IPAddress(destAddr));
re->setInterface(ie);
re->setSource(IPRoute::MANUAL);
re->setNetmask(IPAddress(255, 255, 0, 0));
re->setGateway(IPAddress(next_hop_ip));
re->setType(IPRoute::REMOTE);
rt->addRoute(re);
// Requirement 2: Each router has a point-to-point routing
// entry (netmask 255.255.255.255) for each immediate neighbour
if (atNode->getDistanceToTarget() == 1) {
IPRoute* re2 = new IPRoute();
re2->setHost(IPAddress(destAddr));
re2->setInterface(ie);
re2->setSource(IPRoute::MANUAL);
re2->setNetmask(IPAddress(255, 255, 255, 255));
re2->setType(IPRoute::DIRECT);
rt->addRoute(re2);
}
// If destNode is the outRouter, add a default route
// to the next hop in the direction of the outRouter
if (strcmp(destNode->getModule()->getName(), "outRouter" ) == 0) {
IPRoute* defRoute = new IPRoute();
defRoute->setHost(IPAddress::UNSPECIFIED_ADDRESS);
defRoute->setNetmask(IPAddress::UNSPECIFIED_ADDRESS);
defRoute->setGateway(IPAddress(next_hop_ip));
defRoute->setInterface(ie);
defRoute->setType(IPRoute::REMOTE);
defRoute->setSource(IPRoute::MANUAL);
rt->addRoute(defRoute);
}
}
}
}
void InetUnderlayConfigurator::setUpIPv6 ( cTopology &  topo)
protected

Definition at line 496 of file InetUnderlayConfigurator.cc.

Referenced by initializeUnderlay().

{
// Assign IP addresses to all router modules.
std::vector<IPv6Words> nodeAddresses;
nodeAddresses.resize(topo.getNumNodes());
// IP addresses for backbone
// Take start IP from config file
// FIXME: Make Netmask for Routers configurable!
IPv6Words lowIPBoundary(IPv6Address(par("startIPv6").stringValue()));
// uint32 lowIPBoundary = uint32((1 << 24) + 1);
int numIPNodes = 0;
for (int i = 0; i < topo.getNumNodes(); i++) {
++numIPNodes;
IPv6Words addr = lowIPBoundary;
addr.d0 += numIPNodes;
nodeAddresses[i] = addr;
// update ip display string
if (ev.isGUI()) {
topo.getNode(i)->getModule()->getDisplayString().insertTag("t", 0);
topo.getNode(i)->getModule()->getDisplayString().setTagArg("t", 0,
const_cast<char*>(IPv6Address(addr.d0, addr.d1, addr.d2, addr.d3).str().c_str()));
topo.getNode(i)->getModule()->getDisplayString().setTagArg("t", 1, "l");
topo.getNode(i)->getModule()->getDisplayString().setTagArg("t", 2, "red");
}
// find interface table and assign address to all (non-loopback) interfaces
IInterfaceTable* ift = IPAddressResolver().interfaceTableOf(topo.getNode(i)->getModule());
for ( int k = 0; k < ift->getNumInterfaces(); k++ ) {
InterfaceEntry* ie = ift->getInterface(k);
if (!ie->isLoopback() && ie->ipv6Data()) {
//ie->ipv6Data()->assignAddress(IPv6Address(addr.d0, addr.d1, addr.d2, addr.d3), false, 0, 0);
// full address must match for local delivery
IPv6Address prefix(addr.d0, addr.d1, addr.d2, addr.d3);
IPv6InterfaceData::AdvPrefix p;
p.prefix = prefix;
p.prefixLength = 32;
p.advAutonomousFlag = true;
p.advPreferredLifetime = 0;
p.advValidLifetime = 0;
p.advOnLinkFlag = true;
ie->ipv6Data()->addAdvPrefix(p);
ie->setMACAddress(MACAddress::generateAutoAddress());
ie->ipv6Data()->assignAddress(prefix,false, 0, 0);
if (ie->ipv6Data()->getLinkLocalAddress().isUnspecified()) {
ie->ipv6Data()->assignAddress(IPv6Address::formLinkLocalAddress(ie->getInterfaceToken()),false, 0, 0);
}
}
}
}
// Fill in routing tables.
for (int i = 0; i < topo.getNumNodes(); i++) {
cTopology::Node* destNode = topo.getNode(i);
// calculate shortest paths from everywhere towards destNode
topo.calculateUnweightedSingleShortestPathsTo(destNode);
// add overlayAccessRouters and overlayBackboneRouters
// to the GlobalNodeList
if ((strcmp(destNode->getModule()->getName(), "overlayBackboneRouter") == 0) ||
(strcmp(destNode->getModule()->getName(), "overlayAccessRouter") == 0)) {
//add node to bootstrap oracle
PeerInfo* info = new PeerInfo(0, destNode->getModule()->getId(), NULL);
globalNodeList->addPeer(IPvXAddress(IPv6Address(nodeAddresses[i].d0, nodeAddresses[i].d1, nodeAddresses[i].d2, nodeAddresses[i].d3)), info);
}
// add route (with host=destNode) to every routing table in the network
for (int j = 0; j < topo.getNumNodes(); j++) {
// continue if same node
if (i == j)
continue;
// cancel simulation if node is not connected with destination
cTopology::Node* atNode = topo.getNode(j);
if (atNode->getNumPaths() == 0) {
error((std::string(atNode->getModule()->getName()) + ": Network is not entirely connected."
"Please increase your value for the "
"connectivity parameter").c_str());
}
//
// Add routes at the atNode.
//
// find atNode's interface and routing table
IInterfaceTable* ift = IPAddressResolver().interfaceTableOf(atNode->getModule());
RoutingTable6* rt = IPAddressResolver().routingTable6Of(atNode->getModule());
// find atNode's interface entry for the next hop node
int outputGateId = atNode->getPath(0)->getLocalGate()->getId();
InterfaceEntry *ie = ift->getInterfaceByNodeOutputGateId(outputGateId);
// find the next hop node on the path towards destNode
cModule* next_hop = atNode->getPath(0)->getRemoteNode()->getModule();
int destGateId = destNode->getLinkIn(0)->getLocalGateId();
IInterfaceTable* destIft = IPAddressResolver().interfaceTableOf(destNode->getModule());
int remoteGateId = atNode->getPath(0)->getRemoteGateId();
IInterfaceTable* remoteIft = IPAddressResolver().interfaceTableOf(next_hop);
IPv6Address next_hop_ip = remoteIft->getInterfaceByNodeInputGateId(remoteGateId)->ipv6Data()->getLinkLocalAddress();
IPv6InterfaceData::AdvPrefix destPrefix = destIft->getInterfaceByNodeInputGateId(destGateId)->ipv6Data()->getAdvPrefix(0);
// create routing entry for next hop
rt->addStaticRoute(destPrefix.prefix, destPrefix.prefixLength, ie->getInterfaceId(), next_hop_ip);
}
}
}

Member Data Documentation

std::vector<cModule*> InetUnderlayConfigurator::accessNode
protected

stores accessRouter

Definition at line 104 of file InetUnderlayConfigurator.h.

Referenced by createNode(), initializeUnderlay(), and migrateNode().

int InetUnderlayConfigurator::accessRouterNum
private

number of access router

Definition at line 70 of file InetUnderlayConfigurator.h.

Referenced by initializeUnderlay(), and setDisplayString().

std::deque<IPvXAddress> InetUnderlayConfigurator::killList
protected

stores nodes scheduled to be killed

Definition at line 105 of file InetUnderlayConfigurator.h.

Referenced by handleTimerEvent(), and preKillNode().

int InetUnderlayConfigurator::numCreated
protected

number of overall created overlay terminals

Definition at line 109 of file InetUnderlayConfigurator.h.

Referenced by createNode(), finishUnderlay(), and initializeUnderlay().

int InetUnderlayConfigurator::numKilled
protected

number of overall killed overlay terminals

Definition at line 110 of file InetUnderlayConfigurator.h.

Referenced by finishUnderlay(), initializeUnderlay(), and preKillNode().

int InetUnderlayConfigurator::overlayAccessRouterNum
private

number of overlayAccessRouter

Definition at line 71 of file InetUnderlayConfigurator.h.

Referenced by initializeUnderlay(), and setDisplayString().

int InetUnderlayConfigurator::overlayTerminalNum
private

number of terminal in the overlay

Definition at line 72 of file InetUnderlayConfigurator.h.

std::set<int> InetUnderlayConfigurator::scheduledID
protected

stores nodeIds to prevent migration of prekilled nodes

Definition at line 106 of file InetUnderlayConfigurator.h.

Referenced by handleTimerEvent(), migrateNode(), and preKillNode().


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