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: generalize gnrc_sixlowpan to enable resuability #8218

Closed
wants to merge 6 commits into from

Conversation

cgundogan
Copy link
Member

@cgundogan cgundogan commented Dec 6, 2017

The current implementation of 802.15.4 adaptations and the handling of dispatch types is closely tied to the 6lowpan module (it's basically the same). Thus, it is not possible to reuse lowpan functionalities, like e.g. the lowpan fragmentation, for non-6lowpan frames.

This PR makes the following generalizations and changes:

  • rename GNRC_NETTYPE_SIXLOWPAN to GNRC_NETTYPE_LOWPAN
  • the 6LoWPAN thread is renamed to LoWPAN and directory structure is adjutsed
  • fragmentation is moved out of 6lowpan and added to the more generic lowpan module

Motivation: Generalizing the 6lowpan module to lowpan allows for further extensions and reusability by non-IP protocols. My goal is to implement a LoWPAN layer for ICN without duplicating code for IPv6/6lowpan agnostic dispatch types (like fragmentation).

@miri64 I would like to hear your ideas and feedback about this generalization. Oh, and please pardon me if I changed/renamed too much (:

LoWPAN

@cgundogan cgundogan added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation GNRC Area: network Area: Networking labels Dec 6, 2017
@cgundogan cgundogan requested a review from miri64 December 6, 2017 19:19
@miri64
Copy link
Member

miri64 commented Dec 6, 2017

rename GNRC_NETTYPE_SIXLOWPAN to GNRC_NETTYPE_LOWPAN

Shouldn't it rather be 6LO???!?

@miri64
Copy link
Member

miri64 commented Dec 6, 2017

Ah... should have read the whole description before posting ^^". I have some head-aches with this PR

  • If we rename the module I would rather rename it to gnrc_sixlow to reflect the non-WPAN (aka IEEE 802.15.4) work of the 6Lo-WG. Much of the 6LoWPAN can be reused for that as well. Renaming it to gnrc_lowpan seems like a weird choice with that in mind.
  • If people search for 6LoWPAN code I expect them to either search for a variation of "6LoWPAN" or "6Lo", so I'm not sure this makes it harder to find the 6LoWPAN implementation or API.
  • Is the rename really necessary (even to 6Lo)? The name has has historic implication everyone(TM) knows what is meant with "6LoWPAN", while LoWPAN describes IEEE 802.15.4 at best.

Apart from that: though this PR claims it generalizes 6LoWPAN I have the feeling it really doesn't (why does gnrc_lowpan require ipv6_hdr e.g.?) and just moves stuff around. But as said: this is more a feeling than a substantial claim.

@cgundogan
Copy link
Member Author

Thanks for your quick feedback (:

Is the rename really necessary (even to 6Lo)? The name has has historic implication everyone(TM) knows what is meant with "6LoWPAN", while LoWPAN describes IEEE 802.15.4 at best.

The problem with "6LoWPAN" is that this would lead to confusions for other network layer technologies (=>CCN/NDN). Though, I did not remove 6LoWPAN per se, it's still existent. But the more general module "LoWPAN" is doing the heavy lifting now (fragmentation handling, dispatching, ...).

Apart from that: though this PR claims it generalizes 6LoWPAN I have the feeling it really doesn't (why does gnrc_lowpan require ipv6_hdr e.g.?) and just moves stuff around. But as said: this is more a feeling than a substantial claim.

There are still some smaller parts that need to be refactored. E.g. there's a hard dependency in the fragmentation code to IPHC, which is IMO wrong. Though, changing this would require a little more moving around that's why I left it as is for now.

@cgundogan
Copy link
Member Author

I also figured that RFC4944 has a pretty IP agnostic wording for these kind of dispatches. So I think it's in line with the RFC to remove the SIXLOWPAN prefix from many of the current macros.

@miri64
Copy link
Member

miri64 commented Dec 7, 2017

I also figured that RFC4944 has a pretty IP agnostic wording for these kind of dispatches. So I think it's in line with the RFC to remove the SIXLOWPAN prefix from many of the current macros.

Maybe we should name the module gnrc_rfc4944 then ^^.

@miri64
Copy link
Member

miri64 commented Dec 7, 2017

Can you maybe separate the generalization from the rename? I think that would simplify the review greatly.

@cgundogan
Copy link
Member Author

cgundogan commented Dec 7, 2017

@miri64 This PR basically only consists of renaming and reordering. I did not include any new functionalities. I'll rearrange the commits so that the macro renames happen in a separate commit. I also included a picture of what my motivation is (not for this PR, but follow-ups) in the main comment.

@@ -11,12 +12,13 @@
* @{
*
* @file
* @brief 6LoWPAN definitions for @ref net_gnrc_netif
* @brief Lowpan definitions for @ref net_gnrc_netif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoWPAN

@@ -25,21 +27,21 @@ extern "C" {
#endif

/**
* @brief 6Lo component of @ref gnrc_netif_t
* @brief Lowpan component of @ref gnrc_netif_t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoWPAN

*/
typedef struct {
/**
* @brief Maximum fragment size for 6Lo fragmentation.
* @brief Maximum fragment size for lowpan fragmentation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoWPAN


/**
* @brief Dispatch mask for LOWPAN_IPHC.
* @see <a href="https://tools.ietf.org/html/rfc6282#section-3.1">
* RFC 6282, section 3.1
* </a>
*/
#define SIXLOWPAN_IPHC1_DISP_MASK (0xe0)
#define LOWPAN_IPHC1_DISP_MASK (0xe0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and throughout this file: since the name of the file is sixlowpan.h, I would keep the name SIXLOWPAN_

@@ -203,14 +203,14 @@ int gnrc_netif_get_from_netdev(gnrc_netif_t *netif, gnrc_netapi_opt_t *opt)
break;
#endif /* GNRC_IPV6_NIB_CONF_ROUTER */
#endif /* MODULE_GNRC_IPV6 */
#ifdef MODULE_GNRC_SIXLOWPAN_IPHC
case NETOPT_6LO_IPHC:
#ifdef MODULE_GNRC_LOWPAN_IPHC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module doesn't exist (and I would prefer to keep the name gnrc_sixlowpan_iphc or rename it to gnrc_sixlo_iphc).

#ifdef MODULE_GNRC_SIXLOWPAN_IPHC
case NETOPT_6LO_IPHC:
#ifdef MODULE_GNRC_LOWPAN_IPHC
case NETOPT_LOWPAN_IPHC:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This netopt doesn't exist (and I would prefer to keep the name NETOPT_6LO_IPHC)

@miri64
Copy link
Member

miri64 commented Dec 13, 2017

Apart from the change request and a little bit of testing I'd like to do tomorrow I think we can merge it.

@cgundogan
Copy link
Member Author

@miri64 addressed your comments

@cgundogan cgundogan added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Dec 13, 2017
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Preliminary) ACK. Please squash. I still like to test (tomorrow).

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable labels Dec 13, 2017
smlng
smlng previously requested changes Dec 13, 2017
Copy link
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits

* @brief Default priority for the LoWPAN thread.
*/
#ifndef GNRC_LOWPAN_PRIO
#define GNRC_LOWPAN_PRIO (THREAD_PRIORITY_MAIN - 4)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indention?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another example of disturbing the work flow by trivialities

@@ -1,76 +1,77 @@
/*
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
* Copyright (C) 2015 Hamburg University of Applied Sciences
* Copyright (C) 2015, 2017 Hamburg University of Applied Sciences
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cut it short to HAW Hamburg would be (more) consistent with recent copyrights.

@miri64 miri64 mentioned this pull request Feb 2, 2018
6 tasks
@tcschmidt
Copy link
Member

@cgundogan can you fix the issues and get this merged?

@miri64
Copy link
Member

miri64 commented May 26, 2018

There still is some refactoring work done to reduce the coupling of IPHC and fragmentation. This should not be done in this PR, but separate. I already started the work a few month back, but it's a real brain twister. Mainly, because fragmentation is conceptionally a layer below IPHC, but information about the packet before compression (namely length of the first fragment) is required to be present during and this is not easily factored out with the current code structure.

Second, I'm really not happy about the all the renaming going on here. a) The ICNLoWPAN feature is still experimental, so if it will go a different route than this or doesn't come to fruition do we roll all this back? b) even if it becomes a standard, I would rather keep the name. Otherwise, we never reach API stability if we always also change names (though only minor functionality tweaks are required) as soon as the status quo changes. I did also not go through the code and renamed all of this from sixlowpan to sixlo when the first non-IEEE 802.15.4 RFC came out exactly because of that.

@tcschmidt
Copy link
Member

@cgundogan @miri64 maybe we can discuss naming and how to proceed hand in hand on Monday F2F?

@smlng smlng dismissed their stale review August 7, 2018 07:53

non-blocking comments

@miri64 miri64 removed the GNRC label Oct 5, 2018
@cgundogan
Copy link
Member Author

The architecture of handling sixlowpan dispatches changed drastically on master. The core ideas of this PR already transitioned to master so that this PR is useless now.

@cgundogan cgundogan closed this Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants