# otMacCounters Struct Reference

# otMacCounters


`#include <openthread/link.h>`

Represents the MAC layer counters.

## Summary

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1ae3fa4acc5ae0a29436b364383c43bad0` | `uint32_t` The total number of frames dropped by MAC Filter module, for example received from denylisted node. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a268f88ede5a03e4a35f66e498d2c9d11` | `uint32_t` The total number of MAC Beacon frames received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1acc3d85e3a7d42824e3ebdfae943d3548` | `uint32_t` The total number of MAC Beacon Request frames received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a09144ba1d5bc3be109dbaf81e38b8691` | `uint32_t` The total number of broadcast frames received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a4e8775dffa13d2601b2246d9e05962e9` | `uint32_t` The total number of MAC Data frames received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a9a7289ab06058de8753d30aaa790a2e4` | `uint32_t` The total number of MAC Data Poll frames received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1abc684fc2326fd982e3861008524bd469` | `uint32_t` The total number of frames dropped by destination address check, for example received frame for other node. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1ad5d33241786a951797ae579fe5d90b77` | `uint32_t` The total number of frames dropped due to duplication, that is when the frame has been already received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a4a9efcd5ceddd3d677e5c952e3227fd2` | `uint32_t` The total number of frames dropped due to invalid FCS. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1aceac1f44809dc258d50d75172245bb85` | `uint32_t` The total number of frames dropped due to invalid source address. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1aa7df29fd79b1c36ab799b8f370685d13` | `uint32_t` The total number of frames dropped because of missing or malformed content. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1ab98951ae19946088f17377a62b91bb3d` | `uint32_t` The total number of frames dropped due to other error. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1aa67d413929294ce8c29240fd9fa8d7aa` | `uint32_t` The total number of frames dropped due to security error. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a3378570acb28312daa927523478a3714` | `uint32_t` The total number of frames dropped due to unknown neighbor. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a3b5bfead95b87cde898943a011dd6f70` | `uint32_t` The total number of other types of frames received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1ae848ba216ad2d80f742ef394e6c6c2d1` | `uint32_t` The total number of received frames. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1af8afcce1d306b474df8b96b8358cf92b` | `uint32_t` The total number of unicast frames received. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a2b16e17f0f5e3f71fa75b1bc43352952` | `uint32_t` The total number of unique MAC frame transmission requests with requested acknowledgment. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1adaeb29a8293cd9241167cde973fd617c` | `uint32_t` The total number of unique MAC frame transmission requests that were acked. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a02288065966f2509e02b56bc64897fe7` | `uint32_t` The total number of unique MAC Beacon frame transmission requests. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1ad4b64712d64ce207dcdca59643635472` | `uint32_t` The total number of unique MAC Beacon Request frame transmission requests. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a809c8ef6d2f846763514346b3408035a` | `uint32_t` The total number of unique broadcast MAC frame transmission requests. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a7d9aa8b8ca564418854b95f7f14b1da0` | `uint32_t` The total number of unique MAC Data frame transmission requests. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1adce64ac3658c57a0c74403ac960f89ff` | `uint32_t` The total number of unique MAC Data Poll frame transmission requests. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a6ff7ddc66b5da2957d0d068b2cecc576` | `uint32_t` The total number of unique MAC transmission packets that meet maximal retry limit for direct packets. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a6e3a493ff4de5741fbbd8eda8384b088` | `uint32_t` The total number of unique MAC transmission request failures cause by an abort error. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a400bc529252b5eff1094d7e36e870faa` | `uint32_t` The total number of unique MAC transmission requests failures caused by a busy channel (a CSMA/CA fail). |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1ab18c5b5a102d840c44b90636da554cf8` | `uint32_t` The total number of CCA failures. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a7db69263ccfdf43b83d04ab4394f74f2` | `uint32_t` The total number of unique MAC transmission packets that meet maximal retry limit for indirect packets. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1aa3bfbcc703129394f81ab3db2438789d` | `uint32_t` The total number of unique MAC frame transmission requests without requested acknowledgment. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a2a61049b39c31bb87b37ce88cac61c3a` | `uint32_t` The total number of unique other MAC frame transmission requests. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1a7f160d2676bc1f1f85efe25257b0b517` | `uint32_t` The total number of MAC retransmission attempts. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1ae4fef816e5d6b59fffcb4306083c34ed` | `uint32_t` The total number of unique MAC frame transmission requests. |
| `https://openthread.io/reference/struct/ot-mac-counters#structot_mac_counters_1aa1c0c26b08f5106fa5a59385b4206da5` | `uint32_t` The total number of unique unicast MAC frame transmission requests. |

## Public attributes

### mRxAddressFiltered

```
uint32_t otMacCounters::mRxAddressFiltered
```
The total number of frames dropped by MAC Filter module, for example received from denylisted node.

### mRxBeacon

```
uint32_t otMacCounters::mRxBeacon
```
The total number of MAC Beacon frames received.

### mRxBeaconRequest

```
uint32_t otMacCounters::mRxBeaconRequest
```
The total number of MAC Beacon Request frames received.

### mRxBroadcast

```
uint32_t otMacCounters::mRxBroadcast
```
The total number of broadcast frames received.

### mRxData

```
uint32_t otMacCounters::mRxData
```
The total number of MAC Data frames received.

### mRxDataPoll

```
uint32_t otMacCounters::mRxDataPoll
```
The total number of MAC Data Poll frames received.

### mRxDestAddrFiltered

```
uint32_t otMacCounters::mRxDestAddrFiltered
```
The total number of frames dropped by destination address check, for example received frame for other node.

### mRxDuplicated

```
uint32_t otMacCounters::mRxDuplicated
```
The total number of frames dropped due to duplication, that is when the frame has been already received.

This counter may be incremented, for example when ACK frame generated by the receiver hasn't reached transmitter node which performed retransmission.

### mRxErrFcs

```
uint32_t otMacCounters::mRxErrFcs
```
The total number of frames dropped due to invalid FCS.

### mRxErrInvalidSrcAddr

```
uint32_t otMacCounters::mRxErrInvalidSrcAddr
```
The total number of frames dropped due to invalid source address.

### mRxErrNoFrame

```
uint32_t otMacCounters::mRxErrNoFrame
```
The total number of frames dropped because of missing or malformed content.

### mRxErrOther

```
uint32_t otMacCounters::mRxErrOther
```
The total number of frames dropped due to other error.

### mRxErrSec

```
uint32_t otMacCounters::mRxErrSec
```
The total number of frames dropped due to security error.

This counter may be incremented, for example when lower than expected Frame Counter is used to encrypt the frame.

### mRxErrUnknownNeighbor

```
uint32_t otMacCounters::mRxErrUnknownNeighbor
```
The total number of frames dropped due to unknown neighbor.

### mRxOther

```
uint32_t otMacCounters::mRxOther
```
The total number of other types of frames received.

### mRxTotal

```
uint32_t otMacCounters::mRxTotal
```
The total number of received frames.

This counter counts all frames reported by the platform's radio driver, including frames that were dropped, for example because of an FCS error.

### mRxUnicast

```
uint32_t otMacCounters::mRxUnicast
```
The total number of unicast frames received.

### mTxAckRequested

```
uint32_t otMacCounters::mTxAckRequested
```
The total number of unique MAC frame transmission requests with requested acknowledgment.

### mTxAcked

```
uint32_t otMacCounters::mTxAcked
```
The total number of unique MAC frame transmission requests that were acked.

### mTxBeacon

```
uint32_t otMacCounters::mTxBeacon
```
The total number of unique MAC Beacon frame transmission requests.

### mTxBeaconRequest

```
uint32_t otMacCounters::mTxBeaconRequest
```
The total number of unique MAC Beacon Request frame transmission requests.

### mTxBroadcast

```
uint32_t otMacCounters::mTxBroadcast
```
The total number of unique broadcast MAC frame transmission requests.

### mTxData

```
uint32_t otMacCounters::mTxData
```
The total number of unique MAC Data frame transmission requests.

### mTxDataPoll

```
uint32_t otMacCounters::mTxDataPoll
```
The total number of unique MAC Data Poll frame transmission requests.

### mTxDirectMaxRetryExpiry

```
uint32_t otMacCounters::mTxDirectMaxRetryExpiry
```
The total number of unique MAC transmission packets that meet maximal retry limit for direct packets.

### mTxErrAbort

```
uint32_t otMacCounters::mTxErrAbort
```
The total number of unique MAC transmission request failures cause by an abort error.

### mTxErrBusyChannel

```
uint32_t otMacCounters::mTxErrBusyChannel
```
The total number of unique MAC transmission requests failures caused by a busy channel (a CSMA/CA fail).

### mTxErrCca

```
uint32_t otMacCounters::mTxErrCca
```
The total number of CCA failures.

The meaning of this counter can be different and it depends on the platform's radio driver capabilities.

If [OT_RADIO_CAPS_CSMA_BACKOFF](https://openthread.io/reference/group/radio-types#group__radio-types_1ggabc5c98fcc1211af2b80116dd6e0a035daa2daca978ba32e2c8d066d6cbba1bef5) is enabled, this counter represents the total number of full CSMA/CA failed attempts and it is incremented by one also for each retransmission (in case of a CSMA/CA fail).

If [OT_RADIO_CAPS_TRANSMIT_RETRIES](https://openthread.io/reference/group/radio-types#group__radio-types_1ggabc5c98fcc1211af2b80116dd6e0a035da97a80e5760039794583709129012a023) is enabled, this counter represents the total number of full CSMA/CA failed attempts and it is incremented by one for each individual data frame request (regardless of the amount of retransmissions).

### mTxIndirectMaxRetryExpiry

```
uint32_t otMacCounters::mTxIndirectMaxRetryExpiry
```
The total number of unique MAC transmission packets that meet maximal retry limit for indirect packets.

### mTxNoAckRequested

```
uint32_t otMacCounters::mTxNoAckRequested
```
The total number of unique MAC frame transmission requests without requested acknowledgment.

### mTxOther

```
uint32_t otMacCounters::mTxOther
```
The total number of unique other MAC frame transmission requests.

This counter is currently used for counting out-of-band frames.

### mTxRetry

```
uint32_t otMacCounters::mTxRetry
```
The total number of MAC retransmission attempts.

Note that this counter is incremented by one for each retransmission attempt that may be triggered by lack of acknowledgement, CSMA/CA failure, or other type of transmission error. The `mTxRetry` counter is incremented both for unicast and broadcast MAC frames.

Modify the following configuration parameters to control the amount of retransmissions in the system:


- OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT
- OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT
- OPENTHREAD_CONFIG_MAC_TX_NUM_BCAST
- OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
- OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_INDIRECT

<br />

Currently, this counter is invalid if the platform's radio driver capability includes [OT_RADIO_CAPS_TRANSMIT_RETRIES](https://openthread.io/reference/group/radio-types#group__radio-types_1ggabc5c98fcc1211af2b80116dd6e0a035da97a80e5760039794583709129012a023).

### mTxTotal

```
uint32_t otMacCounters::mTxTotal
```
The total number of unique MAC frame transmission requests.

Note that this counter is incremented for each MAC transmission request only by one, regardless of the amount of CCA failures, CSMA-CA attempts, or retransmissions.

This increment rule applies to the following counters:

- `mTxUnicast`
- `mTxBroadcast`
- `mTxAckRequested`
- `mTxNoAckRequested`
- `mTxData`
- `mTxDataPoll`
- `mTxBeacon`
- `mTxBeaconRequest`
- `mTxOther`
- `mTxErrAbort`
- `mTxErrBusyChannel`

<br />

The following equations are valid:

- `mTxTotal` = `mTxUnicast` + `mTxBroadcast`
- `mTxTotal` = `mTxAckRequested` + `mTxNoAckRequested`
- `mTxTotal` = `mTxData` + `mTxDataPoll` + `mTxBeacon` + `mTxBeaconRequest` + `mTxOther`

<br />

### mTxUnicast

```
uint32_t otMacCounters::mTxUnicast
```
The total number of unique unicast MAC frame transmission requests.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).