ns-3
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:

List of all members.

Public Member Functions

void SetMainInterface (uint32_t interface)
 Set the OLSR main address to the first address on the indicated interface.
void Dump (void)
std::vector< RoutingTableEntryGetRoutingTableEntries () const
std::set< uint32_t > GetInterfaceExclusions () const
void SetInterfaceExclusions (std::set< uint32_t > exceptions)
void AddHostNetworkAssociation (Ipv4Address networkAddr, Ipv4Mask netmask)
 Inject Association to be sent in HNA message.
void RemoveHostNetworkAssociation (Ipv4Address networkAddr, Ipv4Mask netmask)
 Removes Association sent in HNA message.
void SetRoutingTableAssociation (Ptr< Ipv4StaticRouting > routingTable)
 Inject Associations from an Ipv4StaticRouting instance.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::olsr::RoutingProtocol.

Protected Member Functions

virtual void DoStart (void)

Friends

class OlsrMprTestCase

Detailed Description

OLSR routing protocol for IPv4.


Member Function Documentation

Inject Association to be sent in HNA message.

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.

References NS_LOG_INFO.

Referenced by SetRoutingTableAssociation().

void ns3::olsr::RoutingProtocol::DoStart ( void  ) [protected, virtual]

This method is called only once by Object::Start. If the user calls Object::Start multiple times, DoStart 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.

References ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), ns3::Ipv4::GetAddress(), ns3::Ipv4::GetNetDevice(), ns3::Ipv4::GetNInterfaces(), ns3::UdpSocketFactory::GetTypeId(), ns3::olsr::IfaceAssocTuple::ifaceAddr, ns3::olsr::IfaceAssocTuple::mainAddr, ns3::MakeCallback(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().

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.

References ns3::Now(), and NS_LOG_DEBUG.

Return the list of routing table entries discovered by OLSR

This method returns the TypeId associated to ns3::olsr::RoutingProtocol.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3::olsr::RoutingProtocol
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::Ipv4RoutingProtocol/$ns3::olsr::RoutingProtocol
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::olsr::RoutingProtocol
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::Ipv4RoutingProtocol/$ns3::olsr::RoutingProtocol
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::olsr::RoutingProtocol

Attributes defined for this type:

  • HelloInterval: HELLO messages emission interval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +2000000000.0ns
    • Flags: construct write read
  • TcInterval: TC messages emission interval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +5000000000.0ns
    • Flags: construct write read
  • MidInterval: MID messages emission interval. Normally it is equal to TcInterval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +5000000000.0ns
    • Flags: construct write read
  • HnaInterval: HNA messages emission interval. Normally it is equal to TcInterval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +5000000000.0ns
    • Flags: construct write read
  • Willingness: Willingness of a node to carry and forward traffic for other nodes.
    • Set with class: ns3::EnumValue
    • Underlying type: never|low|default|high|always
    • Initial value: default
    • Flags: construct write read

TraceSources defined for this type:

  • Rx: Receive OLSR packet.
  • Tx: Send OLSR packet.
  • RoutingTableChanged: The OLSR routing table has changed.

Reimplemented from ns3::Ipv4RoutingProtocol.

References ns3::MakeTraceSourceAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().

Removes Association sent in HNA message.

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()").

References NS_LOG_INFO.

Referenced by SetRoutingTableAssociation().

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

References ns3::Ipv4::GetAddress().

Inject Associations from an Ipv4StaticRouting instance.

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.

References AddHostNetworkAssociation(), ns3::Ipv4RoutingTableEntry::GetDestNetwork(), ns3::Ipv4RoutingTableEntry::GetDestNetworkMask(), ns3::Ipv4StaticRouting::GetNRoutes(), ns3::Ipv4StaticRouting::GetRoute(), NS_LOG_DEBUG, NS_LOG_INFO, and RemoveHostNetworkAssociation().


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