A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::olsr::RoutingProtocol Class Reference

OLSR routing protocol for IPv4. More...

#include "olsr-routing-protocol.h"

+ Inheritance diagram for ns3::olsr::RoutingProtocol:
+ Collaboration diagram for ns3::olsr::RoutingProtocol:

Public Types

typedef void(* PacketTxRxTracedCallback) (const PacketHeader &header, const MessageList &messages)
 TracedCallback signature for Packet transmit and receive events.
 
typedef void(* TableChangeTracedCallback) (uint32_t size)
 TracedCallback signature for routing table computation.
 
- Public Types inherited from ns3::Ipv4RoutingProtocol
typedef Callback< void, Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrnoErrorCallback
 Callback for routing errors (e.g., no route found)
 
typedef Callback< void, Ptr< const Packet >, const Ipv4Header &, uint32_tLocalDeliverCallback
 Callback for packets to be locally delivered.
 
typedef Callback< void, Ptr< Ipv4MulticastRoute >, Ptr< const Packet >, const Ipv4Header & > MulticastForwardCallback
 Callback for multicast packets to be forwarded.
 
typedef Callback< void, Ptr< Ipv4Route >, Ptr< const Packet >, const Ipv4Header & > UnicastForwardCallback
 Callback for unicast packets to be forwarded.
 

Public Member Functions

 RoutingProtocol ()
 
 ~RoutingProtocol () override
 
void AddHostNetworkAssociation (Ipv4Address networkAddr, Ipv4Mask netmask)
 Injects the specified (networkAddr, netmask) tuple in the list of local HNA associations to be sent by the node via HNA messages.
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model.
 
void Dump ()
 Dump the neighbor table, two-hop neighbor table, and routing table to logging output (NS_LOG_DEBUG log level).
 
std::set< uint32_tGetInterfaceExclusions () const
 Get the excluded interfaces.
 
Ipv4Address GetMainAddress (Ipv4Address iface_addr) const
 Gets the main address associated with a given interface address.
 
const MprSelectorSetGetMprSelectors () const
 Gets the MPR selectors.
 
MprSet GetMprSet () const
 Gets the MPR set.
 
const NeighborSetGetNeighbors () const
 Get the one hop neighbors.
 
const OlsrStateGetOlsrState () const
 Gets the underlying OLSR state object.
 
Ptr< const Ipv4StaticRoutingGetRoutingTableAssociation () const
 Returns the internal HNA table.
 
std::vector< RoutingTableEntryGetRoutingTableEntries () const
 Get the routing table entries.
 
const TopologySetGetTopologySet () const
 Gets the topology set.
 
const TwoHopNeighborSetGetTwoHopNeighbors () const
 Get the two hop neighbors.
 
void PrintRoutingTable (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const override
 Print the Routing Table entries.
 
void RemoveHostNetworkAssociation (Ipv4Address networkAddr, Ipv4Mask netmask)
 Removes the specified (networkAddr, netmask) tuple from the list of local HNA associations to be sent by the node via HNA messages.
 
bool RouteInput (Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, const UnicastForwardCallback &ucb, const MulticastForwardCallback &mcb, const LocalDeliverCallback &lcb, const ErrorCallback &ecb) override
 Route an input packet (to be forwarded or locally delivered)
 
Ptr< Ipv4RouteRouteOutput (Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
 Query routing cache for an existing route, for an outbound packet.
 
void SetInterfaceExclusions (std::set< uint32_t > exceptions)
 Set the interfaces to be excluded.
 
void SetIpv4 (Ptr< Ipv4 > ipv4) override
 
void SetMainInterface (uint32_t interface)
 Set the OLSR main address to the first address on the indicated interface.
 
void SetRoutingTableAssociation (Ptr< Ipv4StaticRouting > routingTable)
 Associates the specified Ipv4StaticRouting routing table to the OLSR routing protocol.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Ipv4RoutingProtocol
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Static Public Attributes

static const uint16_t OLSR_PORT_NUMBER = 698
 port number (698)
 

Protected Member Functions

void DoDispose () override
 Destructor implementation.
 
void DoInitialize () override
 Initialize() implementation.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Private Member Functions

void AddAssociationTuple (const AssociationTuple &tuple)
 Adds a host network association tuple to the Association Set.
 
void AddDuplicateTuple (const DuplicateTuple &tuple)
 Adds a duplicate tuple to the Duplicate Set.
 
void AddEntry (const Ipv4Address &dest, const Ipv4Address &next, const Ipv4Address &interfaceAddress, uint32_t distance)
 Adds a new entry into the routing table.
 
void AddEntry (const Ipv4Address &dest, const Ipv4Address &next, uint32_t interface, uint32_t distance)
 Adds a new entry into the routing table.
 
void AddIfaceAssocTuple (const IfaceAssocTuple &tuple)
 Adds an interface association tuple to the Interface Association Set.
 
void AddMprSelectorTuple (const MprSelectorTuple &tuple)
 Adds an MPR selector tuple to the MPR Selector Set.
 
void AddNeighborTuple (const NeighborTuple &tuple)
 Adds a neighbor tuple to the Neighbor Set.
 
void AddTopologyTuple (const TopologyTuple &tuple)
 Adds a topology tuple to the Topology Set.
 
void AddTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple)
 Adds a 2-hop neighbor tuple to the 2-hop Neighbor Set.
 
void AssociationTupleTimerExpire (Ipv4Address gatewayAddr, Ipv4Address networkAddr, Ipv4Mask netmask)
 Removes association tuple_ if expired.
 
void Clear ()
 Clears the routing table and frees the memory assigned to each one of its entries.
 
int Degree (const NeighborTuple &tuple)
 This auxiliary function (defined in RFC 3626 ) is used for calculating the MPR Set.
 
void DupTupleTimerExpire (Ipv4Address address, uint16_t sequenceNumber)
 Removes tuple if expired.
 
bool FindSendEntry (const RoutingTableEntry &entry, RoutingTableEntry &outEntry) const
 Finds the appropriate entry which must be used in order to forward a data packet to a next hop (given a destination).
 
void ForwardDefault (olsr::MessageHeader olsrMessage, DuplicateTuple *duplicated, const Ipv4Address &localIface, const Ipv4Address &senderAddress)
 OLSR's default forwarding algorithm.
 
uint16_t GetMessageSequenceNumber ()
 Increments message sequence number and returns the new value.
 
uint16_t GetPacketSequenceNumber ()
 Increments packet sequence number and returns the new value.
 
uint32_t GetSize () const
 Returns the routing table size.
 
void HelloTimerExpire ()
 Sends a HELLO message and reschedules the HELLO timer.
 
void HnaTimerExpire ()
 Sends an HNA message (if the node has associated hosts/networks) and reschedules the HNA timer.
 
void IfaceAssocTupleTimerExpire (Ipv4Address ifaceAddr)
 Removes interface association tuple_ if expired.
 
void IncrementAnsn ()
 Increments the ANSN counter.
 
bool IsMyOwnAddress (const Ipv4Address &a) const
 Check that address is one of my interfaces.
 
void LinkSensing (const olsr::MessageHeader &msg, const olsr::MessageHeader::Hello &hello, const Ipv4Address &receiverIface, const Ipv4Address &senderIface)
 Updates Link Set according to a new received HELLO message (following RFC 3626 specification).
 
void LinkTupleAdded (const LinkTuple &tuple, Willingness willingness)
 Adds a link tuple.
 
void LinkTupleTimerExpire (Ipv4Address neighborIfaceAddr)
 Removes tuple_ if expired.
 
void LinkTupleUpdated (const LinkTuple &tuple, Willingness willingness)
 This function is invoked when a link tuple is updated.
 
bool Lookup (const Ipv4Address &dest, RoutingTableEntry &outEntry) const
 Looks up an entry for the specified destination address.
 
void MidTimerExpire ()
 Sends a MID message (if the node has more than one interface) and resets the MID timer.
 
void MprComputation ()
 Computes MPR set of a node following RFC 3626 hints.
 
void MprSelTupleTimerExpire (Ipv4Address mainAddr)
 Removes MPR selector tuple_ if expired.
 
void Nb2hopTupleTimerExpire (Ipv4Address neighborMainAddr, Ipv4Address twoHopNeighborAddr)
 Removes 2_hop neighbor tuple_ if expired.
 
void NeighborLoss (const LinkTuple &tuple)
 Performs all actions needed when a neighbor loss occurs.
 
void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address) override
 
void NotifyInterfaceDown (uint32_t interface) override
 
void NotifyInterfaceUp (uint32_t interface) override
 
void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address) override
 
void PopulateMprSelectorSet (const olsr::MessageHeader &msg, const olsr::MessageHeader::Hello &hello)
 Updates the MPR Selector Set according to the information contained in a new received HELLO message (following RFC 3626 ).
 
void PopulateNeighborSet (const olsr::MessageHeader &msg, const olsr::MessageHeader::Hello &hello)
 Updates the Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626 ).
 
void PopulateTwoHopNeighborSet (const olsr::MessageHeader &msg, const olsr::MessageHeader::Hello &hello)
 Updates the 2-hop Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626 ).
 
void ProcessHello (const olsr::MessageHeader &msg, const Ipv4Address &receiverIface, const Ipv4Address &senderIface)
 Processes a HELLO message following RFC 3626 specification.
 
void ProcessHna (const olsr::MessageHeader &msg, const Ipv4Address &senderIface)
 Processes a HNA message following RFC 3626 specification.
 
void ProcessMid (const olsr::MessageHeader &msg, const Ipv4Address &senderIface)
 Processes a MID message following RFC 3626 specification.
 
void ProcessTc (const olsr::MessageHeader &msg, const Ipv4Address &senderIface)
 Processes a TC message following RFC 3626 specification.
 
void QueueMessage (const olsr::MessageHeader &message, Time delay)
 Enqueues an OLSR message which will be sent with a delay of (0, delay].
 
void RecvOlsr (Ptr< Socket > socket)
 Receive an OLSR message.
 
void RemoveAssociationTuple (const AssociationTuple &tuple)
 Removes a host network association tuple to the Association Set.
 
void RemoveDuplicateTuple (const DuplicateTuple &tuple)
 Removes a duplicate tuple from the Duplicate Set.
 
void RemoveEntry (const Ipv4Address &dest)
 Deletes the entry whose destination address is given.
 
void RemoveIfaceAssocTuple (const IfaceAssocTuple &tuple)
 Removed an interface association tuple to the Interface Association Set.
 
void RemoveLinkTuple (const LinkTuple &tuple)
 Removes a link tuple from the Link Set.
 
void RemoveMprSelectorTuple (const MprSelectorTuple &tuple)
 Removes an MPR selector tuple from the MPR Selector Set.
 
void RemoveNeighborTuple (const NeighborTuple &tuple)
 Removes a neighbor tuple from the Neighbor Set.
 
void RemoveTopologyTuple (const TopologyTuple &tuple)
 Removes a topology tuple to the Topology Set.
 
void RemoveTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple)
 Removes a 2-hop neighbor tuple from the 2-hop Neighbor Set.
 
void RoutingTableComputation ()
 Creates the routing table of the node following RFC 3626 hints.
 
void SendHello ()
 Creates a new OLSR HELLO message which is buffered for being sent later on.
 
void SendHna ()
 Creates a new OLSR HNA message which is buffered for being sent later on.
 
void SendMid ()
 Creates a new OLSR MID message which is buffered for being sent later on.
 
void SendPacket (Ptr< Packet > packet, const MessageList &containedMessages)
 Send an OLSR message.
 
void SendQueuedMessages ()
 Creates as many OLSR packets as needed in order to send all buffered OLSR messages.
 
void SendTc ()
 Creates a new OLSR TC message which is buffered for being sent later on.
 
void TcTimerExpire ()
 Sends a TC message (if there exists any MPR selector) and reschedules the TC timer.
 
void TopologyTupleTimerExpire (Ipv4Address destAddr, Ipv4Address lastAddr)
 Removes topology tuple_ if expired.
 
bool UsesNonOlsrOutgoingInterface (const Ipv4RoutingTableEntry &route)
 Tests whether or not the specified route uses a non-OLSR outgoing interface.
 

Private Attributes

uint16_t m_ansn
 Advertised Neighbor Set sequence number.
 
EventGarbageCollector m_events
 Running events.
 
Time m_helloInterval
 HELLO messages' emission interval.
 
Timer m_helloTimer
 Timer for the HELLO message.
 
Time m_hnaInterval
 HNA messages' emission interval.
 
Ptr< Ipv4StaticRoutingm_hnaRoutingTable
 Routing table for HNA routes.
 
Timer m_hnaTimer
 Timer for the HNA message.
 
std::set< uint32_tm_interfaceExclusions
 Set of interfaces excluded by OSLR.
 
Ptr< Ipv4m_ipv4
 IPv4 object the routing is linked to.
 
bool m_linkTupleTimerFirstTime
 Flag to indicate if it is the first time the LinkTupleTimer fires.
 
Ipv4Address m_mainAddress
 the node main address.
 
uint16_t m_messageSequenceNumber
 Messages sequence number counter.
 
Time m_midInterval
 MID messages' emission interval.
 
Timer m_midTimer
 Timer for the MID message.
 
uint16_t m_packetSequenceNumber
 Packets sequence number counter.
 
olsr::MessageList m_queuedMessages
 A list of pending messages which are buffered awaiting for being sent.
 
Timer m_queuedMessagesTimer
 timer for throttling outgoing messages
 
Ptr< Socketm_recvSocket
 Receiving socket.
 
Ptr< Ipv4StaticRoutingm_routingTableAssociation
 Associations from an Ipv4StaticRouting instance.
 
TracedCallback< uint32_tm_routingTableChanged
 Routing table changes callback.
 
TracedCallback< const PacketHeader &, const MessageList & > m_rxPacketTrace
 Rx packet trace.
 
std::map< Ptr< Socket >, Ipv4InterfaceAddressm_sendSockets
 Container of sockets and the interfaces they are opened onto.
 
OlsrState m_state
 Internal state with all needed data structs.
 
std::map< Ipv4Address, RoutingTableEntrym_table
 Data structure for the routing table.
 
Time m_tcInterval
 TC messages' emission interval.
 
Timer m_tcTimer
 Timer for the TC message.
 
TracedCallback< const PacketHeader &, const MessageList & > m_txPacketTrace
 Tx packet trace.
 
Ptr< UniformRandomVariablem_uniformRandomVariable
 Provides uniform random variables.
 
Willingness m_willingness
 Willingness for forwarding packets on behalf of other nodes.
 

Friends

class ::OlsrMprTestCase
 Declared friend to enable unit tests.
 

Additional Inherited Members

Detailed Description

OLSR routing protocol for IPv4.

Config Paths

ns3::olsr::RoutingProtocol is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/$ns3::olsr::RoutingProtocol"

Attributes

  • HelloInterval: HELLO messages emission interval.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +2e+09ns
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • HnaInterval: HNA messages emission interval. Normally it is equal to TcInterval.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5e+09ns
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • MidInterval: MID messages emission interval. Normally it is equal to TcInterval.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5e+09ns
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • TcInterval: TC messages emission interval.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5e+09ns
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • Willingness: Willingness of a node to carry and forward traffic for other nodes.

TraceSources

Group: Olsr

Size of this type is 1016 bytes (on a 64-bit architecture).

Definition at line 73 of file olsr-routing-protocol.h.

Member Typedef Documentation

◆ PacketTxRxTracedCallback

typedef void(* ns3::olsr::RoutingProtocol::PacketTxRxTracedCallback) (const PacketHeader &header, const MessageList &messages)

TracedCallback signature for Packet transmit and receive events.

Parameters
[in]header
[in]messages

Definition at line 164 of file olsr-routing-protocol.h.

◆ TableChangeTracedCallback

typedef void(* ns3::olsr::RoutingProtocol::TableChangeTracedCallback) (uint32_t size)

TracedCallback signature for routing table computation.

Parameters
[in]sizeFinal routing table size.

Definition at line 172 of file olsr-routing-protocol.h.

Constructor & Destructor Documentation

◆ RoutingProtocol()

ns3::olsr::RoutingProtocol::RoutingProtocol ( )

Definition at line 244 of file olsr-routing-protocol.cc.

References ns3::Create(), ns3::CreateObject(), m_hnaRoutingTable, and m_uniformRandomVariable.

+ Here is the call graph for this function:

◆ ~RoutingProtocol()

ns3::olsr::RoutingProtocol::~RoutingProtocol ( )
override

Definition at line 258 of file olsr-routing-protocol.cc.

Member Function Documentation

◆ AddAssociationTuple()

void ns3::olsr::RoutingProtocol::AddAssociationTuple ( const AssociationTuple & tuple)
private

Adds a host network association tuple to the Association Set.

Parameters
tupleThe host network association tuple to be added.

Definition at line 2573 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::InsertAssociationTuple(), and m_state.

Referenced by ProcessHna().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddDuplicateTuple()

void ns3::olsr::RoutingProtocol::AddDuplicateTuple ( const DuplicateTuple & tuple)
private

Adds a duplicate tuple to the Duplicate Set.

Parameters
tupleThe duplicate tuple to be added.

Definition at line 2338 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::InsertDuplicateTuple(), and m_state.

Referenced by ForwardDefault().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddEntry() [1/2]

void ns3::olsr::RoutingProtocol::AddEntry ( const Ipv4Address & dest,
const Ipv4Address & next,
const Ipv4Address & interfaceAddress,
uint32_t distance )
private

Adds a new entry into the routing table.

If an entry for the given destination existed, an error is thrown.

Parameters
destaddress of the destination node.
nextaddress of the next hop node.
interfaceAddressaddress of the local interface.
distancedistance to the destination node.

Definition at line 3098 of file olsr-routing-protocol.cc.

References AddEntry(), ns3::Ipv4::GetAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4::GetNAddresses(), ns3::Ipv4::GetNInterfaces(), m_ipv4, m_mainAddress, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ AddEntry() [2/2]

void ns3::olsr::RoutingProtocol::AddEntry ( const Ipv4Address & dest,
const Ipv4Address & next,
uint32_t interface,
uint32_t distance )
private

Adds a new entry into the routing table.

If an entry for the given destination existed, it is deleted and freed.

Parameters
destaddress of the destination node.
nextaddress of the next hop node.
interfaceaddress of the local interface.
distancedistance to the destination node.

Definition at line 3079 of file olsr-routing-protocol.cc.

References ns3::olsr::RoutingTableEntry::destAddr, ns3::olsr::RoutingTableEntry::distance, ns3::olsr::RoutingTableEntry::interface, m_mainAddress, m_table, ns3::olsr::RoutingTableEntry::nextAddr, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by AddEntry(), and RoutingTableComputation().

+ Here is the caller graph for this function:

◆ AddHostNetworkAssociation()

void ns3::olsr::RoutingProtocol::AddHostNetworkAssociation ( Ipv4Address networkAddr,
Ipv4Mask netmask )

Injects the specified (networkAddr, netmask) tuple in the list of local HNA associations to be sent by the node via HNA messages.

If this tuple already exists, nothing is done.

Parameters
networkAddrThe network address.
netmaskThe network mask.

Definition at line 1925 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetAssociations(), ns3::olsr::OlsrState::InsertAssociation(), m_state, ns3::olsr::Association::netmask, ns3::olsr::Association::networkAddr, and NS_LOG_INFO.

Referenced by SetRoutingTableAssociation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddIfaceAssocTuple()

void ns3::olsr::RoutingProtocol::AddIfaceAssocTuple ( const IfaceAssocTuple & tuple)
private

Adds an interface association tuple to the Interface Association Set.

Parameters
tupleThe interface association tuple to be added.

Definition at line 2549 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::InsertIfaceAssocTuple(), and m_state.

Referenced by DoInitialize(), and ProcessMid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddMprSelectorTuple()

void ns3::olsr::RoutingProtocol::AddMprSelectorTuple ( const MprSelectorTuple & tuple)
private

Adds an MPR selector tuple to the MPR Selector Set.

Advertised Neighbor Sequence Number (ANSN) is also updated.

Parameters
tupleThe MPR selector tuple to be added.

Definition at line 2499 of file olsr-routing-protocol.cc.

References IncrementAnsn(), ns3::olsr::OlsrState::InsertMprSelectorTuple(), and m_state.

Referenced by PopulateMprSelectorSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddNeighborTuple()

void ns3::olsr::RoutingProtocol::AddNeighborTuple ( const NeighborTuple & tuple)
private

Adds a neighbor tuple to the Neighbor Set.

Parameters
tupleThe neighbor tuple to be added.

Definition at line 2443 of file olsr-routing-protocol.cc.

References IncrementAnsn(), ns3::olsr::OlsrState::InsertNeighborTuple(), and m_state.

Referenced by LinkTupleAdded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddTopologyTuple()

void ns3::olsr::RoutingProtocol::AddTopologyTuple ( const TopologyTuple & tuple)
private

Adds a topology tuple to the Topology Set.

Parameters
tupleThe topology tuple to be added.

Definition at line 2523 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::InsertTopologyTuple(), and m_state.

Referenced by ProcessTc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddTwoHopNeighborTuple()

void ns3::olsr::RoutingProtocol::AddTwoHopNeighborTuple ( const TwoHopNeighborTuple & tuple)
private

Adds a 2-hop neighbor tuple to the 2-hop Neighbor Set.

Parameters
tupleThe 2-hop neighbor tuple to be added.

Definition at line 2469 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::InsertTwoHopNeighborTuple(), and m_state.

Referenced by PopulateTwoHopNeighborSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AssignStreams()

int64_t ns3::olsr::RoutingProtocol::AssignStreams ( int64_t stream)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 3172 of file olsr-routing-protocol.cc.

References m_uniformRandomVariable, and NS_LOG_FUNCTION.

◆ AssociationTupleTimerExpire()

void ns3::olsr::RoutingProtocol::AssociationTupleTimerExpire ( Ipv4Address gatewayAddr,
Ipv4Address networkAddr,
Ipv4Mask netmask )
private

Removes association tuple_ if expired.

Else timer is rescheduled to expire at tuple_->time().

Parameters
gatewayAddrThe gateway address.
networkAddrThe network address.
netmaskThe network mask.

Definition at line 2791 of file olsr-routing-protocol.cc.

References AssociationTupleTimerExpire(), DELAY, ns3::olsr::AssociationTuple::expirationTime, ns3::olsr::OlsrState::FindAssociationTuple(), m_events, m_state, ns3::Simulator::Now(), RemoveAssociationTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by AssociationTupleTimerExpire(), and ProcessHna().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Clear()

void ns3::olsr::RoutingProtocol::Clear ( )
private

Clears the routing table and frees the memory assigned to each one of its entries.

Definition at line 2816 of file olsr-routing-protocol.cc.

References m_table, and NS_LOG_FUNCTION_NOARGS.

Referenced by RoutingTableComputation().

+ Here is the caller graph for this function:

◆ Degree()

int ns3::olsr::RoutingProtocol::Degree ( const NeighborTuple & tuple)
private

This auxiliary function (defined in RFC 3626 ) is used for calculating the MPR Set.

Parameters
tuplethe neighbor tuple which has the main address of the node we are going to calculate its degree to.
Returns
the degree of the node.

Definition at line 648 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::FindNeighborTuple(), ns3::olsr::OlsrState::GetTwoHopNeighbors(), m_state, ns3::olsr::NeighborTuple::neighborMainAddr, and ns3::olsr::TwoHopNeighborTuple::neighborMainAddr.

Referenced by MprComputation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::olsr::RoutingProtocol::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 286 of file olsr-routing-protocol.cc.

References ns3::Socket::Close(), ns3::Object::DoDispose(), m_hnaRoutingTable, m_ipv4, m_recvSocket, m_routingTableAssociation, m_sendSockets, and m_table.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::olsr::RoutingProtocol::DoInitialize ( )
overrideprotectedvirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 363 of file olsr-routing-protocol.cc.

References AddIfaceAssocTuple(), ns3::Socket::Bind(), ns3::Socket::CreateSocket(), ns3::Ipv4::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Ipv4InterfaceAddress::GetLocal(), GetMainAddress(), ns3::Ipv4::GetNetDevice(), ns3::Ipv4::GetNInterfaces(), ns3::Object::GetObject(), ns3::UdpSocketFactory::GetTypeId(), HelloTimerExpire(), HnaTimerExpire(), ns3::olsr::IfaceAssocTuple::ifaceAddr, m_interfaceExclusions, m_ipv4, m_mainAddress, m_recvSocket, m_sendSockets, ns3::olsr::IfaceAssocTuple::mainAddr, ns3::MakeCallback(), MidTimerExpire(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, OLSR_PORT_NUMBER, RecvOlsr(), ns3::Socket::SetAllowBroadcast(), ns3::Socket::SetRecvCallback(), ns3::Socket::SetRecvPktInfo(), ns3::Socket::ShutdownSend(), and TcTimerExpire().

+ Here is the call graph for this function:

◆ Dump()

void ns3::olsr::RoutingProtocol::Dump ( )

Dump the neighbor table, two-hop neighbor table, and routing table to logging output (NS_LOG_DEBUG log level).

If logging is disabled, this function does nothing.

Definition at line 3194 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetNeighbors(), ns3::olsr::OlsrState::GetTwoHopNeighbors(), m_mainAddress, m_state, m_table, ns3::Simulator::Now(), and NS_LOG_DEBUG.

+ Here is the call graph for this function:

◆ DupTupleTimerExpire()

void ns3::olsr::RoutingProtocol::DupTupleTimerExpire ( Ipv4Address address,
uint16_t sequenceNumber )
private

Removes tuple if expired.

Else timer is rescheduled to expire at tuple.expirationTime.

The task of actually removing the tuple is left to the OLSR agent.

Parameters
addressThe address of the tuple.
sequenceNumberThe sequence number of the tuple.

Definition at line 2641 of file olsr-routing-protocol.cc.

References DELAY, DupTupleTimerExpire(), ns3::olsr::DuplicateTuple::expirationTime, ns3::olsr::OlsrState::FindDuplicateTuple(), m_events, m_state, ns3::Simulator::Now(), RemoveDuplicateTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by DupTupleTimerExpire(), and ForwardDefault().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindSendEntry()

bool ns3::olsr::RoutingProtocol::FindSendEntry ( const RoutingTableEntry & entry,
RoutingTableEntry & outEntry ) const
private

Finds the appropriate entry which must be used in order to forward a data packet to a next hop (given a destination).

Imagine a routing table like this: [A,B] [B,C] [C,C]; being each pair of the form [dest addr, next-hop addr]. In this case, if this function is invoked with [A,B] then pair [C,C] is returned because C is the next hop that must be used to forward a data packet destined to A. That is, C is a neighbor of this node, but B isn't. This function finds the appropriate neighbor for forwarding a packet.

Parameters
[in]entryThe routing table entry which indicates the destination node we are interested in.
[out]outEntryThe appropriate routing table entry which indicates the next hop which must be used for forwarding a data packet, or NULL if there is no such entry.
Returns
True if an entry was found, false otherwise.

Definition at line 2843 of file olsr-routing-protocol.cc.

References ns3::olsr::RoutingTableEntry::destAddr, Lookup(), and ns3::olsr::RoutingTableEntry::nextAddr.

Referenced by RouteInput(), and RouteOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForwardDefault()

void ns3::olsr::RoutingProtocol::ForwardDefault ( olsr::MessageHeader olsrMessage,
DuplicateTuple * duplicated,
const Ipv4Address & localIface,
const Ipv4Address & senderAddress )
private

OLSR's default forwarding algorithm.

See RFC 3626 for details.

Parameters
olsrMessageThe OLSR message which must be forwarded.
duplicatedNULL if the message has never been considered for forwarding, or a duplicate tuple in other case.
localIfaceThe address of the interface where the message was received from.
senderAddressThe sender IPv4 address.

Definition at line 1572 of file olsr-routing-protocol.cc.

References AddDuplicateTuple(), ns3::olsr::DuplicateTuple::address, DupTupleTimerExpire(), ns3::olsr::DuplicateTuple::expirationTime, ns3::olsr::OlsrState::FindMprSelectorTuple(), ns3::olsr::OlsrState::FindSymLinkTuple(), ns3::olsr::MessageHeader::GetHopCount(), GetMainAddress(), ns3::olsr::MessageHeader::GetMessageSequenceNumber(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetTimeToLive(), ns3::olsr::DuplicateTuple::ifaceList, JITTER, m_mainAddress, m_state, ns3::Simulator::Now(), NS_LOG_LOGIC, OLSR_DUP_HOLD_TIME, QueueMessage(), ns3::olsr::DuplicateTuple::retransmitted, ns3::Simulator::Schedule(), ns3::olsr::DuplicateTuple::sequenceNumber, ns3::olsr::MessageHeader::SetHopCount(), and ns3::olsr::MessageHeader::SetTimeToLive().

Referenced by RecvOlsr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInterfaceExclusions()

std::set< uint32_t > ns3::olsr::RoutingProtocol::GetInterfaceExclusions ( ) const
inline

Get the excluded interfaces.

Returns
Container of excluded interfaces.

Definition at line 184 of file olsr-routing-protocol.h.

References m_interfaceExclusions.

◆ GetMainAddress()

Ipv4Address ns3::olsr::RoutingProtocol::GetMainAddress ( Ipv4Address iface_addr) const

Gets the main address associated with a given interface address.

Parameters
iface_addrthe interface address.
Returns
the corresponding main address.

Definition at line 986 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::FindIfaceAssocTuple(), m_state, and ns3::olsr::IfaceAssocTuple::mainAddr.

Referenced by DoInitialize(), ForwardDefault(), LinkTupleAdded(), LinkTupleUpdated(), NeighborLoss(), PopulateMprSelectorSet(), PopulateTwoHopNeighborSet(), ProcessMid(), RemoveLinkTuple(), RoutingTableComputation(), and SendHello().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMessageSequenceNumber()

uint16_t ns3::olsr::RoutingProtocol::GetMessageSequenceNumber ( )
inlineprivate

Increments message sequence number and returns the new value.

Returns
The message sequence number.

Definition at line 2592 of file olsr-routing-protocol.cc.

References m_messageSequenceNumber, and OLSR_MAX_SEQ_NUM.

Referenced by SendHello(), SendHna(), SendMid(), and SendTc().

+ Here is the caller graph for this function:

◆ GetMprSelectors()

const MprSelectorSet & ns3::olsr::RoutingProtocol::GetMprSelectors ( ) const

Gets the MPR selectors.

Returns
The MPR selectors.

Definition at line 3142 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetMprSelectors(), and m_state.

+ Here is the call graph for this function:

◆ GetMprSet()

MprSet ns3::olsr::RoutingProtocol::GetMprSet ( ) const

Gets the MPR set.

Returns
The MPR set.

Definition at line 3136 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetMprSet(), and m_state.

+ Here is the call graph for this function:

◆ GetNeighbors()

const NeighborSet & ns3::olsr::RoutingProtocol::GetNeighbors ( ) const

Get the one hop neighbors.

Returns
the set of neighbors discovered by OLSR

Definition at line 3148 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetNeighbors(), and m_state.

+ Here is the call graph for this function:

◆ GetOlsrState()

const OlsrState & ns3::olsr::RoutingProtocol::GetOlsrState ( ) const

Gets the underlying OLSR state object.

Returns
The OLSR state object

Definition at line 3166 of file olsr-routing-protocol.cc.

References m_state.

◆ GetPacketSequenceNumber()

uint16_t ns3::olsr::RoutingProtocol::GetPacketSequenceNumber ( )
inlineprivate

Increments packet sequence number and returns the new value.

Returns
The packet sequence number.

Definition at line 2585 of file olsr-routing-protocol.cc.

References m_packetSequenceNumber, and OLSR_MAX_SEQ_NUM.

Referenced by SendPacket().

+ Here is the caller graph for this function:

◆ GetRoutingTableAssociation()

Ptr< const Ipv4StaticRouting > ns3::olsr::RoutingProtocol::GetRoutingTableAssociation ( ) const

Returns the internal HNA table.

Returns
the internal HNA table

Definition at line 3225 of file olsr-routing-protocol.cc.

References m_hnaRoutingTable.

◆ GetRoutingTableEntries()

std::vector< RoutingTableEntry > ns3::olsr::RoutingProtocol::GetRoutingTableEntries ( ) const

Get the routing table entries.

Returns
the list of routing table entries discovered by OLSR

Definition at line 3125 of file olsr-routing-protocol.cc.

References m_table.

◆ GetSize()

uint32_t ns3::olsr::RoutingProtocol::GetSize ( ) const
inlineprivate

Returns the routing table size.

Returns
The routing table size.

Definition at line 266 of file olsr-routing-protocol.h.

References m_table.

Referenced by RoutingTableComputation().

+ Here is the caller graph for this function:

◆ GetTopologySet()

const TopologySet & ns3::olsr::RoutingProtocol::GetTopologySet ( ) const

Gets the topology set.

Returns
The topology set discovery by OLSR

Definition at line 3160 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetTopologySet(), and m_state.

+ Here is the call graph for this function:

◆ GetTwoHopNeighbors()

const TwoHopNeighborSet & ns3::olsr::RoutingProtocol::GetTwoHopNeighbors ( ) const

Get the two hop neighbors.

Returns
the set of two hop neighbors discovered by OLSR

Definition at line 3154 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetTwoHopNeighbors(), and m_state.

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::olsr::RoutingProtocol::GetTypeId ( )
static

Get the type ID.

Returns
The object TypeId.

Definition at line 188 of file olsr-routing-protocol.cc.

References ns3::olsr::ALWAYS, ns3::olsr::DEFAULT, ns3::olsr::HIGH, ns3::olsr::LOW, m_helloInterval, m_hnaInterval, m_midInterval, m_routingTableChanged, m_rxPacketTrace, m_tcInterval, m_txPacketTrace, m_willingness, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::olsr::NEVER, ns3::Seconds(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ HelloTimerExpire()

void ns3::olsr::RoutingProtocol::HelloTimerExpire ( )
private

Sends a HELLO message and reschedules the HELLO timer.

Definition at line 2599 of file olsr-routing-protocol.cc.

References m_helloInterval, m_helloTimer, ns3::Timer::Schedule(), and SendHello().

Referenced by DoInitialize(), and SetIpv4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HnaTimerExpire()

void ns3::olsr::RoutingProtocol::HnaTimerExpire ( )
private

Sends an HNA message (if the node has associated hosts/networks) and reschedules the HNA timer.

Definition at line 2627 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetAssociations(), m_hnaInterval, m_hnaTimer, m_state, NS_LOG_DEBUG, ns3::Timer::Schedule(), and SendHna().

Referenced by DoInitialize(), and SetIpv4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IfaceAssocTupleTimerExpire()

void ns3::olsr::RoutingProtocol::IfaceAssocTupleTimerExpire ( Ipv4Address ifaceAddr)
private

Removes interface association tuple_ if expired.

Else the timer is rescheduled to expire at tuple_->time().

Parameters
ifaceAddrThe interface address.

Definition at line 2770 of file olsr-routing-protocol.cc.

References DELAY, ns3::olsr::OlsrState::FindIfaceAssocTuple(), IfaceAssocTupleTimerExpire(), m_events, m_state, ns3::Simulator::Now(), RemoveIfaceAssocTuple(), ns3::Simulator::Schedule(), ns3::olsr::IfaceAssocTuple::time, and ns3::EventGarbageCollector::Track().

Referenced by IfaceAssocTupleTimerExpire(), and ProcessMid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IncrementAnsn()

void ns3::olsr::RoutingProtocol::IncrementAnsn ( )
private

Increments the ANSN counter.

Definition at line 2493 of file olsr-routing-protocol.cc.

References m_ansn, and OLSR_MAX_SEQ_NUM.

Referenced by AddMprSelectorTuple(), AddNeighborTuple(), RemoveMprSelectorTuple(), and RemoveNeighborTuple().

+ Here is the caller graph for this function:

◆ IsMyOwnAddress()

bool ns3::olsr::RoutingProtocol::IsMyOwnAddress ( const Ipv4Address & a) const
private

Check that address is one of my interfaces.

Parameters
athe address to check.
Returns
true if the address is own by the node.

Definition at line 3180 of file olsr-routing-protocol.cc.

References ns3::Ipv4InterfaceAddress::GetLocal(), and m_sendSockets.

Referenced by RouteInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LinkSensing()

void ns3::olsr::RoutingProtocol::LinkSensing ( const olsr::MessageHeader & msg,
const olsr::MessageHeader::Hello & hello,
const Ipv4Address & receiverIface,
const Ipv4Address & senderIface )
private

Updates Link Set according to a new received HELLO message (following RFC 3626 specification).

Neighbor Set is also updated if needed.

Parameters
msgThe received message.
helloThe received HELLO sub-message.
receiverIfaceThe interface that received the message.
senderIfaceThe sender interface.

Definition at line 2011 of file olsr-routing-protocol.cc.

References ns3::Time::As(), ns3::olsr::ASYM_LINK, ns3::olsr::LinkTuple::asymTime, DELAY, ns3::olsr::OlsrState::FindLinkTuple(), ns3::olsr::MessageHeader::GetVTime(), ns3::olsr::OlsrState::InsertLinkTuple(), ns3::Time::IsStrictlyPositive(), ns3::olsr::MessageHeader::Hello::linkMessages, LinkTupleAdded(), LinkTupleTimerExpire(), LinkTupleUpdated(), ns3::olsr::LinkTuple::localIfaceAddr, ns3::olsr::LOST_LINK, m_events, m_mainAddress, m_state, ns3::olsr::MPR_NEIGH, ns3::olsr::LinkTuple::neighborIfaceAddr, ns3::olsr::NOT_NEIGH, ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_LOGIC, OLSR_NEIGHB_HOLD_TIME, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::olsr::SYM_LINK, ns3::olsr::SYM_NEIGH, ns3::olsr::LinkTuple::symTime, ns3::olsr::LinkTuple::time, ns3::EventGarbageCollector::Track(), and ns3::olsr::MessageHeader::Hello::willingness.

Referenced by ProcessHello().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LinkTupleAdded()

void ns3::olsr::RoutingProtocol::LinkTupleAdded ( const LinkTuple & tuple,
Willingness willingness )
private

Adds a link tuple.

Parameters
tupleThe tuple to be added.
willingnessThe tuple willingness.

Definition at line 2360 of file olsr-routing-protocol.cc.

References AddNeighborTuple(), GetMainAddress(), ns3::olsr::LinkTuple::neighborIfaceAddr, ns3::olsr::NeighborTuple::neighborMainAddr, ns3::Simulator::Now(), ns3::olsr::NeighborTuple::status, ns3::olsr::NeighborTuple::STATUS_NOT_SYM, ns3::olsr::NeighborTuple::STATUS_SYM, ns3::olsr::LinkTuple::symTime, and ns3::olsr::NeighborTuple::willingness.

Referenced by LinkSensing(), and LinkTupleUpdated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LinkTupleTimerExpire()

void ns3::olsr::RoutingProtocol::LinkTupleTimerExpire ( Ipv4Address neighborIfaceAddr)
private

Removes tuple_ if expired.

Else if symmetric time has expired then it is assumed a neighbor loss and agent_->nb_loss() is called. In this case the timer is rescheduled to expire at tuple_->time(). Otherwise the timer is rescheduled to expire at the minimum between tuple_->time() and tuple_->sym_time().

The task of actually removing the tuple is left to the OLSR agent.

Parameters
neighborIfaceAddrThe tuple neighbor interface address.

Definition at line 2663 of file olsr-routing-protocol.cc.

References DELAY, ns3::olsr::OlsrState::FindLinkTuple(), LinkTupleTimerExpire(), m_events, m_linkTupleTimerFirstTime, m_state, NeighborLoss(), ns3::Simulator::Now(), RemoveLinkTuple(), ns3::Simulator::Schedule(), ns3::olsr::LinkTuple::symTime, ns3::olsr::LinkTuple::time, and ns3::EventGarbageCollector::Track().

Referenced by LinkSensing(), and LinkTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LinkTupleUpdated()

void ns3::olsr::RoutingProtocol::LinkTupleUpdated ( const LinkTuple & tuple,
Willingness willingness )
private

This function is invoked when a link tuple is updated.

Its aim is to also update the corresponding neighbor tuple if it is needed.

Parameters
tupleThe link tuple which has been updated.
willingnessThe tuple willingness.

Definition at line 2390 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::FindNeighborTuple(), ns3::olsr::OlsrState::GetLinks(), GetMainAddress(), LinkTupleAdded(), m_mainAddress, m_state, ns3::olsr::LinkTuple::neighborIfaceAddr, ns3::olsr::NeighborTuple::neighborMainAddr, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_WARN, ns3::Time::S, ns3::olsr::NeighborTuple::status, ns3::olsr::NeighborTuple::STATUS_NOT_SYM, ns3::olsr::NeighborTuple::STATUS_SYM, and ns3::olsr::LinkTuple::symTime.

Referenced by LinkSensing(), and NeighborLoss().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Lookup()

bool ns3::olsr::RoutingProtocol::Lookup ( const Ipv4Address & dest,
RoutingTableEntry & outEntry ) const
private

Looks up an entry for the specified destination address.

Parameters
[in]destDestination address.
[out]outEntryHolds the routing entry result, if found.
Returns
true if found, false if not found.

Definition at line 2829 of file olsr-routing-protocol.cc.

References m_table.

Referenced by FindSendEntry(), RouteInput(), RouteOutput(), and RoutingTableComputation().

+ Here is the caller graph for this function:

◆ MidTimerExpire()

void ns3::olsr::RoutingProtocol::MidTimerExpire ( )
private

Sends a MID message (if the node has more than one interface) and resets the MID timer.

Definition at line 2620 of file olsr-routing-protocol.cc.

References m_midInterval, m_midTimer, ns3::Timer::Schedule(), and SendMid().

Referenced by DoInitialize(), and SetIpv4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MprComputation()

void ns3::olsr::RoutingProtocol::MprComputation ( )
private

Computes MPR set of a node following RFC 3626 hints.

Definition at line 705 of file olsr-routing-protocol.cc.

References ns3::olsr::ALWAYS, Degree(), ns3::olsr::OlsrState::GetNeighbors(), ns3::olsr::OlsrState::GetTwoHopNeighbors(), m_mainAddress, m_state, ns3::olsr::NeighborTuple::neighborMainAddr, ns3::olsr::TwoHopNeighborTuple::neighborMainAddr, ns3::olsr::NEVER, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::olsr::OlsrState::SetMprSet(), ns3::olsr::NeighborTuple::STATUS_SYM, and ns3::olsr::NeighborTuple::willingness.

Referenced by NeighborLoss(), and ProcessHello().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MprSelTupleTimerExpire()

void ns3::olsr::RoutingProtocol::MprSelTupleTimerExpire ( Ipv4Address mainAddr)
private

Removes MPR selector tuple_ if expired.

Else the timer is rescheduled to expire at tuple_->time().

The task of actually removing the tuple is left to the OLSR agent.

Parameters
mainAddrThe tuple IPv4 address.

Definition at line 2727 of file olsr-routing-protocol.cc.

References DELAY, ns3::olsr::MprSelectorTuple::expirationTime, ns3::olsr::OlsrState::FindMprSelectorTuple(), m_events, m_state, MprSelTupleTimerExpire(), ns3::Simulator::Now(), RemoveMprSelectorTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by MprSelTupleTimerExpire(), and PopulateMprSelectorSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Nb2hopTupleTimerExpire()

void ns3::olsr::RoutingProtocol::Nb2hopTupleTimerExpire ( Ipv4Address neighborMainAddr,
Ipv4Address twoHopNeighborAddr )
private

Removes 2_hop neighbor tuple_ if expired.

Else the timer is rescheduled to expire at tuple_->time().

The task of actually removing the tuple is left to the OLSR agent.

Parameters
neighborMainAddrThe neighbor main address.
twoHopNeighborAddrThe 2-hop neighbor address.

Definition at line 2703 of file olsr-routing-protocol.cc.

References DELAY, ns3::olsr::TwoHopNeighborTuple::expirationTime, ns3::olsr::OlsrState::FindTwoHopNeighborTuple(), m_events, m_state, Nb2hopTupleTimerExpire(), ns3::Simulator::Now(), RemoveTwoHopNeighborTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by Nb2hopTupleTimerExpire(), and PopulateTwoHopNeighborSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NeighborLoss()

void ns3::olsr::RoutingProtocol::NeighborLoss ( const LinkTuple & tuple)
private

Performs all actions needed when a neighbor loss occurs.

Neighbor Set, 2-hop Neighbor Set, MPR Set and MPR Selector Set are updated.

Parameters
tuplelink tuple with the information of the link to the neighbor which has been lost.

Definition at line 2325 of file olsr-routing-protocol.cc.

References ns3::olsr::DEFAULT, ns3::olsr::OlsrState::EraseMprSelectorTuples(), ns3::olsr::OlsrState::EraseTwoHopNeighborTuples(), GetMainAddress(), LinkTupleUpdated(), m_mainAddress, m_state, MprComputation(), ns3::olsr::LinkTuple::neighborIfaceAddr, ns3::Simulator::Now(), NS_LOG_DEBUG, RoutingTableComputation(), and ns3::Time::S.

Referenced by LinkTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyAddAddress()

void ns3::olsr::RoutingProtocol::NotifyAddAddress ( uint32_t interface,
Ipv4InterfaceAddress address )
overrideprivatevirtual
Parameters
interfacethe index of the interface we are being notified about
addressa new address being added to an interface

Protocols are expected to implement this method to be notified whenever a new address is added to an interface. Typically used to add a 'network route' on an interface. Can be invoked on an up or down interface.

Implements ns3::Ipv4RoutingProtocol.

Definition at line 3069 of file olsr-routing-protocol.cc.

◆ NotifyInterfaceDown()

void ns3::olsr::RoutingProtocol::NotifyInterfaceDown ( uint32_t interface)
overrideprivatevirtual
Parameters
interfacethe index of the interface we are being notified about

Protocols are expected to implement this method to be notified of the state change of an interface in a node.

Implements ns3::Ipv4RoutingProtocol.

Definition at line 3064 of file olsr-routing-protocol.cc.

◆ NotifyInterfaceUp()

void ns3::olsr::RoutingProtocol::NotifyInterfaceUp ( uint32_t interface)
overrideprivatevirtual
Parameters
interfacethe index of the interface we are being notified about

Protocols are expected to implement this method to be notified of the state change of an interface in a node.

Implements ns3::Ipv4RoutingProtocol.

Definition at line 3059 of file olsr-routing-protocol.cc.

◆ NotifyRemoveAddress()

void ns3::olsr::RoutingProtocol::NotifyRemoveAddress ( uint32_t interface,
Ipv4InterfaceAddress address )
overrideprivatevirtual
Parameters
interfacethe index of the interface we are being notified about
addressa new address being added to an interface

Protocols are expected to implement this method to be notified whenever a new address is removed from an interface. Typically used to remove the 'network route' of an interface. Can be invoked on an up or down interface.

Implements ns3::Ipv4RoutingProtocol.

Definition at line 3074 of file olsr-routing-protocol.cc.

◆ PopulateMprSelectorSet()

void ns3::olsr::RoutingProtocol::PopulateMprSelectorSet ( const olsr::MessageHeader & msg,
const olsr::MessageHeader::Hello & hello )
private

Updates the MPR Selector Set according to the information contained in a new received HELLO message (following RFC 3626 ).

Parameters
msgThe received message.
helloThe received HELLO sub-message.

Definition at line 2234 of file olsr-routing-protocol.cc.

References AddMprSelectorTuple(), DELAY, ns3::olsr::MprSelectorTuple::expirationTime, ns3::olsr::OlsrState::FindMprSelectorTuple(), GetMainAddress(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetVTime(), ns3::olsr::MessageHeader::Hello::linkMessages, m_events, m_mainAddress, m_state, ns3::olsr::MprSelectorTuple::mainAddr, ns3::olsr::MPR_NEIGH, MprSelTupleTimerExpire(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::olsr::OlsrState::PrintMprSelectorSet(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by ProcessHello().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PopulateNeighborSet()

void ns3::olsr::RoutingProtocol::PopulateNeighborSet ( const olsr::MessageHeader & msg,
const olsr::MessageHeader::Hello & hello )
private

Updates the Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626 ).

Parameters
msgThe received message.
helloThe received HELLO sub-message.

Definition at line 2119 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::FindNeighborTuple(), ns3::olsr::MessageHeader::GetOriginatorAddress(), m_state, ns3::olsr::MessageHeader::Hello::willingness, and ns3::olsr::NeighborTuple::willingness.

Referenced by ProcessHello().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PopulateTwoHopNeighborSet()

void ns3::olsr::RoutingProtocol::PopulateTwoHopNeighborSet ( const olsr::MessageHeader & msg,
const olsr::MessageHeader::Hello & hello )
private

Updates the 2-hop Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626 ).

Parameters
msgThe received message.
helloThe received HELLO sub-message.

Definition at line 2130 of file olsr-routing-protocol.cc.

References AddTwoHopNeighborTuple(), DELAY, ns3::olsr::OlsrState::EraseTwoHopNeighborTuples(), ns3::olsr::TwoHopNeighborTuple::expirationTime, ns3::olsr::OlsrState::FindTwoHopNeighborTuple(), ns3::olsr::OlsrState::GetLinks(), GetMainAddress(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetVTime(), ns3::olsr::MessageHeader::Hello::linkMessages, m_events, m_mainAddress, m_state, ns3::olsr::MPR_NEIGH, Nb2hopTupleTimerExpire(), ns3::olsr::TwoHopNeighborTuple::neighborMainAddr, ns3::olsr::NOT_NEIGH, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, ns3::Simulator::Schedule(), ns3::olsr::SYM_NEIGH, ns3::EventGarbageCollector::Track(), and ns3::olsr::TwoHopNeighborTuple::twoHopNeighborAddr.

Referenced by ProcessHello().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintRoutingTable()

void ns3::olsr::RoutingProtocol::PrintRoutingTable ( Ptr< OutputStreamWrapper > stream,
Time::Unit unit = Time::S ) const
overridevirtual

Print the Routing Table entries.

Parameters
streamThe ostream the Routing table is printed to
unitThe time unit to be used in the report

Implements ns3::Ipv4RoutingProtocol.

Definition at line 309 of file olsr-routing-protocol.cc.

References ns3::Time::As(), ns3::Names::FindName(), ns3::Ipv4::GetNetDevice(), ns3::Object::GetObject(), m_hnaRoutingTable, m_ipv4, m_table, and ns3::Now().

+ Here is the call graph for this function:

◆ ProcessHello()

void ns3::olsr::RoutingProtocol::ProcessHello ( const olsr::MessageHeader & msg,
const Ipv4Address & receiverIface,
const Ipv4Address & senderIface )
private

Processes a HELLO message following RFC 3626 specification.

Link sensing and population of the Neighbor Set, 2-hop Neighbor Set and MPR Selector Set are performed.

Parameters
msgthe OLSR message which contains the HELLO message.
receiverIfacethe address of the interface where the message was received from.
senderIfacethe address of the interface where the message was sent from.

Definition at line 1308 of file olsr-routing-protocol.cc.

References ns3::olsr::MessageHeader::GetHello(), ns3::olsr::OlsrState::GetLinks(), ns3::olsr::OlsrState::GetNeighbors(), ns3::olsr::OlsrState::GetTwoHopNeighbors(), LinkSensing(), m_mainAddress, m_state, MprComputation(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, PopulateMprSelectorSet(), PopulateNeighborSet(), PopulateTwoHopNeighborSet(), and ns3::Time::S.

Referenced by RecvOlsr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessHna()

void ns3::olsr::RoutingProtocol::ProcessHna ( const olsr::MessageHeader & msg,
const Ipv4Address & senderIface )
private

Processes a HNA message following RFC 3626 specification.

The Host Network Association Set is updated (if needed) with the information of the received HNA message.

Parameters
msgthe OLSR message which contains the HNA message.
senderIfacethe address of the interface where the message was sent from.

Definition at line 1515 of file olsr-routing-protocol.cc.

References AddAssociationTuple(), ns3::olsr::MessageHeader::Hna::associations, AssociationTupleTimerExpire(), DELAY, ns3::olsr::AssociationTuple::expirationTime, ns3::olsr::OlsrState::FindAssociationTuple(), ns3::olsr::OlsrState::FindSymLinkTuple(), ns3::olsr::AssociationTuple::gatewayAddr, ns3::olsr::MessageHeader::GetHna(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetVTime(), m_state, ns3::olsr::AssociationTuple::netmask, ns3::olsr::AssociationTuple::networkAddr, ns3::Simulator::Now(), and ns3::Simulator::Schedule().

Referenced by RecvOlsr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessMid()

void ns3::olsr::RoutingProtocol::ProcessMid ( const olsr::MessageHeader & msg,
const Ipv4Address & senderIface )
private

Processes a MID message following RFC 3626 specification.

The Interface Association Set is updated (if needed) with the information of the received MID message.

Parameters
msgthe OLSR message which contains the MID message.
senderIfacethe address of the interface where the message was sent from.

Definition at line 1447 of file olsr-routing-protocol.cc.

References AddIfaceAssocTuple(), DELAY, ns3::olsr::OlsrState::FindSymLinkTuple(), ns3::olsr::OlsrState::GetIfaceAssocSetMutable(), GetMainAddress(), ns3::olsr::MessageHeader::GetMid(), ns3::olsr::OlsrState::GetNeighbors(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::OlsrState::GetTwoHopNeighbors(), ns3::olsr::MessageHeader::GetVTime(), ns3::olsr::IfaceAssocTuple::ifaceAddr, IfaceAssocTupleTimerExpire(), ns3::olsr::MessageHeader::Mid::interfaceAddresses, m_mainAddress, m_state, ns3::olsr::IfaceAssocTuple::mainAddr, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, ns3::Simulator::Schedule(), and ns3::olsr::IfaceAssocTuple::time.

Referenced by RecvOlsr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessTc()

void ns3::olsr::RoutingProtocol::ProcessTc ( const olsr::MessageHeader & msg,
const Ipv4Address & senderIface )
private

Processes a TC message following RFC 3626 specification.

The Topology Set is updated (if needed) with the information of the received TC message.

Parameters
msgThe OLSR message which contains the TC message.
senderIfaceThe address of the interface where the message was sent from.

Definition at line 1361 of file olsr-routing-protocol.cc.

References AddTopologyTuple(), ns3::olsr::MessageHeader::Tc::ansn, DELAY, ns3::olsr::TopologyTuple::destAddr, ns3::olsr::OlsrState::EraseOlderTopologyTuples(), ns3::olsr::TopologyTuple::expirationTime, ns3::olsr::OlsrState::FindNewerTopologyTuple(), ns3::olsr::OlsrState::FindSymLinkTuple(), ns3::olsr::OlsrState::FindTopologyTuple(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetTc(), ns3::olsr::OlsrState::GetTopologySet(), ns3::olsr::MessageHeader::GetVTime(), ns3::olsr::TopologyTuple::lastAddr, m_events, m_mainAddress, m_state, ns3::olsr::MessageHeader::Tc::neighborAddresses, ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::Time::S, ns3::Simulator::Schedule(), ns3::olsr::TopologyTuple::sequenceNumber, TopologyTupleTimerExpire(), and ns3::EventGarbageCollector::Track().

Referenced by RecvOlsr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QueueMessage()

void ns3::olsr::RoutingProtocol::QueueMessage ( const olsr::MessageHeader & message,
Time delay )
private

Enqueues an OLSR message which will be sent with a delay of (0, delay].

This buffering system is used in order to piggyback several OLSR messages in a same OLSR packet.

Parameters
messagethe OLSR message which must be sent.
delaymaximum delay the OLSR message is going to be buffered.

Definition at line 1645 of file olsr-routing-protocol.cc.

References ns3::Timer::IsRunning(), m_queuedMessages, m_queuedMessagesTimer, ns3::Timer::Schedule(), and ns3::Timer::SetDelay().

Referenced by ForwardDefault(), SendHello(), SendHna(), SendMid(), and SendTc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RecvOlsr()

void ns3::olsr::RoutingProtocol::RecvOlsr ( Ptr< Socket > socket)
private

Receive an OLSR message.

Parameters
socketThe receiving socket.

Definition at line 470 of file olsr-routing-protocol.cc.

References ns3::InetSocketAddress::ConvertFrom(), ns3::olsr::OlsrState::FindDuplicateTuple(), ForwardDefault(), ns3::Ipv4::GetAddress(), ns3::Ipv4::GetInterfaceForAddress(), ns3::Ipv4::GetInterfaceForDevice(), ns3::InetSocketAddress::GetIpv4(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::olsr::MessageHeader::GetMessageSequenceNumber(), ns3::olsr::MessageHeader::GetMessageType(), ns3::Object::GetObject(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::PacketHeader::GetPacketLength(), ns3::InetSocketAddress::GetPort(), ns3::Ipv4PacketInfoTag::GetRecvIf(), ns3::olsr::MessageHeader::GetSerializedSize(), ns3::olsr::PacketHeader::GetSerializedSize(), ns3::olsr::MessageHeader::GetTimeToLive(), ns3::olsr::MessageHeader::HELLO_MESSAGE, ns3::olsr::MessageHeader::HNA_MESSAGE, ns3::olsr::DuplicateTuple::ifaceList, m_interfaceExclusions, m_ipv4, m_mainAddress, m_rxPacketTrace, m_state, ns3::olsr::MessageHeader::MID_MESSAGE, ns3::Simulator::Now(), NS_ABORT_MSG, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_LOGIC, OLSR_PORT_NUMBER, ProcessHello(), ProcessHna(), ProcessMid(), ProcessTc(), RoutingTableComputation(), ns3::Time::S, and ns3::olsr::MessageHeader::TC_MESSAGE.

Referenced by DoInitialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveAssociationTuple()

void ns3::olsr::RoutingProtocol::RemoveAssociationTuple ( const AssociationTuple & tuple)
private

Removes a host network association tuple to the Association Set.

Parameters
tupleThe host network association tuple to be removed.

Definition at line 2579 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseAssociationTuple(), and m_state.

Referenced by AssociationTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveDuplicateTuple()

void ns3::olsr::RoutingProtocol::RemoveDuplicateTuple ( const DuplicateTuple & tuple)
private

Removes a duplicate tuple from the Duplicate Set.

Parameters
tupleThe duplicate tuple to be removed.

Definition at line 2349 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseDuplicateTuple(), and m_state.

Referenced by DupTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveEntry()

void ns3::olsr::RoutingProtocol::RemoveEntry ( const Ipv4Address & dest)
private

Deletes the entry whose destination address is given.

Parameters
destaddress of the destination node.

Definition at line 2823 of file olsr-routing-protocol.cc.

References m_table.

◆ RemoveHostNetworkAssociation()

void ns3::olsr::RoutingProtocol::RemoveHostNetworkAssociation ( Ipv4Address networkAddr,
Ipv4Mask netmask )

Removes the specified (networkAddr, netmask) tuple from the list of local HNA associations to be sent by the node via HNA messages.

If this tuple does not exist, nothing is done (see "OlsrState::EraseAssociation()").

Parameters
networkAddrThe network address.
netmaskThe network mask.

Definition at line 1948 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseAssociation(), m_state, and NS_LOG_INFO.

Referenced by SetRoutingTableAssociation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveIfaceAssocTuple()

void ns3::olsr::RoutingProtocol::RemoveIfaceAssocTuple ( const IfaceAssocTuple & tuple)
private

Removed an interface association tuple to the Interface Association Set.

Parameters
tupleThe interface association tuple to be removed.

Definition at line 2561 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseIfaceAssocTuple(), and m_state.

Referenced by IfaceAssocTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveLinkTuple()

void ns3::olsr::RoutingProtocol::RemoveLinkTuple ( const LinkTuple & tuple)
private

Removes a link tuple from the Link Set.

Parameters
tupleThe link tuple to be removed.

Definition at line 2380 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseLinkTuple(), ns3::olsr::OlsrState::EraseNeighborTuple(), GetMainAddress(), m_mainAddress, m_state, ns3::olsr::LinkTuple::neighborIfaceAddr, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by LinkTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveMprSelectorTuple()

void ns3::olsr::RoutingProtocol::RemoveMprSelectorTuple ( const MprSelectorTuple & tuple)
private

Removes an MPR selector tuple from the MPR Selector Set.

Advertised Neighbor Sequence Number (ANSN) is also updated.

Parameters
tupleThe MPR selector tuple to be removed.

Definition at line 2511 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseMprSelectorTuple(), IncrementAnsn(), and m_state.

Referenced by MprSelTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveNeighborTuple()

void ns3::olsr::RoutingProtocol::RemoveNeighborTuple ( const NeighborTuple & tuple)
private

Removes a neighbor tuple from the Neighbor Set.

Parameters
tupleThe neighbor tuple to be removed.

Definition at line 2456 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseNeighborTuple(), IncrementAnsn(), and m_state.

+ Here is the call graph for this function:

◆ RemoveTopologyTuple()

void ns3::olsr::RoutingProtocol::RemoveTopologyTuple ( const TopologyTuple & tuple)
private

Removes a topology tuple to the Topology Set.

Parameters
tupleThe topology tuple to be removed.

Definition at line 2536 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseTopologyTuple(), and m_state.

Referenced by TopologyTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveTwoHopNeighborTuple()

void ns3::olsr::RoutingProtocol::RemoveTwoHopNeighborTuple ( const TwoHopNeighborTuple & tuple)
private

Removes a 2-hop neighbor tuple from the 2-hop Neighbor Set.

Parameters
tupleThe 2-hop neighbor tuple to be removed.

Definition at line 2481 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::EraseTwoHopNeighborTuple(), and m_state.

Referenced by Nb2hopTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RouteInput()

bool ns3::olsr::RoutingProtocol::RouteInput ( Ptr< const Packet > p,
const Ipv4Header & header,
Ptr< const NetDevice > idev,
const UnicastForwardCallback & ucb,
const MulticastForwardCallback & mcb,
const LocalDeliverCallback & lcb,
const ErrorCallback & ecb )
overridevirtual

Route an input packet (to be forwarded or locally delivered)

This lookup is used in the forwarding process. The packet is handed over to the Ipv4RoutingProtocol, and will get forwarded onward by one of the callbacks. The Linux equivalent is ip_route_input(). There are four valid outcomes, and a matching callbacks to handle each.

Parameters
preceived packet
headerinput parameter used to form a search key for a route
idevPointer to ingress network device
ucbCallback for the case in which the packet is to be forwarded as unicast
mcbCallback for the case in which the packet is to be forwarded as multicast
lcbCallback for the case in which the packet is to be locally delivered
ecbCallback to call if there is an error in forwarding
Returns
true if the Ipv4RoutingProtocol takes responsibility for forwarding or delivering the packet, false otherwise
Todo
Implement IP aliasing and OLSR

Implements ns3::Ipv4RoutingProtocol.

Definition at line 2945 of file olsr-routing-protocol.cc.

References ns3::Create(), FindSendEntry(), ns3::Ipv4::GetAddress(), ns3::Ipv4Header::GetDestination(), ns3::Node::GetId(), ns3::Ipv4::GetInterfaceForDevice(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4::GetNAddresses(), ns3::Ipv4::GetNetDevice(), ns3::Object::GetObject(), ns3::Ipv4Header::GetSource(), ns3::olsr::RoutingTableEntry::interface, ns3::Ipv4::IsDestinationAddress(), IsMyOwnAddress(), ns3::Callback< R, UArgs >::IsNull(), Lookup(), m_hnaRoutingTable, m_ipv4, m_mainAddress, m_table, ns3::olsr::RoutingTableEntry::nextAddr, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ RouteOutput()

Ptr< Ipv4Route > ns3::olsr::RoutingProtocol::RouteOutput ( Ptr< Packet > p,
const Ipv4Header & header,
Ptr< NetDevice > oif,
Socket::SocketErrno & sockerr )
overridevirtual

Query routing cache for an existing route, for an outbound packet.

This lookup is used by transport protocols. It does not cause any packet to be forwarded, and is synchronous. Can be used for multicast or unicast. The Linux equivalent is ip_route_output()

The header input parameter may have an uninitialized value for the source address, but the destination address should always be properly set by the caller.

Parameters
ppacket to be routed. Note that this method may modify the packet. Callers may also pass in a null pointer.
headerinput parameter (used to form key to search for the route)
oifOutput interface Netdevice. May be zero, or may be bound via socket options to a particular output interface.
sockerrOutput parameter; socket errno
Returns
a code that indicates what happened in the lookup
Todo
Implement IP aliasing and OLSR

Implements ns3::Ipv4RoutingProtocol.

Definition at line 2857 of file olsr-routing-protocol.cc.

References ns3::Create(), ns3::Socket::ERROR_NOROUTETOHOST, ns3::Socket::ERROR_NOTERROR, FindSendEntry(), ns3::Ipv4::GetAddress(), ns3::Ipv4Header::GetDestination(), ns3::Node::GetId(), ns3::Ipv4::GetInterfaceForDevice(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4::GetNAddresses(), ns3::Ipv4::GetNetDevice(), ns3::Object::GetObject(), ns3::olsr::RoutingTableEntry::interface, Lookup(), m_hnaRoutingTable, m_ipv4, m_mainAddress, ns3::olsr::RoutingTableEntry::nextAddr, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ RoutingTableComputation()

void ns3::olsr::RoutingProtocol::RoutingTableComputation ( )
private

Creates the routing table of the node following RFC 3626 hints.

Definition at line 1001 of file olsr-routing-protocol.cc.

References AddEntry(), Clear(), ns3::olsr::TopologyTuple::destAddr, ns3::olsr::RoutingTableEntry::distance, ns3::olsr::OlsrState::FindSymNeighborTuple(), ns3::olsr::AssociationTuple::gatewayAddr, ns3::olsr::OlsrState::GetAssociations(), ns3::olsr::OlsrState::GetAssociationSet(), ns3::Ipv4RoutingTableEntry::GetDestNetwork(), ns3::Ipv4RoutingTableEntry::GetDestNetworkMask(), ns3::olsr::OlsrState::GetIfaceAssocSet(), ns3::olsr::OlsrState::GetLinks(), GetMainAddress(), ns3::olsr::OlsrState::GetNeighbors(), GetSize(), ns3::olsr::OlsrState::GetTopologySet(), ns3::olsr::OlsrState::GetTwoHopNeighbors(), ns3::olsr::IfaceAssocTuple::ifaceAddr, ns3::olsr::RoutingTableEntry::interface, ns3::olsr::TopologyTuple::lastAddr, ns3::olsr::LinkTuple::localIfaceAddr, Lookup(), m_hnaRoutingTable, m_mainAddress, m_routingTableChanged, m_state, ns3::olsr::IfaceAssocTuple::mainAddr, ns3::olsr::LinkTuple::neighborIfaceAddr, ns3::olsr::NeighborTuple::neighborMainAddr, ns3::olsr::TwoHopNeighborTuple::neighborMainAddr, ns3::olsr::Association::netmask, ns3::olsr::AssociationTuple::netmask, ns3::olsr::Association::networkAddr, ns3::olsr::AssociationTuple::networkAddr, ns3::olsr::NEVER, ns3::olsr::RoutingTableEntry::nextAddr, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, ns3::Time::S, ns3::olsr::NeighborTuple::status, ns3::olsr::NeighborTuple::STATUS_SYM, ns3::olsr::LinkTuple::time, and ns3::olsr::TwoHopNeighborTuple::twoHopNeighborAddr.

Referenced by NeighborLoss(), and RecvOlsr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendHello()

void ns3::olsr::RoutingProtocol::SendHello ( )
private

Creates a new OLSR HELLO message which is buffered for being sent later on.

Definition at line 1713 of file olsr-routing-protocol.cc.

References ns3::olsr::ASYM_LINK, ns3::olsr::OlsrState::FindMprAddress(), ns3::olsr::OlsrState::FindNeighborInterfaces(), ns3::olsr::MessageHeader::GetHello(), ns3::olsr::OlsrState::GetLinks(), GetMainAddress(), GetMessageSequenceNumber(), ns3::olsr::OlsrState::GetNeighbors(), ns3::olsr::MessageHeader::GetSerializedSize(), JITTER, ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode, ns3::olsr::MessageHeader::Hello::linkMessages, ns3::olsr::LOST_LINK, m_helloInterval, m_mainAddress, m_state, m_willingness, ns3::olsr::MPR_NEIGH, ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses, ns3::olsr::NOT_NEIGH, ns3::Simulator::Now(), NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, OLSR_NEIGHB_HOLD_TIME, QueueMessage(), ns3::olsr::MessageHeader::SetHopCount(), ns3::olsr::MessageHeader::Hello::SetHTime(), ns3::olsr::MessageHeader::SetMessageSequenceNumber(), ns3::olsr::MessageHeader::SetOriginatorAddress(), ns3::olsr::MessageHeader::SetTimeToLive(), ns3::olsr::MessageHeader::SetVTime(), ns3::olsr::NeighborTuple::STATUS_NOT_SYM, ns3::olsr::NeighborTuple::STATUS_SYM, ns3::olsr::SYM_LINK, ns3::olsr::SYM_NEIGH, and ns3::olsr::MessageHeader::Hello::willingness.

Referenced by HelloTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendHna()

void ns3::olsr::RoutingProtocol::SendHna ( )
private

Creates a new OLSR HNA message which is buffered for being sent later on.

Definition at line 1894 of file olsr-routing-protocol.cc.

References ns3::olsr::MessageHeader::Hna::associations, ns3::olsr::OlsrState::GetAssociations(), ns3::olsr::MessageHeader::GetHna(), GetMessageSequenceNumber(), JITTER, m_mainAddress, m_state, OLSR_HNA_HOLD_TIME, QueueMessage(), ns3::olsr::MessageHeader::SetHopCount(), ns3::olsr::MessageHeader::SetMessageSequenceNumber(), ns3::olsr::MessageHeader::SetOriginatorAddress(), ns3::olsr::MessageHeader::SetTimeToLive(), and ns3::olsr::MessageHeader::SetVTime().

Referenced by HnaTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendMid()

void ns3::olsr::RoutingProtocol::SendMid ( )
private

Creates a new OLSR MID message which is buffered for being sent later on.

Definition at line 1848 of file olsr-routing-protocol.cc.

References ns3::Ipv4::GetAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), GetMessageSequenceNumber(), ns3::olsr::MessageHeader::GetMid(), ns3::Ipv4::GetNInterfaces(), ns3::olsr::MessageHeader::Mid::interfaceAddresses, JITTER, m_interfaceExclusions, m_ipv4, m_mainAddress, OLSR_MID_HOLD_TIME, QueueMessage(), ns3::olsr::MessageHeader::SetHopCount(), ns3::olsr::MessageHeader::SetMessageSequenceNumber(), ns3::olsr::MessageHeader::SetOriginatorAddress(), ns3::olsr::MessageHeader::SetTimeToLive(), and ns3::olsr::MessageHeader::SetVTime().

Referenced by MidTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendPacket()

void ns3::olsr::RoutingProtocol::SendPacket ( Ptr< Packet > packet,
const MessageList & containedMessages )
private

Send an OLSR message.

Parameters
packetThe packet to be sent.
containedMessagesThe messages contained in the packet.

Definition at line 1656 of file olsr-routing-protocol.cc.

References GetPacketSequenceNumber(), ns3::olsr::PacketHeader::GetSerializedSize(), ns3::Ipv4Address::GetSubnetDirectedBroadcast(), m_mainAddress, m_sendSockets, m_txPacketTrace, NS_LOG_DEBUG, OLSR_PORT_NUMBER, ns3::olsr::PacketHeader::SetPacketLength(), and ns3::olsr::PacketHeader::SetPacketSequenceNumber().

Referenced by SendQueuedMessages().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendQueuedMessages()

void ns3::olsr::RoutingProtocol::SendQueuedMessages ( )
private

Creates as many OLSR packets as needed in order to send all buffered OLSR messages.

Maximum number of messages which can be contained in an OLSR packet is dictated by OLSR_MAX_MSGS constant.

Definition at line 1679 of file olsr-routing-protocol.cc.

References ns3::Create(), m_mainAddress, m_queuedMessages, NS_LOG_DEBUG, OLSR_MAX_MSGS, and SendPacket().

Referenced by SetIpv4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendTc()

void ns3::olsr::RoutingProtocol::SendTc ( )
private

Creates a new OLSR TC message which is buffered for being sent later on.

Definition at line 1823 of file olsr-routing-protocol.cc.

References ns3::olsr::MessageHeader::Tc::ansn, GetMessageSequenceNumber(), ns3::olsr::OlsrState::GetMprSelectors(), ns3::olsr::MessageHeader::GetTc(), JITTER, m_ansn, m_mainAddress, m_state, ns3::olsr::MessageHeader::Tc::neighborAddresses, NS_LOG_FUNCTION, OLSR_TOP_HOLD_TIME, QueueMessage(), ns3::olsr::MessageHeader::SetHopCount(), ns3::olsr::MessageHeader::SetMessageSequenceNumber(), ns3::olsr::MessageHeader::SetOriginatorAddress(), ns3::olsr::MessageHeader::SetTimeToLive(), and ns3::olsr::MessageHeader::SetVTime().

Referenced by TcTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetInterfaceExclusions()

void ns3::olsr::RoutingProtocol::SetInterfaceExclusions ( std::set< uint32_t > exceptions)

Set the interfaces to be excluded.

Parameters
exceptionsContainer of excluded interfaces.

Definition at line 462 of file olsr-routing-protocol.cc.

References m_interfaceExclusions.

◆ SetIpv4()

void ns3::olsr::RoutingProtocol::SetIpv4 ( Ptr< Ipv4 > ipv4)
overridevirtual
Parameters
ipv4the ipv4 object this routing protocol is being associated with

Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol

Implements ns3::Ipv4RoutingProtocol.

Definition at line 263 of file olsr-routing-protocol.cc.

References HelloTimerExpire(), HnaTimerExpire(), m_ansn, m_helloTimer, m_hnaRoutingTable, m_hnaTimer, m_ipv4, m_linkTupleTimerFirstTime, m_messageSequenceNumber, m_midTimer, m_packetSequenceNumber, m_queuedMessagesTimer, m_tcTimer, MidTimerExpire(), NS_ASSERT, NS_LOG_DEBUG, OLSR_MAX_SEQ_NUM, SendQueuedMessages(), ns3::Timer::SetFunction(), and TcTimerExpire().

+ Here is the call graph for this function:

◆ SetMainInterface()

void ns3::olsr::RoutingProtocol::SetMainInterface ( uint32_t interface)

Set the OLSR main address to the first address on the indicated interface.

Parameters
interfaceIPv4 interface index

Definition at line 456 of file olsr-routing-protocol.cc.

References ns3::Ipv4::GetAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), m_ipv4, and m_mainAddress.

+ Here is the call graph for this function:

◆ SetRoutingTableAssociation()

void ns3::olsr::RoutingProtocol::SetRoutingTableAssociation ( Ptr< Ipv4StaticRouting > routingTable)

Associates the specified Ipv4StaticRouting routing table to the OLSR routing protocol.

Entries from this associated routing table that use non-olsr outgoing interfaces are added to the list of local HNA associations so that they are included in HNA messages sent by the node. If this method is called more than once, entries from the old association are deleted before entries from the new one are added.

Parameters
routingTablethe Ipv4StaticRouting routing table to be associated.

Definition at line 1955 of file olsr-routing-protocol.cc.

References AddHostNetworkAssociation(), ns3::olsr::OlsrState::GetAssociations(), ns3::Ipv4RoutingTableEntry::GetDestNetwork(), ns3::Ipv4RoutingTableEntry::GetDestNetworkMask(), m_routingTableAssociation, m_state, NS_LOG_DEBUG, NS_LOG_INFO, RemoveHostNetworkAssociation(), and UsesNonOlsrOutgoingInterface().

+ Here is the call graph for this function:

◆ TcTimerExpire()

void ns3::olsr::RoutingProtocol::TcTimerExpire ( )
private

Sends a TC message (if there exists any MPR selector) and reschedules the TC timer.

Definition at line 2606 of file olsr-routing-protocol.cc.

References ns3::olsr::OlsrState::GetMprSelectors(), m_state, m_tcInterval, m_tcTimer, NS_LOG_DEBUG, ns3::Timer::Schedule(), and SendTc().

Referenced by DoInitialize(), and SetIpv4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TopologyTupleTimerExpire()

void ns3::olsr::RoutingProtocol::TopologyTupleTimerExpire ( Ipv4Address destAddr,
Ipv4Address lastAddr )
private

Removes topology tuple_ if expired.

Else the timer is rescheduled to expire at tuple_->time().

The task of actually removing the tuple is left to the OLSR agent.

Parameters
destAddrThe destination address.
lastAddrThe last address.

Definition at line 2748 of file olsr-routing-protocol.cc.

References DELAY, ns3::olsr::TopologyTuple::destAddr, ns3::olsr::TopologyTuple::expirationTime, ns3::olsr::OlsrState::FindTopologyTuple(), ns3::olsr::TopologyTuple::lastAddr, m_events, m_state, ns3::Simulator::Now(), RemoveTopologyTuple(), ns3::Simulator::Schedule(), TopologyTupleTimerExpire(), and ns3::EventGarbageCollector::Track().

Referenced by ProcessTc(), and TopologyTupleTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UsesNonOlsrOutgoingInterface()

bool ns3::olsr::RoutingProtocol::UsesNonOlsrOutgoingInterface ( const Ipv4RoutingTableEntry & route)
private

Tests whether or not the specified route uses a non-OLSR outgoing interface.

Parameters
routeThe route to be tested.
Returns
True if the outgoing interface of the specified route is a non-OLSR interface, false otherwise.

Definition at line 2002 of file olsr-routing-protocol.cc.

References ns3::Ipv4RoutingTableEntry::GetInterface(), and m_interfaceExclusions.

Referenced by SetRoutingTableAssociation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ::OlsrMprTestCase

friend class ::OlsrMprTestCase
friend

Declared friend to enable unit tests.

Definition at line 79 of file olsr-routing-protocol.h.

Member Data Documentation

◆ m_ansn

uint16_t ns3::olsr::RoutingProtocol::m_ansn
private

Advertised Neighbor Set sequence number.

Definition at line 246 of file olsr-routing-protocol.h.

Referenced by IncrementAnsn(), SendTc(), and SetIpv4().

◆ m_events

◆ m_helloInterval

Time ns3::olsr::RoutingProtocol::m_helloInterval
private

HELLO messages' emission interval.

Definition at line 248 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), HelloTimerExpire(), and SendHello().

◆ m_helloTimer

Timer ns3::olsr::RoutingProtocol::m_helloTimer
private

Timer for the HELLO message.

Definition at line 410 of file olsr-routing-protocol.h.

Referenced by HelloTimerExpire(), and SetIpv4().

◆ m_hnaInterval

Time ns3::olsr::RoutingProtocol::m_hnaInterval
private

HNA messages' emission interval.

Definition at line 251 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), and HnaTimerExpire().

◆ m_hnaRoutingTable

Ptr<Ipv4StaticRouting> ns3::olsr::RoutingProtocol::m_hnaRoutingTable
private

◆ m_hnaTimer

Timer ns3::olsr::RoutingProtocol::m_hnaTimer
private

Timer for the HNA message.

Definition at line 429 of file olsr-routing-protocol.h.

Referenced by HnaTimerExpire(), and SetIpv4().

◆ m_interfaceExclusions

std::set<uint32_t> ns3::olsr::RoutingProtocol::m_interfaceExclusions
private

Set of interfaces excluded by OSLR.

Definition at line 175 of file olsr-routing-protocol.h.

Referenced by DoInitialize(), GetInterfaceExclusions(), RecvOlsr(), SendMid(), SetInterfaceExclusions(), and UsesNonOlsrOutgoingInterface().

◆ m_ipv4

Ptr<Ipv4> ns3::olsr::RoutingProtocol::m_ipv4
private

IPv4 object the routing is linked to.

Definition at line 255 of file olsr-routing-protocol.h.

Referenced by AddEntry(), DoDispose(), DoInitialize(), PrintRoutingTable(), RecvOlsr(), RouteInput(), RouteOutput(), SendMid(), SetIpv4(), and SetMainInterface().

◆ m_linkTupleTimerFirstTime

bool ns3::olsr::RoutingProtocol::m_linkTupleTimerFirstTime
private

Flag to indicate if it is the first time the LinkTupleTimer fires.

Definition at line 446 of file olsr-routing-protocol.h.

Referenced by LinkTupleTimerExpire(), and SetIpv4().

◆ m_mainAddress

◆ m_messageSequenceNumber

uint16_t ns3::olsr::RoutingProtocol::m_messageSequenceNumber
private

Messages sequence number counter.

Definition at line 245 of file olsr-routing-protocol.h.

Referenced by GetMessageSequenceNumber(), and SetIpv4().

◆ m_midInterval

Time ns3::olsr::RoutingProtocol::m_midInterval
private

MID messages' emission interval.

Definition at line 250 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), and MidTimerExpire().

◆ m_midTimer

Timer ns3::olsr::RoutingProtocol::m_midTimer
private

Timer for the MID message.

Definition at line 422 of file olsr-routing-protocol.h.

Referenced by MidTimerExpire(), and SetIpv4().

◆ m_packetSequenceNumber

uint16_t ns3::olsr::RoutingProtocol::m_packetSequenceNumber
private

Packets sequence number counter.

Definition at line 244 of file olsr-routing-protocol.h.

Referenced by GetPacketSequenceNumber(), and SetIpv4().

◆ m_queuedMessages

olsr::MessageList ns3::olsr::RoutingProtocol::m_queuedMessages
private

A list of pending messages which are buffered awaiting for being sent.

Definition at line 519 of file olsr-routing-protocol.h.

Referenced by QueueMessage(), and SendQueuedMessages().

◆ m_queuedMessagesTimer

Timer ns3::olsr::RoutingProtocol::m_queuedMessagesTimer
private

timer for throttling outgoing messages

Definition at line 520 of file olsr-routing-protocol.h.

Referenced by QueueMessage(), and SetIpv4().

◆ m_recvSocket

Ptr<Socket> ns3::olsr::RoutingProtocol::m_recvSocket
private

Receiving socket.

Definition at line 816 of file olsr-routing-protocol.h.

Referenced by DoDispose(), and DoInitialize().

◆ m_routingTableAssociation

Ptr<Ipv4StaticRouting> ns3::olsr::RoutingProtocol::m_routingTableAssociation
private

Associations from an Ipv4StaticRouting instance.

Definition at line 177 of file olsr-routing-protocol.h.

Referenced by DoDispose(), and SetRoutingTableAssociation().

◆ m_routingTableChanged

TracedCallback<uint32_t> ns3::olsr::RoutingProtocol::m_routingTableChanged
private

Routing table changes callback.

Definition at line 825 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), and RoutingTableComputation().

◆ m_rxPacketTrace

TracedCallback<const PacketHeader&, const MessageList&> ns3::olsr::RoutingProtocol::m_rxPacketTrace
private

Rx packet trace.

Definition at line 819 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), and RecvOlsr().

◆ m_sendSockets

std::map<Ptr<Socket>, Ipv4InterfaceAddress> ns3::olsr::RoutingProtocol::m_sendSockets
private

Container of sockets and the interfaces they are opened onto.

Definition at line 815 of file olsr-routing-protocol.h.

Referenced by DoDispose(), DoInitialize(), IsMyOwnAddress(), and SendPacket().

◆ m_state

◆ m_table

std::map<Ipv4Address, RoutingTableEntry> ns3::olsr::RoutingProtocol::m_table
private

Data structure for the routing table.

Definition at line 238 of file olsr-routing-protocol.h.

Referenced by AddEntry(), Clear(), DoDispose(), Dump(), GetRoutingTableEntries(), GetSize(), Lookup(), PrintRoutingTable(), RemoveEntry(), and RouteInput().

◆ m_tcInterval

Time ns3::olsr::RoutingProtocol::m_tcInterval
private

TC messages' emission interval.

Definition at line 249 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), and TcTimerExpire().

◆ m_tcTimer

Timer ns3::olsr::RoutingProtocol::m_tcTimer
private

Timer for the TC message.

Definition at line 416 of file olsr-routing-protocol.h.

Referenced by SetIpv4(), and TcTimerExpire().

◆ m_txPacketTrace

TracedCallback<const PacketHeader&, const MessageList&> ns3::olsr::RoutingProtocol::m_txPacketTrace
private

Tx packet trace.

Definition at line 822 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), and SendPacket().

◆ m_uniformRandomVariable

Ptr<UniformRandomVariable> ns3::olsr::RoutingProtocol::m_uniformRandomVariable
private

Provides uniform random variables.

Definition at line 828 of file olsr-routing-protocol.h.

Referenced by RoutingProtocol(), and AssignStreams().

◆ m_willingness

Willingness ns3::olsr::RoutingProtocol::m_willingness
private

Willingness for forwarding packets on behalf of other nodes.

Definition at line 252 of file olsr-routing-protocol.h.

Referenced by GetTypeId(), and SendHello().

◆ OLSR_PORT_NUMBER

const uint16_t ns3::olsr::RoutingProtocol::OLSR_PORT_NUMBER = 698
static

port number (698)

Definition at line 81 of file olsr-routing-protocol.h.

Referenced by DoInitialize(), RecvOlsr(), and SendPacket().


The documentation for this class was generated from the following files: