AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
Loading...
Searching...
No Matches
ns3::anthocnet::RoutingProtocol Class Reference

#include </home/runner/work/AntHocNet/AntHocNet/ns3/model/anthocnet-routing-protocol.h>

Inheritance diagram for ns3::anthocnet::RoutingProtocol:
Ipv4RoutingProtocol anthocnet::core::IRouterObserver anthocnet::core::ILinkState

Public Types

typedef void(* AntTxCallback) (uint8_t type, uint8_t direction, bool broadcast)
 
typedef void(* AntRxCallback) (uint8_t type, uint8_t direction)
 
typedef void(* RouteChangedCallback) (uint32_t dest, uint32_t neighbor, bool added)
 
typedef void(* MacReinjectCallback) (const Ipv4Header &header, Ptr< const Packet > packet)
 

Public Member Functions

 RoutingProtocol ()
 
 ~RoutingProtocol () override
 
void onAntSent (::anthocnet::core::AntType type, ::anthocnet::core::AntDirection dir, bool broadcast) override
 
void onAntReceived (::anthocnet::core::AntType type, ::anthocnet::core::AntDirection dir) override
 
void onRouteChanged (::anthocnet::core::NodeAddress dest, ::anthocnet::core::NodeAddress nb, bool added) override
 
void GetPheromoneDiag (Ipv4Address dest, Ipv4Address neighbor, double &regular, double &virt) const
 
int macQueueLength (::anthocnet::core::NodeAddress nextHop) const override
 
::anthocnet::core::Time macServiceTime (::anthocnet::core::NodeAddress nextHop) const override
 
Ptr< Ipv4Route > RouteOutput (Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr) override
 
bool RouteInput (Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, AHN_RI_CB(UnicastForwardCallback) ucb, AHN_RI_CB(MulticastForwardCallback) mcb, AHN_RI_CB(LocalDeliverCallback) lcb, AHN_RI_CB(ErrorCallback) ecb) override
 
void NotifyInterfaceUp (uint32_t interface) override
 
void NotifyInterfaceDown (uint32_t interface) override
 
void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address) override
 
void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address) override
 
void SetIpv4 (Ptr< Ipv4 > ipv4) override
 
void PrintRoutingTable (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const override
 
int64_t AssignStreams (int64_t stream)
 Seed the protocol's RNG; returns the number of streams used.
 
int64_t AssignTimerStreams (int64_t stream)
 #496: seed the hello/proactive timer-jitter stream (separate from the core's decision stream, so jitter draws never shift the core's sequence); returns the number of streams used.
 
uint64_t LinkfailPropagations () const
 Issue #20 diagnostics: LinkFail origin/propagation split from the core (origins = antTx[linkfail] − propagations; budget drops = suppressed).
 
uint64_t LinkfailBudgetDrops () const
 
uint64_t LinkfailOriginsSuppressed () const
 
uint64_t DirectedSteers () const
 Directed reactive discovery diagnostics: reactive forward ants unicast along the diffusion gradient instead of broadcast (EnableDirectedReactive).
 
uint64_t PtableEntriesRegular () const
 Issue #133 observability: per-node pheromone-table size gauge from the core — current (neighbor, dest) entry counts, split regular vs virtual.
 
uint64_t PtableEntriesVirtual () const
 
const HoldStats & HoldTimeStats () const
 Issue #21 hold-time attribution: per-reason (setup / reconvergence / repair) pending-queue hold-time stats accumulated over the run, read by the comparison harness under –diag to locate the delay tail's dominant hold path.
 
uint64_t RepairDiscardedPackets () const
 Issue #215 drop-cause breakdown, the AntHocNet-specific causes.
 
uint64_t RepairDiscards () const
 Expired local repairs (the core's event count; several packets may be released per event).
 
uint64_t MacReinjectedPackets () const
 Data packets a MAC retry-limit drop put back into the pending queue (#46 re-injection).
 
- Public Member Functions inherited from anthocnet::core::IRouterObserver
virtual ~IRouterObserver ()=default
 
virtual void onAntSent (AntType, AntDirection, bool)
 This node put an ant on the medium (origination or forwarding).
 
virtual void onAntReceived (AntType, AntDirection)
 This node processed a (non-duplicate) received ant.
 
virtual void onRouteChanged (NodeAddress, NodeAddress, bool)
 A neighbour/route entry was added (true) or removed (false).
 
- Public Member Functions inherited from anthocnet::core::ILinkState
virtual ~ILinkState ()=default
 
virtual int macQueueLength (NodeAddress nextHop) const =0
 Packets currently queued for transmission toward nextHop (those a newly-enqueued packet would wait behind).
 
virtual Time macServiceTime (NodeAddress nextHop) const =0
 Smoothed per-packet MAC service time (seconds) toward nextHop: a running average of the time from a packet reaching the head of the interface queue to a successful transmission, including contention/retransmission — and excluding propagation, which is real delay but not congestion.
 

Static Public Member Functions

static TypeId GetTypeId ()
 
::anthocnet::core::NodeAddress ToCore (Ipv4Address a)
 
static Ipv4Address ToIpv4 (::anthocnet::core::NodeAddress a)
 

Static Public Attributes

static const uint16_t ANT_PORT
 UDP port for ant control traffic.
 

Protected Member Functions

void DoInitialize () override
 
void DoDispose () override
 

Detailed Description

Definition at line 64 of file anthocnet-routing-protocol.h.

Member Typedef Documentation

◆ AntTxCallback

typedef void(* ns3::anthocnet::RoutingProtocol::AntTxCallback) (uint8_t type, uint8_t direction, bool broadcast)

Definition at line 76 of file anthocnet-routing-protocol.h.

◆ AntRxCallback

typedef void(* ns3::anthocnet::RoutingProtocol::AntRxCallback) (uint8_t type, uint8_t direction)

Definition at line 77 of file anthocnet-routing-protocol.h.

◆ RouteChangedCallback

typedef void(* ns3::anthocnet::RoutingProtocol::RouteChangedCallback) (uint32_t dest, uint32_t neighbor, bool added)

Definition at line 78 of file anthocnet-routing-protocol.h.

◆ MacReinjectCallback

typedef void(* ns3::anthocnet::RoutingProtocol::MacReinjectCallback) (const Ipv4Header &header, Ptr< const Packet > packet)

Definition at line 85 of file anthocnet-routing-protocol.h.

Constructor & Destructor Documentation

◆ RoutingProtocol()

ns3::anthocnet::RoutingProtocol::RoutingProtocol ( )

◆ ~RoutingProtocol()

ns3::anthocnet::RoutingProtocol::~RoutingProtocol ( )
override

Member Function Documentation

◆ GetTypeId()

static TypeId ns3::anthocnet::RoutingProtocol::GetTypeId ( )
static

◆ onAntSent()

void ns3::anthocnet::RoutingProtocol::onAntSent ( ::anthocnet::core::AntType  type,
::anthocnet::core::AntDirection  dir,
bool  broadcast 
)
override

◆ onAntReceived()

void ns3::anthocnet::RoutingProtocol::onAntReceived ( ::anthocnet::core::AntType  type,
::anthocnet::core::AntDirection  dir 
)
override

◆ onRouteChanged()

void ns3::anthocnet::RoutingProtocol::onRouteChanged ( ::anthocnet::core::NodeAddress  dest,
::anthocnet::core::NodeAddress  nb,
bool  added 
)
override

◆ GetPheromoneDiag()

void ns3::anthocnet::RoutingProtocol::GetPheromoneDiag ( Ipv4Address  dest,
Ipv4Address  neighbor,
double &  regular,
double &  virt 
) const

◆ macQueueLength()

int ns3::anthocnet::RoutingProtocol::macQueueLength ( ::anthocnet::core::NodeAddress  nextHop) const
override

◆ macServiceTime()

::anthocnet::core::Time ns3::anthocnet::RoutingProtocol::macServiceTime ( ::anthocnet::core::NodeAddress  nextHop) const
override

◆ RouteOutput()

Ptr< Ipv4Route > ns3::anthocnet::RoutingProtocol::RouteOutput ( Ptr< Packet >  p,
const Ipv4Header &  header,
Ptr< NetDevice >  oif,
Socket::SocketErrno &  sockerr 
)
override

◆ RouteInput()

bool ns3::anthocnet::RoutingProtocol::RouteInput ( Ptr< const Packet >  p,
const Ipv4Header &  header,
Ptr< const NetDevice >  idev,
AHN_RI_CB(UnicastForwardCallback)  ucb,
AHN_RI_CB(MulticastForwardCallback)  mcb,
AHN_RI_CB(LocalDeliverCallback)  lcb,
AHN_RI_CB(ErrorCallback)  ecb 
)
override

◆ NotifyInterfaceUp()

void ns3::anthocnet::RoutingProtocol::NotifyInterfaceUp ( uint32_t  interface)
override

◆ NotifyInterfaceDown()

void ns3::anthocnet::RoutingProtocol::NotifyInterfaceDown ( uint32_t  interface)
override

◆ NotifyAddAddress()

void ns3::anthocnet::RoutingProtocol::NotifyAddAddress ( uint32_t  interface,
Ipv4InterfaceAddress  address 
)
override

◆ NotifyRemoveAddress()

void ns3::anthocnet::RoutingProtocol::NotifyRemoveAddress ( uint32_t  interface,
Ipv4InterfaceAddress  address 
)
override

◆ SetIpv4()

void ns3::anthocnet::RoutingProtocol::SetIpv4 ( Ptr< Ipv4 >  ipv4)
override

◆ PrintRoutingTable()

void ns3::anthocnet::RoutingProtocol::PrintRoutingTable ( Ptr< OutputStreamWrapper >  stream,
Time::Unit  unit = Time::S 
) const
override

◆ AssignStreams()

int64_t ns3::anthocnet::RoutingProtocol::AssignStreams ( int64_t  stream)

Seed the protocol's RNG; returns the number of streams used.

◆ AssignTimerStreams()

int64_t ns3::anthocnet::RoutingProtocol::AssignTimerStreams ( int64_t  stream)

#496: seed the hello/proactive timer-jitter stream (separate from the core's decision stream, so jitter draws never shift the core's sequence); returns the number of streams used.

AntHocNetHelper assigns these after every node's core stream, so the core streams keep their pre-#496 indices.

◆ LinkfailPropagations()

uint64_t ns3::anthocnet::RoutingProtocol::LinkfailPropagations ( ) const
inline

Issue #20 diagnostics: LinkFail origin/propagation split from the core (origins = antTx[linkfail] − propagations; budget drops = suppressed).

Definition at line 137 of file anthocnet-routing-protocol.h.

◆ LinkfailBudgetDrops()

uint64_t ns3::anthocnet::RoutingProtocol::LinkfailBudgetDrops ( ) const
inline

Definition at line 140 of file anthocnet-routing-protocol.h.

◆ LinkfailOriginsSuppressed()

uint64_t ns3::anthocnet::RoutingProtocol::LinkfailOriginsSuppressed ( ) const
inline

Definition at line 143 of file anthocnet-routing-protocol.h.

◆ DirectedSteers()

uint64_t ns3::anthocnet::RoutingProtocol::DirectedSteers ( ) const
inline

Directed reactive discovery diagnostics: reactive forward ants unicast along the diffusion gradient instead of broadcast (EnableDirectedReactive).

Zero on an enabled run means the gradient never covered a destination the regular table was missing, i.e. the switch was inert for this scenario.

Definition at line 151 of file anthocnet-routing-protocol.h.

◆ PtableEntriesRegular()

uint64_t ns3::anthocnet::RoutingProtocol::PtableEntriesRegular ( ) const
inline

Issue #133 observability: per-node pheromone-table size gauge from the core — current (neighbor, dest) entry counts, split regular vs virtual.

Read by the comparison harness under –diag to watch table growth.

Definition at line 158 of file anthocnet-routing-protocol.h.

◆ PtableEntriesVirtual()

uint64_t ns3::anthocnet::RoutingProtocol::PtableEntriesVirtual ( ) const
inline

Definition at line 161 of file anthocnet-routing-protocol.h.

◆ HoldTimeStats()

const HoldStats & ns3::anthocnet::RoutingProtocol::HoldTimeStats ( ) const
inline

Issue #21 hold-time attribution: per-reason (setup / reconvergence / repair) pending-queue hold-time stats accumulated over the run, read by the comparison harness under –diag to locate the delay tail's dominant hold path.

Definition at line 169 of file anthocnet-routing-protocol.h.

◆ RepairDiscardedPackets()

uint64_t ns3::anthocnet::RoutingProtocol::RepairDiscardedPackets ( ) const
inline

Issue #215 drop-cause breakdown, the AntHocNet-specific causes.

The generic ones (channel, MAC, TTL, interface queue) are measured simulator-side by the comparison harness for every protocol; these three exist only here because only this protocol has a pending queue and a local-repair discard.

Data packets released by a failed local repair ([1] §3.5, D6) — the packet count behind the core's DiscardPending events. This is expected protocol behaviour, not a fault: the paper trades these packets for a bounded delay tail.

Definition at line 181 of file anthocnet-routing-protocol.h.

◆ RepairDiscards()

uint64_t ns3::anthocnet::RoutingProtocol::RepairDiscards ( ) const
inline

Expired local repairs (the core's event count; several packets may be released per event).

Definition at line 184 of file anthocnet-routing-protocol.h.

◆ MacReinjectedPackets()

uint64_t ns3::anthocnet::RoutingProtocol::MacReinjectedPackets ( ) const
inline

Data packets a MAC retry-limit drop put back into the pending queue (#46 re-injection).

Such a packet is not lost yet — its terminal fate is counted wherever it finally ends up — so the harness subtracts these from the raw MAC-failure tally to avoid double-counting them (#215).

Definition at line 189 of file anthocnet-routing-protocol.h.

◆ DoInitialize()

void ns3::anthocnet::RoutingProtocol::DoInitialize ( )
overrideprotected

◆ DoDispose()

void ns3::anthocnet::RoutingProtocol::DoDispose ( )
overrideprotected

◆ ToCore()

::anthocnet::core::NodeAddress ns3::anthocnet::RoutingProtocol::ToCore ( Ipv4Address  a)
inlinestatic

Definition at line 202 of file anthocnet-routing-protocol.h.

◆ ToIpv4()

static Ipv4Address ns3::anthocnet::RoutingProtocol::ToIpv4 ( ::anthocnet::core::NodeAddress  a)
inlinestatic

Definition at line 207 of file anthocnet-routing-protocol.h.

Member Data Documentation

◆ ANT_PORT

const uint16_t ns3::anthocnet::RoutingProtocol::ANT_PORT
static

UDP port for ant control traffic.

Definition at line 70 of file anthocnet-routing-protocol.h.


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