INET Framework for OMNeT++/OMNEST
|
Implements RFC 2461 Neighbor Discovery for IPv6. More...
#include <IPv6NeighbourDiscovery.h>
Classes | |
struct | AdvIfEntry |
struct | DADEntry |
struct | DADGlobalEntry |
struct | RDEntry |
Public Types | |
typedef std::vector< cMessage * > | MsgPtrVector |
typedef IPv6NeighbourCache::Key | Key |
typedef IPv6NeighbourCache::Neighbour | Neighbour |
typedef IPv6NeighbourCache::DefaultRouterList | DefaultRouterList |
Public Member Functions | |
IPv6NeighbourDiscovery () | |
virtual | ~IPv6NeighbourDiscovery () |
const MACAddress & | resolveNeighbour (const IPv6Address &nextHop, int interfaceId) |
Public method, to be invoked from the IPv6 module to determine link-layer address and the output interface of the next hop. More... | |
virtual void | reachabilityConfirmed (const IPv6Address &neighbour, int interfaceId) |
Public method, it can be invoked from the IPv6 module or any other module to let Neighbour Discovery know that the reachability of the given neighbor has just been confirmed (e.g. More... | |
virtual void | sendUnsolicitedNA (InterfaceEntry *ie) |
void | invalidateNeigbourCache () |
RFC2463 Section 3.1: Destination Unreachable Message Send an unreachable message to the IPv6 module. More... | |
Public Member Functions inherited from inet::ILifecycle | |
virtual | ~ILifecycle () |
Protected Types | |
typedef std::set< cMessage * > | RATimerList |
typedef std::set< DADEntry * > | DADList |
typedef std::set< RDEntry * > | RDList |
typedef std::set< AdvIfEntry * > | AdvIfList |
typedef std::map< InterfaceEntry *, DADGlobalEntry > | DADGlobalList |
Protected Member Functions | |
virtual int | numInitStages () const override |
virtual void | initialize (int stage) override |
virtual void | handleMessage (cMessage *msg) override |
virtual void | processNDMessage (ICMPv6Message *msg, IPv6ControlInfo *ctrlInfo) |
virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
Perform one stage of a lifecycle operation. More... | |
virtual void | finish () override |
virtual void | processIPv6Datagram (IPv6Datagram *datagram) |
virtual IPv6NeighbourDiscovery::AdvIfEntry * | fetchAdvIfEntry (InterfaceEntry *ie) |
virtual IPv6NeighbourDiscovery::RDEntry * | fetchRDEntry (InterfaceEntry *ie) |
virtual IPv6Address | determineNextHop (const IPv6Address &destAddr, int &outIfID) |
This function accepts the datagram's destination address and attempts to determine the destination's next hop address and interface ID by: (1) looking up the destination cache, (2)looking up the routing table, or (3) selecting a default router. More... | |
virtual void | initiateNeighbourUnreachabilityDetection (Neighbour *neighbour) |
virtual void | processNUDTimeout (cMessage *timeoutMsg) |
virtual IPv6Address | selectDefaultRouter (int &outIfID) |
virtual void | timeoutPrefixEntry (const IPv6Address &destPrefix, int prefixLength) |
RFC 2461: Section 6.3.5 Whenever the invalidation timer expires for a Prefix List entry, that entry is discarded. More... | |
virtual void | timeoutDefaultRouter (const IPv6Address &addr, int interfaceID) |
RFC 2461: Section 6.3.5 Whenever the Lifetime of an entry in the Default Router List expires, that entry is discarded. More... | |
virtual void | initiateAddressResolution (const IPv6Address &dgSrcAddr, Neighbour *nce) |
This method attempts to resolve the given neighbour's link-layer address. More... | |
virtual void | processARTimeout (cMessage *arTimeoutMsg) |
Resends a NS packet to the address intended for address resolution. More... | |
virtual void | dropQueuedPacketsAwaitingAR (Neighbour *nce) |
Drops specific queued packets for a specific NCE AR-timeout. More... | |
virtual void | sendPacketToIPv6Module (cMessage *msg, const IPv6Address &destAddr, const IPv6Address &srcAddr, int interfaceId) |
Create control info and assigns it to a msg. More... | |
virtual void | sendQueuedPacketsToIPv6Module (Neighbour *nce) |
Send off any queued packets within the Neighbour Discovery module awaiting address resolution. More... | |
virtual void | initiateDAD (const IPv6Address &tentativeAddr, InterfaceEntry *ie) |
Initiating DAD means to send off a Neighbour Solicitation with its target address set as this node's tentative link-local address. More... | |
virtual void | processDADTimeout (cMessage *msg) |
Sends a scheduled DAD NS packet. More... | |
virtual void | makeTentativeAddressPermanent (const IPv6Address &tentativeAddr, InterfaceEntry *ie) |
Permanently assign the given address for the given interface entry. More... | |
virtual void | assignLinkLocalAddress (cMessage *timerMsg) |
as it is not possbile to explicitly define RFC 2462. More... | |
virtual IPv6RouterSolicitation * | createAndSendRSPacket (InterfaceEntry *ie) |
virtual void | initiateRouterDiscovery (cMessage *msg) |
virtual void | cancelRouterDiscovery (InterfaceEntry *ie) |
RFC 2461: Section 6.3.7 4th paragraph Once the host sends a Router Solicitation, and receives a valid Router Advertisement with a non-zero Router Lifetime, the host MUST desist from sending additional solicitations on that interface,. More... | |
virtual void | processRDTimeout (cMessage *msg) |
virtual void | processRSPacket (IPv6RouterSolicitation *rs, IPv6ControlInfo *rsCtrlInfo) |
virtual bool | validateRSPacket (IPv6RouterSolicitation *rs, IPv6ControlInfo *rsCtrlInfo) |
virtual IPv6RouterAdvertisement * | createAndSendRAPacket (const IPv6Address &destAddr, InterfaceEntry *ie) |
virtual void | processRAPacket (IPv6RouterAdvertisement *ra, IPv6ControlInfo *raCtrlInfo) |
virtual void | processRAForRouterUpdates (IPv6RouterAdvertisement *ra, IPv6ControlInfo *raCtrlInfo) |
virtual void | processRAPrefixInfo (IPv6RouterAdvertisement *ra, InterfaceEntry *ie) |
virtual void | processRAPrefixInfoForAddrAutoConf (IPv6NDPrefixInformation &prefixInfo, InterfaceEntry *ie, bool hFlag=false) |
virtual void | createRATimer (InterfaceEntry *ie) |
Create a timer for the given interface entry that sends periodic Router Advertisements. More... | |
virtual void | resetRATimer (InterfaceEntry *ie) |
Reset the given interface entry's Router Advertisement timer. More... | |
virtual void | sendPeriodicRA (cMessage *msg) |
virtual void | sendSolicitedRA (cMessage *msg) |
virtual bool | validateRAPacket (IPv6RouterAdvertisement *ra, IPv6ControlInfo *raCtrlInfo) |
virtual IPv6NeighbourSolicitation * | createAndSendNSPacket (const IPv6Address &nsTargetAddr, const IPv6Address &dgDestAddr, const IPv6Address &dgSrcAddr, InterfaceEntry *ie) |
virtual void | processNSPacket (IPv6NeighbourSolicitation *ns, IPv6ControlInfo *naCtrlInfo) |
virtual bool | validateNSPacket (IPv6NeighbourSolicitation *ns, IPv6ControlInfo *nsCtrlInfo) |
virtual void | processNSForTentativeAddress (IPv6NeighbourSolicitation *ns, IPv6ControlInfo *ctrlInfo) |
virtual void | processNSForNonTentativeAddress (IPv6NeighbourSolicitation *ns, IPv6ControlInfo *ctrlInfo, InterfaceEntry *ie) |
virtual void | processNSWithSpecifiedSrcAddr (IPv6NeighbourSolicitation *ns, IPv6ControlInfo *ctrlInfo, InterfaceEntry *ie) |
IPv6NeighbourAdvertisement * | createAndSendNAPacket (IPv6NeighbourSolicitation *ns, const IPv6Address &nsSrcAddr, const IPv6Address &nsDestAddr, InterfaceEntry *ie) |
virtual void | sendSolicitedNA (IPv6NeighbourSolicitation *ns, IPv6ControlInfo *nsCtrlInfo, InterfaceEntry *ie) |
virtual void | processNAPacket (IPv6NeighbourAdvertisement *na, IPv6ControlInfo *naCtrlInfo) |
virtual bool | validateNAPacket (IPv6NeighbourAdvertisement *na, IPv6ControlInfo *naCtrlInfo) |
virtual void | processNAForIncompleteNCEState (IPv6NeighbourAdvertisement *na, IPv6NeighbourCache::Neighbour *nce) |
virtual void | processNAForOtherNCEStates (IPv6NeighbourAdvertisement *na, IPv6NeighbourCache::Neighbour *nce) |
virtual IPv6Redirect * | createAndSendRedirectPacket (InterfaceEntry *ie) |
virtual void | processRedirectPacket (IPv6Redirect *redirect, IPv6ControlInfo *ctrlInfo) |
virtual bool | canServeWirelessNodes (InterfaceEntry *ie) |
void | routersUnreachabilityDetection (const InterfaceEntry *ie) |
bool | isWirelessInterface (const InterfaceEntry *ie) |
bool | isWirelessAccessPoint (cModule *module) |
Protected Attributes | |
cQueue | pendingQueue |
IInterfaceTable * | ift = nullptr |
IPv6RoutingTable * | rt6 = nullptr |
ICMPv6 * | icmpv6 = nullptr |
xMIPv6 * | mipv6 = nullptr |
IPv6NeighbourCache | neighbourCache |
RATimerList | raTimerList |
DADList | dadList |
RDList | rdList |
AdvIfList | advIfList |
DADGlobalList | dadGlobalList |
Static Private Attributes | |
static simsignal_t | startDADSignal = registerSignal("startDAD") |
Implements RFC 2461 Neighbor Discovery for IPv6.
|
protected |
|
protected |
|
protected |
typedef std::vector<cMessage *> inet::IPv6NeighbourDiscovery::MsgPtrVector |
|
protected |
|
protected |
inet::IPv6NeighbourDiscovery::IPv6NeighbourDiscovery | ( | ) |
|
virtual |
|
protectedvirtual |
as it is not possbile to explicitly define RFC 2462.
ND is the next best place to do this.
RFC 2462-IPv6 Stateless Address Autoconfiguration: Section 1 The autoconfiguration process specified in this document applies only to hosts and not routers. Since host autoconfiguration uses information advertised by routers, routers will need to be configured by some other means. However, it is expected that routers will generate link-local addresses using the mechanism described in this document. In addition, routers are expected to successfully pass the Duplicate Address Detection procedure described in this document on all addresses prior to assigning them to an interface.
Referenced by handleMessage().
|
protectedvirtual |
RFC 2461: Section 6.3.7 4th paragraph Once the host sends a Router Solicitation, and receives a valid Router Advertisement with a non-zero Router Lifetime, the host MUST desist from sending additional solicitations on that interface,.
Cancel Router Discovery on the Interface where a RA was received with the given Interface Entry.
Referenced by processRAPacket().
|
protectedvirtual |
Referenced by createRATimer().
|
protected |
|
protectedvirtual |
Referenced by initiateAddressResolution(), initiateDAD(), processARTimeout(), processDADTimeout(), and processNUDTimeout().
|
protectedvirtual |
Referenced by sendPeriodicRA(), and sendSolicitedRA().
|
protectedvirtual |
|
protectedvirtual |
Referenced by initiateRouterDiscovery(), and processRDTimeout().
|
protectedvirtual |
Create a timer for the given interface entry that sends periodic Router Advertisements.
Referenced by initialize().
|
protectedvirtual |
This function accepts the datagram's destination address and attempts to determine the destination's next hop address and interface ID by: (1) looking up the destination cache, (2)looking up the routing table, or (3) selecting a default router.
It then updates the destination cache. If no default router can be selected than we assume the destination address to be onlink and simply return any available interface.
Referenced by processIPv6Datagram().
|
protectedvirtual |
Drops specific queued packets for a specific NCE AR-timeout.
TODO: Not implemented yet!
Referenced by processARTimeout().
|
protectedvirtual |
Referenced by processRSPacket(), and sendPeriodicRA().
|
protectedvirtual |
Referenced by cancelRouterDiscovery(), and processRDTimeout().
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Perform one stage of a lifecycle operation.
Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.
Return value: true = "done"; false = "not yet done, will invoke doneCallback when done"
Implements inet::ILifecycle.
|
overrideprotectedvirtual |
|
protectedvirtual |
This method attempts to resolve the given neighbour's link-layer address.
The source address of the packet prompting address resolution is also given in order to decide the source address of the NS to be sent. nceKey stores 2 pieces of information (Neighbour address and Interface ID) which is needed for addr resolution and access to the corresponding nce.
Referenced by processIPv6Datagram().
|
protectedvirtual |
Initiating DAD means to send off a Neighbour Solicitation with its target address set as this node's tentative link-local address.
Referenced by assignLinkLocalAddress(), and processRAPrefixInfoForAddrAutoConf().
|
protectedvirtual |
Referenced by processIPv6Datagram(), and resolveNeighbour().
|
protectedvirtual |
Referenced by handleMessage().
void inet::IPv6NeighbourDiscovery::invalidateNeigbourCache | ( | ) |
RFC2463 Section 3.1: Destination Unreachable Message Send an unreachable message to the IPv6 module.
TODO: Relocate to ICMPv6 module
|
protected |
Referenced by canServeWirelessNodes().
|
protected |
Referenced by canServeWirelessNodes().
|
protectedvirtual |
Permanently assign the given address for the given interface entry.
To be called after successful DAD.
Referenced by assignLinkLocalAddress(), and processDADTimeout().
|
inlineoverrideprotectedvirtual |
|
protectedvirtual |
Resends a NS packet to the address intended for address resolution.
TODO: Not implemented yet!
Referenced by handleMessage().
|
protectedvirtual |
Sends a scheduled DAD NS packet.
If number of sends is equals or more than dupAddrDetectTransmits, then permantly assign target link local address as permanent address for given interface entry.
Referenced by handleMessage().
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Referenced by processNAPacket().
|
protectedvirtual |
Referenced by processNAPacket().
|
protectedvirtual |
Referenced by processNDMessage().
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Referenced by processNSPacket().
|
protectedvirtual |
Referenced by processNSPacket().
|
protectedvirtual |
Referenced by processNDMessage().
|
protectedvirtual |
Referenced by processNSForNonTentativeAddress().
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Referenced by processRAPacket().
|
protectedvirtual |
Referenced by processNDMessage().
|
protectedvirtual |
Referenced by processRAForRouterUpdates().
|
protectedvirtual |
Referenced by processRAPacket(), and processRAPrefixInfo().
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Referenced by processNDMessage().
|
protectedvirtual |
Referenced by processNDMessage().
|
virtual |
Public method, it can be invoked from the IPv6 module or any other module to let Neighbour Discovery know that the reachability of the given neighbor has just been confirmed (e.g.
TCP received ACK of new data from it). Neighbour Discovery can then update the neighbour cache with this information, and cancel the Neighbour Unreachability Detection procedure if it is currently running.
|
protectedvirtual |
Reset the given interface entry's Router Advertisement timer.
This is usually done when a router interface responds (by replying with a Router Advertisement sent to the All-Node multicast group)to a router solicitation Also see: RFC 2461, Section 6.2.6
const MACAddress & inet::IPv6NeighbourDiscovery::resolveNeighbour | ( | const IPv6Address & | nextHop, |
int | interfaceId | ||
) |
Public method, to be invoked from the IPv6 module to determine link-layer address and the output interface of the next hop.
If the neighbor cache does not contain this address or it's in the state INCOMPLETE, this method will return the nullptr address, and the IPv6 module should then send the datagram here to IPv6NeighbourDiscovery where it will be stored until neighbour resolution completes.
If the neighbour cache entry is STALE (or REACHABLE but more than reachableTime elapsed since reachability was last confirmed), the link-layer address is still returned and IPv6 can send the datagram, but simultaneously, this call should trigger the Neighbour Unreachability Detection procedure to start in the IPv6NeighbourDiscovery module.
Referenced by inet::IPv6::resolveMACAddressAndSendPacket().
|
protected |
Referenced by processRAForRouterUpdates().
|
protectedvirtual |
Referenced by determineNextHop().
|
protectedvirtual |
Create control info and assigns it to a msg.
Returns a copy of the msg with the control info.
Referenced by createAndSendNSPacket(), createAndSendRAPacket(), createAndSendRSPacket(), sendSolicitedNA(), and sendUnsolicitedNA().
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Send off any queued packets within the Neighbour Discovery module awaiting address resolution.
Not used yet-unsure if we really need it.
–DELETED, Andras
Referenced by processNAForIncompleteNCEState().
|
protectedvirtual |
Referenced by processNSForNonTentativeAddress(), and processNSWithSpecifiedSrcAddr().
|
protectedvirtual |
Referenced by handleMessage().
|
virtual |
Referenced by inet::xMIPv6::processBAMessage().
|
protectedvirtual |
RFC 2461: Section 6.3.5 Whenever the Lifetime of an entry in the Default Router List expires, that entry is discarded.
When removing a router from the Default Router list, the node MUST update the Destination Cache in such a way that all entries using the router perform next-hop determination again rather than continue sending traffic to the (deleted) router.
Referenced by processRAForRouterUpdates(), and routersUnreachabilityDetection().
|
protectedvirtual |
RFC 2461: Section 6.3.5 Whenever the invalidation timer expires for a Prefix List entry, that entry is discarded.
No existing Destination Cache entries need be updated, however. Should a reachability problem arise with an existing Neighbor Cache entry, Neighbor Unreachability Detection will perform any needed recovery.
|
protectedvirtual |
Referenced by processNAPacket().
|
protectedvirtual |
Referenced by processNSPacket().
|
protectedvirtual |
Referenced by processRAPacket().
|
protectedvirtual |
Referenced by processRSPacket().
|
protected |
Referenced by createRATimer(), fetchAdvIfEntry(), and ~IPv6NeighbourDiscovery().
|
protected |
Referenced by makeTentativeAddressPermanent(), and processRAPrefixInfoForAddrAutoConf().
|
protected |
Referenced by initiateDAD(), processDADTimeout(), and ~IPv6NeighbourDiscovery().
|
protected |
Referenced by dropQueuedPacketsAwaitingAR(), initialize(), and processIPv6Datagram().
|
protected |
Referenced by assignLinkLocalAddress(), initialize(), initiateAddressResolution(), initiateNeighbourUnreachabilityDetection(), processARTimeout(), processDADTimeout(), processIPv6Datagram(), processNAForIncompleteNCEState(), processNAForOtherNCEStates(), processNAPacket(), processNSPacket(), processNUDTimeout(), processRAForRouterUpdates(), processRAPacket(), and processRSPacket().
|
protected |
Referenced by initialize(), makeTentativeAddressPermanent(), and processRAPrefixInfoForAddrAutoConf().
|
protected |
Referenced by dropQueuedPacketsAwaitingAR(), invalidateNeigbourCache(), processIPv6Datagram(), processNAForIncompleteNCEState(), processNAForOtherNCEStates(), processNAPacket(), processNSWithSpecifiedSrcAddr(), processNUDTimeout(), processRAForRouterUpdates(), reachabilityConfirmed(), resolveNeighbour(), routersUnreachabilityDetection(), selectDefaultRouter(), and timeoutDefaultRouter().
|
protected |
Referenced by dropQueuedPacketsAwaitingAR(), initialize(), processIPv6Datagram(), and sendQueuedPacketsToIPv6Module().
|
protected |
Referenced by ~IPv6NeighbourDiscovery().
|
protected |
Referenced by cancelRouterDiscovery(), fetchRDEntry(), initiateRouterDiscovery(), processRDTimeout(), and ~IPv6NeighbourDiscovery().
|
protected |
Referenced by createAndSendRAPacket(), determineNextHop(), initialize(), makeTentativeAddressPermanent(), processNSForTentativeAddress(), processRAForRouterUpdates(), processRAPrefixInfo(), processRAPrefixInfoForAddrAutoConf(), routersUnreachabilityDetection(), sendPeriodicRA(), sendSolicitedNA(), sendUnsolicitedNA(), timeoutDefaultRouter(), and timeoutPrefixEntry().
|
staticprivate |
Referenced by initiateDAD().