A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
olsr-routing-protocol.cc File Reference
#include "olsr-routing-protocol.h"
#include "ns3/socket-factory.h"
#include "ns3/udp-socket-factory.h"
#include "ns3/simulator.h"
#include "ns3/log.h"
#include "ns3/names.h"
#include "ns3/inet-socket-address.h"
#include "ns3/ipv4-routing-protocol.h"
#include "ns3/ipv4-routing-table-entry.h"
#include "ns3/ipv4-route.h"
#include "ns3/boolean.h"
#include "ns3/uinteger.h"
#include "ns3/enum.h"
#include "ns3/trace-source-accessor.h"
#include "ns3/ipv4-header.h"
+ Include dependency graph for olsr-routing-protocol.cc:

Go to the source code of this file.

Namespaces

 ns3
 Every class exported by the ns3 library is enclosed in the ns3 namespace.
 
 ns3::olsr
 
 ns3::olsr::anonymous_namespace{olsr-routing-protocol.cc}
 

Macros

#define DELAY(time)
 Gets the delay between a given time and the current time. More...
 
#define JITTER   (Seconds (m_uniformRandomVariable->GetValue (0, OLSR_MAXJITTER)))
 Random number between [0-OLSR_MAXJITTER] used to jitter OLSR packet transmission. More...
 
#define NS_LOG_APPEND_CONTEXT   if (GetObject<Node> ()) { std::clog << "[node " << GetObject<Node> ()->GetId () << "] "; }
 Implementation of OLSR agent and related classes. More...
 
#define OLSR_ASYM_LINK   1
 Asymmetric link type. More...
 
#define OLSR_DUP_HOLD_TIME   Seconds (30)
 Dup holding time. More...
 
#define OLSR_HNA_HOLD_TIME   Time (3 * m_hnaInterval)
 HNA holding time. More...
 
#define OLSR_LOST_LINK   3
 Lost link type. More...
 
#define OLSR_MAX_ADDRS   64
 Maximum number of addresses advertised on a message. More...
 
#define OLSR_MAX_HELLOS   12
 Maximum number of hellos per message (4 possible link types * 3 possible nb types). More...
 
#define OLSR_MAX_MSGS   64
 Maximum number of messages per packet. More...
 
#define OLSR_MAX_SEQ_NUM   65535
 Maximum allowed sequence number. More...
 
#define OLSR_MAXJITTER   (m_helloInterval.GetSeconds () / 4)
 Maximum allowed jitter. More...
 
#define OLSR_MID_HOLD_TIME   Time (3 * m_midInterval)
 MID holding time. More...
 
#define OLSR_MPR_NEIGH   2
 Asymmetric neighbor type. More...
 
#define OLSR_NEIGHB_HOLD_TIME   Time (3 * OLSR_REFRESH_INTERVAL)
 Neighbor holding time. More...
 
#define OLSR_NOT_NEIGH   0
 Not neighbor type. More...
 
#define OLSR_PORT_NUMBER   698
 
#define OLSR_REFRESH_INTERVAL   m_helloInterval
 Period at which a node must cite every link and every neighbor. More...
 
#define OLSR_SYM_LINK   2
 Symmetric link type. More...
 
#define OLSR_SYM_NEIGH   1
 Symmetric neighbor type. More...
 
#define OLSR_TOP_HOLD_TIME   Time (3 * m_tcInterval)
 Top holding time. More...
 
#define OLSR_UNSPEC_LINK   0
 Unspecified link type. More...
 
#define OLSR_WILL_ALWAYS   7
 Willingness for forwarding packets from other nodes: always. More...
 
#define OLSR_WILL_DEFAULT   3
 Willingness for forwarding packets from other nodes: medium. More...
 
#define OLSR_WILL_HIGH   6
 Willingness for forwarding packets from other nodes: high. More...
 
#define OLSR_WILL_LOW   1
 Willingness for forwarding packets from other nodes: low. More...
 
#define OLSR_WILL_NEVER   0
 Willingness for forwarding packets from other nodes: never. More...
 

Functions

void ns3::olsr::anonymous_namespace{olsr-routing-protocol.cc}::CoverTwoHopNeighbors (Ipv4Address neighborMainAddr, TwoHopNeighborSet &N2)
 Remove all covered 2-hop neighbors from N2 set. More...
 
 ns3::olsr::NS_LOG_COMPONENT_DEFINE ("OlsrRoutingProtocol")
 

Macro Definition Documentation

#define DELAY (   time)
Value:
(((time) < (Simulator::Now ())) ? Seconds (0.000001) : \
(time - Simulator::Now () + Seconds (0.000001)))
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
Definition: nstime.h:727
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287

Gets the delay between a given time and the current time.

If given time is previous to the current one, then this macro returns a number close to 0. This is used for scheduling events at a certain moment.

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

Referenced by ns3::olsr::RoutingProtocol::AssociationTupleTimerExpire(), ns3::olsr::RoutingProtocol::DupTupleTimerExpire(), ns3::olsr::RoutingProtocol::IfaceAssocTupleTimerExpire(), ns3::NdiscCache::Entry::IsDelay(), ns3::olsr::RoutingProtocol::LinkSensing(), ns3::olsr::RoutingProtocol::LinkTupleTimerExpire(), ns3::NdiscCache::Entry::MarkDelay(), ns3::olsr::RoutingProtocol::MprSelTupleTimerExpire(), ns3::olsr::RoutingProtocol::Nb2hopTupleTimerExpire(), ns3::olsr::RoutingProtocol::PopulateMprSelectorSet(), ns3::olsr::RoutingProtocol::PopulateTwoHopNeighborSet(), ns3::olsr::RoutingProtocol::ProcessHna(), ns3::olsr::RoutingProtocol::ProcessMid(), ns3::olsr::RoutingProtocol::ProcessTc(), and ns3::olsr::RoutingProtocol::TopologyTupleTimerExpire().

#define JITTER   (Seconds (m_uniformRandomVariable->GetValue (0, OLSR_MAXJITTER)))
#define NS_LOG_APPEND_CONTEXT   if (GetObject<Node> ()) { std::clog << "[node " << GetObject<Node> ()->GetId () << "] "; }

Implementation of OLSR agent and related classes.

This is the main file of this software because OLSR's behaviour is implemented here.

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

#define OLSR_ASYM_LINK   1

Asymmetric link type.

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

Referenced by ns3::olsr::RoutingProtocol::LinkSensing(), and ns3::olsr::RoutingProtocol::SendHello().

#define OLSR_DUP_HOLD_TIME   Seconds (30)

Dup holding time.

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

Referenced by ns3::olsr::RoutingProtocol::ForwardDefault().

#define OLSR_HNA_HOLD_TIME   Time (3 * m_hnaInterval)

HNA holding time.

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

Referenced by ns3::olsr::RoutingProtocol::SendHna().

#define OLSR_LOST_LINK   3
#define OLSR_MAX_ADDRS   64

Maximum number of addresses advertised on a message.

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

#define OLSR_MAX_HELLOS   12

Maximum number of hellos per message (4 possible link types * 3 possible nb types).

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

#define OLSR_MAX_MSGS   64

Maximum number of messages per packet.

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

Referenced by ns3::olsr::RoutingProtocol::SendQueuedMessages().

#define OLSR_MAXJITTER   (m_helloInterval.GetSeconds () / 4)

Maximum allowed jitter.

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

#define OLSR_MID_HOLD_TIME   Time (3 * m_midInterval)

MID holding time.

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

Referenced by ns3::olsr::RoutingProtocol::SendMid().

#define OLSR_NEIGHB_HOLD_TIME   Time (3 * OLSR_REFRESH_INTERVAL)

Neighbor holding time.

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

Referenced by ns3::olsr::RoutingProtocol::LinkSensing(), and ns3::olsr::RoutingProtocol::SendHello().

#define OLSR_REFRESH_INTERVAL   m_helloInterval

Period at which a node must cite every link and every neighbor.

We only use this value in order to define OLSR_NEIGHB_HOLD_TIME.

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

#define OLSR_SYM_LINK   2

Symmetric link type.

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

Referenced by ns3::olsr::RoutingProtocol::LinkSensing(), and ns3::olsr::RoutingProtocol::SendHello().

#define OLSR_SYM_NEIGH   1
#define OLSR_TOP_HOLD_TIME   Time (3 * m_tcInterval)

Top holding time.

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

Referenced by ns3::olsr::RoutingProtocol::SendTc().

#define OLSR_UNSPEC_LINK   0

Unspecified link type.

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

Referenced by ns3::olsr::RoutingProtocol::LinkSensing().

#define OLSR_WILL_ALWAYS   7

Willingness for forwarding packets from other nodes: always.

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

Referenced by ns3::olsr::RoutingProtocol::GetTypeId(), and ns3::olsr::RoutingProtocol::MprComputation().

#define OLSR_WILL_DEFAULT   3

Willingness for forwarding packets from other nodes: medium.

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

Referenced by ns3::olsr::RoutingProtocol::GetTypeId(), and ns3::olsr::RoutingProtocol::NeighborLoss().

#define OLSR_WILL_HIGH   6

Willingness for forwarding packets from other nodes: high.

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

Referenced by ns3::olsr::RoutingProtocol::GetTypeId().

#define OLSR_WILL_LOW   1

Willingness for forwarding packets from other nodes: low.

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

Referenced by ns3::olsr::RoutingProtocol::GetTypeId().

#define OLSR_WILL_NEVER   0

Willingness for forwarding packets from other nodes: never.

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

Referenced by ns3::olsr::RoutingProtocol::GetTypeId(), ns3::olsr::RoutingProtocol::MprComputation(), and ns3::olsr::RoutingProtocol::RoutingTableComputation().