OLSR routing protocol for IPv4. More...
#include "olsr-routing-protocol.h"
Public Types | |
typedef void(* | PacketTxRxTracedCallback) (const PacketHeader &header, const MessageList &messages) |
TracedCallback signature for Packet transmit and receive events. More... | |
typedef void(* | TableChangeTracedCallback) (uint32_t size) |
TracedCallback signature for routing table computation. More... | |
Public Types inherited from ns3::Ipv4RoutingProtocol | |
typedef Callback< void, Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrno > | ErrorCallback |
Callback for routing errors (e.g., no route found) More... | |
typedef Callback< void, Ptr< const Packet >, const Ipv4Header &, uint32_t > | LocalDeliverCallback |
Callback for packets to be locally delivered. More... | |
typedef Callback< void, Ptr< Ipv4MulticastRoute >, Ptr< const Packet >, const Ipv4Header & > | MulticastForwardCallback |
Callback for multicast packets to be forwarded. More... | |
typedef Callback< void, Ptr< Ipv4Route >, Ptr< const Packet >, const Ipv4Header & > | UnicastForwardCallback |
Callback for unicast packets to be forwarded. More... | |
Public Member Functions | |
RoutingProtocol (void) | |
virtual | ~RoutingProtocol (void) |
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. More... | |
int64_t | AssignStreams (int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
void | Dump (void) |
Dump the neighbor table, two-hop neighbor table, and routing table to logging output (NS_LOG_DEBUG log level). More... | |
std::set< uint32_t > | GetInterfaceExclusions (void) const |
Get the excluded interfaces. More... | |
virtual NS_DEPRECATED_3_34 Ptr< Ipv4 > | GetIpv4 (void) const |
Ipv4Address | GetMainAddress (Ipv4Address iface_addr) const |
Gets the main address associated with a given interface address. More... | |
const MprSelectorSet & | GetMprSelectors (void) const |
Gets the MPR selectors. More... | |
MprSet | GetMprSet (void) const |
Gets the MPR set. More... | |
const NeighborSet & | GetNeighbors (void) const |
Get the one hop neighbors. More... | |
const OlsrState & | GetOlsrState (void) const |
Gets the underlying OLSR state object. More... | |
Ptr< const Ipv4StaticRouting > | GetRoutingTableAssociation (void) const |
Returns the internal HNA table. More... | |
std::vector< RoutingTableEntry > | GetRoutingTableEntries (void) const |
Get the routing table entries. More... | |
const TopologySet & | GetTopologySet (void) const |
Gets the topology set. More... | |
const TwoHopNeighborSet & | GetTwoHopNeighbors (void) const |
Get the two hop neighbors. More... | |
virtual void | PrintRoutingTable (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const |
Print the Routing Table entries. More... | |
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. More... | |
virtual bool | RouteInput (Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) |
Route an input packet (to be forwarded or locally delivered) More... | |
virtual Ptr< Ipv4Route > | RouteOutput (Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) |
Query routing cache for an existing route, for an outbound packet. More... | |
void | SetInterfaceExclusions (std::set< uint32_t > exceptions) |
Set the interfaces to be excluded. More... | |
virtual void | SetIpv4 (Ptr< Ipv4 > ipv4) |
void | SetMainInterface (uint32_t interface) |
Set the OLSR main address to the first address on the indicated interface. More... | |
void | SetRoutingTableAssociation (Ptr< Ipv4StaticRouting > routingTable) |
Associates the specified Ipv4StaticRouting routing table to the OLSR routing protocol. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Ipv4RoutingProtocol | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Attributes | |
static const uint16_t | OLSR_PORT_NUMBER = 698 |
port number (698) More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
void | AddAssociationTuple (const AssociationTuple &tuple) |
Adds a host network association tuple to the Association Set. More... | |
void | AddDuplicateTuple (const DuplicateTuple &tuple) |
Adds a duplicate tuple to the Duplicate Set. More... | |
void | AddEntry (const Ipv4Address &dest, const Ipv4Address &next, const Ipv4Address &interfaceAddress, uint32_t distance) |
Adds a new entry into the routing table. More... | |
void | AddEntry (const Ipv4Address &dest, const Ipv4Address &next, uint32_t interface, uint32_t distance) |
Adds a new entry into the routing table. More... | |
void | AddIfaceAssocTuple (const IfaceAssocTuple &tuple) |
Adds an interface association tuple to the Interface Association Set. More... | |
void | AddMprSelectorTuple (const MprSelectorTuple &tuple) |
Adds an MPR selector tuple to the MPR Selector Set. More... | |
void | AddNeighborTuple (const NeighborTuple &tuple) |
Adds a neighbor tuple to the Neighbor Set. More... | |
void | AddTopologyTuple (const TopologyTuple &tuple) |
Adds a topology tuple to the Topology Set. More... | |
void | AddTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple) |
Adds a 2-hop neighbor tuple to the 2-hop Neighbor Set. More... | |
void | AssociationTupleTimerExpire (Ipv4Address gatewayAddr, Ipv4Address networkAddr, Ipv4Mask netmask) |
Removes association tuple_ if expired. More... | |
void | Clear (void) |
Clears the routing table and frees the memory assigned to each one of its entries. More... | |
int | Degree (NeighborTuple const &tuple) |
This auxiliary function (defined in RFC 3626) is used for calculating the MPR Set. More... | |
void | DupTupleTimerExpire (Ipv4Address address, uint16_t sequenceNumber) |
Removes tuple if expired. More... | |
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). More... | |
void | ForwardDefault (olsr::MessageHeader olsrMessage, DuplicateTuple *duplicated, const Ipv4Address &localIface, const Ipv4Address &senderAddress) |
OLSR's default forwarding algorithm. More... | |
uint16_t | GetMessageSequenceNumber (void) |
Increments message sequence number and returns the new value. More... | |
uint16_t | GetPacketSequenceNumber (void) |
Increments packet sequence number and returns the new value. More... | |
uint32_t | GetSize (void) const |
Returns the routing table size. More... | |
void | HelloTimerExpire (void) |
Sends a HELLO message and reschedules the HELLO timer. More... | |
void | HnaTimerExpire (void) |
Sends an HNA message (if the node has associated hosts/networks) and reschedules the HNA timer. More... | |
void | IfaceAssocTupleTimerExpire (Ipv4Address ifaceAddr) |
Removes interface association tuple_ if expired. More... | |
void | IncrementAnsn (void) |
Increments the ANSN counter. More... | |
bool | IsMyOwnAddress (const Ipv4Address &a) const |
Check that address is one of my interfaces. More... | |
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). More... | |
void | LinkTupleAdded (const LinkTuple &tuple, uint8_t willingness) |
Adds a link tuple. More... | |
void | LinkTupleTimerExpire (Ipv4Address neighborIfaceAddr) |
Removes tuple_ if expired. More... | |
void | LinkTupleUpdated (const LinkTuple &tuple, uint8_t willingness) |
This function is invoked when a link tuple is updated. More... | |
bool | Lookup (const Ipv4Address &dest, RoutingTableEntry &outEntry) const |
Looks up an entry for the specified destination address. More... | |
void | MidTimerExpire (void) |
Sends a MID message (if the node has more than one interface) and resets the MID timer. More... | |
void | MprComputation (void) |
Computates MPR set of a node following RFC 3626 hints. More... | |
void | MprSelTupleTimerExpire (Ipv4Address mainAddr) |
Removes MPR selector tuple_ if expired. More... | |
void | Nb2hopTupleTimerExpire (Ipv4Address neighborMainAddr, Ipv4Address twoHopNeighborAddr) |
Removes 2_hop neighbor tuple_ if expired. More... | |
void | NeighborLoss (const LinkTuple &tuple) |
Performs all actions needed when a neighbor loss occurs. More... | |
virtual void | NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address) |
virtual void | NotifyInterfaceDown (uint32_t interface) |
virtual void | NotifyInterfaceUp (uint32_t interface) |
virtual void | NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address) |
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). More... | |
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). More... | |
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). More... | |
void | ProcessHello (const olsr::MessageHeader &msg, const Ipv4Address &receiverIface, const Ipv4Address &senderIface) |
Processes a HELLO message following RFC 3626 specification. More... | |
void | ProcessHna (const olsr::MessageHeader &msg, const Ipv4Address &senderIface) |
Processes a HNA message following RFC 3626 specification. More... | |
void | ProcessMid (const olsr::MessageHeader &msg, const Ipv4Address &senderIface) |
Processes a MID message following RFC 3626 specification. More... | |
void | ProcessTc (const olsr::MessageHeader &msg, const Ipv4Address &senderIface) |
Processes a TC message following RFC 3626 specification. More... | |
void | QueueMessage (const olsr::MessageHeader &message, Time delay) |
Enques an OLSR message which will be sent with a delay of (0, delay]. More... | |
void | RecvOlsr (Ptr< Socket > socket) |
Receive an OLSR message. More... | |
void | RemoveAssociationTuple (const AssociationTuple &tuple) |
Removes a host network association tuple to the Association Set. More... | |
void | RemoveDuplicateTuple (const DuplicateTuple &tuple) |
Removes a duplicate tuple from the Duplicate Set. More... | |
void | RemoveEntry (const Ipv4Address &dest) |
Deletes the entry whose destination address is given. More... | |
void | RemoveIfaceAssocTuple (const IfaceAssocTuple &tuple) |
Removed an interface association tuple to the Interface Association Set. More... | |
void | RemoveLinkTuple (const LinkTuple &tuple) |
Removes a link tuple from the Link Set. More... | |
void | RemoveMprSelectorTuple (const MprSelectorTuple &tuple) |
Removes an MPR selector tuple from the MPR Selector Set. More... | |
void | RemoveNeighborTuple (const NeighborTuple &tuple) |
Removes a neighbor tuple from the Neighbor Set. More... | |
void | RemoveTopologyTuple (const TopologyTuple &tuple) |
Removes a topology tuple to the Topology Set. More... | |
void | RemoveTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple) |
Removes a 2-hop neighbor tuple from the 2-hop Neighbor Set. More... | |
void | RoutingTableComputation (void) |
Creates the routing table of the node following RFC 3626 hints. More... | |
void | SendHello (void) |
Creates a new OLSR HELLO message which is buffered for being sent later on. More... | |
void | SendHna (void) |
Creates a new OLSR HNA message which is buffered for being sent later on. More... | |
void | SendMid (void) |
Creates a new OLSR MID message which is buffered for being sent later on. More... | |
void | SendPacket (Ptr< Packet > packet, const MessageList &containedMessages) |
Send an OLSR message. More... | |
void | SendQueuedMessages (void) |
Creates as many OLSR packets as needed in order to send all buffered OLSR messages. More... | |
void | SendTc (void) |
Creates a new OLSR TC message which is buffered for being sent later on. More... | |
void | TcTimerExpire (void) |
Sends a TC message (if there exists any MPR selector) and reschedules the TC timer. More... | |
void | TopologyTupleTimerExpire (Ipv4Address destAddr, Ipv4Address lastAddr) |
Removes topology tuple_ if expired. More... | |
bool | UsesNonOlsrOutgoingInterface (const Ipv4RoutingTableEntry &route) |
Tests whether or not the specified route uses a non-OLSR outgoing interface. More... | |
Private Attributes | |
uint16_t | m_ansn |
Advertised Neighbor Set sequence number. More... | |
EventGarbageCollector | m_events |
Running events. More... | |
Time | m_helloInterval |
HELLO messages' emission interval. More... | |
Timer | m_helloTimer |
Timer for the HELLO message. More... | |
Time | m_hnaInterval |
HNA messages' emission interval. More... | |
Ptr< Ipv4StaticRouting > | m_hnaRoutingTable |
Routing table for HNA routes. More... | |
Timer | m_hnaTimer |
Timer for the HNA message. More... | |
std::set< uint32_t > | m_interfaceExclusions |
Set of interfaces excluded by OSLR. More... | |
Ptr< Ipv4 > | m_ipv4 |
IPv4 object the routing is linked to. More... | |
bool | m_linkTupleTimerFirstTime |
Flag to indicate if it is the first time the LinkTupleTimer fires. More... | |
Ipv4Address | m_mainAddress |
the node main address. More... | |
uint16_t | m_messageSequenceNumber |
Messages sequence number counter. More... | |
Time | m_midInterval |
MID messages' emission interval. More... | |
Timer | m_midTimer |
Timer for the MID message. More... | |
uint16_t | m_packetSequenceNumber |
Packets sequence number counter. More... | |
olsr::MessageList | m_queuedMessages |
A list of pending messages which are buffered awaiting for being sent. More... | |
Timer | m_queuedMessagesTimer |
timer for throttling outgoing messages More... | |
Ptr< Socket > | m_recvSocket |
Receiving socket. More... | |
Ptr< Ipv4StaticRouting > | m_routingTableAssociation |
Associations from an Ipv4StaticRouting instance. More... | |
TracedCallback< uint32_t > | m_routingTableChanged |
Routing table chanes challback. More... | |
TracedCallback< const PacketHeader &, const MessageList & > | m_rxPacketTrace |
Rx packet trace. More... | |
std::map< Ptr< Socket >, Ipv4InterfaceAddress > | m_sendSockets |
Container of sockets and the interfaces they are opened onto. More... | |
OlsrState | m_state |
Internal state with all needed data structs. More... | |
std::map< Ipv4Address, RoutingTableEntry > | m_table |
Data structure for the routing table. More... | |
Time | m_tcInterval |
TC messages' emission interval. More... | |
Timer | m_tcTimer |
Timer for the TC message. More... | |
TracedCallback< const PacketHeader &, const MessageList & > | m_txPacketTrace |
Tx packet trace. More... | |
Ptr< UniformRandomVariable > | m_uniformRandomVariable |
Provides uniform random variables. More... | |
uint8_t | m_willingness |
Willingness for forwarding packets on behalf of other nodes. More... | |
Friends | |
class | ::OlsrMprTestCase |
Declared friend to enable unit tests. More... | |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
OLSR routing protocol for IPv4.
ns3::olsr::RoutingProtocol is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 992 bytes (on a 64-bit architecture).
Definition at line 80 of file olsr-routing-protocol.h.
typedef void(* ns3::olsr::RoutingProtocol::PacketTxRxTracedCallback) (const PacketHeader &header, const MessageList &messages) |
TracedCallback signature for Packet transmit and receive events.
[in] | header | |
[in] | messages |
Definition at line 171 of file olsr-routing-protocol.h.
typedef void(* ns3::olsr::RoutingProtocol::TableChangeTracedCallback) (uint32_t size) |
TracedCallback signature for routing table computation.
[in] | size | Final routing table size. |
Definition at line 178 of file olsr-routing-protocol.h.
ns3::olsr::RoutingProtocol::RoutingProtocol | ( | void | ) |
Definition at line 200 of file olsr-routing-protocol.cc.
References m_hnaRoutingTable, and m_uniformRandomVariable.
|
virtual |
Definition at line 214 of file olsr-routing-protocol.cc.
|
private |
Adds a host network association tuple to the Association Set.
tuple | The host network association tuple to be added. |
Definition at line 2614 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::InsertAssociationTuple(), and m_state.
Referenced by ProcessHna().
|
private |
Adds a duplicate tuple to the Duplicate Set.
tuple | The duplicate tuple to be added. |
Definition at line 2375 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::InsertDuplicateTuple(), and m_state.
Referenced by ForwardDefault().
|
private |
Adds a new entry into the routing table.
If an entry for the given destination existed, an error is thrown.
dest | address of the destination node. |
next | address of the next hop node. |
interfaceAddress | address of the local interface. |
distance | distance to the destination node. |
Definition at line 3110 of file olsr-routing-protocol.cc.
References AddEntry(), m_ipv4, m_mainAddress, NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
Adds a new entry into the routing table.
If an entry for the given destination existed, it is deleted and freed.
dest | address of the destination node. |
next | address of the next hop node. |
interface | address of the local interface. |
distance | distance to the destination node. |
Definition at line 3091 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().
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.
networkAddr | The network address. |
netmask | The network mask. |
Definition at line 1916 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().
|
private |
Adds an interface association tuple to the Interface Association Set.
tuple | The interface association tuple to be added. |
Definition at line 2590 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::InsertIfaceAssocTuple(), and m_state.
Referenced by DoInitialize(), and ProcessMid().
|
private |
Adds an MPR selector tuple to the MPR Selector Set.
Advertised Neighbor Sequence Number (ANSN) is also updated.
tuple | The MPR selector tuple to be added. |
Definition at line 2540 of file olsr-routing-protocol.cc.
References IncrementAnsn(), ns3::olsr::OlsrState::InsertMprSelectorTuple(), and m_state.
Referenced by PopulateMprSelectorSet().
|
private |
Adds a neighbor tuple to the Neighbor Set.
tuple | The neighbor tuple to be added. |
Definition at line 2484 of file olsr-routing-protocol.cc.
References IncrementAnsn(), ns3::olsr::OlsrState::InsertNeighborTuple(), and m_state.
Referenced by LinkTupleAdded().
|
private |
Adds a topology tuple to the Topology Set.
tuple | The topology tuple to be added. |
Definition at line 2564 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::InsertTopologyTuple(), and m_state.
Referenced by ProcessTc().
|
private |
Adds a 2-hop neighbor tuple to the 2-hop Neighbor Set.
tuple | The 2-hop neighbor tuple to be added. |
Definition at line 2510 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::InsertTwoHopNeighborTuple(), and m_state.
Referenced by PopulateTwoHopNeighborSet().
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.
stream | first stream index to use |
Definition at line 3186 of file olsr-routing-protocol.cc.
References m_uniformRandomVariable, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
private |
Removes association tuple_ if expired.
Else timer is rescheduled to expire at tuple_->time().
gatewayAddr | The gateway address. |
networkAddr | The network address. |
netmask | The network mask. |
Definition at line 2820 of file olsr-routing-protocol.cc.
References 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 ProcessHna().
|
private |
Clears the routing table and frees the memory assigned to each one of its entries.
Definition at line 2840 of file olsr-routing-protocol.cc.
References m_table, and NS_LOG_FUNCTION_NOARGS.
Referenced by RoutingTableComputation().
|
private |
This auxiliary function (defined in RFC 3626) is used for calculating the MPR Set.
tuple | the neighbor tuple which has the main address of the node we are going to calculate its degree to. |
Definition at line 609 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().
|
protectedvirtual |
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 247 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.
|
protectedvirtual |
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 322 of file olsr-routing-protocol.cc.
References AddIfaceAssocTuple(), ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), ns3::Ipv4Address::GetAny(), GetMainAddress(), 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::SetIpTtl(), ns3::Socket::SetRecvCallback(), ns3::Socket::SetRecvPktInfo(), ns3::Socket::ShutdownSend(), and TcTimerExpire().
void ns3::olsr::RoutingProtocol::Dump | ( | void | ) |
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 3209 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.
|
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.
address | The address of the tuple. |
sequenceNumber | The sequence number of the tuple. |
Definition at line 2680 of file olsr-routing-protocol.cc.
References first::address, DELAY, 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 ForwardDefault().
|
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.
[in] | entry | The routing table entry which indicates the destination node we are interested in. |
[out] | outEntry | The 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. |
Definition at line 2869 of file olsr-routing-protocol.cc.
References ns3::olsr::RoutingTableEntry::destAddr, Lookup(), and ns3::olsr::RoutingTableEntry::nextAddr.
Referenced by RouteInput(), and RouteOutput().
|
private |
OLSR's default forwarding algorithm.
See RFC 3626 for details.
olsrMessage | The OLSR message which must be forwarded. |
duplicated | NULL if the message has never been considered for forwarding, or a duplicate tuple in other case. |
localIface | The address of the interface where the message was received from. |
senderAddress | The sender IPv4 address. |
Definition at line 1566 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().
|
inline |
Get the excluded interfaces.
Definition at line 189 of file olsr-routing-protocol.h.
References m_interfaceExclusions.
Definition at line 242 of file olsr-routing-protocol.cc.
References m_ipv4.
Ipv4Address ns3::olsr::RoutingProtocol::GetMainAddress | ( | Ipv4Address | iface_addr | ) | const |
Gets the main address associated with a given interface address.
iface_addr | the interface address. |
Definition at line 960 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().
|
inlineprivate |
Increments message sequence number and returns the new value.
Definition at line 2631 of file olsr-routing-protocol.cc.
References m_messageSequenceNumber, and OLSR_MAX_SEQ_NUM.
Referenced by SendHello(), SendHna(), SendMid(), and SendTc().
const MprSelectorSet & ns3::olsr::RoutingProtocol::GetMprSelectors | ( | void | ) | const |
Gets the MPR selectors.
Definition at line 3156 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::GetMprSelectors(), and m_state.
MprSet ns3::olsr::RoutingProtocol::GetMprSet | ( | void | ) | const |
Gets the MPR set.
Definition at line 3150 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::GetMprSet(), and m_state.
const NeighborSet & ns3::olsr::RoutingProtocol::GetNeighbors | ( | void | ) | const |
Get the one hop neighbors.
Definition at line 3162 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::GetNeighbors(), and m_state.
const OlsrState & ns3::olsr::RoutingProtocol::GetOlsrState | ( | void | ) | const |
Gets the underlying OLSR state object.
Definition at line 3180 of file olsr-routing-protocol.cc.
References m_state.
|
inlineprivate |
Increments packet sequence number and returns the new value.
Definition at line 2625 of file olsr-routing-protocol.cc.
References m_packetSequenceNumber, and OLSR_MAX_SEQ_NUM.
Referenced by SendPacket().
Ptr< const Ipv4StaticRouting > ns3::olsr::RoutingProtocol::GetRoutingTableAssociation | ( | void | ) | const |
Returns the internal HNA table.
Definition at line 3239 of file olsr-routing-protocol.cc.
References m_hnaRoutingTable.
std::vector< RoutingTableEntry > ns3::olsr::RoutingProtocol::GetRoutingTableEntries | ( | void | ) | const |
Get the routing table entries.
Definition at line 3138 of file olsr-routing-protocol.cc.
References m_table.
|
inlineprivate |
Returns the routing table size.
Definition at line 271 of file olsr-routing-protocol.h.
References m_table.
Referenced by RoutingTableComputation().
const TopologySet & ns3::olsr::RoutingProtocol::GetTopologySet | ( | void | ) | const |
Gets the topology set.
Definition at line 3174 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::GetTopologySet(), and m_state.
const TwoHopNeighborSet & ns3::olsr::RoutingProtocol::GetTwoHopNeighbors | ( | void | ) | const |
Get the two hop neighbors.
Definition at line 3168 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::GetTwoHopNeighbors(), and m_state.
|
static |
Get the type ID.
Definition at line 156 of file olsr-routing-protocol.cc.
References 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(), OLSR_WILL_ALWAYS, OLSR_WILL_DEFAULT, OLSR_WILL_HIGH, OLSR_WILL_LOW, OLSR_WILL_NEVER, ns3::Seconds(), and ns3::TypeId::SetParent().
|
private |
Sends a HELLO message and reschedules the HELLO timer.
Definition at line 2638 of file olsr-routing-protocol.cc.
References m_helloInterval, m_helloTimer, ns3::Timer::Schedule(), and SendHello().
Referenced by DoInitialize(), and SetIpv4().
|
private |
Sends an HNA message (if the node has associated hosts/networks) and reschedules the HNA timer.
Definition at line 2666 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().
|
private |
Removes interface association tuple_ if expired.
Else the timer is rescheduled to expire at tuple_->time().
ifaceAddr | The interface address. |
Definition at line 2800 of file olsr-routing-protocol.cc.
References DELAY, ns3::olsr::OlsrState::FindIfaceAssocTuple(), m_events, m_state, ns3::Simulator::Now(), RemoveIfaceAssocTuple(), ns3::Simulator::Schedule(), ns3::olsr::IfaceAssocTuple::time, and ns3::EventGarbageCollector::Track().
Referenced by ProcessMid().
|
private |
Increments the ANSN counter.
Definition at line 2534 of file olsr-routing-protocol.cc.
References m_ansn, and OLSR_MAX_SEQ_NUM.
Referenced by AddMprSelectorTuple(), AddNeighborTuple(), RemoveMprSelectorTuple(), and RemoveNeighborTuple().
|
private |
Check that address is one of my interfaces.
a | the address to check. |
Definition at line 3194 of file olsr-routing-protocol.cc.
References ns3::Ipv4InterfaceAddress::GetLocal(), and m_sendSockets.
Referenced by RouteInput().
|
private |
Updates Link Set according to a new received HELLO message (following RFC 3626 specification).
Neighbor Set is also updated if needed.
msg | The received message. |
hello | The received HELLO sub-message. |
receiverIface | The interface that received the message. |
senderIface | The sender interface. |
Definition at line 1998 of file olsr-routing-protocol.cc.
References ns3::Time::As(), ns3::olsr::LinkTuple::asymTime, DELAY, ns3::olsr::OlsrState::FindLinkTuple(), ns3::olsr::MessageHeader::GetVTime(), ns3::olsr::OlsrState::InsertLinkTuple(), ns3::olsr::MessageHeader::Hello::linkMessages, LinkTupleAdded(), LinkTupleTimerExpire(), LinkTupleUpdated(), ns3::olsr::LinkTuple::localIfaceAddr, m_events, m_mainAddress, m_state, max, min, ns3::olsr::LinkTuple::neighborIfaceAddr, ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_LOGIC, OLSR_ASYM_LINK, OLSR_LOST_LINK, OLSR_MPR_NEIGH, OLSR_NEIGHB_HOLD_TIME, OLSR_NOT_NEIGH, OLSR_SYM_LINK, OLSR_SYM_NEIGH, OLSR_UNSPEC_LINK, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::olsr::LinkTuple::symTime, ns3::olsr::LinkTuple::time, ns3::EventGarbageCollector::Track(), and ns3::olsr::MessageHeader::Hello::willingness.
Referenced by ProcessHello().
|
private |
Adds a link tuple.
tuple | Thetuple to be added. |
willingness | The tuple willingness. |
Definition at line 2397 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().
|
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.
neighborIfaceAddr | The tuple neighbor interface address. |
Definition at line 2701 of file olsr-routing-protocol.cc.
References DELAY, ns3::olsr::OlsrState::FindLinkTuple(), m_events, m_linkTupleTimerFirstTime, m_state, min, NeighborLoss(), ns3::Simulator::Now(), RemoveLinkTuple(), ns3::Simulator::Schedule(), ns3::olsr::LinkTuple::symTime, ns3::olsr::LinkTuple::time, and ns3::EventGarbageCollector::Track().
Referenced by LinkSensing().
|
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.
tuple | The link tuple which has been updated. |
willingness | The tuple willingness. |
Definition at line 2428 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().
|
private |
Looks up an entry for the specified destination address.
[in] | dest | Destination address. |
[out] | outEntry | Holds the routing entry result, if found. |
Definition at line 2853 of file olsr-routing-protocol.cc.
References m_table.
Referenced by FindSendEntry(), RouteInput(), RouteOutput(), and RoutingTableComputation().
|
private |
Sends a MID message (if the node has more than one interface) and resets the MID timer.
Definition at line 2659 of file olsr-routing-protocol.cc.
References m_midInterval, m_midTimer, ns3::Timer::Schedule(), and SendMid().
Referenced by DoInitialize(), and SetIpv4().
|
private |
Computates MPR set of a node following RFC 3626 hints.
Definition at line 665 of file olsr-routing-protocol.cc.
References ns3::olsr::anonymous_namespace{olsr-routing-protocol.cc}::CoverTwoHopNeighbors(), Degree(), ns3::olsr::OlsrState::GetNeighbors(), ns3::olsr::OlsrState::GetTwoHopNeighbors(), m_mainAddress, m_state, max, ns3::olsr::NeighborTuple::neighborMainAddr, ns3::olsr::TwoHopNeighborTuple::neighborMainAddr, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, OLSR_WILL_ALWAYS, OLSR_WILL_NEVER, ns3::olsr::OlsrState::SetMprSet(), ns3::olsr::NeighborTuple::STATUS_SYM, and ns3::olsr::NeighborTuple::willingness.
Referenced by NeighborLoss(), and ProcessHello().
|
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.
mainAddr | The tuple IPv4 address. |
Definition at line 2760 of file olsr-routing-protocol.cc.
References DELAY, ns3::olsr::MprSelectorTuple::expirationTime, ns3::olsr::OlsrState::FindMprSelectorTuple(), m_events, m_state, ns3::Simulator::Now(), RemoveMprSelectorTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().
Referenced by PopulateMprSelectorSet().
|
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.
neighborMainAddr | The neighbor main address. |
twoHopNeighborAddr | The 2-hop neighbor address. |
Definition at line 2739 of file olsr-routing-protocol.cc.
References DELAY, ns3::olsr::TwoHopNeighborTuple::expirationTime, ns3::olsr::OlsrState::FindTwoHopNeighborTuple(), m_events, m_state, ns3::Simulator::Now(), RemoveTwoHopNeighborTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().
Referenced by PopulateTwoHopNeighborSet().
|
private |
Performs all actions needed when a neighbor loss occurs.
Neighbor Set, 2-hop Neighbor Set, MPR Set and MPR Selector Set are updated.
tuple | link tuple with the information of the link to the neighbor which has been lost. |
Definition at line 2361 of file olsr-routing-protocol.cc.
References 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, OLSR_WILL_DEFAULT, RoutingTableComputation(), and ns3::Time::S.
Referenced by LinkTupleTimerExpire().
|
privatevirtual |
interface | the index of the interface we are being notified about |
address | a 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 3081 of file olsr-routing-protocol.cc.
|
privatevirtual |
interface | the 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 3077 of file olsr-routing-protocol.cc.
|
privatevirtual |
interface | the 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 3073 of file olsr-routing-protocol.cc.
|
privatevirtual |
interface | the index of the interface we are being notified about |
address | a 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 3085 of file olsr-routing-protocol.cc.
|
private |
Updates the MPR Selector Set according to the information contained in a new received HELLO message (following RFC 3626).
msg | The received message. |
hello | The received HELLO sub-message. |
Definition at line 2265 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, MprSelTupleTimerExpire(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, OLSR_MPR_NEIGH, ns3::olsr::OlsrState::PrintMprSelectorSet(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().
Referenced by ProcessHello().
|
private |
Updates the Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626).
msg | The received message. |
hello | The received HELLO sub-message. |
Definition at line 2147 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().
|
private |
Updates the 2-hop Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626).
msg | The received message. |
hello | The received HELLO sub-message. |
Definition at line 2158 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, Nb2hopTupleTimerExpire(), ns3::olsr::TwoHopNeighborTuple::neighborMainAddr, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, OLSR_MPR_NEIGH, OLSR_NOT_NEIGH, OLSR_SYM_NEIGH, ns3::Simulator::Schedule(), ns3::EventGarbageCollector::Track(), and ns3::olsr::TwoHopNeighborTuple::twoHopNeighborAddr.
Referenced by ProcessHello().
|
virtual |
Print the Routing Table entries.
stream | The ostream the Routing table is printed to |
unit | The time unit to be used in the report |
Implements ns3::Ipv4RoutingProtocol.
Definition at line 271 of file olsr-routing-protocol.cc.
References ns3::Time::As(), ns3::Names::FindName(), ns3::OutputStreamWrapper::GetStream(), m_hnaRoutingTable, m_ipv4, m_table, and ns3::Now().
|
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.
msg | the OLSR message which contains the HELLO message. |
receiverIface | the address of the interface where the message was received from. |
senderIface | the address of the interface where the message was sent from. |
Definition at line 1293 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().
|
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.
msg | the OLSR message which contains the HNA message. |
senderIface | the address of the interface where the message was sent from. |
Definition at line 1507 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().
|
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.
msg | the OLSR message which contains the MID message. |
senderIface | the address of the interface where the message was sent from. |
Definition at line 1437 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().
|
private |
Processes a TC message following RFC 3626 specification.
The Topology Set is updated (if needed) with the information of the received TC message.
msg | The OLSR message which contains the TC message. |
senderIface | The address of the interface where the message was sent from. |
Definition at line 1347 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().
|
private |
Enques 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.
message | the OLSR message which must be sent. |
delay | maximum delay the OLSR message is going to be buffered. |
Definition at line 1634 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().
Receive an OLSR message.
socket | The receiving socket. |
Definition at line 429 of file olsr-routing-protocol.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::olsr::OlsrState::FindDuplicateTuple(), ForwardDefault(), ns3::Node::GetDevice(), ns3::InetSocketAddress::GetIpv4(), ns3::olsr::MessageHeader::GetMessageSequenceNumber(), ns3::olsr::MessageHeader::GetMessageType(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::PacketHeader::GetPacketLength(), ns3::InetSocketAddress::GetPort(), ns3::Ipv4PacketInfoTag::GetRecvIf(), ns3::olsr::PacketHeader::GetSerializedSize(), ns3::olsr::MessageHeader::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(), ns3::Socket::RecvFrom(), ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), RoutingTableComputation(), ns3::Time::S, and ns3::olsr::MessageHeader::TC_MESSAGE.
Referenced by DoInitialize().
|
private |
Removes a host network association tuple to the Association Set.
tuple | The host network association tuple to be removed. |
Definition at line 2620 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseAssociationTuple(), and m_state.
Referenced by AssociationTupleTimerExpire().
|
private |
Removes a duplicate tuple from the Duplicate Set.
tuple | The duplicate tuple to be removed. |
Definition at line 2386 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseDuplicateTuple(), and m_state.
Referenced by DupTupleTimerExpire().
|
private |
Deletes the entry whose destination address is given.
dest | address of the destination node. |
Definition at line 2847 of file olsr-routing-protocol.cc.
References m_table.
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()").
networkAddr | The network address. |
netmask | The network mask. |
Definition at line 1937 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseAssociation(), m_state, and NS_LOG_INFO.
Referenced by SetRoutingTableAssociation().
|
private |
Removed an interface association tuple to the Interface Association Set.
tuple | The interface association tuple to be removed. |
Definition at line 2602 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseIfaceAssocTuple(), and m_state.
Referenced by IfaceAssocTupleTimerExpire().
|
private |
Removes a link tuple from the Link Set.
tuple | The link tuple to be removed. |
Definition at line 2417 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().
|
private |
Removes an MPR selector tuple from the MPR Selector Set.
Advertised Neighbor Sequence Number (ANSN) is also updated.
tuple | The MPR selector tuple to be removed. |
Definition at line 2552 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseMprSelectorTuple(), IncrementAnsn(), and m_state.
Referenced by MprSelTupleTimerExpire().
|
private |
Removes a neighbor tuple from the Neighbor Set.
tuple | The neighbor tuple to be removed. |
Definition at line 2497 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseNeighborTuple(), IncrementAnsn(), and m_state.
|
private |
Removes a topology tuple to the Topology Set.
tuple | The topology tuple to be removed. |
Definition at line 2577 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseTopologyTuple(), and m_state.
Referenced by TopologyTupleTimerExpire().
|
private |
Removes a 2-hop neighbor tuple from the 2-hop Neighbor Set.
tuple | The 2-hop neighbor tuple to be removed. |
Definition at line 2522 of file olsr-routing-protocol.cc.
References ns3::olsr::OlsrState::EraseTwoHopNeighborTuple(), and m_state.
Referenced by Nb2hopTupleTimerExpire().
|
virtual |
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.
p | received packet |
header | input parameter used to form a search key for a route |
idev | Pointer to ingress network device |
ucb | Callback for the case in which the packet is to be forwarded as unicast |
mcb | Callback for the case in which the packet is to be forwarded as multicast |
lcb | Callback for the case in which the packet is to be locally delivered |
ecb | Callback to call if there is an error in forwarding |
Implements ns3::Ipv4RoutingProtocol.
Definition at line 2962 of file olsr-routing-protocol.cc.
References FindSendEntry(), ns3::Ipv4Header::GetDestination(), ns3::Node::GetId(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4Header::GetSource(), ns3::olsr::RoutingTableEntry::interface, IsMyOwnAddress(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::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.
|
virtual |
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.
p | packet to be routed. Note that this method may modify the packet. Callers may also pass in a null pointer. |
header | input parameter (used to form key to search for the route) |
oif | Output interface Netdevice. May be zero, or may be bound via socket options to a particular output interface. |
sockerr | Output parameter; socket errno |
Implements ns3::Ipv4RoutingProtocol.
Definition at line 2884 of file olsr-routing-protocol.cc.
References ns3::Socket::ERROR_NOROUTETOHOST, ns3::Socket::ERROR_NOTERROR, FindSendEntry(), ns3::Ipv4Header::GetDestination(), ns3::Node::GetId(), ns3::Ipv4InterfaceAddress::GetLocal(), 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.
|
private |
Creates the routing table of the node following RFC 3626 hints.
Definition at line 976 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::RoutingTableEntry::nextAddr, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, OLSR_WILL_NEVER, 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().
|
private |
Creates a new OLSR HELLO message which is buffered for being sent later on.
Definition at line 1706 of file olsr-routing-protocol.cc.
References 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(), first::interfaces, JITTER, ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode, ns3::olsr::MessageHeader::Hello::linkMessages, m_helloInterval, m_mainAddress, m_state, m_willingness, ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses, ns3::Simulator::Now(), NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, OLSR_ASYM_LINK, OLSR_LOST_LINK, OLSR_MPR_NEIGH, OLSR_NEIGHB_HOLD_TIME, OLSR_NOT_NEIGH, OLSR_SYM_LINK, OLSR_SYM_NEIGH, 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, and ns3::olsr::MessageHeader::Hello::willingness.
Referenced by HelloTimerExpire().
|
private |
Creates a new OLSR HNA message which is buffered for being sent later on.
Definition at line 1883 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().
|
private |
Creates a new OLSR MID message which is buffered for being sent later on.
Definition at line 1838 of file olsr-routing-protocol.cc.
References GetMessageSequenceNumber(), ns3::olsr::MessageHeader::GetMid(), 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().
|
private |
Send an OLSR message.
packet | The packet to be sent. |
containedMessages | The messages contained in the packet. |
Definition at line 1645 of file olsr-routing-protocol.cc.
References ns3::Packet::AddHeader(), ns3::Packet::Copy(), GetPacketSequenceNumber(), ns3::olsr::PacketHeader::GetSerializedSize(), ns3::Packet::GetSize(), 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().
|
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 1670 of file olsr-routing-protocol.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::AddHeader(), ns3::Packet::GetSize(), m_mainAddress, m_queuedMessages, NS_LOG_DEBUG, OLSR_MAX_MSGS, and SendPacket().
Referenced by SetIpv4().
|
private |
Creates a new OLSR TC message which is buffered for being sent later on.
Definition at line 1814 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().
void ns3::olsr::RoutingProtocol::SetInterfaceExclusions | ( | std::set< uint32_t > | exceptions | ) |
Set the interfaces to be excluded.
exceptions | Container of excluded interfaces. |
Definition at line 421 of file olsr-routing-protocol.cc.
References m_interfaceExclusions.
ipv4 | the ipv4 object this routing protocol is being associated with |
Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol
Implements ns3::Ipv4RoutingProtocol.
Definition at line 219 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().
void ns3::olsr::RoutingProtocol::SetMainInterface | ( | uint32_t | interface | ) |
Set the OLSR main address to the first address on the indicated interface.
interface | IPv4 interface index |
Definition at line 416 of file olsr-routing-protocol.cc.
References m_ipv4, and m_mainAddress.
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.
routingTable | the Ipv4StaticRouting routing table to be associated. |
Definition at line 1944 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().
|
private |
Sends a TC message (if there exists any MPR selector) and reschedules the TC timer.
Definition at line 2645 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().
|
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.
destAddr | The destination address. |
lastAddr | The last address. |
Definition at line 2780 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(), and ns3::EventGarbageCollector::Track().
Referenced by ProcessTc().
|
private |
Tests whether or not the specified route uses a non-OLSR outgoing interface.
route | The route to be tested. |
Definition at line 1989 of file olsr-routing-protocol.cc.
References ns3::Ipv4RoutingTableEntry::GetInterface(), and m_interfaceExclusions.
Referenced by SetRoutingTableAssociation().
|
friend |
Declared friend to enable unit tests.
Definition at line 86 of file olsr-routing-protocol.h.
|
private |
Advertised Neighbor Set sequence number.
Definition at line 251 of file olsr-routing-protocol.h.
Referenced by IncrementAnsn(), SendTc(), and SetIpv4().
|
private |
Running events.
Definition at line 247 of file olsr-routing-protocol.h.
Referenced by AssociationTupleTimerExpire(), DupTupleTimerExpire(), IfaceAssocTupleTimerExpire(), LinkSensing(), LinkTupleTimerExpire(), MprSelTupleTimerExpire(), Nb2hopTupleTimerExpire(), PopulateMprSelectorSet(), PopulateTwoHopNeighborSet(), ProcessTc(), and TopologyTupleTimerExpire().
|
private |
HELLO messages' emission interval.
Definition at line 253 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), HelloTimerExpire(), and SendHello().
|
private |
Timer for the HELLO message.
Definition at line 421 of file olsr-routing-protocol.h.
Referenced by HelloTimerExpire(), and SetIpv4().
|
private |
HNA messages' emission interval.
Definition at line 256 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), and HnaTimerExpire().
|
private |
Routing table for HNA routes.
Definition at line 245 of file olsr-routing-protocol.h.
Referenced by RoutingProtocol(), DoDispose(), GetRoutingTableAssociation(), PrintRoutingTable(), RouteInput(), RouteOutput(), RoutingTableComputation(), and SetIpv4().
|
private |
Timer for the HNA message.
Definition at line 439 of file olsr-routing-protocol.h.
Referenced by HnaTimerExpire(), and SetIpv4().
|
private |
Set of interfaces excluded by OSLR.
Definition at line 181 of file olsr-routing-protocol.h.
Referenced by DoInitialize(), GetInterfaceExclusions(), RecvOlsr(), SendMid(), SetInterfaceExclusions(), and UsesNonOlsrOutgoingInterface().
IPv4 object the routing is linked to.
Definition at line 260 of file olsr-routing-protocol.h.
Referenced by AddEntry(), DoDispose(), DoInitialize(), GetIpv4(), PrintRoutingTable(), RecvOlsr(), RouteInput(), RouteOutput(), SendMid(), SetIpv4(), and SetMainInterface().
|
private |
Flag to indicate if it is the first time the LinkTupleTimer fires.
Definition at line 455 of file olsr-routing-protocol.h.
Referenced by LinkTupleTimerExpire(), and SetIpv4().
|
private |
the node main address.
Definition at line 812 of file olsr-routing-protocol.h.
Referenced by AddEntry(), DoInitialize(), Dump(), ForwardDefault(), LinkSensing(), LinkTupleUpdated(), MprComputation(), NeighborLoss(), PopulateMprSelectorSet(), PopulateTwoHopNeighborSet(), ProcessHello(), ProcessMid(), ProcessTc(), RecvOlsr(), RemoveLinkTuple(), RouteInput(), RouteOutput(), RoutingTableComputation(), SendHello(), SendHna(), SendMid(), SendPacket(), SendQueuedMessages(), SendTc(), and SetMainInterface().
|
private |
Messages sequence number counter.
Definition at line 250 of file olsr-routing-protocol.h.
Referenced by GetMessageSequenceNumber(), and SetIpv4().
|
private |
MID messages' emission interval.
Definition at line 255 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), and MidTimerExpire().
|
private |
Timer for the MID message.
Definition at line 433 of file olsr-routing-protocol.h.
Referenced by MidTimerExpire(), and SetIpv4().
|
private |
Packets sequence number counter.
Definition at line 249 of file olsr-routing-protocol.h.
Referenced by GetPacketSequenceNumber(), and SetIpv4().
|
private |
A list of pending messages which are buffered awaiting for being sent.
Definition at line 520 of file olsr-routing-protocol.h.
Referenced by QueueMessage(), and SendQueuedMessages().
|
private |
timer for throttling outgoing messages
Definition at line 521 of file olsr-routing-protocol.h.
Referenced by QueueMessage(), and SetIpv4().
Receiving socket.
Definition at line 818 of file olsr-routing-protocol.h.
Referenced by DoDispose(), and DoInitialize().
|
private |
Associations from an Ipv4StaticRouting instance.
Definition at line 182 of file olsr-routing-protocol.h.
Referenced by DoDispose(), and SetRoutingTableAssociation().
|
private |
Routing table chanes challback.
Definition at line 828 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), and RoutingTableComputation().
|
private |
Rx packet trace.
Definition at line 822 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), and RecvOlsr().
|
private |
Container of sockets and the interfaces they are opened onto.
Definition at line 817 of file olsr-routing-protocol.h.
Referenced by DoDispose(), DoInitialize(), IsMyOwnAddress(), and SendPacket().
|
private |
Internal state with all needed data structs.
Definition at line 259 of file olsr-routing-protocol.h.
Referenced by AddAssociationTuple(), AddDuplicateTuple(), AddHostNetworkAssociation(), AddIfaceAssocTuple(), AddMprSelectorTuple(), AddNeighborTuple(), AddTopologyTuple(), AddTwoHopNeighborTuple(), AssociationTupleTimerExpire(), Degree(), Dump(), DupTupleTimerExpire(), ForwardDefault(), GetMainAddress(), GetMprSelectors(), GetMprSet(), GetNeighbors(), GetOlsrState(), GetTopologySet(), GetTwoHopNeighbors(), HnaTimerExpire(), IfaceAssocTupleTimerExpire(), LinkSensing(), LinkTupleTimerExpire(), LinkTupleUpdated(), MprComputation(), MprSelTupleTimerExpire(), Nb2hopTupleTimerExpire(), NeighborLoss(), PopulateMprSelectorSet(), PopulateNeighborSet(), PopulateTwoHopNeighborSet(), ProcessHello(), ProcessHna(), ProcessMid(), ProcessTc(), RecvOlsr(), RemoveAssociationTuple(), RemoveDuplicateTuple(), RemoveHostNetworkAssociation(), RemoveIfaceAssocTuple(), RemoveLinkTuple(), RemoveMprSelectorTuple(), RemoveNeighborTuple(), RemoveTopologyTuple(), RemoveTwoHopNeighborTuple(), RoutingTableComputation(), SendHello(), SendHna(), SendTc(), SetRoutingTableAssociation(), TcTimerExpire(), and TopologyTupleTimerExpire().
|
private |
Data structure for the routing table.
Definition at line 243 of file olsr-routing-protocol.h.
Referenced by AddEntry(), Clear(), DoDispose(), Dump(), GetRoutingTableEntries(), GetSize(), Lookup(), PrintRoutingTable(), RemoveEntry(), and RouteInput().
|
private |
TC messages' emission interval.
Definition at line 254 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), and TcTimerExpire().
|
private |
Timer for the TC message.
Definition at line 427 of file olsr-routing-protocol.h.
Referenced by SetIpv4(), and TcTimerExpire().
|
private |
Tx packet trace.
Definition at line 825 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), and SendPacket().
|
private |
Provides uniform random variables.
Definition at line 831 of file olsr-routing-protocol.h.
Referenced by RoutingProtocol(), and AssignStreams().
|
private |
Willingness for forwarding packets on behalf of other nodes.
Definition at line 257 of file olsr-routing-protocol.h.
Referenced by GetTypeId(), and SendHello().
|
static |
port number (698)
Definition at line 88 of file olsr-routing-protocol.h.
Referenced by DoInitialize(), RecvOlsr(), and SendPacket().