-
Notifications
You must be signed in to change notification settings - Fork 2k
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
nettype: intial import #2397
nettype: intial import #2397
Conversation
|
Does it make sense to put the |
I thought it might be clearer for newcomers to the new network stack to give a clear "this is where the new stuff is" ;-). |
Ready for review :-) |
9e4e57b
to
065b6b3
Compare
still think that starting now to put stuff into To the PR: I think it would make sense to take the changes to |
* @note Expand at will. | ||
*/ | ||
typedef struct { | ||
NG_NETTYPE_UNDEF = 0, /**< Protocol is undefined */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we really use these protocol number as array offset, I would not include this value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be done by doing type - 1
internally. I'd rather have some fallback value for testing etc.
What's the purpose of these types? Where should they be used? |
NG_NETTYPE_IEEE802154, /**< Protocol is IEEE 802.15.4 */ | ||
#endif | ||
#ifdef MODULE_NG_SIXLOWPAN | ||
NG_NETTYPE_SIXLOWPAN, /**< Protocol is 6LoWPAN */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I would not call 6LoWPAN a link layer protocol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me neither. But in our stack it would take the place of a link layer protocol, since it sits behind a network interface of the IPv6 layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get this. In the envisioned stack I'm theoretically able to put as many threads/modules/layers as I want (in case I have enough memory) between two OSI layers. I would either drop the substructuring at all or make a new subsection for adaptation layers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+--------------+
| IPv6 |
| IF | IF |
+--------------+
^ ^
netapi netapi
v v
+-----+ +-----+
| MAC | | 6LP |
| | +-----+
| | ^
| | netapi
| | v
| | +-----+
| | | MAC |
+-----+ +-----+
|radio| |radio|
+-----+ +-----+
Does it make anymore sense to you now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting 6LoWPAN between anything other than IPv6 and a MAC is non-sensical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make anymore sense to you now?
No. I still disagree calling 6LoWPAN a link layer protocol. That's simply wrong for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can take it out of the group, but I thought the implementation would be easier to find then, since it would also reside in sys/net/link_layer
(if not their, where else)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either create a new folder name something like "adaption_layer" or leave it in network layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of putting/leaving it in the network layer.
Is replacement for |
#endif | ||
#ifdef MODULE_NG_ICMPV6 | ||
NG_NETTYPE_ICMPV6, /**< Protocol is ICMPv6 */ | ||
NG_NETTYPE_ICMPV6_ECHO, /**< Protocol is ICMPv6, echo reply/request */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really make sense for upper layers to register for an echo reply?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, for example a ping application, or a application if the tests result are as expected in these things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant echo request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goes the same for the Plugtests
I think it would make sense to PR the interface for |
* | ||
* @note Expand at will. | ||
*/ | ||
typedef struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not an enum? Can this actually compile this way as a struct def?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! Will fix this
@cgundogan sure, if someone implements a version of those protocols that utilizes netapi we can add them. I only added the stuff we decided to implement for now. |
@haukepetersen done: #2404 |
Fixed @cgundogan comment |
Removed the ICMPv6 subtypes. Registration can be done doing e.g. netreg_register(NETTYPE_ICMPV6, ipv6_pid, ICMPV6_TYPE_RPL, rpl_pid); |
* @name Link Layer | ||
*/ | ||
#ifdef MODULE_NG_IEEE802154 | ||
NG_NETTYPE_IEEE802154, /**< Protocol is IEEE 802.15.4 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed today, in my opinion we can drop this option, as link layers should register independent of their protocol
looks good to me (except the 15.4 entry in the list). ack when fixed. |
Addressed @haukepetersen's comments. |
EDIT: I understand that you removed the ICMPv6 subtypes a commit earlier, but why did you not remove the |
@cgundogan: RPL is missing indeed, but as the code states: everyone who adds a new protocol should just add it to this list. As I understood it, the current list includes just some randomly selected protocols to show how this file is supposed to work - but it is not complete, so adding e.g. RPL, TCP, etc, has to be done whenever those implementations are added... |
@haukepetersen Well, for the sake of completeness, I would like to see the RPL NETTYPE also in this PR - both, because it is an existing module in RIOT and to prevent further time consuming questions in a later phase |
fine with me. @authmillenon, could you add at least RPL and TCP to this list? |
For RPL the idea was to do it via demux context (as described) so a NETTYPE_RPL is not needed.
Where ever the values for the ICMPv6 type field will be defined.
Because AODV uses its own package format, while RPL utilizes ICMPv6. AODV will be demultiplexed in the IP thread's dultiplexer (as ICMPv6, UDP, TCP, etc.), while RPL will be demultiplexed in the ICMPv6 module. @haukepetersen and I talked about this dual nature that you basically have two ways now to register to a protocol yesterday, but come to the conclusion, that this is the most memory-saving one, while also being flexible. As for TCP, I can re-add it. |
@authmillenon I am not sure if this is relevant here, but data-plane packets (udp, tcp ..) can and most probably will be annotated later with an IPv6-Hop-By-Hop extension header with RPL information (https://tools.ietf.org/html/rfc6553). These packets, regardless of their transport layer, need to interact with RPL in some way. |
@cgundogan then RPL can also register via |
@authmillenon I am still not convinced.. AODV can also use
|
True, AODV utilizes UDP, so there is actually no reason to include it into this list. For RPL @authmillenon is right, it registers for certain types of next-headers and ICMP messages, so there is also no reason to include RPL in this list. |
Done |
thx. I have nothing to add: ACK (merge at will once Travis is happy) |
851be09
to
9d36c05
Compare
Squashed |
me gusta, let's wait for travis and then merge |
Type to define protocols