|
INET Framework for OMNeT++/OMNEST
|
#include <Aodv.h>
|
| void | handleMessageWhenUp (cMessage *msg) override |
| |
| void | initialize (int stage) override |
| |
| virtual int | numInitStages () const override |
| |
| void | startRouteDiscovery (const L3Address &target, unsigned int timeToLive=0) |
| |
| void | completeRouteDiscovery (const L3Address &target) |
| |
| bool | hasOngoingRouteDiscovery (const L3Address &destAddr) |
| |
| void | cancelRouteDiscovery (const L3Address &destAddr) |
| |
| void | updateRoutingTable (IRoute *route, const L3Address &nextHop, unsigned int hopCount, bool hasValidDestNum, unsigned int destSeqNum, bool isActive, simtime_t lifeTime) |
| |
| IRoute * | createRoute (const L3Address &destAddr, const L3Address &nextHop, unsigned int hopCount, bool hasValidDestNum, unsigned int destSeqNum, bool isActive, simtime_t lifeTime) |
| |
| bool | updateValidRouteLifeTime (const L3Address &destAddr, simtime_t lifetime) |
| |
| void | scheduleExpungeRoutes () |
| |
| void | expungeRoutes () |
| |
| const Ptr< RrepAck > | createRREPACK () |
| |
| const Ptr< Rrep > | createHelloMessage () |
| |
| const Ptr< Rreq > | createRREQ (const L3Address &destAddr) |
| |
| const Ptr< Rrep > | createRREP (const Ptr< Rreq > &rreq, IRoute *destRoute, IRoute *originatorRoute, const L3Address &sourceAddr) |
| |
| const Ptr< Rrep > | createGratuitousRREP (const Ptr< Rreq > &rreq, IRoute *originatorRoute) |
| |
| const Ptr< Rerr > | createRERR (const std::vector< UnreachableNode > &unreachableNodes) |
| |
| void | handleRREP (const Ptr< Rrep > &rrep, const L3Address &sourceAddr) |
| |
| void | handleRREQ (const Ptr< Rreq > &rreq, const L3Address &sourceAddr, unsigned int timeToLive) |
| |
| void | handleRERR (const Ptr< const Rerr > &rerr, const L3Address &sourceAddr) |
| |
| void | handleHelloMessage (const Ptr< Rrep > &helloMessage) |
| |
| void | handleRREPACK (const Ptr< const RrepAck > &rrepACK, const L3Address &neighborAddr) |
| |
| void | sendRREQ (const Ptr< Rreq > &rreq, const L3Address &destAddr, unsigned int timeToLive) |
| |
| void | sendRREPACK (const Ptr< RrepAck > &rrepACK, const L3Address &destAddr) |
| |
| void | sendRREP (const Ptr< Rrep > &rrep, const L3Address &destAddr, unsigned int timeToLive) |
| |
| void | sendGRREP (const Ptr< Rrep > &grrep, const L3Address &destAddr, unsigned int timeToLive) |
| |
| void | forwardRREP (const Ptr< Rrep > &rrep, const L3Address &destAddr, unsigned int timeToLive) |
| |
| void | forwardRREQ (const Ptr< Rreq > &rreq, unsigned int timeToLive) |
| |
| void | handleRREPACKTimer () |
| |
| void | handleBlackListTimer () |
| |
| void | sendHelloMessagesIfNeeded () |
| |
| void | handleWaitForRREP (WaitForRrep *rrepTimer) |
| |
| void | sendRERRWhenNoRouteToForward (const L3Address &unreachableAddr) |
| |
| void | handleLinkBreakSendRERR (const L3Address &unreachableAddr) |
| |
| virtual void | receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override |
| |
| 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...
|
| |
| void | delayDatagram (Packet *datagram) |
| |
| L3Address | getSelfIPAddress () const |
| |
| void | sendAODVPacket (const Ptr< AodvControlPacket > &packet, const L3Address &destAddr, unsigned int timeToLive, double delay) |
| |
| void | processPacket (Packet *pk) |
| |
| void | clearState () |
| |
| void | checkIpVersionAndPacketTypeCompatibility (AodvControlPacketType packetType) |
| |
| virtual void | socketDataArrived (UdpSocket *socket, Packet *packet) override |
| | Notifies about data arrival, packet ownership is transferred to the callee. More...
|
| |
| virtual void | socketErrorArrived (UdpSocket *socket, Indication *indication) override |
| | Notifies about error indication arrival, indication ownership is transferred to the callee. More...
|
| |
| virtual void | socketClosed (UdpSocket *socket) override |
| | Notifies about socket closed, indication ownership is transferred to the callee. More...
|
| |
| virtual void | handleStartOperation (LifecycleOperation *operation) override |
| |
| virtual void | handleStopOperation (LifecycleOperation *operation) override |
| |
| virtual void | handleCrashOperation (LifecycleOperation *operation) override |
| |
| virtual bool | isInitializeStage (int stage) const override |
| |
| virtual bool | isModuleStartStage (int stage) const override |
| |
| virtual bool | isModuleStopStage (int stage) const override |
| |
| 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 () |
| |
◆ Aodv()
| inet::aodv::Aodv::Aodv |
( |
| ) |
|
◆ ~Aodv()
| inet::aodv::Aodv::~Aodv |
( |
| ) |
|
|
virtual |
◆ cancelRouteDiscovery()
| void inet::aodv::Aodv::cancelRouteDiscovery |
( |
const L3Address & |
destAddr | ) |
|
|
protected |
1607 for (
auto it = lt; it != ut; it++)
1608 networkProtocol->dropQueuedDatagram(
const_cast<const Packet *
>(it->second));
1614 cancelAndDelete(waitRREPIter->second);
Referenced by handleWaitForRREP().
◆ checkIpVersionAndPacketTypeCompatibility()
121 switch (packetType) {
127 throw cRuntimeError(
"AODV Control Packet arrived with non-IPv6 packet type %d, but AODV configured for IPv6 routing", packetType);
135 throw cRuntimeError(
"AODV Control Packet arrived with IPv6 packet type %d, but AODV configured for non-IPv6 routing", packetType);
139 throw cRuntimeError(
"AODV Control Packet arrived with undefined packet type: %d", packetType);
Referenced by processPacket().
◆ clearState()
| void inet::aodv::Aodv::clearState |
( |
| ) |
|
|
protected |
◆ completeRouteDiscovery()
| void inet::aodv::Aodv::completeRouteDiscovery |
( |
const L3Address & |
target | ) |
|
|
protected |
1309 EV_DETAIL <<
"Completing route discovery, originator " <<
getSelfIPAddress() <<
", target " << target << endl;
1316 for (
auto it = lt; it != ut; it++) {
1317 Packet *datagram = it->second;
1319 EV_DETAIL <<
"Sending queued datagram: source " << networkHeader->getSourceAddress() <<
", destination " << networkHeader->getDestinationAddress() << endl;
1320 networkProtocol->reinjectQueuedDatagram(
const_cast<const Packet *
>(datagram));
1329 cancelAndDelete(waitRREPIter->second);
Referenced by handleRREP().
◆ createGratuitousRREP()
| const Ptr< Rrep > inet::aodv::Aodv::createGratuitousRREP |
( |
const Ptr< Rreq > & |
rreq, |
|
|
IRoute * |
originatorRoute |
|
) |
| |
|
protected |
517 ASSERT(originatorRoute !=
nullptr);
518 auto grrep = makeShared<Rrep>();
522 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(originatorRoute->getProtocolData());
541 grrep->setHopCount(originatorRoute->getMetric());
542 grrep->setDestAddr(rreq->getOriginatorAddr());
543 grrep->setDestSeqNum(rreq->getOriginatorSeqNum());
544 grrep->setOriginatorAddr(rreq->getDestAddr());
545 grrep->setLifeTime(routeData->getLifeTime());
Referenced by handleRREQ().
◆ createHelloMessage()
| const Ptr< Rrep > inet::aodv::Aodv::createHelloMessage |
( |
| ) |
|
|
protected |
1356 auto helloMessage = makeShared<Rrep>();
1358 helloMessage->setChunkLength(
usingIpv6 ?
B(44) :
B(20));
1362 helloMessage->setHopCount(0);
1365 return helloMessage;
Referenced by sendHelloMessagesIfNeeded().
◆ createRERR()
| const Ptr< Rerr > inet::aodv::Aodv::createRERR |
( |
const std::vector< UnreachableNode > & |
unreachableNodes | ) |
|
|
protected |
1130 auto rerr = makeShared<Rerr>();
1133 unsigned int destCount = unreachableNodes.size();
1134 rerr->setUnreachableNodesArraySize(destCount);
1136 for (
unsigned int i = 0; i < destCount; i++) {
1137 UnreachableNode node;
1138 node.addr = unreachableNodes[i].addr;
1139 node.seqNum = unreachableNodes[i].seqNum;
1140 rerr->setUnreachableNodes(i, node);
1143 rerr->setChunkLength(
B(4 + destCount * (
usingIpv6 ? (4 + 16) : (4 + 4))));
Referenced by handleLinkBreakSendRERR(), handleRERR(), and sendRERRWhenNoRouteToForward().
◆ createRoute()
| IRoute * inet::aodv::Aodv::createRoute |
( |
const L3Address & |
destAddr, |
|
|
const L3Address & |
nextHop, |
|
|
unsigned int |
hopCount, |
|
|
bool |
hasValidDestNum, |
|
|
unsigned int |
destSeqNum, |
|
|
bool |
isActive, |
|
|
simtime_t |
lifeTime |
|
) |
| |
|
protected |
984 newRoute->setDestination(destAddr);
985 newRoute->setNextHop(nextHop);
987 newRoute->setMetric(hopCount);
988 NetworkInterface *ifEntry =
interfaceTable->findInterfaceByName(par(
"interface"));
990 newRoute->setInterface(ifEntry);
992 newRoute->setSource(
this);
999 AodvRouteData *newProtocolData =
new AodvRouteData();
1000 newProtocolData->setIsActive(isActive);
1001 newProtocolData->setHasValidDestNum(hasValidDestNum);
1002 newProtocolData->setDestSeqNum(destSeqNum);
1003 newProtocolData->setLifeTime(lifeTime);
1004 newRoute->setProtocolData(newProtocolData);
1006 EV_DETAIL <<
"Adding new route " << newRoute << endl;
Referenced by handleHelloMessage(), handleRREP(), and handleRREQ().
◆ createRREP()
| const Ptr< Rrep > inet::aodv::Aodv::createRREP |
( |
const Ptr< Rreq > & |
rreq, |
|
|
IRoute * |
destRoute, |
|
|
IRoute * |
originatorRoute, |
|
|
const L3Address & |
sourceAddr |
|
) |
| |
|
protected |
434 auto rrep = makeShared<Rrep>();
442 rrep->setDestAddr(rreq->getDestAddr());
446 rrep->setOriginatorAddr(rreq->getOriginatorAddr());
460 if (!rreq->getUnknownSeqNumFlag() &&
sequenceNum + 1 == rreq->getDestSeqNum())
470 rrep->setHopCount(0);
481 AodvRouteData *destRouteData = check_and_cast<AodvRouteData *>(destRoute->getProtocolData());
482 AodvRouteData *originatorRouteData = check_and_cast<AodvRouteData *>(originatorRoute->getProtocolData());
483 rrep->setDestSeqNum(destRouteData->getDestSeqNum());
490 destRouteData->addPrecursor(lastHopAddr);
498 originatorRouteData->addPrecursor(destRoute->getNextHopAsGeneric());
504 rrep->setHopCount(destRoute->getMetric());
509 rrep->setLifeTime((destRouteData->getLifeTime() - simTime()).trunc(SIMTIME_MS));
Referenced by handleRREQ().
◆ createRREPACK()
| const Ptr< RrepAck > inet::aodv::Aodv::createRREPACK |
( |
| ) |
|
|
protected |
1635 auto rrepAck = makeShared<RrepAck>();
Referenced by handleRREP().
◆ createRREQ()
| const Ptr< Rreq > inet::aodv::Aodv::createRREQ |
( |
const L3Address & |
destAddr | ) |
|
|
protected |
376 auto rreqPacket = makeShared<Rreq>();
378 rreqPacket->setChunkLength(
usingIpv6 ?
B(48) :
B(24));
381 IRoute *lastKnownRoute =
routingTable->findBestMatchingRoute(destAddr);
390 if (lastKnownRoute && lastKnownRoute->getSource() ==
this) {
395 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(lastKnownRoute->getProtocolData());
396 if (routeData && routeData->hasValidDestNum()) {
397 rreqPacket->setDestSeqNum(routeData->getDestSeqNum());
398 rreqPacket->setUnknownSeqNumFlag(
false);
401 rreqPacket->setUnknownSeqNumFlag(
true);
404 rreqPacket->setUnknownSeqNumFlag(
true);
407 rreqPacket->setDestAddr(destAddr);
412 rreqPacket->setRreqId(
rreqId);
415 rreqPacket->setHopCount(0);
Referenced by handleWaitForRREP(), and startRouteDiscovery().
◆ datagramForwardHook()
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.
1511 const L3Address& destAddr = networkHeader->getDestinationAddress();
1512 const L3Address& sourceAddr = networkHeader->getSourceAddress();
1513 IRoute *ipSource =
routingTable->findBestMatchingRoute(sourceAddr);
1515 if (destAddr.isBroadcast() ||
routingTable->isLocalAddress(destAddr) || destAddr.isMulticast()) {
1516 if (
routingTable->isLocalAddress(destAddr) && ipSource && ipSource->getSource() ==
this)
1524 IRoute *routeDest =
routingTable->findBestMatchingRoute(destAddr);
1525 AodvRouteData *routeDestData = routeDest ?
dynamic_cast<AodvRouteData *
>(routeDest->getProtocolData()) :
nullptr;
1535 if (routeDest && routeDest->getSource() ==
this)
1543 if (ipSource && ipSource->getSource() ==
this)
1546 EV_INFO <<
"We can't forward datagram because we have no active route for " << destAddr << endl;
1547 if (routeDest && routeDestData && !routeDestData->isActive()) {
1559 if (routeDestData->hasValidDestNum())
1560 routeDestData->setDestSeqNum(routeDestData->getDestSeqNum() + 1);
1570 else if (!routeDest || routeDest->getSource() !=
this)
◆ datagramLocalInHook()
| virtual Result inet::aodv::Aodv::datagramLocalInHook |
( |
Packet * |
datagram | ) |
|
|
inlineoverrideprotectedvirtual |
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.
◆ datagramLocalOutHook()
| virtual Result inet::aodv::Aodv::datagramLocalOutHook |
( |
Packet * |
datagram | ) |
|
|
inlineoverrideprotectedvirtual |
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.
◆ datagramPostRoutingHook()
| virtual Result inet::aodv::Aodv::datagramPostRoutingHook |
( |
Packet * |
datagram | ) |
|
|
inlineoverrideprotectedvirtual |
This is the last hook called by the network protocol before it sends a datagram to the lower layer.
Implements inet::INetfilter::IHook.
◆ datagramPreRoutingHook()
| virtual Result inet::aodv::Aodv::datagramPreRoutingHook |
( |
Packet * |
datagram | ) |
|
|
inlineoverrideprotectedvirtual |
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.
◆ delayDatagram()
| void inet::aodv::Aodv::delayDatagram |
( |
Packet * |
datagram | ) |
|
|
protected |
266 EV_DETAIL <<
"Queuing datagram, source " << networkHeader->getSourceAddress() <<
", destination " << networkHeader->getDestinationAddress() << endl;
267 const L3Address& target = networkHeader->getDestinationAddress();
Referenced by ensureRouteForDatagram().
◆ ensureRouteForDatagram()
189 const L3Address& destAddr = networkHeader->getDestinationAddress();
190 const L3Address& sourceAddr = networkHeader->getSourceAddress();
192 if (destAddr.isBroadcast() ||
routingTable->isLocalAddress(destAddr) || destAddr.isMulticast())
195 EV_INFO <<
"Finding route for source " << sourceAddr <<
" with destination " << destAddr << endl;
196 IRoute *route =
routingTable->findBestMatchingRoute(destAddr);
197 AodvRouteData *routeData = route ?
dynamic_cast<AodvRouteData *
>(route->getProtocolData()) :
nullptr;
198 bool isActive = routeData && routeData->isActive();
199 if (isActive && !route->getNextHopAsGeneric().isUnspecified()) {
200 EV_INFO <<
"Active route found: " << route << endl;
213 bool isInactive = routeData && !routeData->isActive();
219 EV_INFO << (isInactive ?
"Inactive" :
"Missing") <<
" route for destination " << destAddr << endl;
233 EV_DETAIL <<
"Route discovery is in progress, originator " <<
getSelfIPAddress() <<
" target " << destAddr << endl;
◆ expungeRoutes()
| void inet::aodv::Aodv::expungeRoutes |
( |
| ) |
|
|
protected |
1440 for (
int i = 0; i <
routingTable->getNumRoutes(); i++) {
1442 if (route->getSource() ==
this) {
1443 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(route->getProtocolData());
1444 ASSERT(routeData !=
nullptr);
1445 if (routeData->getLifeTime() <= simTime()) {
1446 if (routeData->isActive()) {
1447 EV_DETAIL <<
"Route to " << route->getDestinationAsGeneric() <<
" expired and set to inactive. It will be deleted after DELETE_PERIOD time" << endl;
1452 routeData->setIsActive(
false);
1459 EV_DETAIL <<
"Route to " << route->getDestinationAsGeneric() <<
" expired and is inactive, but we are waiting for a RREP to this destination, so we extend its lifetime with 2 * NET_TRAVERSAL_TIME" << endl;
1463 EV_DETAIL <<
"Route to " << route->getDestinationAsGeneric() <<
" expired and is inactive and we are not expecting any RREP to this destination, so we delete this route" << endl;
Referenced by handleMessageWhenUp().
◆ forwardRREP()
| void inet::aodv::Aodv::forwardRREP |
( |
const Ptr< Rrep > & |
rrep, |
|
|
const L3Address & |
destAddr, |
|
|
unsigned int |
timeToLive |
|
) |
| |
|
protected |
1292 EV_INFO <<
"Forwarding the Route Reply to the node " << rrep->getOriginatorAddr() <<
" which originated the Route Request" << endl;
Referenced by handleRREP().
◆ forwardRREQ()
| void inet::aodv::Aodv::forwardRREQ |
( |
const Ptr< Rreq > & |
rreq, |
|
|
unsigned int |
timeToLive |
|
) |
| |
|
protected |
1303 EV_INFO <<
"Forwarding the Route Request message with TTL= " << timeToLive << endl;
Referenced by handleRREQ().
◆ getSelfIPAddress()
| L3Address inet::aodv::Aodv::getSelfIPAddress |
( |
| ) |
const |
|
protected |
◆ handleBlackListTimer()
| void inet::aodv::Aodv::handleBlackListTimer |
( |
| ) |
|
|
protected |
1680 simtime_t nextTime = SimTime::getMaxTime();
1683 auto current = it++;
1686 if (current->second <= simTime()) {
1687 EV_DETAIL <<
"Blacklist lifetime has expired for " << current->first <<
" removing it from the blacklisted addresses" << endl;
1690 else if (nextTime > current->second)
1691 nextTime = current->second;
1694 if (nextTime != SimTime::getMaxTime())
Referenced by handleMessageWhenUp().
◆ handleCrashOperation()
◆ handleHelloMessage()
| void inet::aodv::Aodv::handleHelloMessage |
( |
const Ptr< Rrep > & |
helloMessage | ) |
|
|
protected |
1402 const L3Address& helloOriginatorAddr = helloMessage->getDestAddr();
1403 IRoute *routeHelloOriginator =
routingTable->findBestMatchingRoute(helloOriginatorAddr);
1417 unsigned int latestDestSeqNum = helloMessage->getDestSeqNum();
1420 if (!routeHelloOriginator || routeHelloOriginator->getSource() !=
this)
1421 createRoute(helloOriginatorAddr, helloOriginatorAddr, 1,
true, latestDestSeqNum,
true, newLifeTime);
1423 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(routeHelloOriginator->getProtocolData());
1424 simtime_t lifeTime = routeData->getLifeTime();
1425 updateRoutingTable(routeHelloOriginator, helloOriginatorAddr, 1,
true, latestDestSeqNum,
true,
std::max(lifeTime, newLifeTime));
Referenced by handleRREP().
◆ handleLinkBreakSendRERR()
| void inet::aodv::Aodv::handleLinkBreakSendRERR |
( |
const L3Address & |
unreachableAddr | ) |
|
|
protected |
1062 IRoute *unreachableRoute =
routingTable->findBestMatchingRoute(unreachableAddr);
1064 if (!unreachableRoute || unreachableRoute->getSource() !=
this)
1067 std::vector<UnreachableNode> unreachableNodes;
1068 AodvRouteData *unreachableRouteData = check_and_cast<AodvRouteData *>(unreachableRoute->getProtocolData());
1070 if (unreachableRouteData->isActive()) {
1071 UnreachableNode node;
1072 node.addr = unreachableAddr;
1073 node.seqNum = unreachableRouteData->getDestSeqNum();
1074 unreachableNodes.push_back(node);
1082 for (
int i = 0; i <
routingTable->getNumRoutes(); i++) {
1085 AodvRouteData *routeData =
dynamic_cast<AodvRouteData *
>(route->getProtocolData());
1086 if (routeData && routeData->isActive() && route->getNextHopAsGeneric() == unreachableAddr) {
1087 if (routeData->hasValidDestNum())
1088 routeData->setDestSeqNum(routeData->getDestSeqNum() + 1);
1090 EV_DETAIL <<
"Marking route to " << route->getDestinationAsGeneric() <<
" as inactive" << endl;
1092 routeData->setIsActive(
false);
1096 UnreachableNode node;
1097 node.addr = route->getDestinationAsGeneric();
1098 node.seqNum = routeData->getDestSeqNum();
1099 unreachableNodes.push_back(node);
1113 EV_WARN <<
"A node should not generate more than RERR_RATELIMIT RERR messages per second. Canceling sending RERR" << endl;
1117 if (unreachableNodes.empty())
1124 EV_INFO <<
"Broadcasting Route Error message with TTL=1" << endl;
Referenced by receiveSignal().
◆ handleMessageWhenUp()
| void inet::aodv::Aodv::handleMessageWhenUp |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
Implements inet::OperationalMixin< cSimpleModule >.
92 if (msg->isSelfMessage()) {
93 if (
auto waitForRrep =
dynamic_cast<WaitForRrep *
>(msg))
108 auto timer = check_and_cast<PacketHolderMessage *>(msg);
113 throw cRuntimeError(
"Unknown self message");
◆ handleRERR()
| void inet::aodv::Aodv::handleRERR |
( |
const Ptr< const Rerr > & |
rerr, |
|
|
const L3Address & |
sourceAddr |
|
) |
| |
|
protected |
1150 EV_INFO <<
"AODV Route Error arrived with source addr: " << sourceAddr << endl;
1155 unsigned int unreachableArraySize = rerr->getUnreachableNodesArraySize();
1156 std::vector<UnreachableNode> unreachableNeighbors;
1158 for (
int i = 0; i <
routingTable->getNumRoutes(); i++) {
1160 AodvRouteData *routeData = route ?
dynamic_cast<AodvRouteData *
>(route->getProtocolData()) :
nullptr;
1169 if (routeData->isActive() && route->getNextHopAsGeneric() == sourceAddr) {
1170 for (
unsigned int j = 0; j < unreachableArraySize; j++) {
1171 if (route->getDestinationAsGeneric() == rerr->getUnreachableNodes(j).addr) {
1176 routeData->setDestSeqNum(rerr->getUnreachableNodes(j).seqNum);
1177 routeData->setIsActive(
false);
1184 if (routeData->getPrecursorList().size() > 0) {
1185 UnreachableNode node;
1186 node.addr = route->getDestinationAsGeneric();
1187 node.seqNum = routeData->getDestSeqNum();
1188 unreachableNeighbors.push_back(node);
1197 EV_WARN <<
"A node should not generate more than RERR_RATELIMIT RERR messages per second. Canceling sending RERR" << endl;
1202 EV_INFO <<
"Sending RERR to inform our neighbors about link breaks." << endl;
1203 auto newRERR =
createRERR(unreachableNeighbors);
Referenced by processPacket().
◆ handleRREP()
| void inet::aodv::Aodv::handleRREP |
( |
const Ptr< Rrep > & |
rrep, |
|
|
const L3Address & |
sourceAddr |
|
) |
| |
|
protected |
553 EV_INFO <<
"AODV Route Reply arrived with source addr: " << sourceAddr <<
" originator addr: " << rrep->getOriginatorAddr()
554 <<
" destination addr: " << rrep->getDestAddr() << endl;
556 if (rrep->getOriginatorAddr().isUnspecified()) {
557 EV_INFO <<
"This Route Reply is a Hello Message" << endl;
567 IRoute *previousHopRoute =
routingTable->findBestMatchingRoute(sourceAddr);
569 if (!previousHopRoute || previousHopRoute->getSource() !=
this) {
578 unsigned int newHopCount = rrep->getHopCount() + 1;
579 rrep->setHopCount(newHopCount);
584 IRoute *destRoute =
routingTable->findBestMatchingRoute(rrep->getDestAddr());
585 AodvRouteData *destRouteData =
nullptr;
586 simtime_t lifeTime = rrep->getLifeTime();
587 unsigned int destSeqNum = rrep->getDestSeqNum();
589 if (destRoute && destRoute->getSource() ==
this) {
590 destRouteData = check_and_cast<AodvRouteData *>(destRoute->getProtocolData());
596 if (!destRouteData->hasValidDestNum()) {
597 updateRoutingTable(destRoute, sourceAddr, newHopCount,
true, destSeqNum,
true, simTime() + lifeTime);
621 else if (destSeqNum > destRouteData->getDestSeqNum()) {
622 updateRoutingTable(destRoute, sourceAddr, newHopCount,
true, destSeqNum,
true, simTime() + lifeTime);
627 if (destSeqNum == destRouteData->getDestSeqNum() && !destRouteData->isActive()) {
628 updateRoutingTable(destRoute, sourceAddr, newHopCount,
true, destSeqNum,
true, simTime() + lifeTime);
632 else if (destSeqNum == destRouteData->getDestSeqNum() && newHopCount < (
unsigned int)destRoute->getMetric()) {
633 updateRoutingTable(destRoute, sourceAddr, newHopCount,
true, destSeqNum,
true, simTime() + lifeTime);
638 destRoute =
createRoute(rrep->getDestAddr(), sourceAddr, newHopCount,
true, destSeqNum,
true, simTime() + lifeTime);
639 destRouteData = check_and_cast<AodvRouteData *>(destRoute->getProtocolData());
649 IRoute *originatorRoute =
routingTable->findBestMatchingRoute(rrep->getOriginatorAddr());
656 if (originatorRoute && originatorRoute->getSource() ==
this) {
657 AodvRouteData *originatorRouteData = check_and_cast<AodvRouteData *>(originatorRoute->getProtocolData());
663 simtime_t existingLifeTime = originatorRouteData->getLifeTime();
672 if (rrep->getAckRequiredFlag()) {
675 rrep->setAckRequiredFlag(
false);
682 destRouteData->addPrecursor(originatorRoute->getNextHopAsGeneric());
688 IRoute *nextHopToDestRoute =
routingTable->findBestMatchingRoute(destRoute->getNextHopAsGeneric());
689 if (nextHopToDestRoute && nextHopToDestRoute->getSource() ==
this) {
690 AodvRouteData *nextHopToDestRouteData = check_and_cast<AodvRouteData *>(nextHopToDestRoute->getProtocolData());
691 nextHopToDestRouteData->addPrecursor(originatorRoute->getNextHopAsGeneric());
693 auto outgoingRREP = dynamicPtrCast<Rrep>(rrep->dupShared());
694 forwardRREP(outgoingRREP, originatorRoute->getNextHopAsGeneric(), 100);
698 EV_ERROR <<
"Reverse route doesn't exist. Dropping the RREP message" << endl;
702 EV_INFO <<
"The Route Reply has arrived for our Route Request to node " << rrep->getDestAddr() << endl;
703 updateRoutingTable(destRoute, sourceAddr, newHopCount,
true, destSeqNum,
true, simTime() + lifeTime);
Referenced by processPacket().
◆ handleRREPACK()
| void inet::aodv::Aodv::handleRREPACK |
( |
const Ptr< const RrepAck > & |
rrepACK, |
|
|
const L3Address & |
neighborAddr |
|
) |
| |
|
protected |
1653 EV_INFO <<
"RREP-ACK arrived from " << neighborAddr << endl;
1655 IRoute *route =
routingTable->findBestMatchingRoute(neighborAddr);
1656 if (route && route->getSource() ==
this) {
1657 EV_DETAIL <<
"Marking route " << route <<
" as active" << endl;
1658 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(route->getProtocolData());
1659 routeData->setIsActive(
true);
Referenced by processPacket().
◆ handleRREPACKTimer()
| void inet::aodv::Aodv::handleRREPACKTimer |
( |
| ) |
|
|
protected |
◆ handleRREQ()
| void inet::aodv::Aodv::handleRREQ |
( |
const Ptr< Rreq > & |
rreq, |
|
|
const L3Address & |
sourceAddr, |
|
|
unsigned int |
timeToLive |
|
) |
| |
|
protected |
775 EV_INFO <<
"AODV Route Request arrived with source addr: " << sourceAddr <<
" originator addr: " << rreq->getOriginatorAddr()
776 <<
" destination addr: " << rreq->getDestAddr() << endl;
781 EV_INFO <<
"The sender node " << sourceAddr <<
" is in our blacklist. Ignoring the Route Request" << endl;
788 IRoute *previousHopRoute =
routingTable->findBestMatchingRoute(sourceAddr);
790 if (!previousHopRoute || previousHopRoute->getSource() !=
this) {
801 RreqIdentifier rreqIdentifier(rreq->getOriginatorAddr(), rreq->getRreqId());
804 EV_WARN <<
"The same packet has arrived within PATH_DISCOVERY_TIME= " <<
pathDiscoveryTime <<
". Discarding it" << endl;
814 rreq->setHopCount(rreq->getHopCount() + 1);
819 IRoute *reverseRoute =
routingTable->findBestMatchingRoute(rreq->getOriginatorAddr());
846 unsigned int hopCount = rreq->getHopCount();
848 simtime_t newLifeTime =
std::max(simTime(), minimalLifeTime);
849 int rreqSeqNum = rreq->getOriginatorSeqNum();
850 if (!reverseRoute || reverseRoute->getSource() !=
this) {
853 reverseRoute =
createRoute(rreq->getOriginatorAddr(), sourceAddr, hopCount,
true, rreqSeqNum,
true, newLifeTime);
856 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(reverseRoute->getProtocolData());
857 int routeSeqNum = routeData->getDestSeqNum();
858 int newSeqNum =
std::max(routeSeqNum, rreqSeqNum);
859 int newHopCount = rreq->getHopCount();
860 int routeHopCount = reverseRoute->getMetric();
872 if (rreqSeqNum > routeSeqNum ||
873 (rreqSeqNum == routeSeqNum && newHopCount < routeHopCount) ||
874 rreq->getUnknownSeqNumFlag())
876 updateRoutingTable(reverseRoute, sourceAddr, hopCount,
true, newSeqNum,
true, newLifeTime);
896 IRoute *destRoute =
routingTable->findBestMatchingRoute(rreq->getDestAddr());
897 AodvRouteData *destRouteData = destRoute ?
dynamic_cast<AodvRouteData *
>(destRoute->getProtocolData()) :
nullptr;
901 EV_INFO <<
"I am the destination node for which the route was requested" << endl;
904 auto rrep =
createRREP(rreq, destRoute, reverseRoute, sourceAddr);
907 sendRREP(rrep, rreq->getOriginatorAddr(), 255);
913 if (destRouteData && destRouteData->isActive() && destRouteData->hasValidDestNum() &&
914 destRouteData->getDestSeqNum() >= rreq->getDestSeqNum())
916 EV_INFO <<
"I am an intermediate node who has information about a route to " << rreq->getDestAddr() << endl;
918 if (destRoute->getNextHopAsGeneric() == sourceAddr) {
919 EV_WARN <<
"This RREP would make a loop. Dropping it" << endl;
924 if (!rreq->getDestOnlyFlag()) {
926 auto rrep =
createRREP(rreq, destRoute, reverseRoute, sourceAddr);
929 sendRREP(rrep, rreq->getOriginatorAddr(), 255);
931 if (rreq->getGratuitousRREPFlag()) {
937 IRoute *originatorRoute =
routingTable->findBestMatchingRoute(rreq->getOriginatorAddr());
939 sendGRREP(grrep, rreq->getDestAddr(), 100);
945 EV_INFO <<
"The originator indicated that only the destination may respond to this RREQ (D flag is set). Forwarding ..." << endl;
966 rreq->setDestSeqNum(
std::max(destRouteData->getDestSeqNum(), rreq->getDestSeqNum()));
967 rreq->setUnknownSeqNumFlag(
false);
969 auto outgoingRREQ = dynamicPtrCast<Rreq>(rreq->dupShared());
973 EV_WARN <<
"Can't forward the RREQ because of its small (<= 1) TTL: " << timeToLive <<
" or the AODV reboot has not completed yet" << endl;
Referenced by processPacket().
◆ handleStartOperation()
◆ handleStopOperation()
◆ handleWaitForRREP()
| void inet::aodv::Aodv::handleWaitForRREP |
( |
WaitForRrep * |
rrepTimer | ) |
|
|
protected |
1270 EV_INFO <<
"We didn't get any Route Reply within RREP timeout" << endl;
1271 L3Address destAddr = rrepTimer->getDestAddr();
1276 EV_WARN <<
"Re-discovery attempts for node " << destAddr <<
" reached RREQ_RETRIES= " <<
rreqRetries <<
" limit. Stop sending RREQ." << endl;
Referenced by handleMessageWhenUp().
◆ hasOngoingRouteDiscovery()
| bool inet::aodv::Aodv::hasOngoingRouteDiscovery |
( |
const L3Address & |
destAddr | ) |
|
|
protected |
◆ initialize()
| void inet::aodv::Aodv::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ numInitStages()
| virtual int inet::aodv::Aodv::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ processPacket()
| void inet::aodv::Aodv::processPacket |
( |
Packet * |
pk | ) |
|
|
protected |
145 L3Address sourceAddr = packet->getTag<
L3AddressInd>()->getSrcAddress();
147 unsigned int arrivalPacketTTL = packet->getTag<HopLimitInd>()->getHopLimit() - 1;
148 const auto& aodvPacket = packet->popAtFront<AodvControlPacket>();
151 auto packetType = aodvPacket->getPacketType();
152 switch (packetType) {
156 handleRREQ(
CHK(dynamicPtrCast<Rreq>(aodvPacket->dupShared())), sourceAddr, arrivalPacketTTL);
163 handleRREP(
CHK(dynamicPtrCast<Rrep>(aodvPacket->dupShared())), sourceAddr);
170 handleRERR(
CHK(dynamicPtrCast<const Rerr>(aodvPacket)), sourceAddr);
182 throw cRuntimeError(
"AODV Control Packet arrived with undefined packet type: %d", packetType);
Referenced by socketDataArrived().
◆ receiveSignal()
| void inet::aodv::Aodv::receiveSignal |
( |
cComponent * |
source, |
|
|
simsignal_t |
signalID, |
|
|
cObject * |
obj, |
|
|
cObject * |
details |
|
) |
| |
|
overrideprotectedvirtual |
1015 Enter_Method(
"%s", cComponent::getSignalName(signalID));
1018 EV_DETAIL <<
"Received link break signal" << endl;
1019 Packet *datagram = check_and_cast<Packet *>(obj);
1021 if (networkHeader !=
nullptr) {
1022 L3Address unreachableAddr = networkHeader->getDestinationAddress();
1023 if (unreachableAddr.getAddressType() ==
addressType) {
1032 IRoute *route =
routingTable->findBestMatchingRoute(unreachableAddr);
1034 if (route && route->getSource() ==
this)
◆ scheduleExpungeRoutes()
| void inet::aodv::Aodv::scheduleExpungeRoutes |
( |
| ) |
|
|
protected |
1475 simtime_t nextExpungeTime = SimTime::getMaxTime();
1476 for (
int i = 0; i <
routingTable->getNumRoutes(); i++) {
1479 if (route->getSource() ==
this) {
1480 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(route->getProtocolData());
1481 ASSERT(routeData !=
nullptr);
1483 if (routeData->getLifeTime() < nextExpungeTime)
1484 nextExpungeTime = routeData->getLifeTime();
1487 if (nextExpungeTime == SimTime::getMaxTime()) {
1495 if (
expungeTimer->getArrivalTime() != nextExpungeTime) {
Referenced by createRoute(), expungeRoutes(), handleLinkBreakSendRERR(), handleRERR(), and updateRoutingTable().
◆ sendAODVPacket()
| void inet::aodv::Aodv::sendAODVPacket |
( |
const Ptr< AodvControlPacket > & |
packet, |
|
|
const L3Address & |
destAddr, |
|
|
unsigned int |
timeToLive, |
|
|
double |
delay |
|
) |
| |
|
protected |
731 ASSERT(timeToLive != 0);
733 const char *className = aodvPacket->getClassName();
734 Packet *packet =
new Packet(!strncmp(
"inet::", className, 6) ? className + 6 : className);
735 packet->insertAtBack(aodvPacket);
737 int interfaceId =
CHK(
interfaceTable->findInterfaceByName(par(
"interface")))->getInterfaceId();
738 packet->addTag<
InterfaceReq>()->setInterfaceId(interfaceId);
739 packet->addTag<
HopLimitReq>()->setHopLimit(timeToLive);
740 packet->addTag<L3AddressReq>()->setDestAddress(destAddr);
743 if (destAddr.isBroadcast())
749 auto *timer =
new PacketHolderMessage(
"aodv-send-jitter",
KIND_DELAYEDSEND);
750 timer->setOwnedPacket(packet);
751 scheduleAfter(delay, timer);
Referenced by forwardRREP(), forwardRREQ(), handleLinkBreakSendRERR(), handleRERR(), sendGRREP(), sendHelloMessagesIfNeeded(), sendRERRWhenNoRouteToForward(), sendRREP(), sendRREPACK(), and sendRREQ().
◆ sendGRREP()
| void inet::aodv::Aodv::sendGRREP |
( |
const Ptr< Rrep > & |
grrep, |
|
|
const L3Address & |
destAddr, |
|
|
unsigned int |
timeToLive |
|
) |
| |
|
protected |
1335 EV_INFO <<
"Sending gratuitous Route Reply to " << destAddr << endl;
1337 IRoute *destRoute =
routingTable->findBestMatchingRoute(destAddr);
1338 const L3Address& nextHop = destRoute->getNextHopAsGeneric();
Referenced by handleRREQ().
◆ sendHelloMessagesIfNeeded()
| void inet::aodv::Aodv::sendHelloMessagesIfNeeded |
( |
| ) |
|
|
protected |
1378 bool hasActiveRoute =
false;
1380 for (
int i = 0; i <
routingTable->getNumRoutes(); i++) {
1382 if (route->getSource() ==
this) {
1383 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(route->getProtocolData());
1384 if (routeData->isActive()) {
1385 hasActiveRoute =
true;
1392 EV_INFO <<
"It is hello time, broadcasting Hello Messages with TTL=1" << endl;
Referenced by handleMessageWhenUp().
◆ sendRERRWhenNoRouteToForward()
| void inet::aodv::Aodv::sendRERRWhenNoRouteToForward |
( |
const L3Address & |
unreachableAddr | ) |
|
|
protected |
1579 EV_WARN <<
"A node should not generate more than RERR_RATELIMIT RERR messages per second. Canceling sending RERR" << endl;
1582 std::vector<UnreachableNode> unreachableNodes;
1583 UnreachableNode node;
1584 node.addr = unreachableAddr;
1586 IRoute *unreachableRoute =
routingTable->findBestMatchingRoute(unreachableAddr);
1587 AodvRouteData *unreachableRouteData = unreachableRoute ?
dynamic_cast<AodvRouteData *
>(unreachableRoute->getProtocolData()) :
nullptr;
1589 if (unreachableRouteData && unreachableRouteData->hasValidDestNum())
1590 node.seqNum = unreachableRouteData->getDestSeqNum();
1594 unreachableNodes.push_back(node);
1598 EV_INFO <<
"Broadcasting Route Error message with TTL=1" << endl;
Referenced by datagramForwardHook().
◆ sendRREP()
| void inet::aodv::Aodv::sendRREP |
( |
const Ptr< Rrep > & |
rrep, |
|
|
const L3Address & |
destAddr, |
|
|
unsigned int |
timeToLive |
|
) |
| |
|
protected |
344 EV_INFO <<
"Sending Route Reply to " << destAddr << endl;
350 IRoute *destRoute =
routingTable->findBestMatchingRoute(destAddr);
351 const L3Address& nextHop = destRoute->getNextHopAsGeneric();
352 AodvRouteData *destRouteData = check_and_cast<AodvRouteData *>(destRoute->getProtocolData());
353 destRouteData->addPrecursor(nextHop);
357 if (destRoute->getMetric() == 1) {
362 rrep->setAckRequiredFlag(
true);
Referenced by handleRREQ().
◆ sendRREPACK()
| void inet::aodv::Aodv::sendRREPACK |
( |
const Ptr< RrepAck > & |
rrepACK, |
|
|
const L3Address & |
destAddr |
|
) |
| |
|
protected |
1642 EV_INFO <<
"Sending Route Reply ACK to " << destAddr << endl;
Referenced by handleRREP().
◆ sendRREQ()
| void inet::aodv::Aodv::sendRREQ |
( |
const Ptr< Rreq > & |
rreq, |
|
|
const L3Address & |
destAddr, |
|
|
unsigned int |
timeToLive |
|
) |
| |
|
protected |
285 EV_WARN <<
"A node should not originate more than RREQ_RATELIMIT RREQ messages per second. Canceling sending RREQ" << endl;
290 WaitForRrep *rrepTimerMsg =
nullptr;
292 rrepTimerMsg = rrepTimer->second;
293 unsigned int lastTTL = rrepTimerMsg->getLastTTL();
294 rrepTimerMsg->setDestAddr(rreq->getDestAddr());
306 if (timeToLive != 0) {
307 rrepTimerMsg->setLastTTL(timeToLive);
308 rrepTimerMsg->setFromInvalidEntry(
true);
309 cancelEvent(rrepTimerMsg);
312 ASSERT(!rrepTimerMsg->isScheduled());
317 ASSERT(!rrepTimerMsg->isScheduled());
323 rrepTimerMsg =
new WaitForRrep();
329 rrepTimerMsg->setFromInvalidEntry(
false);
330 rrepTimerMsg->setDestAddr(rreq->getDestAddr());
335 scheduleAfter(ringTraversalTime, rrepTimerMsg);
337 EV_INFO <<
"Sending a Route Request with target " << rreq->getDestAddr() <<
" and TTL= " << timeToLive << endl;
Referenced by handleWaitForRREP(), and startRouteDiscovery().
◆ socketClosed()
| void inet::aodv::Aodv::socketClosed |
( |
UdpSocket * |
socket | ) |
|
|
overrideprotectedvirtual |
◆ socketDataArrived()
| void inet::aodv::Aodv::socketDataArrived |
( |
UdpSocket * |
socket, |
|
|
Packet * |
packet |
|
) |
| |
|
overrideprotectedvirtual |
◆ socketErrorArrived()
Notifies about error indication arrival, indication ownership is transferred to the callee.
Implements inet::UdpSocket::ICallback.
763 EV_WARN <<
"Ignoring UDP error report " << indication->getName() << endl;
◆ startRouteDiscovery()
| void inet::aodv::Aodv::startRouteDiscovery |
( |
const L3Address & |
target, |
|
|
unsigned int |
timeToLive = 0 |
|
) |
| |
|
protected |
◆ updateRoutingTable()
| void inet::aodv::Aodv::updateRoutingTable |
( |
IRoute * |
route, |
|
|
const L3Address & |
nextHop, |
|
|
unsigned int |
hopCount, |
|
|
bool |
hasValidDestNum, |
|
|
unsigned int |
destSeqNum, |
|
|
bool |
isActive, |
|
|
simtime_t |
lifeTime |
|
) |
| |
|
protected |
711 EV_DETAIL <<
"Updating existing route: " << route << endl;
713 route->setNextHop(nextHop);
714 route->setMetric(hopCount);
716 AodvRouteData *routingData = check_and_cast<AodvRouteData *>(route->getProtocolData());
717 ASSERT(routingData !=
nullptr);
719 routingData->setLifeTime(lifeTime);
720 routingData->setDestSeqNum(destSeqNum);
721 routingData->setIsActive(isActive);
722 routingData->setHasValidDestNum(hasValidDestNum);
724 EV_DETAIL <<
"Route updated: " << route << endl;
Referenced by handleHelloMessage(), handleRREP(), and handleRREQ().
◆ updateValidRouteLifeTime()
| bool inet::aodv::Aodv::updateValidRouteLifeTime |
( |
const L3Address & |
destAddr, |
|
|
simtime_t |
lifetime |
|
) |
| |
|
protected |
1620 IRoute *route =
routingTable->findBestMatchingRoute(destAddr);
1621 if (route && route->getSource() ==
this) {
1622 AodvRouteData *routeData = check_and_cast<AodvRouteData *>(route->getProtocolData());
1623 if (routeData->isActive()) {
1624 simtime_t newLifeTime =
std::max(routeData->getLifeTime(), lifetime);
1625 EV_DETAIL <<
"Updating " << route <<
" lifetime to " << newLifeTime << endl;
1626 routeData->setLifeTime(newLifeTime);
Referenced by datagramForwardHook(), and ensureRouteForDatagram().
◆ activeRouteTimeout
| simtime_t inet::aodv::Aodv::activeRouteTimeout |
|
protected |
◆ addressToRreqRetries
| std::map<L3Address, unsigned int> inet::aodv::Aodv::addressToRreqRetries |
|
protected |
◆ addressType
◆ allowedHelloLoss
| unsigned int inet::aodv::Aodv::allowedHelloLoss = 0 |
|
protected |
◆ aodvUDPPort
| unsigned int inet::aodv::Aodv::aodvUDPPort = 0 |
|
protected |
◆ askGratuitousRREP
| bool inet::aodv::Aodv::askGratuitousRREP = false |
|
protected |
◆ blacklist
| std::map<L3Address, simtime_t> inet::aodv::Aodv::blacklist |
|
protected |
◆ blacklistTimeout
| simtime_t inet::aodv::Aodv::blacklistTimeout |
|
protected |
◆ blacklistTimer
| cMessage* inet::aodv::Aodv::blacklistTimer = nullptr |
|
protected |
◆ counterTimer
| cMessage* inet::aodv::Aodv::counterTimer = nullptr |
|
protected |
◆ deletePeriod
| simtime_t inet::aodv::Aodv::deletePeriod |
|
protected |
◆ destinationOnlyFlag
| bool inet::aodv::Aodv::destinationOnlyFlag = false |
|
protected |
◆ expungeTimer
| cMessage* inet::aodv::Aodv::expungeTimer = nullptr |
|
protected |
◆ failedNextHop
◆ helloInterval
| simtime_t inet::aodv::Aodv::helloInterval |
|
protected |
◆ helloMsgTimer
| cMessage* inet::aodv::Aodv::helloMsgTimer = nullptr |
|
protected |
◆ host
| cModule* inet::aodv::Aodv::host = nullptr |
|
protected |
◆ interfaceTable
◆ jitterPar
| cPar* inet::aodv::Aodv::jitterPar = nullptr |
|
protected |
◆ lastBroadcastTime
| simtime_t inet::aodv::Aodv::lastBroadcastTime |
|
protected |
◆ localAddTTL
| unsigned int inet::aodv::Aodv::localAddTTL = 0 |
|
protected |
◆ maxJitter
| simtime_t inet::aodv::Aodv::maxJitter |
|
protected |
◆ myRouteTimeout
| simtime_t inet::aodv::Aodv::myRouteTimeout |
|
protected |
◆ netDiameter
| unsigned int inet::aodv::Aodv::netDiameter = 0 |
|
protected |
◆ netTraversalTime
| simtime_t inet::aodv::Aodv::netTraversalTime |
|
protected |
◆ networkProtocol
◆ nextHopWait
| simtime_t inet::aodv::Aodv::nextHopWait |
|
protected |
◆ nodeTraversalTime
| simtime_t inet::aodv::Aodv::nodeTraversalTime |
|
protected |
◆ pathDiscoveryTime
| simtime_t inet::aodv::Aodv::pathDiscoveryTime |
|
protected |
◆ periodicJitter
| cPar* inet::aodv::Aodv::periodicJitter = nullptr |
|
protected |
◆ rebootTime
| simtime_t inet::aodv::Aodv::rebootTime |
|
protected |
◆ rerrCount
| unsigned int inet::aodv::Aodv::rerrCount = 0 |
|
protected |
◆ rerrRatelimit
| unsigned int inet::aodv::Aodv::rerrRatelimit = 0 |
|
protected |
◆ routingTable
Referenced by createRoute(), createRREQ(), datagramForwardHook(), ensureRouteForDatagram(), expungeRoutes(), getSelfIPAddress(), handleHelloMessage(), handleLinkBreakSendRERR(), handleRERR(), handleRREP(), handleRREPACK(), handleRREQ(), initialize(), receiveSignal(), scheduleExpungeRoutes(), sendGRREP(), sendHelloMessagesIfNeeded(), sendRERRWhenNoRouteToForward(), sendRREP(), and updateValidRouteLifeTime().
◆ rrepAckTimer
| cMessage* inet::aodv::Aodv::rrepAckTimer = nullptr |
|
protected |
◆ rreqCount
| unsigned int inet::aodv::Aodv::rreqCount = 0 |
|
protected |
◆ rreqId
| unsigned int inet::aodv::Aodv::rreqId = 0 |
|
protected |
◆ rreqRatelimit
| unsigned int inet::aodv::Aodv::rreqRatelimit = 0 |
|
protected |
◆ rreqRetries
| unsigned int inet::aodv::Aodv::rreqRetries = 0 |
|
protected |
◆ rreqsArrivalTime
◆ sequenceNum
| unsigned int inet::aodv::Aodv::sequenceNum = 0 |
|
protected |
◆ socket
◆ targetAddressToDelayedPackets
| std::multimap<L3Address, Packet *> inet::aodv::Aodv::targetAddressToDelayedPackets |
|
protected |
◆ timeoutBuffer
| unsigned int inet::aodv::Aodv::timeoutBuffer = 0 |
|
protected |
◆ ttlIncrement
| unsigned int inet::aodv::Aodv::ttlIncrement = 0 |
|
protected |
◆ ttlStart
| unsigned int inet::aodv::Aodv::ttlStart = 0 |
|
protected |
◆ ttlThreshold
| unsigned int inet::aodv::Aodv::ttlThreshold = 0 |
|
protected |
◆ useHelloMessages
| bool inet::aodv::Aodv::useHelloMessages = false |
|
protected |
◆ usingIpv6
| bool inet::aodv::Aodv::usingIpv6 = false |
|
protected |
◆ waitForRREPTimers
The documentation for this class was generated from the following files:
void setOutputGate(cGate *toUdp)
Sets the gate on which to send to UDP.
Definition: UdpSocket.h:117
#define CHK(x)
Definition: INETDefs.h:87
const Ptr< Rrep > createHelloMessage()
Definition: Aodv.cc:1343
cMessage * expungeTimer
Definition: Aodv.h:119
@ AODV
managed by AODV routing
Definition: IRoute.h:41
const Ptr< Rerr > createRERR(const std::vector< UnreachableNode > &unreachableNodes)
Definition: Aodv.cc:1128
bool usingIpv6
Definition: Aodv.h:72
simtime_t helloInterval
Definition: Aodv.h:82
State operationalState
Definition: OperationalMixin.h:23
void handleLinkBreakSendRERR(const L3Address &unreachableAddr)
Definition: Aodv.cc:1041
void bind(int localPort)
Bind the socket to a local port number.
Definition: UdpSocket.cc:34
@ RERR
Definition: AodvControlPackets_m.h:77
void sendHelloMessagesIfNeeded()
Definition: Aodv.cc:1368
virtual int getMaxPrefixLength() const =0
void handleRERR(const Ptr< const Rerr > &rerr, const L3Address &sourceAddr)
Definition: Aodv.cc:1148
simtime_t nodeTraversalTime
Definition: Aodv.h:92
void completeRouteDiscovery(const L3Address &target)
Definition: Aodv.cc:1307
IRoute * createRoute(const L3Address &destAddr, const L3Address &nextHop, unsigned int hopCount, bool hasValidDestNum, unsigned int destSeqNum, bool isActive, simtime_t lifeTime)
Definition: Aodv.cc:976
simsignal_t linkBrokenSignal
Definition: Simsignals.cc:22
void forwardRREP(const Ptr< Rrep > &rrep, const L3Address &destAddr, unsigned int timeToLive)
Definition: Aodv.cc:1290
ModuleRefByPar< IInterfaceTable > interfaceTable
Definition: Aodv.h:69
void sendRREP(const Ptr< Rrep > &rrep, const L3Address &destAddr, unsigned int timeToLive)
Definition: Aodv.cc:342
const int KIND_DELAYEDSEND
Definition: Aodv.cc:31
std::map< L3Address, WaitForRrep * > waitForRREPTimers
Definition: Aodv.h:108
std::map< L3Address, unsigned int > addressToRreqRetries
Definition: Aodv.h:115
removed L4PortReq
Definition: IUdp-gates.txt:11
void handleHelloMessage(const Ptr< Rrep > &helloMessage)
Definition: Aodv.cc:1400
simtime_t myRouteTimeout
Definition: Aodv.h:99
simtime_t nextHopWait
Definition: Aodv.h:102
cModule * host
Definition: Aodv.h:67
void clearState()
Definition: Aodv.cc:1240
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
virtual void initialize(int stage) override
Definition: OperationalMixinImpl.h:26
simtime_t netTraversalTime
Definition: Aodv.h:101
cPar * periodicJitter
Definition: Aodv.h:94
removed InterfaceReq
Definition: IUdp-gates.txt:11
virtual void destroy() override
Notify the protocol that the owner of ISocket has destroyed the socket.
Definition: UdpSocket.cc:98
void sendRREQ(const Ptr< Rreq > &rreq, const L3Address &destAddr, unsigned int timeToLive)
Definition: Aodv.cc:271
unsigned int rerrRatelimit
Definition: Aodv.h:75
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
unsigned int aodvUDPPort
Definition: Aodv.h:76
void updateRoutingTable(IRoute *route, const L3Address &nextHop, unsigned int hopCount, bool hasValidDestNum, unsigned int destSeqNum, bool isActive, simtime_t lifeTime)
Definition: Aodv.cc:709
void forwardRREQ(const Ptr< Rreq > &rreq, unsigned int timeToLive)
Definition: Aodv.cc:1301
@ RREQ
Definition: AodvControlPackets_m.h:75
virtual L3Address getBroadcastAddress() const =0
unsigned int ttlStart
Definition: Aodv.h:87
const Ptr< RrepAck > createRREPACK()
Definition: Aodv.cc:1633
void sendAODVPacket(const Ptr< AodvControlPacket > &packet, const L3Address &destAddr, unsigned int timeToLive, double delay)
Definition: Aodv.cc:729
void processPacket(Packet *pk)
Definition: Aodv.cc:143
std::map< L3Address, simtime_t > blacklist
Definition: Aodv.h:111
@ RREP_IPv6
Definition: AodvControlPackets_m.h:80
void setCallback(ICallback *cb)
Sets a callback object, to be used with processMessage().
Definition: UdpSocket.cc:338
const Ptr< Rrep > createRREP(const Ptr< Rreq > &rreq, IRoute *destRoute, IRoute *originatorRoute, const L3Address &sourceAddr)
Definition: Aodv.cc:432
Result ensureRouteForDatagram(Packet *datagram)
Definition: Aodv.cc:186
void handleWaitForRREP(WaitForRrep *rrepTimer)
Definition: Aodv.cc:1268
cMessage * counterTimer
Definition: Aodv.h:120
simtime_t activeRouteTimeout
Definition: Aodv.h:81
void handleRREPACKTimer()
Definition: Aodv.cc:1665
void expungeRoutes()
Definition: Aodv.cc:1438
bool useHelloMessages
Definition: Aodv.h:78
@ RREQ_IPv6
Definition: AodvControlPackets_m.h:79
const Ptr< const NetworkHeaderBase > findNetworkProtocolHeader(Packet *packet)
Definition: L3Tools.cc:37
void cancelRouteDiscovery(const L3Address &destAddr)
Definition: Aodv.cc:1602
virtual void send(Packet *msg) override
Sends a data packet to the address and port specified previously in a connect() call.
Definition: UdpSocket.cc:80
bool hasOngoingRouteDiscovery(const L3Address &destAddr)
Definition: Aodv.cc:244
unsigned int netDiameter
Definition: Aodv.h:83
void sendGRREP(const Ptr< Rrep > &grrep, const L3Address &destAddr, unsigned int timeToLive)
Definition: Aodv.cc:1333
void scheduleExpungeRoutes()
Definition: Aodv.cc:1473
simtime_t lastBroadcastTime
Definition: Aodv.h:114
intscale< b, 1, 8 > B
Definition: Units.h:1168
const Ptr< const NetworkHeaderBase > getNetworkProtocolHeader(Packet *packet)
Definition: L3Tools.cc:43
unsigned int localAddTTL
Definition: Aodv.h:90
simtime_t pathDiscoveryTime
Definition: Aodv.h:103
L3Address failedNextHop
Definition: Aodv.h:110
std::multimap< L3Address, Packet * > targetAddressToDelayedPackets
Definition: Aodv.h:128
cMessage * rrepAckTimer
Definition: Aodv.h:121
@ QUEUE
queues the datagram for later re-injection (e.g. when route discovery completes)
Definition: INetfilter.h:42
UdpSocket socket
Definition: Aodv.h:71
@ RREP
Definition: AodvControlPackets_m.h:76
cPar * jitterPar
Definition: Aodv.h:93
virtual void processMessage(cMessage *msg) override
Examines the message, takes ownership, and updates socket state.
Definition: UdpSocket.cc:343
removed HopLimitReq
Definition: IUdp-gates.txt:11
simtime_t deletePeriod
Definition: Aodv.h:98
const Ptr< Rrep > createGratuitousRREP(const Ptr< Rreq > &rreq, IRoute *originatorRoute)
Definition: Aodv.cc:515
simtime_t rebootTime
Definition: Aodv.h:125
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
unsigned int sequenceNum
Definition: Aodv.h:107
unsigned int timeoutBuffer
Definition: Aodv.h:86
virtual void close() override
Unbinds the socket.
Definition: UdpSocket.cc:87
unsigned int ttlIncrement
Definition: Aodv.h:88
@ RERR_IPv6
Definition: AodvControlPackets_m.h:81
unsigned int rreqRetries
Definition: Aodv.h:84
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
double max(const double a, const double b)
Returns the maximum of a and b.
Definition: SctpAssociation.h:266
void setBroadcast(bool broadcast)
Set the Broadcast option on the UDP socket.
Definition: UdpSocket.cc:139
@ RREPACK_IPv6
Definition: AodvControlPackets_m.h:82
bool destinationOnlyFlag
Definition: Aodv.h:79
@ IPv6
Definition: L3Address.h:36
bool updateValidRouteLifeTime(const L3Address &destAddr, simtime_t lifetime)
Definition: Aodv.cc:1618
std::map< RreqIdentifier, simtime_t, RreqIdentifierCompare > rreqsArrivalTime
Definition: Aodv.h:109
void handleRREQ(const Ptr< Rreq > &rreq, const L3Address &sourceAddr, unsigned int timeToLive)
Definition: Aodv.cc:773
simtime_t blacklistTimeout
Definition: Aodv.h:100
const Ptr< Rreq > createRREQ(const L3Address &destAddr)
Definition: Aodv.cc:374
virtual void startActiveOperationExtraTimeOrFinish(simtime_t extraTime)
Definition: OperationalMixinImpl.h:179
#define Enter_Method(...)
Definition: SelfDoc.h:71
unsigned int rreqId
Definition: Aodv.h:106
IL3AddressType * addressType
Definition: Aodv.h:64
void sendRREPACK(const Ptr< RrepAck > &rrepACK, const L3Address &destAddr)
Definition: Aodv.cc:1640
void handleRREP(const Ptr< Rrep > &rrep, const L3Address &sourceAddr)
Definition: Aodv.cc:549
L3Address getSelfIPAddress() const
Definition: Aodv.cc:258
@ ACCEPT
allows the datagram to pass to the next hook
Definition: INetfilter.h:40
unsigned int rerrCount
Definition: Aodv.h:112
IL3AddressType * getAddressType() const
Definition: L3Address.cc:59
cMessage * helloMsgTimer
Definition: Aodv.h:118
unsigned int rreqCount
Definition: Aodv.h:113
bool askGratuitousRREP
Definition: Aodv.h:77
void handleBlackListTimer()
Definition: Aodv.cc:1678
ModuleRefByPar< INetfilter > networkProtocol
Definition: Aodv.h:70
@ RREPACK
Definition: AodvControlPackets_m.h:78
ModuleRefByPar< IRoutingTable > routingTable
Definition: Aodv.h:68
void handleRREPACK(const Ptr< const RrepAck > &rrepACK, const L3Address &neighborAddr)
Definition: Aodv.cc:1646
void checkIpVersionAndPacketTypeCompatibility(AodvControlPacketType packetType)
Definition: Aodv.cc:119
unsigned int allowedHelloLoss
Definition: Aodv.h:91
void delayDatagram(Packet *datagram)
Definition: Aodv.cc:263
unsigned int rreqRatelimit
Definition: Aodv.h:85
cMessage * blacklistTimer
Definition: Aodv.h:122
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80
INET_API InitStage INITSTAGE_ROUTING_PROTOCOLS
Initialization of routing protocols.
unsigned int ttlThreshold
Definition: Aodv.h:89
void startRouteDiscovery(const L3Address &target, unsigned int timeToLive=0)
Definition: Aodv.cc:249
void sendRERRWhenNoRouteToForward(const L3Address &unreachableAddr)
Definition: Aodv.cc:1576