net/netstats: L1/L2 per neighbor statistics#14448
Conversation
3087601 to
3e98f6c
Compare
07c21fa to
e199d59
Compare
b6e89b2 to
c6a175d
Compare
57db5fe to
582786d
Compare
|
I've given this a first practical test by adding all the netstats_neighbor_* from the other example to an gnrc_border_router, where the BR is a nrf52840dongle that talks to a particle-xenon and another nrf52840dongle; both leaf nodes were continuously being pinged from upstream, and I varied the transmission properties by moving water containers into the leaf node's near field (ie touched the board). In the quick test, the LQI and RSSI values were plausible ("-73 dBm 90" -- not great, not terrible). Other data stayed empty (while the received counter went up, sent and average tx time was 0 throughout) until I enabled more netstats (l2, ipv6, rpl) that were already active in the GNRC example -- are they actual dependencies? ETX stayed at 200% for all links; I presume that'd need additional work for the nrf802154 driver? When I powered off one of the leaves, its stats stayed constant (with the fresh=16) for minutes, even after I tried pinging them from the netstats board. That's consistent with the 10 minutes default before halving. Is that a good strategy? Allowing radio contact every five minutes for just a few packages to come through suffices to get what appears on the neigh interface to be a perfectly viable link, even though it only works while some door is open. On the BR node, I'm seeing stats not only for the 6lo interfaces but for all. It's probably not urgent in this initial iteration, but is there a roadmap to not storing practically irrelevant stats there? (CDC-ECM is quite stable ;-) ) |
ETX relies on |
Can you try with
Good point!
Hmm I must admit that I didn't look much into how the 'freshness' is supposed to be used.
How about just leaving it at 0 and then handling it like LQI and RSSI (if it's 0 set the value directly, otherwise use EWMA). Then we can always handle 0 as invalid. In an ideal world, all drivers would already be ported to the sub-mac and then we would fall back to software retransmissions if ETX stats are requested and the hardware does not support reporting them. |
That makes it go down from 200% to 100% initially (as confidence is gained that the device is there), but levels at 100% even when I observe a loss of around 3% (which in first approximation means 105% ETX) or unplug the device for a minute. Funnily, it even keeps going down to 100% if, after a reboot, it is unplugged when the ETX is around 105%. |
|
Ah edit nvm, still reports 0 |
|
ACKs are not enabled by default with the sub-MAC. I get the expected results. |
There was a problem hiding this comment.
Tested on the IoT-LAB @ Grenoble-Site:
Details
1612547335.027789;m3-102;ifconfig
1612547335.029176;m3-101;ifconfig
1612547335.030352;m3-102;Iface 6 HWaddr: 37:3F Channel: 26 Page: 0 NID: 0x23 PHY: O-QPSK
1612547335.030546;m3-102;
1612547335.030868;m3-101;Iface 6 HWaddr: 1F:60 Channel: 26 Page: 0 NID: 0x23 PHY: O-QPSK
1612547335.030987;m3-101;
1612547335.031278;m3-102; Long HWaddr: BA:D0:5B:74:8D:B9:37:3F
1612547335.032674;m3-102; TX-Power: 0dBm State: IDLE max. Retrans.: 3 CSMA Retries: 4
1612547335.033352;m3-101; Long HWaddr: A6:DA:E9:93:B3:CC:9F:60
1612547335.033490;m3-101; TX-Power: 0dBm State: IDLE max. Retrans.: 3 CSMA Retries: 4
1612547335.035965;m3-101; AUTOACK ACK_REQ CSMA L2-PDU:102 MTU:1280 HL:64 RTR
1612547335.036167;m3-101; 6LO IPHC
1612547335.036388;m3-102; AUTOACK ACK_REQ CSMA L2-PDU:102 MTU:1280 HL:64 RTR
1612547335.036494;m3-102; 6LO IPHC
1612547335.037185;m3-101; Source address length: 8
1612547335.037288;m3-101; Link type: wireless
1612547335.037408;m3-102; Source address length: 8
1612547335.037503;m3-102; Link type: wireless
1612547335.038541;m3-102; inet6 addr: fe80::b8d0:5b74:8db9:373f scope: link VAL
1612547335.038802;m3-101; inet6 addr: fe80::a4da:e993:b3cc:9f60 scope: link VAL
1612547335.039775;m3-102; inet6 group: ff02::2
1612547335.039971;m3-102; inet6 group: ff02::1
1612547335.040149;m3-101; inet6 group: ff02::2
1612547335.040891;m3-102; inet6 group: ff02::1:ffb9:373f
1612547335.041004;m3-102;
1612547335.041320;m3-101; inet6 group: ff02::1
1612547335.041415;m3-101; inet6 group: ff02::1:ffcc:9f60
1612547335.041495;m3-101;
1612547335.042022;m3-102; Statistics for Layer 2
1612547335.042666;m3-101; Statistics for Layer 2
1612547335.042759;m3-101; RX packets 4 bytes 172
1612547335.043137;m3-102; RX packets 3 bytes 129
1612547335.043234;m3-102; TX packets 4 (Multicast: 4) bytes 172
1612547335.044333;m3-101; TX packets 4 (Multicast: 4) bytes 172
1612547335.044527;m3-101; TX succeeded 4 errors 0
1612547335.044702;m3-102; TX succeeded 4 errors 0
1612547335.045375;m3-101; Statistics for IPv6
1612547335.045850;m3-102; Statistics for IPv6
1612547335.045955;m3-102; RX packets 3 bytes 192
1612547335.046858;m3-101; RX packets 4 bytes 256
1612547335.047068;m3-102; TX packets 4 (Multicast: 4) bytes 256
1612547335.048187;m3-101; TX packets 4 (Multicast: 4) bytes 256
1612547335.048414;m3-101; TX succeeded 4 errors 0
1612547335.048526;m3-101;
1612547335.048719;m3-102; TX succeeded 4 errors 0
1612547335.048794;m3-102;
neigh
1612547351.945720;m3-101;> neigh
1612547351.945985;m3-102;> neigh
1612547351.947440;m3-101;Neighbor link layer stats:
1612547351.947687;m3-101;L2 address fresh etx sent received rssi lqi avg tx time
1612547351.947846;m3-102;Neighbor link layer stats:
1612547351.947945;m3-102;L2 address fresh etx sent received rssi lqi avg tx time
1612547351.950340;m3-102;-------------------------------------------------------------------------
1612547351.952069;m3-101;-------------------------------------------------------------------------
1612547351.952298;m3-101;BA:D0:5B:74:8D:B9:37:3F 5 200% 0 5 -35 dBm 255 0 µs
1612547351.952448;m3-102;A6:DA:E9:93:B3:CC:9F:60 4 200% 0 4 -34 dBm 255 0 µs
m3-101;ping6 fe80::b8d0:5b74:8db9:373f
1612547366.086402;m3-101;> ping6 fe80::b8d0:5b74:8db9:373f
1612547366.095017;m3-101;12 bytes from fe80::b8d0:5b74:8db9:373f%6: icmp_seq=0 ttl=64 rssi=-35 dBm time=6.289 ms
1612547367.097566;m3-101;12 bytes from fe80::b8d0:5b74:8db9:373f%6: icmp_seq=1 ttl=64 rssi=-35 dBm time=8.522 ms
1612547368.097486;m3-101;12 bytes from fe80::b8d0:5b74:8db9:373f%6: icmp_seq=2 ttl=64 rssi=-34 dBm time=8.841 ms
1612547368.097682;m3-101;
1612547368.098759;m3-101;--- fe80::b8d0:5b74:8db9:373f PING statistics ---
1612547368.100137;m3-101;3 packets transmitted, 3 packets received, 0% packet loss
1612547368.101777;m3-101;round-trip min/avg/max = 6.289/7.884/8.841 ms
neigh
1612547372.243304;m3-101;> neigh
1612547372.243608;m3-102;> neigh
1612547372.245013;m3-101;Neighbor link layer stats:
1612547372.246061;m3-101;L2 address fresh etx sent received rssi lqi avg tx time
1612547372.246288;m3-102;Neighbor link layer stats:
1612547372.246406;m3-102;L2 address fresh etx sent received rssi lqi avg tx time
1612547372.247064;m3-102;-------------------------------------------------------------------------
1612547372.247222;m3-101;-------------------------------------------------------------------------
1612547372.249026;m3-101;BA:D0:5B:74:8D:B9:37:3F 12 200% 3 9 -35 dBm 255 2958 µs
1612547372.249260;m3-102;A6:DA:E9:93:B3:CC:9F:60 11 200% 3 8 -34 dBm 255 3028 µs
Works like a charm, just some tweaks for "modern RIOT" remaining.
| static inline bool l2util_addr_equal(const uint8_t *addr_a, uint8_t addr_a_len, | ||
| const uint8_t *addr_b, uint8_t addr_b_len) | ||
| { | ||
| if (addr_a_len != addr_b_len) { | ||
| return false; | ||
| } | ||
|
|
||
| return memcmp(addr_a, addr_b, addr_a_len) == 0; | ||
| } |
There was a problem hiding this comment.
A test for this in tests/l2util would be nice, but can be done in a follow-up :-).
miri64
left a comment
There was a problem hiding this comment.
Some last style and code improvement nits remain. Other then that, this ready to merge, so please squash immediately.
| @@ -0,0 +1 @@ | |||
| ../driver_netdev_common/main.c No newline at end of file | |||
There was a problem hiding this comment.
I like when people know how to use Git features 🙂
7946254 to
f1c3509
Compare
|
Rebased again to the merge of #15694 |
f1c3509 to
26ec165
Compare
Soft-ACK from my side. @maribu could you give this one final look regarding the usage of tx_sync in gnrc_netif's _send? Just to be on the save side.
|
Please squash |
`gnrc_netdev_default` is a pseudomodule, what this driver really wants is gnrc_netif.
58861f6 to
cc9c58a
Compare
Contribution description
This is a rebase of a previous PR to add a database for neighborhood metrics.
Those are needed for generating better routes with RPL (MR-HOF #7450).
I think it makes sense to attach this directly to the
netifnetdev as originally proposed as those statistics are per-interface anyway.Only rebase & slight cleanup done so far.
Testing procedure
When running
examples/gnrc_networkingyou should now have aneighcommand that prints statistics about neighbors.Issues/PRs references
taken over from #6873
needed for #14623