netstats: add counter for retransmissions#11836
Conversation
| (either acknowledged or unconfirmed | ||
| sending operation, e.g. multicast) */ | ||
| uint32_t tx_failed; /**< failed sending operations */ | ||
| uint32_t tx_retrans; /**< total number of retransmissions */ |
There was a problem hiding this comment.
AFAIK (at least on the Atmel radio) this is not the total number of retransmissions but the number of transmissions where all retransmission attemts failed to get an ACK back.
There was a problem hiding this comment.
I think that comment was supposed to the event handler? And isn't this the same? At least that is what we used in the past to count L2 retransmissions in our experiments. Or am I misunderstanding something?
There was a problem hiding this comment.
Ideally, we would count the absolute number of retransmissions here but this is not always the case (only speaking for the Atmel radio, we would need to lookup others). When this interrupt fires, MAX_RETIRES retransmissions failed to get an ACK, which is 4 by default. When an ACK appears after the second retransmission you won't notice.
There was a problem hiding this comment.
If this event imposes radio-specific corner cases to the upper layer, the design is already broken. So we should really be sure what this event does exactly.
There was a problem hiding this comment.
So we should really be sure what this event does exactly.
Behavior of the Atmel radio was explained above. Next would be to find out handling on other devices.
There was a problem hiding this comment.
I remember a really old question from @OlegHahm asking if I knew how to get the hardware auto-retransmission counter, and I think we did not find anything.
So if the re-transmission is done by the hardware itself, it would not be noticed.
I think that is what Peter is talking about.
There was a problem hiding this comment.
@PeterKietzmann I think in some old branch of mine I fiddled around with setting the retry amount to zero and handle the retransmissions within the driver, but I don't remember the details any more.
There was a problem hiding this comment.
Thanks for your feedback. @cladmi yes, at least this is the case for AT86RF2XX. No idea about other devices that we support. @OlegHahm yes I know, that was even a (never merged) PR of yours that I reference from time to time.
To conclude: If "all" other devices than the Atmel radio do support this count, we could go with this PR. If not we might delay the discussion until there is more from the software MAC initiative (by @jia200x )
There was a problem hiding this comment.
Ok. I'm leaving this PR open for now for later reference though (or if we need the counter for experiments again ;-)).
There was a problem hiding this comment.
It should not be used for experiments with samr21-xpro or iotlab-m3 though or results would be based on a too low value.
|
Although having this kind of statistic would be great, this counter is misleading with the current state of integration. Radios that we know of don't report the actual number of retries and a software retransmission method is still absent (or am I mistaken)? I propose to close this PR with memo label set and tackle the task a little bit later when @jia200x continues his work on the lower layers. Do you agree @miri64? In any way, I will remove the release milestone tag. |
|
How about renaming the counter to something like |
|
First, merging this PR should IMO not be about the need for this counter in some individual experiments. Second, we never actually used this metric. Personally, I only look at this counter ( next to CSMA failure counter) to get an idea about link quality. Third, this event does not actually reflect the number of missing ACKs (as explained above) and it is very hardware specific, so I was even wondering weather we should implement this in a hardware specific module. As a compromise: What if we name it "experimental" and document it somehow? |
|
The AT86RF233 has a retransmission counter (see As @PeterKietzmann describes incrementing a counter on "NOACK" while only give a lower bound and doesn't represent the actual value. If we are going to add a retransmission counter, I would add at least a way to check if the radio support ACK retransmissions before displaying them to the user. They can be e.g dropped from the message. if(radio_supports_retrans_counter)
{
printf("retransmissions %u", stats->tx_retrans");
}So we get Instead of This Note that all radios running in Basic Mode with software IEEE802.15.4 implementation (WIP) will support the retransmission counter. So for experiments, it's possible to do this or use a radio that support the counter |
|
Note that for MAC layers supporting retransmission, the |
We used it for https://arxiv.org/pdf/1905.08089.pdf (Fig. 9(c)) and I was under the impression we used it for https://arxiv.org/pdf/1806.01444.pdf. But okay, if this is too device specific, then this shouldn't be included in |
(cherry picked from commit fe3e937, see RIOT-OS#11836)
(cherry picked from commit aa4b31a, see RIOT-OS#11836)
(cherry picked from commit 0c4e598, see RIOT-OS#11836)
Contribution description
This was cherry-picked out of #11068 (which became a huge mess during my experiment phase in preparation for the 6LoWPAN fragment forwarding paper.
This adds a retransmission counter to
netstats. It also adds an implementation of that counter tognrc_netifto countNETDEV_EVENT_TX_NOACKevents as retransmissions in the interface's netstats (as no ACK from the receiver implies a retransmission). Lastly, the shell command is extended to print out the new counter.Testing procedure
Flash
gnrc_networkingto two boards that have network devices that support retransmissions (I used twosamr21-xpromake termto both of them in two different terminals.Check if the retransmission counter for Layer 2 is 0
Let them ping each other with unicast addresses in short intervals to stress the medium:
ifconfigshould showretransmissions> 0 for Layer 2Issues/PRs references
Cherry-picked from #11068, but this PR has no dependencies.