Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnrc_sixlowpan: Refactoring #8511

Closed
3 of 6 tasks
miri64 opened this issue Feb 2, 2018 · 6 comments
Closed
3 of 6 tasks

gnrc_sixlowpan: Refactoring #8511

miri64 opened this issue Feb 2, 2018 · 6 comments
Assignees
Labels
Area: network Area: Networking Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Type: tracking The issue tracks and organizes the sub-tasks of a larger effort

Comments

@miri64
Copy link
Member

miri64 commented Feb 2, 2018

Motivation

GNRC's 6LoWPAN has some quality defects in its design, that need to be addressed before @cgundogan can start porting ICNLoWPAN to RIOT. Also I have some issues with certain points in the code that in hindsight I would have done differently.

A model for the 6LoWPAN adaption layer

In a try to solve both problems in my motivation in one go I came up with a model for the 6LoWPAN adaption layer that drafts the different components of 6LoWPAN (fragmentation, IPHC, etc.) as layered sub-modules (in the following referred to as 6Lo modules) with a common API. In reviewing all the RFCs currently available on the adaption layer (RFC4944, RFC6282, RFC7400, RFC8025, RFC8138 (and also some drafts)) I identified 8 6Lo modules (which in turn of course can have their own sub-module). In the following the cursive ones are already implemented in RIOT and need to be refactored to this module:

I omitted HC1 since I believe there is no benefit in ever porting it, but if someone would plan to it would also be its own 6Lo layer.

Every 6Lo modules will provide two functions with the following prototype:

void send(gnrc_pktsnip_t *pkt, void *ctx, uint8_t page);
void recv(gnrc_pktsnip_t *pkt, void *ctx, uint8_t page);

For the more visual inclined, here is a UML diagram I threw together:

6lo-remodel-class

The context is there so e.g. the compression models can be handed the reassembly buffer so they can de-compress the packet directly in it instead of awkwardly returning some values by having 3 (!) return values to the compression decode function as it is currently the case (i.e. so we don't have to back-trace into a previous 6Lo layer, once the task of the next layer layer did its job).

How to proceed

I think moving over to this module shouldn't be too intrusive as it is pretty simple and most components are already in a shape that is quite similar. I think @cgundogan can divide most of the refactoring tasks among ourselves.

I'm going to open a project to track our process on that more dynamically.

@miri64 miri64 added Area: network Area: Networking Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. GNRC labels Feb 2, 2018
miri64 added a commit to miri64/RIOT that referenced this issue Feb 2, 2018
This abstracts the sending and receiving of 6Lo packets to the new
6Lo sub-layer model introduced in RIOT-OS#8511 and exemplifies it as well.
miri64 added a commit to miri64/RIOT that referenced this issue Mar 1, 2018
This abstracts the sending and receiving of 6Lo packets to the new
6Lo sub-layer model introduced in RIOT-OS#8511 and exemplifies it as well.
miri64 added a commit to miri64/RIOT that referenced this issue Mar 1, 2018
This abstracts the sending and receiving of 6Lo packets to the new
6Lo sub-layer model introduced in RIOT-OS#8511 and exemplifies it as well.
miri64 added a commit to miri64/RIOT that referenced this issue Mar 5, 2018
miri64 added a commit to miri64/RIOT that referenced this issue Mar 5, 2018
@miri64
Copy link
Member Author

miri64 commented Mar 6, 2018

While working on untangling IPHC and fragmentation, I might have found a way to have it work without context at least for this use-case.

miri64 added a commit to miri64/RIOT that referenced this issue Jun 14, 2018
miri64 added a commit to miri64/RIOT that referenced this issue Jun 14, 2018
@miri64
Copy link
Member Author

miri64 commented Jun 14, 2018

While working on untangling IPHC and fragmentation, I might have found a way to have it work without context at least for this use-case.

Actually, that isn't the case. What I have to hand down for encoding though, is the datagram-size. I'll ponder about this some more and then adapt this issue, if need be.

miri64 added a commit to miri64/RIOT that referenced this issue Jun 14, 2018
This exposes the parts of the reassembly buffer to be usable as context
as proposed in RIOT-OS#8511.

I only exposed *parts of* for two reasons:

1. I don't need to expose further types (like `rbuf_int_t`), that are
   not of interest outside of fragmentation.
2. This allows for an easy future extension for the virtual reassembly
   buffer as proposed in [[1]].

This makes this change a little bit more involved, because instead of
just renaming the type, I also need to add the usage of the `super`
member, but I think in the end this little preparation work will be
beneficial in the future.

[1]: https://tools.ietf.org/html/draft-watteyne-6lo-minimal-fragment-01#section-3
@miri64
Copy link
Member Author

miri64 commented Jun 14, 2018

In the mean time: the reassembly buffer definitely needs to be exposed (see #9353)

miri64 added a commit to miri64/RIOT that referenced this issue Jun 19, 2018
This refactors the `gnrc_sixlowpan_frag` module for the API proposed
in RIOT-OS#8511.

The `ctx` for `gnrc_sixlowpan_frag_send()` is required to be a
`gnrc_sixlowpan_msg_frag_t` object, so IPHC can later on use it to
provide the *original* datagram size (otherwise, we would need to adapt
the API just for that, which seems to me as convoluted as this
proposal).

I also provide an expose function with a future possibility to provide
more than just one `gnrc_sixlowpan_msg_frag_t` object later on (plus
having cleaner module separation in general).
bergzand pushed a commit to bergzand/RIOT that referenced this issue Jun 25, 2018
This exposes the parts of the reassembly buffer to be usable as context
as proposed in RIOT-OS#8511.

I only exposed *parts of* for two reasons:

1. I don't need to expose further types (like `rbuf_int_t`), that are
   not of interest outside of fragmentation.
2. This allows for an easy future extension for the virtual reassembly
   buffer as proposed in [[1]].

This makes this change a little bit more involved, because instead of
just renaming the type, I also need to add the usage of the `super`
member, but I think in the end this little preparation work will be
beneficial in the future.

[1]: https://tools.ietf.org/html/draft-watteyne-6lo-minimal-fragment-01#section-3
miri64 added a commit to miri64/RIOT that referenced this issue Jun 26, 2018
miri64 added a commit to miri64/RIOT that referenced this issue Jun 26, 2018
This refactors the `gnrc_sixlowpan_frag` module for the API proposed
in RIOT-OS#8511.

The `ctx` for `gnrc_sixlowpan_frag_send()` is required to be a
`gnrc_sixlowpan_msg_frag_t` object, so IPHC can later on use it to
provide the *original* datagram size (otherwise, we would need to adapt
the API just for that, which seems to me as convoluted as this
proposal).

I also provide an expose function with a future possibility to provide
more than just one `gnrc_sixlowpan_msg_frag_t` object later on (plus
having cleaner module separation in general).
cgundogan added a commit that referenced this issue Jun 26, 2018
miri64 added a commit to miri64/RIOT that referenced this issue Jul 3, 2018
This refactors reception/decoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already complicated enough I decided to divide send and receive up into
separate changes it into its own change.
miri64 added a commit to miri64/RIOT that referenced this issue Jul 3, 2018
This refactors sending/encoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already was pretty complicated to refactor, I decided to divide send
and receive up into separate changes.
cgundogan added a commit that referenced this issue Jul 25, 2018
miri64 added a commit to miri64/RIOT that referenced this issue Jul 25, 2018
This refactors reception/decoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already complicated enough I decided to divide send and receive up into
separate changes.
miri64 added a commit to miri64/RIOT that referenced this issue Jul 25, 2018
This refactors reception/decoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already complicated enough I decided to divide send and receive up into
separate changes.
cgundogan added a commit that referenced this issue Jul 26, 2018
@miri64
Copy link
Member Author

miri64 commented Jul 26, 2018

With #9484 merged now this means the basic refactoring work is finished. @cgundogan are you planning to provide a paging module? @A-Paul did you follow the progress of this PR for your work on GHC?

pekkanikander pushed a commit to AaltoNEPPI/RIOT that referenced this issue Aug 11, 2018
This refactors the `gnrc_sixlowpan_frag` module for the API proposed
in RIOT-OS#8511.

The `ctx` for `gnrc_sixlowpan_frag_send()` is required to be a
`gnrc_sixlowpan_msg_frag_t` object, so IPHC can later on use it to
provide the *original* datagram size (otherwise, we would need to adapt
the API just for that, which seems to me as convoluted as this
proposal).

I also provide an expose function with a future possibility to provide
more than just one `gnrc_sixlowpan_msg_frag_t` object later on (plus
having cleaner module separation in general).
pekkanikander pushed a commit to AaltoNEPPI/RIOT that referenced this issue Aug 28, 2018
This refactors the `gnrc_sixlowpan_frag` module for the API proposed
in RIOT-OS#8511.

The `ctx` for `gnrc_sixlowpan_frag_send()` is required to be a
`gnrc_sixlowpan_msg_frag_t` object, so IPHC can later on use it to
provide the *original* datagram size (otherwise, we would need to adapt
the API just for that, which seems to me as convoluted as this
proposal).

I also provide an expose function with a future possibility to provide
more than just one `gnrc_sixlowpan_msg_frag_t` object later on (plus
having cleaner module separation in general).
danpetry pushed a commit to danpetry/RIOT that referenced this issue Sep 5, 2018
This refactors sending/encoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already was pretty complicated to refactor, I decided to divide send
and receive up into separate changes.
danpetry pushed a commit to danpetry/RIOT that referenced this issue Sep 5, 2018
This refactors reception/decoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already complicated enough I decided to divide send and receive up into
separate changes.
YutongGu pushed a commit to usc-ee250-spring2020/RIOT-EE250 that referenced this issue Sep 23, 2018
This refactors sending/encoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already was pretty complicated to refactor, I decided to divide send
and receive up into separate changes.
YutongGu pushed a commit to usc-ee250-spring2020/RIOT-EE250 that referenced this issue Sep 23, 2018
This refactors reception/decoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already complicated enough I decided to divide send and receive up into
separate changes.
@miri64 miri64 added the Type: tracking The issue tracks and organizes the sub-tasks of a larger effort label Sep 27, 2018
@miri64 miri64 removed the GNRC label Oct 5, 2018
llueder pushed a commit to llueder/RIOT that referenced this issue Oct 21, 2018
This refactors sending/encoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already was pretty complicated to refactor, I decided to divide send
and receive up into separate changes.
llueder pushed a commit to llueder/RIOT that referenced this issue Oct 21, 2018
This refactors reception/decoding part of `gnrc_sixlowpan_iphc` to the
more layered approach modeled in RIOT-OS#8511. Since the reception part is
already complicated enough I decided to divide send and receive up into
separate changes.
panail pushed a commit to panail/RIOT that referenced this issue Oct 29, 2018
This abstracts the sending and receiving of 6Lo packets to the new
6Lo sub-layer model introduced in RIOT-OS#8511 and exemplifies it as well.
@miri64
Copy link
Member Author

miri64 commented Nov 20, 2018

The remaining points in the list above are not refactoring but new features, so this issue can be closed.

@miri64 miri64 closed this as completed Nov 20, 2018
@miri64
Copy link
Member Author

miri64 commented Nov 20, 2018

(this also closes the GNRC 6Lo refactoring project)

miri64 added a commit to miri64/RIOT that referenced this issue Jan 22, 2019
miri64 added a commit to miri64/RIOT that referenced this issue Jan 22, 2019
miri64 added a commit to miri64/RIOT that referenced this issue Jan 22, 2019
miri64 added a commit to miri64/RIOT that referenced this issue Jan 22, 2019
miri64 added a commit to miri64/RIOT that referenced this issue Jan 22, 2019
miri64 added a commit to miri64/RIOT that referenced this issue Jan 22, 2019
miri64 added a commit that referenced this issue Jan 22, 2019
gnrc_sixlowpan: document submodules according to #8511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Type: tracking The issue tracks and organizes the sub-tasks of a larger effort
Projects
None yet
Development

No branches or pull requests

3 participants