#include "olsr-routing-protocol.h"
#include "olsr-repositories.h"
#include "ns3/boolean.h"
#include "ns3/enum.h"
#include "ns3/inet-socket-address.h"
#include "ns3/ipv4-header.h"
#include "ns3/ipv4-packet-info-tag.h"
#include "ns3/ipv4-route.h"
#include "ns3/ipv4-routing-protocol.h"
#include "ns3/ipv4-routing-table-entry.h"
#include "ns3/log.h"
#include "ns3/names.h"
#include "ns3/simulator.h"
#include "ns3/socket-factory.h"
#include "ns3/trace-source-accessor.h"
#include "ns3/udp-socket-factory.h"
#include "ns3/uinteger.h"
#include <iomanip>
#include <iostream>
Go to the source code of this file.
Namespaces | |
namespace | ns3 |
Every class exported by the ns3 library is enclosed in the ns3 namespace. | |
namespace | ns3::olsr |
namespace | ns3::olsr::anonymous_namespace{olsr-routing-protocol.cc} |
Macros | |
#define | DELAY(time) |
Gets the delay between a given time and the current time. | |
#define | JITTER (Seconds(m_uniformRandomVariable->GetValue(0, OLSR_MAXJITTER))) |
Random number between [0-OLSR_MAXJITTER] used to jitter OLSR packet transmission. | |
#define | NS_LOG_APPEND_CONTEXT |
Implementation of OLSR agent and related classes. | |
#define | OLSR_DUP_HOLD_TIME Seconds(30) |
Dup holding time. | |
#define | OLSR_HNA_HOLD_TIME Time(3 * m_hnaInterval) |
HNA holding time. | |
#define | OLSR_MAX_ADDRS 64 |
Maximum number of addresses advertised on a message. | |
#define | OLSR_MAX_HELLOS 12 |
Maximum number of hellos per message (4 possible link types * 3 possible nb types). | |
#define | OLSR_MAX_MSGS 64 |
Maximum number of messages per packet. | |
#define | OLSR_MAX_SEQ_NUM 65535 |
Maximum allowed sequence number. | |
#define | OLSR_MAXJITTER (m_helloInterval.GetSeconds() / 4) |
Maximum allowed jitter. | |
#define | OLSR_MID_HOLD_TIME Time(3 * m_midInterval) |
MID holding time. | |
#define | OLSR_NEIGHB_HOLD_TIME Time(3 * OLSR_REFRESH_INTERVAL) |
Neighbor holding time. | |
#define | OLSR_REFRESH_INTERVAL m_helloInterval |
Period at which a node must cite every link and every neighbor. | |
#define | OLSR_TOP_HOLD_TIME Time(3 * m_tcInterval) |
Top holding time. | |
Enumerations | |
enum class | ns3::olsr::LinkType : uint8_t { ns3::olsr::LinkType::UNSPEC_LINK = 0 , ns3::olsr::LinkType::ASYM_LINK = 1 , ns3::olsr::LinkType::SYM_LINK = 2 , ns3::olsr::LinkType::LOST_LINK = 3 } |
OLSR link types. More... | |
enum class | ns3::olsr::NeighborType : uint8_t { ns3::olsr::NeighborType::NOT_NEIGH = 0 , ns3::olsr::NeighborType::SYM_NEIGH = 1 , ns3::olsr::NeighborType::MPR_NEIGH = 2 } |
OLSR neighbor types. 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. | |
std::ostream & | ns3::olsr::operator<< (std::ostream &os, LinkType linkType) |
Stream insertion operator for OLSR link type. | |
std::ostream & | ns3::olsr::operator<< (std::ostream &os, NeighborType neighborType) |
Stream insertion operator for OLSR link type. | |
#define DELAY | ( | time | ) |
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 55 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::NdiscCache::Entry::Print(), 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))) |
Random number between [0-OLSR_MAXJITTER] used to jitter OLSR packet transmission.
Definition at line 86 of file olsr-routing-protocol.cc.
Referenced by ns3::olsr::RoutingProtocol::ForwardDefault(), ns3::olsr::RoutingProtocol::SendHello(), ns3::olsr::RoutingProtocol::SendHna(), ns3::olsr::RoutingProtocol::SendMid(), and ns3::olsr::RoutingProtocol::SendTc().
#define NS_LOG_APPEND_CONTEXT |
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 18 of file olsr-routing-protocol.cc.
#define OLSR_DUP_HOLD_TIME Seconds(30) |
Dup holding time.
Definition at line 73 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 77 of file olsr-routing-protocol.cc.
Referenced by ns3::olsr::RoutingProtocol::SendHna().
#define OLSR_MAX_ADDRS 64 |
Maximum number of addresses advertised on a message.
Definition at line 95 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 92 of file olsr-routing-protocol.cc.
#define OLSR_MAX_MSGS 64 |
Maximum number of messages per packet.
Definition at line 89 of file olsr-routing-protocol.cc.
Referenced by ns3::olsr::RoutingProtocol::SendQueuedMessages().
#define OLSR_MAX_SEQ_NUM 65535 |
Maximum allowed sequence number.
Definition at line 84 of file olsr-routing-protocol.cc.
Referenced by ns3::olsr::RoutingProtocol::GetMessageSequenceNumber(), ns3::olsr::RoutingProtocol::GetPacketSequenceNumber(), ns3::olsr::RoutingProtocol::IncrementAnsn(), and ns3::olsr::RoutingProtocol::SetIpv4().
#define OLSR_MAXJITTER (m_helloInterval.GetSeconds() / 4) |
Maximum allowed jitter.
Definition at line 82 of file olsr-routing-protocol.cc.
#define OLSR_MID_HOLD_TIME Time(3 * m_midInterval) |
MID holding time.
Definition at line 75 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 69 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 64 of file olsr-routing-protocol.cc.
#define OLSR_TOP_HOLD_TIME Time(3 * m_tcInterval) |
Top holding time.
Definition at line 71 of file olsr-routing-protocol.cc.
Referenced by ns3::olsr::RoutingProtocol::SendTc().