Help with Modular Network Stack

Hello everyone,

We at IBR, TU Braunschweig are trying to implement a truly modular network stack where different components of the network stack like Network layer, transport layer, framer, duty cycling can be interchanged with different implementations without touching the code of other layers.

The current GNRC implementation is mostly designed around the traditional TCP(/UDP)/IPv6 network stack since the neighbor information base stores ipv6 addresses, implements NDP and RPL (both designed for ipv6).

The goal is to bring the modularity of Contiki-NG's network stack to RIOT. The motivation behind this is that we would be able to have many more different implementations like Rime and switch between these different implementations easily (just a small change in the Makefile). Also, from a developer's perspective it would be really easy to understand and implement new things in the network stack since he/she wouldn't have to understand the implementation details of the other components of the network stack.

This logically is supposed to be attained by implementing structs representing each part of the network stack (Eg: A common struct for routing protocols which has function pointers each routing algorithm will have to implement like in [1]).

Could you guys therefore guide towards implementing such a modular network stack ?

Regards, Nishchay Agrawal

[1] https://contiki-ng.readthedocs.io/en/latest/_api/structrouting__driver.html

Hi,

actually, GNRC is quite capable to also serve non-TCP/IP protocols and designed to be highly modular from the ground up. You can see this in the way we integrated e.g. CCN-lite / ICN into GNRC. All you need is an event loop that serves the `gnrc_netapi` and define what the event loop expects and what it provides.

I don't have a specific guide at hand of how to implement a modular network stack, but there is this poster proposal by A. Dunkels on RIME: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.64.360&rep=rep1&type=pdf

Best regards, Martine