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

ng_rpl: port to the new network stack #3050

Merged
merged 3 commits into from
Aug 18, 2015
Merged

Conversation

cgundogan
Copy link
Member

Depends on: #2783 and #2818

This PR introduces RPL for the new network stack. I used the old RPL implementation as a blueprint and copied code blocks, which could be reused.

For a better internal dodag management I made use of utlist.h (linked list).
Thus, it was quite easy to adopt the code to support multiple dodags and/or instances.

Furthermore, I changed the parsing of control packets. The old implementation did use a mediary data structure to parse all the information and then assign them to the internal dodag structure. I completely removed this mediary step and operate directly on the internal data structures.

While adopting the code, I found small discrepancies betwen the implementation and the RFC. I tried to correct them to the best of my knowledge.

This port is far from being complete, as I only included the Storing mode of operation
Missing things:

I did all my testing with the ng_nativenet implementation by rebasing this to the branch of @kaspar030 #2776 and then use the test application in ./tests/driver_netdev_eth/.
There I modifid the Makefile to include ng_ipv6_default and ng_rpl.

When starting two to four nodes (tap0..tap3), I first have to add an IPv6 address to the nodes and can then initialize RPL on the given interface.

ifconfig 5 add 2001:db8::x/64
rpl init 5

Please make sure, that you use the same prefix part for all nodes.

On one node I create a DODAG by issuing: rpl root 1 2001:db8::x, where 1 is the instance id by choice and 2001:db8::x the dodag id. Note that you should not use the prefix notation (*/xx) like I did for ifconfig here.

rpl shows some basic information about the dodags and rpl help will display some more commands, like deleting/adding dodags, starting/stoping trickle timers, sending DIS etc.

I would like to test this on some iotlab m3s, but I don't know how. Could somebody point me to a test/example application, which I can use as a baseline?

@OlegHahm @BytesGalore @authmillenon @gebart @Lotterleben @haukepetersen @emmanuelsearch and basically everyone else: please help me by reviewing this code of a Kraken...

@authmillenon you should especially look into the communication with the network layer part, because I do not know if I implemented it the right way - it works though.

@cgundogan cgundogan added Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT NSTF labels May 22, 2015
@miri64
Copy link
Member

miri64 commented May 22, 2015

I did all my testing with the ng_nativenet implementation by rebasing this to the branch of @kaspar030 #2776 and then use the test application in ./tests/driver_netdev_eth/.
There I modifid the Makefile to include ng_ipv6_default and ng_rpl.

I advice to use ng_ipv6_router_default instead. This way to FIB is included automatically, as well as the router behavior for NDP/6LOWPAN-ND (later on). Also you compile it in the configuration that RPL will be used most likely in.

@miri64
Copy link
Member

miri64 commented May 22, 2015

(for the router behavior of NDP you need #3049 of course)

@@ -58,6 +58,9 @@ typedef enum {
#ifdef MODULE_NG_ICMPV6
NG_NETTYPE_ICMPV6, /**< Protocol is ICMPv6 */
#endif
#ifdef MODULE_NG_RPL
NG_NETTYPE_RPL_CTRL, /**< Protocol is ICMPv6, RPL sub-type */
Copy link
Member

Choose a reason for hiding this comment

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

I think I would prefer something like NG_NETTYPE_ICMP_RPL.

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't need a NG_NETTYPE at all oO let me review ths

Copy link
Member

Choose a reason for hiding this comment

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

It's not even used ;-)

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, seems like a left-over from my previous attempt.. will address all your comments soon

@OlegHahm OlegHahm added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label May 26, 2015
/* if the bytes-1 equals we check the bits of the lowest byte */
uint8_t bitmask = 0x00;
/* get a bitmask for the trailing 0b */
for( uint8_t j = 0; j < 8; ++j ) {
Copy link
Member

Choose a reason for hiding this comment

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

again wrong prefix incrementor?

@OlegHahm
Copy link
Member

I think we're finally ready to go: ACK and go as soon as Travis is green.

@cgundogan
Copy link
Member Author

travis is not happy, because I modified netif.h. And netif.h has some doxygen warnings. (see #3641)

@jnohlgard
Copy link
Member

I don't like merging this without any Travis-enabled build with USEMODULE+=ng_rpl. Currently the RPL implementation is not even being compile-tested by Travis.

@cgundogan
Copy link
Member Author

@gebart good catch. I will add ng_rpl to the ng_networking example now. When the future of ng_networking is decided, this can be changed later in follow-up PRs.

@jnohlgard
Copy link
Member

ACK, let's wait for Travis

@OlegHahm
Copy link
Member

Spark-Core needs black-listing.

@OlegHahm
Copy link
Member

cppcheck complains:

sys/net/routing/ng_rpl/ng_rpl_control_messages.c:398: warning (nullPointer): Possible null pointer dereference: parent - otherwise it is redundant to check it against null.

sys/net/routing/ng_rpl/ng_rpl_control_messages.c:38: style (variableScope): The scope of the variable 'tmp' can be reduced.

sys/net/routing/ng_rpl/ng_rpl_control_messages.c:95: style (variableScope): The scope of the variable 'dodag_conf' can be reduced.

sys/shell/commands/sc_ng_rpl.c:31: performance (redundantAssignment): Variable 'iface_pid' is reassigned a value before the old one has been used.

sys/shell/commands/sc_ng_rpl.c:48: style (variableScope): The scope of the variable 'addr_str' can be reduced.

@OlegHahm
Copy link
Member

Needs a rebase, too.

@cgundogan
Copy link
Member Author

rebased and eliminated cppcheck warnings

@cgundogan
Copy link
Member Author

travis approves

@OlegHahm
Copy link
Member

Let me run one final test.

@OlegHahm
Copy link
Member

Test runs fine, ACK holds - wanna hit the button yourself?

@cgundogan
Copy link
Member Author

I am sitting in the bus right now. Merge at will. Otherwise I merge when I
get home
Am 18.08.2015 16:42 schrieb "Oleg Hahm" [email protected]:

Test runs fine, ACK holds - wanna hit the button yourself?


Reply to this email directly or view it on GitHub
#3050 (comment).

OlegHahm added a commit that referenced this pull request Aug 18, 2015
ng_rpl: port to the new network stack
@OlegHahm OlegHahm merged commit e3edf34 into RIOT-OS:master Aug 18, 2015
@emmanuelsearch
Copy link
Member

Congrats @cgundogan !

@cgundogan
Copy link
Member Author

Eureka!
Am 18.08.2015 16:50 schrieb "Emmanuel Baccelli" [email protected]:

Congrats @cgundogan https://github.com/cgundogan !


Reply to this email directly or view it on GitHub
#3050 (comment).

@miri64
Copy link
Member

miri64 commented Aug 18, 2015

✨ \o/ ✨

@kaspar030
Copy link
Contributor

nice!

@BytesGalore
Copy link
Member

bäääm, you did it sir 🎆

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 Community: Hack'n'ACK candidate This PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK parties Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants