#include <I3BaseApp.h>
Basic template class for I3 applications.
Public Member Functions | |
I3BaseApp () | |
Constructor. | |
~I3BaseApp () | |
Destructor. | |
Protected Types | |
enum | I3MobilityStage { I3_MOBILITY_BEFORE_UPDATE, I3_MOBILITY_UPDATED } |
Protected Member Functions | |
int | numInitStages () const |
Returns number of init stages required. | |
void | initialize (int stage) |
Basic initialization. | |
virtual void | initializeApp (int stage) |
App initialization - should be overwritten by application. | |
void | bootstrapI3 () |
Internal I3 bootstrap - connects to I3, inserts sampling triggers and initializes timers. | |
virtual void | initializeI3 () |
Application I3 initialize - should be overwritten by application. | |
virtual void | handleTimerEvent (cMessage *msg) |
Handles timers - should be overwritten by application. | |
virtual void | handleUDPMessage (cMessage *msg) |
Handles messages incoming from UDP gate. | |
void | handleMessage (cMessage *msg) |
Handles incoming messages. | |
virtual void | deliver (I3Trigger &trigger, I3IdentifierStack &stack, cMessage *msg) |
Delivers packets coming from I3 - should be overwritten by application. | |
void | sendToI3 (I3Message *msg) |
Sends a message to I3. | |
void | sendThroughUDP (cMessage *msg, const I3IPAddress &ip) |
Sends a message through UDP. | |
void | refreshTriggers () |
Refreshes (reinserts) stored triggers. | |
void | refreshSamples () |
Refreshes sampling triggers and selects fastest server as gateway. | |
I3Identifier | retrieveClosestIdentifier () |
void | sendPacket (const I3Identifier &id, cMessage *msg, bool useHint=false) |
Routes a packet through I3, passing an identifier stack composed of a single identifier. | |
void | sendPacket (const I3IdentifierStack &stack, cMessage *msg, bool useHint=false) |
Routes a packet through I3. | |
void | insertTrigger (const I3Identifier &identifier, bool store=true) |
Inserts a trigger into I3, composed by the given identifier and an identifier stack containing only this node's IP address. | |
void | insertTrigger (const I3Identifier &identifier, const I3IdentifierStack &stack, bool store=true) |
Inserts a trigger into I3 with the given identifier and identifier stack. | |
void | insertTrigger (const I3Trigger &t, bool store=true) |
Inserts the given trigger into I3. | |
void | removeTrigger (const I3Identifier &identifier) |
Removes all triggers from the list of inserted triggers whose identifiers equal the one given. | |
void | removeTrigger (const I3Trigger &trigger) |
Removes a trigger from I3. | |
std::set< I3Trigger > & | getInsertedTriggers () |
Returns the list of inserted triggers. | |
void | receiveChangeNotification (int category, cPolymorphic *details) |
virtual void | doMobilityEvent (I3MobilityStage stage) |
Protected Attributes | |
int | numSent |
Number of sent messages. | |
int | sentBytes |
int | numReceived |
Number of received messages. | |
int | receivedBytes |
int | numIsolations |
Number of times this node has been isolated - i.e. | |
IPvXAddress | nodeIPAddress |
Cached IP address of this node. | |
std::set< I3Trigger > | insertedTriggers |
Stored I3 triggers sent from this node, to be refreshed automatically. | |
std::map < I3Identifier, I3CachedServer > | samplingCache |
std::map < I3Identifier, I3CachedServer > | identifierCache |
I3CachedServer | gateway |
cMessage * | refreshTriggersTimer |
int | refreshTriggersTime |
cMessage * | refreshSamplesTimer |
int | refreshSamplesTime |
cMessage * | initializeTimer |
cMessage * | bootstrapTimer |
Private Attributes | |
bool | mobilityInStages |
Classes | |
struct | I3CachedServer |
enum I3BaseApp::I3MobilityStage [protected] |
int I3BaseApp::numInitStages | ( | ) | const [protected] |
void I3BaseApp::initialize | ( | int | stage | ) | [protected] |
Basic initialization.
00069 { 00070 if (stage != MIN_STAGE_APP) return; 00071 00072 nodeIPAddress = IPAddressResolver().addressOf(parentModule()).get4(); 00073 00074 bindToPort(par("clientPort")); 00075 /* NotificationBoardAccess().get()->subscribe(this, NF_HOSTPOSITION_BEFOREUPDATE); 00076 NotificationBoardAccess().get()->subscribe(this, NF_HOSTPOSITION_UPDATED);*/ 00077 00078 displayString().setTagArg("i", 0, "i3c"); 00079 parentModule()->displayString().removeTag("i2"); 00080 00081 if (int(par("bootstrapTime")) >= int(par("initTime"))) { 00082 opp_error("Parameter bootstrapTime must be smaller than initTime"); 00083 } 00084 00085 bootstrapTimer = new cMessage(); 00086 scheduleAt(simulation.simTime() + int(par("bootstrapTime")), bootstrapTimer); 00087 00088 initializeTimer = new cMessage(); 00089 scheduleAt(simulation.simTime() + int(par("initTime")), initializeTimer); 00090 00091 numSent = 0; 00092 sentBytes = 0; 00093 numReceived = 0; 00094 receivedBytes = 0; 00095 numIsolations = 0; 00096 mobilityInStages = false; 00097 00098 WATCH(nodeIPAddress); 00099 WATCH(numSent); 00100 WATCH(sentBytes); 00101 WATCH(numReceived); 00102 WATCH(receivedBytes); 00103 WATCH(numIsolations); 00104 00105 00106 WATCH_SET(insertedTriggers); 00107 WATCH(gateway); 00108 WATCH_MAP(samplingCache); 00109 WATCH_MAP(identifierCache); 00110 00111 initializeApp(stage); 00112 }
void I3BaseApp::initializeApp | ( | int | stage | ) | [protected, virtual] |
App initialization - should be overwritten by application.
I3 related commands should go in initializeI3.
stage | Initialization stage passed from initialize() |
Reimplemented in I3Anycast, I3Composite, I3HostMobility, I3LatencyStretch, I3Multicast, I3SessionClient, and I3Triggers.
void I3BaseApp::bootstrapI3 | ( | ) | [protected] |
Internal I3 bootstrap - connects to I3, inserts sampling triggers and initializes timers.
00119 { 00120 I3IPAddress myAddress(nodeIPAddress, par("clientPort")); 00121 00122 const NodeHandle handle = BootstrapOracleAccess().get()->getBootstrapNode(); 00123 gateway.address = I3IPAddress(handle.ip, par("serverPort")); 00124 00125 for (int i = 0; i < int(par("cacheSize")); i++) { 00126 I3Identifier id; 00127 00128 id.createRandomKey(); 00129 00130 ostringstream os; 00131 os << myAddress << " sample" << i; 00132 id.setName(os.str()); 00133 00134 samplingCache[id] = I3CachedServer(); // placeholder 00135 00136 insertTrigger(id, false); 00137 } 00138 00139 refreshTriggersTimer = new cMessage(); 00140 refreshTriggersTime = par("triggerRefreshTime"); 00141 scheduleAt(simulation.simTime() + truncnormal(refreshTriggersTime, refreshTriggersTime / 10), 00142 refreshTriggersTimer); 00143 00144 refreshSamplesTimer = new cMessage(); 00145 refreshSamplesTime = par("sampleRefreshTime"); 00146 scheduleAt(simulation.simTime() + truncnormal(refreshSamplesTime, refreshSamplesTime / 10), 00147 refreshSamplesTimer); 00148 }
void I3BaseApp::initializeI3 | ( | ) | [protected, virtual] |
Application I3 initialize - should be overwritten by application.
Reimplemented in I3Anycast, I3Composite, I3HostMobility, I3LatencyStretch, I3Multicast, I3SessionServer, I3SessionClient, I3SessionClientStarter, I3TRTClient, and I3Triggers.
void I3BaseApp::handleTimerEvent | ( | cMessage * | msg | ) | [protected, virtual] |
Handles timers - should be overwritten by application.
msg | Timer to be handled |
Reimplemented in I3Anycast, I3Composite, I3HostMobility, I3LatencyStretch, I3Multicast, I3SessionClient, I3TRTClient, and I3Triggers.
void I3BaseApp::handleUDPMessage | ( | cMessage * | msg | ) | [protected, virtual] |
Handles messages incoming from UDP gate.
msg | Message sent |
Reimplemented in I3HostMobility, and I3LatencyStretch.
00195 { 00196 I3Message *i3msg; 00197 00198 i3msg = dynamic_cast<I3Message*>(msg); 00199 if (i3msg) { 00200 switch (i3msg->getType()) { 00201 case SEND_PACKET: 00202 { 00203 I3SendPacketMessage *smsg; 00204 00205 smsg = check_and_cast<I3SendPacketMessage*>(msg); 00206 numReceived++; 00207 receivedBytes += smsg->byteLength(); 00208 00209 /* deliver to app */ 00210 cMessage *newMessage = smsg->decapsulate(); 00211 deliver(smsg->getMatchedTrigger(), smsg->getIdentifierStack(), newMessage); 00212 00213 break; 00214 } 00215 case QUERY_REPLY: 00216 { 00217 I3QueryReplyMessage *pmsg; 00218 pmsg = check_and_cast<I3QueryReplyMessage*>(msg); 00219 I3Identifier &id = pmsg->getIdentifier(); 00220 00221 identifierCache[id].address = pmsg->getSource(); 00222 identifierCache[id].lastReply = simulation.simTime(); 00223 identifierCache[id].roundTripTime = simulation.simTime() - pmsg->getSendingTime(); 00224 00225 if (samplingCache.count(id) != 0) { 00226 samplingCache[id] = identifierCache[id]; 00227 } 00228 break; 00229 } 00230 default: 00231 /* shouldn't get here */ 00232 break; 00233 } 00234 } 00235 delete msg; 00236 }
void I3BaseApp::handleMessage | ( | cMessage * | msg | ) | [protected] |
Handles incoming messages.
msg | Incoming message |
00156 { 00157 if (msg->isSelfMessage()) { 00158 if (msg == bootstrapTimer) { 00159 bootstrapI3(); 00160 delete msg; 00161 bootstrapTimer = 0; 00162 } else if (msg == initializeTimer) { 00163 initializeI3(); 00164 delete msg; 00165 initializeTimer = 0; 00166 } else if (msg == refreshTriggersTimer) { 00167 refreshTriggers(); 00168 scheduleAt(simulation.simTime() + truncnormal(refreshTriggersTime, refreshTriggersTime / 10), 00169 refreshTriggersTimer); 00170 } else if (msg == refreshSamplesTimer) { 00171 refreshSamples(); 00172 scheduleAt(simulation.simTime() + truncnormal(refreshSamplesTime, refreshSamplesTime / 10), 00173 refreshSamplesTimer); 00174 } else { 00175 handleTimerEvent(msg); 00176 } 00177 } else if (msg->arrivedOn("from_udp")) { 00178 handleUDPMessage(msg); 00179 } else { 00180 delete msg; 00181 } 00182 }
void I3BaseApp::deliver | ( | I3Trigger & | trigger, | |
I3IdentifierStack & | stack, | |||
cMessage * | msg | |||
) | [protected, virtual] |
Delivers packets coming from I3 - should be overwritten by application.
trigger | Application trigger to which the packet was sent | |
stack | Identifier stack passed from I3 | |
msg | Arriving message |
Reimplemented in I3Anycast, I3Composite, I3HostMobility, I3LatencyStretch, I3Multicast, I3SessionServer, I3SessionClient, and I3Triggers.
void I3BaseApp::sendToI3 | ( | I3Message * | msg | ) | [protected] |
Sends a message to I3.
msg | Message to be sent |
00239 { 00240 sendThroughUDP(msg, gateway.address); 00241 }
void I3BaseApp::sendThroughUDP | ( | cMessage * | msg, | |
const I3IPAddress & | ip | |||
) | [protected] |
Sends a message through UDP.
msg | Message to be sent | |
ip | IP of destination |
00244 { 00245 msg->removeControlInfo(); 00246 msg->setKind(UDP_C_DATA); 00247 00248 UDPControlInfo* udpControlInfo = new UDPControlInfo(); 00249 udpControlInfo->setSrcAddr(nodeIPAddress); 00250 udpControlInfo->setSrcPort(par("clientPort")); 00251 00252 udpControlInfo->setDestAddr(add.ip); 00253 udpControlInfo->setDestPort(add.port); 00254 00255 msg->setControlInfo(udpControlInfo); 00256 send(msg, "to_udp"); 00257 }
void I3BaseApp::refreshTriggers | ( | ) | [protected] |
Refreshes (reinserts) stored triggers.
00260 { 00261 I3IPAddress myAddress(nodeIPAddress, par("clientPort")); 00262 map<I3Identifier, I3CachedServer>::iterator mit; 00263 00264 00265 // pick fastest I3 server as gateway 00266 gateway.roundTripTime = int(par("serverTimeout")); 00267 I3Identifier gatewayId; 00268 for (mit = samplingCache.begin(); mit != samplingCache.end(); mit++) { 00269 if (gateway.roundTripTime > mit->second.roundTripTime) { 00270 gatewayId = mit->first; 00271 gateway = mit->second; 00272 } 00273 } 00274 00275 // check if gateway has timeout'ed 00276 if (simulation.simTime() - gateway.lastReply >= int(par("serverTimeout"))) { 00277 // We have a small problem here: if the fastest server has timeout, 00278 // that means the previous gateway had stopped responding some time before and no triggers were refreshed. 00279 // Since all servers have timeout'ed by now and we can't trust return times, pick a random server and hope that one is alive. 00280 int random = intrand(samplingCache.size()), i; 00281 00282 cout << "Gateway timeout at " << nodeIPAddress << 00283 ", time " << simulation.simTime() << 00284 "; expired gateway is " << gateway << "(" << gatewayId << ") " << 00285 " with last reply at " << gateway.lastReply <<endl; 00286 00287 for (i = 0, mit = samplingCache.begin(); i < random; i++, mit++); 00288 gateway = mit->second; 00289 cout << "New gateway for " << nodeIPAddress << " is " << gateway << endl; 00290 00291 if (gateway.roundTripTime > 2 * int(par("serverTimeout"))) { 00292 cout << "New gateway's (" << gateway << ") rtt for " << 00293 nodeIPAddress << " too high... marking as isolated!" << endl; 00294 numIsolations++; 00295 const NodeHandle handle = BootstrapOracleAccess().get()->getBootstrapNode(); 00296 gateway.address = I3IPAddress(handle.ip, par("serverPort")); 00297 } 00298 } 00299 00300 /* ping gateway */ 00301 insertTrigger(gatewayId, false); 00302 // cout << "Client " << nodeIPAddress << " pings " << gatewayId << endl; 00303 00304 /* reinsert stored triggers */ 00305 set<I3Trigger>::iterator it; 00306 for (it = insertedTriggers.begin(); it != insertedTriggers.end(); it++) { 00307 insertTrigger(*it, false); 00308 } 00309 00310 /* now that we are refreshing stuff, might as well erase old identifier cache entries */ 00311 for (mit = identifierCache.begin(); mit != identifierCache.end(); mit++) { 00312 if (mit->second.lastReply - simulation.simTime() > int(par("idStoreTime"))) { 00313 identifierCache.erase(mit); 00314 } 00315 } 00316 00317 }
void I3BaseApp::refreshSamples | ( | ) | [protected] |
Refreshes sampling triggers and selects fastest server as gateway.
00319 { 00320 map<I3Identifier, I3CachedServer>::iterator mit; 00321 00322 cout << "Refresh samples!" << endl; 00323 /* reinsert sample triggers */ 00324 for (mit = samplingCache.begin(); mit != samplingCache.end(); mit++) { 00325 insertTrigger(mit->first, false); 00326 } 00327 }
I3Identifier I3BaseApp::retrieveClosestIdentifier | ( | ) | [protected] |
00330 { 00331 simtime_t time; 00332 I3Identifier id; 00333 map<I3Identifier, I3CachedServer>::iterator mit; 00334 I3IPAddress myAddress(nodeIPAddress, par("clientPort")); 00335 00336 time = DBL_MAX; 00337 for (mit = samplingCache.begin(); mit != samplingCache.end(); mit++) { 00338 if (time > mit->second.roundTripTime) { 00339 time = mit->second.roundTripTime; 00340 id = mit->first; 00341 } 00342 } 00343 samplingCache.erase(id); 00344 00345 I3Identifier rid; 00346 rid.createRandomKey(); 00347 00348 ostringstream os; 00349 os << myAddress << " sample"; 00350 rid.setName(os.str()); 00351 00352 samplingCache[rid] = I3CachedServer(); // placeholder 00353 insertTrigger(rid, false); 00354 00355 return id; 00356 }
void I3BaseApp::sendPacket | ( | const I3Identifier & | id, | |
cMessage * | msg, | |||
bool | useHint = false | |||
) | [protected] |
Routes a packet through I3, passing an identifier stack composed of a single identifier.
id | Destination identifier | |
msg | Message to be sent | |
useHint | Use address in server cache if existant |
00359 { 00360 I3IdentifierStack stack; 00361 00362 stack.push(id); 00363 sendPacket(stack, msg, useHint); 00364 }
void I3BaseApp::sendPacket | ( | const I3IdentifierStack & | stack, | |
cMessage * | msg, | |||
bool | useHint = false | |||
) | [protected] |
Routes a packet through I3.
stack | Destination identifier stack | |
msg | Message to be sent | |
useHint | Use address in server cache if existant |
00367 { 00368 I3SendPacketMessage *smsg; 00369 00370 smsg = new I3SendPacketMessage(); 00371 smsg->setLength(SEND_PACKET_L(smsg)); 00372 smsg->encapsulate(msg); 00373 smsg->setIdentifierStack(stack); 00374 00375 smsg->setSendReply(useHint); 00376 if (useHint) { 00377 I3IPAddress add(nodeIPAddress, par("clientPort")); 00378 smsg->setSource(add); 00379 } 00380 00381 numSent++; 00382 sentBytes += smsg->byteLength(); 00383 00384 I3SubIdentifier subid = stack.peek(); // first check where the packet should go 00385 if (subid.getType() == I3SubIdentifier::IPAddress) { // if it's an IP address 00386 smsg->getIdentifierStack().pop(); // pop it 00387 sendThroughUDP(smsg, subid.getIPAddress()); // and send directly to host 00388 } else { // else if it's an identifier 00389 // check if we have the I3 server cached 00390 I3IPAddress address = (useHint && identifierCache.count(subid.getIdentifier()) != 0) ? 00391 identifierCache[subid.getIdentifier()].address : 00392 gateway.address; 00393 sendThroughUDP(smsg, address); // send it directly 00394 } 00395 }
void I3BaseApp::insertTrigger | ( | const I3Identifier & | identifier, | |
bool | store = true | |||
) | [protected] |
Inserts a trigger into I3, composed by the given identifier and an identifier stack containing only this node's IP address.
identifier | Trigger's identifier | |
store | Sets whether to store the trigger for auto-refresh |
00398 { 00399 I3Trigger trigger; 00400 I3IPAddress add(nodeIPAddress, par("clientPort"));; 00401 00402 trigger.getIdentifierStack().push(add); 00403 trigger.setIdentifier(identifier); 00404 insertTrigger(trigger, store); 00405 }
void I3BaseApp::insertTrigger | ( | const I3Identifier & | identifier, | |
const I3IdentifierStack & | stack, | |||
bool | store = true | |||
) | [protected] |
Inserts a trigger into I3 with the given identifier and identifier stack.
identifier | Trigger's identifier | |
stack | Trigger's identifier stack | |
store | Sets whether to store the trigger for auto-refresh |
00408 { 00409 I3Trigger trigger; 00410 00411 trigger.setIdentifier(identifier); 00412 trigger.getIdentifierStack() = stack; 00413 insertTrigger(trigger, store); 00414 }
void I3BaseApp::insertTrigger | ( | const I3Trigger & | t, | |
bool | store = true | |||
) | [protected] |
Inserts the given trigger into I3.
t | Trigger to be inserted | |
store | Sets whether to store the trigger for auto-refresh |
00416 { 00417 00418 if (store) { 00419 if (insertedTriggers.count(t) != 0) return; 00420 insertedTriggers.insert(t); 00421 } 00422 00423 I3InsertTriggerMessage *msg = new I3InsertTriggerMessage(); 00424 I3IPAddress myAddress(nodeIPAddress, par("clientPort")); 00425 00426 msg->setTrigger(t); 00427 msg->setSendReply(true); 00428 msg->setSource(myAddress); 00429 msg->setLength(INSERT_TRIGGER_L(msg)); 00430 00431 sendThroughUDP(msg, gateway.address); 00432 }
void I3BaseApp::removeTrigger | ( | const I3Identifier & | identifier | ) | [protected] |
Removes all triggers from the list of inserted triggers whose identifiers equal the one given.
identifier | Identifier to be compared against |
00435 { 00436 I3Trigger dummy; 00437 dummy.setIdentifier(identifier); 00438 00439 set<I3Trigger>::iterator it = insertedTriggers.lower_bound(dummy); 00440 if (it == insertedTriggers.end()) return; /* no matches */ 00441 00442 for (; it != insertedTriggers.end() && it->getIdentifier() == identifier; it++) { 00443 removeTrigger(*it); 00444 } 00445 }
void I3BaseApp::removeTrigger | ( | const I3Trigger & | trigger | ) | [protected] |
Removes a trigger from I3.
trigger | Trigger to be removed |
00448 { 00449 I3RemoveTriggerMessage *msg = new I3RemoveTriggerMessage(); 00450 msg->setTrigger(t); 00451 msg->setLength(REMOVE_TRIGGER_L(msg)); 00452 sendThroughUDP(msg, gateway.address); 00453 00454 insertedTriggers.erase(t); 00455 }
set< I3Trigger > & I3BaseApp::getInsertedTriggers | ( | ) | [protected] |
void I3BaseApp::receiveChangeNotification | ( | int | category, | |
cPolymorphic * | details | |||
) | [protected] |
00463 { 00464 Enter_Method_Silent(); 00465 00466 /* Mobility is happening (the only event we are subscribed to). We have two things to do: 00467 * 1) Insert triggers with new IP 00468 * 2) Delete triggers with old IP 00469 * If it's one staged mobility, we just get told the IP after it's changed, and we need to make sure 00470 * step 1 and 2 are done. If it's two staged mobility, we need to make sure we do step 1 first and then 00471 * step 2. */ 00472 00473 // if (!mobilityInStages) { /* if the flag isn't set, mobility isn't done in stages or this is stage 1 */ 00474 // if (category == NF_HOSTPOSITION_BEFOREUPDATE) { 00475 // mobilityInStages = true; /* set the flag so we don't land here in stage 2 again */ 00476 // } 00477 // /* do part 1! */ 00478 // cMessage *msg = check_and_cast<cMessage*>(details); 00479 // IPvXAddress *ipAddr = (IPvXAddress*)msg->contextPointer(); 00480 // 00481 // ostringstream os; 00482 // os << "Mobility first stage - actual IP is " << nodeIPAddress << ", future IP is " << *ipAddr << endl; 00483 // parentModule()->bubble(os.str().c_str()); 00484 // 00485 // std::cout << "In advance from " << nodeIPAddress << " to " << *ipAddr << endl; 00486 // I3IPAddress oldAddress(nodeIPAddress, par("clientPort")); 00487 // I3IPAddress newAddress(*ipAddr, par("clientPort")); 00488 // 00489 // delete ipAddr; 00490 // delete msg; 00491 // 00492 // for (set<I3Trigger>::iterator it = insertedTriggers.begin(); it != insertedTriggers.end(); it++) { 00493 // I3Trigger trigger(*it); /* create copy */ 00494 // trigger.getIdentifierStack().replaceAddress(oldAddress, newAddress); /* replace old address with new */ 00495 // insertTrigger(trigger, false); /* insert trigger in I3, but don't store it in our list yet - that's done in part 2 */ 00496 // } 00497 // 00498 // doMobilityEvent(I3_MOBILITY_BEFORE_UPDATE); 00499 // } 00500 // if (category == NF_HOSTPOSITION_UPDATED) { /* part 2: both for 1-stage and stage 2 of 2-stage mobility */ 00501 // I3IPAddress oldAddress(nodeIPAddress, par("clientPort")); 00502 // nodeIPAddress = IPAddressResolver().addressOf(parentModule()).get4(); 00503 // I3IPAddress newAddress(nodeIPAddress, par("clientPort")); 00504 // 00505 // cout << "After from " << oldAddress << " to " << newAddress << endl; 00506 // 00507 // ostringstream os; 00508 // os << "Mobility second stage - setting IP as " << newAddress << endl; 00509 // parentModule()->bubble(os.str().c_str()); 00510 // 00511 // set<I3Trigger> newSet; /* list of new triggers (that we already inserted in I3 in stage 1) */ 00512 // 00513 // for (set<I3Trigger>::iterator it = insertedTriggers.begin(); it != insertedTriggers.end(); it++) { 00514 // I3Trigger trigger(*it); /* create copy */ 00515 // 00516 // trigger.getIdentifierStack().replaceAddress(oldAddress, newAddress); /* replace old address with new */ 00517 // newSet.insert(trigger); /* insert in new list */ 00518 // 00519 // removeTrigger(*it); /* remove trigger from I3 and out list */ 00520 // 00521 // } 00522 // insertedTriggers = newSet; /* replace old list with updated one */ 00523 // 00524 // mobilityInStages = false; /* reset variable */ 00525 // refreshTriggers(); /* to get new trigger round-trip times, new cache list */ 00526 // refreshSamples(); 00527 // 00528 // doMobilityEvent(I3_MOBILITY_UPDATED); 00529 // } 00530 }
void I3BaseApp::doMobilityEvent | ( | I3MobilityStage | stage | ) | [protected, virtual] |
int I3BaseApp::numSent [protected] |
Number of sent messages.
int I3BaseApp::sentBytes [protected] |
int I3BaseApp::numReceived [protected] |
Number of received messages.
int I3BaseApp::receivedBytes [protected] |
int I3BaseApp::numIsolations [protected] |
Number of times this node has been isolated - i.e.
without any I3 servers known
IPvXAddress I3BaseApp::nodeIPAddress [protected] |
Cached IP address of this node.
std::set<I3Trigger> I3BaseApp::insertedTriggers [protected] |
Stored I3 triggers sent from this node, to be refreshed automatically.
std::map<I3Identifier, I3CachedServer> I3BaseApp::samplingCache [protected] |
std::map<I3Identifier, I3CachedServer> I3BaseApp::identifierCache [protected] |
I3CachedServer I3BaseApp::gateway [protected] |
cMessage* I3BaseApp::refreshTriggersTimer [protected] |
int I3BaseApp::refreshTriggersTime [protected] |
cMessage* I3BaseApp::refreshSamplesTimer [protected] |
int I3BaseApp::refreshSamplesTime [protected] |
cMessage* I3BaseApp::initializeTimer [protected] |
cMessage* I3BaseApp::bootstrapTimer [protected] |
bool I3BaseApp::mobilityInStages [private] |