[riot-notifications] [RIOT-OS/RIOT] tools/zep_dispatch: add topology generator (#16889)

benpicco notifications at github.com
Fri Sep 24 16:46:29 CEST 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 adds a small tool to generate topologies for `zep_dispatcher`.
It places a custom amount of nodes at random positions in a virtual space. The radio ranges of the nodes can be randomized too.

The network is than serialized into a format that can be consumed by `zep_dispatcher` as well as a data set of all nodes and their ranges that can be plotted using Gnuplot.

To aid debugging the 'radio circles' of the nodes are also colored: The root node gets assigned a random color, each node that has a bi-directional connection to the root inherits that color. If it can only hear the root node, but not reach it, it will inherit the color value divided in half.

This process is repeated recursively for each node so that in the end all nodes that have an (in)direct connection to the root should have the same color.

### Testing procedure

`make run` in `dist/tools/zep_dispatch` will automatically generate a new topology if there is none yet.
Parameters can be adjusted in `topogen.sh`.

This will also produce a visualization of the network layout (requires Gnuplot)


All nodes that have a bi-directional connection to the root node (A) are colored turquoise. Nodes that can only receive packets from a node connected to the root node are colored green. Nodes that have no connection to the root network at all are black.

You can now start an instance of `examples/gnrc_networking` with `USE_ZEP=1` for each simulated node. The ZEP dispatcher will place it in a free spot in the network.

Once all spots are filled you can run `make graph` to produce a connection graph of all nodes in the simulated network (requires Graphviz) 


If you want a new topology, just delete `network.topo` and run `make run` again.

### 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 --

  * <a href="https://github.com/RIOT-OS/RIOT/pull/16889/commits/3e7999387cca60ddc98d90fa569d4f1477a5a85a">tools/zep_dispatch: don't graph links with weight 0</a>
  * <a href="https://github.com/RIOT-OS/RIOT/pull/16889/commits/e76e14cfdd8e877d618537ae01f9b46c3cd49891">tools/zep_dispatch: add topology generator</a>

-- File Changes --

    M dist/tools/zep_dispatch/Makefile (25)
    M dist/tools/zep_dispatch/main.c (2)
    A dist/tools/zep_dispatch/topogen.c (218)
    A dist/tools/zep_dispatch/topogen.sh (25)
    M dist/tools/zep_dispatch/topology.c (12)

-- 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/20210924/8c100d17/attachment.htm>

More information about the notifications mailing list