|
AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
|
#include </home/runner/work/AntHocNet/AntHocNet/ns3/model/anthocnet-routing-protocol.h>
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 ®ular, 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 |
Definition at line 64 of file anthocnet-routing-protocol.h.
| typedef void(* ns3::anthocnet::RoutingProtocol::AntTxCallback) (uint8_t type, uint8_t direction, bool broadcast) |
Definition at line 76 of file anthocnet-routing-protocol.h.
| typedef void(* ns3::anthocnet::RoutingProtocol::AntRxCallback) (uint8_t type, uint8_t direction) |
Definition at line 77 of file anthocnet-routing-protocol.h.
| typedef void(* ns3::anthocnet::RoutingProtocol::RouteChangedCallback) (uint32_t dest, uint32_t neighbor, bool added) |
Definition at line 78 of file anthocnet-routing-protocol.h.
| typedef void(* ns3::anthocnet::RoutingProtocol::MacReinjectCallback) (const Ipv4Header &header, Ptr< const Packet > packet) |
Definition at line 85 of file anthocnet-routing-protocol.h.
| ns3::anthocnet::RoutingProtocol::RoutingProtocol | ( | ) |
|
override |
|
static |
|
override |
|
override |
|
override |
| void ns3::anthocnet::RoutingProtocol::GetPheromoneDiag | ( | Ipv4Address | dest, |
| Ipv4Address | neighbor, | ||
| double & | regular, | ||
| double & | virt | ||
| ) | const |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
| int64_t ns3::anthocnet::RoutingProtocol::AssignStreams | ( | int64_t | stream | ) |
Seed the protocol's RNG; returns the number of streams used.
| 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.
|
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.
|
inline |
Definition at line 140 of file anthocnet-routing-protocol.h.
|
inline |
Definition at line 143 of file anthocnet-routing-protocol.h.
|
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.
|
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.
|
inline |
Definition at line 161 of file anthocnet-routing-protocol.h.
|
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.
|
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.
|
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.
|
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.
|
overrideprotected |
|
overrideprotected |
|
inlinestatic |
Definition at line 202 of file anthocnet-routing-protocol.h.
|
inlinestatic |
Definition at line 207 of file anthocnet-routing-protocol.h.
|
static |
UDP port for ant control traffic.
Definition at line 70 of file anthocnet-routing-protocol.h.