[riot-notifications] [RIOT-OS/RIOT] tools/zep_dispatch: add support for advanced topologies (#15773)

benpicco notifications at github.com
Thu Jan 14 19:42:48 CET 2021

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 extends the ZEP dispatcher with support for advanced topologies.

A topology can be specified in a simple file format

<node_a> <node_b> [weight_ab] [weight_ba]

This line defines a connection between `<node_a>` and `<node_b>`.
The weight of the edge `<node_a>` -> `<node_b>` is `<weight_ab>`.

An edge weight is a float value between 0 and 1 that represents the probability of a successful packet transmission on that path.

A weight of `0` would mean no connection, whereas a weight of `1` would be a perfect connection. Intermediate values are possible, e.g. `0.6` would result in a packet loss probability of 40%.

The weights can be omitted.
If both weights are omitted, a perfect connection is assumed.
If `<weight_ba>` is omitted, a  connection is assumed and `<weight_ab>` is used for both directions.

#### Example topology

# A and B are connected with an ideal link
# A and C are connected with a symmetric link with 10% packet loss
A	C	0.9
# B and C are on an asymmetric connection
# The path B -> C has 60% packet loss while C -> B has 30% packet loss
B	C	0.4	0.7

### Testing procedure

 - start the dispatcher

       make -C dist/tools/zep_dispatch run

 - connect three `native` nodes

       make -C examples/gnrc_networking USE_ZEP=1 all term # x 3

- generate a graph of the topology

       make -C dist/tools/zep_dispatch graph

![example gv](https://user-images.githubusercontent.com/1301112/104633873-19a60980-56a0-11eb-8ed7-aad149f34b38.png)

The nodes can all ping each other, but with varying packet loss

ping ff02::1 -c 10
12 bytes from fe80::25a:4550:a00:9f82%7: icmp_seq=0 ttl=64 rssi=255 dBm time=0.512 ms
12 bytes from fe80::25a:4550:a00:a885%7: icmp_seq=1 ttl=64 rssi=255 dBm time=0.276 ms
12 bytes from fe80::25a:4550:a00:a885%7: icmp_seq=5 ttl=64 rssi=255 dBm time=0.552 ms
12 bytes from fe80::25a:4550:a00:a885%7: icmp_seq=6 ttl=64 rssi=255 dBm time=0.376 ms
12 bytes from fe80::25a:4550:a00:9f82%7: icmp_seq=7 ttl=64 rssi=255 dBm time=0.591 ms
12 bytes from fe80::25a:4550:a00:a885%7: icmp_seq=7 ttl=64 rssi=255 dBm time=0.623 ms (DUP!)
12 bytes from fe80::25a:4550:a00:a885%7: icmp_seq=8 ttl=64 rssi=255 dBm time=0.517 ms

--- ff02::1 PING statistics ---
10 packets transmitted, 6 packets received, 1 duplicates, 40% packet loss
round-trip min/avg/max = 0.276/0.492/0.623 ms

### Issues/PRs references

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:


-- Commit Summary --

  * cpu/native: export send() as real_send()
  * socket_zep: include HW address with HELLO packet
  * tools/zep_dispatch: add support for topologies

-- File Changes --

    M cpu/native/include/native_internal.h (1)
    M cpu/native/socket_zep/socket_zep.c (17)
    M cpu/native/syscalls.c (2)
    M dist/tools/zep_dispatch/Makefile (27)
    A dist/tools/zep_dispatch/README.md (46)
    A dist/tools/zep_dispatch/example.topo (7)
    M dist/tools/zep_dispatch/main.c (174)
    A dist/tools/zep_dispatch/topology.c (272)
    A dist/tools/zep_dispatch/topology.h (18)
    A dist/tools/zep_dispatch/zep_parser.c (78)
    A dist/tools/zep_dispatch/zep_parser.h (6)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210114/faa5b030/attachment-0001.htm>

More information about the notifications mailing list