[riot-notifications] [RIOT-OS/RIOT] gnrc_sixlowpan_frag_stats: initial import of frag statistics (#11835)

Martine Lenders notifications at github.com
Fri Jul 12 16:15:18 CEST 2019


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### 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](https://arxiv.org/abs/1905.08089).

This provides analytical tools for 6LoWPAN fragmentation and reassembly. A counter is introduced for

- reassembly buffer full events,
- fragmentation buffer full events, and
- VRB full events

Furthermore a shell command is introduced that prints these counters out.
<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->


### Testing procedure
The fragmentation buffer full counter and VRB full counter are not testable without a fragment forwarding scheme (e.g. #11068).

The reassembly buffer full counter can be tested by including the module `gnrc_sixlowpan_frag_stats` to `gnrc_networking`, configuring the reassembly buffer size to 1, building that application for a 6Lo-capable board (I used the `samr21-xpro`), and flashing it to two nodes:

```sh
USEMODULE=gnrc_sixlowpan_frag_stats CFLAGS=-DGNRC_SIXLOWPAN_FRAG_RBUF_SIZE=1 \
    make -C examples/gnrc_networking flash # to two nodes
```

On **node 1** check if the command was compiled in. Both available counters should be set to 0.

```
> help
2019-07-12 16:08:34,988 - INFO #  help
2019-07-12 16:08:34,991 - INFO # Command              Description
2019-07-12 16:08:34,994 - INFO # ---------------------------------------
2019-07-12 16:08:35,000 - INFO # udp                  send data over UDP and listen on UDP ports
2019-07-12 16:08:35,003 - INFO # reboot               Reboot the node
2019-07-12 16:08:35,009 - INFO # ps                   Prints information about running threads.
2019-07-12 16:08:35,012 - INFO # ping6                Ping via ICMPv6
2019-07-12 16:08:35,016 - INFO # random_init          initializes the PRNG
2019-07-12 16:08:35,021 - INFO # random_get           returns 32 bit of pseudo randomness
2019-07-12 16:08:35,026 - INFO # nib                  Configure neighbor information base
2019-07-12 16:08:35,031 - INFO # ifconfig             Configure network interfaces
2019-07-12 16:08:35,038 - INFO # rpl                  rpl configuration tool ('rpl help' for more information)
2019-07-12 16:08:35,042 - INFO # 6lo_frag             6LoWPAN fragment statistics
> 6lo_frag
2019-07-12 16:08:37,340 - INFO #  6lo_frag
2019-07-12 16:08:37,341 - INFO # rbuf full: 0
2019-07-12 16:08:37,342 - INFO # frag full: 0
```

Get the link-local address of **node 1**:

```
> ifconfig
[…]
2019-07-12 16:09:28,096 - INFO #           inet6 addr: fe80::7b65:822:8693:9d5a  scope: local  VAL
[…]
```

On **node 2** ping node 1 with a small interval (e.g. 10 ms) but larg-ish packet size (just require fragmentation, e.g. 128 bytes):

```
ping6 -i 10 -s 128 fe80::7b65:822:8693:9d5a
2019-07-12 16:12:38,078 - INFO #  ping6 -i 10 -s 128 fe80::7b65:822:8693:9d5a
2019-07-12 16:12:38,171 - INFO # 136 bytes from fe80::7b65:822:8693:9d5a: icmp_seq=2 ttl=64 rssi=-34 dBm time=44.766 ms
2019-07-12 16:12:39,118 - INFO # 
2019-07-12 16:12:39,122 - INFO # --- fe80::7b65:822:8693:9d5a PING statistics ---
2019-07-12 16:12:39,128 - INFO # 3 packets transmitted, 1 packets received, 66% packet loss
2019-07-12 16:12:39,132 - INFO # round-trip min/avg/max = 44.766/44.766/44.766 ms
```

It is expected for the success rate not to be that great, as we only have one reassembly buffer entry on node 1 (+ other effects like might interfere with this short amount of interval).

Check the `6lo_frag` command on **node 1**. `rbuf_full` should now be >0:

```
> 6lo_frag
2019-07-12 16:13:21,489 - INFO #  6lo_frag
2019-07-12 16:13:21,490 - INFO # rbuf full: 1
2019-07-12 16:13:21,492 - INFO # frag full: 0
```


<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references
Cherry-picked from #11068

Depends on #11000 as the statistics module was already ported for that in #11068.

![Route to 6Lo minimal fragment forwarding](http://page.mi.fu-berlin.de/mlenders/sixlo_minfwd.svg)
<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11835

-- Commit Summary --

  * gnrc_sixlowpan_frag: initial import of the VRB
  * tests: add unittests for gnrc_sixlowpan_frag_vrb
  * fixup! gnrc_sixlowpan_frag: add datagram size to base type
  * gnrc_sixlowpan_frag: include VRB in normal GC
  * fixup! gnrc_sixlowpan_frag: initial import of the VRB
  * fixup! tests: add unittests for gnrc_sixlowpan_frag_vrb
  * Merge branch 'gnrc_sixlowpan_frag/new/vrb' into gnrc_sixlowpan_frag/new/stats
  * gnrc_sixlowpan_frag_stats: initial import of frag statistics
  * shell_commands: add command to get 6lo frag statistics

-- File Changes --

    M makefiles/pseudomodules.inc.mk (1)
    M sys/include/net/gnrc/sixlowpan/config.h (31)
    M sys/include/net/gnrc/sixlowpan/frag.h (25)
    A sys/include/net/gnrc/sixlowpan/frag/vrb.h (149)
    M sys/net/gnrc/Makefile (3)
    M sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c (5)
    M sys/net/gnrc/network_layer/sixlowpan/frag/rbuf.c (24)
    A sys/net/gnrc/network_layer/sixlowpan/frag/vrb/Makefile (3)
    A sys/net/gnrc/network_layer/sixlowpan/frag/vrb/gnrc_sixlowpan_frag_vrb.c (142)
    M sys/shell/commands/Makefile (3)
    A sys/shell/commands/sc_gnrc_6lo_frag_stats.c (34)
    M sys/shell/commands/shell_commands.c (9)
    A tests/unittests/tests-gnrc_sixlowpan_frag_vrb/Makefile (1)
    A tests/unittests/tests-gnrc_sixlowpan_frag_vrb/Makefile.include (2)
    A tests/unittests/tests-gnrc_sixlowpan_frag_vrb/tests-gnrc_sixlowpan_frag_vrb.c (283)
    A tests/unittests/tests-gnrc_sixlowpan_frag_vrb/tests-gnrc_sixlowpan_frag_vrb.h (37)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11835.patch
https://github.com/RIOT-OS/RIOT/pull/11835.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11835
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190712/9a5f962c/attachment-0001.html>


More information about the notifications mailing list