|
INET Framework for OMNeT++/OMNEST
|
Implements RFC 3775 Mobility Support in Ipv6.
More...
#include <xMIPv6.h>
|
| virtual int | numInitStages () const override |
| |
| virtual void | initialize (int stage) override |
| |
| virtual void | handleMessage (cMessage *msg) override |
| |
| void | processMobilityMessage (Packet *inPacket) |
| | This is where all the mobility messages are sifted through and sent to appropriate functions for processing. More...
|
| |
| void | createBUTimer (const Ipv6Address &buDest, NetworkInterface *ie, const uint lifeTime, bool homeRegistration) |
| | This method finally creates the timer structure and schedules the message for sending. More...
|
| |
| void | createDeregisterBUTimer (const Ipv6Address &buDest, NetworkInterface *ie) |
| | Similiar to the previous one, this method creates an BU timer with registration lifetime equal to 0. More...
|
| |
| void | createBUTimer (const Ipv6Address &buDest, NetworkInterface *ie) |
| |
| void | sendPeriodicBU (cMessage *msg) |
| | This method is called when the timer created in createBUTimer() has fired. More...
|
| |
| void | createAndSendBUMessage (const Ipv6Address &dest, NetworkInterface *ie, const uint buSeq, const uint lifeTime, const int bindAuthData=0) |
| | Method for creating and sending a BU by a MN. More...
|
| |
| void | updateBUL (BindingUpdate *bu, const Ipv6Address &dest, const Ipv6Address &CoA, NetworkInterface *ie, const simtime_t sendTime) |
| | Update the an entry of the BUL with the provided parameters. More...
|
| |
| xMIPv6::BuTransmitIfEntry * | fetchBUTransmitIfEntry (NetworkInterface *ie, const Ipv6Address &dest) |
| | This method takes an interface and a destination address and returns the appropriate IfEntry for an BU. More...
|
| |
| void | sendMobilityMessageToIPv6Module (Packet *msg, const Ipv6Address &destAddr, const Ipv6Address &srcAddr=Ipv6Address::UNSPECIFIED_ADDRESS, int interfaceId=-1, simtime_t sendTime=0) |
| | Append tags to the Mobility Messages (BU, BA etc) and send it out to the Ipv6 Module. More...
|
| |
| void | processBUMessage (Packet *inPacket, const Ptr< const BindingUpdate > &bu) |
| | Process a BU - only applicable to HAs and CNs. More...
|
| |
| bool | validateBUMessage (Packet *inPacket, const Ptr< const BindingUpdate > &bu) |
| | Validate a BU - only applicable to HAs and CNs. More...
|
| |
| bool | validateBUderegisterMessage (Packet *inPacket, const Ptr< const BindingUpdate > &bu) |
| | Similiar to validateBUMessage(). More...
|
| |
| void | createAndSendBAMessage (const Ipv6Address &src, const Ipv6Address &dest, int interfaceId, const BaStatus &baStatus, const uint baSeq, const int bindingAuthorizationData, const uint lifeTime, simtime_t sendTime=0) |
| | Constructs and send a BA to the Ipv6 module. More...
|
| |
| void | processBAMessage (Packet *inPacket, const Ptr< const BindingAcknowledgement > &ba) |
| | Processes the received BA and creates tunnels or mobility header paths if appropriate. More...
|
| |
| bool | validateBAck (Packet *inPacket, const BindingAcknowledgement &ba) |
| | Validates a Binding Acknowledgement for a mobile node. More...
|
| |
| void | createAndSendBEMessage (const Ipv6Address &dest, const BeStatus &beStatus) |
| | Creates and sends Binding Error message. More...
|
| |
| virtual void | initReturnRoutability (const Ipv6Address &cnDest, NetworkInterface *ie) |
| | Creates HoTI and CoTI messages and sends them to the CN if timers are not already existing. More...
|
| |
| void | createTestInitTimer (const Ptr< MobilityHeader > testInit, const Ipv6Address &dest, NetworkInterface *ie, simtime_t sendTime=0) |
| | Creates and schedules a timer for either a HoTI or a CoTI transmission. More...
|
| |
| void | sendTestInit (cMessage *msg) |
| | If a TestInit timer was fired, this method gets called. More...
|
| |
| void | resetBUIfEntry (const Ipv6Address &dest, int interfaceID, simtime_t retransmissionTime) |
| | Cancels the current existing timer and reschedules it with initial values. More...
|
| |
| void | createAndSendHoTIMessage (const Ipv6Address &cnDest, NetworkInterface *ie) |
| | Creates and sends a HoTI message to the specified destination. More...
|
| |
| void | createAndSendCoTIMessage (const Ipv6Address &cnDest, NetworkInterface *ie) |
| | Creates and sends a CoTI message to the specified destination. More...
|
| |
| void | processHoTIMessage (Packet *inPacket, const Ptr< const HomeTestInit > &HoTI) |
| | Create and send a HoT message. More...
|
| |
| void | processCoTIMessage (Packet *inPacket, const Ptr< const CareOfTestInit > &CoTI) |
| | Create and send a CoT message. More...
|
| |
| void | processHoTMessage (Packet *inPacket, const Ptr< const HomeTest > &HoT) |
| | First verifies a received HoT message and sends a BU to the CN if the care-of keygen token is available as well. More...
|
| |
| bool | validateHoTMessage (Packet *inPacket, const HomeTest &HoT) |
| | Verifies a HoT according to the RFC, Section 11.6.2. More...
|
| |
| void | processCoTMessage (Packet *inPacket, const Ptr< const CareOfTest > &CoT) |
| | Like processHoTMessage(), but related to CoT. More...
|
| |
| bool | validateCoTMessage (Packet *inPacket, const CareOfTest &CoT) |
| | Like validateHoTMessage(), but related to CoT. More...
|
| |
| bool | checkForBUtoCN (BindingUpdateList::BindingUpdateListEntry &bulEntry, NetworkInterface *ie) |
| | Send a BU depending on current status of: More...
|
| |
| void | sendBUtoCN (BindingUpdateList::BindingUpdateListEntry &bulEntry, NetworkInterface *ie) |
| | Creates a timer for sending a BU. More...
|
| |
| void | processType2RH (Packet *packet, Ipv6RoutingHeader *rh) |
| | Process the Type 2 Routing Header which belongs to the provided datagram. More...
|
| |
| bool | validateType2RH (const Ipv6Header &ipv6Header, const Ipv6RoutingHeader &rh) |
| | Perform validity checks according to RFC 3775 - Section 6.4. More...
|
| |
| void | processHoAOpt (Packet *packet, HomeAddressOption *hoaOpt) |
| | Process the Home Address Option which belongs to the provided datagram. More...
|
| |
| void | createBRRTimer (const Ipv6Address &brDest, NetworkInterface *ie, const uint scheduledTime) |
| | Creates a timer for a Binding Refresh Request message that is going to be fired in scheduledTime seconds. More...
|
| |
| void | sendPeriodicBRR (cMessage *msg) |
| | Handles a fired BRR message transmission structure. More...
|
| |
| void | createAndSendBRRMessage (const Ipv6Address &dest, NetworkInterface *ie) |
| | Creates a Binding Refresh Request and sends it to the Ipv6 module. More...
|
| |
| void | processBRRMessage (Packet *inPacket, const Ptr< const BindingRefreshRequest > &brr) |
| | Processes the Binding Refresh Message. More...
|
| |
| bool | cancelTimerIfEntry (const Ipv6Address &dest, int interfaceID, int msgType) |
| | Deletes the appropriate entry from the transmitIfList and cancels the corresponding retransmission timer. More...
|
| |
| bool | pendingTimerIfEntry (Ipv6Address &dest, int interfaceID, int msgType) |
| | Checks whether there exists an TransmitIfEntry for the specified values. More...
|
| |
| TimerIfEntry * | getTimerIfEntry (Key &key, int timerType) |
| | Returns a pointer to an TimerIfEntry object identified by the provided key, which can be one of the possible polymorphic types. More...
|
| |
| TimerIfEntry * | searchTimerIfEntry (Ipv6Address &dest, int timerType) |
| | Searches for a transmitEntry with the given destination address which is of type timerType. More...
|
| |
| void | removeTimerEntries (const Ipv6Address &dest, int interfaceId) |
| | Removes timers of all types for the specified destination address and interfaceId. More...
|
| |
| void | cancelEntries (int interfaceId, Ipv6Address &CoA) |
| | Cancel all timers (TransmitIf entities for HA and CNs) related to the provided interfaceId and CoA. More...
|
| |
| void | removeCoAEntries () |
| | Remove all entries from the interfaceCoAList. More...
|
| |
| void | createBULEntryExpiryTimer (BindingUpdateList::BindingUpdateListEntry *entry, NetworkInterface *ie, simtime_t scheduledTime) |
| | Creates or overwrites a timer for BUL expiry that fires at provided scheduledTime. More...
|
| |
| void | handleBULExpiry (cMessage *msg) |
| | Handles the situation of a BUL expiry. More...
|
| |
| void | createBCEntryExpiryTimer (const Ipv6Address &HoA, NetworkInterface *ie, simtime_t scheduledTime) |
| | Creates or overwrites a timer for BC expiry that fires at provided scheduledTime. More...
|
| |
| void | handleBCExpiry (cMessage *msg) |
| | Handles the expiry of a BC entry. More...
|
| |
| void | createHomeTokenEntryExpiryTimer (Ipv6Address &cnAddr, NetworkInterface *ie, simtime_t scheduledTime) |
| | Creates or overwrites a timer for home keygen token expiry that fires at provided scheduledTime. More...
|
| |
| void | createCareOfTokenEntryExpiryTimer (Ipv6Address &cnAddr, NetworkInterface *ie, simtime_t scheduledTime) |
| | Creates or overwrites a timer for care-of keygen token expiry that fires at provided scheduledTime. More...
|
| |
Implements RFC 3775 Mobility Support in Ipv6.
◆ CnList
◆ InterfaceCoAList
holds the tuples of currently available {InterfaceID, CoA} pairs
◆ TransmitIfList
◆ ~xMIPv6()
| inet::xMIPv6::~xMIPv6 |
( |
| ) |
|
|
virtual |
Destructur.
Ensures that the memory from the list with all TimerIfEntry's gets properly released.
◆ cancelEntries()
| void inet::xMIPv6::cancelEntries |
( |
int |
interfaceId, |
|
|
Ipv6Address & |
CoA |
|
) |
| |
|
protected |
Cancel all timers (TransmitIf entities for HA and CNs) related to the provided interfaceId and CoA.
In addition the tunnels to the Home Agent and the CNs are destroyed as well. 0
2340 NetworkInterface *ie =
ift->getInterfaceById(interfaceId);
2345 Ipv6Address HA = ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress();
2353 if ((*it).first.interfaceID == interfaceId) {
2357 if ((*oldIt).first.type ==
KEY_BU)
2358 tunneling->destroyTunnelForEntryAndTrigger(CoA, (*oldIt).first.dest);
2361 cancelTimerIfEntry((*oldIt).first.dest, (*oldIt).first.interfaceID, (*oldIt).first.type);
Referenced by removeCoAEntries().
◆ cancelTimerIfEntry()
| bool inet::xMIPv6::cancelTimerIfEntry |
( |
const Ipv6Address & |
dest, |
|
|
int |
interfaceID, |
|
|
int |
msgType |
|
) |
| |
|
protected |
Deletes the appropriate entry from the transmitIfList and cancels the corresponding retransmission timer.
2194 Key key(dest, interfaceID, msgType);
2202 TimerIfEntry *entry = (pos->second);
2204 cancelAndDelete(entry->timer);
2205 entry->timer =
nullptr;
2211 EV_DEBUG <<
"Deleted TimerIfEntry and corresponding timer.\n";
Referenced by cancelEntries(), createBUTimer(), handleBCExpiry(), handleBULExpiry(), handleTokenExpiry(), processBAMessage(), processBUMessage(), processCoTMessage(), processHoTMessage(), removeTimerEntries(), sendPeriodicBRR(), and ~xMIPv6().
◆ checkForBUtoCN()
Send a BU depending on current status of:
- Registration or Deregistration phase
- Availability of tokens
Return true or false depending on whether a BU has been sent or not.
1938 EV_INFO <<
"Checking whether a new BU has to be sent to CN." << endl;
1943 if (!
bul->isValidBinding(bulEntry.destAddress)) {
1950 if (
bul->isHomeTokenAvailable(bulEntry.destAddress, ie)) {
1963 if (!
bul->isCareOfTokenAvailable(bulEntry.destAddress, ie)) {
1964 if (
bul->recentlySentCOTI(bulEntry.destAddress, ie))
1971 if (!
bul->isHomeTokenAvailable(bulEntry.destAddress, ie)) {
1972 if (
bul->recentlySentHOTI(bulEntry.destAddress, ie))
1982 if ((
bul->isBindingAboutToExpire(bulEntry.destAddress)
1983 || !
bul->isValidBinding(bulEntry.destAddress))
Referenced by handleBULExpiry(), processCoTMessage(), processHoTMessage(), and returningHome().
◆ createAndSendBAMessage()
| void inet::xMIPv6::createAndSendBAMessage |
( |
const Ipv6Address & |
src, |
|
|
const Ipv6Address & |
dest, |
|
|
int |
interfaceId, |
|
|
const BaStatus & |
baStatus, |
|
|
const uint |
baSeq, |
|
|
const int |
bindingAuthorizationData, |
|
|
const uint |
lifeTime, |
|
|
simtime_t |
sendTime = 0 |
|
) |
| |
|
protected |
Constructs and send a BA to the Ipv6 module.
Only applicable to HAs and CNs.
1060 EV_TRACE <<
"Entered createAndSendBAMessage() method" << endl;
1062 NetworkInterface *ie =
ift->getInterfaceById(interfaceId);
1072 auto packet =
new Packet(
"Binding Acknowledgement");
1073 const auto& ba = makeShared<BindingAcknowledgement>();
1075 ba->setStatus(baStatus);
1076 ba->setSequenceNumber(baSeq);
1079 ba->setLifetime(lifeTime / 4);
1093 ba->setBindingAuthorizationData(bindingAuthorizationData);
1097 int bindAuthSize = 0;
1103 packet->insertAtFront(ba);
Referenced by processBUMessage(), and validateBUMessage().
◆ createAndSendBEMessage()
| void inet::xMIPv6::createAndSendBEMessage |
( |
const Ipv6Address & |
dest, |
|
|
const BeStatus & |
beStatus |
|
) |
| |
|
protected |
Creates and sends Binding Error message.
2178 EV_TRACE <<
"\n<<<<<<<<< Entered createAndSendBEMessage() Function>>>>>>>\n";
2180 auto packet =
new Packet(
"BError");
2181 const auto& be = makeShared<BindingError>();
2183 be->setStatus(beStatus);
2187 packet->insertAtFront(be);
Referenced by processHoAOpt().
◆ createAndSendBRRMessage()
Creates a Binding Refresh Request and sends it to the Ipv6 module.
2453 EV_TRACE <<
"\n<<======THIS IS THE ROUTINE FOR CREATING AND SENDING BRR MESSAGE =====>>\n";
2454 auto outPacket =
new Packet(
"Binding Refresh Request");
2455 const auto& brr = makeShared<BindingRefreshRequest>();
2464 outPacket->insertAtFront(brr);
2466 EV_INFO <<
"\n<<======BRR MESSAGE FORMED; APPENDING CONTROL INFO=====>>\n";
2467 Ipv6Address CoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA);
2468 ASSERT(!CoA.isUnspecified());
Referenced by sendPeriodicBRR().
◆ createAndSendBUMessage()
Method for creating and sending a BU by a MN.
465 EV_INFO <<
"Creating and sending Binding Update" << endl;
467 Ipv6Address CoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA);
469 if (CoA.isUnspecified())
470 CoA = ie->getProtocolData<Ipv6InterfaceData>()->getPreferredAddress();
472 auto packet =
new Packet(
"Binding Update");
473 const auto& bu = makeShared<BindingUpdate>();
497 bu->setLifetime(lifeTime / 4);
499 bu->setSequence(buSeq);
503 bu->setAckFlag(
true);
507 bu->setHomeRegistrationFlag(dest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress());
520 bu->setLinkLocalAddressCompatibilityFlag(
true);
522 bu->setKeyManagementFlag(
false);
531 Ipv6Address HoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::HoA);
532 ASSERT(!HoA.isUnspecified());
537 bu->setHomeAddressMN(HoA);
544 bu->setBindingAuthorizationData(bindAuthData);
546 int nonceIndicesSize = 0;
548 if (!bu->getHomeRegistrationFlag())
552 int bindAuthSize = 0;
563 updateBUL(bu.get(), dest, CoA, ie, simTime());
565 packet->insertAtFront(bu);
Referenced by sendPeriodicBU().
◆ createAndSendCoTIMessage()
◆ createAndSendHoTIMessage()
◆ createBCEntryExpiryTimer()
Creates or overwrites a timer for BC expiry that fires at provided scheduledTime.
2610 cMessage *bcExpiryMsg =
new cMessage(
"BCEntryExpiry",
MK_BC_EXPIRY);
2616 bcExpIfEntry->dest = HoA;
2617 bcExpIfEntry->HoA = HoA;
2618 bcExpIfEntry->ifEntry = ie;
2619 bcExpIfEntry->timer = bcExpiryMsg;
2621 bcExpiryMsg->setContextPointer(bcExpIfEntry);
2623 scheduleAt(scheduledTime, bcExpiryMsg);
2624 EV_INFO <<
"Scheduled BC expiry for time " << scheduledTime <<
"s" << endl;
Referenced by processBUMessage().
◆ createBRRTimer()
Creates a timer for a Binding Refresh Request message that is going to be fired in scheduledTime seconds.
2392 Key key(brDest, ie->getInterfaceId(),
KEY_BR);
2393 BrTransmitIfEntry *brIfEntry;
2399 if ((brIfEntry =
dynamic_cast<BrTransmitIfEntry *
>(pos->second))) {
2400 cancelAndDelete(brIfEntry->timer);
2403 throw cRuntimeError(
"Expected BrTransmitIfEntry* !");
2407 brIfEntry =
new BrTransmitIfEntry();
2411 brIfEntry->dest = brDest;
2412 brIfEntry->ifEntry = ie;
2413 brIfEntry->retries = 0;
2416 brIfEntry->timer = brTriggerMsg;
2417 brTriggerMsg->setContextPointer(brIfEntry);
2420 scheduleAfter(scheduledTime, brTriggerMsg);
2421 EV_DETAIL <<
"\n++++++++++BRR TIMER CREATED FOR SIM TIME: " << simTime() + scheduledTime
2422 <<
" seconds+++++++++++++++++ \n";
◆ createBULEntryExpiryTimer()
Creates or overwrites a timer for BUL expiry that fires at provided scheduledTime.
2502 cMessage *bulExpiryMsg =
new cMessage(
"BULEntryExpiry",
MK_BUL_EXPIRY);
2505 Ipv6Address& HoA = entry->homeAddress;
2506 Ipv6Address& CoA = entry->careOfAddress;
2507 Ipv6Address& HA = entry->destAddress;
2513 bulExpIfEntry->dest = HA;
2514 bulExpIfEntry->HoA = HoA;
2515 bulExpIfEntry->CoA = CoA;
2516 bulExpIfEntry->ifEntry = ie;
2517 bulExpIfEntry->timer = bulExpiryMsg;
2519 bulExpiryMsg->setContextPointer(bulExpIfEntry);
2523 scheduleAt(scheduledTime, bulExpiryMsg);
2524 EV_INFO <<
"Scheduled BUL expiry (" << entry->bindingExpiry <<
"s) for time " << scheduledTime <<
"s" << endl;
Referenced by handleBULExpiry(), and processBAMessage().
◆ createBUTimer() [1/2]
315 BindingUpdateList::BindingUpdateListEntry *bulEntry =
bul->fetch(buDest);
316 ASSERT(bulEntry !=
nullptr);
323 if (buDest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress())
324 createBUTimer(buDest, ie, ie->getProtocolData<Ipv6InterfaceData>()->_getMaxHaBindingLifeTime(),
true);
329 createBUTimer(buDest, ie, ie->getProtocolData<Ipv6InterfaceData>()->_getMaxRrBindingLifeTime(),
false);
◆ createBUTimer() [2/2]
This method finally creates the timer structure and schedules the message for sending.
358 EV_INFO <<
"Creating BU timer at sim time: " << simTime() <<
" seconds." << endl;
362 Key key(buDest, ie->getInterfaceId(),
KEY_BU);
368 buIfEntry->dest = buDest;
369 buIfEntry->ifEntry = ie;
370 buIfEntry->timer = buTriggerMsg;
374 buIfEntry->buSequenceNumber =
bul->getSequenceNumber(buDest);
376 buIfEntry->lifeTime = lifeTime;
383 if (!
bul->isInBindingUpdateList(buDest))
384 buIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeoutFirst();
388 buIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeout();
390 buIfEntry->homeRegistration = homeRegistration;
392 buTriggerMsg->setContextPointer(buIfEntry);
396 scheduleAfter(SIMTIME_ZERO, buTriggerMsg);
Referenced by createBUTimer(), createDeregisterBUTimer(), handleBULExpiry(), initiateMipv6Protocol(), and sendBUtoCN().
◆ createCareOfTokenEntryExpiryTimer()
Creates or overwrites a timer for care-of keygen token expiry that fires at provided scheduledTime.
Referenced by processCoTMessage().
◆ createDeregisterBUTimer()
Similiar to the previous one, this method creates an BU timer with registration lifetime equal to 0.
351 createBUTimer(buDest, ie, 0, buDest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress());
Referenced by createBUTimer(), and returningHome().
◆ createHomeTokenEntryExpiryTimer()
Creates or overwrites a timer for home keygen token expiry that fires at provided scheduledTime.
Referenced by processHoTMessage().
◆ createTestInitTimer()
Creates and schedules a timer for either a HoTI or a CoTI transmission.
1459 EV_DETAIL <<
"\n++++++++++TEST INIT TIMER CREATED AT SIM TIME: " << simTime()
1460 <<
" seconds+++++++++++++++++ \n";
1472 if (dynamicPtrCast<HomeTestInit>(testInit))
1478 Key key(dest, ie->getInterfaceId(), msgType);
1482 cancelAndDelete(tiIfEntry->timer);
1484 tiIfEntry->timer = testInitTriggerMsg;
1486 tiIfEntry->dest = dest;
1487 tiIfEntry->ifEntry = ie;
1488 tiIfEntry->testInitMsg = testInit;
1491 tiIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeout();
1492 tiIfEntry->nextScheduledTime = simTime();
1494 testInitTriggerMsg->setContextPointer(tiIfEntry);
1498 scheduleAfter(sendTime, testInitTriggerMsg);
Referenced by createAndSendCoTIMessage(), and createAndSendHoTIMessage().
◆ createTokenEntryExpiryTimer()
Creates or overwrites a timer for {home, care-of} keygen token expiry that fires at provided scheduledTime.
Parameter tokenType is provided as KEY_XTOKEN_EXP
2659 cMessage *tokenExpiryMsg =
new cMessage(
"TokenEntryExpiry",
MK_TOKEN_EXPIRY);
2661 Key key(cnAddr, ie->getInterfaceId(), tokenType);
2665 tokenExpIfEntry->cnAddr = cnAddr;
2666 tokenExpIfEntry->ifEntry = ie;
2667 tokenExpIfEntry->timer = tokenExpiryMsg;
2669 tokenExpIfEntry->tokenType = tokenType;
2671 tokenExpiryMsg->setContextPointer(tokenExpIfEntry);
2673 scheduleAt(scheduledTime, tokenExpiryMsg);
2674 EV_INFO <<
"Scheduled token expiry for time " << scheduledTime <<
"s" << endl;
◆ fetchBUTransmitIfEntry()
This method takes an interface and a destination address and returns the appropriate IfEntry for an BU.
Is supposed to be used until the valid BA is received for the respective BU.
614 if (BuTransmitIfEntry *buIfEntry =
dynamic_cast<BuTransmitIfEntry *
>(elem.second)) {
615 if (buIfEntry->ifEntry->getInterfaceId() == ie->getInterfaceId() && buIfEntry->dest == dest)
Referenced by updateBUL().
◆ getTimerIfEntry()
Returns a pointer to an TimerIfEntry object identified by the provided key, which can be one of the possible polymorphic types.
In case there does not yet exist such an entry, a new one is created. The type of the TimerIfEntry is specified with the provided timerType.
2226 TimerIfEntry *ifEntry;
2232 if (TestInitTransmitIfEntry *testInitIfEntry =
dynamic_cast<TestInitTransmitIfEntry *
>(pos->second)) {
2233 cancelAndDelete(testInitIfEntry->timer);
2234 testInitIfEntry->testInitMsg =
nullptr;
2236 ifEntry = testInitIfEntry;
2238 else if (BuTransmitIfEntry *buIfEntry =
dynamic_cast<BuTransmitIfEntry *
>(pos->second)) {
2239 cancelAndDelete(buIfEntry->timer);
2241 ifEntry = buIfEntry;
2243 else if (BulExpiryIfEntry *bulExpIfEntry =
dynamic_cast<BulExpiryIfEntry *
>(pos->second)) {
2244 cancelAndDelete(bulExpIfEntry->timer);
2246 ifEntry = bulExpIfEntry;
2248 else if (BcExpiryIfEntry *bcExpIfEntry =
dynamic_cast<BcExpiryIfEntry *
>(pos->second)) {
2249 cancelAndDelete(bcExpIfEntry->timer);
2251 ifEntry = bcExpIfEntry;
2253 else if (TokenExpiryIfEntry *tokenExpIfEntry =
dynamic_cast<TokenExpiryIfEntry *
>(pos->second)) {
2254 cancelAndDelete(tokenExpIfEntry->timer);
2255 tokenExpIfEntry->timer =
nullptr;
2257 ifEntry = tokenExpIfEntry;
2260 throw cRuntimeError(
"Expected a subclass of TimerIfEntry!");
2262 ifEntry->timer =
nullptr;
2266 switch (timerType) {
2268 ifEntry =
new BuTransmitIfEntry();
2272 ifEntry =
new TestInitTransmitIfEntry();
2276 ifEntry =
new BulExpiryIfEntry();
2280 ifEntry =
new BcExpiryIfEntry();
2284 ifEntry =
new TokenExpiryIfEntry();
2288 throw cRuntimeError(
"Expected a valid TimerIfEntry type!");
2292 ifEntry->timer =
nullptr;
2293 ifEntry->ifEntry =
nullptr;
Referenced by createBCEntryExpiryTimer(), createBULEntryExpiryTimer(), createBUTimer(), createTestInitTimer(), and createTokenEntryExpiryTimer().
◆ handleBCExpiry()
| void inet::xMIPv6::handleBCExpiry |
( |
cMessage * |
msg | ) |
|
|
protected |
Handles the expiry of a BC entry.
Entry is removed from BC and tunnels/routing paths are destroyed.
2637 EV_INFO <<
"BC entry has expired - removing entry and associated structures..." << endl;
2639 BcExpiryIfEntry *bcExpIfEntry = (BcExpiryIfEntry *)msg->getContextPointer();
2640 ASSERT(bcExpIfEntry !=
nullptr);
2643 bc->deleteEntry(bcExpIfEntry->HoA);
2646 tunneling->destroyTunnelFromTrigger(bcExpIfEntry->HoA);
Referenced by handleMessage().
◆ handleBULExpiry()
| void inet::xMIPv6::handleBULExpiry |
( |
cMessage * |
msg | ) |
|
|
protected |
Handles the situation of a BUL expiry.
Either a BU is sent in advance for renewal or the BUL entry is removed.
2550 BulExpiryIfEntry *bulExpIfEntry = (BulExpiryIfEntry *)msg->getContextPointer();
2551 ASSERT(bulExpIfEntry !=
nullptr);
2554 BindingUpdateList::BindingUpdateListEntry *entry =
bul->lookup(bulExpIfEntry->dest);
2555 ASSERT(entry !=
nullptr);
2560 if (simTime() < entry->bindingExpiry) {
2561 EV_INFO <<
"BUL entry about to expire - creating new BU timer..." << endl;
2564 NetworkInterface *ie = bulExpIfEntry->ifEntry;
2569 if (bulExpIfEntry->dest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress())
2572 BindingUpdateList::BindingUpdateListEntry *entry =
bul->lookup(bulExpIfEntry->dest);
2577 EV_DETAIL <<
"Resetting expiry timer... " << endl;
2585 EV_INFO <<
"BUL entry has expired - removing entry and associated structures..." << endl;
2591 bul->removeBinding(bulExpIfEntry->dest);
2594 int interfaceID = bulExpIfEntry->ifEntry->getInterfaceId();
2598 tunneling->destroyTunnel(bulExpIfEntry->CoA, bulExpIfEntry->dest);
Referenced by handleMessage().
◆ handleMessage()
| void inet::xMIPv6::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
134 if (msg->isSelfMessage()) {
135 EV_DETAIL <<
"Self message received!\n";
138 EV_DETAIL <<
"Periodic BU Timeout Message Received\n";
142 EV_DETAIL <<
"Periodic BRR Timeout Message Received\n";
146 EV_DETAIL <<
"HoTI/CoTI Timeout Message Received\n";
150 EV_DETAIL <<
"BUL Expiry Timeout Message Received\n";
154 EV_DETAIL <<
"BUL Expiry Timeout Message Received\n";
158 EV_DETAIL <<
"RR token expired" << endl;
162 throw cRuntimeError(
"Unrecognized Timer");
166 auto packet = check_and_cast<Packet *>(msg);
168 EV_INFO <<
" Received MIPv6 related message" << endl;
173 else if (
auto packet =
dynamic_cast<Packet *
>(msg)) {
174 Ipv6ExtensionHeader *eh = (Ipv6ExtensionHeader *)packet->getContextPointer();
175 if (
auto rh =
dynamic_cast<Ipv6RoutingHeader *
>(eh))
177 else if (
auto hao =
dynamic_cast<HomeAddressOption *
>(eh))
180 throw cRuntimeError(
"Unknown Extension Header.");
183 throw cRuntimeError(
"Unknown message type received.");
◆ handleTokenExpiry()
| void inet::xMIPv6::handleTokenExpiry |
( |
cMessage * |
msg | ) |
|
|
private |
Handles the event that indicates that a {care-of,home} keygen token has expired.
2679 TokenExpiryIfEntry *tokenExpIfEntry = (TokenExpiryIfEntry *)msg->getContextPointer();
2680 ASSERT(tokenExpIfEntry !=
nullptr);
2683 EV_INFO <<
"Care-of keygen token for CN=" << tokenExpIfEntry->cnAddr <<
" expired";
2684 bul->resetCareOfToken(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress());
2687 EV_INFO <<
"Home keygen token for CN=" << tokenExpIfEntry->cnAddr <<
" expired";
2688 bul->resetHomeToken(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress());
2691 throw cRuntimeError(
"Unkown value for tokenType!");
2693 EV_INFO <<
"...removed token from BUL." << endl;
2698 cancelTimerIfEntry(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry->getInterfaceId(), tokenExpIfEntry->tokenType);
Referenced by handleMessage().
◆ initialize()
| void inet::xMIPv6::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
86 cSimpleModule::initialize(stage);
89 EV_TRACE <<
"Initializing xMIPv6 module" << endl;
105 tunneling.reference(
this,
"ipv6TunnelingModule",
true);
111 rt6 = L3AddressResolver().getIpv6RoutingTableOf(host);
112 rt6->setIsMobileNode(par(
"isMobileNode"));
113 rt6->setMipv6Support(
true);
114 rt6->setIsHomeAgent(par(
"isHomeAgent"));
117 ift.reference(
this,
"interfaceTableModule",
true);
118 ipv6nd.reference(
this,
"ipv6NeighbourDiscoveryModule",
true);
120 if (
rt6->isMobileNode()) {
121 bul.reference(
this,
"bindingUpdateListModule",
true);
124 bc.reference(
this,
"bindingCacheModule",
true);
◆ initiateMipv6Protocol()
Initiates the Mobile IP protocol.
Method to be used when we have moved to a new access network and the new CoA is available for that interface.
237 if (!(ie->isLoopback()) &&
rt6->isMobileNode()) {
238 EV_INFO <<
"Initiating Mobile Ipv6 protocol..." << endl;
241 Ipv6Address haDest = ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress();
249 Ipv6Address HoA = ie->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress();
252 BindingUpdateList::BindingUpdateListEntry *bulEntry =
bul->fetch(cn);
253 ASSERT(bulEntry !=
nullptr);
255 bul->removeBinding(cn);
257 bul->resetCareOfToken(cn, HoA);
258 tunneling->destroyTunnelForExitAndTrigger(HoA, cn);
◆ initReturnRoutability()
Creates HoTI and CoTI messages and sends them to the CN if timers are not already existing.
If home and care-of tokens are already available a BU is directly sent to the CN.
1388 EV_TRACE <<
"Initiating Return Routability...\n";
1391 bool sendHoTI =
true, sendCoTI =
true;
1404 BindingUpdateList::BindingUpdateListEntry *cnEntry =
bul->fetch(cnDest);
1417 if (
bul->isHomeTokenAvailable(cnDest, ie)) {
1418 EV_INFO <<
"Valid home token available - sending HoTI later.\n";
1425 if (
bul->isCareOfTokenAvailable(cnDest, ie)) {
1426 EV_INFO <<
"Valid care-of token available - sending CoTI later.\n" << endl;
1434 if (!sendHoTI && !sendCoTI) {
1444 if (sendHoTI && !
bul->recentlySentHOTI(cnDest, ie)) {
1449 if (sendCoTI && !
bul->recentlySentCOTI(cnDest, ie)) {
Referenced by processBRRMessage(), and triggerRouteOptimization().
◆ numInitStages()
| virtual int inet::xMIPv6::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ pendingTimerIfEntry()
| bool inet::xMIPv6::pendingTimerIfEntry |
( |
Ipv6Address & |
dest, |
|
|
int |
interfaceID, |
|
|
int |
msgType |
|
) |
| |
|
protected |
Checks whether there exists an TransmitIfEntry for the specified values.
In case a new TODOTimerIfEntry is added, this method has to be appropriately extended in order to cover the new data structure. Returns true on success and false otherwise.
2218 Key key(dest, interfaceID, msgType);
◆ processBAMessage()
Processes the received BA and creates tunnels or mobility header paths if appropriate.
11.5.1 After updating its home registration, the mobile node then updates associated mobility bindings in correspondent nodes that it is performing route optimization with as specified in Section 11.7.2.
1126 EV_TRACE <<
"\n<<<<<<<<<This is where BA gets processed>>>>>>>>>\n";
1128 Ipv6Address baSource = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1129 auto ifTag = inPacket->getTag<InterfaceInd>();
1130 NetworkInterface *ie =
ift->getInterfaceById(ifTag->getInterfaceId());
1132 if (
rt6->isMobileNode()) {
1134 EV_INFO <<
"Discarding invalid BAck...\n";
1155 if (ba->getStatus() < 128) {
1156 EV_INFO <<
"Binding was accepted." << endl;
1161 if (ba->getLifetime() == 0) {
1162 if (baSource == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress()) {
1169 ipv6nd->sendUnsolicitedNa(ie);
1178 bul->removeBinding(baSource);
1187 BindingUpdateList::BindingUpdateListEntry *entry =
bul->lookup(baSource);
1188 ASSERT(entry !=
nullptr);
1191 if (entry->BAck ==
false && entry->destAddress == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress()) {
1215 else if (entry->BAck ==
false) {
1216 tunneling->destroyTunnelForExitAndTrigger(entry->homeAddress, baSource);
1249 int l_ack = ba->getLifetime() * 4;
1250 int l_update = entry->bindingLifetime;
1251 int l_remain = entry->bindingLifetime - (SIMTIME_DBL(simTime() - entry->sentTime));
1252 int x = l_remain - (l_update - l_ack);
1253 entry->bindingLifetime = x > 0 ? x : 0;
1254 entry->bindingExpiry = simTime() + entry->bindingLifetime;
1259 scheduledTime = scheduledTime > 0 ? scheduledTime : 0;
1263 EV_DETAIL <<
"Scheduling BULEntryExpiryTimer for " << scheduledTime << endl;
1285 EV_INFO <<
"Binding was rejected.\n";
Referenced by processMobilityMessage().
◆ processBRRMessage()
Processes the Binding Refresh Message.
2480 Ipv6Address cnAddress = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
2481 Ipv6Address HoA = inPacket->getTag<
L3AddressInd>()->getDestAddress().toIpv6();
2483 if (!
bul->isInBindingUpdateList(cnAddress, HoA)) {
2484 EV_WARN <<
"BRR not accepted - no binding for this CN. Dropping message." << endl;
2485 PacketDropDetails details;
2490 auto ifTag = inPacket->getTag<InterfaceInd>();
2491 NetworkInterface *ie =
ift->getInterfaceById(ifTag->getInterfaceId());
Referenced by processMobilityMessage().
◆ processBUMessage()
| void inet::xMIPv6::processBUMessage |
( |
Packet * |
inPacket, |
|
|
const Ptr< const BindingUpdate > & |
bu |
|
) |
| |
|
protected |
Process a BU - only applicable to HAs and CNs.
682 EV_INFO <<
"Entered BU processing method" << endl;
689 if (
rt6->isMobileNode() && !
rt6->isHomeAgent()) {
690 EV_WARN <<
"Wrong Node: not HA or CN" << endl;
693 bubble(
"Wrong Node: not HA or CN");
702 if (validBUMessage) {
703 auto ifTag = inPacket->getTag<InterfaceInd>();
705 const Ipv6Address& HoA = bu->getHomeAddressMN();
706 Ipv6Address CoA = addrTag->getSrcAddress().toIpv6();
707 Ipv6Address destAddress = addrTag->getDestAddress().toIpv6();
708 uint buLifetime = bu->getLifetime() * 4;
709 uint buSequence = bu->getSequence();
710 bool homeRegistration = bu->getHomeRegistrationFlag();
722 if ((buLifetime == 0) || (CoA == HoA)) {
733 uint baSeqNumber = bu->getSequence();
735 bu->getBindingAuthorizationData(), baSeqNumber, buLifetime);
736 EV_ERROR <<
"Not HA for this MN. Responding with appropirate BA...\n";
748 bc->deleteEntry(HoA);
753 tunneling->destroyTunnelFromTrigger(HoA);
763 if (
rt6->isHomeAgent() || bu->getAckFlag()) {
769 uint baSeqNumber = bu->getSequence();
781 bu->getBindingAuthorizationData(), lifeTime);
784 if (!
rt6->isHomeAgent()) {
787 int interfaceID = ifTag->getInterfaceId();
791 EV_INFO <<
"Deregistered binding\n";
792 bubble(
"Deregistered binding!");
804 if (homeRegistration) {
811 if (!
rt6->isHomeAgent()) {
813 uint baSeqNumber = bu->getSequence();
816 bu->getBindingAuthorizationData(), lifeTime);
821 else if (!
rt6->isOnLinkAddress(HoA)) {
829 uint baSeqNumber = bu->getSequence();
832 bu->getBindingAuthorizationData(), lifeTime);
839 bool existingBinding =
bc->isInBindingCache(HoA);
840 bc->addOrUpdateBC(HoA, CoA, buLifetime, buSequence, homeRegistration);
852 if (bu->getAckFlag() ||
rt6->isHomeAgent()) {
865 uint baSeqNumber = bu->getSequence();
869 uint lifeTime =
bc->getLifetime(HoA);
877 if (
rt6->isHomeAgent())
879 sendTime = existingBinding ? 0 : 1;
885 bu->getBindingAuthorizationData(), lifeTime, sendTime);
895 EV_INFO <<
"BU Validated as OK: ACK FLAG NOT SET" << endl;
896 bubble(
"!!!BU VALID --- ACK FLAG = False !!!");
899 if (
rt6->isHomeAgent()) {
900 Ipv6Address& HA = destAddress;
904 tunneling->destroyTunnelForEntryAndTrigger(HA, HoA);
912 Ipv6Address& CNAddress = destAddress;
913 tunneling->destroyTunnelForEntryAndTrigger(CNAddress, HoA);
920 int interfaceID = ifTag->getInterfaceId();
935 EV_WARN <<
"BU Validation Failed: Dropping message" << endl;
936 bubble(
"BU Validation Failed: Dropping Packet");
Referenced by processMobilityMessage().
◆ processCoTIMessage()
| void inet::xMIPv6::processCoTIMessage |
( |
Packet * |
inPacket, |
|
|
const Ptr< const CareOfTestInit > & |
CoTI |
|
) |
| |
|
protected |
Create and send a CoT message.
1727 Ipv6Address srcAddr = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1728 Ipv6Address coa = inPacket->getTag<
L3AddressInd>()->getDestAddress().toIpv6();
1730 auto outPacket =
new Packet(
"CoT");
1731 const auto& cot = makeShared<CareOfTest>();
1733 cot->setCareOfInitCookie(coti->getCareOfInitCookie());
1734 cot->setCareOfKeyGenToken(
bc->generateCareOfToken(coa, 0));
1737 outPacket->insertAtFront(cot);
1739 EV_INFO <<
"\n<<======CoT MESSAGE FORMED; APPENDING CONTROL INFO=====>>\n";
Referenced by processMobilityMessage().
◆ processCoTMessage()
| void inet::xMIPv6::processCoTMessage |
( |
Packet * |
inPacket, |
|
|
const Ptr< const CareOfTest > & |
CoT |
|
) |
| |
|
protected |
Like processHoTMessage(), but related to CoT.
1838 EV_WARN <<
"CoT validation not passed: dropping message" << endl;
1839 PacketDropDetails details;
1844 EV_INFO <<
"CoT validation passed: updating BUL" << endl;
1846 Ipv6Address srcAddr = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1848 auto ifTag = inPacket->getTag<InterfaceInd>();
1849 int interfaceID = ifTag->getInterfaceId();
1851 NetworkInterface *ie =
ift->getInterfaceById(interfaceID);
1853 BindingUpdateList::BindingUpdateListEntry *bulEntry =
bul->lookup(srcAddr);
1854 ASSERT(bulEntry !=
nullptr);
1860 bulEntry->tokenC = CoT->getCareOfKeyGenToken();
1864 simTime() + ie->getProtocolData<Ipv6InterfaceData>()->_getMaxTokenLifeTime());
Referenced by processMobilityMessage().
◆ processHoAOpt()
Process the Home Address Option which belongs to the provided datagram.
Swaps the addresses between the original source address of the datagram and the field in the option.
2124 auto ipv6Header = packet->peekAtFront<Ipv6Header>();
2127 bool validHoAOpt =
false;
2128 const Ipv6Address& HoA = hoaOpt->getHomeAddress();
2129 const Ipv6Address& CoA = ipv6Header->getSrcAddress();
2138 ASSERT(
bc !=
nullptr);
2140 if (
bc->isInBindingCache(HoA, CoA)) {
2141 ipv6Header =
nullptr;
2142 packet->trimFront();
2143 auto newIpv6Header = packet->removeAtFront<Ipv6Header>();
2144 newIpv6Header->setSrcAddress(HoA);
2149 EV_WARN <<
"Invalid RH2 destination - no entry in binding cache. Dropping packet." << endl;
2161 packet->setContextPointer(
nullptr);
2165 EV_INFO <<
"Valid HoA Option - copied address from HoA Option to datagram" << endl;
2166 send(packet,
"toIPv6");
2169 PacketDropDetails details;
Referenced by handleMessage().
◆ processHoTIMessage()
| void inet::xMIPv6::processHoTIMessage |
( |
Packet * |
inPacket, |
|
|
const Ptr< const HomeTestInit > & |
HoTI |
|
) |
| |
|
protected |
Create and send a HoT message.
1703 Ipv6Address srcAddr = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1704 Ipv6Address HoA = inPacket->getTag<
L3AddressInd>()->getDestAddress().toIpv6();
1706 auto outPacket =
new Packet(
"HoT");
1707 const auto& homeTest = makeShared<HomeTest>();
1708 homeTest->setMobilityHeaderType(
HOME_TEST);
1709 homeTest->setHomeInitCookie(homeTestInit->getHomeInitCookie());
1710 homeTest->setHomeKeyGenToken(
bc->generateHomeToken(HoA, 0));
1713 outPacket->insertAtFront(homeTest);
1715 EV_INFO <<
"\n<<======HoT MESSAGE FORMED; APPENDING CONTROL INFO=====>>\n";
Referenced by processMobilityMessage().
◆ processHoTMessage()
| void inet::xMIPv6::processHoTMessage |
( |
Packet * |
inPacket, |
|
|
const Ptr< const HomeTest > & |
HoT |
|
) |
| |
|
protected |
First verifies a received HoT message and sends a BU to the CN if the care-of keygen token is available as well.
Retransmission of HoTI message is rescheduled.
1751 EV_WARN <<
"HoT validation not passed: dropping message" << endl;
1752 PacketDropDetails details;
1757 EV_WARN <<
"HoT validation passed: updating BUL" << endl;
1758 Ipv6Address srcAddr = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1760 int interfaceID = inPacket->getTag<InterfaceInd>()->getInterfaceId();
1761 NetworkInterface *ie =
ift->getInterfaceById(interfaceID);
1763 BindingUpdateList::BindingUpdateListEntry *bulEntry =
bul->lookup(srcAddr);
1764 ASSERT(bulEntry !=
nullptr);
1770 bulEntry->tokenH = homeTest->getHomeKeyGenToken();
1774 simTime() + ie->getProtocolData<Ipv6InterfaceData>()->_getMaxTokenLifeTime());
Referenced by processMobilityMessage().
◆ processMobilityMessage()
| void inet::xMIPv6::processMobilityMessage |
( |
Packet * |
inPacket | ) |
|
|
protected |
This is where all the mobility messages are sifted through and sent to appropriate functions for processing.
189 const auto& mipv6Msg = inPacket->peekAtFront<MobilityHeader>();
191 EV_INFO <<
"Processing of MIPv6 related mobility message" << endl;
193 if (
const auto& bu = dynamicPtrCast<const BindingUpdate>(mipv6Msg)) {
194 EV_INFO <<
"Message recognised as BINDING UPDATE (BU)" << endl;
198 else if (
const auto& ba = dynamicPtrCast<const BindingAcknowledgement>(mipv6Msg)) {
199 EV_INFO <<
"Message recognised as BINDING ACKNOWLEDGEMENT (BA)" << endl;
204 else if (
const auto& hoti = dynamicPtrCast<const HomeTestInit>(mipv6Msg)) {
205 EV_INFO <<
"Message recognised as HOME TEST INIT (HoTI)" << endl;
208 else if (
const auto& coti = dynamicPtrCast<const CareOfTestInit>(mipv6Msg)) {
209 EV_INFO <<
"Message recognised as CARE-OF TEST INIT (CoTI)" << endl;
212 else if (
const auto& ht = dynamicPtrCast<const HomeTest>(mipv6Msg)) {
213 EV_INFO <<
"Message recognised as HOME TEST (HoT)" << endl;
216 else if (
const auto& cot = dynamicPtrCast<const CareOfTest>(mipv6Msg)) {
217 EV_INFO <<
"Message recognised as CARE-OF TEST (CoT)" << endl;
220 else if (
const auto& brr = dynamicPtrCast<const BindingRefreshRequest>(mipv6Msg)) {
221 EV_INFO <<
"Message recognised as Binding Refresh Request" << endl;
225 EV_WARN <<
"Unrecognised mobility message... Dropping" << endl;
226 PacketDropDetails details;
Referenced by handleMessage().
◆ processType2RH()
Process the Type 2 Routing Header which belongs to the provided datagram.
Swaps the addresses between the original destination address of the datagram and the field in the routing header.
2019 auto ipv6Header = packet->peekAtFront<Ipv6Header>();
2023 PacketDropDetails details;
2030 bool validRH2 =
false;
2031 const Ipv6Address& HoA = rh->getAddress(0);
2045 if (rh->getSegmentsLeft() != 1) {
2046 EV_WARN <<
"Invalid RH2 - segments left field must be 1. Dropping packet." << endl;
2047 PacketDropDetails details;
2060 if (
rt6->isHomeAddress(HoA)) {
2065 ipv6Header =
nullptr;
2066 packet->trimFront();
2067 auto newIpv6Header = packet->removeAtFront<Ipv6Header>();
2068 newIpv6Header->setDestAddress(HoA);
2076 EV_WARN <<
"Invalid RH2 - not a HoA. Dropping packet." << endl;
2079 packet->setContextPointer(
nullptr);
2082 EV_INFO <<
"Valid RH2 - copied address from RH2 to datagram" << endl;
2083 send(packet,
"toIPv6");
2086 PacketDropDetails details;
Referenced by handleMessage().
◆ removeCoAEntries()
| void inet::xMIPv6::removeCoAEntries |
( |
| ) |
|
|
protected |
Remove all entries from the interfaceCoAList.
2372 EV_DEBUG <<
"Cancelling timers for ifID=" << elem.first <<
" and CoA=" << elem.second << endl;
Referenced by processBAMessage().
◆ removeTimerEntries()
| void inet::xMIPv6::removeTimerEntries |
( |
const Ipv6Address & |
dest, |
|
|
int |
interfaceId |
|
) |
| |
|
protected |
Removes timers of all types for the specified destination address and interfaceId.
Whenever a new mobility related timer is added, is MUST be added within this method to ensure proper removal.
2313 if (
rt6->isMobileNode()) {
2330 else if (
rt6->isHomeAgent()) {
Referenced by handleBULExpiry(), processBAMessage(), and returningHome().
◆ resetBUIfEntry()
| void inet::xMIPv6::resetBUIfEntry |
( |
const Ipv6Address & |
dest, |
|
|
int |
interfaceID, |
|
|
simtime_t |
retransmissionTime |
|
) |
| |
|
protected |
Cancels the current existing timer and reschedules it with initial values.
Similiar to the other resetTestInitIfEntry() method, but this one searches for the appropriate transmission structure first as the interfaceID is not known but needed as lookup key. Reset the transmission structure for a BU and reschedule it for the provided time.
1665 TimerIfEntry *entry = (pos->second);
1669 entry->ackTimeout = entry->ifEntry->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeout();
1672 entry->nextScheduledTime = retransmissionTime;
1673 rescheduleAt(entry->nextScheduledTime, entry->timer);
1675 EV_INFO <<
"Updated BuTransmitIfEntry and corresponding timer.\n";
◆ returningHome()
This method destroys all tunnels associated to the previous CoA and sends appropriate BU(s) to HA and CN(s).
This method destroys the HA tunnel associated to the previous CoA and sends an appropriate BU to the HA.
275 EV_INFO <<
"MIPv6 Returning home procedure..." << endl;
281 const Ipv6Address& HA = ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress();
298 BindingUpdateList::BindingUpdateListEntry *bulEntry =
bul->lookup(cn);
299 ASSERT(bulEntry !=
nullptr);
306 tunneling->destroyTunnelForExitAndTrigger(ie->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress(), *(
itCNList));
◆ searchTimerIfEntry()
Searches for a transmitEntry with the given destination address which is of type timerType.
Returns nullptr if no such entry exists.
2304 if (elem.first.type == timerType && elem.first.dest == dest)
◆ sendBUtoCN()
◆ sendMobilityMessageToIPv6Module()
◆ sendPeriodicBRR()
| void inet::xMIPv6::sendPeriodicBRR |
( |
cMessage * |
msg | ) |
|
|
protected |
Handles a fired BRR message transmission structure.
Creates and sends and appropriate Binding Refresh Request. Transmission structure is rescheduled afterwards.
2427 EV_INFO <<
"\n<<====== Periodic BRR MESSAGE at time: " << simTime() <<
" seconds =====>>\n";
2428 BrTransmitIfEntry *brIfEntry = (BrTransmitIfEntry *)msg->getContextPointer();
2429 NetworkInterface *ie = brIfEntry->ifEntry;
2430 Ipv6Address& brDest = brIfEntry->dest;
2438 brIfEntry->retries++;
Referenced by handleMessage().
◆ sendPeriodicBU()
| void inet::xMIPv6::sendPeriodicBU |
( |
cMessage * |
msg | ) |
|
|
protected |
This method is called when the timer created in createBUTimer() has fired.
The BU is created and the appropriate method for sending it called. The timer structure is updated and rescheduled.
401 EV_INFO <<
"Sending periodic BU message at time: " << simTime() <<
" seconds." << endl;
402 BuTransmitIfEntry *buIfEntry = (BuTransmitIfEntry *)msg->getContextPointer();
404 NetworkInterface *ie = buIfEntry->ifEntry;
405 Ipv6Address& buDest = buIfEntry->dest;
406 buIfEntry->presentSentTimeBU = simTime();
408 buIfEntry->nextScheduledTime = buIfEntry->presentSentTimeBU + buIfEntry->ackTimeout;
413 buIfEntry->ackTimeout = (buIfEntry->ackTimeout) * 2;
419 buIfEntry->buSequenceNumber = (buIfEntry->buSequenceNumber + 1) % 65536;
423 if (!buIfEntry->homeRegistration) {
424 Ipv6Address CoA =
bul->getCoA(buDest);
429 int bindingAuthorizationData =
bul->generateBAuthData(buDest, CoA);
430 createAndSendBUMessage(buDest, ie, buIfEntry->buSequenceNumber, buIfEntry->lifeTime, bindingAuthorizationData);
448 if (!(buIfEntry->ackTimeout < ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout())) {
449 EV_DETAIL <<
"Crossed maximum BINDACK timeout...resetting to predefined maximum." << endl;
452 buIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout();
458 EV_DETAIL <<
"Present Sent Time: " << buIfEntry->presentSentTimeBU <<
", Present TimeOut: " << buIfEntry->ackTimeout << endl;
459 EV_DETAIL <<
"Next Sent Time: " << buIfEntry->nextScheduledTime << endl;
460 scheduleAt(buIfEntry->nextScheduledTime, msg);
Referenced by handleMessage().
◆ sendTestInit()
| void inet::xMIPv6::sendTestInit |
( |
cMessage * |
msg | ) |
|
|
protected |
If a TestInit timer was fired, this method gets called.
The message is sent and the Binding Update List accordingly updated. Afterwards the transmission timer is rescheduled.
1504 TestInitTransmitIfEntry *tiIfEntry = (TestInitTransmitIfEntry *)msg->getContextPointer();
1505 NetworkInterface *ie = tiIfEntry->ifEntry;
1525 if (
auto homeTestInit = dynamicPtrCast<HomeTestInit>(tiIfEntry->testInitMsg)) {
1527 Ipv6Address HoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::HoA);
1528 ASSERT(!HoA.isUnspecified());
1530 auto outPacket =
new Packet(
"HoTI");
1533 bul->addOrUpdateBUL(tiIfEntry->dest, HoA, simTime(), homeTestInit->getHomeInitCookie(),
true);
1535 bul->resetHomeToken(tiIfEntry->dest, HoA);
1537 outPacket->insertAtFront(homeTestInit);
1545 auto careOfTestInit =
CHK(dynamicPtrCast<CareOfTestInit>(tiIfEntry->testInitMsg));
1547 Ipv6Address CoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA);
1548 ASSERT(!CoA.isUnspecified());
1550 auto outPacket =
new Packet(
"CoTI");
1553 bul->addOrUpdateBUL(tiIfEntry->dest, CoA, simTime(), careOfTestInit->getCareOfInitCookie(),
false);
1555 bul->resetCareOfToken(tiIfEntry->dest, CoA);
1557 outPacket->insertAtFront(careOfTestInit);
1568 tiIfEntry->nextScheduledTime = tiIfEntry->ackTimeout + simTime();
1576 tiIfEntry->ackTimeout = tiIfEntry->ackTimeout * 2;
1577 if (!(tiIfEntry->ackTimeout < ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout()))
1578 tiIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout();
1580 msg->setContextPointer(tiIfEntry);
1581 scheduleAt(tiIfEntry->nextScheduledTime, msg);
1583 EV_INFO <<
"Scheduled next HoTI/CoTI for time=" << tiIfEntry->nextScheduledTime
1584 <<
" with timeout=" << tiIfEntry->ackTimeout <<
" for dest="
1585 << tiIfEntry->dest << endl;
Referenced by handleMessage().
◆ triggerRouteOptimization()
The following method is used for triggering RO to a CN.
Alain Tigyo, 21.03.2008 The following code is used for triggering RO to a CN.
1358 if (vIndex >
ift->getNumInterfaces()) {
1359 EV_INFO <<
"Route Optimization for: " << destAddress <<
" already triggered";
1363 if ((
bul->getCoA(destAddress) != ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA))
1368 EV_INFO <<
" ...moved to new network. Initializing RO.";
1374 if ((!
bul->isInBindingUpdateList(destAddress, HoA))
1377 EV_INFO <<
"Initialise Route Optimization for: " << destAddress <<
"\n";
1381 cnList.push_back(destAddress);
Referenced by inet::Ipv6Tunneling::decapsulateDatagram(), and processBAMessage().
◆ updateBUL()
Update the an entry of the BUL with the provided parameters.
589 uint buLife = 4 * bu->getLifetime();
590 uint buSeq = bu->getSequence();
592 Ipv6Address HoA = bu->getHomeAddressMN();
597 if (buIfEntry ==
nullptr) {
598 EV_WARN <<
"No scheduled BU entry available!\n";
606 bul->addOrUpdateBUL(dest, HoA, CoA, buLife, buSeq, sendTime);
Referenced by createAndSendBUMessage().
◆ validateBAck()
Validates a Binding Acknowledgement for a mobile node.
1325 Ipv6Address cnAddress = packet->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1326 auto ifTag = packet->getTag<InterfaceInd>();
1327 NetworkInterface *ie =
ift->getInterfaceById(ifTag->getInterfaceId());
1329 if (cnAddress != ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress()) {
1331 EV_WARN <<
"BA Validation Failed: Binding Authorization Data invalid !" << endl;
1339 if (
bul->getSequenceNumber(cnAddress) != ba.getSequenceNumber()) {
1340 EV_WARN <<
"BA Validation Failed: Sequence number from BA does not match the one from the BUL!!\n";
Referenced by processBAMessage().
◆ validateBUderegisterMessage()
| bool inet::xMIPv6::validateBUderegisterMessage |
( |
Packet * |
inPacket, |
|
|
const Ptr< const BindingUpdate > & |
bu |
|
) |
| |
|
protected |
Similiar to validateBUMessage().
However, this one is used only by HA to verify deregistration BU.
1052 return bc->isInBindingCache(bu->getHomeAddressMN())
1053 &&
bc->getHomeRegistration(bu->getHomeAddressMN());
Referenced by processBUMessage().
◆ validateBUMessage()
| bool inet::xMIPv6::validateBUMessage |
( |
Packet * |
inPacket, |
|
|
const Ptr< const BindingUpdate > & |
bu |
|
) |
| |
|
protected |
Validate a BU - only applicable to HAs and CNs.
944 auto ifTag = packet->getTag<InterfaceInd>();
947 EV_INFO <<
"\n<<<<<<<<<ROUTINE WHERE BU GETS VALIDATED>>>>>>>>>>>>>>><<\n";
949 Ipv6Address src = packet->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
950 Ipv6Address homeAddress = bu->getHomeAddressMN();
951 uint seqNumber = bu->getSequence();
952 uint bcSeqNumber =
bc->readBCSequenceNumber(homeAddress);
955 if (!(src.isGlobal() && src.isUnicast())) {
956 EV_WARN <<
"BU Validation Failed: SrcAdress is not unicast Global !" << endl;
957 EV_WARN <<
"Dropping unvalidated BU message" << endl;
958 bubble(
"!! BU Validation Failed !!");
961 if (!(homeAddress.isGlobal() && homeAddress.isUnicast())) {
962 EV_WARN <<
"BU Validation Failed: Home Adress of MN is not unicast Global !" << endl;
963 bubble(
"!! BU Validation Failed !!");
964 EV_WARN <<
"Dropping unvalidated BU message" << endl;
973 else if (((bcSeqNumber % 65536) > seqNumber) || ((32768 + bcSeqNumber) % 65536 < seqNumber)) {
974 EV_WARN <<
"BU Validation Failed: Received Seq#: " << seqNumber <<
" is LESS THAN in BC: "
975 << bcSeqNumber << endl;
976 bubble(
"!! BU Validation Failed !!");
977 EV_WARN <<
"Dropping unvalidated BU message" << endl;
985 Ipv6Address destAddress = packet->getTag<
L3AddressInd>()->getDestAddress().toIpv6();
987 bu->getBindingAuthorizationData(), bcSeqNumber, 0);
993 if (!bu->getHomeRegistrationFlag()) {
994 if (
bc->getHomeRegistration(homeAddress) != bu->getHomeRegistrationFlag()) {
1002 EV_WARN <<
"BU Validation Failed: home registration flag in binding cache has different value than in the binding update" << endl;
1004 bu->getBindingAuthorizationData(), bcSeqNumber, 0);
1009 int homeToken =
bc->generateHomeToken(homeAddress, 0);
1010 int careOfToken =
bc->generateCareOfToken(src, 0);
1011 int bindAuthData =
bc->generateKey(homeToken, careOfToken, src);
1013 if (bu->getLifetime() == 0) {
1014 EV_DETAIL <<
"homeToken=" << homeToken <<
", careOfToken=" << careOfToken
1015 <<
" , bindAuthData=" << bindAuthData
1016 <<
", BU data=" << bu->getBindingAuthorizationData() << endl;
1018 if ((bu->getBindingAuthorizationData() != bindAuthData)
1019 && (bu->getBindingAuthorizationData() != homeToken))
1021 EV_WARN <<
"BU Validation Failed: Binding Authorization Data invalid!" << endl;
1026 if (bu->getBindingAuthorizationData() != bindAuthData) {
1027 EV_WARN <<
"BU Validation Failed: Binding Authorization Data invalid!" << endl;
1034 EV_INFO <<
"BU validation passed" << endl;
1037 bubble(
"BU Validated");
Referenced by processBUMessage().
◆ validateCoTMessage()
| bool inet::xMIPv6::validateCoTMessage |
( |
Packet * |
inPacket, |
|
|
const CareOfTest & |
CoT |
|
) |
| |
|
protected |
Like validateHoTMessage(), but related to CoT.
1888 Ipv6Address srcAddr = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1889 Ipv6Address destAddr = inPacket->getTag<
L3AddressInd>()->getDestAddress().toIpv6();
1890 auto ifTag = inPacket->getTag<InterfaceInd>();
1891 int interfaceID = ifTag->getInterfaceId();
1897 BindingUpdateList::BindingUpdateListEntry *bulEntry =
bul->lookup(srcAddr);
1898 if (bulEntry ==
nullptr) {
1899 EV_WARN <<
"Invalid CoT: No entry in BUL" << endl;
1903 if (bulEntry->sentHoTI == 0 && bulEntry->sentCoTI == 0) {
1904 EV_WARN <<
"Invalid CoT: No RR procedure initialized for this CN." << endl;
1919 NetworkInterface *ie =
ift->getInterfaceById(interfaceID);
1920 if (destAddr != ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA)) {
1921 EV_WARN <<
"Invalid CoT: CoA not valid anymore." << endl;
1927 if (bulEntry->cookieCoTI != (
int)CoT.getCareOfInitCookie()) {
1928 EV_WARN <<
"Invalid CoT: Cookie value different from the stored one." << endl;
Referenced by processCoTMessage().
◆ validateHoTMessage()
| bool inet::xMIPv6::validateHoTMessage |
( |
Packet * |
inPacket, |
|
|
const HomeTest & |
HoT |
|
) |
| |
|
protected |
Verifies a HoT according to the RFC, Section 11.6.2.
1791 Ipv6Address srcAddr = inPacket->getTag<
L3AddressInd>()->getSrcAddress().toIpv6();
1792 Ipv6Address destAddr = inPacket->getTag<
L3AddressInd>()->getDestAddress().toIpv6();
1799 BindingUpdateList::BindingUpdateListEntry *bulEntry =
bul->lookup(srcAddr);
1800 if (bulEntry ==
nullptr) {
1801 EV_WARN <<
"Invalid HoT: No entry in BUL" << endl;
1819 if (!
rt6->isHomeAddress(destAddr)) {
1820 EV_WARN <<
"Invalid HoT: Destination Address not HoA." << endl;
1826 if (bulEntry->cookieHoTI != (
int)homeTest.getHomeInitCookie()) {
1827 EV_WARN <<
"Invalid HoT: Cookie value different from the stored one." << endl;
Referenced by processHoTMessage().
◆ validateType2RH()
Perform validity checks according to RFC 3775 - Section 6.4.
2097 if (rh.getAddressArraySize() != 1) {
2098 EV_WARN <<
"Invalid RH2 header: no HoA provided!" << endl;
2102 Ipv6Address CoA = ipv6Header.getSrcAddress();
2103 Ipv6Address HoA = rh.getAddress(0);
2107 if (!HoA.isUnicast()) {
2108 EV_WARN <<
"Invalid RH2 header: address in RH2 is not a unicast routable address!" << endl;
2114 if (HoA.getScope() < CoA.getScope()) {
2115 EV_WARN <<
"Invalid RH2 header: scope of Address in RH2 is smaller than the source address of the datagram!" << endl;
Referenced by processType2RH().
◆ bc
◆ bul
Referenced by checkForBUtoCN(), createBUTimer(), handleBULExpiry(), handleTokenExpiry(), initialize(), initiateMipv6Protocol(), initReturnRoutability(), processBAMessage(), processBRRMessage(), processCoTMessage(), processHoTMessage(), returningHome(), sendPeriodicBU(), sendTestInit(), triggerRouteOptimization(), updateBUL(), validateBAck(), validateCoTMessage(), and validateHoTMessage().
◆ cnList
◆ ift
Referenced by cancelEntries(), createAndSendBAMessage(), initialize(), processBAMessage(), processBRRMessage(), processBUMessage(), processCoTMessage(), processHoTMessage(), triggerRouteOptimization(), validateBAck(), and validateCoTMessage().
◆ interfaceCoAList
◆ ipv6nd
◆ itCNList
| CnList::iterator inet::xMIPv6::itCNList |
|
protected |
◆ rt6
◆ statVectorBAfromCN
| cOutVector inet::xMIPv6::statVectorBAfromCN |
|
protected |
◆ statVectorBAfromHA
| cOutVector inet::xMIPv6::statVectorBAfromHA |
|
protected |
◆ statVectorBAtoMN
| cOutVector inet::xMIPv6::statVectorBAtoMN |
|
protected |
◆ statVectorBUtoCN
| cOutVector inet::xMIPv6::statVectorBUtoCN |
|
protected |
◆ statVectorBUtoHA
| cOutVector inet::xMIPv6::statVectorBUtoHA |
|
protected |
◆ statVectorBUtoMN
| cOutVector inet::xMIPv6::statVectorBUtoMN |
|
protected |
◆ statVectorCoTfromCN
| cOutVector inet::xMIPv6::statVectorCoTfromCN |
|
protected |
◆ statVectorCoTItoCN
| cOutVector inet::xMIPv6::statVectorCoTItoCN |
|
protected |
◆ statVectorCoTtoMN
| cOutVector inet::xMIPv6::statVectorCoTtoMN |
|
protected |
◆ statVectorHoTfromCN
| cOutVector inet::xMIPv6::statVectorHoTfromCN |
|
protected |
◆ statVectorHoTItoCN
| cOutVector inet::xMIPv6::statVectorHoTItoCN |
|
protected |
◆ statVectorHoTtoMN
| cOutVector inet::xMIPv6::statVectorHoTtoMN |
|
protected |
◆ transmitIfList
◆ tunneling
The documentation for this class was generated from the following files:
@ EXPIRED_CARE_OF_NONCE_INDEX
Definition: MobilityHeader_m.h:235
#define CHK(x)
Definition: INETDefs.h:87
void removeCoAEntries()
Remove all entries from the interfaceCoAList.
Definition: xMIPv6.cc:2368
#define MK_BUL_EXPIRY
Definition: xMIPv6.cc:38
void createBUTimer(const Ipv6Address &buDest, NetworkInterface *ie, const uint lifeTime, bool homeRegistration)
This method finally creates the timer structure and schedules the message for sending.
Definition: xMIPv6.cc:354
bool validateBUMessage(Packet *inPacket, const Ptr< const BindingUpdate > &bu)
Validate a BU - only applicable to HAs and CNs.
Definition: xMIPv6.cc:942
@ CARE_OF_TEST
Definition: MobilityHeader_m.h:80
void sendPeriodicBU(cMessage *msg)
This method is called when the timer created in createBUTimer() has fired.
Definition: xMIPv6.cc:399
@ CARE_OF_TEST_INIT
Definition: MobilityHeader_m.h:78
void createAndSendCoTIMessage(const Ipv6Address &cnDest, NetworkInterface *ie)
Creates and sends a CoTI message to the specified destination.
Definition: xMIPv6.cc:1689
@ RR_COMPLETE
Definition: BindingUpdateList.h:42
void processCoTIMessage(Packet *inPacket, const Ptr< const CareOfTestInit > &CoTI)
Create and send a CoT message.
Definition: xMIPv6.cc:1724
@ NONE
Definition: BindingUpdateList.h:40
@ BINDING_UPDATE_ACCEPTED
Definition: MobilityHeader_m.h:224
@ BINDING_ERROR
Definition: MobilityHeader_m.h:83
@ REGISTRATION_TYPE_CHANGE_DISALLOWED
Definition: MobilityHeader_m.h:237
TimerIfEntry * getTimerIfEntry(Key &key, int timerType)
Returns a pointer to an TimerIfEntry object identified by the provided key, which can be one of the p...
Definition: xMIPv6.cc:2224
bool checkForBUtoCN(BindingUpdateList::BindingUpdateListEntry &bulEntry, NetworkInterface *ie)
Send a BU depending on current status of:
Definition: xMIPv6.cc:1936
#define TRANSMIT_TYPE_BU
Definition: xMIPv6.h:44
bool cancelTimerIfEntry(const Ipv6Address &dest, int interfaceID, int msgType)
Deletes the appropriate entry from the transmitIfList and cancels the corresponding retransmission ti...
Definition: xMIPv6.cc:2192
@ NOT_HA_FOR_THIS_MN
Definition: MobilityHeader_m.h:231
void createAndSendBEMessage(const Ipv6Address &dest, const BeStatus &beStatus)
Creates and sends Binding Error message.
Definition: xMIPv6.cc:2176
static const Protocol ipv6
Definition: Protocol.h:94
xMIPv6::BuTransmitIfEntry * fetchBUTransmitIfEntry(NetworkInterface *ie, const Ipv6Address &dest)
This method takes an interface and a destination address and returns the appropriate IfEntry for an B...
Definition: xMIPv6.cc:610
@ MOBILITY
Definition: Ipv6Tunneling.h:47
bool validateHoTMessage(Packet *inPacket, const HomeTest &HoT)
Verifies a HoT according to the RFC, Section 11.6.2.
Definition: xMIPv6.cc:1788
void sendBUtoCN(BindingUpdateList::BindingUpdateListEntry &bulEntry, NetworkInterface *ie)
Creates a timer for sending a BU.
Definition: xMIPv6.cc:1995
void processHoTIMessage(Packet *inPacket, const Ptr< const HomeTestInit > &HoTI)
Create and send a HoT message.
Definition: xMIPv6.cc:1700
opp_component_ptr< Ipv6RoutingTable > rt6
Definition: xMIPv6.h:62
@ BINDING_REFRESH_REQUEST
Definition: MobilityHeader_m.h:76
#define SIZE_BE
Definition: xMIPv6.cc:58
#define BRR_TIMEOUT_THRESHOLD
Definition: xMIPv6.cc:41
void handleTokenExpiry(cMessage *msg)
Handles the event that indicates that a {care-of,home} keygen token has expired.
Definition: xMIPv6.cc:2677
void createTokenEntryExpiryTimer(Ipv6Address &cnAddr, NetworkInterface *ie, simtime_t scheduledTime, int tokenType)
Creates or overwrites a timer for {home, care-of} keygen token expiry that fires at provided schedule...
Definition: xMIPv6.cc:2656
void handleBULExpiry(cMessage *msg)
Handles the situation of a BUL expiry.
Definition: xMIPv6.cc:2543
bool validateType2RH(const Ipv6Header &ipv6Header, const Ipv6RoutingHeader &rh)
Perform validity checks according to RFC 3775 - Section 6.4.
Definition: xMIPv6.cc:2093
InterfaceCoAList interfaceCoAList
Definition: xMIPv6.h:120
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
#define MK_TOKEN_EXPIRY
Definition: xMIPv6.cc:40
TransmitIfList transmitIfList
Definition: xMIPv6.h:116
#define EXPIRY_TYPE_BUL
Definition: xMIPv6.h:47
#define CO_COOKIE
Definition: BindingUpdateList.h:28
@ UNKNOWN_BINDING_FOR_HOME_ADDRESS_DEST_OPTION
Definition: MobilityHeader_m.h:315
removed InterfaceReq
Definition: IUdp-gates.txt:11
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
INET_API InitStage INITSTAGE_NETWORK_LAYER
Initialization of network layer protocols.
CnList cnList
Definition: xMIPv6.h:124
#define EXPIRY_TYPE_BC
Definition: xMIPv6.h:48
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
void removeTimerEntries(const Ipv6Address &dest, int interfaceId)
Removes timers of all types for the specified destination address and interfaceId.
Definition: xMIPv6.cc:2311
#define SIZE_MOBILITY_HEADER
Definition: xMIPv6.cc:48
#define HO_COOKIE
Definition: BindingUpdateList.h:26
#define SIZE_BACK
Definition: xMIPv6.cc:52
@ HOME_TEST_INIT
Definition: MobilityHeader_m.h:77
@ T2RH
Definition: Ipv6Tunneling.h:45
void sendTestInit(cMessage *msg)
If a TestInit timer was fired, this method gets called.
Definition: xMIPv6.cc:1501
#define KEY_BC_EXP
Definition: xMIPv6.h:40
simsignal_t mipv6RoCompletedSignal
Definition: Simsignals.cc:66
#define TRANSMIT_TYPE_TI
Definition: xMIPv6.h:45
#define KEY_CI
Definition: xMIPv6.h:37
void createAndSendBAMessage(const Ipv6Address &src, const Ipv6Address &dest, int interfaceId, const BaStatus &baStatus, const uint baSeq, const int bindingAuthorizationData, const uint lifeTime, simtime_t sendTime=0)
Constructs and send a BA to the Ipv6 module.
Definition: xMIPv6.cc:1056
#define SIZE_BIND_AUTH_DATA
Definition: xMIPv6.cc:51
@ RR
Definition: BindingUpdateList.h:41
void insertNetworkProtocolHeader(Packet *packet, const Protocol &protocol, const Ptr< NetworkHeaderBase > &header)
Definition: L3Tools.cc:70
simsignal_t packetDroppedSignal
Definition: Simsignals.cc:85
@ BINDING_ACKNOWLEDGEMENT
Definition: MobilityHeader_m.h:82
void processBRRMessage(Packet *inPacket, const Ptr< const BindingRefreshRequest > &brr)
Processes the Binding Refresh Message.
Definition: xMIPv6.cc:2472
@ EXPIRED_HOME_NONCE_INDEX
Definition: MobilityHeader_m.h:234
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
@ HOME_TEST
Definition: MobilityHeader_m.h:79
void createAndSendHoTIMessage(const Ipv6Address &cnDest, NetworkInterface *ie)
Creates and sends a HoTI message to the specified destination.
Definition: xMIPv6.cc:1678
ModuleRefByPar< Ipv6NeighbourDiscovery > ipv6nd
Definition: xMIPv6.h:66
ModuleRefByPar< BindingCache > bc
Definition: xMIPv6.h:64
void createAndSendBUMessage(const Ipv6Address &dest, NetworkInterface *ie, const uint buSeq, const uint lifeTime, const int bindAuthData=0)
Method for creating and sending a BU by a MN.
Definition: xMIPv6.cc:463
@ NOT_HOME_SUBNET
Definition: MobilityHeader_m.h:230
@ HA_OPT
Definition: Ipv6Tunneling.h:46
intscale< b, 1, 8 > B
Definition: Units.h:1168
void createBULEntryExpiryTimer(BindingUpdateList::BindingUpdateListEntry *entry, NetworkInterface *ie, simtime_t scheduledTime)
Creates or overwrites a timer for BUL expiry that fires at provided scheduledTime.
Definition: xMIPv6.cc:2498
void updateBUL(BindingUpdate *bu, const Ipv6Address &dest, const Ipv6Address &CoA, NetworkInterface *ie, const simtime_t sendTime)
Update the an entry of the BUL with the provided parameters.
Definition: xMIPv6.cc:586
void sendPeriodicBRR(cMessage *msg)
Handles a fired BRR message transmission structure.
Definition: xMIPv6.cc:2425
#define SIZE_HOT
Definition: xMIPv6.cc:56
virtual void triggerRouteOptimization(const Ipv6Address &destAddress, const Ipv6Address &HoA, NetworkInterface *ie)
The following method is used for triggering RO to a CN.
Definition: xMIPv6.cc:1351
void processHoTMessage(Packet *inPacket, const Ptr< const HomeTest > &HoT)
First verifies a received HoT message and sends a BU to the CN if the care-of keygen token is availab...
Definition: xMIPv6.cc:1748
void createDeregisterBUTimer(const Ipv6Address &buDest, NetworkInterface *ie)
Similiar to the previous one, this method creates an BU timer with registration lifetime equal to 0.
Definition: xMIPv6.cc:333
bool contains(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:65
void createBCEntryExpiryTimer(const Ipv6Address &HoA, NetworkInterface *ie, simtime_t scheduledTime)
Creates or overwrites a timer for BC expiry that fires at provided scheduledTime.
Definition: xMIPv6.cc:2608
#define KEY_CTOKEN_EXP
Definition: xMIPv6.h:42
removed HopLimitReq
Definition: IUdp-gates.txt:11
@ REGISTER
Definition: BindingUpdateList.h:43
void createTestInitTimer(const Ptr< MobilityHeader > testInit, const Ipv6Address &dest, NetworkInterface *ie, simtime_t sendTime=0)
Creates and schedules a timer for either a HoTI or a CoTI transmission.
Definition: xMIPv6.cc:1457
#define UNDEFINED_BIND_AUTH_DATA
Definition: BindingUpdateList.h:25
void handleBCExpiry(cMessage *msg)
Handles the expiry of a BC entry.
Definition: xMIPv6.cc:2627
#define SIZE_COT
Definition: xMIPv6.cc:57
@ BINDING_UPDATE
Definition: MobilityHeader_m.h:81
#define MK_SEND_PERIODIC_BU
Definition: xMIPv6.cc:35
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
bool validateBUderegisterMessage(Packet *inPacket, const Ptr< const BindingUpdate > &bu)
Similiar to validateBUMessage().
Definition: xMIPv6.cc:1042
#define PRE_BINDING_EXPIRY
Definition: BindingUpdateList.h:31
#define SIZE_BU
Definition: xMIPv6.cc:49
@ OTHER_PACKET_DROP
Definition: Simsignals_m.h:84
void sendMobilityMessageToIPv6Module(Packet *msg, const Ipv6Address &destAddr, const Ipv6Address &srcAddr=Ipv6Address::UNSPECIFIED_ADDRESS, int interfaceId=-1, simtime_t sendTime=0)
Append tags to the Mobility Messages (BU, BA etc) and send it out to the Ipv6 Module.
Definition: xMIPv6.cc:622
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
#define SIZE_HOTI
Definition: xMIPv6.cc:54
#define SIZE_HOA_OPTION
Definition: xMIPv6.cc:50
void cancelEntries(int interfaceId, Ipv6Address &CoA)
Cancel all timers (TransmitIf entities for HA and CNs) related to the provided interfaceId and CoA.
Definition: xMIPv6.cc:2338
#define MK_SEND_TEST_INIT
Definition: xMIPv6.cc:37
#define KEY_HI
Definition: xMIPv6.h:36
static const Protocol mobileipv6
Definition: Protocol.h:100
ModuleRefByPar< IInterfaceTable > ift
Definition: xMIPv6.h:61
BaStatus
Enum generated from inet/networklayer/xmipv6/MobilityHeader.msg:54 by opp_msgtool.
Definition: MobilityHeader_m.h:223
@ DEREGISTER
Definition: BindingUpdateList.h:45
#define KEY_BUL_EXP
Definition: xMIPv6.h:39
void processHoAOpt(Packet *packet, HomeAddressOption *hoaOpt)
Process the Home Address Option which belongs to the provided datagram.
Definition: xMIPv6.cc:2122
#define KEY_BU
Definition: xMIPv6.h:35
ModuleRefByPar< BindingUpdateList > bul
Definition: xMIPv6.h:63
bool validateCoTMessage(Packet *inPacket, const CareOfTest &CoT)
Like validateHoTMessage(), but related to CoT.
Definition: xMIPv6.cc:1885
#define Enter_Method(...)
Definition: SelfDoc.h:71
bool validateBAck(Packet *inPacket, const BindingAcknowledgement &ba)
Validates a Binding Acknowledgement for a mobile node.
Definition: xMIPv6.cc:1313
@ NORMAL
Definition: Ipv6Tunneling.h:44
void createCareOfTokenEntryExpiryTimer(Ipv6Address &cnAddr, NetworkInterface *ie, simtime_t scheduledTime)
Creates or overwrites a timer for care-of keygen token expiry that fires at provided scheduledTime.
Definition: xMIPv6.h:512
void createAndSendBRRMessage(const Ipv6Address &dest, NetworkInterface *ie)
Creates a Binding Refresh Request and sends it to the Ipv6 module.
Definition: xMIPv6.cc:2451
void createHomeTokenEntryExpiryTimer(Ipv6Address &cnAddr, NetworkInterface *ie, simtime_t scheduledTime)
Creates or overwrites a timer for home keygen token expiry that fires at provided scheduledTime.
Definition: xMIPv6.h:504
#define SIZE_NONCE_INDICES
Definition: xMIPv6.cc:53
void processCoTMessage(Packet *inPacket, const Ptr< const CareOfTest > &CoT)
Like processHoTMessage(), but related to CoT.
Definition: xMIPv6.cc:1835
@ HOME_REGISTRATION_NOT_SUPPORTED
Definition: MobilityHeader_m.h:229
void processBAMessage(Packet *inPacket, const Ptr< const BindingAcknowledgement > &ba)
Processes the received BA and creates tunnels or mobility header paths if appropriate.
Definition: xMIPv6.cc:1124
void * Key
Definition: Macho.h:327
#define KEY_HTOKEN_EXP
Definition: xMIPv6.h:41
ModuleRefByPar< Ipv6Tunneling > tunneling
Definition: xMIPv6.h:65
unsigned int uint
Definition: INETDefs.h:55
void processMobilityMessage(Packet *inPacket)
This is where all the mobility messages are sifted through and sent to appropriate functions for proc...
Definition: xMIPv6.cc:187
CnList::iterator itCNList
Definition: xMIPv6.h:125
#define KEY_BR
Definition: xMIPv6.h:38
void processBUMessage(Packet *inPacket, const Ptr< const BindingUpdate > &bu)
Process a BU - only applicable to HAs and CNs.
Definition: xMIPv6.cc:680
void processType2RH(Packet *packet, Ipv6RoutingHeader *rh)
Process the Type 2 Routing Header which belongs to the provided datagram.
Definition: xMIPv6.cc:2017
BeStatus
Enum generated from inet/networklayer/xmipv6/MobilityHeader.msg:86 by opp_msgtool.
Definition: MobilityHeader_m.h:314
virtual void initReturnRoutability(const Ipv6Address &cnDest, NetworkInterface *ie)
Creates HoTI and CoTI messages and sends them to the CN if timers are not already existing.
Definition: xMIPv6.cc:1386
@ REGISTERED
Definition: BindingUpdateList.h:44
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80
@ EXPIRED_NONCES
Definition: MobilityHeader_m.h:236
#define MK_BC_EXPIRY
Definition: xMIPv6.cc:39
#define BRR_RETRIES
Definition: xMIPv6.cc:42
#define MK_SEND_PERIODIC_BR
Definition: xMIPv6.cc:36
#define SIZE_BRR
Definition: xMIPv6.cc:59
#define EXPIRY_TYPE_TOKEN
Definition: xMIPv6.h:50
#define SIZE_COTI
Definition: xMIPv6.cc:55