34 #ifndef EMANEMODELSIEEE802ABGNEIGHBORMANAGER_HEADER_ 35 #define EMANEMODELSIEEE802ABGNEIGHBORMANAGER_HEADER_ 57 namespace IEEE80211ABG
78 float fRxPowerMilliWatts,
81 std::uint8_t u8Category);
86 float fRxPowerMilliWatts,
89 std::uint8_t u8Category);
140 using NeighborEntryMap = std::map<NEMId, NeighborEntry>;
142 using NeighborEntryInsertResult = std::pair<NeighborEntryMap::iterator, bool>;
144 using Neighbor2HopEntryMap = std::map<NEMId, Neighbor2HopEntry>;
146 using Neighbor2HopEntryInsertResult = std::pair<Neighbor2HopEntryMap::iterator, bool>;
148 using NbrSetMap = std::map<NEMId, NbrSet>;
150 using NbrUtilizationMap = std::map<NEMId, Microseconds>;
152 using ProbabilityPair = std::pair<float, float>;
154 using ProbabilityPairMap = std::map<NEMId, ProbabilityPair>;
156 using ProbabilityPairMapMap = std::map<NEMId, ProbabilityPairMap>;
158 using RxPowerMap = std::map<NEMId, float>;
168 NeighborEntryMap oneHopNbrMap_;
170 Neighbor2HopEntryMap twoHopNbrMap_;
172 NbrSetMap cachedOneHopNbrSetMap_;
178 size_t totalOneHopNumPackets_;
180 size_t totalTwoHopNumPackets_;
182 size_t numTotalActiveOneHopNeighbors_;
186 float fAverageRxPowerPerMessageMilliWatts_;
188 float fTotalRxPowerMilliWatts_;
190 Microseconds averageUtilizationPerOneHopNbrMicroseconds_;
192 Microseconds averageUtilizationPerTwoHopNbrMicroseconds_;
194 float fEstimatedNumOneHopNeighbors_;
196 float fEstimatedNumTwoHopNeighbors_;
200 size_t sumCommonPackets_;
202 size_t sumHiddenPackets_;
204 float fCommonRxPowerMilliWatts_;
206 float fHiddenRxPowerMilliWatts_;
214 NbrUtilizationMap oneHopUtilizationMap_;
216 NbrUtilizationMap twoHopUtilizationMap_;
218 ProbabilityPairMapMap commonProbabilityMapMap_;
220 ProbabilityPairMapMap hiddenProbabilityMapMap_;
222 RxPowerMap commonNbrAvgRxPowerMwMap_;
224 RxPowerMap hiddenNbrAvgRxPowerMwMap_;
229 std::uniform_real_distribution<float>> RNDZeroToOne_;
237 void sendOneHopNbrListEvent_i();
239 bool flushOneHopNeighbors_i(
const TimePoint & tvCurrentTime,
const Microseconds & timeOutMicroseconds);
241 bool flushTwoHopNeighbors_i(
const TimePoint & tvCurrentTime,
const Microseconds & timeOutMicroseconds);
243 void resetCounters_i();
245 void calculateBwUtilization_i(
const Microseconds & deltaTMicroseconds);
247 NeighborEntryInsertResult addOneHopNeighbor_i(
NEMId src);
249 Neighbor2HopEntryInsertResult addTwoHopNeighbor_i(
NEMId src);
257 float getChannelActivity_i(
const Microseconds & utilizationMicroseconds,
const Microseconds & deltaTMicroseconds)
const;
259 void setCommonAndHiddenProbability_i();
261 ProbabilityPairMap setProbability_i(
NEMId id,
const NbrUtilizationMap & map,
263 const NbrSet & nbrSet,
const char * str)
const;
265 float getRandomRxPowerMilliWatts_i(
NEMId src,
float R1,
266 const ProbabilityPairMapMap & pmap,
267 const RxPowerMap & rmap)
const;
272 #endif //EMANEMODELSIEEE802ABGNEIGHBORMANAGER_HEADER_ float getLocalNodeTx() const
size_t getTotalActiveOneHopNeighbors() const
std::string Serialization
float getAverageRxPowerPerMessageMilliWatts() const
void handleOneHopNeighborsEvent(const Serialization &serialization)
void registerStatistics(StatisticRegistrar &statisticRegistrar)
void setNeighborTimeoutMicroseconds(const Microseconds &timeOutMicroseconds)
float getNumberOfEstimatedTwoHopNeighbors() const
std::vector< UtilizationRatioPair > UtilizationRatioVector
Microseconds getAllUtilizationMicroseconds(NEMId src) const
float getHiddenChannelActivity(NEMId src) const
float getAverageRxPowerPerMessageCommonNodesMilliWatts() const
float getNumberOfEstimatedCommonNeighbors(NEMId src) const
void updateCtrlChannelActivity(NEMId src, NEMId origin, std::uint8_t type, float fRxPowerMilliWatts, const TimePoint &tvTime, const Microseconds &duration, std::uint8_t u8Category)
The StatisticRegistrar allows NEM layers to register statistics and statistic tables. Statistics and Statistic tables are owned by the emulator framework and a borrowed reference is returned to the registering NEM layer.
Defines the ieee 80211 abg 1 and 2 hop neighbor manager.
float getRandomRxPowerCommonNodesMilliWatts(NEMId src)
void setCategories(std::uint8_t u8NumCategories)
std::chrono::microseconds Microseconds
Microseconds getTotalOneHopUtilizationMicroseconds() const
NeighborManager(NEMId id, PlatformServiceProvider *pPlatformService, MACLayer *pMgr)
float getNumberOfEstimatedHiddenNeighbors(NEMId src) const
std::set< EMANE::NEMId > NbrSet
float getNumberOfEstimatedOneHopNeighbors() const
Microseconds getTotalTwoHopUtilizationMicroseconds() const
float getRandomRxPowerHiddenNodesMilliWatts(NEMId src)
Microseconds getAverageMessageDurationMicroseconds() const
Clock::time_point TimePoint
void updateDataChannelActivity(NEMId src, std::uint8_t type, float fRxPowerMilliWatts, const TimePoint &timePoint, const Microseconds &duration, std::uint8_t u8Category)
TimePoint getLastOneHopNbrListTxTime() const
A utility wrapper around a generator and a distribution.
float getAverageRxPowerPerMessageHiddenNodesMilliWatts() const
IEEE 80211 ABG MAC implementation.
WMMManager::UtilizationRatioVector getUtilizationRatios()