ns3::olsr::AgentImpl Class Reference

#include <olsr-agent-impl.h>

Inheritance diagram for ns3::olsr::AgentImpl:
Inheritance graph
[legend]
Collaboration diagram for ns3::olsr::AgentImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AgentImpl ()
virtual ~AgentImpl ()
virtual void SetNode (Ptr< Node > node)
virtual void Start ()
 Starts the OLSR protocol operation.
virtual void SetMainInterface (uint32_t interface)
 Sets the main interface to be used by OLSR.
virtual Ptr< const
olsr::RoutingTable
GetRoutingTable () const

Static Public Member Functions

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

Protected Member Functions

void DoDispose ()
void SendPacket (Ptr< Packet > packet, const MessageList &containedMessages)
uint16_t GetPacketSequenceNumber ()
 Increments packet sequence number and returns the new value.
uint16_t GetMessageSequenceNumber ()
 Increments message sequence number and returns the new value.
void RecvOlsr (Ptr< Socket > socket)
void MprComputation ()
 Computates MPR set of a node following RFC 3626 hints.
void RoutingTableComputation ()
 Creates the routing table of the node following RFC 3626 hints.
Ipv4Address GetMainAddress (Ipv4Address iface_addr) const
 Gets the main address associated with a given interface address.
void HelloTimerExpire ()
 Sends a HELLO message and reschedules the HELLO timer.
void TcTimerExpire ()
 Sends a TC message (if there exists any MPR selector) and reschedules the TC timer.
void MidTimerExpire ()
 Sends a MID message (if the node has more than one interface) and resets the MID timer.
void DupTupleTimerExpire (Ipv4Address address, uint16_t sequenceNumber)
 Removes tuple if expired. Else timer is rescheduled to expire at tuple.expirationTime.
void LinkTupleTimerExpire (Ipv4Address neighborIfaceAddr)
 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().
void Nb2hopTupleTimerExpire (Ipv4Address neighborMainAddr, Ipv4Address twoHopNeighborAddr)
 Removes tuple_ if expired. Else the timer is rescheduled to expire at tuple_->time().
void MprSelTupleTimerExpire (Ipv4Address mainAddr)
 Removes tuple_ if expired. Else the timer is rescheduled to expire at tuple_->time().
void TopologyTupleTimerExpire (Ipv4Address destAddr, Ipv4Address lastAddr)
 Removes tuple_ if expired. Else the timer is rescheduled to expire at tuple_->time().
void IfaceAssocTupleTimerExpire (Ipv4Address ifaceAddr)
 Removes tuple_ if expired. Else timer is rescheduled to expire at tuple_->time().
void IncrementAnsn ()
void ForwardDefault (olsr::MessageHeader olsrMessage, DuplicateTuple *duplicated, const Ipv4Address &localIface, const Ipv4Address &senderAddress)
 OLSR's default forwarding algorithm.
void QueueMessage (const olsr::MessageHeader &message, Time delay)
 Enques an OLSR message which will be sent with a delay of (0, delay].
void SendQueuedMessages ()
 Creates as many OLSR packets as needed in order to send all buffered OLSR messages.
void SendHello ()
 Creates a new OLSR HELLO message which is buffered for being sent later on.
void SendTc ()
 Creates a new OLSR TC message which is buffered for being sent later on.
void SendMid ()
 Creates a new OLSR MID message which is buffered for being sent later on.
void NeighborLoss (const LinkTuple &tuple)
 Performs all actions needed when a neighbor loss occurs.
void AddDuplicateTuple (const DuplicateTuple &tuple)
 Adds a duplicate tuple to the Duplicate Set.
void RemoveDuplicateTuple (const DuplicateTuple &tuple)
 Removes a duplicate tuple from the Duplicate Set.
void LinkTupleAdded (const LinkTuple &tuple, uint8_t willingness)
void RemoveLinkTuple (const LinkTuple &tuple)
 Removes a link tuple from the Link Set.
void LinkTupleUpdated (const LinkTuple &tuple, uint8_t willingness)
 This function is invoked when a link tuple is updated. Its aim is to also update the corresponding neighbor tuple if it is needed.
void AddNeighborTuple (const NeighborTuple &tuple)
 Adds a neighbor tuple to the Neighbor Set.
void RemoveNeighborTuple (const NeighborTuple &tuple)
 Removes a neighbor tuple from the Neighbor Set.
void AddTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple)
 Adds a 2-hop neighbor tuple to the 2-hop Neighbor Set.
void RemoveTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple)
 Removes a 2-hop neighbor tuple from the 2-hop Neighbor Set.
void AddMprSelectorTuple (const MprSelectorTuple &tuple)
 Adds an MPR selector tuple to the MPR Selector Set.
void RemoveMprSelectorTuple (const MprSelectorTuple &tuple)
 Removes an MPR selector tuple from the MPR Selector Set.
void AddTopologyTuple (const TopologyTuple &tuple)
 Adds a topology tuple to the Topology Set.
void RemoveTopologyTuple (const TopologyTuple &tuple)
 Removes a topology tuple from the Topology Set.
void AddIfaceAssocTuple (const IfaceAssocTuple &tuple)
 Adds an interface association tuple to the Interface Association Set.
void RemoveIfaceAssocTuple (const IfaceAssocTuple &tuple)
 Removes an interface association tuple from the Interface Association Set.
void ProcessHello (const olsr::MessageHeader &msg, const Ipv4Address &receiverIface, const Ipv4Address &senderIface)
 Processes a HELLO message following RFC 3626 specification.
void ProcessTc (const olsr::MessageHeader &msg, const Ipv4Address &senderIface)
 Processes a TC message following RFC 3626 specification.
void ProcessMid (const olsr::MessageHeader &msg, const Ipv4Address &senderIface)
 Processes a MID message following RFC 3626 specification.
void LinkSensing (const olsr::MessageHeader &msg, const olsr::MessageHeader::Hello &hello, const Ipv4Address &receiverIface, const Ipv4Address &sender_iface)
 Updates Link Set according to a new received HELLO message (following RFC 3626 specification). Neighbor Set is also updated if needed.
void PopulateNeighborSet (const olsr::MessageHeader &msg, const olsr::MessageHeader::Hello &hello)
 Updates the Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626).
void PopulateTwoHopNeighborSet (const olsr::MessageHeader &msg, const olsr::MessageHeader::Hello &hello)
 Updates the 2-hop Neighbor Set according to the information contained in a new received HELLO message (following RFC 3626).
void 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).
int Degree (NeighborTuple const &tuple)
 This auxiliary function (defined in RFC 3626) is used for calculating the MPR Set.

Protected Attributes

Timer m_helloTimer
Timer m_tcTimer
Timer m_midTimer
bool m_linkTupleTimerFirstTime
olsr::MessageList m_queuedMessages
 A list of pending messages which are buffered awaiting for being sent.
Timer m_queuedMessagesTimer
Ipv4Address m_mainAddress
std::map< Ptr< Socket >
, Ipv4Address
m_socketAddresses
TracedCallback< const
PacketHeader &, const
MessageList & > 
m_rxPacketTrace
TracedCallback< const
PacketHeader &, const
MessageList & > 
m_txPacketTrace
TracedCallback< uint32_t > m_routingTableChanged

Private Attributes

EventGarbageCollector m_events
Ipv4Address m_routingAgentAddr
 Address of the routing agent.
uint16_t m_packetSequenceNumber
 Packets sequence number counter.
uint16_t m_messageSequenceNumber
 Messages sequence number counter.
uint16_t m_ansn
 Advertised Neighbor Set sequence number.
Time m_helloInterval
 HELLO messages' emission interval.
Time m_tcInterval
 TC messages' emission interval.
Time m_midInterval
 MID messages' emission interval.
uint8_t m_willingness
 Willingness for forwarding packets on behalf of other nodes.
Ptr< RoutingTablem_routingTable
 Routing table.
OlsrState m_state
 Internal state with all needed data structs.
Ptr< Ipv4m_ipv4

Detailed Description

Definition at line 49 of file olsr-agent-impl.h.


Constructor & Destructor Documentation

ns3::olsr::AgentImpl::AgentImpl (  ) 

Definition at line 184 of file olsr-agent-impl.cc.

ns3::olsr::AgentImpl::~AgentImpl (  )  [virtual]

Definition at line 191 of file olsr-agent-impl.cc.


Member Function Documentation

void ns3::olsr::AgentImpl::AddDuplicateTuple ( const DuplicateTuple &  tuple  )  [protected]

Adds a duplicate tuple to the Duplicate Set.

Parameters:
tuple the duplicate tuple to be added.

Definition at line 1960 of file olsr-agent-impl.cc.

References m_state.

Referenced by ForwardDefault().

void ns3::olsr::AgentImpl::AddIfaceAssocTuple ( const IfaceAssocTuple &  tuple  )  [protected]

Adds an interface association tuple to the Interface Association Set.

Parameters:
tuple the interface association tuple to be added.

Definition at line 2227 of file olsr-agent-impl.cc.

References m_state.

Referenced by ProcessMid(), and Start().

void ns3::olsr::AgentImpl::AddMprSelectorTuple ( const MprSelectorTuple &  tuple  )  [protected]

Adds an MPR selector tuple to the MPR Selector Set.

Advertised Neighbor Sequence Number (ANSN) is also updated.

Parameters:
tuple the MPR selector tuple to be added.

Definition at line 2155 of file olsr-agent-impl.cc.

References IncrementAnsn(), and m_state.

Referenced by PopulateMprSelectorSet().

void ns3::olsr::AgentImpl::AddNeighborTuple ( const NeighborTuple &  tuple  )  [protected]

Adds a neighbor tuple to the Neighbor Set.

Parameters:
tuple the neighbor tuple to be added.

Definition at line 2077 of file olsr-agent-impl.cc.

References IncrementAnsn(), and m_state.

Referenced by LinkTupleAdded().

void ns3::olsr::AgentImpl::AddTopologyTuple ( const TopologyTuple &  tuple  )  [protected]

Adds a topology tuple to the Topology Set.

Parameters:
tuple the topology tuple to be added.

Definition at line 2191 of file olsr-agent-impl.cc.

References m_state.

Referenced by ProcessTc().

void ns3::olsr::AgentImpl::AddTwoHopNeighborTuple ( const TwoHopNeighborTuple &  tuple  )  [protected]

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

Parameters:
tuple the 2-hop neighbor tuple to be added.

Definition at line 2113 of file olsr-agent-impl.cc.

References m_state.

Referenced by PopulateTwoHopNeighborSet().

int ns3::olsr::AgentImpl::Degree ( NeighborTuple const &  tuple  )  [protected]

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

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

Definition at line 456 of file olsr-agent-impl.cc.

References m_state.

Referenced by MprComputation().

void ns3::olsr::AgentImpl::DoDispose ( void   )  [protected, virtual]

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

Subclasses are expected to implement their real destruction code in an overriden 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.

Reimplemented from ns3::Object.

Definition at line 213 of file olsr-agent-impl.cc.

References m_ipv4, m_routingTable, and m_socketAddresses.

void ns3::olsr::AgentImpl::DupTupleTimerExpire ( Ipv4Address  address,
uint16_t  sequenceNumber 
) [protected]

Removes tuple if expired. Else timer is rescheduled to expire at tuple.expirationTime.

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

Parameters:
tuple The tuple which has expired.

Definition at line 2319 of file olsr-agent-impl.cc.

References DELAY, m_events, m_state, ns3::Simulator::Now(), RemoveDuplicateTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by ForwardDefault().

void ns3::olsr::AgentImpl::ForwardDefault ( olsr::MessageHeader  olsrMessage,
DuplicateTuple *  duplicated,
const Ipv4Address localIface,
const Ipv4Address senderAddress 
) [protected]

OLSR's default forwarding algorithm.

See RFC 3626 for details.

Parameters:
p the OLSR packet which has been received.
msg the OLSR message which must be forwarded.
dup_tuple NULL if the message has never been considered for forwarding, or a duplicate tuple in other case.
local_iface the address of the interface where the message was received from.

Definition at line 1247 of file olsr-agent-impl.cc.

References AddDuplicateTuple(), DupTupleTimerExpire(), ns3::olsr::MessageHeader::GetHopCount(), GetMainAddress(), ns3::olsr::MessageHeader::GetMessageSequenceNumber(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetTimeToLive(), JITTER, m_mainAddress, m_state, ns3::Simulator::Now(), ns3::Now(), NS_LOG_LOGIC, OLSR_DUP_HOLD_TIME, QueueMessage(), ns3::Simulator::Schedule(), ns3::olsr::MessageHeader::SetHopCount(), and ns3::olsr::MessageHeader::SetTimeToLive().

Referenced by RecvOlsr().

Ipv4Address ns3::olsr::AgentImpl::GetMainAddress ( Ipv4Address  iface_addr  )  const [protected]

Gets the main address associated with a given interface address.

Parameters:
iface_addr the interface address.
Returns:
the corresponding main address.

Definition at line 747 of file olsr-agent-impl.cc.

References m_state.

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

uint16_t ns3::olsr::AgentImpl::GetMessageSequenceNumber (  )  [inline, protected]

Increments message sequence number and returns the new value.

Definition at line 2263 of file olsr-agent-impl.cc.

References m_messageSequenceNumber, and OLSR_MAX_SEQ_NUM.

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

uint16_t ns3::olsr::AgentImpl::GetPacketSequenceNumber (  )  [inline, protected]

Increments packet sequence number and returns the new value.

Definition at line 2256 of file olsr-agent-impl.cc.

References m_packetSequenceNumber, and OLSR_MAX_SEQ_NUM.

Referenced by SendPacket().

Ptr< const olsr::RoutingTable > ns3::olsr::AgentImpl::GetRoutingTable (  )  const [virtual]

Implements ns3::olsr::Agent.

Definition at line 2492 of file olsr-agent-impl.cc.

References m_routingTable.

TypeId ns3::olsr::AgentImpl::GetTypeId ( void   )  [static]

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

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

  • /NodeList/[i]/$ns3olsr::Agent/$ns3olsr::AgentImpl

Attributes defined for this type:

  • HelloInterval: HELLO messages emission interval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 2000000000ns
    • Flags: construct write read
  • TcInterval: TC messages emission interval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 5000000000ns
    • Flags: construct write read
  • MidInterval: MID messages emission interval. Normally it is equal to TcInterval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 5000000000ns
    • 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::olsr::Agent.

Definition at line 148 of file olsr-agent-impl.cc.

References ns3::TypeId::AddAttribute(), ns3::TypeId::AddTraceSource(), m_helloInterval, m_midInterval, m_routingTableChanged, m_rxPacketTrace, m_tcInterval, m_txPacketTrace, m_willingness, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakeTraceSourceAccessor(), OLSR_WILL_ALWAYS, OLSR_WILL_DEFAULT, OLSR_WILL_HIGH, OLSR_WILL_LOW, OLSR_WILL_NEVER, ns3::Seconds(), and ns3::TypeId::SetParent().

void ns3::olsr::AgentImpl::HelloTimerExpire (  )  [protected]

Sends a HELLO message and reschedules the HELLO timer.

Parameters:
e The event which has expired.

Definition at line 2275 of file olsr-agent-impl.cc.

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

Referenced by SetNode(), and Start().

void ns3::olsr::AgentImpl::IfaceAssocTupleTimerExpire ( Ipv4Address  ifaceAddr  )  [protected]

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

Warning:
Actually this is never invoked because there is no support for multiple interfaces.
Parameters:
e The event which has expired.

Definition at line 2472 of file olsr-agent-impl.cc.

References DELAY, m_events, m_state, ns3::Simulator::Now(), RemoveIfaceAssocTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by ProcessMid().

void ns3::olsr::AgentImpl::IncrementAnsn (  )  [protected]
void ns3::olsr::AgentImpl::LinkSensing ( const olsr::MessageHeader msg,
const olsr::MessageHeader::Hello hello,
const Ipv4Address receiverIface,
const Ipv4Address sender_iface 
) [protected]
void ns3::olsr::AgentImpl::LinkTupleAdded ( const LinkTuple &  tuple,
uint8_t  willingness 
) [protected]

Definition at line 1987 of file olsr-agent-impl.cc.

References AddNeighborTuple(), GetMainAddress(), and ns3::Simulator::Now().

Referenced by LinkSensing(), and LinkTupleUpdated().

void ns3::olsr::AgentImpl::LinkTupleTimerExpire ( Ipv4Address  neighborIfaceAddr  )  [protected]

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

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

Parameters:
e The event which has expired.

Definition at line 2351 of file olsr-agent-impl.cc.

References DELAY, m_events, m_linkTupleTimerFirstTime, m_state, NeighborLoss(), ns3::Now(), RemoveLinkTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by LinkSensing().

void ns3::olsr::AgentImpl::LinkTupleUpdated ( const LinkTuple &  tuple,
uint8_t  willingness 
) [protected]

This function is invoked when a link tuple is updated. Its aim is to also update the corresponding neighbor tuple if it is needed.

Parameters:
tuple the link tuple which has been updated.

Definition at line 2030 of file olsr-agent-impl.cc.

References GetMainAddress(), LinkTupleAdded(), m_mainAddress, m_state, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_WARN.

Referenced by LinkSensing(), and NeighborLoss().

void ns3::olsr::AgentImpl::MidTimerExpire (  )  [protected]

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

Warning:
Currently it does nothing because there is no support for multiple interfaces.
Parameters:
e The event which has expired.

Definition at line 2305 of file olsr-agent-impl.cc.

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

Referenced by SetNode(), and Start().

void ns3::olsr::AgentImpl::MprComputation (  )  [protected]

Computates MPR set of a node following RFC 3626 hints.

Definition at line 478 of file olsr-agent-impl.cc.

References Degree(), m_mainAddress, m_state, NS_LOG_DEBUG, NS_LOG_FUNCTION, OLSR_WILL_ALWAYS, and OLSR_WILL_NEVER.

Referenced by NeighborLoss(), and ProcessHello().

void ns3::olsr::AgentImpl::MprSelTupleTimerExpire ( Ipv4Address  mainAddr  )  [protected]

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

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

Parameters:
e The event which has expired.

Definition at line 2420 of file olsr-agent-impl.cc.

References DELAY, m_events, m_state, ns3::Simulator::Now(), RemoveMprSelectorTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by PopulateMprSelectorSet().

void ns3::olsr::AgentImpl::Nb2hopTupleTimerExpire ( Ipv4Address  neighborMainAddr,
Ipv4Address  twoHopNeighborAddr 
) [protected]

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

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

Parameters:
e The event which has expired.

Definition at line 2392 of file olsr-agent-impl.cc.

References DELAY, m_events, m_state, ns3::Simulator::Now(), RemoveTwoHopNeighborTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by PopulateTwoHopNeighborSet().

void ns3::olsr::AgentImpl::NeighborLoss ( const LinkTuple &  tuple  )  [protected]

Performs all actions needed when a neighbor loss occurs.

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

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

Definition at line 1941 of file olsr-agent-impl.cc.

References GetMainAddress(), LinkTupleUpdated(), m_mainAddress, m_state, MprComputation(), ns3::Simulator::Now(), NS_LOG_DEBUG, OLSR_WILL_DEFAULT, and RoutingTableComputation().

Referenced by LinkTupleTimerExpire().

void ns3::olsr::AgentImpl::PopulateMprSelectorSet ( const olsr::MessageHeader msg,
const olsr::MessageHeader::Hello hello 
) [protected]
void ns3::olsr::AgentImpl::PopulateNeighborSet ( const olsr::MessageHeader msg,
const olsr::MessageHeader::Hello hello 
) [protected]

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

Definition at line 1714 of file olsr-agent-impl.cc.

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

Referenced by ProcessHello().

void ns3::olsr::AgentImpl::PopulateTwoHopNeighborSet ( const olsr::MessageHeader msg,
const olsr::MessageHeader::Hello hello 
) [protected]
void ns3::olsr::AgentImpl::ProcessHello ( const olsr::MessageHeader msg,
const Ipv4Address receiverIface,
const Ipv4Address senderIface 
) [protected]

Processes a HELLO message following RFC 3626 specification.

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

Parameters:
msg the OLSR message which contains the HELLO message.
receiver_iface the address of the interface where the message was received from.
sender_iface the address of the interface where the message was sent from.

Definition at line 1009 of file olsr-agent-impl.cc.

References ns3::olsr::MessageHeader::GetHello(), LinkSensing(), m_mainAddress, m_state, MprComputation(), ns3::Simulator::Now(), NS_LOG_DEBUG, PopulateMprSelectorSet(), PopulateNeighborSet(), and PopulateTwoHopNeighborSet().

Referenced by RecvOlsr().

void ns3::olsr::AgentImpl::ProcessMid ( const olsr::MessageHeader msg,
const Ipv4Address senderIface 
) [protected]

Processes a MID message following RFC 3626 specification.

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

Parameters:
msg the OLSR message which contains the MID message.
sender_iface the address of the interface where the message was sent from.

Definition at line 1165 of file olsr-agent-impl.cc.

References AddIfaceAssocTuple(), DELAY, GetMainAddress(), ns3::olsr::MessageHeader::GetMid(), ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetVTime(), IfaceAssocTupleTimerExpire(), ns3::olsr::MessageHeader::Mid::interfaceAddresses, m_mainAddress, m_state, ns3::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, and ns3::Simulator::Schedule().

Referenced by RecvOlsr().

void ns3::olsr::AgentImpl::ProcessTc ( const olsr::MessageHeader msg,
const Ipv4Address senderIface 
) [protected]

Processes a TC message following RFC 3626 specification.

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

Parameters:
msg the OLSR message which contains the TC message.
sender_iface the address of the interface where the message was sent from.

Definition at line 1070 of file olsr-agent-impl.cc.

References AddTopologyTuple(), ns3::olsr::MessageHeader::Tc::ansn, DELAY, ns3::olsr::MessageHeader::GetOriginatorAddress(), ns3::olsr::MessageHeader::GetTc(), ns3::olsr::MessageHeader::GetVTime(), m_events, m_mainAddress, m_state, ns3::olsr::MessageHeader::Tc::neighborAddresses, ns3::Simulator::Now(), ns3::Now(), NS_LOG_DEBUG, ns3::Simulator::Schedule(), TopologyTupleTimerExpire(), and ns3::EventGarbageCollector::Track().

Referenced by RecvOlsr().

void ns3::olsr::AgentImpl::QueueMessage ( const olsr::MessageHeader message,
Time  delay 
) [protected]

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.

Parameters:
msg the OLSR message which must be sent.
delay maximum delay the OLSR message is going to be buffered.

Definition at line 1322 of file olsr-agent-impl.cc.

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

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

void ns3::olsr::AgentImpl::RecvOlsr ( Ptr< Socket socket  )  [protected]
void ns3::olsr::AgentImpl::RemoveDuplicateTuple ( const DuplicateTuple &  tuple  )  [protected]

Removes a duplicate tuple from the Duplicate Set.

Parameters:
tuple the duplicate tuple to be removed.

Definition at line 1976 of file olsr-agent-impl.cc.

References m_state.

Referenced by DupTupleTimerExpire().

void ns3::olsr::AgentImpl::RemoveIfaceAssocTuple ( const IfaceAssocTuple &  tuple  )  [protected]

Removes an interface association tuple from the Interface Association Set.

Parameters:
tuple the interface association tuple to be removed.

Definition at line 2244 of file olsr-agent-impl.cc.

References m_state.

Referenced by IfaceAssocTupleTimerExpire().

void ns3::olsr::AgentImpl::RemoveLinkTuple ( const LinkTuple &  tuple  )  [protected]

Removes a link tuple from the Link Set.

Parameters:
tuple the link tuple to be removed.

Definition at line 2012 of file olsr-agent-impl.cc.

References GetMainAddress(), m_mainAddress, m_state, ns3::Simulator::Now(), and NS_LOG_DEBUG.

Referenced by LinkTupleTimerExpire().

void ns3::olsr::AgentImpl::RemoveMprSelectorTuple ( const MprSelectorTuple &  tuple  )  [protected]

Removes an MPR selector tuple from the MPR Selector Set.

Advertised Neighbor Sequence Number (ANSN) is also updated.

Parameters:
tuple the MPR selector tuple to be removed.

Definition at line 2174 of file olsr-agent-impl.cc.

References IncrementAnsn(), and m_state.

Referenced by MprSelTupleTimerExpire().

void ns3::olsr::AgentImpl::RemoveNeighborTuple ( const NeighborTuple &  tuple  )  [protected]

Removes a neighbor tuple from the Neighbor Set.

Parameters:
tuple the neighbor tuple to be removed.

Definition at line 2095 of file olsr-agent-impl.cc.

References IncrementAnsn(), and m_state.

void ns3::olsr::AgentImpl::RemoveTopologyTuple ( const TopologyTuple &  tuple  )  [protected]

Removes a topology tuple from the Topology Set.

Parameters:
tuple the topology tuple to be removed.

Definition at line 2209 of file olsr-agent-impl.cc.

References m_state.

Referenced by TopologyTupleTimerExpire().

void ns3::olsr::AgentImpl::RemoveTwoHopNeighborTuple ( const TwoHopNeighborTuple &  tuple  )  [protected]

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

Parameters:
tuple the 2-hop neighbor tuple to be removed.

Definition at line 2130 of file olsr-agent-impl.cc.

References m_state.

Referenced by Nb2hopTupleTimerExpire().

void ns3::olsr::AgentImpl::RoutingTableComputation (  )  [protected]
void ns3::olsr::AgentImpl::SendHello (  )  [protected]
void ns3::olsr::AgentImpl::SendMid (  )  [protected]
void ns3::olsr::AgentImpl::SendPacket ( Ptr< Packet packet,
const MessageList containedMessages 
) [protected]
void ns3::olsr::AgentImpl::SendQueuedMessages (  )  [protected]

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 1359 of file olsr-agent-impl.cc.

References m_mainAddress, m_queuedMessages, NS_LOG_DEBUG, OLSR_MAX_MSGS, and SendPacket().

Referenced by SetNode().

void ns3::olsr::AgentImpl::SendTc (  )  [protected]
void ns3::olsr::AgentImpl::SetMainInterface ( uint32_t  interface  )  [virtual]

Sets the main interface to be used by OLSR.

Normally OLSR supports multiple interfaces, but the protocol requires the definition of a "main interface". This interface's IPv4 address provides the identity of the node, and all outgoing OLSR routing messages must have the main interface address, regardless of the actual interface used to transmit the packet. This method allows one to explicitly select an interface as the main interface. It must be called before the agent starts, but calling it is optional; if not called, the agent tries to guess and uses a suitable interface.

Implements ns3::olsr::Agent.

Definition at line 298 of file olsr-agent-impl.cc.

References m_ipv4, and m_mainAddress.

void ns3::olsr::AgentImpl::SetNode ( Ptr< Node node  )  [virtual]
void ns3::olsr::AgentImpl::Start (  )  [virtual]

Starts the OLSR protocol operation.

Calling this method essentially bootstraps the OLSR protocol, and causes the agent to start broadcasting OLSR messages to neighbors, as well start listening to messages from neighbors.

Implements ns3::olsr::Agent.

Definition at line 233 of file olsr-agent-impl.cc.

References AddIfaceAssocTuple(), ns3::Socket::CreateSocket(), GetMainAddress(), ns3::UdpSocketFactory::GetTypeId(), HelloTimerExpire(), m_ipv4, m_mainAddress, m_routingTable, m_socketAddresses, ns3::MakeCallback(), MidTimerExpire(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, OLSR_PORT_NUMBER, RecvOlsr(), and TcTimerExpire().

void ns3::olsr::AgentImpl::TcTimerExpire (  )  [protected]

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

Parameters:
e The event which has expired.

Definition at line 2286 of file olsr-agent-impl.cc.

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

Referenced by SetNode(), and Start().

void ns3::olsr::AgentImpl::TopologyTupleTimerExpire ( Ipv4Address  destAddr,
Ipv4Address  lastAddr 
) [protected]

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

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

Parameters:
e The event which has expired.

Definition at line 2447 of file olsr-agent-impl.cc.

References DELAY, m_events, m_state, ns3::Simulator::Now(), RemoveTopologyTuple(), ns3::Simulator::Schedule(), and ns3::EventGarbageCollector::Track().

Referenced by ProcessTc().


Member Data Documentation

uint16_t ns3::olsr::AgentImpl::m_ansn [private]

Advertised Neighbor Set sequence number.

Definition at line 74 of file olsr-agent-impl.h.

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

HELLO messages' emission interval.

Definition at line 77 of file olsr-agent-impl.h.

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

Definition at line 109 of file olsr-agent-impl.h.

Referenced by HelloTimerExpire(), and SetNode().

Definition at line 90 of file olsr-agent-impl.h.

Referenced by DoDispose(), SendMid(), SetMainInterface(), SetNode(), and Start().

Definition at line 119 of file olsr-agent-impl.h.

Referenced by LinkTupleTimerExpire(), and SetNode().

Messages sequence number counter.

Definition at line 72 of file olsr-agent-impl.h.

Referenced by GetMessageSequenceNumber(), and SetNode().

MID messages' emission interval.

Definition at line 81 of file olsr-agent-impl.h.

Referenced by GetTypeId(), and MidTimerExpire().

Definition at line 115 of file olsr-agent-impl.h.

Referenced by MidTimerExpire(), and SetNode().

Packets sequence number counter.

Definition at line 70 of file olsr-agent-impl.h.

Referenced by GetPacketSequenceNumber(), and SetNode().

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

Definition at line 129 of file olsr-agent-impl.h.

Referenced by QueueMessage(), and SendQueuedMessages().

Definition at line 130 of file olsr-agent-impl.h.

Referenced by QueueMessage(), and SetNode().

Address of the routing agent.

Definition at line 67 of file olsr-agent-impl.h.

Referenced by PopulateTwoHopNeighborSet().

Routing table.

Definition at line 86 of file olsr-agent-impl.h.

Referenced by DoDispose(), GetRoutingTable(), RoutingTableComputation(), and Start().

Definition at line 191 of file olsr-agent-impl.h.

Referenced by GetTypeId(), and RoutingTableComputation().

Definition at line 188 of file olsr-agent-impl.h.

Referenced by GetTypeId(), and RecvOlsr().

Definition at line 185 of file olsr-agent-impl.h.

Referenced by DoDispose(), RecvOlsr(), SendPacket(), and Start().

OlsrState ns3::olsr::AgentImpl::m_state [private]

TC messages' emission interval.

Definition at line 79 of file olsr-agent-impl.h.

Referenced by GetTypeId(), and TcTimerExpire().

Definition at line 112 of file olsr-agent-impl.h.

Referenced by SetNode(), and TcTimerExpire().

Definition at line 190 of file olsr-agent-impl.h.

Referenced by GetTypeId(), and SendPacket().

Willingness for forwarding packets on behalf of other nodes.

Definition at line 83 of file olsr-agent-impl.h.

Referenced by GetTypeId(), and SendHello().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:12:21 2009 for NS-3 by  doxygen 1.6.3