INET Framework for OMNeT++/OMNEST
inet::dymo::Dymo Class Reference

This class provides Dynamic MANET On-demand (Dymo also known as AODVv2) Routing based on the IETF draft at http://tools.ietf.org/html/draft-ietf-manet-dymo-24. More...

#include <Dymo.h>

Inheritance diagram for inet::dymo::Dymo:
inet::RoutingProtocolBase inet::NetfilterBase::HookBase inet::OperationalBase inet::INetfilter::IHook inet::OperationalMixin< cSimpleModule > inet::ILifecycle

Public Member Functions

 Dymo ()
 
virtual ~Dymo ()
 
- Public Member Functions inherited from inet::RoutingProtocolBase
 RoutingProtocolBase ()
 
- Public Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual ~OperationalMixin ()
 }@ More...
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 
- Public Member Functions inherited from inet::NetfilterBase::HookBase
virtual ~HookBase ()
 
void registeredTo (INetfilter *nf)
 
void unregisteredFrom (INetfilter *nf)
 
bool isRegisteredHook (INetfilter *nf)
 
- Public Member Functions inherited from inet::INetfilter::IHook
virtual ~IHook ()
 

Protected Member Functions

virtual int numInitStages () const override
 
void initialize (int stage) override
 
void handleMessageWhenUp (cMessage *message) override
 
- Protected Member Functions inherited from inet::RoutingProtocolBase
virtual bool isInitializeStage (int stage) const override
 
virtual bool isModuleStartStage (int stage) const override
 
virtual bool isModuleStopStage (int stage) const override
 
- Protected Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual int numInitStages () const override
 
virtual void refreshDisplay () const override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void handleMessageWhenDown (cMessage *msg)
 
virtual bool handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual State getInitialOperationalState () const
 Returns initial operational state: OPERATING or NOT_OPERATING. More...
 
virtual void handleActiveOperationTimeout (cMessage *message)
 
virtual bool isUp () const
 utility functions More...
 
virtual bool isDown () const
 
virtual void setOperationalState (State newState)
 
virtual void scheduleOperationTimeout (simtime_t timeout)
 
virtual void setupActiveOperation (LifecycleOperation *operation, IDoneCallback *doneCallback, State)
 
virtual void delayActiveOperationFinish (simtime_t timeout)
 
virtual void startActiveOperationExtraTime (simtime_t delay=SIMTIME_ZERO)
 
virtual void startActiveOperationExtraTimeOrFinish (simtime_t extraTime)
 
virtual void finishActiveOperation ()
 

Private Member Functions

void processSelfMessage (cMessage *message)
 
void processMessage (cMessage *message)
 
void startRouteDiscovery (const L3Address &target)
 
void retryRouteDiscovery (const L3Address &target, int retryCount)
 
void completeRouteDiscovery (const L3Address &target)
 
void cancelRouteDiscovery (const L3Address &target)
 
bool hasOngoingRouteDiscovery (const L3Address &target)
 
void delayDatagram (Packet *datagram)
 
void reinjectDelayedDatagram (Packet *datagram)
 
void dropDelayedDatagram (Packet *datagram)
 
void eraseDelayedDatagrams (const L3Address &target)
 
bool hasDelayedDatagrams (const L3Address &target)
 
void cancelRreqTimer (const L3Address &target)
 
void deleteRreqTimer (const L3Address &target)
 
void eraseRreqTimer (const L3Address &target)
 
RreqWaitRrepTimercreateRreqWaitRrepTimer (const L3Address &target, int retryCount)
 
void scheduleRreqWaitRrepTimer (RreqWaitRrepTimer *message)
 
void processRreqWaitRrepTimer (RreqWaitRrepTimer *message)
 
RreqBackoffTimercreateRreqBackoffTimer (const L3Address &target, int retryCount)
 
void scheduleRreqBackoffTimer (RreqBackoffTimer *message)
 
void processRreqBackoffTimer (RreqBackoffTimer *message)
 
simtime_t computeRreqBackoffTime (int retryCount)
 
RreqHolddownTimercreateRreqHolddownTimer (const L3Address &target)
 
void scheduleRreqHolddownTimer (RreqHolddownTimer *message)
 
void processRreqHolddownTimer (RreqHolddownTimer *message)
 
void sendUdpPacket (cPacket *packet)
 
void cancelJitterTimerPacket (PacketJitterTimer *msg)
 
void eraseJitterTimerPacket (PacketJitterTimer *msg)
 
void scheduleJitterTimerPacket (cPacket *packet, double delay)
 
void processJitterTimerPacket (PacketJitterTimer *msg)
 
void processUdpPacket (Packet *packet)
 
void sendDymoPacket (const Ptr< DymoPacket > &packet, const NetworkInterface *networkInterface, const L3Address &nextHop, double delay)
 
void processDymoPacket (Packet *packet, const Ptr< const DymoPacket > &dymoPacket)
 
bool permissibleRteMsg (Packet *packet, const Ptr< const RteMsg > &rteMsg)
 
void processRteMsg (Packet *packet, const Ptr< const RteMsg > &rteMsg)
 
b computeRteMsgLength (const Ptr< RteMsg > &rteMsg)
 
const Ptr< RreqcreateRreq (const L3Address &target, int retryCount)
 
void sendRreq (const Ptr< Rreq > &rreq)
 
void processRreq (Packet *packet, const Ptr< const Rreq > &rreq)
 
b computeRreqLength (const Ptr< Rreq > &rreq)
 
const Ptr< RrepcreateRrep (const Ptr< const RteMsg > &rteMsg)
 
const Ptr< RrepcreateRrep (const Ptr< const RteMsg > &rteMsg, IRoute *route)
 
void sendRrep (const Ptr< Rrep > &rrep)
 
void sendRrep (const Ptr< Rrep > &rrep, IRoute *route)
 
void processRrep (Packet *packet, const Ptr< const Rrep > &rrep)
 
b computeRrepLength (const Ptr< Rrep > &rrep)
 
const Ptr< RerrcreateRerr (std::vector< L3Address > &addresses)
 
void sendRerr (const Ptr< Rerr > &rerr)
 
void sendRerrForUndeliverablePacket (const L3Address &destination)
 
void sendRerrForBrokenLink (const NetworkInterface *networkInterface, const L3Address &nextHop)
 
void processRerr (Packet *packet, const Ptr< const Rerr > &rerr)
 
b computeRerrLength (const Ptr< Rerr > &rerr)
 
IRoutecreateRoute (Packet *packet, const Ptr< const RteMsg > &rteMsg, const AddressBlock &addressBlock)
 
void updateRoutes (Packet *packet, const Ptr< const RteMsg > &rteMsg, const AddressBlock &addressBlock)
 
void updateRoute (Packet *packet, const Ptr< const RteMsg > &rteMsg, const AddressBlock &addressBlock, IRoute *route)
 
int getLinkCost (const NetworkInterface *networkInterface, DymoMetricType metricType)
 
bool isLoopFree (const Ptr< const RteMsg > &rteMsg, IRoute *route)
 
void processExpungeTimer ()
 
void scheduleExpungeTimer ()
 
void expungeRoutes ()
 
simtime_t getNextExpungeTime ()
 
DymoRouteState getRouteState (DymoRouteData *routeData)
 
void configureInterfaces ()
 
L3Address getSelfAddress ()
 
bool isClientAddress (const L3Address &address)
 
void addSelfNode (const Ptr< RteMsg > &rteMsg)
 
void addNode (const Ptr< RteMsg > &rteMsg, AddressBlock &addressBlock)
 
void incrementSequenceNumber ()
 
Result ensureRouteForDatagram (Packet *datagram)
 
virtual Result datagramPreRoutingHook (Packet *datagram) override
 This is the first hook called by the network protocol before it routes a datagram that was received from the lower layer. More...
 
virtual Result datagramForwardHook (Packet *datagram) override
 This is the second hook called by the network protocol before it sends a datagram to the lower layer. More...
 
virtual Result datagramPostRoutingHook (Packet *datagram) override
 This is the last hook called by the network protocol before it sends a datagram to the lower layer. More...
 
virtual Result datagramLocalInHook (Packet *datagram) override
 This is the last hook called by the network protocol before it sends a datagram to the upper layer. More...
 
virtual Result datagramLocalOutHook (Packet *datagram) override
 This is the first hook called by the network protocol before it routes a datagram that was received from the upper layer. More...
 
virtual void handleStartOperation (LifecycleOperation *operation) override
 
virtual void handleStopOperation (LifecycleOperation *operation) override
 
virtual void handleCrashOperation (LifecycleOperation *operation) override
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 

Private Attributes

const char * clientAddresses
 
bool useMulticastRREP
 
const char * interfaces
 
double activeInterval
 
double maxIdleTime
 
double maxSequenceNumberLifetime
 
double routeRREQWaitTime
 
double rreqHolddownTime
 
int maxHopCount
 
int discoveryAttemptsMax
 
bool appendInformation
 
int bufferSizePackets
 
int bufferSizeBytes
 
simtime_t maxJitter
 
bool sendIntermediateRREP
 
int minHopLimit
 
int maxHopLimit
 
cModule * host
 
IL3AddressTypeaddressType
 
ModuleRefByPar< IInterfaceTableinterfaceTable
 
ModuleRefByPar< IRoutingTableroutingTable
 
ModuleRefByPar< INetfilternetworkProtocol
 
cMessage * expungeTimer
 
DymoSequenceNumber sequenceNumber
 
std::map< L3Address, DymoSequenceNumbertargetAddressToSequenceNumber
 
std::map< L3Address, RreqTimer * > targetAddressToRREQTimer
 
std::multimap< L3Address, Packet * > targetAddressToDelayedPackets
 
std::set< PacketJitterTimer * > packetJitterTimers
 
std::vector< std::pair< L3Address, int > > clientAddressAndPrefixLengthPairs
 

Additional Inherited Members

- Public Types inherited from inet::INetfilter::IHook
enum  Type {
  PREROUTING, LOCALIN, FORWARD, POSTROUTING,
  LOCALOUT
}
 
enum  Result { ACCEPT, DROP, QUEUE, STOLEN }
 
- Protected Types inherited from inet::OperationalMixin< cSimpleModule >
enum  State
 
- Protected Attributes inherited from inet::OperationalMixin< cSimpleModule >
State operationalState
 
simtime_t lastChange
 
Operation activeOperation
 
cMessage * activeOperationTimeout
 
cMessage * activeOperationExtraTimer
 
- Protected Attributes inherited from inet::NetfilterBase::HookBase
std::vector< INetfilter * > netfilters
 

Detailed Description

This class provides Dynamic MANET On-demand (Dymo also known as AODVv2) Routing based on the IETF draft at http://tools.ietf.org/html/draft-ietf-manet-dymo-24.

Optional features implemented:

  • 7.1. Route Discovery Retries and Buffering To reduce congestion in a network, repeated attempts at route discovery for a particular Target Node SHOULD utilize a binary exponential backoff.
  • 13.1. Expanding Rings Multicast Increase hop limit from min to max with each retry.
  • 13.2. Intermediate RREP Allow intermediate Dymo routers to reply with RREP.
  • 13.6. Message Aggregation RFC5148 add jitter to broadcasts

Constructor & Destructor Documentation

◆ Dymo()

inet::dymo::Dymo::Dymo ( )
35  :
36  clientAddresses(nullptr),
37  useMulticastRREP(false),
38  interfaces(nullptr),
44  maxHopCount(-1),
46  appendInformation(false),
48  bufferSizeBytes(-1),
49  maxJitter(NaN),
50  sendIntermediateRREP(false),
51  minHopLimit(-1),
52  maxHopLimit(-1),
53  host(nullptr),
54  addressType(nullptr),
55  expungeTimer(nullptr),
57 {
58 }

◆ ~Dymo()

inet::dymo::Dymo::~Dymo ( )
virtual
61 {
62  for (auto& elem : targetAddressToRREQTimer)
63  cancelAndDelete(elem.second);
64  for (auto& pkt_timer : packetJitterTimers) {
65  cancelAndDelete(pkt_timer);
66  }
67  cancelAndDelete(expungeTimer);
68 }

Member Function Documentation

◆ addNode()

void inet::dymo::Dymo::addNode ( const Ptr< RteMsg > &  rteMsg,
AddressBlock addressBlock 
)
private
1350 {
1351  int size = rteMsg->getAddedNodeArraySize();
1352  rteMsg->setAddedNodeArraySize(size + 1);
1353  rteMsg->setAddedNode(size, addressBlock);
1354 }

Referenced by addSelfNode().

◆ addSelfNode()

void inet::dymo::Dymo::addSelfNode ( const Ptr< RteMsg > &  rteMsg)
private
1333 {
1334  const L3Address& address = getSelfAddress();
1335  AddressBlock addressBlock;
1336  addressBlock.setAddress(address);
1337  addressBlock.setPrefixLength(addressType->getMaxPrefixLength());
1338  addressBlock.setHasValidityTime(false);
1339  addressBlock.setValidityTime(-1);
1340  addressBlock.setHasMetric(true);
1341  addressBlock.setMetric(0);
1342  addressBlock.setHasMetricType(true);
1343  addressBlock.setMetricType(HOP_COUNT);
1344  addressBlock.setHasSequenceNumber(true);
1345  addressBlock.setSequenceNumber(sequenceNumber);
1346  addNode(rteMsg, addressBlock);
1347 }

Referenced by processRrep(), and processRreq().

◆ cancelJitterTimerPacket()

void inet::dymo::Dymo::cancelJitterTimerPacket ( PacketJitterTimer msg)
private
403  {
404  packetJitterTimers.erase(msg);
405  cancelAndDelete(msg);
406 }

◆ cancelRouteDiscovery()

void inet::dymo::Dymo::cancelRouteDiscovery ( const L3Address target)
private
202 {
203  EV_INFO << "Canceling route discovery: originator = " << getSelfAddress() << ", target = " << target << endl;
204  ASSERT(hasOngoingRouteDiscovery(target));
205  auto lt = targetAddressToDelayedPackets.lower_bound(target);
206  auto ut = targetAddressToDelayedPackets.upper_bound(target);
207  for (auto it = lt; it != ut; it++)
208  dropDelayedDatagram(it->second);
209  eraseDelayedDatagrams(target);
210 }

Referenced by handleStopOperation(), and processRreqWaitRrepTimer().

◆ cancelRreqTimer()

void inet::dymo::Dymo::cancelRreqTimer ( const L3Address target)
private
261 {
262  auto tt = targetAddressToRREQTimer.find(target);
263  ASSERT(tt != targetAddressToRREQTimer.end());
264  cancelEvent(tt->second);
265 }

Referenced by processRrep(), and processRreqWaitRrepTimer().

◆ completeRouteDiscovery()

void inet::dymo::Dymo::completeRouteDiscovery ( const L3Address target)
private
191 {
192  EV_INFO << "Completing route discovery: originator = " << getSelfAddress() << ", target = " << target << endl;
193  ASSERT(hasOngoingRouteDiscovery(target));
194  auto lt = targetAddressToDelayedPackets.lower_bound(target);
195  auto ut = targetAddressToDelayedPackets.upper_bound(target);
196  for (auto it = lt; it != ut; it++)
197  reinjectDelayedDatagram(it->second);
198  eraseDelayedDatagrams(target);
199 }

Referenced by processRrep().

◆ computeRerrLength()

b inet::dymo::Dymo::computeRerrLength ( const Ptr< Rerr > &  rerr)
private
1023 {
1024  // TODO validityTime, metric, metricType, TLVs
1025  // 1. <address-block> := <num-addr> <addr-flags> (<head-length><head>?)? (<tail-length><tail>?)? <mid>* <prefix-length>*
1026  int addressBlock = 8 + 8;
1027  // head-length and head are not used
1028  // tail-length and tail are not used
1029  // mid contains the originator and target addresses
1030  addressBlock += rerr->getUnreachableNodeArraySize() * 4 * 8;
1031  // prefix-length is not used (assuming 8 * address-length bits)
1032  // 2. <tlv> := <tlv-type> <tlv-flags> <tlv-type-ext>? (<index-start><index-stop>?)? (<length><value>?)?
1033  int addressTLV = 8 + 8;
1034  // tlv-type-ext is not used
1035  // index-start and index-stop are not used
1036  // length is set to 2 + added node count
1037  addressTLV += 8;
1038  // sequence number values are included
1039  addressTLV += rerr->getUnreachableNodeArraySize() * 2 * 8;
1040  // 3. <tlv-block> := <tlvs-length> <tlv>*
1041  int addressTLVBlock = 16;
1042  // there's exactly one tlv in the block
1043  addressTLVBlock += addressTLV;
1044  // 4. <tlv-block> := <tlvs-length> <tlv>*
1045  int messageTLVBlock = 16;
1046  // there's no TLV in the message TLV block
1047  // 5. <msg-header> := <msg-type> <msg-flags> <msg-addr-length> <msg-size> <msg-orig-addr>? <msg-hop-limit>? <msg-hop-count>? <msg-seq-num>?
1048  int messageHeader = 8 + 4 + 4 + 16;
1049  // msg-orig-addr is not used
1050  // msg-hop-limit is always included in the message header
1051  messageHeader += 8 + 8;
1052  // msg-hop-count is not used
1053  // msg-seq-num is not used
1054  // 6. <message> := <msg-header> <tlv-block> (<addr-block><tlv-block>)*
1055  int message = messageHeader + messageTLVBlock;
1056  // there's exactly one address-block with one tlv-block in the message
1057  message += (addressBlock + addressTLVBlock);
1058  // 7. <pkt-header> := <version> <pkt-flags> <pkt-seq-num>? <tlv-block>?
1059  int packetHeader = 4 + 4;
1060  // pkt-seq-num is not used
1061  // tlv-block is not used
1062  // 8. <packet> := <pkt-header> <message>*
1063  int packet = packetHeader;
1064  // there's exactly one message in the packet
1065  packet += message;
1066  return b(packet);
1067 }

Referenced by sendRerr().

◆ computeRrepLength()

b inet::dymo::Dymo::computeRrepLength ( const Ptr< Rrep > &  rrep)
private
830 {
831  return computeRteMsgLength(rrep);
832 }

Referenced by sendRrep().

◆ computeRreqBackoffTime()

simtime_t inet::dymo::Dymo::computeRreqBackoffTime ( int  retryCount)
private
342 {
343  return pow(routeRREQWaitTime, retryCount);
344 }

Referenced by scheduleRreqBackoffTimer().

◆ computeRreqLength()

b inet::dymo::Dymo::computeRreqLength ( const Ptr< Rreq > &  rreq)
private
712 {
713  return computeRteMsgLength(rreq);
714 }

Referenced by sendRreq().

◆ computeRteMsgLength()

b inet::dymo::Dymo::computeRteMsgLength ( const Ptr< RteMsg > &  rteMsg)
private
551 {
552  // TODO validityTime, metric, metricType, TLVs
553  // 1. <address-block> := <num-addr> <addr-flags> (<head-length><head>?)? (<tail-length><tail>?)? <mid>* <prefix-length>*
554  int addressBlock = 8 + 8;
555  // head-length and head are not used
556  // tail-length and tail are not used
557  // mid contains the originator and target addresses
558  addressBlock += (2 + rteMsg->getAddedNodeArraySize()) * 4 * 8;
559  // prefix-length is not used (assuming 8 * address-length bits)
560  // 2. <tlv> := <tlv-type> <tlv-flags> <tlv-type-ext>? (<index-start><index-stop>?)? (<length><value>?)?
561  int addressTLV = 8 + 8;
562  // tlv-type-ext is not used
563  // index-start and index-stop are not used
564  // length is set to 2 + added node count
565  addressTLV += 8;
566  // sequence number values are included
567  addressTLV += (2 + rteMsg->getAddedNodeArraySize()) * 2 * 8;
568  // 3. <tlv-block> := <tlvs-length> <tlv>*
569  int addressTLVBlock = 16;
570  // there's exactly one tlv in the block
571  addressTLVBlock += addressTLV;
572  // 4. <tlv-block> := <tlvs-length> <tlv>*
573  int messageTLVBlock = 16;
574  // there's no TLV in the message TLV block
575  // 5. <msg-header> := <msg-type> <msg-flags> <msg-addr-length> <msg-size> <msg-orig-addr>? <msg-hop-limit>? <msg-hop-count>? <msg-seq-num>?
576  int messageHeader = 8 + 4 + 4 + 16;
577  // msg-orig-addr is not used
578  // msg-hop-limit and msg-hop-count are always included in the message header
579  messageHeader += 8 + 8;
580  // msg-seq-num is not used
581  // 6. <message> := <msg-header> <tlv-block> (<addr-block><tlv-block>)*
582  int message = messageHeader + messageTLVBlock;
583  // there's exactly one address-block with one tlv-block in the message
584  message += (addressBlock + addressTLVBlock);
585  // 7. <pkt-header> := <version> <pkt-flags> <pkt-seq-num>? <tlv-block>?
586  int packetHeader = 4 + 4;
587  // pkt-seq-num is not used
588  // tlv-block is not used
589  // 8. <packet> := <pkt-header> <message>*
590  int packet = packetHeader;
591  // there's exactly one message in the packet
592  packet += message;
593  return b(packet);
594 }

Referenced by computeRrepLength(), and computeRreqLength().

◆ configureInterfaces()

void inet::dymo::Dymo::configureInterfaces ( )
private
1292 {
1293  // join multicast groups
1294  cPatternMatcher interfaceMatcher(interfaces, false, true, false);
1295  for (int i = 0; i < interfaceTable->getNumInterfaces(); i++) {
1296  NetworkInterface *networkInterface = interfaceTable->getInterface(i);
1297  if (networkInterface->isMulticast() && interfaceMatcher.matches(networkInterface->getInterfaceName()))
1298  // Most AODVv2 messages are sent with the IP destination address set to the link-local
1299  // multicast address LL-MANET-Routers [RFC5498] unless otherwise specified. Therefore,
1300  // all AODVv2 routers MUST subscribe to LL-MANET-Routers [RFC5498] to receiving AODVv2 messages.
1301  networkInterface->joinMulticastGroup(addressType->getLinkLocalManetRoutersMulticastAddress());
1302  }
1303 }

Referenced by handleStartOperation().

◆ createRerr()

const Ptr< Rerr > inet::dymo::Dymo::createRerr ( std::vector< L3Address > &  addresses)
private
839 {
840  auto rerr = makeShared<Rerr>(); // TODO "RERR");
841  for (auto& unreachableAddresse : unreachableAddresses) {
842  const L3Address& unreachableAddress = unreachableAddresse;
843  AddressBlock *addressBlock = new AddressBlock();
844  addressBlock->setAddress(unreachableAddress);
845  addressBlock->setPrefixLength(addressType->getMaxPrefixLength());
846  addressBlock->setHasValidityTime(false);
847  addressBlock->setHasMetric(false);
848  addressBlock->setHasMetricType(false);
849  auto st = targetAddressToSequenceNumber.find(unreachableAddress);
850  if (st != targetAddressToSequenceNumber.end()) {
851  addressBlock->setHasSequenceNumber(true);
852  addressBlock->setSequenceNumber(st->second);
853  }
854  else
855  addressBlock->setHasSequenceNumber(false);
856  int size = rerr->getUnreachableNodeArraySize();
857  rerr->setUnreachableNodeArraySize(size + 1);
858  rerr->setUnreachableNode(size, *addressBlock);
859  }
860  rerr->setHopLimit(maxHopLimit);
861  return rerr;
862 }

Referenced by processRerr(), sendRerrForBrokenLink(), and sendRerrForUndeliverablePacket().

◆ createRoute()

IRoute * inet::dymo::Dymo::createRoute ( Packet packet,
const Ptr< const RteMsg > &  rteMsg,
const AddressBlock addressBlock 
)
private
1127 {
1128  IRoute *route = routingTable->createRoute();
1129  route->setSourceType(IRoute::DYMO);
1130  route->setSource(this);
1131  route->setProtocolData(new DymoRouteData());
1132  updateRoute(packet, rteMsg, addressBlock, route);
1133  return route;
1134 }

Referenced by updateRoutes().

◆ createRrep() [1/2]

const Ptr< Rrep > inet::dymo::Dymo::createRrep ( const Ptr< const RteMsg > &  rteMsg)
private
721 {
722  return createRrep(rteMsg, nullptr);
723 }

Referenced by processRreq().

◆ createRrep() [2/2]

const Ptr< Rrep > inet::dymo::Dymo::createRrep ( const Ptr< const RteMsg > &  rteMsg,
IRoute route 
)
private
726 {
727  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(route->getProtocolData());
728  auto rrep = makeShared<Rrep>(); // TODO "RREP");
729  AddressBlock& originatorNode = rrep->getOriginatorNodeForUpdate();
730  AddressBlock& targetNode = rrep->getTargetNodeForUpdate();
731  // 1. RREP_Gen first uses the routing information to update its route
732  // table entry for OrigNode if necessary as specified in Section 6.2.
733  // NOTE: this is already done
734  // 2. RREP_Gen MUST increment its OwnSeqNum by one (1) according to
735  // the rules specified in Section 5.5.
737  // 3. RREP.AddrBlk[OrigNode] := RREQ.AddrBlk[OrigNode]
738  originatorNode = AddressBlock(rteMsg->getOriginatorNode());
739  // 4. RREP.AddrBlk[TargNode] := RREQ.AddrBlk[TargNode]
740  targetNode = AddressBlock(rteMsg->getTargetNode());
741  // 5. RREP.SeqNumTLV[OrigNode] := RREQ.SeqNumTLV[OrigNode]
742  originatorNode.setHasSequenceNumber(true);
743  originatorNode.setSequenceNumber(rteMsg->getOriginatorNode().getSequenceNumber());
744  // 6. RREP.SeqNumTLV[TargNode] := OwnSeqNum
745  targetNode.setHasSequenceNumber(true);
746  targetNode.setSequenceNumber(sequenceNumber);
747  // 7. If Route[TargNode].PfxLen/8 is equal to the number of bytes in
748  // the addresses of the RREQ (4 for Ipv4, 16 for Ipv6), then no
749  // <prefix-length> is included with the iRREP. Otherwise,
750  // RREP.PfxLen[TargNode] := RREQ.PfxLen[TargNode] according to the
751  // rules of RFC 5444 AddrBlk encoding.
752  // TODO implement
753  // 8. RREP.MetricType[TargNode] := Route[TargNode].MetricType
754  targetNode.setHasMetricType(true);
755  targetNode.setMetricType(routeData->getMetricType());
756  // 9. RREP.Metric[TargNode] := Route[TargNode].Metric
757  targetNode.setHasMetric(true);
758  targetNode.setMetric(route->getMetric());
759  // 10. <msg-hop-limit> SHOULD be set to RteMsg.<msg-hop-count>.
760  rrep->setHopLimit(rteMsg->getHopCount());
761  // 11. IP.DestinationAddr := Route[OrigNode].NextHop
762  // NOTE: can't be done here, it is done later
763  return rrep;
764 }

◆ createRreq()

const Ptr< Rreq > inet::dymo::Dymo::createRreq ( const L3Address target,
int  retryCount 
)
private
601 {
602  auto rreq = makeShared<Rreq>(); // TODO "RREQ");
603  AddressBlock& originatorNode = rreq->getOriginatorNodeForUpdate();
604  AddressBlock& targetNode = rreq->getTargetNodeForUpdate();
605  // 7.3. RREQ Generation
606  // 1. RREQ_Gen MUST increment its OwnSeqNum by one (1) according to the
607  // rules specified in Section 5.5.
609  // 2. OrigNode MUST be a unicast address. If RREQ_Gen is not OrigNode,
610  // then OwnSeqNum will be used as the value of OrigNode.SeqNum. will
611  // be used by AODVv2 routers to create a route toward the OrigNode,
612  // enabling a RREP from TargRtr, and eventually used for proper
613  // forwarding of data packets.
614  // 3. If RREQ_Gen requires that only TargRtr is allowed to generate a
615  // RREP, then RREQ_Gen includes the "Destination RREP Only" TLV as
616  // part of the RFC 5444 message header. This also assures that
617  // TargRtr increments its sequence number. Otherwise, intermediate
618  // AODVv2 routers MAY respond to the RREQ_Gen's RREQ if they have an
619  // valid route to TargNode (see Section 13.2).
620  // 4. msg-hopcount MUST be set to 0.
621  rreq->setHopCount(0);
622  // * This RFC 5444 constraint causes the typical RteMsg payload
623  // incur additional enlargement.
624  // 5. RREQ_Gen adds the TargNode.Addr to the RREQ.
625  targetNode.setAddress(target);
626  targetNode.setPrefixLength(addressType->getMaxPrefixLength());
627  // 6. If a previous value of the TargNode's SeqNum is known RREQ_Gen SHOULD
628  // include TargNode.SeqNum in all but the last RREQ attempt.
629  auto st = targetAddressToSequenceNumber.find(target);
630  if (st != targetAddressToSequenceNumber.end() && retryCount < discoveryAttemptsMax - 1) {
631  targetNode.setHasSequenceNumber(true);
632  targetNode.setSequenceNumber(st->second);
633  }
634  else
635  targetNode.setHasSequenceNumber(false);
636  // 7. RREQ_Gen adds OrigNode.Addr, its prefix, and the RREQ_Gen.SeqNum (OwnSeqNum) to the RREQ.
637  const L3Address& originator = getSelfAddress();
638  originatorNode.setAddress(originator);
639  originatorNode.setPrefixLength(addressType->getMaxPrefixLength());
640  originatorNode.setHasSequenceNumber(true);
641  originatorNode.setSequenceNumber(sequenceNumber);
642  // 8. If OrigNode.Metric is included it is set to the cost of the route
643  // between OrigNode and RREQ_Gen.
644  originatorNode.setHasMetric(true);
645  originatorNode.setMetric(0);
646  originatorNode.setHasMetricType(true);
647  originatorNode.setMetricType(HOP_COUNT);
648  targetNode.setHasMetricType(true);
649  targetNode.setMetricType(HOP_COUNT);
650  // 13.1. Expanding Rings Multicast
651  int hopLimit = minHopLimit + (maxHopLimit - minHopLimit) * retryCount / discoveryAttemptsMax;
652  rreq->setHopLimit(hopLimit);
653  return rreq;
654 }

Referenced by retryRouteDiscovery(), and startRouteDiscovery().

◆ createRreqBackoffTimer()

RreqBackoffTimer * inet::dymo::Dymo::createRreqBackoffTimer ( const L3Address target,
int  retryCount 
)
private
320 {
321  RreqBackoffTimer *message = new RreqBackoffTimer("RreqBackoffTimer");
322  message->setRetryCount(retryCount);
323  message->setTarget(target);
324  return message;
325 }

Referenced by processRreqWaitRrepTimer().

◆ createRreqHolddownTimer()

RreqHolddownTimer * inet::dymo::Dymo::createRreqHolddownTimer ( const L3Address target)
private
351 {
352  RreqHolddownTimer *message = new RreqHolddownTimer("RreqHolddownTimer");
353  message->setTarget(target);
354  return message;
355 }

Referenced by processRreqWaitRrepTimer().

◆ createRreqWaitRrepTimer()

RreqWaitRrepTimer * inet::dymo::Dymo::createRreqWaitRrepTimer ( const L3Address target,
int  retryCount 
)
private
285 {
286  RreqWaitRrepTimer *message = new RreqWaitRrepTimer("RreqWaitRrepTimer");
287  message->setRetryCount(retryCount);
288  message->setTarget(target);
289  return message;
290 }

Referenced by retryRouteDiscovery(), and startRouteDiscovery().

◆ datagramForwardHook()

virtual Result inet::dymo::Dymo::datagramForwardHook ( Packet datagram)
inlineoverrideprivatevirtual

This is the second hook called by the network protocol before it sends a datagram to the lower layer.

This is done after the datagramPreRoutingHook or the datagramLocalInHook is called and the datagram is routed.

Implements inet::INetfilter::IHook.

206 { return ACCEPT; }

◆ datagramLocalInHook()

virtual Result inet::dymo::Dymo::datagramLocalInHook ( Packet datagram)
inlineoverrideprivatevirtual

This is the last hook called by the network protocol before it sends a datagram to the upper layer.

This is done after the datagramPreRoutingHook is called and the datagram is routed.

Implements inet::INetfilter::IHook.

208 { return ACCEPT; }

◆ datagramLocalOutHook()

virtual Result inet::dymo::Dymo::datagramLocalOutHook ( Packet datagram)
inlineoverrideprivatevirtual

This is the first hook called by the network protocol before it routes a datagram that was received from the upper layer.

The nextHopAddress is ignored when the outputNetworkInterface is a nullptr. After this is done

Implements inet::INetfilter::IHook.

209 { Enter_Method("datagramLocalOutHook"); return ensureRouteForDatagram(datagram); }

◆ datagramPostRoutingHook()

virtual Result inet::dymo::Dymo::datagramPostRoutingHook ( Packet datagram)
inlineoverrideprivatevirtual

This is the last hook called by the network protocol before it sends a datagram to the lower layer.

Implements inet::INetfilter::IHook.

207 { return ACCEPT; }

◆ datagramPreRoutingHook()

virtual Result inet::dymo::Dymo::datagramPreRoutingHook ( Packet datagram)
inlineoverrideprivatevirtual

This is the first hook called by the network protocol before it routes a datagram that was received from the lower layer.

The nextHopAddress is ignored when the outputNetworkInterface is nullptr.

Implements inet::INetfilter::IHook.

205 { Enter_Method("datagramPreRoutingHook"); return ensureRouteForDatagram(datagram); }

◆ delayDatagram()

void inet::dymo::Dymo::delayDatagram ( Packet datagram)
private
222 {
223  const auto& networkHeader = getNetworkProtocolHeader(datagram);
224  EV_INFO << "Queuing datagram: source = " << networkHeader->getSourceAddress() << ", destination = " << networkHeader->getDestinationAddress() << endl;
225  const L3Address& target = networkHeader->getDestinationAddress();
226  targetAddressToDelayedPackets.insert(std::pair<L3Address, Packet *>(target, datagram));
227 }

Referenced by ensureRouteForDatagram().

◆ deleteRreqTimer()

void inet::dymo::Dymo::deleteRreqTimer ( const L3Address target)
private
268 {
269  auto tt = targetAddressToRREQTimer.find(target);
270  ASSERT(tt != targetAddressToRREQTimer.end());
271  delete tt->second;
272 }

Referenced by processRrep(), and processRreqWaitRrepTimer().

◆ dropDelayedDatagram()

void inet::dymo::Dymo::dropDelayedDatagram ( Packet datagram)
private
237 {
238  const auto& networkHeader = getNetworkProtocolHeader(datagram);
239  EV_WARN << "Dropping queued datagram: source = " << networkHeader->getSourceAddress() << ", destination = " << networkHeader->getDestinationAddress() << endl;
240  networkProtocol->dropQueuedDatagram(const_cast<const Packet *>(datagram));
241 }

Referenced by cancelRouteDiscovery().

◆ ensureRouteForDatagram()

INetfilter::IHook::Result inet::dymo::Dymo::ensureRouteForDatagram ( Packet datagram)
private
1377 {
1378  const auto& networkHeader = getNetworkProtocolHeader(datagram);
1379  const L3Address& source = networkHeader->getSourceAddress();
1380  const L3Address& destination = networkHeader->getDestinationAddress();
1381  if (destination.isMulticast() || destination.isBroadcast() || routingTable->isLocalAddress(destination))
1382  return ACCEPT;
1383  else {
1384  EV_DETAIL << "Finding route: source = " << source << ", destination = " << destination << endl;
1385  IRoute *route = routingTable->findBestMatchingRoute(destination);
1386  DymoRouteData *routeData = route ? dynamic_cast<DymoRouteData *>(route->getProtocolData()) : nullptr;
1387  bool broken = routeData && routeData->getBroken();
1388  if (route && !route->getNextHopAsGeneric().isUnspecified() && !broken) {
1389  EV_DETAIL << "Route found: source = " << source << ", destination = " << destination << ", route: " << route << endl;
1390  if (routeData)
1391  // 8.1. Handling Route Lifetimes During Packet Forwarding
1392  // Route.LastUsed := Current_Time, and the packet is forwarded to the route's next hop.
1393  routeData->setLastUsed(simTime());
1394  return ACCEPT;
1395  }
1396  else if (source.isUnspecified() || isClientAddress(source)) {
1397  EV_DETAIL << (broken ? "Broken" : "Missing") << " route: source = " << source << ", destination = " << destination << endl;
1398  delayDatagram(datagram);
1399  if (!hasOngoingRouteDiscovery(destination))
1400  startRouteDiscovery(destination);
1401  else
1402  EV_INFO << "Route discovery is in progress: originator = " << getSelfAddress() << ", target = " << destination << endl;
1403  return QUEUE;
1404  }
1405  else
1406  // the actual routing decision will be repeated in the network protocol
1407  return ACCEPT;
1408  }
1409 }

◆ eraseDelayedDatagrams()

void inet::dymo::Dymo::eraseDelayedDatagrams ( const L3Address target)
private
244 {
245  EV_DEBUG << "Erasing the list of delayed datagrams: originator = " << getSelfAddress() << ", destination = " << target << endl;
246  auto lt = targetAddressToDelayedPackets.lower_bound(target);
247  auto ut = targetAddressToDelayedPackets.upper_bound(target);
248  targetAddressToDelayedPackets.erase(lt, ut);
249 }

Referenced by cancelRouteDiscovery(), and completeRouteDiscovery().

◆ eraseJitterTimerPacket()

void inet::dymo::Dymo::eraseJitterTimerPacket ( PacketJitterTimer msg)
private

◆ eraseRreqTimer()

void inet::dymo::Dymo::eraseRreqTimer ( const L3Address target)
private
275 {
276  auto tt = targetAddressToRREQTimer.find(target);
277  targetAddressToRREQTimer.erase(tt);
278 }

Referenced by processRrep(), processRreqHolddownTimer(), and processRreqWaitRrepTimer().

◆ expungeRoutes()

void inet::dymo::Dymo::expungeRoutes ( )
private
1226 {
1227  EV_DETAIL << "Expunging routes from routing table: routeCount = " << routingTable->getNumRoutes() << endl;
1228  // 6.3. Route Table Entry Timeouts
1229  for (int i = 0; i < routingTable->getNumRoutes(); i++) {
1230  IRoute *route = routingTable->getRoute(i);
1231  if (route->getSource() == this) {
1232  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(route->getProtocolData());
1233  // An Active route MUST NOT be expunged
1234  // An Idle route SHOULD NOT be expunged
1235  // An Expired route MAY be expunged (least recently used first)
1236  // A route MUST be expunged if (Current_Time - Route.LastUsed) >= MAX_SEQNUM_LIFETIME.
1237  // A route MUST be expunged if Current_Time >= Route.ExpirationTime
1238  if ((getRouteState(routeData) == EXPIRED) ||
1239  (simTime() - routeData->getLastUsed() >= maxSequenceNumberLifetime) ||
1240  (simTime() >= routeData->getExpirationTime()))
1241  {
1242  EV_DETAIL << "Expunging route: " << route << endl;
1243  routingTable->deleteRoute(route);
1244  i--;
1245  }
1246  }
1247  }
1248 }

Referenced by processExpungeTimer().

◆ getLinkCost()

int inet::dymo::Dymo::getLinkCost ( const NetworkInterface networkInterface,
DymoMetricType  metricType 
)
private
1179 {
1180  switch (metricType) {
1181  case HOP_COUNT:
1182  return 1;
1183 
1184  default:
1185  throw cRuntimeError("Unknown metric type");
1186  }
1187 }

◆ getNextExpungeTime()

simtime_t inet::dymo::Dymo::getNextExpungeTime ( )
private
1251 {
1252  simtime_t nextExpirationTime = SimTime::getMaxTime();
1253  for (int i = 0; i < routingTable->getNumRoutes(); i++) {
1254  IRoute *route = routingTable->getRoute(i);
1255  if (route->getSource() == this) {
1256  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(route->getProtocolData());
1257  const simtime_t& expirationTime = routeData->getExpirationTime();
1258  if (expirationTime < nextExpirationTime)
1259  nextExpirationTime = expirationTime;
1260  const simtime_t& defaultExpirationTime = routeData->getLastUsed() + maxSequenceNumberLifetime;
1261  if (defaultExpirationTime < nextExpirationTime)
1262  nextExpirationTime = defaultExpirationTime;
1263  }
1264  }
1265  return nextExpirationTime;
1266 }

Referenced by scheduleExpungeTimer().

◆ getRouteState()

DymoRouteState inet::dymo::Dymo::getRouteState ( DymoRouteData routeData)
private
1269 {
1270  simtime_t lastUsed = routeData->getLastUsed();
1271  if (routeData->getBroken())
1272  return BROKEN;
1273  else if (lastUsed - simTime() <= activeInterval)
1274  return ACTIVE;
1275  else if (routeData->getExpirationTime() != SimTime::getMaxTime()) {
1276  if (simTime() >= routeData->getExpirationTime())
1277  return EXPIRED;
1278  else
1279  return TIMED;
1280  }
1281  else if (lastUsed - simTime() <= maxIdleTime)
1282  return IDLE;
1283  else
1284  return EXPIRED;
1285 }

Referenced by expungeRoutes(), and sendRerrForBrokenLink().

◆ getSelfAddress()

◆ handleCrashOperation()

void inet::dymo::Dymo::handleCrashOperation ( LifecycleOperation operation)
overrideprivatevirtual

Implements inet::OperationalMixin< cSimpleModule >.

1434 {
1436  for (auto& elem : targetAddressToRREQTimer)
1437  cancelAndDelete(elem.second);
1438  targetAddressToRREQTimer.clear();
1439  for (auto& elem : targetAddressToDelayedPackets)
1440  delete elem.second;
1442  for (auto& pkt_timer : packetJitterTimers)
1443  cancelAndDelete(pkt_timer);
1444  packetJitterTimers.clear();
1445 }

◆ handleMessageWhenUp()

void inet::dymo::Dymo::handleMessageWhenUp ( cMessage *  message)
overrideprotectedvirtual

Implements inet::OperationalMixin< cSimpleModule >.

135 {
136  if (message->isSelfMessage())
137  processSelfMessage(message);
138  else
139  processMessage(message);
140 }

◆ handleStartOperation()

void inet::dymo::Dymo::handleStartOperation ( LifecycleOperation operation)
overrideprivatevirtual

Implements inet::OperationalMixin< cSimpleModule >.

1416 {
1418 }

◆ handleStopOperation()

void inet::dymo::Dymo::handleStopOperation ( LifecycleOperation operation)
overrideprivatevirtual

Implements inet::OperationalMixin< cSimpleModule >.

1421 {
1422  // TODO send a RERR to notify peers about broken routes
1423  for (auto& elem : targetAddressToRREQTimer) {
1424  cancelRouteDiscovery(elem.first);
1425  cancelAndDelete(elem.second);
1426  }
1427  targetAddressToRREQTimer.clear();
1428  for (auto& pkt_timer : packetJitterTimers)
1429  cancelAndDelete(pkt_timer);
1430  packetJitterTimers.clear();
1431 }

◆ hasDelayedDatagrams()

bool inet::dymo::Dymo::hasDelayedDatagrams ( const L3Address target)
private
252 {
254 }

Referenced by processRreqHolddownTimer().

◆ hasOngoingRouteDiscovery()

bool inet::dymo::Dymo::hasOngoingRouteDiscovery ( const L3Address target)
private

◆ incrementSequenceNumber()

void inet::dymo::Dymo::incrementSequenceNumber ( )
private
1361 {
1362  // 5.5. AODVv2 Sequence Numbers
1363  // Most of the time, OwnSeqNum is incremented by simply adding one (1).
1364  // But to increment OwnSeqNum when it has the value of the largest possible
1365  // number representable as a 16-bit unsigned integer (i.e., 65,535), it MUST
1366  // be set to one (1). In other words, the sequence number after 65,535 is 1.
1367  sequenceNumber++;
1368  if (sequenceNumber == 0)
1369  sequenceNumber = 1;
1370 }

Referenced by createRrep(), and createRreq().

◆ initialize()

void inet::dymo::Dymo::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::OperationalMixin< cSimpleModule >.

75 {
76  if (stage == INITSTAGE_ROUTING_PROTOCOLS) {
77  addressType = getSelfAddress().getAddressType(); // addressType need for handleStartOperation() and handleStartOperation() called by RoutingProtocolBase::initialize();
78  }
79 
81 
82  if (stage == INITSTAGE_LOCAL) {
83  // Dymo parameters from RFC
84  clientAddresses = par("clientAddresses");
85  useMulticastRREP = par("useMulticastRREP");
86  interfaces = par("interfaces");
87  activeInterval = par("activeInterval");
88  maxIdleTime = par("maxIdleTime");
89  maxSequenceNumberLifetime = par("maxSequenceNumberLifetime");
90  routeRREQWaitTime = par("routeRREQWaitTime");
91  rreqHolddownTime = par("rreqHolddownTime");
92  maxHopCount = par("maxHopCount");
93  discoveryAttemptsMax = par("discoveryAttemptsMax");
94  appendInformation = par("appendInformation");
95  bufferSizePackets = par("bufferSizePackets");
96  bufferSizeBytes = par("bufferSizeBytes");
97  // Dymo extension parameters
98  maxJitter = par("maxJitter");
99  sendIntermediateRREP = par("sendIntermediateRREP");
100  minHopLimit = par("minHopLimit");
101  maxHopLimit = par("maxHopLimit");
102  // context
103  host = getContainingNode(this);
104  interfaceTable.reference(this, "interfaceTableModule", true);
105  routingTable.reference(this, "routingTableModule", true);
106  networkProtocol.reference(this, "networkProtocolModule", true);
107  // internal
108  expungeTimer = new cMessage("ExpungeTimer");
109  L3AddressResolver addressResolver;
110  cStringTokenizer tokenizer(clientAddresses);
111  while (tokenizer.hasMoreTokens()) {
112  const char *clientAddress = tokenizer.nextToken();
113  char *slash = const_cast<char *>(strchr(clientAddress, '/'));
114  if (slash)
115  *slash = 0;
116  const L3Address address = addressResolver.resolve(clientAddress);
117  int prefixLength = address.getAddressType()->getMaxPrefixLength();
118  if (slash) {
119  int pLength = atoi(slash + 1);
120  if (pLength < 0 || pLength > prefixLength)
121  throw cRuntimeError("invalid prefix length in 'clientAddresses' parameter: '%s/%s'", clientAddress, slash);
122  prefixLength = pLength;
123  }
124  clientAddressAndPrefixLengthPairs.push_back(std::pair<L3Address, int>(address, prefixLength));
125  }
126  }
127  else if (stage == INITSTAGE_ROUTING_PROTOCOLS) {
128  registerProtocol(Protocol::manet, gate("ipOut"), gate("ipIn"));
129  host->subscribe(linkBrokenSignal, this);
130  networkProtocol->registerHook(0, this);
131  }
132 }

◆ isClientAddress()

bool inet::dymo::Dymo::isClientAddress ( const L3Address address)
private
1315 {
1316  if (routingTable->isLocalAddress(address))
1317  return true;
1318  else {
1319  for (auto& elem : clientAddressAndPrefixLengthPairs)
1320  // TODO check for prefix length too
1321  if (elem.first == address)
1322  return true;
1323 
1324  return false;
1325  }
1326 }

Referenced by ensureRouteForDatagram(), processRrep(), and processRreq().

◆ isLoopFree()

bool inet::dymo::Dymo::isLoopFree ( const Ptr< const RteMsg > &  rteMsg,
IRoute route 
)
private
1190 {
1191  // TODO implement
1192  return true;
1193 }

Referenced by updateRoutes().

◆ numInitStages()

virtual int inet::dymo::Dymo::numInitStages ( ) const
inlineoverrideprotectedvirtual
90 { return NUM_INIT_STAGES; }

◆ permissibleRteMsg()

bool inet::dymo::Dymo::permissibleRteMsg ( Packet packet,
const Ptr< const RteMsg > &  rteMsg 
)
private
462 {
463  // 7.5. Handling a Received RteMsg
464  const AddressBlock& originatorNode = rteMsg->getOriginatorNode();
465  const AddressBlock& targetNode = rteMsg->getTargetNode();
466  // 1. HandlingRtr MUST handle AODVv2 messages only from adjacent
467  // routers as specified in Section 5.4. AODVv2 messages from other
468  // sources MUST be disregarded.
469  // 5.4. AODVv2 Packet Header Fields and Information Elements
470  // If a packet is received with a value other than 255, any AODVv2
471  // message contained in the packet MUST be disregarded by AODVv2.
472  if (packet->getTag<HopLimitInd>()->getHopLimit() != 255)
473  return false;
474  // 2. If the RteMsg.<msg-hop-limit> is equal to 0, then the message is disregarded.
475  if (rteMsg->getHopLimit() == 0)
476  return false;
477  // 3. If the RteMsg.<msg-hop-count> is present, and RteMsg.<msg-hop-
478  // count> >= MAX_HOPCOUNT, then the message is disregarded.
479  if (rteMsg->getHopCount() >= maxHopCount)
480  return false;
481  // 4. HandlingRtr examines the RteMsg to ascertain that it contains the
482  // required information: TargNode.Addr, OrigNode.Addr,
483  // RteMsg_Gen.Metric and RteMsg_Gen.SeqNum. If the required
484  // information does not exist, the message is disregarded.
485  if (dynamicPtrCast<const Rreq>(rteMsg) && (!originatorNode.getHasMetric() || !originatorNode.getHasSequenceNumber()))
486  return false;
487  else if (dynamicPtrCast<const Rrep>(rteMsg) && (!targetNode.getHasMetric() || !targetNode.getHasSequenceNumber()))
488  return false;
489  // 5. HandlingRtr checks that OrigNode.Addr and TargNode.Addr are valid
490  // routable unicast addresses. If not, the message is disregarded.
491  const L3Address& originatorAddress = originatorNode.getAddress();
492  const L3Address& targetAddress = targetNode.getAddress();
493  if (originatorAddress.isUnspecified() || originatorAddress.isMulticast() || originatorAddress.isBroadcast() ||
494  targetAddress.isUnspecified() || targetAddress.isMulticast() || targetAddress.isBroadcast())
495  return false;
496  // 6. HandlingRtr checks that the Metric Type associated with
497  // OrigNode.Metric and TargNode.Metric is known, and that Cost(L)
498  // can be computed. If not, the message is disregarded.
499  // * DISCUSSION: alternatively, can change the AddrBlk metric to
500  // use HopCount, measured from<msg-hop-limit>.
501  if (originatorNode.getMetricType() != HOP_COUNT || targetNode.getMetricType() != HOP_COUNT)
502  return false;
503  // 7. If MAX_METRIC[RteMsg.MetricType] <= (RteMsg_Gen.Metric +
504  // Cost(L)), where 'L' is the incoming link, the RteMsg is
505  // disregarded.
506  // TODO implement
507  return true;
508 }

Referenced by processRrep(), and processRreq().

◆ processDymoPacket()

void inet::dymo::Dymo::processDymoPacket ( Packet packet,
const Ptr< const DymoPacket > &  dymoPacket 
)
private
445 {
446  auto dymoPacketCopy = dymoPacket->dupShared();
447  if (auto rreq = dynamicPtrCast<const Rreq>(dymoPacketCopy))
448  processRreq(packet, rreq);
449  else if (auto rrep = dynamicPtrCast<const Rrep>(dymoPacketCopy))
450  processRrep(packet, rrep);
451  else if (auto rerr = dynamicPtrCast<const Rerr>(dymoPacketCopy))
452  processRerr(packet, rerr);
453  else
454  throw cRuntimeError("Unknown Dymo packet");
455 }

Referenced by processUdpPacket().

◆ processExpungeTimer()

void inet::dymo::Dymo::processExpungeTimer ( )
private
1200 {
1201  EV_DETAIL << "Processing expunge timer" << endl;
1202  expungeRoutes();
1204 }

Referenced by processSelfMessage().

◆ processJitterTimerPacket()

void inet::dymo::Dymo::processJitterTimerPacket ( PacketJitterTimer msg)
private
397 {
398  sendUdpPacket(msg->removeJitteredPacket());
399  packetJitterTimers.erase(msg);
400  delete msg;
401 }

Referenced by processSelfMessage().

◆ processMessage()

void inet::dymo::Dymo::processMessage ( cMessage *  message)
private
163 {
164  if (Packet *fp = dynamic_cast<Packet *>(message))
165  processUdpPacket(fp);
166  else
167  throw cRuntimeError("Unknown message");
168 }

Referenced by handleMessageWhenUp().

◆ processRerr()

void inet::dymo::Dymo::processRerr ( Packet packet,
const Ptr< const Rerr > &  rerr 
)
private
946 {
947  EV_DETAIL << "Processing RERR" << endl;
948  // 8.4. Receiving and Handling RERR Messages
949  // HandlingRtr examines the incoming RERR to assure that it contains
950  // Msg.<msg-hop-limit> and at least one UnreachableNode.Address. If the
951  // required information does not exist, the incoming RERR message is
952  // disregarded and further processing stopped.
953  if (rerrIncoming->getHopLimit() == 0 || rerrIncoming->getUnreachableNodeArraySize() == 0)
954  return;
955  else {
956  L3Address srcAddr = packet->getTag<L3AddressInd>()->getSrcAddress();
957  auto incomingIfTag = packet->getTag<InterfaceInd>();
958  // Otherwise, for each UnreachableNode.Address, HandlingRtr searches its
959  // route table for a route using longest prefix matching. If no such
960  // Route is found, processing is complete for that UnreachableNode.Address.
961  std::vector<L3Address> unreachableAddresses;
962  for (int i = 0; i < (int)rerrIncoming->getUnreachableNodeArraySize(); i++) {
963  const AddressBlock& addressBlock = rerrIncoming->getUnreachableNode(i);
964  for (int j = 0; j < routingTable->getNumRoutes(); j++) {
965  IRoute *route = routingTable->getRoute(j);
966  if (route->getSource() == this) {
967  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(route->getProtocolData());
968  const L3Address& unreachableAddress = addressBlock.getAddress();
969  // HandlingRtr verifies the following:
970  // 1. The UnreachableNode.Address is a routable unicast address.
971  // 2. Route.NextHopAddress is the same as RERR IP.SourceAddress.
972  // 3. Route.NextHopInterface is the same as the interface on which the
973  // RERR was received.
974  // 4. The UnreachableNode.SeqNum is unknown, OR Route.SeqNum <=
975  // UnreachableNode.SeqNum (using signed 16-bit arithmetic).
976  if (unreachableAddress.isUnicast() &&
977  unreachableAddress == route->getDestinationAsGeneric() &&
978  route->getNextHopAsGeneric() == srcAddr &&
979  route->getInterface()->getInterfaceId() == incomingIfTag->getInterfaceId() &&
980  (!addressBlock.getHasSequenceNumber() || routeData->getSequenceNumber() <= addressBlock.getSequenceNumber()))
981  {
982  // If the route satisfies all of the above conditions, HandlingRtr sets
983  // the Route.Broken flag for that route.
984  EV_DETAIL << "Marking route as broken: " << route << endl;
985  // TODO delete route, but save its data for later update
986 // route->setEnabled(false);
987  routeData->setBroken(true);
988  unreachableAddresses.push_back(unreachableAddress);
989  }
990  }
991  }
992  }
993  if (unreachableAddresses.size() == 0)
994  EV_DETAIL << "No unreachable address found" << endl;
995  else {
996  // Furthermore, if Msg.<msg-hop-limit> is greater than 0, then HandlingRtr
997  // adds the UnreachableNode address and TLV information to an AddrBlk for
998  // delivery in the outgoing RERR message to one or more of HandlingRtr's
999  // upstream neighbors.
1000  // If there are no UnreachableNode addresses to be transmitted in an
1001  // RERR to upstream routers, HandlingRtr MUST discard the RERR, and no
1002  // further action is taken.
1003  // Otherwise, Msg.<msg-hop-limit> is decremented by one (1) and
1004  auto rerrOutgoing = createRerr(unreachableAddresses);
1005  rerrOutgoing->setHopLimit(rerrIncoming->getHopLimit() - 1);
1006  // processing continues as follows:
1007  // o If precursor lists are (optionally) maintained, the outgoing RERR
1008  // SHOULD be sent to the active precursors of the broken route as
1009  // specified in Section 13.3.
1010  // o Otherwise, if the incoming RERR message was received at the LL-
1011  // MANET-Routers [RFC5498] multicast address, the outgoing RERR
1012  // SHOULD also be sent to LL-MANET-Routers.
1013  // o Otherwise, if the PktSource MsgTLV is present, and HandlingRtr has
1014  // a Route to PktSource.Addr, then HandlingRtr MUST send the outgoing
1015  // RERR to Route[PktSource.Addr].NextHop.
1016  // o Otherwise, the outgoing RERR MUST be sent to LL-MANET-Routers.
1017  sendRerr(rerrOutgoing);
1018  }
1019  }
1020 }

Referenced by processDymoPacket().

◆ processRrep()

void inet::dymo::Dymo::processRrep ( Packet packet,
const Ptr< const Rrep > &  rrep 
)
private
786 {
787  const L3Address& target = rrepIncoming->getTargetNode().getAddress();
788  const L3Address& originator = rrepIncoming->getOriginatorNode().getAddress();
789  EV_DETAIL << "Processing RREP: originator = " << originator << ", target = " << target << endl;
790  if (permissibleRteMsg(packet, rrepIncoming)) {
791  processRteMsg(packet, rrepIncoming);
792  // 7.5.2. Additional Handling for Outgoing RREP
793  if (isClientAddress(originator)) {
794  EV_DETAIL << "Received RREP for client: originator = " << originator << ", target = " << target << endl;
795  if (hasOngoingRouteDiscovery(target)) {
796  completeRouteDiscovery(target);
797  cancelRreqTimer(target);
798  deleteRreqTimer(target);
799  eraseRreqTimer(target);
800  }
801  }
802  else {
803  // o If HandlingRtr is not OrigRtr then the outgoing RREP is sent to
804  // the Route.NextHopAddress for the RREP.AddrBlk[OrigNode]. If no
805  // forwarding route exists to OrigNode, then a RERR SHOULD be
806  // transmitted to RREP.AddrBlk[TargNode]. See Table 1 for notational
807  // conventions; OrigRtr, OrigNode, and TargNode are routers named in
808  // the context of OrigRtr, that is, the router originating the RREQ
809  // to which the RREP is responding.
810  EV_DETAIL << "Forwarding RREP: originator = " << originator << ", target = " << target << endl;
811  auto rrepOutgoing = staticPtrCast<Rrep>(rrepIncoming->dupShared());
812  if (appendInformation)
813  addSelfNode(rrepOutgoing);
814  if (useMulticastRREP)
815  sendRrep(rrepOutgoing);
816  else {
817  IRoute *route = routingTable->findBestMatchingRoute(originator);
818  if (route)
819  sendRrep(rrepOutgoing, route);
820  else
821  EV_WARN << "No route found toward originator, dropping RREP: originator = " << originator << ", target = " << target << endl;
822  }
823  }
824  }
825  else
826  EV_WARN << "Dropping non-permissible RREQ" << endl;
827 }

Referenced by processDymoPacket().

◆ processRreq()

void inet::dymo::Dymo::processRreq ( Packet packet,
const Ptr< const Rreq > &  rreq 
)
private
666 {
667  const L3Address& target = rreqIncoming->getTargetNode().getAddress();
668  const L3Address& originator = rreqIncoming->getOriginatorNode().getAddress();
669  EV_DETAIL << "Processing RREQ: originator = " << originator << ", target = " << target << endl;
670  if (permissibleRteMsg(packet, rreqIncoming)) {
671  processRteMsg(packet, rreqIncoming);
672  // 7.5.1. Additional Handling for Outgoing RREQ
673  // o If the upstream router is in the Blacklist, and Current_Time <
674  // BlacklistRmTime, then HandlingRtr MUST NOT transmit any outgoing
675  // RREQ, and processing is complete.
676  // TODO implement
677  // o Otherwise, if the upstream router is in the Blacklist, and
678  // Current_Time >= BlacklistRmTime, then the upstream router SHOULD
679  // be removed from the Blacklist, and message processing continued.
680  // TODO implement
681  if (isClientAddress(target)) {
682  // o If TargNode is a client of HandlingRtr, then a RREP is generated
683  // by the HandlingRtr (i.e., TargRtr) and unicast to the upstream
684  // router towards the RREQ OrigNode, as specified in Section 7.4.
685  // Afterwards, TargRtr processing for the RREQ is complete.
686  EV_DETAIL << "Received RREQ for client: originator = " << originator << ", target = " << target << endl;
687  if (useMulticastRREP)
688  sendRrep(createRrep(rreqIncoming));
689  else {
690  IRoute *route = routingTable->findBestMatchingRoute(originator);
691  auto rrep = createRrep(rreqIncoming, route);
692  sendRrep(rrep, route);
693  }
694  }
695  else {
696  // o If HandlingRtr is not the TargetNode, then the outgoing RREQ (as
697  // altered by the procedure defined above) SHOULD be sent to the IP
698  // multicast address LL-MANET-Routers [RFC5498]. If the RREQ is
699  // unicast, the IP.DestinationAddress is set to the NextHopAddress.
700  EV_DETAIL << "Forwarding RREQ: originator = " << originator << ", target = " << target << endl;
701  auto rreqOutgoing = dynamicPtrCast<Rreq>(rreqIncoming->dupShared());
702  if (appendInformation)
703  addSelfNode(rreqOutgoing);
704  sendRreq(rreqOutgoing);
705  }
706  }
707  else
708  EV_WARN << "Dropping non-permissible RREQ" << endl;
709 }

Referenced by processDymoPacket().

◆ processRreqBackoffTimer()

void inet::dymo::Dymo::processRreqBackoffTimer ( RreqBackoffTimer message)
private
335 {
336  EV_DETAIL << "Processing RREQ backoff timer" << endl;
337  retryRouteDiscovery(message->getTarget(), message->getRetryCount() + 1);
338  delete message;
339 }

Referenced by processSelfMessage().

◆ processRreqHolddownTimer()

void inet::dymo::Dymo::processRreqHolddownTimer ( RreqHolddownTimer message)
private
365 {
366  EV_DETAIL << "Processing RREQ holddown timer" << endl;
367  const L3Address& target = message->getTarget();
368  eraseRreqTimer(target);
369  if (hasDelayedDatagrams(target))
370  startRouteDiscovery(target);
371  delete message;
372 }

Referenced by processSelfMessage().

◆ processRreqWaitRrepTimer()

void inet::dymo::Dymo::processRreqWaitRrepTimer ( RreqWaitRrepTimer message)
private
300 {
301  EV_DETAIL << "Processing RREQ wait RREP timer" << endl;
302  const L3Address& target = message->getTarget();
303  if (message->getRetryCount() == discoveryAttemptsMax - 1) {
304  cancelRouteDiscovery(target);
305  cancelRreqTimer(target);
306  deleteRreqTimer(target);
307  eraseRreqTimer(target);
309  }
310  else
311  scheduleRreqBackoffTimer(createRreqBackoffTimer(target, message->getRetryCount()));
312  delete message;
313 }

Referenced by processSelfMessage().

◆ processRteMsg()

void inet::dymo::Dymo::processRteMsg ( Packet packet,
const Ptr< const RteMsg > &  rteMsg 
)
private
511 {
512  // 7.5. Handling a Received RteMsg
513  // 1. HandlingRtr MUST process the routing information contained in the
514  // RteMsg as speciied in Section 6.1.
515  if (dynamicPtrCast<const Rreq>(rteMsg))
516  updateRoutes(packet, rteMsg, rteMsg->getOriginatorNode());
517  else if (dynamicPtrCast<const Rrep>(rteMsg))
518  updateRoutes(packet, rteMsg, rteMsg->getTargetNode());
519  // 2. HandlingRtr MAY process AddedNode routing information (if
520  // present) as specified in Section 13.7.1 Otherwise, if AddedNode
521  // information is not processed, it MUST be deleted.
522  int count = rteMsg->getAddedNodeArraySize();
523  for (int i = 0; i < count; i++)
524  updateRoutes(packet, rteMsg, rteMsg->getAddedNode(i));
525  // 3. By sending the updated RteMsg, HandlingRtr advertises that it
526  // will route for addresses contained in the outgoing RteMsg based
527  // on the information enclosed. HandlingRtr MAY choose not to send
528  // the RteMsg, though not resending this RteMsg could decrease
529  // connectivity in the network or result in a nonoptimal path. The
530  // circumstances under which HandlingRtr might choose to not re-
531  // transmit a RteMsg are not specified in this document. Some
532  // examples might include the following:
533  // * HandlingRtr is already heavily loaded and does not want to
534  // advertise routing for the contained addresses
535  // * HandlingRtr recently transmitted identical routing information
536  // (e.g. in a RteMsg advertising the same metric)
537  // * HandlingRtr is low on energy and has to reduce energy expended
538  // for sending protocol messages or packet forwarding
539  // Unless HandlingRtr is prepared to send an updated RteMsg, it
540  // halts processing. Otherwise, processing continues as follows.
541  // TODO why is this here and how could we halt here?
542  // 4. HandlingRtr MUST decrement RteMsg.<msg-hop-limit>. If
543  // RteMsg.<msg-hop-limit> is then zero (0), no further action is taken.
544  // KLUDGE constPtrCast<RteMsg>(rteMsg)
545  constPtrCast<RteMsg>(rteMsg)->setHopLimit(rteMsg->getHopLimit() - 1);
546  // 5. HandlingRtr MUST increment RteMsg.<msg-hop-count>.
547  constPtrCast<RteMsg>(rteMsg)->setHopCount(rteMsg->getHopCount() + 1);
548 }

Referenced by processRrep(), and processRreq().

◆ processSelfMessage()

void inet::dymo::Dymo::processSelfMessage ( cMessage *  message)
private
147 {
148  if (message == expungeTimer)
150  else if (auto waitRrepTimer = dynamic_cast<RreqWaitRrepTimer *>(message))
151  processRreqWaitRrepTimer(waitRrepTimer);
152  else if (auto backoffTimer = dynamic_cast<RreqBackoffTimer *>(message))
153  processRreqBackoffTimer(backoffTimer);
154  else if (auto holddownTimer = dynamic_cast<RreqHolddownTimer *>(message))
155  processRreqHolddownTimer(holddownTimer);
156  else if (auto jitterTimer = dynamic_cast<PacketJitterTimer *>(message))
157  processJitterTimerPacket(jitterTimer);
158  else
159  throw cRuntimeError("Unknown self message");
160 }

Referenced by handleMessageWhenUp().

◆ processUdpPacket()

void inet::dymo::Dymo::processUdpPacket ( Packet packet)
private
409 {
410  packet->popAtFront<UdpHeader>();
411  processDymoPacket(packet, packet->peekDataAt<DymoPacket>(b(0), packet->getDataLength()));
412  delete packet;
413 }

Referenced by processMessage().

◆ receiveSignal()

void inet::dymo::Dymo::receiveSignal ( cComponent *  source,
simsignal_t  signalID,
cObject *  obj,
cObject *  details 
)
overrideprivatevirtual
1452 {
1453  Enter_Method("%s", cComponent::getSignalName(signalID));
1454 
1455  if (signalID == linkBrokenSignal) {
1456  EV_WARN << "Received link break" << endl;
1457  Packet *datagram = check_and_cast<Packet *>(obj);
1458  const auto& networkHeader = findNetworkProtocolHeader(datagram);
1459  if (networkHeader != nullptr) {
1460  const L3Address& destination = networkHeader->getDestinationAddress();
1461  if (destination.getAddressType() == addressType) {
1462  IRoute *route = routingTable->findBestMatchingRoute(destination);
1463  if (route) {
1464  const L3Address& nextHop = route->getNextHopAsGeneric();
1465  sendRerrForBrokenLink(route->getInterface(), nextHop);
1466  }
1467  }
1468  }
1469  }
1470 }

◆ reinjectDelayedDatagram()

void inet::dymo::Dymo::reinjectDelayedDatagram ( Packet datagram)
private
230 {
231  const auto& networkHeader = getNetworkProtocolHeader(datagram);
232  EV_INFO << "Sending queued datagram: source = " << networkHeader->getSourceAddress() << ", destination = " << networkHeader->getDestinationAddress() << endl;
233  networkProtocol->reinjectQueuedDatagram(const_cast<const Packet *>(datagram));
234 }

Referenced by completeRouteDiscovery().

◆ retryRouteDiscovery()

void inet::dymo::Dymo::retryRouteDiscovery ( const L3Address target,
int  retryCount 
)
private
183 {
184  EV_INFO << "Retrying route discovery: originator = " << getSelfAddress() << ", target = " << target << ", retry = " << retryCount << endl;
185  ASSERT(hasOngoingRouteDiscovery(target));
186  sendRreq(createRreq(target, retryCount));
188 }

Referenced by processRreqBackoffTimer().

◆ scheduleExpungeTimer()

void inet::dymo::Dymo::scheduleExpungeTimer ( )
private
1207 {
1208  EV_DETAIL << "Scheduling expunge timer" << endl;
1209  simtime_t nextExpungeTime = getNextExpungeTime();
1210  if (nextExpungeTime == SimTime::getMaxTime()) {
1211  if (expungeTimer->isScheduled())
1212  cancelEvent(expungeTimer);
1213  }
1214  else {
1215  if (!expungeTimer->isScheduled())
1216  scheduleAt(nextExpungeTime, expungeTimer);
1217  else {
1218  if (expungeTimer->getArrivalTime() != nextExpungeTime) {
1219  rescheduleAt(nextExpungeTime, expungeTimer);
1220  }
1221  }
1222  }
1223 }

Referenced by processExpungeTimer(), and updateRoute().

◆ scheduleJitterTimerPacket()

void inet::dymo::Dymo::scheduleJitterTimerPacket ( cPacket *  packet,
double  delay 
)
private
384 {
385 
386  if (delay == 0)
387  sendUdpPacket(packet);
388  else {
389  PacketJitterTimer *message = new PacketJitterTimer("PacketJitterTimer");
390  message->setJitteredPacket(packet);
391  scheduleAfter(delay, message);
392  packetJitterTimers.insert(message);
393  }
394 }

Referenced by sendDymoPacket().

◆ scheduleRreqBackoffTimer()

void inet::dymo::Dymo::scheduleRreqBackoffTimer ( RreqBackoffTimer message)
private
328 {
329  EV_DETAIL << "Scheduling RREQ backoff timer" << endl;
330  targetAddressToRREQTimer[message->getTarget()] = message;
331  scheduleAfter(computeRreqBackoffTime(message->getRetryCount()), message);
332 }

Referenced by processRreqWaitRrepTimer().

◆ scheduleRreqHolddownTimer()

void inet::dymo::Dymo::scheduleRreqHolddownTimer ( RreqHolddownTimer message)
private
358 {
359  EV_DETAIL << "Scheduling RREQ holddown timer" << endl;
360  targetAddressToRREQTimer[message->getTarget()] = message;
361  scheduleAfter(rreqHolddownTime, message);
362 }

Referenced by processRreqWaitRrepTimer().

◆ scheduleRreqWaitRrepTimer()

void inet::dymo::Dymo::scheduleRreqWaitRrepTimer ( RreqWaitRrepTimer message)
private
293 {
294  EV_DETAIL << "Scheduling RREQ wait RREP timer" << endl;
295  targetAddressToRREQTimer[message->getTarget()] = message;
296  scheduleAfter(routeRREQWaitTime, message);
297 }

Referenced by retryRouteDiscovery(), and startRouteDiscovery().

◆ sendDymoPacket()

void inet::dymo::Dymo::sendDymoPacket ( const Ptr< DymoPacket > &  packet,
const NetworkInterface networkInterface,
const L3Address nextHop,
double  delay 
)
private
420 {
421  // 5.4. AODVv2 Packet Header Fields and Information Elements
422  // In addition, IP Protocol Number 138 has been reserved for MANET protocols [RFC5498].
423  auto className = packet->getClassName();
424  Packet *udpPacket = new Packet(!strncmp("inet::", className, 6) ? className + 6 : className);
425  auto udpHeader = makeShared<UdpHeader>();
426  udpPacket->addTag<PacketProtocolTag>()->setProtocol(&Protocol::manet);
427  // In its default mode of operation, AODVv2 uses the Udp port 269 [RFC5498] to carry protocol packets.
428  udpHeader->setSourcePort(DYMO_UDP_PORT);
429  udpHeader->setDestinationPort(DYMO_UDP_PORT);
430  udpHeader->setCrcMode(CRC_DISABLED);
431  udpPacket->addTag<DispatchProtocolReq>()->setProtocol(addressType->getNetworkProtocol());
432  if (networkInterface)
433  udpPacket->addTag<InterfaceReq>()->setInterfaceId(networkInterface->getInterfaceId());
434  auto addresses = udpPacket->addTag<L3AddressReq>();
435  addresses->setSrcAddress(getSelfAddress());
436  addresses->setDestAddress(nextHop);
437  // The Ipv4 TTL (Ipv6 Hop Limit) field for all packets containing AODVv2 messages is set to 255.
438  udpPacket->addTag<HopLimitReq>()->setHopLimit(255);
439  udpPacket->insertAtFront(udpHeader);
440  udpPacket->insertAtBack(packet);
441  scheduleJitterTimerPacket(udpPacket, delay);
442 }

Referenced by sendRerr(), sendRrep(), and sendRreq().

◆ sendRerr()

void inet::dymo::Dymo::sendRerr ( const Ptr< Rerr > &  rerr)
private
865 {
866  rerr->setChunkLength(computeRerrLength(rerr));
867  EV_DETAIL << "Sending RERR: unreachableNodeCount = " << rerr->getUnreachableNodeArraySize() << endl;
869 }

Referenced by processRerr(), sendRerrForBrokenLink(), and sendRerrForUndeliverablePacket().

◆ sendRerrForBrokenLink()

void inet::dymo::Dymo::sendRerrForBrokenLink ( const NetworkInterface networkInterface,
const L3Address nextHop 
)
private
895 {
896  EV_DETAIL << "Sending RERR for broken link: nextHop = " << nextHop << endl;
897  // 8.3.2. Case 2: Broken Link
898  // The second case happens when the link breaks to an active downstream
899  // neighbor (i.e., the next hop of an active route). In this case,
900  // RERR_dest MUST be the multicast address LL-MANET-Routers, except when
901  // the optional feature of maintaining precursor lists is used as
902  // specified in Section 13.3. All Active, Idle and Expired routes that
903  // use the broken link MUST be marked as Broken. The set of
904  // UnreachableNodes is initialized by identifying those Active routes
905  // which use the broken link. For each such Active Route, Route.Dest is
906  // added to the set of Unreachable Nodes. After the Active Routes using
907  // the broken link have all been included as UnreachableNodes, idle
908  // routes MAY also be included, as long as the packet size of the RERR
909  // does not exceed the MTU of the physical medium.
910  // If the set of UnreachableNodes is empty, no RERR is generated.
911  // Otherwise, RERR_Gen generates a new RERR, and the address of each
912  // UnreachableNode (IP.DestinationAddress from a data packet or
913  // RREP.TargNode.Address) is inserted into an AddrBlock. If a prefix is
914  // known for the UnreachableNode.Address, it SHOULD be included.
915  // Otherwise, the UnreachableNode.Address is assumed to be a host
916  // address with a full length prefix. The value for each
917  // UnreachableNode's SeqNum (UnreachableNode.SeqNum) MUST be placed in a
918  // SeqNum AddrTLV. If none of UnreachableNode.Addr entries are
919  // associated with known prefix lengths, then the AddrBLK SHOULD NOT
920  // include any prefix-length information. Otherwise, for each
921  // UnreachableNode.Addr that does not have any associated prefix-length
922  // information, the prefix-length for that address MUST be assigned to
923  // zero.
924  std::vector<L3Address> unreachableAddresses;
925  for (int i = 0; i < routingTable->getNumRoutes(); i++) {
926  IRoute *route = routingTable->getRoute(i);
927  if (route->getSource() == this) {
928  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(route->getProtocolData());
929  DymoRouteState routeState = getRouteState(routeData);
930  if (routeState != BROKEN && route->getInterface() == networkInterface && route->getNextHopAsGeneric() == nextHop) {
931  EV_DETAIL << "Marking route as broken: " << route << endl;
932  // TODO delete route, but save its data for later update
933 // route->setEnabled(false);
934  routeData->setBroken(true);
935  unreachableAddresses.push_back(route->getDestinationAsGeneric());
936  }
937  }
938  }
939  if (unreachableAddresses.size() == 0)
940  EV_DETAIL << "No unreachable address found" << endl;
941  else
942  sendRerr(createRerr(unreachableAddresses));
943 }

Referenced by receiveSignal().

◆ sendRerrForUndeliverablePacket()

void inet::dymo::Dymo::sendRerrForUndeliverablePacket ( const L3Address destination)
private
872 {
873  EV_DETAIL << "Sending RERR for undeliverable packet: destination = " << destination << endl;
874  // 8.3.1. Case 1: Undeliverable Packet
875  // The first case happens when the router receives a packet but does not
876  // have a valid route for the destination of the packet. In this case,
877  // there is exactly one UnreachableNode to be included in the RERR's
878  // AddrBlk. RERR_dest SHOULD be the multicast address LL-MANET-Routers,
879  // but RERR_Gen MAY instead set RERR_dest to be the next hop towards the
880  // source IP address of the packet which was undeliverable. In the
881  // latter case, the PktSource MsgTLV MUST be included, containing the
882  // the source IP address of the undeliverable packet. If a value for
883  // the UnreachableNode's SeqNum (UnreachableNode.SeqNum) is known, it
884  // MUST be placed in the RERR. Otherwise, if no Seqnum AddrTLV is
885  // included, all nodes handling the RERR will assume their route through
886  // RERR_Gen towards the UnreachableNode is no longer valid and flag
887  // those routes as broken. RERR_Gen MUST discard the packet or message
888  // that triggered generation of the RERR.
889  std::vector<L3Address> unreachableAddresses;
890  unreachableAddresses.push_back(destination);
891  sendRerr(createRerr(unreachableAddresses));
892 }

◆ sendRrep() [1/2]

void inet::dymo::Dymo::sendRrep ( const Ptr< Rrep > &  rrep)
private
767 {
768  const L3Address& target = rrep->getTargetNode().getAddress();
769  const L3Address& originator = rrep->getOriginatorNode().getAddress();
770  rrep->setChunkLength(computeRrepLength(rrep));
771  EV_DETAIL << "Sending broadcast RREP: originator = " << originator << ", target = " << target << endl;
773 }

Referenced by processRrep(), and processRreq().

◆ sendRrep() [2/2]

void inet::dymo::Dymo::sendRrep ( const Ptr< Rrep > &  rrep,
IRoute route 
)
private
776 {
777  const L3Address& target = rrep->getTargetNode().getAddress();
778  const L3Address& originator = rrep->getOriginatorNode().getAddress();
779  const L3Address& nextHop = route->getNextHopAsGeneric();
780  rrep->setChunkLength(computeRrepLength(rrep));
781  EV_DETAIL << "Sending unicast RREP: originator = " << originator << ", target = " << target << ", nextHop = " << nextHop << endl;
782  sendDymoPacket(rrep, route->getInterface(), nextHop, 0);
783 }

◆ sendRreq()

void inet::dymo::Dymo::sendRreq ( const Ptr< Rreq > &  rreq)
private
657 {
658  const L3Address& target = rreq->getTargetNode().getAddress();
659  const L3Address& originator = rreq->getOriginatorNode().getAddress();
660  rreq->setChunkLength(computeRreqLength(rreq));
661  EV_DETAIL << "Sending RREQ: originator = " << originator << ", target = " << target << endl;
663 }

Referenced by processRreq(), retryRouteDiscovery(), and startRouteDiscovery().

◆ sendUdpPacket()

void inet::dymo::Dymo::sendUdpPacket ( cPacket *  packet)
private
379 {
380  send(packet, "ipOut");
381 }

Referenced by processJitterTimerPacket(), and scheduleJitterTimerPacket().

◆ startRouteDiscovery()

void inet::dymo::Dymo::startRouteDiscovery ( const L3Address target)
private
175 {
176  EV_INFO << "Starting route discovery: originator = " << getSelfAddress() << ", target = " << target << endl;
177  ASSERT(!hasOngoingRouteDiscovery(target));
178  sendRreq(createRreq(target, 0));
180 }

Referenced by ensureRouteForDatagram(), and processRreqHolddownTimer().

◆ updateRoute()

void inet::dymo::Dymo::updateRoute ( Packet packet,
const Ptr< const RteMsg > &  rteMsg,
const AddressBlock addressBlock,
IRoute route 
)
private
1137 {
1138  // 6.2. Applying Route Updates To Route Table Entries
1139  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(route->getProtocolData());
1140  // Route.Address := RteMsg.Addr
1141  const L3Address& address = addressBlock.getAddress();
1142  route->setDestination(address);
1143  // If (RteMsg.PfxLen != 0), then Route.PfxLen := RteMsg.PfxLen
1144  route->setPrefixLength(addressBlock.getPrefixLength());
1145  // Route.SeqNum := RteMsg.SeqNum
1146  DymoSequenceNumber sequenceNumber = addressBlock.getSequenceNumber();
1147  routeData->setSequenceNumber(sequenceNumber);
1149  // Route.NextHopAddress := IP.SourceAddress (i.e., an address of the node from which the RteMsg was received)
1150  // note that Dymo packets are not routed on the IP level, so we can use the source address here
1151  L3Address srcAddr = packet->getTag<L3AddressInd>()->getSrcAddress();
1152  route->setNextHop(srcAddr);
1153  // Route.NextHopInterface is set to the interface on which RteMsg was received
1154  NetworkInterface *networkInterface = interfaceTable->getInterfaceById((packet->getTag<InterfaceInd>())->getInterfaceId());
1155  if (networkInterface)
1156  route->setInterface(networkInterface);
1157  // Route.Broken flag := FALSE
1158  routeData->setBroken(false);
1159  // If RteMsg.MetricType is included, then Route.MetricType := RteMsg.MetricType. Otherwise, Route.MetricType := DEFAULT_METRIC_TYPE.
1160  // Route.MetricType := RteMsg.MetricType
1161  if (addressBlock.getHasMetricType())
1162  routeData->setMetricType(addressBlock.getMetricType());
1163  else
1164  routeData->setMetricType(HOP_COUNT);
1165  // Route.Metric := RteMsg.Metric
1166  route->setMetric(addressBlock.getMetric());
1167  // Route.LastUsed := Current_Time
1168  routeData->setLastUsed(simTime());
1169  // If RteMsg.VALIDITY_TIME is not included, then Route.ExpirationTime := MAXTIME, otherwise Route.ExpirationTime := Current_Time + RteMsg.VALIDITY_TIME
1170  if (addressBlock.getHasValidityTime())
1171  routeData->setExpirationTime(simTime() + addressBlock.getValidityTime());
1172  else
1173  routeData->setExpirationTime(SimTime::getMaxTime());
1175 }

Referenced by createRoute(), and updateRoutes().

◆ updateRoutes()

void inet::dymo::Dymo::updateRoutes ( Packet packet,
const Ptr< const RteMsg > &  rteMsg,
const AddressBlock addressBlock 
)
private
1074 {
1075  const L3Address& address = addressBlock.getAddress();
1076  if (address == getSelfAddress())
1077  // we don't need to manage routes for our own address
1078  return;
1079  else {
1080  // 6.1. Evaluating Incoming Routing Information
1081  // HandRtr searches its route table to see if there is a route table
1082  // entry with the same MetricType of the RteMsg, matching RteMsg.Addr.
1083  IRoute *route = nullptr;
1084  for (int i = 0; i < routingTable->getNumRoutes(); i++) {
1085  IRoute *routeCandidate = routingTable->getRoute(i);
1086  if (routeCandidate->getSource() == this) {
1087  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(routeCandidate->getProtocolData());
1088  if (routeCandidate->getDestinationAsGeneric() == address && routeData->getMetricType() == addressBlock.getMetricType()) {
1089  route = routeCandidate;
1090  break;
1091  }
1092  }
1093  }
1094  // If not, HandRtr creates a route table entry for RteMsg.Addr as described
1095  // in Section 6.2. Otherwise, HandRtr compares the incoming routing information
1096  // in RteMsg against the already stored routing information in the route table
1097  // entry (Route) for RteMsg.Addr, as described below.
1098  if (!route) {
1099  IRoute *route = createRoute(packet, rteMsg, addressBlock);
1100  EV_DETAIL << "Adding new route: " << route << endl;
1101  routingTable->addRoute(route);
1102  }
1103  else {
1104  DymoRouteData *routeData = check_and_cast<DymoRouteData *>(route->getProtocolData());
1105  // Offers improvement if
1106  // (RteMsg.SeqNum > Route.SeqNum) OR
1107  // {(RteMsg.SeqNum == Route.SeqNum) AND
1108  // [(RteMsg.Metric < Route.Metric) OR
1109  // ((Route.Broken == TRUE) && LoopFree (RteMsg, Route))]} if
1110  if ((addressBlock.getSequenceNumber() > routeData->getSequenceNumber()) ||
1111  (addressBlock.getSequenceNumber() == routeData->getSequenceNumber() && addressBlock.getMetric() < route->getMetric()) ||
1112  (routeData->getBroken() && isLoopFree(rteMsg, route)))
1113  {
1114  // it's more recent, or it's not stale and is shorter, or it can safely repair a broken route
1115  // TODO should we simply update the route instead? only if the route change notification is sent exactly once
1116  routingTable->removeRoute(route);
1117  EV_DETAIL << "Updating existing route: " << route << endl;
1118  updateRoute(packet, rteMsg, addressBlock, route);
1119  EV_DETAIL << "Route updated: " << route << endl;
1120  routingTable->addRoute(route);
1121  }
1122  }
1123  }
1124 }

Referenced by processRteMsg().

Member Data Documentation

◆ activeInterval

double inet::dymo::Dymo::activeInterval
private

Referenced by getRouteState(), and initialize().

◆ addressType

◆ appendInformation

bool inet::dymo::Dymo::appendInformation
private

◆ bufferSizeBytes

int inet::dymo::Dymo::bufferSizeBytes
private

Referenced by initialize().

◆ bufferSizePackets

int inet::dymo::Dymo::bufferSizePackets
private

Referenced by initialize().

◆ clientAddressAndPrefixLengthPairs

std::vector<std::pair<L3Address, int> > inet::dymo::Dymo::clientAddressAndPrefixLengthPairs
private

Referenced by initialize(), and isClientAddress().

◆ clientAddresses

const char* inet::dymo::Dymo::clientAddresses
private

Referenced by initialize().

◆ discoveryAttemptsMax

int inet::dymo::Dymo::discoveryAttemptsMax
private

◆ expungeTimer

cMessage* inet::dymo::Dymo::expungeTimer
private

◆ host

cModule* inet::dymo::Dymo::host
private

Referenced by initialize().

◆ interfaces

const char* inet::dymo::Dymo::interfaces
private

Referenced by configureInterfaces(), and initialize().

◆ interfaceTable

ModuleRefByPar<IInterfaceTable> inet::dymo::Dymo::interfaceTable
private

◆ maxHopCount

int inet::dymo::Dymo::maxHopCount
private

Referenced by initialize(), and permissibleRteMsg().

◆ maxHopLimit

int inet::dymo::Dymo::maxHopLimit
private

Referenced by createRerr(), createRreq(), and initialize().

◆ maxIdleTime

double inet::dymo::Dymo::maxIdleTime
private

Referenced by getRouteState(), and initialize().

◆ maxJitter

simtime_t inet::dymo::Dymo::maxJitter
private

Referenced by initialize(), and sendRreq().

◆ maxSequenceNumberLifetime

double inet::dymo::Dymo::maxSequenceNumberLifetime
private

◆ minHopLimit

int inet::dymo::Dymo::minHopLimit
private

Referenced by createRreq(), and initialize().

◆ networkProtocol

ModuleRefByPar<INetfilter> inet::dymo::Dymo::networkProtocol
private

◆ packetJitterTimers

◆ routeRREQWaitTime

double inet::dymo::Dymo::routeRREQWaitTime
private

◆ routingTable

◆ rreqHolddownTime

double inet::dymo::Dymo::rreqHolddownTime
private

◆ sendIntermediateRREP

bool inet::dymo::Dymo::sendIntermediateRREP
private

Referenced by initialize().

◆ sequenceNumber

DymoSequenceNumber inet::dymo::Dymo::sequenceNumber
private

◆ targetAddressToDelayedPackets

std::multimap<L3Address, Packet *> inet::dymo::Dymo::targetAddressToDelayedPackets
private

◆ targetAddressToRREQTimer

◆ targetAddressToSequenceNumber

std::map<L3Address, DymoSequenceNumber> inet::dymo::Dymo::targetAddressToSequenceNumber
private

◆ useMulticastRREP

bool inet::dymo::Dymo::useMulticastRREP
private

The documentation for this class was generated from the following files:
inet::dymo::Dymo::activeInterval
double activeInterval
Definition: Dymo.h:51
DYMO_UDP_PORT
#define DYMO_UDP_PORT
Definition: DymoDefs.h:16
inet::dymo::Dymo::processJitterTimerPacket
void processJitterTimerPacket(PacketJitterTimer *msg)
Definition: Dymo.cc:396
inet::dymo::Dymo::targetAddressToSequenceNumber
std::map< L3Address, DymoSequenceNumber > targetAddressToSequenceNumber
Definition: Dymo.h:78
inet::dymo::Dymo::scheduleJitterTimerPacket
void scheduleJitterTimerPacket(cPacket *packet, double delay)
Definition: Dymo.cc:383
inet::dymo::EXPIRED
@ EXPIRED
Definition: DymoDefs.h:23
inet::dymo::Dymo::sendDymoPacket
void sendDymoPacket(const Ptr< DymoPacket > &packet, const NetworkInterface *networkInterface, const L3Address &nextHop, double delay)
Definition: Dymo.cc:419
inet::dymo::Dymo::processMessage
void processMessage(cMessage *message)
Definition: Dymo.cc:162
inet::dymo::Dymo::createRreqHolddownTimer
RreqHolddownTimer * createRreqHolddownTimer(const L3Address &target)
Definition: Dymo.cc:350
inet::IL3AddressType::getMaxPrefixLength
virtual int getMaxPrefixLength() const =0
inet::dymo::Dymo::processExpungeTimer
void processExpungeTimer()
Definition: Dymo.cc:1199
inet::dymo::Dymo::getSelfAddress
L3Address getSelfAddress()
Definition: Dymo.cc:1309
inet::dymo::ACTIVE
@ ACTIVE
Definition: DymoDefs.h:21
inet::linkBrokenSignal
simsignal_t linkBrokenSignal
Definition: Simsignals.cc:22
inet::dymo::Dymo::bufferSizePackets
int bufferSizePackets
Definition: Dymo.h:59
inet::dymo::Dymo::expungeTimer
cMessage * expungeTimer
Definition: Dymo.h:76
inet::dymo::Dymo::cancelRouteDiscovery
void cancelRouteDiscovery(const L3Address &target)
Definition: Dymo.cc:201
inet::count
int count(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:54
inet::dymo::Dymo::cancelRreqTimer
void cancelRreqTimer(const L3Address &target)
Definition: Dymo.cc:260
inet::dymo::IDLE
@ IDLE
Definition: DymoDefs.h:22
inet::dymo::Dymo::completeRouteDiscovery
void completeRouteDiscovery(const L3Address &target)
Definition: Dymo.cc:190
inet::getContainingNode
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
inet::OperationalMixin< cSimpleModule >::initialize
virtual void initialize(int stage) override
Definition: OperationalMixinImpl.h:26
inet::dymo::Dymo::sendUdpPacket
void sendUdpPacket(cPacket *packet)
Definition: Dymo.cc:378
InterfaceReq
removed InterfaceReq
Definition: IUdp-gates.txt:11
inet::dymo::Dymo::hasDelayedDatagrams
bool hasDelayedDatagrams(const L3Address &target)
Definition: Dymo.cc:251
inet::dymo::Dymo::updateRoutes
void updateRoutes(Packet *packet, const Ptr< const RteMsg > &rteMsg, const AddressBlock &addressBlock)
Definition: Dymo.cc:1073
inet::dymo::Dymo::hasOngoingRouteDiscovery
bool hasOngoingRouteDiscovery(const L3Address &target)
Definition: Dymo.cc:212
DispatchProtocolReq
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
inet::dymo::Dymo::maxHopCount
int maxHopCount
Definition: Dymo.h:56
L3AddressInd
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
inet::dymo::Dymo::processRreqWaitRrepTimer
void processRreqWaitRrepTimer(RreqWaitRrepTimer *message)
Definition: Dymo.cc:299
inet::CRC_DISABLED
@ CRC_DISABLED
Definition: CrcMode_m.h:56
inet::IL3AddressType::getLinkLocalManetRoutersMulticastAddress
virtual L3Address getLinkLocalManetRoutersMulticastAddress() const =0
inet::dymo::Dymo::clientAddressAndPrefixLengthPairs
std::vector< std::pair< L3Address, int > > clientAddressAndPrefixLengthPairs
Definition: Dymo.h:82
inet::dymo::Dymo::maxSequenceNumberLifetime
double maxSequenceNumberLifetime
Definition: Dymo.h:53
inet::dymo::Dymo::startRouteDiscovery
void startRouteDiscovery(const L3Address &target)
Definition: Dymo.cc:174
inet::dymo::Dymo::isClientAddress
bool isClientAddress(const L3Address &address)
Definition: Dymo.cc:1314
inet::dymo::Dymo::sendRreq
void sendRreq(const Ptr< Rreq > &rreq)
Definition: Dymo.cc:656
inet::dymo::Dymo::maxIdleTime
double maxIdleTime
Definition: Dymo.h:52
inet::dymo::HOP_COUNT
@ HOP_COUNT
Definition: Dymo_m.h:75
inet::IRoute::DYMO
@ DYMO
managed by DYMO routing
Definition: IRoute.h:40
inet::dymo::Dymo::reinjectDelayedDatagram
void reinjectDelayedDatagram(Packet *datagram)
Definition: Dymo.cc:229
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::dymo::Dymo::sendRerr
void sendRerr(const Ptr< Rerr > &rerr)
Definition: Dymo.cc:864
inet::findNetworkProtocolHeader
const Ptr< const NetworkHeaderBase > findNetworkProtocolHeader(Packet *packet)
Definition: L3Tools.cc:37
inet::dymo::Dymo::processRreq
void processRreq(Packet *packet, const Ptr< const Rreq > &rreq)
Definition: Dymo.cc:665
inet::dymo::Dymo::computeRrepLength
b computeRrepLength(const Ptr< Rrep > &rrep)
Definition: Dymo.cc:829
inet::dymo::Dymo::retryRouteDiscovery
void retryRouteDiscovery(const L3Address &target, int retryCount)
Definition: Dymo.cc:182
inet::dymo::Dymo::eraseDelayedDatagrams
void eraseDelayedDatagrams(const L3Address &target)
Definition: Dymo.cc:243
inet::dymo::Dymo::processRrep
void processRrep(Packet *packet, const Ptr< const Rrep > &rrep)
Definition: Dymo.cc:785
inet::dymo::Dymo::scheduleRreqBackoffTimer
void scheduleRreqBackoffTimer(RreqBackoffTimer *message)
Definition: Dymo.cc:327
inet::dymo::Dymo::createRreqWaitRrepTimer
RreqWaitRrepTimer * createRreqWaitRrepTimer(const L3Address &target, int retryCount)
Definition: Dymo.cc:284
inet::Protocol::manet
static const Protocol manet
Definition: Protocol.h:99
inet::dymo::Dymo::createRerr
const Ptr< Rerr > createRerr(std::vector< L3Address > &addresses)
Definition: Dymo.cc:838
inet::dymo::Dymo::createRreq
const Ptr< Rreq > createRreq(const L3Address &target, int retryCount)
Definition: Dymo.cc:600
inet::dymo::Dymo::computeRreqBackoffTime
simtime_t computeRreqBackoffTime(int retryCount)
Definition: Dymo.cc:341
inet::dymo::Dymo::getRouteState
DymoRouteState getRouteState(DymoRouteData *routeData)
Definition: Dymo.cc:1268
inet::getNetworkProtocolHeader
const Ptr< const NetworkHeaderBase > getNetworkProtocolHeader(Packet *packet)
Definition: L3Tools.cc:43
inet::dymo::Dymo::packetJitterTimers
std::set< PacketJitterTimer * > packetJitterTimers
Definition: Dymo.h:81
inet::dymo::Dymo::routingTable
ModuleRefByPar< IRoutingTable > routingTable
Definition: Dymo.h:72
inet::dymo::Dymo::eraseRreqTimer
void eraseRreqTimer(const L3Address &target)
Definition: Dymo.cc:274
inet::dymo::BROKEN
@ BROKEN
Definition: DymoDefs.h:24
inet::dymo::Dymo::interfaceTable
ModuleRefByPar< IInterfaceTable > interfaceTable
Definition: Dymo.h:71
inet::INetfilter::IHook::QUEUE
@ QUEUE
queues the datagram for later re-injection (e.g. when route discovery completes)
Definition: INetfilter.h:42
inet::dymo::Dymo::useMulticastRREP
bool useMulticastRREP
Definition: Dymo.h:49
inet::dymo::DymoSequenceNumber
uint32_t DymoSequenceNumber
Definition: DymoDefs.h:18
inet::dymo::Dymo::maxHopLimit
int maxHopLimit
Definition: Dymo.h:66
inet::dymo::Dymo::routeRREQWaitTime
double routeRREQWaitTime
Definition: Dymo.h:54
inet::dymo::Dymo::isLoopFree
bool isLoopFree(const Ptr< const RteMsg > &rteMsg, IRoute *route)
Definition: Dymo.cc:1189
inet::dymo::Dymo::interfaces
const char * interfaces
Definition: Dymo.h:50
HopLimitReq
removed HopLimitReq
Definition: IUdp-gates.txt:11
inet::dymo::Dymo::sendRerrForBrokenLink
void sendRerrForBrokenLink(const NetworkInterface *networkInterface, const L3Address &nextHop)
Definition: Dymo.cc:894
inet::dymo::Dymo::createRrep
const Ptr< Rrep > createRrep(const Ptr< const RteMsg > &rteMsg)
Definition: Dymo.cc:720
inet::dymo::Dymo::processRerr
void processRerr(Packet *packet, const Ptr< const Rerr > &rerr)
Definition: Dymo.cc:945
inet::dymo::Dymo::ensureRouteForDatagram
Result ensureRouteForDatagram(Packet *datagram)
Definition: Dymo.cc:1376
inet::dymo::Dymo::configureInterfaces
void configureInterfaces()
Definition: Dymo.cc:1291
NaN
#define NaN
Definition: INETMath.h:91
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::dymo::Dymo::addNode
void addNode(const Ptr< RteMsg > &rteMsg, AddressBlock &addressBlock)
Definition: Dymo.cc:1349
inet::dymo::DymoRouteState
DymoRouteState
Definition: DymoDefs.h:20
inet::dymo::Dymo::targetAddressToDelayedPackets
std::multimap< L3Address, Packet * > targetAddressToDelayedPackets
Definition: Dymo.h:80
inet::dymo::Dymo::processDymoPacket
void processDymoPacket(Packet *packet, const Ptr< const DymoPacket > &dymoPacket)
Definition: Dymo.cc:444
inet::dymo::Dymo::sendIntermediateRREP
bool sendIntermediateRREP
Definition: Dymo.h:64
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::dymo::Dymo::rreqHolddownTime
double rreqHolddownTime
Definition: Dymo.h:55
inet::dymo::Dymo::processRteMsg
void processRteMsg(Packet *packet, const Ptr< const RteMsg > &rteMsg)
Definition: Dymo.cc:510
inet::dymo::TIMED
@ TIMED
Definition: DymoDefs.h:25
inet::dymo::Dymo::targetAddressToRREQTimer
std::map< L3Address, RreqTimer * > targetAddressToRREQTimer
Definition: Dymo.h:79
inet::dymo::Dymo::networkProtocol
ModuleRefByPar< INetfilter > networkProtocol
Definition: Dymo.h:73
inet::dymo::Dymo::processRreqBackoffTimer
void processRreqBackoffTimer(RreqBackoffTimer *message)
Definition: Dymo.cc:334
inet::dymo::Dymo::scheduleExpungeTimer
void scheduleExpungeTimer()
Definition: Dymo.cc:1206
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::dymo::Dymo::addressType
IL3AddressType * addressType
Definition: Dymo.h:70
inet::dymo::Dymo::incrementSequenceNumber
void incrementSequenceNumber()
Definition: Dymo.cc:1360
inet::dymo::Dymo::maxJitter
simtime_t maxJitter
Definition: Dymo.h:63
inet::dymo::Dymo::computeRerrLength
b computeRerrLength(const Ptr< Rerr > &rerr)
Definition: Dymo.cc:1022
inet::dymo::Dymo::createRreqBackoffTimer
RreqBackoffTimer * createRreqBackoffTimer(const L3Address &target, int retryCount)
Definition: Dymo.cc:319
inet::dymo::Dymo::addSelfNode
void addSelfNode(const Ptr< RteMsg > &rteMsg)
Definition: Dymo.cc:1332
inet::dymo::Dymo::updateRoute
void updateRoute(Packet *packet, const Ptr< const RteMsg > &rteMsg, const AddressBlock &addressBlock, IRoute *route)
Definition: Dymo.cc:1136
inet::INetfilter::IHook::ACCEPT
@ ACCEPT
allows the datagram to pass to the next hook
Definition: INetfilter.h:40
inet::dymo::Dymo::appendInformation
bool appendInformation
Definition: Dymo.h:58
inet::L3Address::getAddressType
IL3AddressType * getAddressType() const
Definition: L3Address.cc:59
inet::dymo::Dymo::delayDatagram
void delayDatagram(Packet *datagram)
Definition: Dymo.cc:221
inet::dymo::Dymo::processSelfMessage
void processSelfMessage(cMessage *message)
Definition: Dymo.cc:146
inet::dymo::Dymo::minHopLimit
int minHopLimit
Definition: Dymo.h:65
inet::dymo::Dymo::createRoute
IRoute * createRoute(Packet *packet, const Ptr< const RteMsg > &rteMsg, const AddressBlock &addressBlock)
Definition: Dymo.cc:1126
inet::dymo::Dymo::discoveryAttemptsMax
int discoveryAttemptsMax
Definition: Dymo.h:57
inet::IL3AddressType::getNetworkProtocol
virtual const Protocol * getNetworkProtocol() const =0
inet::dymo::Dymo::processUdpPacket
void processUdpPacket(Packet *packet)
Definition: Dymo.cc:408
inet::dymo::Dymo::bufferSizeBytes
int bufferSizeBytes
Definition: Dymo.h:60
inet::registerProtocol
void registerProtocol(const Protocol &protocol, cGate *gate, ServicePrimitive servicePrimitive)
Registers a protocol primitive (PDU processing) at the given gate.
Definition: IProtocolRegistrationListener.cc:83
inet::dymo::Dymo::scheduleRreqHolddownTimer
void scheduleRreqHolddownTimer(RreqHolddownTimer *message)
Definition: Dymo.cc:357
inet::dymo::Dymo::expungeRoutes
void expungeRoutes()
Definition: Dymo.cc:1225
inet::dymo::Dymo::dropDelayedDatagram
void dropDelayedDatagram(Packet *datagram)
Definition: Dymo.cc:236
inet::dymo::Dymo::host
cModule * host
Definition: Dymo.h:69
inet::dymo::Dymo::sendRrep
void sendRrep(const Ptr< Rrep > &rrep)
Definition: Dymo.cc:766
inet::dymo::Dymo::scheduleRreqWaitRrepTimer
void scheduleRreqWaitRrepTimer(RreqWaitRrepTimer *message)
Definition: Dymo.cc:292
inet::dymo::Dymo::deleteRreqTimer
void deleteRreqTimer(const L3Address &target)
Definition: Dymo.cc:267
inet::dymo::Dymo::computeRreqLength
b computeRreqLength(const Ptr< Rreq > &rreq)
Definition: Dymo.cc:711
inet::dymo::Dymo::permissibleRteMsg
bool permissibleRteMsg(Packet *packet, const Ptr< const RteMsg > &rteMsg)
Definition: Dymo.cc:461
inet::containsKey
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80
inet::INITSTAGE_ROUTING_PROTOCOLS
INET_API InitStage INITSTAGE_ROUTING_PROTOCOLS
Initialization of routing protocols.
inet::dymo::Dymo::clientAddresses
const char * clientAddresses
Definition: Dymo.h:48
inet::dymo::Dymo::computeRteMsgLength
b computeRteMsgLength(const Ptr< RteMsg > &rteMsg)
Definition: Dymo.cc:550
inet::dymo::Dymo::processRreqHolddownTimer
void processRreqHolddownTimer(RreqHolddownTimer *message)
Definition: Dymo.cc:364
inet::dymo::Dymo::getNextExpungeTime
simtime_t getNextExpungeTime()
Definition: Dymo.cc:1250
inet::dymo::Dymo::sequenceNumber
DymoSequenceNumber sequenceNumber
Definition: Dymo.h:77