INET Framework for OMNeT++/OMNEST
inet::xMIPv6 Class Reference

Implements RFC 3775 Mobility Support in Ipv6. More...

#include <xMIPv6.h>

Inheritance diagram for inet::xMIPv6:

Classes

class  BcExpiryIfEntry
 
class  BrTransmitIfEntry
 
class  BulExpiryIfEntry
 
class  BuTransmitIfEntry
 Subclasses for the different timers. More...
 
struct  Key
 
class  TestInitTransmitIfEntry
 
class  TimerIfEntry
 The base class for all other timers that are used for retransmissions. More...
 
class  TokenExpiryIfEntry
 

Public Member Functions

virtual ~xMIPv6 ()
 Destructur. More...
 
void initiateMipv6Protocol (NetworkInterface *ie, const Ipv6Address &CoA)
 Initiates the Mobile IP protocol. More...
 
void returningHome (const Ipv6Address &CoA, NetworkInterface *ie)
 This method destroys all tunnels associated to the previous CoA and sends appropriate BU(s) to HA and CN(s). More...
 
virtual void triggerRouteOptimization (const Ipv6Address &destAddress, const Ipv6Address &HoA, NetworkInterface *ie)
 The following method is used for triggering RO to a CN. More...
 

Protected Types

typedef std::map< Key, TimerIfEntry * > TransmitIfList
 
typedef std::map< int, Ipv6AddressInterfaceCoAList
 holds the tuples of currently available {InterfaceID, CoA} pairs More...
 
typedef std::vector< Ipv6AddressCnList
 

Protected Member Functions

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::BuTransmitIfEntryfetchBUTransmitIfEntry (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...
 
TimerIfEntrygetTimerIfEntry (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...
 
TimerIfEntrysearchTimerIfEntry (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...
 

Protected Attributes

ModuleRefByPar< IInterfaceTableift
 
opp_component_ptr< Ipv6RoutingTablert6
 
ModuleRefByPar< BindingUpdateListbul
 
ModuleRefByPar< BindingCachebc
 
ModuleRefByPar< Ipv6Tunnelingtunneling
 
ModuleRefByPar< Ipv6NeighbourDiscoveryipv6nd
 
cOutVector statVectorBUtoHA
 
cOutVector statVectorBUtoCN
 
cOutVector statVectorBUtoMN
 
cOutVector statVectorBAtoMN
 
cOutVector statVectorBAfromHA
 
cOutVector statVectorBAfromCN
 
cOutVector statVectorHoTItoCN
 
cOutVector statVectorCoTItoCN
 
cOutVector statVectorHoTtoMN
 
cOutVector statVectorCoTtoMN
 
cOutVector statVectorHoTfromCN
 
cOutVector statVectorCoTfromCN
 
TransmitIfList transmitIfList
 
InterfaceCoAList interfaceCoAList
 
CnList cnList
 
CnList::iterator itCNList
 

Private Member Functions

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 scheduledTime. More...
 
void handleTokenExpiry (cMessage *msg)
 Handles the event that indicates that a {care-of,home} keygen token has expired. More...
 

Detailed Description

Implements RFC 3775 Mobility Support in Ipv6.

Member Typedef Documentation

◆ CnList

typedef std::vector<Ipv6Address> inet::xMIPv6::CnList
protected

◆ InterfaceCoAList

typedef std::map<int, Ipv6Address> inet::xMIPv6::InterfaceCoAList
protected

holds the tuples of currently available {InterfaceID, CoA} pairs

◆ TransmitIfList

typedef std::map<Key, TimerIfEntry *> inet::xMIPv6::TransmitIfList
protected

Constructor & Destructor Documentation

◆ ~xMIPv6()

inet::xMIPv6::~xMIPv6 ( )
virtual

Destructur.

Ensures that the memory from the list with all TimerIfEntry's gets properly released.

70 {
71  auto it = transmitIfList.begin();
72 
73  while (it != transmitIfList.end()) {
74  Key key = it->first;
75 
76  // advance pointer to make sure it does not become invalid
77  // after the cancel() call
78  ++it;
79 
80  cancelTimerIfEntry(key.dest, key.interfaceID, key.type);
81  }
82 }

Member Function Documentation

◆ 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

2339 {
2340  NetworkInterface *ie = ift->getInterfaceById(interfaceId);
2341 
2342  // we have to cancel all existing timers
2343 
2344  // ...first for the HA
2345  Ipv6Address HA = ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress();
2346 // Ipv6Address HoA = ie->ipv6()->getMNHomeAddress();
2347 
2348  cancelTimerIfEntry(HA, interfaceId, KEY_BU);
2349  tunneling->destroyTunnel(CoA, HA);
2350 
2351  // ...and then for the CNs
2352  for (auto it = transmitIfList.begin(); it != transmitIfList.end();) {
2353  if ((*it).first.interfaceID == interfaceId) {
2354  auto oldIt = it++;
2355 
2356  // destroy tunnel (if we have a BU entry here)
2357  if ((*oldIt).first.type == KEY_BU)
2358  tunneling->destroyTunnelForEntryAndTrigger(CoA, (*oldIt).first.dest);
2359 
2360  // then cancel the pending event
2361  cancelTimerIfEntry((*oldIt).first.dest, (*oldIt).first.interfaceID, (*oldIt).first.type);
2362  }
2363  else
2364  ++it;
2365  }
2366 }

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.

2193 {
2194  Key key(dest, interfaceID, msgType);
2195  auto pos = transmitIfList.find(key);
2196 
2197  if (pos == transmitIfList.end()) {
2198 // EV << "### No corresponding TimerIfEntry found! ###\n";
2199  return false;
2200  }
2201 
2202  TimerIfEntry *entry = (pos->second);
2203 
2204  cancelAndDelete(entry->timer); // cancels the retransmission timer
2205  entry->timer = nullptr;
2206 
2207  transmitIfList.erase(key); // remove entry from list
2208 
2209  delete entry; // free memory
2210 
2211  EV_DEBUG << "Deleted TimerIfEntry and corresponding timer.\n";
2212 
2213  return true;
2214 }

Referenced by cancelEntries(), createBUTimer(), handleBCExpiry(), handleBULExpiry(), handleTokenExpiry(), processBAMessage(), processBUMessage(), processCoTMessage(), processHoTMessage(), removeTimerEntries(), sendPeriodicBRR(), and ~xMIPv6().

◆ checkForBUtoCN()

bool inet::xMIPv6::checkForBUtoCN ( BindingUpdateList::BindingUpdateListEntry bulEntry,
NetworkInterface ie 
)
protected

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.

1937 {
1938  EV_INFO << "Checking whether a new BU has to be sent to CN." << endl;
1939 
1940  if (bulEntry.state == BindingUpdateList::DEREGISTER) {
1941  // we are supposed to send a deregistration BU
1942 
1943  if (!bul->isValidBinding(bulEntry.destAddress)) {
1944  // no valid binding existing; nothing to do
1945  // TODO cleanup operations?
1946  return false;
1947  }
1948 
1949  // we need a valid home keygen token for deregistration
1950  if (bul->isHomeTokenAvailable(bulEntry.destAddress, ie)) {
1951  sendBUtoCN(bulEntry, ie);
1952  return true;
1953  }
1954  else {
1955  // no token available
1956  // send HoTI
1957  createAndSendHoTIMessage(bulEntry.destAddress, ie);
1958  return false;
1959  }
1960  }
1961  else { // case REGISTER, REGISTERED and anything else
1962  // for a registration BU we need both valid care-of and home keygen tokens
1963  if (!bul->isCareOfTokenAvailable(bulEntry.destAddress, ie)) {
1964  if (bul->recentlySentCOTI(bulEntry.destAddress, ie))
1965  return false;
1966 
1967  createAndSendCoTIMessage(bulEntry.destAddress, ie);
1968  return false;
1969  }
1970 
1971  if (!bul->isHomeTokenAvailable(bulEntry.destAddress, ie)) {
1972  if (bul->recentlySentHOTI(bulEntry.destAddress, ie))
1973  return false;
1974 
1975  createAndSendHoTIMessage(bulEntry.destAddress, ie);
1976  return false;
1977  }
1978 
1979  bulEntry.state = BindingUpdateList::RR_COMPLETE;
1980 
1981  // tokens are available: now we also need the case that the binding is about to expire or we have no valid binding at all
1982  if ((bul->isBindingAboutToExpire(bulEntry.destAddress)
1983  || !bul->isValidBinding(bulEntry.destAddress))
1984  && bulEntry.state != BindingUpdateList::REGISTER
1985  && bulEntry.state != BindingUpdateList::NONE)
1986  {
1987  sendBUtoCN(bulEntry, ie);
1988  return true;
1989  }
1990  else
1991  return false;
1992  }
1993 }

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.

1059 {
1060  EV_TRACE << "Entered createAndSendBAMessage() method" << endl;
1061 
1062  NetworkInterface *ie = ift->getInterfaceById(interfaceId); // To find the interface on which the BU was received
1063 
1064  // swapping src and destination for the ack packet
1065 // Ipv6Address source = ie->ipv6()->linkLocalAddress();
1066 // Ipv6Address destination = src;
1067 // Ipv6Address src = ie ->ipv6()->linkLocalAddress();
1068 
1069  // uncommented the code above - we can use the swapped original src and
1070  // dest from the ctrlInfo as it is provided in the first two arguments
1071 
1072  auto packet = new Packet("Binding Acknowledgement");
1073  const auto& ba = makeShared<BindingAcknowledgement>();
1074  ba->setMobilityHeaderType(BINDING_ACKNOWLEDGEMENT);
1075  ba->setStatus(baStatus);
1076  ba->setSequenceNumber(baSeq); // this sequence number will correspond to the ACKed BU
1077 
1078  // we are providing lifetime as a parameter
1079  ba->setLifetime(lifeTime / 4); /* 6.1.8 ...in time units of 4 seconds... */
1080 
1081  /*9.5.4
1082  If the Status field in the Binding Acknowledgement contains the value
1083  136 (expired home nonce index), 137 (expired care-of nonce index), or
1084  138 (expired nonces) then the message MUST NOT include the Binding
1085  Authorization Data mobility option. Otherwise, the Binding
1086  Authorization Data mobility option MUST be included, and MUST meet
1087  the specific authentication requirements for Binding Acknowledgements
1088  as defined in Section 5.2.*/
1089  if (ba->getStatus() != EXPIRED_HOME_NONCE_INDEX &&
1090  ba->getStatus() != EXPIRED_CARE_OF_NONCE_INDEX &&
1091  ba->getStatus() != EXPIRED_NONCES)
1092  {
1093  ba->setBindingAuthorizationData(bindingAuthorizationData);
1094  }
1095 
1096  // setting message size
1097  int bindAuthSize = 0;
1098 
1099  if (bindingAuthorizationData != UNDEFINED_BIND_AUTH_DATA)
1100  bindAuthSize = SIZE_BIND_AUTH_DATA + 2; // Binding Auth. Data + 6.2.3 PadN = 16 bit
1101 
1102  ba->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_BACK + bindAuthSize));
1103  packet->insertAtFront(ba);
1104 
1105  /*The rules for selecting the Destination IP address (and, if required,
1106  routing header construction) for the Binding Acknowledgement to the
1107  mobile node are the same as in the previous section. When the Status
1108  field in the Binding Acknowledgement is greater than or equal to 128
1109  and the Source Address of the Binding Update is on the home link, the
1110  home agent MUST send it to the mobile node's link layer address
1111  (retrieved either from the Binding Update or through Neighbor
1112  Solicitation).*/
1113  // TODO
1114 
1115  sendMobilityMessageToIPv6Module(packet, dest, src, ie->getInterfaceId(), sendTime);
1116 
1117  // statistic collection
1118  /*if (rt6->isHomeAgent())
1119  statVectorBAtoMN.record(1);
1120  else
1121  statVectorBAtoMN.record(2);*/
1122 }

Referenced by processBUMessage(), and validateBUMessage().

◆ createAndSendBEMessage()

void inet::xMIPv6::createAndSendBEMessage ( const Ipv6Address dest,
const BeStatus beStatus 
)
protected

Creates and sends Binding Error message.

2177 {
2178  EV_TRACE << "\n<<<<<<<<< Entered createAndSendBEMessage() Function>>>>>>>\n";
2179 
2180  auto packet = new Packet("BError");
2181  const auto& be = makeShared<BindingError>();
2182  be->setMobilityHeaderType(BINDING_ERROR);
2183  be->setStatus(beStatus);
2184 
2185  // setting message size
2186  be->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_BE));
2187  packet->insertAtFront(be);
2188 
2189  sendMobilityMessageToIPv6Module(packet, dest);
2190 }

Referenced by processHoAOpt().

◆ createAndSendBRRMessage()

void inet::xMIPv6::createAndSendBRRMessage ( const Ipv6Address dest,
NetworkInterface ie 
)
protected

Creates a Binding Refresh Request and sends it to the Ipv6 module.

2452 {
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>();
2456 
2457  /*6.1.2
2458  The Binding Refresh Request message uses the MH Type value 0. When
2459  this value is indicated in the MH Type field, the format of the
2460  Message Data field in the Mobility Header is as follows:*/
2461  brr->setMobilityHeaderType(BINDING_REFRESH_REQUEST);
2462 
2463  brr->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_BRR));
2464  outPacket->insertAtFront(brr);
2465 
2466  EV_INFO << "\n<<======BRR MESSAGE FORMED; APPENDING CONTROL INFO=====>>\n";
2467  Ipv6Address CoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA);
2468  ASSERT(!CoA.isUnspecified());
2469  sendMobilityMessageToIPv6Module(outPacket, dest, CoA, ie->getInterfaceId());
2470 }

Referenced by sendPeriodicBRR().

◆ createAndSendBUMessage()

void inet::xMIPv6::createAndSendBUMessage ( const Ipv6Address dest,
NetworkInterface ie,
const uint  buSeq,
const uint  lifeTime,
const int  bindAuthData = 0 
)
protected

Method for creating and sending a BU by a MN.

464 {
465  EV_INFO << "Creating and sending Binding Update" << endl;
466  // TODO use the globalAddress(Ipv6InterfaceData::CoA) in the address selection somewhere above (caller)
467  Ipv6Address CoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA); // source address of MN
468 
469  if (CoA.isUnspecified())
470  CoA = ie->getProtocolData<Ipv6InterfaceData>()->getPreferredAddress(); // in case a CoA is not availabile (e.g. returning home)
471 
472  auto packet = new Packet("Binding Update");
473  const auto& bu = makeShared<BindingUpdate>();
474 
475  /*11.7.1
476  To register a care-of address or to extend the lifetime of an
477  existing registration, the mobile node sends a packet to its home
478  agent containing a Binding Update, with the packet constructed as
479  follows:*/
480  /*11.7.2
481  A Binding Update is created as follows:*/
482  bu->setMobilityHeaderType(BINDING_UPDATE);
483 
484  /*11.7.1
485  o The value specified in the Lifetime field MUST be non-zero and
486  SHOULD be less than or equal to the remaining valid lifetime of
487  the home address and the care-of address specified for the
488  binding.*/
489  /*6.1.7
490  Lifetime
491  16-bit unsigned integer. The number of time units remaining
492  before the binding MUST be considered expired. A value of zero
493  indicates that the Binding Cache entry for the mobile node MUST be
494  deleted. (In this case the specified care-of address MUST also be
495  set equal to the home address.) One time unit is 4 seconds.
496  */
497  bu->setLifetime(lifeTime / 4);
498 
499  bu->setSequence(buSeq);
500 
501  /*11.7.1
502  o The Acknowledge (A) bit MUST be set in the Binding Update.*/
503  bu->setAckFlag(true);
504 
505  /*o The Home Registration (H) bit MUST be set in the Binding Update.*/
506  // set flag depending on whether the BU goes to HA or not - CB
507  bu->setHomeRegistrationFlag(dest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress());
508 
509  /*11.7.1
510  o If the mobile node's link-local address has the same interface
511  identifier as the home address for which it is supplying a new
512  care-of address, then the mobile node SHOULD set the Link-Local
513  Address Compatibility (L) bit.
514  o If the home address was generated using RFC 3041 [18], then the
515  link local address is unlikely to have a compatible interface
516  identifier. In this case, the mobile node MUST clear the Link-
517  Local Address Compatibility (L) bit.*/
518  // The link identifiers are always the same in our simulations. As
519  // long as this is not changing, we can stick to the value "true"
520  bu->setLinkLocalAddressCompatibilityFlag(true); // fine for now
521 
522  bu->setKeyManagementFlag(false); // no IKE/IPsec available anyway
523 
524  /*11.7.1
525  o The packet MUST contain a Home Address destination option, giving
526  the mobile node's home address for the binding.*/
527  /*11.7.2
528  o The home address of the mobile node MUST be added to the packet in
529  a Home Address destination option, unless the Source Address is
530  the home address.*/
531  Ipv6Address HoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::HoA);
532  ASSERT(!HoA.isUnspecified());
533 
534  // As every Ipv6 Datagram sending the BU has to have the Home Address Option, I have
535  // made this field a part of BU message to ease my task of simulation...
536  // this can be accessed from the InterfaceTable of the MN.
537  bu->setHomeAddressMN(HoA); // HoA of MN
538 
539  /*11.7.2
540  o The Mobility Header is constructed according to rules in Section
541  6.1.7 and Section 5.2.6, including the Binding Authorization Data
542  (calculated as defined in Section 6.2.7) and possibly the Nonce
543  Indices mobility options.*/
544  bu->setBindingAuthorizationData(bindAuthData); // added for BU to CN
545 
546  int nonceIndicesSize = 0;
547 
548  if (!bu->getHomeRegistrationFlag())
549  nonceIndicesSize = SIZE_NONCE_INDICES;
550 
551  // setting message size
552  int bindAuthSize = 0;
553 
554  if (bindAuthData != UNDEFINED_BIND_AUTH_DATA)
555  bindAuthSize = SIZE_BIND_AUTH_DATA; // (6.2.3 PadN = 16 bit) -> no padding required if nonces provided // TODO check whether nonces valid
556 
557  bu->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_BU + SIZE_HOA_OPTION + bindAuthSize + nonceIndicesSize));
558 
559  /*11.7.1
560  When sending a Binding Update to its home agent, the mobile node MUST
561  also create or update the corresponding Binding Update List entry, as
562  specified in Section 11.7.2.*/
563  updateBUL(bu.get(), dest, CoA, ie, simTime());
564 
565  packet->insertAtFront(bu);
566 
567  /*11.7.1
568  o The care-of address for the binding MUST be used as the Source
569  Address in the packet's Ipv6 header, unless an Alternate Care-of
570  Address mobility option is included in the Binding Update. This
571  option MUST be included in all home registrations, as the ESP
572  protocol will not be able to protect care-of addresses in the Ipv6
573  header. (Mobile Ipv6 implementations that know they are using
574  IPsec AH to protect a particular message might avoid this option.
575  For brevity the usage of AH is not discussed in this document.)*/
576  /*11.7.2
577  o The current care-of address of the mobile node MUST be sent either
578  in the Source Address of the Ipv6 header, or in the Alternate
579  Care-of Address mobility option.
580  o The Destination Address of the Ipv6 header MUST contain the
581  address of the correspondent node.*/
582  sendMobilityMessageToIPv6Module(packet, dest, CoA, ie->getInterfaceId());
583 // sendMobilityMessageToIPv6Module(bu, dest);
584 }

Referenced by sendPeriodicBU().

◆ createAndSendCoTIMessage()

void inet::xMIPv6::createAndSendCoTIMessage ( const Ipv6Address cnDest,
NetworkInterface ie 
)
protected

Creates and sends a CoTI message to the specified destination.

1690 {
1691  const auto& CoTI = makeShared<CareOfTestInit>();
1692  CoTI->setMobilityHeaderType(CARE_OF_TEST_INIT);
1693  CoTI->setCareOfInitCookie(CO_COOKIE);
1694  // setting message size
1695  CoTI->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_COTI));
1696 
1697  createTestInitTimer(CoTI, cnDest, ie);
1698 }

Referenced by checkForBUtoCN(), handleTokenExpiry(), and initReturnRoutability().

◆ createAndSendHoTIMessage()

void inet::xMIPv6::createAndSendHoTIMessage ( const Ipv6Address cnDest,
NetworkInterface ie 
)
protected

Creates and sends a HoTI message to the specified destination.

1679 {
1680  const auto& HoTI = makeShared<HomeTestInit>();
1681  HoTI->setMobilityHeaderType(HOME_TEST_INIT);
1682  HoTI->setHomeInitCookie(HO_COOKIE);
1683  // setting message size
1684  HoTI->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_HOTI));
1685 
1686  createTestInitTimer(HoTI, cnDest, ie);
1687 }

Referenced by checkForBUtoCN(), handleTokenExpiry(), and initReturnRoutability().

◆ createBCEntryExpiryTimer()

void inet::xMIPv6::createBCEntryExpiryTimer ( const Ipv6Address HoA,
NetworkInterface ie,
simtime_t  scheduledTime 
)
protected

Creates or overwrites a timer for BC expiry that fires at provided scheduledTime.

2609 {
2610  cMessage *bcExpiryMsg = new cMessage("BCEntryExpiry", MK_BC_EXPIRY);
2611 
2612  Key key(HoA, ie->getInterfaceId(), KEY_BC_EXP);
2613  // fetch a valid TimerIfEntry obect
2614  BcExpiryIfEntry *bcExpIfEntry = check_and_cast<BcExpiryIfEntry *>(getTimerIfEntry(key, EXPIRY_TYPE_BC));
2615 
2616  bcExpIfEntry->dest = HoA;
2617  bcExpIfEntry->HoA = HoA;
2618  bcExpIfEntry->ifEntry = ie;
2619  bcExpIfEntry->timer = bcExpiryMsg;
2620 
2621  bcExpiryMsg->setContextPointer(bcExpIfEntry); // information in the bulExpIfEntry is required for handler when message fires
2622 
2623  scheduleAt(scheduledTime, bcExpiryMsg);
2624  EV_INFO << "Scheduled BC expiry for time " << scheduledTime << "s" << endl;
2625 }

Referenced by processBUMessage().

◆ createBRRTimer()

void inet::xMIPv6::createBRRTimer ( const Ipv6Address brDest,
NetworkInterface ie,
const uint  scheduledTime 
)
protected

Creates a timer for a Binding Refresh Request message that is going to be fired in scheduledTime seconds.

2381 {
2382  /*9.5.5
2383  If the sender knows that the Binding Cache entry is still in active
2384  use, it MAY send a Binding Refresh Request message to the mobile node
2385  in an attempt to avoid this overhead and latency due to deleting and
2386  recreating the Binding Cache entry. This message is always sent to
2387  the home address of the mobile node.*/
2388 
2389  Enter_Method("createBRRTimer()");
2390 
2391  // check if there already exists a BRTimer entry for this key
2392  Key key(brDest, ie->getInterfaceId(), KEY_BR);
2393  BrTransmitIfEntry *brIfEntry;
2394 
2395  auto pos = transmitIfList.find(key);
2396  if (pos != transmitIfList.end()) {
2397  // there already exists an unACKed retransmission timer for that entry
2398  // -> overwrite the old with the new one
2399  if ((brIfEntry = dynamic_cast<BrTransmitIfEntry *>(pos->second))) {
2400  cancelAndDelete(brIfEntry->timer); // delete the corresponding timer
2401  }
2402  else
2403  throw cRuntimeError("Expected BrTransmitIfEntry* !");
2404  }
2405  else {
2406  // we do not yet have an entry -> create a new one
2407  brIfEntry = new BrTransmitIfEntry();
2408  transmitIfList.insert(std::make_pair(key, brIfEntry));
2409  }
2410 
2411  brIfEntry->dest = brDest;
2412  brIfEntry->ifEntry = ie;
2413  brIfEntry->retries = 0;
2414 
2415  cMessage *brTriggerMsg = new cMessage("sendPeriodicBRR", MK_SEND_PERIODIC_BR);
2416  brIfEntry->timer = brTriggerMsg;
2417  brTriggerMsg->setContextPointer(brIfEntry); // attaching the brIfEntry info corresponding to a particular address ith message
2418 
2419  // Scheduling a message which will trigger a BRR towards brIfEntry->dest
2420  scheduleAfter(scheduledTime, brTriggerMsg);
2421  EV_DETAIL << "\n++++++++++BRR TIMER CREATED FOR SIM TIME: " << simTime() + scheduledTime
2422  << " seconds+++++++++++++++++ \n";
2423 }

◆ createBULEntryExpiryTimer()

void inet::xMIPv6::createBULEntryExpiryTimer ( BindingUpdateList::BindingUpdateListEntry entry,
NetworkInterface ie,
simtime_t  scheduledTime 
)
protected

Creates or overwrites a timer for BUL expiry that fires at provided scheduledTime.

2499 {
2500 // Enter_Method("createBULEntryExpiryTimer()");
2501 // EV << "Creating BUL entry expiry timer for sim time: " << entry->bindingExpiry << " seconds." << endl;
2502  cMessage *bulExpiryMsg = new cMessage("BULEntryExpiry", MK_BUL_EXPIRY);
2503 
2504  // we are able to associate the BUL entry later on based on HoA, CoA and destination (=HA address)
2505  Ipv6Address& HoA = entry->homeAddress;
2506  Ipv6Address& CoA = entry->careOfAddress;
2507  Ipv6Address& HA = entry->destAddress;
2508 
2509  Key key(HA, ie->getInterfaceId(), KEY_BUL_EXP);
2510  // fetch a valid TimerIfEntry obect
2511  BulExpiryIfEntry *bulExpIfEntry = check_and_cast<BulExpiryIfEntry *>(getTimerIfEntry(key, EXPIRY_TYPE_BUL));
2512 
2513  bulExpIfEntry->dest = HA;
2514  bulExpIfEntry->HoA = HoA;
2515  bulExpIfEntry->CoA = CoA;
2516  bulExpIfEntry->ifEntry = ie;
2517  bulExpIfEntry->timer = bulExpiryMsg;
2518 
2519  bulExpiryMsg->setContextPointer(bulExpIfEntry); // information in the bulExpIfEntry is required for handler when message fires
2520 
2521  /*BulExpiryIfEntry* bulExpIfEntry = createBULEntryExpiryTimer(key, HA, HoA, CoA, ie);*/
2522 
2523  scheduleAt(scheduledTime, bulExpiryMsg);
2524  EV_INFO << "Scheduled BUL expiry (" << entry->bindingExpiry << "s) for time " << scheduledTime << "s" << endl;
2525  // WAS SCHEDULED FOR EXPIRY, NOT 2 SECONDS BEFORE!?!?!?
2526 }

Referenced by handleBULExpiry(), and processBAMessage().

◆ createBUTimer() [1/2]

void inet::xMIPv6::createBUTimer ( const Ipv6Address buDest,
NetworkInterface ie 
)
protected
311 {
312  // if we send a new BU we can delete any potential existing BUL expiry timer for this destination
313  cancelTimerIfEntry(buDest, ie->getInterfaceId(), KEY_BUL_EXP);
314 
315  BindingUpdateList::BindingUpdateListEntry *bulEntry = bul->fetch(buDest);
316  ASSERT(bulEntry != nullptr);
317 
318  if (bulEntry->state != BindingUpdateList::DEREGISTER)
319  bulEntry->state = BindingUpdateList::REGISTER;
320 
321  // update lifetime, 14.9.07
322  //if (homeRegistration)
323  if (buDest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress())
324  createBUTimer(buDest, ie, ie->getProtocolData<Ipv6InterfaceData>()->_getMaxHaBindingLifeTime(), true);
325  else {
326  if (bulEntry->state == BindingUpdateList::DEREGISTER)
327  createDeregisterBUTimer(buDest, ie);
328  else
329  createBUTimer(buDest, ie, ie->getProtocolData<Ipv6InterfaceData>()->_getMaxRrBindingLifeTime(), false);
330  }
331 }

◆ createBUTimer() [2/2]

void inet::xMIPv6::createBUTimer ( const Ipv6Address buDest,
NetworkInterface ie,
const uint  lifeTime,
bool  homeRegistration 
)
protected

This method finally creates the timer structure and schedules the message for sending.

356 {
357  Enter_Method("createBUTimer()");
358  EV_INFO << "Creating BU timer at sim time: " << simTime() << " seconds." << endl;
359  cMessage *buTriggerMsg = new cMessage("sendPeriodicBU", MK_SEND_PERIODIC_BU);
360 
361  // check if there already exists a BUTimer entry for this key
362  Key key(buDest, ie->getInterfaceId(), KEY_BU);
363  // fetch a valid TimerIfEntry obect
364  BuTransmitIfEntry *buIfEntry = check_and_cast<BuTransmitIfEntry *>(getTimerIfEntry(key, TRANSMIT_TYPE_BU));
365  // TODO Investigate problem witht he following line. : runtime error because of attempted message rescheduling
366 // cancelAndDelete(buIfEntry->timer);
367 
368  buIfEntry->dest = buDest;
369  buIfEntry->ifEntry = ie;
370  buIfEntry->timer = buTriggerMsg;
371 
372  // retrieve sequence number from BUL
373  // if no entry exists, the method will return 0
374  buIfEntry->buSequenceNumber = bul->getSequenceNumber(buDest); // the sequence number gets initialized and stored here
375 
376  buIfEntry->lifeTime = lifeTime;
377 
378  /*11.8
379  If the mobile node is sending a Binding Update and does not have
380  an existing binding at the home agent, it SHOULD use
381  InitialBindackTimeoutFirstReg (see Section 13) as a value for the
382  initial retransmission timer.*/
383  if (!bul->isInBindingUpdateList(buDest))
384  buIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeoutFirst(); // the backoff constant gets initialised here
385  /*Otherwise, the mobile node should use the specified value of
386  INITIAL_BINDACK_TIMEOUT for the initial retransmission timer.*/
387  else
388  buIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeout(); // if there's an entry in the BUL, use different value
389 
390  buIfEntry->homeRegistration = homeRegistration;
391 
392  buTriggerMsg->setContextPointer(buIfEntry); // attaching the buIfEntry info corresponding to a particular address ith message
393 
394  // send BU now
395 // scheduleAt(buIfEntry->initScheduledBUTime, buTriggerMsg); //Scheduling a message which will trigger a BU towards buIfEntry->dest
396  scheduleAfter(SIMTIME_ZERO, buTriggerMsg); // Scheduling a message which will trigger a BU towards buIfEntry->dest
397 }

Referenced by createBUTimer(), createDeregisterBUTimer(), handleBULExpiry(), initiateMipv6Protocol(), and sendBUtoCN().

◆ createCareOfTokenEntryExpiryTimer()

void inet::xMIPv6::createCareOfTokenEntryExpiryTimer ( Ipv6Address cnAddr,
NetworkInterface ie,
simtime_t  scheduledTime 
)
inlineprotected

Creates or overwrites a timer for care-of keygen token expiry that fires at provided scheduledTime.

513  {
514  createTokenEntryExpiryTimer(cnAddr, ie, scheduledTime, KEY_CTOKEN_EXP);
515  }

Referenced by processCoTMessage().

◆ createDeregisterBUTimer()

void inet::xMIPv6::createDeregisterBUTimer ( const Ipv6Address buDest,
NetworkInterface ie 
)
protected

Similiar to the previous one, this method creates an BU timer with registration lifetime equal to 0.

334 {
335  /*11.5.4
336  The mobile node SHOULD then send a Binding Update to its home agent,
337  to instruct its home agent to no longer intercept or tunnel packets
338  for it. In this home registration, the mobile node MUST set the
339  Acknowledge (A) and Home Registration (H) bits, set the Lifetime
340  field to zero, and set the care-of address for the binding to the
341  mobile node's own home address. The mobile node MUST use its home
342  address as the source address in the Binding Update.*/
343 
344  /*11.7.2
345  If the Binding Update is sent to the correspondent node, requesting
346  the deletion of any existing Binding Cache entry it has for the
347  mobile node, the care-of address is set to the mobile node's home
348  address and the Lifetime field set to zero.*/
349 
350 // createBUTimer(buDest, ie, 0, homeRegistration);
351  createBUTimer(buDest, ie, 0, buDest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress());
352 }

Referenced by createBUTimer(), and returningHome().

◆ createHomeTokenEntryExpiryTimer()

void inet::xMIPv6::createHomeTokenEntryExpiryTimer ( Ipv6Address cnAddr,
NetworkInterface ie,
simtime_t  scheduledTime 
)
inlineprotected

Creates or overwrites a timer for home keygen token expiry that fires at provided scheduledTime.

505  {
506  createTokenEntryExpiryTimer(cnAddr, ie, scheduledTime, KEY_HTOKEN_EXP);
507  }

Referenced by processHoTMessage().

◆ createTestInitTimer()

void inet::xMIPv6::createTestInitTimer ( const Ptr< MobilityHeader testInit,
const Ipv6Address dest,
NetworkInterface ie,
simtime_t  sendTime = 0 
)
protected

Creates and schedules a timer for either a HoTI or a CoTI transmission.

1458 {
1459  EV_DETAIL << "\n++++++++++TEST INIT TIMER CREATED AT SIM TIME: " << simTime()
1460  << " seconds+++++++++++++++++ \n";
1461 
1462  cMessage *testInitTriggerMsg = new cMessage("sendTestInit", MK_SEND_TEST_INIT);
1463 
1464  /*11.8
1465  When the mobile node sends a Mobile Prefix Solicitation, Home Test
1466  Init, Care-of Test Init or Binding Update for which it expects a
1467  response, the mobile node has to determine a value for the initial
1468  retransmission timer:*/
1469  // check if there already exists a testInitTimer entry for this key
1470  int msgType;
1471 
1472  if (dynamicPtrCast<HomeTestInit>(testInit))
1473  msgType = KEY_HI;
1474  else
1475  msgType = KEY_CI;
1476 
1477  // TODO refactor the code below, as it is also used in createBUTimer
1478  Key key(dest, ie->getInterfaceId(), msgType);
1479  // fetch a valid TimerIfEntry object
1480  TestInitTransmitIfEntry *tiIfEntry = check_and_cast<TestInitTransmitIfEntry *>(getTimerIfEntry(key, TRANSMIT_TYPE_TI));
1481 // delete tiIfEntry->testInitMsg;
1482  cancelAndDelete(tiIfEntry->timer);
1483 
1484  tiIfEntry->timer = testInitTriggerMsg;
1485 
1486  tiIfEntry->dest = dest;
1487  tiIfEntry->ifEntry = ie;
1488  tiIfEntry->testInitMsg = testInit;
1489  /*o Otherwise, the mobile node should use the specified value of
1490  INITIAL_BINDACK_TIMEOUT for the initial retransmission timer.*/
1491  tiIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeout();
1492  tiIfEntry->nextScheduledTime = simTime(); // we send the HoTI/CoTI now
1493 
1494  testInitTriggerMsg->setContextPointer(tiIfEntry); // attach the Test Init If Entry to this message
1495 
1496  // scheduling a message which will trigger the Test Init for sendTime seconds
1497  // if not called with a parameter for sendTime, the message will be scheduled for NOW
1498  scheduleAfter(sendTime, testInitTriggerMsg);
1499 }

Referenced by createAndSendCoTIMessage(), and createAndSendHoTIMessage().

◆ createTokenEntryExpiryTimer()

void inet::xMIPv6::createTokenEntryExpiryTimer ( Ipv6Address cnAddr,
NetworkInterface ie,
simtime_t  scheduledTime,
int  tokenType 
)
private

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

2658 {
2659  cMessage *tokenExpiryMsg = new cMessage("TokenEntryExpiry", MK_TOKEN_EXPIRY);
2660 
2661  Key key(cnAddr, ie->getInterfaceId(), tokenType);
2662  // fetch a valid TimerIfEntry obect
2663  TokenExpiryIfEntry *tokenExpIfEntry = check_and_cast<TokenExpiryIfEntry *>(getTimerIfEntry(key, EXPIRY_TYPE_TOKEN));
2664 
2665  tokenExpIfEntry->cnAddr = cnAddr;
2666  tokenExpIfEntry->ifEntry = ie;
2667  tokenExpIfEntry->timer = tokenExpiryMsg;
2668 
2669  tokenExpIfEntry->tokenType = tokenType;
2670 
2671  tokenExpiryMsg->setContextPointer(tokenExpIfEntry);
2672 
2673  scheduleAt(scheduledTime, tokenExpiryMsg);
2674  EV_INFO << "Scheduled token expiry for time " << scheduledTime << "s" << endl;
2675 }

◆ fetchBUTransmitIfEntry()

xMIPv6::BuTransmitIfEntry * inet::xMIPv6::fetchBUTransmitIfEntry ( NetworkInterface ie,
const Ipv6Address dest 
)
protected

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.

611 {
612  // TODO use STL search algorithm
613  for (auto& elem : transmitIfList) {
614  if (BuTransmitIfEntry *buIfEntry = dynamic_cast<BuTransmitIfEntry *>(elem.second)) {
615  if (buIfEntry->ifEntry->getInterfaceId() == ie->getInterfaceId() && buIfEntry->dest == dest)
616  return buIfEntry;
617  }
618  }
619  return nullptr;
620 }

Referenced by updateBUL().

◆ getTimerIfEntry()

xMIPv6::TimerIfEntry * inet::xMIPv6::getTimerIfEntry ( Key key,
int  timerType 
)
protected

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.

2225 {
2226  TimerIfEntry *ifEntry;
2227  auto pos = transmitIfList.find(key);
2228 
2229  if (pos != transmitIfList.end()) {
2230  // there already exists an unACKed retransmission timer for that entry
2231  // -> overwrite the old with the new one
2232  if (TestInitTransmitIfEntry *testInitIfEntry = dynamic_cast<TestInitTransmitIfEntry *>(pos->second)) {
2233  cancelAndDelete(testInitIfEntry->timer); // delete the corresponding timer
2234  testInitIfEntry->testInitMsg = nullptr;
2235 
2236  ifEntry = testInitIfEntry;
2237  }
2238  else if (BuTransmitIfEntry *buIfEntry = dynamic_cast<BuTransmitIfEntry *>(pos->second)) {
2239  cancelAndDelete(buIfEntry->timer); // delete the corresponding timer
2240 
2241  ifEntry = buIfEntry;
2242  }
2243  else if (BulExpiryIfEntry *bulExpIfEntry = dynamic_cast<BulExpiryIfEntry *>(pos->second)) {
2244  cancelAndDelete(bulExpIfEntry->timer); // delete the corresponding timer
2245 
2246  ifEntry = bulExpIfEntry;
2247  }
2248  else if (BcExpiryIfEntry *bcExpIfEntry = dynamic_cast<BcExpiryIfEntry *>(pos->second)) {
2249  cancelAndDelete(bcExpIfEntry->timer); // delete the corresponding timer
2250 
2251  ifEntry = bcExpIfEntry;
2252  }
2253  else if (TokenExpiryIfEntry *tokenExpIfEntry = dynamic_cast<TokenExpiryIfEntry *>(pos->second)) {
2254  cancelAndDelete(tokenExpIfEntry->timer); // delete the corresponding timer
2255  tokenExpIfEntry->timer = nullptr;
2256 
2257  ifEntry = tokenExpIfEntry;
2258  }
2259  else
2260  throw cRuntimeError("Expected a subclass of TimerIfEntry!");
2261 
2262  ifEntry->timer = nullptr;
2263  }
2264  else {
2265  // we do not yet have an entry -> create a new one
2266  switch (timerType) {
2267  case TRANSMIT_TYPE_BU:
2268  ifEntry = new BuTransmitIfEntry();
2269  break;
2270 
2271  case TRANSMIT_TYPE_TI:
2272  ifEntry = new TestInitTransmitIfEntry();
2273  break;
2274 
2275  case EXPIRY_TYPE_BUL:
2276  ifEntry = new BulExpiryIfEntry();
2277  break;
2278 
2279  case EXPIRY_TYPE_BC:
2280  ifEntry = new BcExpiryIfEntry();
2281  break;
2282 
2283  case EXPIRY_TYPE_TOKEN:
2284  ifEntry = new TokenExpiryIfEntry();
2285  break;
2286 
2287  default:
2288  throw cRuntimeError("Expected a valid TimerIfEntry type!");
2289  break;
2290  }
2291 
2292  ifEntry->timer = nullptr;
2293  ifEntry->ifEntry = nullptr;
2294 
2295  transmitIfList.insert(std::make_pair(key, ifEntry));
2296  }
2297 
2298  return ifEntry;
2299 }

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.

2628 {
2629  /*10.3.1
2630  The home agent MAY further decrease the specified lifetime for the
2631  binding, for example based on a local policy. The resulting
2632  lifetime is stored by the home agent in the Binding Cache entry,
2633  and this Binding Cache entry MUST be deleted by the home agent
2634  after the expiration of this lifetime.*/
2635  /*9.5.2
2636  Any Binding Cache entry MUST be deleted after the expiration of its lifetime.*/
2637  EV_INFO << "BC entry has expired - removing entry and associated structures..." << endl;
2638 
2639  BcExpiryIfEntry *bcExpIfEntry = (BcExpiryIfEntry *)msg->getContextPointer(); // detaching the corresponding bulExpIfEntry pointer
2640  ASSERT(bcExpIfEntry != nullptr);
2641 
2642  // remove binding from BC
2643  bc->deleteEntry(bcExpIfEntry->HoA);
2644 
2645  // and remove the tunnel
2646  tunneling->destroyTunnelFromTrigger(bcExpIfEntry->HoA);
2647 
2648  // and remove entry from list
2649  cancelTimerIfEntry(bcExpIfEntry->dest, bcExpIfEntry->ifEntry->getInterfaceId(), KEY_BC_EXP);
2650  // deletion of the message already takes place in the cancelTimerIfEntry(.., KEY_BC_EXP);
2651 
2652  // TODO
2653  // in the future we might send a Binding Refresh Request shortly before the expiration of the BCE
2654 }

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.

2544 {
2545  /*11.7.1
2546  Also, if the mobile node wants the services of the home agent beyond
2547  the current registration period, the mobile node should send a new
2548  Binding Update to it well before the expiration of this period, even
2549  if it is not changing its primary care-of address.*/
2550  BulExpiryIfEntry *bulExpIfEntry = (BulExpiryIfEntry *)msg->getContextPointer(); // detaching the corresponding bulExpIfEntry pointer
2551  ASSERT(bulExpIfEntry != nullptr);
2552 
2553  // we fetch the BUL entry that belongs to this expiration timer
2554  BindingUpdateList::BindingUpdateListEntry *entry = bul->lookup(bulExpIfEntry->dest);
2555  ASSERT(entry != nullptr);
2556 
2557  // A timer usually can appear for two times:
2558  // 1. Entry is shortly before expiration -> send new BU
2559  // 2. Entry expired -> remove
2560  if (simTime() < entry->bindingExpiry) {
2561  EV_INFO << "BUL entry about to expire - creating new BU timer..." << endl;
2562  // we have to store the pointer to the InterfaceIdentifier as the BUL expiry timer
2563  // will be canceled/deleted by createBUTimer(...)
2564  NetworkInterface *ie = bulExpIfEntry->ifEntry;
2565 
2566  // send new BU
2567  // we immediately create a new BU transmission timer for BU to HA
2568  // but we only trigger BU creation for transmission to CN
2569  if (bulExpIfEntry->dest == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress())
2570  createBUTimer(bulExpIfEntry->dest, bulExpIfEntry->ifEntry);
2571  else {
2572  BindingUpdateList::BindingUpdateListEntry *entry = bul->lookup(bulExpIfEntry->dest);
2573  checkForBUtoCN(*entry, ie);
2574  }
2575 
2576  // we reschedule the expiration timer for expiry time
2577  EV_DETAIL << "Resetting expiry timer... " << endl;
2578  createBULEntryExpiryTimer(entry, ie, entry->bindingExpiry);
2579 
2580  // ...and that's it.
2581  // createBUTimer will take care of cancelling/overwriting the current BU timer.
2582  // As soon as we receive a valid BA to this BU the BUL expiry timer will be reset.
2583  }
2584  else {
2585  EV_INFO << "BUL entry has expired - removing entry and associated structures..." << endl;
2586 
2587  // TODO group everything from below in a purgeMobilityState() method
2588 
2589  entry->state = BindingUpdateList::NONE;
2590  // remove binding
2591  bul->removeBinding(bulExpIfEntry->dest);
2592 
2593  // remove all timers
2594  int interfaceID = bulExpIfEntry->ifEntry->getInterfaceId();
2595  removeTimerEntries(bulExpIfEntry->dest, interfaceID);
2596 
2597  // destroy tunnel
2598  tunneling->destroyTunnel(bulExpIfEntry->CoA, bulExpIfEntry->dest);
2599 
2600  // and remove entry from list
2601  cancelTimerIfEntry(bulExpIfEntry->dest, interfaceID, KEY_BUL_EXP);
2602 
2603  // deletion of the message already takes place in the cancelTimerIfEntry(.., KEY_BUL_EXP);
2604 // delete msg;
2605  }
2606 }

Referenced by handleMessage().

◆ handleMessage()

void inet::xMIPv6::handleMessage ( cMessage *  msg)
overrideprotectedvirtual
133 {
134  if (msg->isSelfMessage()) {
135  EV_DETAIL << "Self message received!\n";
136 
137  if (msg->getKind() == MK_SEND_PERIODIC_BU) {
138  EV_DETAIL << "Periodic BU Timeout Message Received\n";
139  sendPeriodicBU(msg);
140  }
141  else if (msg->getKind() == MK_SEND_PERIODIC_BR) {
142  EV_DETAIL << "Periodic BRR Timeout Message Received\n";
143  sendPeriodicBRR(msg);
144  }
145  else if (msg->getKind() == MK_SEND_TEST_INIT) {
146  EV_DETAIL << "HoTI/CoTI Timeout Message Received\n";
147  sendTestInit(msg);
148  }
149  else if (msg->getKind() == MK_BUL_EXPIRY) {
150  EV_DETAIL << "BUL Expiry Timeout Message Received\n";
151  handleBULExpiry(msg);
152  }
153  else if (msg->getKind() == MK_BC_EXPIRY) {
154  EV_DETAIL << "BUL Expiry Timeout Message Received\n";
155  handleBCExpiry(msg);
156  }
157  else if (msg->getKind() == MK_TOKEN_EXPIRY) {
158  EV_DETAIL << "RR token expired" << endl;
159  handleTokenExpiry(msg);
160  }
161  else
162  throw cRuntimeError("Unrecognized Timer"); // stops sim w/ error msg.
163  }
164  // if its a MIPv6 related mobility message
165  else {
166  auto packet = check_and_cast<Packet *>(msg);
167  if (packet->getTag<PacketProtocolTag>()->getProtocol() == &Protocol::mobileipv6) {
168  EV_INFO << " Received MIPv6 related message" << endl;
169  processMobilityMessage(packet);
170  }
171  // CB on 29.08.07
172  // normal datagram with an extension header
173  else if (auto packet = dynamic_cast<Packet *>(msg)) {
174  Ipv6ExtensionHeader *eh = (Ipv6ExtensionHeader *)packet->getContextPointer();
175  if (auto rh = dynamic_cast<Ipv6RoutingHeader *>(eh))
176  processType2RH(packet, rh);
177  else if (auto hao = dynamic_cast<HomeAddressOption *>(eh))
178  processHoAOpt(packet, hao);
179  else
180  throw cRuntimeError("Unknown Extension Header.");
181  }
182  else
183  throw cRuntimeError("Unknown message type received.");
184  }
185 }

◆ handleTokenExpiry()

void inet::xMIPv6::handleTokenExpiry ( cMessage *  msg)
private

Handles the event that indicates that a {care-of,home} keygen token has expired.

2678 {
2679  TokenExpiryIfEntry *tokenExpIfEntry = (TokenExpiryIfEntry *)msg->getContextPointer(); // detaching the corresponding tokenExpIfEntry pointer
2680  ASSERT(tokenExpIfEntry != nullptr);
2681 
2682  if (tokenExpIfEntry->tokenType == KEY_CTOKEN_EXP) {
2683  EV_INFO << "Care-of keygen token for CN=" << tokenExpIfEntry->cnAddr << " expired";
2684  bul->resetCareOfToken(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress());
2685  }
2686  else if (tokenExpIfEntry->tokenType == KEY_HTOKEN_EXP) {
2687  EV_INFO << "Home keygen token for CN=" << tokenExpIfEntry->cnAddr << " expired";
2688  bul->resetHomeToken(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress());
2689  }
2690  else
2691  throw cRuntimeError("Unkown value for tokenType!");
2692 
2693  EV_INFO << "...removed token from BUL." << endl;
2694 
2695  if (bul->getMobilityState(tokenExpIfEntry->cnAddr) == BindingUpdateList::RR_COMPLETE)
2696  bul->setMobilityState(tokenExpIfEntry->cnAddr, BindingUpdateList::RR);
2697 
2698  cancelTimerIfEntry(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry->getInterfaceId(), tokenExpIfEntry->tokenType);
2699 
2700  // and now send a Test Init message to retrieve a new token
2701  if (tokenExpIfEntry->tokenType == KEY_CTOKEN_EXP)
2702  createAndSendCoTIMessage(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry);
2703  else
2704  createAndSendHoTIMessage(tokenExpIfEntry->cnAddr, tokenExpIfEntry->ifEntry);
2705 
2706 // delete msg;
2707 }

Referenced by handleMessage().

◆ initialize()

void inet::xMIPv6::initialize ( int  stage)
overrideprotectedvirtual
85 {
86  cSimpleModule::initialize(stage);
87 
88  if (stage == INITSTAGE_LOCAL) {
89  EV_TRACE << "Initializing xMIPv6 module" << endl;
90 
91  // statistic collection
92  /*statVectorBUtoHA.setName("BU to HA");
93  statVectorBUtoCN.setName("BU to CN");
94  statVectorBUtoMN.setName("BU to MN");
95  statVectorBAtoMN.setName("BA to MN");
96  statVectorBAfromHA.setName("BA from HA");
97  statVectorBAfromCN.setName("BA from CN");
98  statVectorHoTItoCN.setName("HoTI to CN");
99  statVectorCoTItoCN.setName("CoTI to CN");
100  statVectorHoTtoMN.setName("HoT to MN");
101  statVectorCoTtoMN.setName("CoT to MN");
102  statVectorHoTfromCN.setName("HoT from CN");
103  statVectorCoTfromCN.setName("CoT from CN");*/
104 
105  tunneling.reference(this, "ipv6TunnelingModule", true); // access to tunneling module
106 
107  // moved rt6 initialization to here, as we should
108  // set the MIPv6 flag as soon as possible for use
109  // with other modules.
110  cModule *host = getContainingNode(this);
111  rt6 = L3AddressResolver().getIpv6RoutingTableOf(host);
112  rt6->setIsMobileNode(par("isMobileNode"));
113  rt6->setMipv6Support(true);
114  rt6->setIsHomeAgent(par("isHomeAgent"));
115  }
116  else if (stage == INITSTAGE_NETWORK_LAYER) {
117  ift.reference(this, "interfaceTableModule", true);
118  ipv6nd.reference(this, "ipv6NeighbourDiscoveryModule", true);
119 
120  if (rt6->isMobileNode()) {
121  bul.reference(this, "bindingUpdateListModule", true);
122  }
123  else {
124  bc.reference(this, "bindingCacheModule", true);
125  }
126 
127  WATCH_VECTOR(cnList);
128  WATCH_MAP(interfaceCoAList);
129  }
130 }

◆ initiateMipv6Protocol()

void inet::xMIPv6::initiateMipv6Protocol ( NetworkInterface ie,
const Ipv6Address CoA 
)

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.

234 {
235  Enter_Method("initiateMipv6Protocol"); // can be called by NeighborDiscovery module
236 
237  if (!(ie->isLoopback()) && rt6->isMobileNode()) {
238  EV_INFO << "Initiating Mobile Ipv6 protocol..." << endl;
239 
240  // The MN is supposed to send a BU to the HA after forming a CoA
241  Ipv6Address haDest = ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress(); // HA address for use in the BU for Home Registration
242 
243  createBUTimer(haDest, ie);
244 
245  // RO with CNs is triggered after receiving a valid BA from the HA
246  }
247 
248  // a movement occured -> BUL entries for CNs not valid anymore
249  Ipv6Address HoA = ie->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress();
250 
251  for (auto cn : cnList) { // run an iterator through the CN map
252  BindingUpdateList::BindingUpdateListEntry *bulEntry = bul->fetch(cn);
253  ASSERT(bulEntry != nullptr);
254 // bul->resetBindingCacheEntry(*bulEntry, HoA);
255  bul->removeBinding(cn); //FIXME need revision: this function sometimes remove the entry from bul, and bul->resetCareOfToken(cn, HoA) creates assert
256  // care-of token becomes invalid with new CoA
257  bul->resetCareOfToken(cn, HoA);
258  tunneling->destroyTunnelForExitAndTrigger(HoA, cn);
259  }
260 }

◆ initReturnRoutability()

void inet::xMIPv6::initReturnRoutability ( const Ipv6Address cnDest,
NetworkInterface ie 
)
protectedvirtual

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.

1387 {
1388  EV_TRACE << "Initiating Return Routability...\n";
1389  Enter_Method("initReturnRoutability()");
1390 
1391  bool sendHoTI = true, sendCoTI = true;
1392 
1393  /*11.6.1
1394  A mobile node that initiates a return routability procedure MUST send
1395  (in parallel) a Home Test Init message and a Care-of Test Init
1396  messages. However, if the mobile node has recently received (see
1397  Section 5.2.7) one or both home or care-of keygen tokens, and
1398  associated nonce indices for the desired addresses, it MAY reuse
1399  them. Therefore, the return routability procedure may in some cases
1400  be completed with only one message pair. It may even be completed
1401  without any messages at all, if the mobile node has a recent home
1402  keygen token and has previously visited the same care-of address so
1403  that it also has a recent care-of keygen token.*/
1404  BindingUpdateList::BindingUpdateListEntry *cnEntry = bul->fetch(cnDest);
1405  ASSERT(cnEntry);
1406  cnEntry->state = BindingUpdateList::RR;
1407 
1408  /*A Home Test Init message MUST be created as described in Section
1409  6.1.3.*/
1410  //if (cnEntry != nullptr)
1411  //{
1412  // if there exists an entry in the BUL, check whether we already
1413  // have valid home and care-of tokens
1414 
1415  // check whether the last received home token is still valid
1416  //if ((cnEntry->tokenH != UNDEFINED_TOKEN) && (cnEntry->sentHoTI + ie->ipv6()->_maxTokenLifeTime() > simTime()))
1417  if (bul->isHomeTokenAvailable(cnDest, ie)) {
1418  EV_INFO << "Valid home token available - sending HoTI later.\n";
1419  sendHoTI = false;
1420  }
1421  //else
1422 // delete HoTI;
1423 
1424  /*if ((cnEntry->tokenC != UNDEFINED_TOKEN) && (cnEntry->sentCoTI + ie->ipv6()->_maxTokenLifeTime() > simTime()))*/
1425  if (bul->isCareOfTokenAvailable(cnDest, ie)) {
1426  EV_INFO << "Valid care-of token available - sending CoTI later.\n" << endl;
1427 
1428  // we already have a care-of token
1429  sendCoTI = false;
1430  }
1431  //else
1432 // delete CoTI;
1433 
1434  if (!sendHoTI && !sendCoTI) { // cnEntry can not be nullptr as a consequence of the other two flag's values
1435  // we already had a valid home and care-of token
1436  // -> no need for sending HoTI/CoTI; we can
1437  // immediately continue with sending a BU
1438  cnEntry->state = BindingUpdateList::RR_COMPLETE;
1439 
1440  sendBUtoCN(*cnEntry, ie);
1441  }
1442  //}
1443 
1444  if (sendHoTI && !bul->recentlySentHOTI(cnDest, ie)) {
1445  // no entry for this CN available: create Home Test Init message to be sent via HA
1446  createAndSendHoTIMessage(cnDest, ie);
1447  }
1448 
1449  if (sendCoTI && !bul->recentlySentCOTI(cnDest, ie)) {
1450  /*A Care-of Test Init message MUST be created as described in Section
1451  6.1.4.*/
1452  // Care-of Test Init Message to CN
1453  createAndSendCoTIMessage(cnDest, ie);
1454  }
1455 }

Referenced by processBRRMessage(), and triggerRouteOptimization().

◆ numInitStages()

virtual int inet::xMIPv6::numInitStages ( ) const
inlineoverrideprotectedvirtual
165 { return NUM_INIT_STAGES; }

◆ 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.

2217 {
2218  Key key(dest, interfaceID, msgType);
2219  // return true if there is an entry
2220  // and false otherwise
2221  return containsKey(transmitIfList, key);
2222 }

◆ processBAMessage()

void inet::xMIPv6::processBAMessage ( Packet inPacket,
const Ptr< const BindingAcknowledgement > &  ba 
)
protected

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.

1125 {
1126  EV_TRACE << "\n<<<<<<<<<This is where BA gets processed>>>>>>>>>\n";
1127 // bool retransmitBU = false;
1128  Ipv6Address baSource = inPacket->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
1129  auto ifTag = inPacket->getTag<InterfaceInd>();
1130  NetworkInterface *ie = ift->getInterfaceById(ifTag->getInterfaceId()); // the interface on which the BAck was received
1131 
1132  if (rt6->isMobileNode()) {
1133  if (!validateBAck(inPacket, *ba)) {
1134  EV_INFO << "Discarding invalid BAck...\n";
1135  delete inPacket;
1136 
1137  // statistic collection
1138  /*if (baSource == ie->ipv6()->getHomeAgentAddress())
1139  statVectorBAfromHA.record(3);
1140  else
1141  statVectorBAfromCN.record(3);*/
1142 
1143  return;
1144  }
1145 
1146  /*11.7.3
1147  When a mobile node receives a packet carrying a valid Binding
1148  Acknowledgement, the mobile node MUST examine the Status field as
1149  follows:
1150  o If the Status field indicates that the Binding Update was accepted
1151  (the Status field is less than 128), then the mobile node MUST
1152  update the corresponding entry in its Binding Update List to
1153  indicate that the Binding Update has been acknowledged; the mobile
1154  node MUST then stop retransmitting the Binding Update.*/
1155  if (ba->getStatus() < 128) {
1156  EV_INFO << "Binding was accepted." << endl;
1157 
1158  // As the BU is obviously valid, we can remove the transmission timer for BU
1159  cancelTimerIfEntry(baSource, ie->getInterfaceId(), KEY_BU);
1160 
1161  if (ba->getLifetime() == 0) { // BAck to deregistration BU
1162  if (baSource == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress()) {
1163  /*11.5.4
1164  After receiving the Binding Acknowledgement for its Binding Update to
1165  its home agent, the mobile node MUST multicast onto the home link (to
1166  the all-nodes multicast address) a Neighbor Advertisement [12], to
1167  advertise the mobile node's own link-layer address for its own home
1168  address.*/
1169  ipv6nd->sendUnsolicitedNa(ie);
1170 
1171  // statistic collection
1172  /*statVectorBAfromHA.record(2);*/
1173  }
1174  /*else
1175  statVectorBAfromCN.record(2);*/
1176 
1177  // delete the entry from the BUL
1178  bul->removeBinding(baSource);
1179  // remove all timers related to this BA address
1180  removeTimerEntries(baSource, ifTag->getInterfaceId());
1181  }
1182  else {
1183  // binding with lifeTime >0 was accepted
1184 
1185  // moved the code below from sendBU()
1186  // retrieve the appropriate BUL entry
1187  BindingUpdateList::BindingUpdateListEntry *entry = bul->lookup(baSource);
1188  ASSERT(entry != nullptr);
1189 
1190  // establish tunnel, but only if we have not already acked the BU before
1191  if (entry->BAck == false && entry->destAddress == ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress()) { // BA from HA
1192  removeCoAEntries(); // TODO would be better if this is done somewhere else or in a comletely different way
1193  interfaceCoAList[ie->getInterfaceId()] = entry->careOfAddress;
1194 
1195  tunneling->createTunnel(Ipv6Tunneling::NORMAL, entry->careOfAddress, entry->destAddress);
1196 // bubble("Established tunnel to home agent.");
1197 
1203  // initiate RR for the CNs
1204  for (itCNList = cnList.begin(); itCNList != cnList.end(); itCNList++) { // run an iterator through the CN map
1205  Ipv6Address& cnDest = *(itCNList);
1206 
1207 // entry->state = BindingUpdateList::RR;
1208  //if (!bul->isValidBinding(cnDest)) // to initiate HoTI/CoTI resending
1209  triggerRouteOptimization(cnDest, ie->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress(), ie);
1210  }
1211 
1212  // statistic collection
1213  /*statVectorBAfromHA.record(1);*/
1214  }
1215  else if (entry->BAck == false) { // BA from CN
1216  tunneling->destroyTunnelForExitAndTrigger(entry->homeAddress, baSource);
1217  tunneling->createTunnel(Ipv6Tunneling::HA_OPT, entry->careOfAddress, entry->homeAddress, baSource);
1218 // tunneling->createPseudoTunnel(CoA, bu->getHomeAddressMN(), dest, TUNNEL_HA_OPT);
1219 // bubble("Established Type 2 Routing Header path to CN.");
1220 
1221  // statistic collection
1222  /*statVectorBAfromCN.record(1);*/
1223 
1224  // fire event to MIH subscribers
1225  emit(mipv6RoCompletedSignal, (cObject *)nullptr);
1226  }
1227 
1228  // set BAck flag in BUL
1229  entry->BAck = true;
1230 
1231  // set mobility state in BUL
1232  entry->state = BindingUpdateList::REGISTERED;
1233 
1234  /*11.7.3
1235  In addition, if the value specified in the Lifetime field in the
1236  Binding Acknowledgement is less than the Lifetime value sent in
1237  the Binding Update being acknowledged, the mobile node MUST
1238  subtract the difference between these two Lifetime values from the
1239  remaining lifetime for the binding as maintained in the
1240  corresponding Binding Update List entry (with a minimum value for
1241  the Binding Update List entry lifetime of 0). That is, if the
1242  Lifetime value sent in the Binding Update was L_update, the
1243  Lifetime value received in the Binding Acknowledgement was L_ack,
1244  and the current remaining lifetime of the Binding Update List
1245  entry is L_remain, then the new value for the remaining lifetime
1246  of the Binding Update List entry should be
1247  max((L_remain - (L_update - L_ack)), 0)
1248  where max(X, Y) is the maximum of X and Y.*/
1249  int l_ack = ba->getLifetime() * 4; /* 6.1.7 One time unit is 4 seconds. */
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;
1255  // we schedule the timer that manages the BUL entry expiration
1256  // TODO currently we schedule the expiry message some seconds (PRE_BINDING_EXPIRY)
1257  // before the actual expiration. Can be improved.
1258  simtime_t scheduledTime = entry->bindingExpiry - PRE_BINDING_EXPIRY;
1259  scheduledTime = scheduledTime > 0 ? scheduledTime : 0;
1260 
1261  /*EV << "l_ack=" << l_ack << ", l_update=" << l_update << ", l_remain=" << l_remain << ", x=" << x << endl;
1262  EV << "entry->bindingLifetime=" << entry->bindingLifetime << " and entry->bindingExpiry=" << entry->bindingExpiry << endl;*/
1263  EV_DETAIL << "Scheduling BULEntryExpiryTimer for " << scheduledTime << endl;
1264  createBULEntryExpiryTimer(entry, ie, scheduledTime);
1265 
1266  // 11.06.08 - CB: rescheduling changed. Handled by BUL entry expiry.
1267  /*// reschedule the message if the BA is from a CN and not from the HA
1268  retransmitBU = (entry->destAddress != ie->ipv6()->getHomeAgentAddress());*/
1269 
1270  /*if (baSource == ie->ipv6()->getHomeAgentAddress())
1271  {
1272  // initiate RR for CNs moved to above
1273  }*/
1274  }
1275  }
1276  /*o If the Status field indicates that the Binding Update was rejected
1277  (the Status field is greater than or equal to 128), then the
1278  mobile node can take steps to correct the cause of the error and
1279  retransmit the Binding Update (with a new Sequence Number value),
1280  subject to the rate limiting restriction specified in Section
1281  11.8. If this is not done or it fails, then the mobile node
1282  SHOULD record in its Binding Update List that future Binding
1283  Updates SHOULD NOT be sent to this destination.*/
1284  else {
1285  EV_INFO << "Binding was rejected.\n";
1286 
1287  /*11.7.1
1288  If the home agent rejects the value, it sends back a
1289  Binding Acknowledgement with a status code 135, and the last accepted
1290  sequence number in the Sequence Number field of the Binding
1291  Acknowledgement. The mobile node MUST store this information and use
1292  the next Sequence Number value for the next Binding Update it sends.*/
1293 
1294  // retransmission is performed anyway as timers are not deleted
1295  // TODO store DO_NOT_SEND_BU in BUL
1296  }
1297  }
1298 
1299  // update 11.6.08 - CB: rescheduling of BU is now handled by BUL entry expiry
1300  // for now, we delete the BU transmission timer irrelevant of the status of the BA
1301  // TODO catch BA failure case
1302  /*
1303  int interfaceID = ctrlInfo->interfaceId();
1304  if (retransmitBU)
1305  resetBUIfEntry(baSource, interfaceID, retransmissionTime); // add bindingLifetime
1306  else
1307  cancelTransmitIfEntry(baSource, interfaceID, KEY_BU);
1308  */
1309 
1310  delete inPacket;
1311 }

Referenced by processMobilityMessage().

◆ processBRRMessage()

void inet::xMIPv6::processBRRMessage ( Packet inPacket,
const Ptr< const BindingRefreshRequest > &  brr 
)
protected

Processes the Binding Refresh Message.

2473 {
2474  /*11.7.4
2475  When a mobile node receives a packet containing a Binding Refresh
2476  Request message, the mobile node has a Binding Update List entry for
2477  the source of the Binding Refresh Request, and the mobile node wants
2478  to retain its binding cache entry at the correspondent node, then the
2479  mobile node should start a return routability procedure.*/
2480  Ipv6Address cnAddress = inPacket->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
2481  Ipv6Address HoA = inPacket->getTag<L3AddressInd>()->getDestAddress().toIpv6();
2482 
2483  if (!bul->isInBindingUpdateList(cnAddress, HoA)) {
2484  EV_WARN << "BRR not accepted - no binding for this CN. Dropping message." << endl;
2485  PacketDropDetails details;
2486  details.setReason(OTHER_PACKET_DROP);
2487  emit(packetDroppedSignal, inPacket, &details);
2488  }
2489  else {
2490  auto ifTag = inPacket->getTag<InterfaceInd>();
2491  NetworkInterface *ie = ift->getInterfaceById(ifTag->getInterfaceId());
2492  initReturnRoutability(cnAddress, ie);
2493  }
2494 
2495  delete inPacket;
2496 }

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.

681 {
682  EV_INFO << "Entered BU processing method" << endl;
683 
684  /*if ((!rt6->isMobileNode() && !rt6->isRouter() && !rt6->isHomeAgent()) ||
685  (rt6->isRouter() && rt6->isHomeAgent() && !rt6->isMobileNode())
686  ) // if node is either HA or CN, only then a BA is sent otherwise not.
687  */
688  // BA is not sent when node is a mobile node and not a HA at the same time
689  if (rt6->isMobileNode() && !rt6->isHomeAgent()) { // rewrote condition to make it more clear - CB
690  EV_WARN << "Wrong Node: not HA or CN" << endl;
691 
692  if (hasGUI())
693  bubble("Wrong Node: not HA or CN");
694 
695  delete inPacket;
696  return;
697  }
698 
699  BaStatus status;
700  bool validBUMessage = validateBUMessage(inPacket, bu);
701 
702  if (validBUMessage) {
703  auto ifTag = inPacket->getTag<InterfaceInd>();
704  auto addrTag = inPacket->getTag<L3AddressInd>();
705  const Ipv6Address& HoA = bu->getHomeAddressMN();
706  Ipv6Address CoA = addrTag->getSrcAddress().toIpv6();
707  Ipv6Address destAddress = addrTag->getDestAddress().toIpv6();
708  uint buLifetime = bu->getLifetime() * 4; /* 6.1.7 One time unit is 4 seconds. */
709  uint buSequence = bu->getSequence();
710  bool homeRegistration = bu->getHomeRegistrationFlag();
711 
712  // handling for binding de-registration
713 
714  /*9.5.1
715  If the Lifetime specified in the Binding Update is zero or the
716  specified care-of address matches the home address for the
717  binding, then this is a request to delete the cached binding for
718  the home address. [...] If the Home Registration (H) bit is set
719  in the Binding Update, the Binding Update is processed according
720  to the procedure specified in Section 10.3.2; otherwise, it is
721  processed according to the procedure specified in Section 9.5.3.*/
722  if ((buLifetime == 0) || (CoA == HoA)) {
723  // Check home registration flag -> not much difference in Section 10.3.2 and 9.5.3 for our purpose
724 
725  // de-register binding
726  if (rt6->isHomeAgent() && !validateBUderegisterMessage(inPacket, bu)) { // HAs have to validate the BU
727  /* If the receiving node has no entry marked as a home registration
728  in its Binding Cache for this mobile node, then this node MUST
729  reject the Binding Update and SHOULD return a Binding
730  Acknowledgement to the mobile node, in which the Status field is
731  set to 133 (not home agent for this mobile node).*/
732  status = NOT_HA_FOR_THIS_MN; // enum defined in MobilityHeader.msg file
733  uint baSeqNumber = bu->getSequence(); // the sequence number from Rxed BU is copied into BA.
734  createAndSendBAMessage(destAddress, CoA, ifTag->getInterfaceId(), status,
735  bu->getBindingAuthorizationData(), baSeqNumber, buLifetime); // swapped src and dest, update lifeTime
736  EV_ERROR << "Not HA for this MN. Responding with appropirate BA...\n";
737  delete inPacket;
738  return;
739  }
740  /*9.5.3
741  Any existing binding for the given home address MUST be deleted. A
742  Binding Cache entry for the home address MUST NOT be created in
743  response to receiving the Binding Update.*/
744  /*10.3.2
745  If the home agent does not reject the Binding Update as described
746  above, then it MUST delete any existing entry in its Binding Cache
747  for this mobile node.*/
748  bc->deleteEntry(HoA);
749 
750  /*In addition, the home agent MUST stop intercepting packets on the
751  mobile node's home link that are addressed to the mobile node*/
752  // of course this is also true for CNs
753  tunneling->destroyTunnelFromTrigger(HoA);
754 
755  // kill BC expiry timer
756  cancelTimerIfEntry(HoA, ifTag->getInterfaceId(), KEY_BC_EXP);
757 
758  /*10.3.2
759  Then, the home agent MUST return a Binding Acknowledgement to the mobile node */
760  /*9.5.4
761  o If the Acknowledge (A) bit set is set in the Binding Update, a
762  Binding Acknowledgement MUST be sent.*/
763  if (rt6->isHomeAgent() || bu->getAckFlag()) {
764  /*constructed as follows:
765  o The Status field MUST be set to a value 0, indicating success.*/
766  status = BINDING_UPDATE_ACCEPTED; // enum defined in MobilityHeader.msg file
767  /*o The Sequence Number field MUST be copied from the Sequence Number
768  given in the Binding Update.*/
769  uint baSeqNumber = bu->getSequence();
770  /*o The Lifetime field MUST be set to zero.*/
771  uint lifeTime = 0;
772 
773  /*//The following was omitted://
774  o The Key Management Mobility Capability (K) bit is set or cleared
775  and actions based on its value are performed as described in the
776  previous section. The mobile node's home address is used as its
777  new care-of address for the purposes of moving the key management
778  connection to a new endpoint.
779  o The Binding Refresh Advice mobility option MUST be omitted.*/
780  createAndSendBAMessage(destAddress, CoA, ifTag->getInterfaceId(), status, baSeqNumber,
781  bu->getBindingAuthorizationData(), lifeTime); // swapped src and dest
782  }
783 
784  if (!rt6->isHomeAgent()) { // this is a CN
785  // cancel existing Binding Refresh Request timer
786  // (if there exists one)
787  int interfaceID = ifTag->getInterfaceId();
788  cancelTimerIfEntry(HoA, interfaceID, KEY_BR);
789  }
790 
791  EV_INFO << "Deregistered binding\n";
792  bubble("Deregistered binding!");
793  }
794  else {
795  // binding lifetime is nonzero
796  /*9.5.1
797  If the Lifetime specified in the Binding Update is nonzero and the
798  specified care-of address is not equal to the home address for the
799  binding, then this is a request to cache a binding for the home
800  address. If the Home Registration (H) bit is set in the Binding
801  Update, the Binding Update is processed according to the procedure
802  specified in Section 10.3.1; otherwise, it is processed according
803  to the procedure specified in Section 9.5.2.*/
804  if (homeRegistration) {
805  /* 10.3.1
806  o If the node implements only correspondent node functionality, or
807  has not been configured to act as a home agent, then the node MUST
808  reject the Binding Update. The node MUST also return a Binding
809  Acknowledgement to the mobile node, in which the Status field is
810  set to 131 (home registration not supported).*/
811  if (!rt6->isHomeAgent()) {
812  status = HOME_REGISTRATION_NOT_SUPPORTED; // enum defined in MobilityHeader.msg file
813  uint baSeqNumber = bu->getSequence();
814  uint lifeTime = 0;
815  createAndSendBAMessage(destAddress, CoA, ifTag->getInterfaceId(), status, baSeqNumber,
816  bu->getBindingAuthorizationData(), lifeTime);
817 
818  delete inPacket;
819  return;
820  }
821  else if (!rt6->isOnLinkAddress(HoA)) {
822  /*Else, if the home address for the binding (the Home Address field
823  in the packet's Home Address option) is not an on-link Ipv6
824  address with respect to the home agent's current Prefix List, then
825  the home agent MUST reject the Binding Update and SHOULD return a
826  Binding Acknowledgement to the mobile node, in which the Status
827  field is set to 132 (not home subnet).*/
828  status = NOT_HOME_SUBNET; // enum defined in MobilityHeader.msg file
829  uint baSeqNumber = bu->getSequence();
830  uint lifeTime = 0;
831  createAndSendBAMessage(destAddress, CoA, ifTag->getInterfaceId(), status, baSeqNumber,
832  bu->getBindingAuthorizationData(), lifeTime);
833 
834  delete inPacket;
835  return;
836  }
837  }
838 
839  bool existingBinding = bc->isInBindingCache(HoA);
840  bc->addOrUpdateBC(HoA, CoA, buLifetime, buSequence, homeRegistration);
841  // for both HA and CN we create a BCE expiry timer
842  createBCEntryExpiryTimer(HoA, ift->getInterfaceById(ifTag->getInterfaceId()), simTime() + buLifetime);
843 
844  /*10.3.1
845  Regardless of the setting of the Acknowledge (A) bit in the Binding
846  Update, the home agent MUST return a Binding Acknowledgement to the
847  mobile node*/
848  /*9.5.4
849  If the Acknowledge (A) bit set is set in the Binding Update, a
850  Binding Acknowledgement MUST be sent. Otherwise, the treatment
851  depends on the below rule.*/
852  if (bu->getAckFlag() || rt6->isHomeAgent()) {
853  /*10.3.1
854  The Status field MUST be set to a value indicating success. The
855  value 1 (accepted but prefix discovery necessary) MUST be used if
856  the subnet prefix of the specified home address is deprecated, or
857  becomes deprecated during the lifetime of the binding, or becomes
858  invalid at the end of the lifetime. The value 0 MUST be used
859  otherwise. For the purposes of comparing the binding and prefix
860  lifetimes, the prefix lifetimes are first converted into units of
861  four seconds by ignoring the two least significant bits.*/
862  status = BINDING_UPDATE_ACCEPTED; // enum defined in MobilityHeader.msg file
863  /*The Sequence Number field MUST be copied from the Sequence Number
864  given in the Binding Update.*/
865  uint baSeqNumber = bu->getSequence();
866  /*The Lifetime field MUST be set to the remaining lifetime for the
867  binding as set by the home agent in its home registration Binding
868  Cache entry for the mobile node, as described above.*/
869  uint lifeTime = bc->getLifetime(HoA);
870 
871  /* 10.3.1
872  Unless this home agent already has a binding for the given home
873  address, the home agent MUST perform Duplicate Address Detection [13]
874  on the mobile node's home link before returning the Binding
875  Acknowledgement.*/
876  simtime_t sendTime;
877  if (rt6->isHomeAgent())
878  // HA has to do DAD in case this is a new binding for this HoA
879  sendTime = existingBinding ? 0 : 1;
880  else
881  sendTime = 0;
882 
883  createAndSendBAMessage(destAddress, CoA, ifTag->getInterfaceId(), status, baSeqNumber,
884 // bu->getBindingAuthorizationData(), 15, sendTime); // swapped src and dest
885  bu->getBindingAuthorizationData(), lifeTime, sendTime); // swapped src and dest, corrected lifetime value
886 
887  /*If this Duplicate Address Detection fails for the given
888  home address or an associated link local address, then the home agent
889  MUST reject the complete Binding Update and MUST return a Binding
890  Acknowledgement to the mobile node, in which the Status field is set
891  to 134 (Duplicate Address Detection failed).*/
892  // TODO
893  }
894  else { // condition: ! bu->getAckFlag()
895  EV_INFO << "BU Validated as OK: ACK FLAG NOT SET" << endl;
896  bubble("!!!BU VALID --- ACK FLAG = False !!!");
897  }
898 
899  if (rt6->isHomeAgent()) { // establish tunnel to MN
900  Ipv6Address& HA = destAddress;
901 
902  // we first destroy the already existing tunnel if
903  // there exists one
904  tunneling->destroyTunnelForEntryAndTrigger(HA, HoA);
905 
906  tunneling->createTunnel(Ipv6Tunneling::NORMAL, HA, CoA, HoA);
907 // bubble("Established tunnel to mobile node.");
908  }
909  else {
910  // we first destroy the already existing RH2 path if
911  // there exists one
912  Ipv6Address& CNAddress = destAddress;
913  tunneling->destroyTunnelForEntryAndTrigger(CNAddress, HoA);
914 
915  // establish RH2 pseudo-tunnel at correspondent node
916  tunneling->createTunnel(Ipv6Tunneling::T2RH, CNAddress, CoA, HoA);
917 
918  // cancel existing Binding Refresh Request timer
919  // (if there exists one)
920  int interfaceID = ifTag->getInterfaceId();
921  cancelTimerIfEntry(HoA, interfaceID, KEY_BR);
922 
923  // and then we initialize a (new) BRR timer that gets
924  // fired as soon as the BU lifetime is closing to 0.
925  // Then we send Binding Refresh Requests once again
926  // until we receive a valid BU.
927  // FOX uncommented BRR below
928 // NetworkInterface *ie = ift->interfaceAt(interfaceID);
929 // createBRRTimer(HoA, ie, buLifetime - BRR_TIMEOUT_THRESHOLD);
930 // createBRRTimer(HoA, ie, BRR_TIMEOUT_THRESHOLD);
931  }
932  }
933  }
934  else {
935  EV_WARN << "BU Validation Failed: Dropping message" << endl;
936  bubble("BU Validation Failed: Dropping Packet");
937  }
938 
939  delete inPacket;
940 }

Referenced by processMobilityMessage().

◆ processCoTIMessage()

void inet::xMIPv6::processCoTIMessage ( Packet inPacket,
const Ptr< const CareOfTestInit > &  CoTI 
)
protected

Create and send a CoT message.

1725 {
1726  // 9.4.2 & 9.4.4
1727  Ipv6Address srcAddr = inPacket->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
1728  Ipv6Address coa = inPacket->getTag<L3AddressInd>()->getDestAddress().toIpv6();
1729 
1730  auto outPacket = new Packet("CoT");
1731  const auto& cot = makeShared<CareOfTest>();
1732  cot->setMobilityHeaderType(CARE_OF_TEST);
1733  cot->setCareOfInitCookie(coti->getCareOfInitCookie());
1734  cot->setCareOfKeyGenToken(bc->generateCareOfToken(coa, 0)); // TODO nonce
1735  // setting message size
1736  cot->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_COT));
1737  outPacket->insertAtFront(cot);
1738 
1739  EV_INFO << "\n<<======CoT MESSAGE FORMED; APPENDING CONTROL INFO=====>>\n";
1740  sendMobilityMessageToIPv6Module(outPacket, srcAddr, coa);
1741 
1742  // statistic collection
1743  /*statVectorCoTtoMN.record(1);*/
1744 
1745  delete inPacket;
1746 }

Referenced by processMobilityMessage().

◆ processCoTMessage()

void inet::xMIPv6::processCoTMessage ( Packet inPacket,
const Ptr< const CareOfTest > &  CoT 
)
protected

Like processHoTMessage(), but related to CoT.

1836 {
1837  if (!validateCoTMessage(inPacket, *CoT)) {
1838  EV_WARN << "CoT validation not passed: dropping message" << endl;
1839  PacketDropDetails details;
1840  details.setReason(OTHER_PACKET_DROP);
1841  emit(packetDroppedSignal, inPacket, &details);
1842  }
1843  else {
1844  EV_INFO << "CoT validation passed: updating BUL" << endl;
1845 
1846  Ipv6Address srcAddr = inPacket->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
1847 // Ipv6Address& destAddr = ctrlInfo->destAddr();
1848  auto ifTag = inPacket->getTag<InterfaceInd>();
1849  int interfaceID = ifTag->getInterfaceId();
1850 
1851  NetworkInterface *ie = ift->getInterfaceById(interfaceID);
1852 
1853  BindingUpdateList::BindingUpdateListEntry *bulEntry = bul->lookup(srcAddr);
1854  ASSERT(bulEntry != nullptr);
1855 
1856  // cancel the existing CoTI retransmission timer
1857  cancelTimerIfEntry(srcAddr, interfaceID, KEY_CI);
1858 
1859  // set the care-of keygen token
1860  bulEntry->tokenC = CoT->getCareOfKeyGenToken();
1861 
1862  // set token expiry appropriately
1863  createCareOfTokenEntryExpiryTimer(srcAddr, ift->getInterfaceById(interfaceID),
1864  simTime() + ie->getProtocolData<Ipv6InterfaceData>()->_getMaxTokenLifeTime());
1865 
1866  // if we have the home token as well, we can send the BU to the CN now
1867  // but only if we have already sent or are about to send a BU
1868 
1869  // call method that potentially sends BU now
1870  checkForBUtoCN(*bulEntry, ie);
1871 
1872  // reset the CoTI timer for the time the token expires
1873 // resetTestInitIfEntry(srcAddr, interfaceID, KEY_CI);
1874 
1875  /*// delete the CoT retransmission timer
1876  cancelTimerIfEntry(srcAddr, interfaceID, KEY_CI);*/
1877 
1878  // gather statistics
1879  /*statVectorCoTfromCN.record(1);*/
1880  }
1881 
1882  delete inPacket;
1883 }

Referenced by processMobilityMessage().

◆ processHoAOpt()

void inet::xMIPv6::processHoAOpt ( Packet packet,
HomeAddressOption hoaOpt 
)
protected

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.

2123 {
2124  auto ipv6Header = packet->peekAtFront<Ipv6Header>();
2125 
2126  // datagram from MN to CN
2127  bool validHoAOpt = false;
2128  const Ipv6Address& HoA = hoaOpt->getHomeAddress();
2129  const Ipv6Address& CoA = ipv6Header->getSrcAddress();
2130 
2131  /*9.3.1
2132  Packets containing a
2133  Home Address option MUST be dropped if there is no corresponding
2134  Binding Cache entry. A corresponding Binding Cache entry MUST have
2135  the same home address as appears in the Home Address destination
2136  option, and the currently registered care-of address MUST be equal to
2137  the source address of the packet.*/
2138  ASSERT(bc != nullptr);
2139 
2140  if (bc->isInBindingCache(HoA, CoA)) {
2141  ipv6Header = nullptr;
2142  packet->trimFront();
2143  auto newIpv6Header = packet->removeAtFront<Ipv6Header>();
2144  newIpv6Header->setSrcAddress(HoA);
2145  insertNetworkProtocolHeader(packet, Protocol::ipv6, newIpv6Header);
2146  validHoAOpt = true;
2147  }
2148  else {
2149  EV_WARN << "Invalid RH2 destination - no entry in binding cache. Dropping packet." << endl;
2150 
2151  /*If the packet is dropped due the above tests, the correspondent node
2152  MUST send the Binding Error message as described in Section 9.3.3.
2153  The Status field in this message should be set to 1 (unknown binding
2154  for Home Address destination option).*/
2155  // previous code was erroneous, as destination from packet is probably
2156  // not a valid address of the interfaces of this node
2158  createAndSendBEMessage(CoA, status);
2159  }
2160 
2161  packet->setContextPointer(nullptr);
2162  delete hoaOpt;
2163 
2164  if (validHoAOpt) {
2165  EV_INFO << "Valid HoA Option - copied address from HoA Option to datagram" << endl;
2166  send(packet, "toIPv6");
2167  }
2168  else {
2169  PacketDropDetails details;
2170  details.setReason(OTHER_PACKET_DROP);
2171  emit(packetDroppedSignal, packet, &details);
2172  delete packet;
2173  }
2174 }

Referenced by handleMessage().

◆ processHoTIMessage()

void inet::xMIPv6::processHoTIMessage ( Packet inPacket,
const Ptr< const HomeTestInit > &  HoTI 
)
protected

Create and send a HoT message.

1701 {
1702  // 9.4.1 & 9.4.3
1703  Ipv6Address srcAddr = inPacket->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
1704  Ipv6Address HoA = inPacket->getTag<L3AddressInd>()->getDestAddress().toIpv6();
1705 
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)); // TODO nonce
1711  // setting message size
1712  homeTest->setChunkLength(B(SIZE_MOBILITY_HEADER + SIZE_HOT));
1713  outPacket->insertAtFront(homeTest);
1714 
1715  EV_INFO << "\n<<======HoT MESSAGE FORMED; APPENDING CONTROL INFO=====>>\n";
1716  sendMobilityMessageToIPv6Module(outPacket, srcAddr, HoA);
1717 
1718  // statistic collection
1719  /*statVectorHoTtoMN.record(1);*/
1720 
1721  delete inPacket;
1722 }

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.

1749 {
1750  if (!validateHoTMessage(inPacket, *homeTest)) {
1751  EV_WARN << "HoT validation not passed: dropping message" << endl;
1752  PacketDropDetails details;
1753  details.setReason(OTHER_PACKET_DROP);
1754  emit(packetDroppedSignal, inPacket, &details);
1755  }
1756  else {
1757  EV_WARN << "HoT validation passed: updating BUL" << endl;
1758  Ipv6Address srcAddr = inPacket->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
1759 // Ipv6Address& destAddr = ctrlInfo->destAddr();
1760  int interfaceID = inPacket->getTag<InterfaceInd>()->getInterfaceId();
1761  NetworkInterface *ie = ift->getInterfaceById(interfaceID);
1762 
1763  BindingUpdateList::BindingUpdateListEntry *bulEntry = bul->lookup(srcAddr);
1764  ASSERT(bulEntry != nullptr);
1765 
1766  // cancel the existing HoTI retransmission timer
1767  cancelTimerIfEntry(srcAddr, interfaceID, KEY_HI);
1768 
1769  // set the home keygen token
1770  bulEntry->tokenH = homeTest->getHomeKeyGenToken();
1771 
1772  // set token expiry appropriately
1773  createHomeTokenEntryExpiryTimer(srcAddr, ift->getInterfaceById(interfaceID),
1774  simTime() + ie->getProtocolData<Ipv6InterfaceData>()->_getMaxTokenLifeTime());
1775 
1776  // if we have the care-of token as well, we can send the BU to the CN now
1777  // but only if we have not already sent or are about to send a BU
1778  // call method that potentially sends a BU now
1779  checkForBUtoCN(*bulEntry, ie);
1780 
1781  // gather statistics
1782  /*statVectorHoTfromCN.record(1);*/
1783  }
1784 
1785  delete inPacket;
1786 }

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.

188 {
189  const auto& mipv6Msg = inPacket->peekAtFront<MobilityHeader>();
190 
191  EV_INFO << "Processing of MIPv6 related mobility message" << endl;
192 
193  if (const auto& bu = dynamicPtrCast<const BindingUpdate>(mipv6Msg)) {
194  EV_INFO << "Message recognised as BINDING UPDATE (BU)" << endl;
195 // EV << "\n<<<<<<<<Giving Control to processBUMessage()>>>>>>>\n";
196  processBUMessage(inPacket, bu);
197  }
198  else if (const auto& ba = dynamicPtrCast<const BindingAcknowledgement>(mipv6Msg)) {
199  EV_INFO << "Message recognised as BINDING ACKNOWLEDGEMENT (BA)" << endl;
200 // EV << "\n<<<<<<<<Giving Control to processBAMessage()>>>>>>>\n";
201  processBAMessage(inPacket, ba);
202  }
203  // 28.08.07 - CB
204  else if (const auto& hoti = dynamicPtrCast<const HomeTestInit>(mipv6Msg)) {
205  EV_INFO << "Message recognised as HOME TEST INIT (HoTI)" << endl;
206  processHoTIMessage(inPacket, hoti);
207  }
208  else if (const auto& coti = dynamicPtrCast<const CareOfTestInit>(mipv6Msg)) {
209  EV_INFO << "Message recognised as CARE-OF TEST INIT (CoTI)" << endl;
210  processCoTIMessage(inPacket, coti);
211  }
212  else if (const auto& ht = dynamicPtrCast<const HomeTest>(mipv6Msg)) {
213  EV_INFO << "Message recognised as HOME TEST (HoT)" << endl;
214  processHoTMessage(inPacket, ht);
215  }
216  else if (const auto& cot = dynamicPtrCast<const CareOfTest>(mipv6Msg)) {
217  EV_INFO << "Message recognised as CARE-OF TEST (CoT)" << endl;
218  processCoTMessage(inPacket, cot);
219  }
220  else if (const auto& brr = dynamicPtrCast<const BindingRefreshRequest>(mipv6Msg)) {
221  EV_INFO << "Message recognised as Binding Refresh Request" << endl;
222  processBRRMessage(inPacket, brr);
223  }
224  else {
225  EV_WARN << "Unrecognised mobility message... Dropping" << endl;
226  PacketDropDetails details;
227  details.setReason(OTHER_PACKET_DROP);
228  emit(packetDroppedSignal, inPacket, &details);
229  delete inPacket;
230  }
231 }

Referenced by handleMessage().

◆ processType2RH()

void inet::xMIPv6::processType2RH ( Packet packet,
Ipv6RoutingHeader rh 
)
protected

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.

2018 {
2019  auto ipv6Header = packet->peekAtFront<Ipv6Header>();
2020 // EV << "Processing RH2..." << endl;
2021 
2022  if (!validateType2RH(*ipv6Header.get(), *rh)) {
2023  PacketDropDetails details;
2024  details.setReason(OTHER_PACKET_DROP);
2025  emit(packetDroppedSignal, packet, &details);
2026  delete packet;
2027  return;
2028  }
2029 
2030  bool validRH2 = false;
2031  const Ipv6Address& HoA = rh->getAddress(0);
2032 
2033  /*11.3.3
2034  A node receiving a packet addressed to itself (i.e., one of the
2035  node's addresses is in the Ipv6 destination field) follows the next
2036  header chain of headers and processes them. When it encounters a
2037  type 2 routing header during this processing, it performs the
2038  following checks. If any of these checks fail, the node MUST
2039  silently discard the packet.*/
2040 
2041  /*The length field in the routing header is exactly 2.*/
2042  // omitted
2043 
2044  /*The segments left field in the routing header is 1 on the wire.*/
2045  if (rh->getSegmentsLeft() != 1) {
2046  EV_WARN << "Invalid RH2 - segments left field must be 1. Dropping packet." << endl;
2047  PacketDropDetails details;
2048  details.setReason(OTHER_PACKET_DROP);
2049  emit(packetDroppedSignal, packet, &details);
2050  delete packet;
2051  return;
2052  }
2053 
2054  // probably datagram from CN to MN
2055 
2056  /*The Home Address field in the routing header is one of the node's
2057  home addresses, if the segments left field was 1. Thus, in
2058  particular the address field is required to be a unicast routable
2059  address.*/
2060  if (rt6->isHomeAddress(HoA)) {
2061  /*Once the above checks have been performed, the node swaps the Ipv6
2062  destination field with the Home Address field in the routing header,
2063  decrements segments left by one from the value it had on the wire,
2064  and resubmits the packet to IP for processing the next header.*/
2065  ipv6Header = nullptr;
2066  packet->trimFront();
2067  auto newIpv6Header = packet->removeAtFront<Ipv6Header>();
2068  newIpv6Header->setDestAddress(HoA);
2069  insertNetworkProtocolHeader(packet, Protocol::ipv6, newIpv6Header);
2070  validRH2 = true;
2071  }
2072  else {
2073  /*If any of these checks fail, the node MUST
2074  silently discard the packet.*/
2075 // delete datagram;
2076  EV_WARN << "Invalid RH2 - not a HoA. Dropping packet." << endl;
2077  }
2078 
2079  packet->setContextPointer(nullptr);
2080 
2081  if (validRH2) {
2082  EV_INFO << "Valid RH2 - copied address from RH2 to datagram" << endl;
2083  send(packet, "toIPv6");
2084  }
2085  else {
2086  PacketDropDetails details;
2087  details.setReason(OTHER_PACKET_DROP);
2088  emit(packetDroppedSignal, packet, &details);
2089  delete packet;
2090  }
2091 }

Referenced by handleMessage().

◆ removeCoAEntries()

void inet::xMIPv6::removeCoAEntries ( )
protected

Remove all entries from the interfaceCoAList.

2369 {
2370  for (auto& elem : interfaceCoAList) {
2371  //if (it->first == ie->interfaceId())
2372  EV_DEBUG << "Cancelling timers for ifID=" << elem.first << " and CoA=" << elem.second << endl;
2373  cancelEntries(elem.first, elem.second);
2374  }
2375 
2376  // delete all entries after cleanup
2377  interfaceCoAList.clear();
2378 }

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.

2312 {
2313  if (rt6->isMobileNode()) {
2314  // HoTI
2315  cancelTimerIfEntry(dest, interfaceId, KEY_HI);
2316  // CoTI
2317  cancelTimerIfEntry(dest, interfaceId, KEY_CI);
2318  // BU
2319  cancelTimerIfEntry(dest, interfaceId, KEY_BU);
2320  // BRR
2321  cancelTimerIfEntry(dest, interfaceId, KEY_BR);
2322  // BUL expiry
2323  cancelTimerIfEntry(dest, interfaceId, KEY_BUL_EXP);
2324  // BC expiry
2325 // cancelTimerIfEntry(dest, interfaceId, KEY_BC_EXP);
2326  // token expiry
2327  cancelTimerIfEntry(dest, interfaceId, KEY_HTOKEN_EXP);
2328  cancelTimerIfEntry(dest, interfaceId, KEY_CTOKEN_EXP);
2329  }
2330  else if (rt6->isHomeAgent()) {
2331  cancelTimerIfEntry(dest, interfaceId, KEY_BC_EXP);
2332  }
2333  else { // CN
2334  cancelTimerIfEntry(dest, interfaceId, KEY_BC_EXP);
2335  }
2336 }

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.

1652 {
1653  /*ASSERT(msgType == KEY_BU);
1654  Key key(dest, interfaceID, msgType);*/
1655 
1656  Key key(dest, interfaceID, KEY_BU);
1657 
1658  auto pos = transmitIfList.find(key);
1659 
1660  if (pos == transmitIfList.end()) {
1661 // EV << "### No corresponding TimerIfEntry found! ###\n";
1662  return;
1663  }
1664 
1665  TimerIfEntry *entry = (pos->second);
1666  ASSERT(entry);
1667 
1668  // reset the timeout value to the initial value
1669  entry->ackTimeout = entry->ifEntry->getProtocolData<Ipv6InterfaceData>()->_getInitialBindAckTimeout();
1670  // and then we reschedule again for BU expiry time
1671  // (with correct offset for scheduling)
1672  entry->nextScheduledTime = retransmissionTime;
1673  rescheduleAt(entry->nextScheduledTime, entry->timer);
1674 
1675  EV_INFO << "Updated BuTransmitIfEntry and corresponding timer.\n";
1676 }

◆ returningHome()

void inet::xMIPv6::returningHome ( const Ipv6Address CoA,
NetworkInterface ie 
)

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.

267 {
268  Enter_Method("returningHome"); // can be called by NeighborDiscovery module
269 
270  /*11.5.4
271  A mobile node detects that it has returned to its home link through
272  the movement detection algorithm in use (Section 11.5.1), when the
273  mobile node detects that its home subnet prefix is again on-link.*/
274 
275  EV_INFO << "MIPv6 Returning home procedure..." << endl;
276 
277  // cancel timers
278 
279  // eventually we could have some unacknowledged BUs
280  // we have to cancel these: first the one for the Home Agent...
281  const Ipv6Address& HA = ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress();
282  removeTimerEntries(HA, ie->getInterfaceId());
283  // destroy tunnel to HA
284  tunneling->destroyTunnel(CoA, HA);
285  // unregister binding from HA..
286  createDeregisterBUTimer(HA, ie);
287  bul->setMobilityState(HA, BindingUpdateList::DEREGISTER);
288 
289  // ...and then the messages for CNs
290  for (itCNList = cnList.begin(); itCNList != cnList.end(); itCNList++) { // run an iterator through the CN map
291  // we first cancel potential timers for the respective CN
292  removeTimerEntries(*(itCNList), ie->getInterfaceId());
293 
294  // then we send the BU for deregistration
295  if (bul->isValidBinding(*(itCNList))) {
296  Ipv6Address cn = *(itCNList);
297 // createDeregisterBUTimer(*(itCNList), ie);
298  BindingUpdateList::BindingUpdateListEntry *bulEntry = bul->lookup(cn);
299  ASSERT(bulEntry != nullptr);
300  bulEntry->state = BindingUpdateList::DEREGISTER;
301  checkForBUtoCN(*bulEntry, ie);
302  }
303 
304  // destroy the tunnel now
305  // we have to as it is invalid (bound to old CoA that is not available anymore)
306  tunneling->destroyTunnelForExitAndTrigger(ie->getProtocolData<Ipv6InterfaceData>()->getMNHomeAddress(), *(itCNList));
307  }
308 }

◆ searchTimerIfEntry()

xMIPv6::TimerIfEntry * inet::xMIPv6::searchTimerIfEntry ( Ipv6Address dest,
int  timerType 
)
protected

Searches for a transmitEntry with the given destination address which is of type timerType.

Returns nullptr if no such entry exists.

2302 {
2303  for (auto& elem : transmitIfList) {
2304  if (elem.first.type == timerType && elem.first.dest == dest)
2305  return elem.second;
2306  }
2307 
2308  return nullptr;
2309 }

◆ sendBUtoCN()

void inet::xMIPv6::sendBUtoCN ( BindingUpdateList::BindingUpdateListEntry bulEntry,
NetworkInterface ie 
)
protected

Creates a timer for sending a BU.

1996 {
1997  /*11.7.2
1998  Upon successfully completing the return routability procedure, and
1999  after receiving a successful Binding Acknowledgement from the Home
2000  Agent, a Binding Update MAY be sent to the correspondent node.*/
2001  EV_INFO << "Sending BU to CN" << endl;
2002 
2003  /*
2004  // The createBU method requires information on the interface. This is not available in the
2005  // bul entry though. Hence we just fetch a token expiry timer to retrieve this information.
2006  TimerIfEntry* transmitEntry = searchTimerIfEntry(bulEntry.destAddress, KEY_HTOKEN_EXP); // we could also use a care-of keygen token of course...
2007  ASSERT(transmitEntry!=nullptr);
2008  NetworkInterface* ie = transmitEntry->ifEntry;*/
2009 
2010  if (bulEntry.state != BindingUpdateList::DEREGISTER)
2011  bulEntry.state = BindingUpdateList::REGISTER;
2012 
2013  createBUTimer(bulEntry.destAddress, ie);
2014 // createBUTimer(bulEntry.destAddress, ie, false);
2015 }

Referenced by checkForBUtoCN(), and initReturnRoutability().

◆ sendMobilityMessageToIPv6Module()

void inet::xMIPv6::sendMobilityMessageToIPv6Module ( Packet msg,
const Ipv6Address destAddr,
const Ipv6Address srcAddr = Ipv6Address::UNSPECIFIED_ADDRESS,
int  interfaceId = -1,
simtime_t  sendTime = 0 
)
protected

Append tags to the Mobility Messages (BU, BA etc) and send it out to the Ipv6 Module.

624 {
625  EV_INFO << "Appending ControlInfo to mobility message\n";
626  msg->removeTagIfPresent<DispatchProtocolReq>();
627  msg->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&Protocol::mobileipv6);
628  if (interfaceId != -1)
629  msg->addTagIfAbsent<InterfaceReq>()->setInterfaceId(interfaceId);
630  msg->addTagIfAbsent<L3AddressReq>()->setSrcAddress(srcAddr);
631  msg->addTagIfAbsent<L3AddressReq>()->setDestAddress(destAddr);
632  msg->addTagIfAbsent<HopLimitReq>()->setHopLimit(255);
633  EV_INFO << "ControlInfo appended successfully. Sending mobility message to Ipv6 module\n";
634 
635  EV_DETAIL << "controlInfo: DestAddr=" << destAddr
636  << " SrcAddr=" << srcAddr
637  << " InterfaceId=" << interfaceId << endl;
638 
639  // TODO solve the HA DAD problem in a different way
640  // (delay currently specified via the sendTime parameter)
641  if (sendTime > 0)
642  sendDelayed(msg, sendTime, "toIPv6");
643  else
644  send(msg, "toIPv6");
645 }

Referenced by createAndSendBAMessage(), createAndSendBEMessage(), createAndSendBRRMessage(), createAndSendBUMessage(), processCoTIMessage(), processHoTIMessage(), and sendTestInit().

◆ 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.

2426 {
2427  EV_INFO << "\n<<====== Periodic BRR MESSAGE at time: " << simTime() << " seconds =====>>\n";
2428  BrTransmitIfEntry *brIfEntry = (BrTransmitIfEntry *)msg->getContextPointer(); // detaching the corresponding brIfEntry pointer
2429  NetworkInterface *ie = brIfEntry->ifEntry;
2430  Ipv6Address& brDest = brIfEntry->dest;
2431 
2432  /*9.5.5
2433  The correspondent node MAY retransmit Binding Refresh Request
2434  messages as long as the rate limitation is applied. The
2435  correspondent node MUST stop retransmitting when it receives a
2436  Binding Update.*/
2437  if (brIfEntry->retries < BRR_RETRIES) { // we'll not retransmit infinite times
2438  brIfEntry->retries++;
2439 
2440  createAndSendBRRMessage(brDest, ie);
2441 
2442  // retransmit the Binding Refresh Message
2443  scheduleAfter(BRR_TIMEOUT_THRESHOLD, msg);
2444  }
2445  else {
2446  // we've tried often enough - remove the timer
2447  cancelTimerIfEntry(brDest, ie->getInterfaceId(), KEY_BR);
2448  }
2449 }

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.

400 {
401  EV_INFO << "Sending periodic BU message at time: " << simTime() << " seconds." << endl;
402  BuTransmitIfEntry *buIfEntry = (BuTransmitIfEntry *)msg->getContextPointer(); // detaching the corresponding buIfEntry pointer
403 // EV << "### lifetime of buIfEntry=" << buIfEntry->lifeTime << " and seq#= " << buIfEntry->buSequenceNumber << endl;
404  NetworkInterface *ie = buIfEntry->ifEntry; // copy the ie info
405  Ipv6Address& buDest = buIfEntry->dest;
406  buIfEntry->presentSentTimeBU = simTime(); // records the present time at which BU is sent
407 
408  buIfEntry->nextScheduledTime = buIfEntry->presentSentTimeBU + buIfEntry->ackTimeout;
409  /*11.8
410  The retransmissions by the mobile node MUST use an exponential back-
411  off process in which the timeout period is doubled upon each
412  retransmission*/
413  buIfEntry->ackTimeout = (buIfEntry->ackTimeout) * 2;
414 
415  /*Each Binding Update MUST have a Sequence Number greater than the
416  Sequence Number value sent in the previous Binding Update to the same
417  destination address (if any). The sequence numbers are compared
418  modulo 2**16, as described in Section 9.5.1.*/
419  buIfEntry->buSequenceNumber = (buIfEntry->buSequenceNumber + 1) % 65536;
420 
421  // Added by CB, 28.08.07
422 // Ipv6Address CoA = ie->ipv6()->globalAddress();
423  if (!buIfEntry->homeRegistration) { // this BU goes to a CN
424  Ipv6Address CoA = bul->getCoA(buDest); // 24.9.07 - CB
425  // TODO think of a good mechanism to obtain the appropriate/correct CoA
426  // Problem 1: ie->ipv6()->globalAddress() retrieves the HoA
427  // Problem 2: bul->getCoA(buDest) becomes a problem in case of Multihoming
428  // Solution: globalAddress(TYPE_COA) ?
429  int bindingAuthorizationData = bul->generateBAuthData(buDest, CoA);
430  createAndSendBUMessage(buDest, ie, buIfEntry->buSequenceNumber, buIfEntry->lifeTime, bindingAuthorizationData);
431 
432  // statistic collection
433  /*statVectorBUtoCN.record(1);*/
434  }
435  else {
436  createAndSendBUMessage(buDest, ie, buIfEntry->buSequenceNumber, buIfEntry->lifeTime);
437 
438  // statistic collection
439  /*statVectorBUtoHA.record(1);*/
440  }
441 
442  /*if (buIfEntry->ackTimeout < ie->ipv6()->_maxBindAckTimeout())
443  {
444  //buIfEntry->presentBindAckTimeout = buIfEntry->nextBindAckTimeout; //reassign the timeout value
445 // scheduleAt(buIfEntry->nextScheduledTime, msg);
446  }
447  else*/
448  if (!(buIfEntry->ackTimeout < ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout())) {
449  EV_DETAIL << "Crossed maximum BINDACK timeout...resetting to predefined maximum." << endl; // buIfEntry->nextBindAckTimeout << " ++++++\n";
450 // ev << "\n++++Present Sent Time: " << buIfEntry->presentSentTimeBU << " Present TimeOut: " << buIfEntry->ackTimeout << endl;
451 // buIfEntry->nextScheduledTime = buIfEntry->presentSentTimeBU + buIfEntry->maxBindAckTimeout;
452  buIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout();
453 // buIfEntry->nextScheduledTime = ie->ipv6()->_maxBindAckTimeout();
454 // ev << "\n++++Next Sent Time: " << buIfEntry->nextScheduledTime << endl;//" Next TimeOut: " << buIfEntry->nextBindAckTimeout << endl;
455 // scheduleAt(buIfEntry->nextScheduledTime, msg);
456  }
457 
458  EV_DETAIL << "Present Sent Time: " << buIfEntry->presentSentTimeBU << ", Present TimeOut: " << buIfEntry->ackTimeout << endl;
459  EV_DETAIL << "Next Sent Time: " << buIfEntry->nextScheduledTime << endl; // << " Next TimeOut: " << buIfEntry->nextBindAckTimeout << endl;
460  scheduleAt(buIfEntry->nextScheduledTime, msg);
461 }

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.

1502 {
1503  // FIXME the following line is unsafe, rewrite it
1504  TestInitTransmitIfEntry *tiIfEntry = (TestInitTransmitIfEntry *)msg->getContextPointer(); // check_and_cast<TestInitTransmitIfEntry*>((TestInitTransmitIfEntry*) msg->contextPointer());
1505  NetworkInterface *ie = tiIfEntry->ifEntry;
1506 
1507  /*11.6.1
1508  When sending a Home Test Init or Care-of Test Init message
1509  the mobile node MUST record in its Binding Update List the following
1510  fields from the messages:
1511  o The IP address of the node to which the message was sent.
1512  o The home address of the mobile node. This value will appear in
1513  the Source Address field of the Home Test Init message. When
1514  sending the Care-of Test Init message, this address does not
1515  appear in the message, but represents the home address for which
1516  the binding is desired.
1517  o The time at which each of these messages was sent.
1518  o The cookies used in the messages.
1519  Note that a single Care-of Test Init message may be sufficient even
1520  when there are multiple home addresses. In this case the mobile node
1521  MAY record the same information in multiple Binding Update List
1522  entries.*/
1523 
1524  // retrieve the cookie from the Test Init message
1525  if (auto homeTestInit = dynamicPtrCast<HomeTestInit>(tiIfEntry->testInitMsg)) {
1526  // moved the following two lines to here
1527  Ipv6Address HoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::HoA);
1528  ASSERT(!HoA.isUnspecified());
1529 
1530  auto outPacket = new Packet("HoTI");
1531 
1532  // update cache
1533  bul->addOrUpdateBUL(tiIfEntry->dest, HoA, simTime(), homeTestInit->getHomeInitCookie(), true);
1534  // mark the current home token as invalid
1535  bul->resetHomeToken(tiIfEntry->dest, HoA);
1536  // and send message
1537  outPacket->insertAtFront(homeTestInit);
1538  sendMobilityMessageToIPv6Module(outPacket, tiIfEntry->dest, HoA);
1539 
1540  // statistic collection
1541  /*statVectorHoTItoCN.record(1);*/
1542  }
1543  else {
1544  // must be of type CareOfTestInit
1545  auto careOfTestInit = CHK(dynamicPtrCast<CareOfTestInit>(tiIfEntry->testInitMsg));
1546  // moved the following two lines to here
1547  Ipv6Address CoA = ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA);
1548  ASSERT(!CoA.isUnspecified());
1549 
1550  auto outPacket = new Packet("CoTI");
1551 
1552  // update cache
1553  bul->addOrUpdateBUL(tiIfEntry->dest, CoA, simTime(), careOfTestInit->getCareOfInitCookie(), false);
1554  // mark the current care-of token as invalid
1555  bul->resetCareOfToken(tiIfEntry->dest, CoA);
1556  // and send message
1557  outPacket->insertAtFront(careOfTestInit);
1558  sendMobilityMessageToIPv6Module(outPacket, tiIfEntry->dest, CoA, ie->getInterfaceId());
1559 
1560  // statistic collection
1561  /*statVectorCoTItoCN.record(1);*/
1562  }
1563 
1564  /*11.8
1565  If the mobile node fails to receive a valid matching response within
1566  the selected initial retransmission interval, the mobile node SHOULD
1567  retransmit the message until a response is received.*/
1568  tiIfEntry->nextScheduledTime = tiIfEntry->ackTimeout + simTime();
1569 
1570  /*The retransmissions by the mobile node MUST use an exponential back-
1571  off process in which the timeout period is doubled upon each
1572  retransmission, until either the node receives a response or the
1573  timeout period reaches the value MAX_BINDACK_TIMEOUT. The mobile
1574  node MAY continue to send these messages at this slower rate
1575  indefinitely.*/
1576  tiIfEntry->ackTimeout = tiIfEntry->ackTimeout * 2;
1577  if (!(tiIfEntry->ackTimeout < ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout()))
1578  tiIfEntry->ackTimeout = ie->getProtocolData<Ipv6InterfaceData>()->_getMaxBindAckTimeout();
1579 
1580  msg->setContextPointer(tiIfEntry);
1581  scheduleAt(tiIfEntry->nextScheduledTime, msg);
1582 
1583  EV_INFO << "Scheduled next HoTI/CoTI for time=" << tiIfEntry->nextScheduledTime
1584  << " with timeout=" << tiIfEntry->ackTimeout << " for dest="
1585  << tiIfEntry->dest << endl;
1586 
1587 // delete tiIfEntry;
1588 // delete msg;
1589 }

Referenced by handleMessage().

◆ triggerRouteOptimization()

void inet::xMIPv6::triggerRouteOptimization ( const Ipv6Address destAddress,
const Ipv6Address HoA,
NetworkInterface ie 
)
virtual

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.

1352 {
1353  if (bul->getMobilityState(destAddress) == BindingUpdateList::NONE)
1354  bul->setMobilityState(destAddress, BindingUpdateList::RR);
1355 
1356  int vIndex = tunneling->getVIfIndexForDest(destAddress, Ipv6Tunneling::MOBILITY);
1357 
1358  if (vIndex > ift->getNumInterfaces()) {
1359  EV_INFO << "Route Optimization for: " << destAddress << " already triggered";
1360 
1361  // we have to check whether our current CoA is different from the one saved in the BUL
1362  // (this would mean we have moved to a new access network on this interface)
1363  if ((bul->getCoA(destAddress) != ie->getProtocolData<Ipv6InterfaceData>()->getGlobalAddress(Ipv6InterfaceData::CoA))
1364  || bul->getMobilityState(destAddress) == BindingUpdateList::NONE)
1365  {
1366  // we have a new CoA compared to BUL entry -> redo RO
1367  initReturnRoutability(destAddress, ie);
1368  EV_INFO << " ...moved to new network. Initializing RO.";
1369  }
1370 
1371  EV_INFO << endl;
1372  }
1373  else {
1374  if ((!bul->isInBindingUpdateList(destAddress, HoA))
1375  || (bul->getMobilityState(destAddress) == BindingUpdateList::RR))
1376  {
1377  EV_INFO << "Initialise Route Optimization for: " << destAddress << "\n";
1378  initReturnRoutability(destAddress, ie);
1379 
1380  if (!contains(cnList, destAddress))
1381  cnList.push_back(destAddress);
1382  }
1383  }
1384 }

Referenced by inet::Ipv6Tunneling::decapsulateDatagram(), and processBAMessage().

◆ updateBUL()

void inet::xMIPv6::updateBUL ( BindingUpdate bu,
const Ipv6Address dest,
const Ipv6Address CoA,
NetworkInterface ie,
const simtime_t  sendTime 
)
protected

Update the an entry of the BUL with the provided parameters.

588 {
589  uint buLife = 4 * bu->getLifetime(); /* 6.1.7 One time unit is 4 seconds. */
590  uint buSeq = bu->getSequence();
591 
592  Ipv6Address HoA = bu->getHomeAddressMN();
593 
594  // to point to the struct where i am globally recording the startisitcs for sent time and next sent time for the BU:
595  BuTransmitIfEntry *buIfEntry = fetchBUTransmitIfEntry(ie, dest);
596 
597  if (buIfEntry == nullptr) {
598  EV_WARN << "No scheduled BU entry available!\n";
599  return;
600  }
601 
602 // simtime_t sentTime = buIfEntry->presentSentTimeBU;
603 // simtime_t nextSentTime = buIfEntry->nextScheduledTime;
604 
605 // ASSERT(bul);
606  bul->addOrUpdateBUL(dest, HoA, CoA, buLife, buSeq, sendTime); // , nextSentTime); //updates the binding Update List
607 // EV << "#### Updated BUL with lifetime=" << buLife << "and sentTime=" << sentTime << endl;
608 }

Referenced by createAndSendBUMessage().

◆ validateBAck()

bool inet::xMIPv6::validateBAck ( Packet inPacket,
const BindingAcknowledgement ba 
)
protected

Validates a Binding Acknowledgement for a mobile node.

1314 {
1315  /*11.7.3
1316  Upon receiving a packet carrying a Binding Acknowledgement, a mobile
1317  node MUST validate the packet according to the following tests:
1318 
1319  o The packet meets the authentication requirements for Binding
1320  Acknowledgements defined in Section 6.1.8 and Section 5. That is,
1321  if the Binding Update was sent to the home agent, underlying IPsec
1322  protection is used. If the Binding Update was sent to the
1323  correspondent node, the Binding Authorization Data mobility option
1324  MUST be present and have a valid value.*/
1325  Ipv6Address cnAddress = packet->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
1326  auto ifTag = packet->getTag<InterfaceInd>();
1327  NetworkInterface *ie = ift->getInterfaceById(ifTag->getInterfaceId());
1328 
1329  if (cnAddress != ie->getProtocolData<Ipv6InterfaceData>()->getHomeAgentAddress()) { // BAck comes from a CN and not from the HA
1330  if (ba.getBindingAuthorizationData() == UNDEFINED_BIND_AUTH_DATA) {
1331  EV_WARN << "BA Validation Failed: Binding Authorization Data invalid !" << endl;
1332  return false;
1333  }
1334  }
1335 
1336  /*o The Sequence Number field matches the Sequence Number sent by the
1337  mobile node to this destination address in an outstanding Binding
1338  Update.*/
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";
1341  return false;
1342  }
1343 
1344  return true;
1345 }

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.

1043 {
1044  /*To begin processing the Binding Update, the home agent MUST perform
1045  the following test:
1046 
1047  o If the receiving node has no entry marked as a home registration
1048  in its Binding Cache for this mobile node, then this node MUST
1049  reject the Binding Update and SHOULD return a Binding
1050  Acknowledgement to the mobile node, in which the Status field is
1051  set to 133 (not home agent for this mobile node).*/
1052  return bc->isInBindingCache(bu->getHomeAddressMN())
1053  && bc->getHomeRegistration(bu->getHomeAddressMN());
1054 }

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.

943 {
944  auto ifTag = packet->getTag<InterfaceInd>();
945  // Performs BU Validation according to RFC3775 Sec 9.5.1
946 
947  EV_INFO << "\n<<<<<<<<<ROUTINE WHERE BU GETS VALIDATED>>>>>>>>>>>>>>><<\n";
948 
949  Ipv6Address src = packet->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
950  Ipv6Address homeAddress = bu->getHomeAddressMN(); // confirm whether it is getHomeAddressMN() or simply homeAddress()
951  uint seqNumber = bu->getSequence(); // The seq Number of the recieved BU
952  uint bcSeqNumber = bc->readBCSequenceNumber(homeAddress); // The seq Number of the last recieved BU in the Binding cache
953 
954  // restructured the following and removed "delete bu"
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 !!");
959  return false; // result = false;
960  }
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;
965  return false; // result = false;
966  }
967  /*9.5.1
968  This Sequence Number comparison MUST be performed modulo 2**16, i.e.,
969  the number is a free running counter represented modulo 65536. A
970  Sequence Number in a received Binding Update is considered less than
971  or equal to the last received number if its value lies in the range
972  of the last received number and the preceding 32768 values, inclusive.*/
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;
978 
979  /*9.5.1
980  If the mobile node sends a sequence number which is not greater than
981  the sequence number from the last valid Binding Update for this home
982  address, then the receiving node MUST send back a Binding
983  Acknowledgement with status code 135, and the last accepted sequence
984  number in the Sequence Number field of the Binding Acknowledgement.*/
985  Ipv6Address destAddress = packet->getTag<L3AddressInd>()->getDestAddress().toIpv6();
986  createAndSendBAMessage(destAddress, homeAddress, ifTag->getInterfaceId(), REGISTRATION_TYPE_CHANGE_DISALLOWED,
987  bu->getBindingAuthorizationData(), bcSeqNumber, 0);
988 
989  return false;
990  }
991 
992  // this is the CN validation part
993  if (!bu->getHomeRegistrationFlag()) {
994  if (bc->getHomeRegistration(homeAddress) != bu->getHomeRegistrationFlag()) {
995  /*9.5.1
996  If a binding already exists for the given home address and the home
997  registration flag has a different value than the Home Registration
998  (H) bit in the Binding Update, then the receiving node MUST send back
999  a Binding Acknowledgement with status code 139 (registration type
1000  change disallowed). The home registration flag stored in the Binding
1001  Cache entry MUST NOT be changed.*/
1002  EV_WARN << "BU Validation Failed: home registration flag in binding cache has different value than in the binding update" << endl;
1003  createAndSendBAMessage(src, homeAddress, ifTag->getInterfaceId(), REGISTRATION_TYPE_CHANGE_DISALLOWED,
1004  bu->getBindingAuthorizationData(), bcSeqNumber, 0);
1005 
1006  return false;
1007  }
1008 
1009  int homeToken = bc->generateHomeToken(homeAddress, 0); // TODO nonce
1010  int careOfToken = bc->generateCareOfToken(src, 0); // TODO nonce
1011  int bindAuthData = bc->generateKey(homeToken, careOfToken, src);
1012 
1013  if (bu->getLifetime() == 0) { // deregistration BU
1014  EV_DETAIL << "homeToken=" << homeToken << ", careOfToken=" << careOfToken
1015  << " , bindAuthData=" << bindAuthData
1016  << ", BU data=" << bu->getBindingAuthorizationData() << endl;
1017 
1018  if ((bu->getBindingAuthorizationData() != bindAuthData)
1019  && (bu->getBindingAuthorizationData() != homeToken)) // this is quick and dirty -> TODO
1020  {
1021  EV_WARN << "BU Validation Failed: Binding Authorization Data invalid!" << endl;
1022  return false;
1023  }
1024  }
1025  else { // registration BU
1026  if (bu->getBindingAuthorizationData() != bindAuthData) {
1027  EV_WARN << "BU Validation Failed: Binding Authorization Data invalid!" << endl;
1028  return false;
1029  }
1030  }
1031  }
1032 
1033  // If all the above tests are passed the Received BU is valid
1034  EV_INFO << "BU validation passed" << endl;
1035 
1036  if (hasGUI())
1037  bubble("BU Validated");
1038 
1039  return true; // result;
1040 }

Referenced by processBUMessage().

◆ validateCoTMessage()

bool inet::xMIPv6::validateCoTMessage ( Packet inPacket,
const CareOfTest CoT 
)
protected

Like validateHoTMessage(), but related to CoT.

1886 {
1887  // RFC - 11.6.2
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();
1892 
1893  /* The Source Address of the packet belongs to a correspondent node
1894  for which the mobile node has a Binding Update List entry with a
1895  state indicating that return routability procedure is in progress.
1896  Note that there may be multiple such entries. */
1897  BindingUpdateList::BindingUpdateListEntry *bulEntry = bul->lookup(srcAddr);
1898  if (bulEntry == nullptr) {
1899  EV_WARN << "Invalid CoT: No entry in BUL" << endl;
1900  return false; // no entry in BUL
1901  }
1902 
1903  if (bulEntry->sentHoTI == 0 && bulEntry->sentCoTI == 0) {
1904  EV_WARN << "Invalid CoT: No RR procedure initialized for this CN." << endl;
1905  return false; // no RR procedure started for this entry
1906  }
1907 
1908  /* The Binding Update List indicates that no care-of keygen token has
1909  been received yet.. */
1910  // TODO reactive this code as soon as token expiry is available in the BUL
1911  /*if (bulEntry->tokenC != UNDEFINED_TOKEN)
1912  {
1913  EV << "Invalid CoT: Already received a care-of keygen token." << endl;
1914  return false; // 0 is expected to indicate "undefined"
1915  }*/
1916 
1917  /* The Destination Address of the packet is the current care-of
1918  address of the mobile node. */
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;
1922  return false;
1923  }
1924 
1925  /* The Care-of Init Cookie field in the message matches the value
1926  stored in the Binding Update List. */
1927  if (bulEntry->cookieCoTI != (int)CoT.getCareOfInitCookie()) {
1928  EV_WARN << "Invalid CoT: Cookie value different from the stored one." << endl;
1929  return false;
1930  }
1931 
1932  // if we have come that far, the CoT is valid
1933  return true;
1934 }

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.

1789 {
1790  // RFC - 11.6.2
1791  Ipv6Address srcAddr = inPacket->getTag<L3AddressInd>()->getSrcAddress().toIpv6();
1792  Ipv6Address destAddr = inPacket->getTag<L3AddressInd>()->getDestAddress().toIpv6();
1793 // int interfaceID = ctrlInfo->interfaceId();
1794 
1795  /* The Source Address of the packet belongs to a correspondent node
1796  for which the mobile node has a Binding Update List entry with a
1797  state indicating that return routability procedure is in progress.
1798  Note that there may be multiple such entries. */
1799  BindingUpdateList::BindingUpdateListEntry *bulEntry = bul->lookup(srcAddr);
1800  if (bulEntry == nullptr) {
1801  EV_WARN << "Invalid HoT: No entry in BUL" << endl;
1802  return false; // no entry in BUL
1803  }
1804 
1805  /* The Binding Update List indicates that no home keygen token has
1806  been received yet. */
1807  // TODO reactivate this code as soon as token expiry is available in the BUL
1808  /*if (bulEntry->tokenH != UNDEFINED_TOKEN)
1809  {
1810  EV << "Invalid HoT: Home keygen token already exists." << endl;
1811  return false; // 0 is expected to indicate "undefined"
1812  }*/
1813 
1814  /* The Destination Address of the packet has the home address of the
1815  mobile node, and the packet has been received in a tunnel from the
1816  home agent. */
1817  // TODO check whether it is necessary to check HoA exlusively for the
1818  // interface the message was received on.
1819  if (!rt6->isHomeAddress(destAddr)) {
1820  EV_WARN << "Invalid HoT: Destination Address not HoA." << endl;
1821  return false; // TODO check whether packet was received from HA tunnel
1822  }
1823 
1824  /* The Home Init Cookie field in the message matches the value stored
1825  in the Binding Update List. */
1826  if (bulEntry->cookieHoTI != (int)homeTest.getHomeInitCookie()) {
1827  EV_WARN << "Invalid HoT: Cookie value different from the stored one." << endl;
1828  return false;
1829  }
1830 
1831  // if we have come that far, the HoT is valid
1832  return true;
1833 }

Referenced by processHoTMessage().

◆ validateType2RH()

bool inet::xMIPv6::validateType2RH ( const Ipv6Header ipv6Header,
const Ipv6RoutingHeader rh 
)
protected

Perform validity checks according to RFC 3775 - Section 6.4.

2094 {
2095  // cf. RFC 3775 - 6.4
2096 
2097  if (rh.getAddressArraySize() != 1) {
2098  EV_WARN << "Invalid RH2 header: no HoA provided!" << endl;
2099  return false;
2100  }
2101 
2102  Ipv6Address CoA = ipv6Header.getSrcAddress();
2103  Ipv6Address HoA = rh.getAddress(0);
2104 
2105  /* The IP address contained in the routing header, since it is the mobile
2106  node's home address, MUST be a unicast routable address. */
2107  if (!HoA.isUnicast()) {
2108  EV_WARN << "Invalid RH2 header: address in RH2 is not a unicast routable address!" << endl;
2109  return false;
2110  }
2111 
2112  /* Furthermore, if the scope of the home address is smaller than the
2113  scope of the care-of address, the mobile node MUST discard the packet */
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;
2116  return false;
2117  }
2118 
2119  return true;
2120 }

Referenced by processType2RH().

Member Data Documentation

◆ bc

◆ bul

◆ cnList

◆ ift

◆ interfaceCoAList

InterfaceCoAList inet::xMIPv6::interfaceCoAList
protected

◆ ipv6nd

ModuleRefByPar<Ipv6NeighbourDiscovery> inet::xMIPv6::ipv6nd
protected

Referenced by initialize(), and processBAMessage().

◆ itCNList

CnList::iterator inet::xMIPv6::itCNList
protected

Referenced by processBAMessage(), and returningHome().

◆ 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:
inet::EXPIRED_CARE_OF_NONCE_INDEX
@ EXPIRED_CARE_OF_NONCE_INDEX
Definition: MobilityHeader_m.h:235
CHK
#define CHK(x)
Definition: INETDefs.h:87
inet::xMIPv6::removeCoAEntries
void removeCoAEntries()
Remove all entries from the interfaceCoAList.
Definition: xMIPv6.cc:2368
MK_BUL_EXPIRY
#define MK_BUL_EXPIRY
Definition: xMIPv6.cc:38
inet::xMIPv6::createBUTimer
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
inet::xMIPv6::validateBUMessage
bool validateBUMessage(Packet *inPacket, const Ptr< const BindingUpdate > &bu)
Validate a BU - only applicable to HAs and CNs.
Definition: xMIPv6.cc:942
inet::CARE_OF_TEST
@ CARE_OF_TEST
Definition: MobilityHeader_m.h:80
inet::xMIPv6::sendPeriodicBU
void sendPeriodicBU(cMessage *msg)
This method is called when the timer created in createBUTimer() has fired.
Definition: xMIPv6.cc:399
inet::CARE_OF_TEST_INIT
@ CARE_OF_TEST_INIT
Definition: MobilityHeader_m.h:78
inet::xMIPv6::createAndSendCoTIMessage
void createAndSendCoTIMessage(const Ipv6Address &cnDest, NetworkInterface *ie)
Creates and sends a CoTI message to the specified destination.
Definition: xMIPv6.cc:1689
inet::BindingUpdateList::RR_COMPLETE
@ RR_COMPLETE
Definition: BindingUpdateList.h:42
inet::xMIPv6::processCoTIMessage
void processCoTIMessage(Packet *inPacket, const Ptr< const CareOfTestInit > &CoTI)
Create and send a CoT message.
Definition: xMIPv6.cc:1724
inet::BindingUpdateList::NONE
@ NONE
Definition: BindingUpdateList.h:40
inet::BINDING_UPDATE_ACCEPTED
@ BINDING_UPDATE_ACCEPTED
Definition: MobilityHeader_m.h:224
inet::BINDING_ERROR
@ BINDING_ERROR
Definition: MobilityHeader_m.h:83
inet::REGISTRATION_TYPE_CHANGE_DISALLOWED
@ REGISTRATION_TYPE_CHANGE_DISALLOWED
Definition: MobilityHeader_m.h:237
inet::xMIPv6::getTimerIfEntry
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
inet::xMIPv6::checkForBUtoCN
bool checkForBUtoCN(BindingUpdateList::BindingUpdateListEntry &bulEntry, NetworkInterface *ie)
Send a BU depending on current status of:
Definition: xMIPv6.cc:1936
TRANSMIT_TYPE_BU
#define TRANSMIT_TYPE_BU
Definition: xMIPv6.h:44
inet::xMIPv6::cancelTimerIfEntry
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
inet::NOT_HA_FOR_THIS_MN
@ NOT_HA_FOR_THIS_MN
Definition: MobilityHeader_m.h:231
inet::xMIPv6::createAndSendBEMessage
void createAndSendBEMessage(const Ipv6Address &dest, const BeStatus &beStatus)
Creates and sends Binding Error message.
Definition: xMIPv6.cc:2176
inet::Protocol::ipv6
static const Protocol ipv6
Definition: Protocol.h:94
inet::xMIPv6::fetchBUTransmitIfEntry
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
inet::Ipv6Tunneling::MOBILITY
@ MOBILITY
Definition: Ipv6Tunneling.h:47
inet::xMIPv6::validateHoTMessage
bool validateHoTMessage(Packet *inPacket, const HomeTest &HoT)
Verifies a HoT according to the RFC, Section 11.6.2.
Definition: xMIPv6.cc:1788
inet::xMIPv6::sendBUtoCN
void sendBUtoCN(BindingUpdateList::BindingUpdateListEntry &bulEntry, NetworkInterface *ie)
Creates a timer for sending a BU.
Definition: xMIPv6.cc:1995
inet::xMIPv6::processHoTIMessage
void processHoTIMessage(Packet *inPacket, const Ptr< const HomeTestInit > &HoTI)
Create and send a HoT message.
Definition: xMIPv6.cc:1700
inet::xMIPv6::rt6
opp_component_ptr< Ipv6RoutingTable > rt6
Definition: xMIPv6.h:62
inet::BINDING_REFRESH_REQUEST
@ BINDING_REFRESH_REQUEST
Definition: MobilityHeader_m.h:76
SIZE_BE
#define SIZE_BE
Definition: xMIPv6.cc:58
BRR_TIMEOUT_THRESHOLD
#define BRR_TIMEOUT_THRESHOLD
Definition: xMIPv6.cc:41
inet::xMIPv6::handleTokenExpiry
void handleTokenExpiry(cMessage *msg)
Handles the event that indicates that a {care-of,home} keygen token has expired.
Definition: xMIPv6.cc:2677
inet::xMIPv6::createTokenEntryExpiryTimer
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
inet::xMIPv6::handleBULExpiry
void handleBULExpiry(cMessage *msg)
Handles the situation of a BUL expiry.
Definition: xMIPv6.cc:2543
inet::xMIPv6::validateType2RH
bool validateType2RH(const Ipv6Header &ipv6Header, const Ipv6RoutingHeader &rh)
Perform validity checks according to RFC 3775 - Section 6.4.
Definition: xMIPv6.cc:2093
inet::xMIPv6::interfaceCoAList
InterfaceCoAList interfaceCoAList
Definition: xMIPv6.h:120
inet::getContainingNode
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
MK_TOKEN_EXPIRY
#define MK_TOKEN_EXPIRY
Definition: xMIPv6.cc:40
inet::xMIPv6::transmitIfList
TransmitIfList transmitIfList
Definition: xMIPv6.h:116
EXPIRY_TYPE_BUL
#define EXPIRY_TYPE_BUL
Definition: xMIPv6.h:47
CO_COOKIE
#define CO_COOKIE
Definition: BindingUpdateList.h:28
inet::UNKNOWN_BINDING_FOR_HOME_ADDRESS_DEST_OPTION
@ UNKNOWN_BINDING_FOR_HOME_ADDRESS_DEST_OPTION
Definition: MobilityHeader_m.h:315
InterfaceReq
removed InterfaceReq
Definition: IUdp-gates.txt:11
DispatchProtocolReq
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
inet::INITSTAGE_NETWORK_LAYER
INET_API InitStage INITSTAGE_NETWORK_LAYER
Initialization of network layer protocols.
inet::xMIPv6::cnList
CnList cnList
Definition: xMIPv6.h:124
EXPIRY_TYPE_BC
#define EXPIRY_TYPE_BC
Definition: xMIPv6.h:48
L3AddressInd
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
inet::xMIPv6::removeTimerEntries
void removeTimerEntries(const Ipv6Address &dest, int interfaceId)
Removes timers of all types for the specified destination address and interfaceId.
Definition: xMIPv6.cc:2311
SIZE_MOBILITY_HEADER
#define SIZE_MOBILITY_HEADER
Definition: xMIPv6.cc:48
HO_COOKIE
#define HO_COOKIE
Definition: BindingUpdateList.h:26
SIZE_BACK
#define SIZE_BACK
Definition: xMIPv6.cc:52
inet::HOME_TEST_INIT
@ HOME_TEST_INIT
Definition: MobilityHeader_m.h:77
inet::Ipv6Tunneling::T2RH
@ T2RH
Definition: Ipv6Tunneling.h:45
inet::xMIPv6::sendTestInit
void sendTestInit(cMessage *msg)
If a TestInit timer was fired, this method gets called.
Definition: xMIPv6.cc:1501
KEY_BC_EXP
#define KEY_BC_EXP
Definition: xMIPv6.h:40
inet::mipv6RoCompletedSignal
simsignal_t mipv6RoCompletedSignal
Definition: Simsignals.cc:66
TRANSMIT_TYPE_TI
#define TRANSMIT_TYPE_TI
Definition: xMIPv6.h:45
KEY_CI
#define KEY_CI
Definition: xMIPv6.h:37
inet::xMIPv6::createAndSendBAMessage
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
SIZE_BIND_AUTH_DATA
#define SIZE_BIND_AUTH_DATA
Definition: xMIPv6.cc:51
inet::BindingUpdateList::RR
@ RR
Definition: BindingUpdateList.h:41
inet::insertNetworkProtocolHeader
void insertNetworkProtocolHeader(Packet *packet, const Protocol &protocol, const Ptr< NetworkHeaderBase > &header)
Definition: L3Tools.cc:70
inet::packetDroppedSignal
simsignal_t packetDroppedSignal
Definition: Simsignals.cc:85
inet::BINDING_ACKNOWLEDGEMENT
@ BINDING_ACKNOWLEDGEMENT
Definition: MobilityHeader_m.h:82
inet::xMIPv6::processBRRMessage
void processBRRMessage(Packet *inPacket, const Ptr< const BindingRefreshRequest > &brr)
Processes the Binding Refresh Message.
Definition: xMIPv6.cc:2472
inet::EXPIRED_HOME_NONCE_INDEX
@ EXPIRED_HOME_NONCE_INDEX
Definition: MobilityHeader_m.h:234
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::HOME_TEST
@ HOME_TEST
Definition: MobilityHeader_m.h:79
inet::xMIPv6::createAndSendHoTIMessage
void createAndSendHoTIMessage(const Ipv6Address &cnDest, NetworkInterface *ie)
Creates and sends a HoTI message to the specified destination.
Definition: xMIPv6.cc:1678
inet::xMIPv6::ipv6nd
ModuleRefByPar< Ipv6NeighbourDiscovery > ipv6nd
Definition: xMIPv6.h:66
inet::xMIPv6::bc
ModuleRefByPar< BindingCache > bc
Definition: xMIPv6.h:64
inet::xMIPv6::createAndSendBUMessage
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
inet::NOT_HOME_SUBNET
@ NOT_HOME_SUBNET
Definition: MobilityHeader_m.h:230
inet::Ipv6Tunneling::HA_OPT
@ HA_OPT
Definition: Ipv6Tunneling.h:46
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::xMIPv6::createBULEntryExpiryTimer
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
inet::xMIPv6::updateBUL
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
inet::xMIPv6::sendPeriodicBRR
void sendPeriodicBRR(cMessage *msg)
Handles a fired BRR message transmission structure.
Definition: xMIPv6.cc:2425
SIZE_HOT
#define SIZE_HOT
Definition: xMIPv6.cc:56
inet::xMIPv6::triggerRouteOptimization
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
inet::xMIPv6::processHoTMessage
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
inet::xMIPv6::createDeregisterBUTimer
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
inet::contains
bool contains(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:65
inet::xMIPv6::createBCEntryExpiryTimer
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
KEY_CTOKEN_EXP
#define KEY_CTOKEN_EXP
Definition: xMIPv6.h:42
HopLimitReq
removed HopLimitReq
Definition: IUdp-gates.txt:11
inet::BindingUpdateList::REGISTER
@ REGISTER
Definition: BindingUpdateList.h:43
inet::xMIPv6::createTestInitTimer
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
UNDEFINED_BIND_AUTH_DATA
#define UNDEFINED_BIND_AUTH_DATA
Definition: BindingUpdateList.h:25
inet::xMIPv6::handleBCExpiry
void handleBCExpiry(cMessage *msg)
Handles the expiry of a BC entry.
Definition: xMIPv6.cc:2627
SIZE_COT
#define SIZE_COT
Definition: xMIPv6.cc:57
inet::BINDING_UPDATE
@ BINDING_UPDATE
Definition: MobilityHeader_m.h:81
MK_SEND_PERIODIC_BU
#define MK_SEND_PERIODIC_BU
Definition: xMIPv6.cc:35
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::xMIPv6::validateBUderegisterMessage
bool validateBUderegisterMessage(Packet *inPacket, const Ptr< const BindingUpdate > &bu)
Similiar to validateBUMessage().
Definition: xMIPv6.cc:1042
PRE_BINDING_EXPIRY
#define PRE_BINDING_EXPIRY
Definition: BindingUpdateList.h:31
SIZE_BU
#define SIZE_BU
Definition: xMIPv6.cc:49
inet::OTHER_PACKET_DROP
@ OTHER_PACKET_DROP
Definition: Simsignals_m.h:84
inet::xMIPv6::sendMobilityMessageToIPv6Module
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
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
SIZE_HOTI
#define SIZE_HOTI
Definition: xMIPv6.cc:54
SIZE_HOA_OPTION
#define SIZE_HOA_OPTION
Definition: xMIPv6.cc:50
inet::xMIPv6::cancelEntries
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
MK_SEND_TEST_INIT
#define MK_SEND_TEST_INIT
Definition: xMIPv6.cc:37
KEY_HI
#define KEY_HI
Definition: xMIPv6.h:36
inet::Protocol::mobileipv6
static const Protocol mobileipv6
Definition: Protocol.h:100
inet::xMIPv6::ift
ModuleRefByPar< IInterfaceTable > ift
Definition: xMIPv6.h:61
inet::BaStatus
BaStatus
Enum generated from inet/networklayer/xmipv6/MobilityHeader.msg:54 by opp_msgtool.
Definition: MobilityHeader_m.h:223
inet::BindingUpdateList::DEREGISTER
@ DEREGISTER
Definition: BindingUpdateList.h:45
KEY_BUL_EXP
#define KEY_BUL_EXP
Definition: xMIPv6.h:39
inet::xMIPv6::processHoAOpt
void processHoAOpt(Packet *packet, HomeAddressOption *hoaOpt)
Process the Home Address Option which belongs to the provided datagram.
Definition: xMIPv6.cc:2122
KEY_BU
#define KEY_BU
Definition: xMIPv6.h:35
inet::xMIPv6::bul
ModuleRefByPar< BindingUpdateList > bul
Definition: xMIPv6.h:63
inet::xMIPv6::validateCoTMessage
bool validateCoTMessage(Packet *inPacket, const CareOfTest &CoT)
Like validateHoTMessage(), but related to CoT.
Definition: xMIPv6.cc:1885
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::xMIPv6::validateBAck
bool validateBAck(Packet *inPacket, const BindingAcknowledgement &ba)
Validates a Binding Acknowledgement for a mobile node.
Definition: xMIPv6.cc:1313
inet::Ipv6Tunneling::NORMAL
@ NORMAL
Definition: Ipv6Tunneling.h:44
inet::xMIPv6::createCareOfTokenEntryExpiryTimer
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
inet::xMIPv6::createAndSendBRRMessage
void createAndSendBRRMessage(const Ipv6Address &dest, NetworkInterface *ie)
Creates a Binding Refresh Request and sends it to the Ipv6 module.
Definition: xMIPv6.cc:2451
inet::xMIPv6::createHomeTokenEntryExpiryTimer
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
SIZE_NONCE_INDICES
#define SIZE_NONCE_INDICES
Definition: xMIPv6.cc:53
inet::xMIPv6::processCoTMessage
void processCoTMessage(Packet *inPacket, const Ptr< const CareOfTest > &CoT)
Like processHoTMessage(), but related to CoT.
Definition: xMIPv6.cc:1835
inet::HOME_REGISTRATION_NOT_SUPPORTED
@ HOME_REGISTRATION_NOT_SUPPORTED
Definition: MobilityHeader_m.h:229
inet::xMIPv6::processBAMessage
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
inet::Macho::Key
void * Key
Definition: Macho.h:327
KEY_HTOKEN_EXP
#define KEY_HTOKEN_EXP
Definition: xMIPv6.h:41
inet::xMIPv6::tunneling
ModuleRefByPar< Ipv6Tunneling > tunneling
Definition: xMIPv6.h:65
inet::uint
unsigned int uint
Definition: INETDefs.h:55
inet::xMIPv6::processMobilityMessage
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
inet::xMIPv6::itCNList
CnList::iterator itCNList
Definition: xMIPv6.h:125
KEY_BR
#define KEY_BR
Definition: xMIPv6.h:38
inet::xMIPv6::processBUMessage
void processBUMessage(Packet *inPacket, const Ptr< const BindingUpdate > &bu)
Process a BU - only applicable to HAs and CNs.
Definition: xMIPv6.cc:680
inet::xMIPv6::processType2RH
void processType2RH(Packet *packet, Ipv6RoutingHeader *rh)
Process the Type 2 Routing Header which belongs to the provided datagram.
Definition: xMIPv6.cc:2017
inet::BeStatus
BeStatus
Enum generated from inet/networklayer/xmipv6/MobilityHeader.msg:86 by opp_msgtool.
Definition: MobilityHeader_m.h:314
inet::xMIPv6::initReturnRoutability
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
inet::BindingUpdateList::REGISTERED
@ REGISTERED
Definition: BindingUpdateList.h:44
inet::containsKey
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80
inet::EXPIRED_NONCES
@ EXPIRED_NONCES
Definition: MobilityHeader_m.h:236
MK_BC_EXPIRY
#define MK_BC_EXPIRY
Definition: xMIPv6.cc:39
BRR_RETRIES
#define BRR_RETRIES
Definition: xMIPv6.cc:42
MK_SEND_PERIODIC_BR
#define MK_SEND_PERIODIC_BR
Definition: xMIPv6.cc:36
SIZE_BRR
#define SIZE_BRR
Definition: xMIPv6.cc:59
EXPIRY_TYPE_TOKEN
#define EXPIRY_TYPE_TOKEN
Definition: xMIPv6.h:50
SIZE_COTI
#define SIZE_COTI
Definition: xMIPv6.cc:55