EMANE  1.2.1
macstatistics.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013,2016 - Adjacent Link LLC, Bridgewater, New Jersey
3  * Copyright (c) 2008 - DRS CenGen, LLC, Columbia, Maryland
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * * Neither the name of DRS CenGen, LLC nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef EMANEMODELSIEEE802ABGMACSTATISTICS_HEADER_
35 #define EMANEMODELSIEEE802ABGMACSTATISTICS_HEADER_
36 
37 #include "macconfig.h"
38 
40 #include "emane/statisticnumeric.h"
41 
42 #include <map>
43 #include <vector>
44 
45 namespace EMANE
46 {
47  namespace Models
48  {
49  namespace IEEE80211ABG
50  {
51 
58  {
59  /*
60  * Statistic timers
61  */
62  public:
64 
66 
67  // discards
70 
73 
76 
79 
82 
85 
88 
91 
92  void updateOneHopNbrHighWaterMark(size_t num);
93  void updateTwoHopNbrHighWaterMark(size_t num);
94 
95  // events
99 
100  void registerStatistics(StatisticRegistrar & statisticRegistrar);
101 
102  private:
103  EMANE::NEMId id_;
104 
110  StatisticNumeric<std::uint32_t> * pNumDownstreamUnicastDataDiscardDueToRetries_;
111  StatisticNumeric<std::uint32_t> * pNumDownstreamUnicastRtsCtsDataDiscardDueToRetries_;
112 
113  StatisticNumeric<std::uint32_t> * pNumUpstreamUnicastDataDiscardDueToSinr_;
114  StatisticNumeric<std::uint32_t> * pNumUpstreamBroadcastDataDiscardDueToSinr_;
115 
116  StatisticNumeric<std::uint32_t> * pNumUpstreamUnicastDataDiscardDueToClobberRxDuringTx_;
117  StatisticNumeric<std::uint32_t> * pNumUpstreamBroadcastDataDiscardDueToClobberRxDuringTx_;
118 
119  StatisticNumeric<std::uint32_t> * pNumUpstreamUnicastDataDiscardDueToClobberRxHiddenBusy_;
120  StatisticNumeric<std::uint32_t> * pNumUpstreamBroadcastDataDiscardDueToClobberRxHiddenBusy_;
121 
122  StatisticNumeric<std::uint32_t> * pNumDownstreamUnicastDataDiscardDueToTxop_;
123  StatisticNumeric<std::uint32_t> * pNumDownstreamBroadcastDataDiscardDueToTxop_;
124 
125  StatisticNumeric<std::uint32_t> * pNumUpstreamUnicastRtsCtsDataRxFromPhy_;
126  StatisticNumeric<std::uint32_t> * pNumUpstreamUnicastCtsRxFromPhy_;
127 
128  StatisticNumeric<std::uint32_t> * pNumUpstreamUnicastDataNoiseHiddenRx_;
129  StatisticNumeric<std::uint32_t> * pNumUpstreamBroadcastDataNoiseHiddenRx_;
130 
131  StatisticNumeric<std::uint32_t> * pNumUpstreamUnicastDataNoiseRxCommon_;
132  StatisticNumeric<std::uint32_t> * pNumUpstreamBroadcastDataNoiseRxCommon_;
133 
134  StatisticNumeric<std::uint32_t> * pNumOneHopNbrHighWaterMark_;
135  StatisticNumeric<std::uint32_t> * pNumTwoHopNbrHighWaterMark_;
136 
137  StatisticNumeric<std::uint32_t> * pNumRxOneHopNbrListEvents_;
138  StatisticNumeric<std::uint32_t> * pNumRxOneHopNbrListInvalidEvents_;
139  StatisticNumeric<std::uint32_t> * pNumTxOneHopNbrListEvents_;
140  };
141  }
142  }
143 }
144 #endif //EMANEMODELSIEEE802ABGMACSTATISTICS_HEADER_
void updateTwoHopNbrHighWaterMark(size_t num)
set the two hop nbr high water mark
void incrementUpstreamUnicastDataDiscardDueToSinr()
increment unicast data discard due to sinr
void incrementUpstreamBroadcastDataDiscardDueToSinr()
increment braodcast data discard due to sinr
void incrementRxOneHopNbrListEventCount()
increment number rx one hop nbr list events
MACStatistics(EMANE::NEMId)
constructor
void incrementTxOneHopNbrListEventCount()
increment number tx one hop nbr list events
void incrementUpstreamUnicastDataDiscardDueToClobberRxDuringTx()
increment unicast data discard due to collision rx during tx
void incrementUpstreamBroadcastNoiseHiddenRx()
increment braodcastcast data collision due to hidden rx
void incrementDownstreamUnicastRtsCtsDataDiscardDueToRetries()
increment braodcast data discard due to exhausted retries
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.
void incrementUpstreamBroadcastNoiseRxCommon()
increment unicastcast data collision due to rx common
void updateOneHopNbrHighWaterMark(size_t num)
set the one hop nbr high water mark
class used to define the mac layer statistic items
Definition: macstatistics.h:57
void incrementUpstreamUnicastNoiseRxCommon()
increment braodcastcast data collision due to rx common
std::uint16_t NEMId
Definition: types.h:52
void incrementDownstreamUnicastDataDiscardDueToRetries()
increment unicast data discard due to exhausted retries
void incrementUpstreamUnicastDataDiscardDueToClobberRxHiddenBusy()
increment unicast data discard due to collision rx busy hidden
void incrementUpstreamUnicastNoiseHiddenRx()
increment unicastcast data collision due to hidden rx
void registerStatistics(StatisticRegistrar &statisticRegistrar)
void incrementUpstreamBroadcastDataDiscardDueToClobberRxHiddenBusy()
increment braodcast data discard due to collision rx busy hidden
void incrementDownstreamUnicastDataDiscardDueToTxop()
increment unicast data discard due to txop expired
void incrementUpstreamUnicastCtsRxFromPhy()
increment unicast cts recv from phy
void incrementDownstreamBroadcastDataDiscardDueToTxop()
increment unicast data discard due to txop expired
void incrementRxOneHopNbrListInvalidEventCount()
increment number rx one hop nbr list invalid events
Definition: agent.h:43
void incrementUpstreamBroadcastDataDiscardDueToClobberRxDuringTx()
increment braodcast data discard due to collision rx during tx
void incrementUpstreamUnicastRtsCtsDataRxFromPhy()
increment unicast rts/ctsdata recv from phy