-
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
pkg: ndn-riot: initial import of ndn-riot as a package #5914
Conversation
Build fails for me with (I'm a bit puzzled since the next statement is a assert using the variable) /home/frey/Desktop/Projekte/RIOT/tests/ndn-ping/bin/pkg/native/ndn-riot/pit.c:
In function ‘ndn_pit_add’:
/home/frey/Desktop/Projekte/RIOT/tests/ndn-ping/bin/pkg/native/ndn-riot/pit.c:104:13:
error: unused variable ‘r’ [-Werror=unused-variable]
int r = ndn_interest_get_name(&entry->shared_pi->block, &pn); |
Looking forward to test this. |
@mfrey, maybe you're building (the package) with |
@OlegHahm I haven't set anything actually. The variable is only used in the assert statement. If you don't build with NEDBUG this is an issue nontheless. Isn't it? Anyway, @cgundogan fixed it by a cast to void. I'll give it a try later. |
Sure. Just wanted to find an explanation. |
There is also a unittest suite for encoding & decoding APIs that has not been merged into ndn-riot repo yet: https://github.com/wentaoshang/RIOT/tree/ndn/tests/unittests/tests-ndn_encoding I can try to make a separate PR for this if you think it can be included. |
nice, definitely! |
Doesn't ndn-riot require malloc/free? In that case, the application should use the tlsf package. |
Until #5943 is fixed, the applications should also blacklist boards without hwrng. |
@cgundogan, with named-data-iot/ndn-riot#2 being merged, could you please update the revision of the package? |
a4da9bb
to
8ea42ac
Compare
@OlegHahm sure, sorry for the delay. I amended the new commit hash to point to current master of https://github.com/named-data-iot/ |
Sorry I lost track of this issue. Wonder what is the current status? Anything needed to be fixed from NDN-RIOT side? Honestly I'm not very familiar with the Github collaboration procedure but I can try my best to help. Also I have some concern about the requirement for hardware RNG for micro-ecc, because the two platforms (SAMR21 and IoT-Lab M3) I'm using for NDN-RIOT right now do not have this feature. What I did is to patch micro-ecc (named-data-iot@8b9f0b1) and use deterministic ECDSA signing with pre-generated keys (RFC6979). Any comment on this idea? |
8ea42ac
to
f27c93b
Compare
@OlegHahm ping? @wentaoshang I have no experience with the micro-ecc package, but the diff in your commit (named-data-iot@8b9f0b1) is not very apparent to me. What exactly did you change? |
@wentaoshang so you're using your own deterministic ECDSA implementation or is the one you're using part of MicroECC? The patch you're referencing, named-data-iot/RIOT@8b9f0b1 , removes the RIOT hardware random generator integration. Does MicroECC behave differently based on whether |
Sorry I forgot to mention this: I'm using a signing function called |
@wentaoshang So instead of removing the default implementation, can't you call |
That could also work... Ideally I want to be able to switch automatically between deterministic/nondeterministic signing (maybe at compile time?), based on whether HWRNG is available. But what you proposed sounds a good solution for now. |
The setter/getter functions for the random generator callback are part of the public API https://github.com/kmackay/micro-ecc/blob/master/uECC.h#L127 . So it seems what you want to achieve is possible without completely removing support for hardware random number generator in MciroECC. |
I agree. I'll try to figure out how to update ndn-riot code. I remember that without named-data-iot/RIOT@8b9f0b1 the code could not compile for platforms with no HWRNG because |
Try to do build the package in "pkg/ndn-riot/Makefile" (instead of adding "DIRS += BINDIRBASE/..." in "pkg/ndn-riot/Makefile.include". See how other packages do it, usually sth like |
Thank you @kaspar030, the problem was indeed the missing rule for compiling the package. I still don't understand why it works on my computer an not for Murdock, but well, at least it is fixed. |
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.
@astralien3000, can you squash ? The last commits should be squashed to the first one of this PR, IIUC.
pkg/ndn-riot/Makefile
Outdated
@@ -0,0 +1,11 @@ | |||
PKG_NAME=ndn-riot | |||
PKG_URL=https://github.com/astralien3000/ndn-riot |
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.
What is the reason not to take the official repo's url?
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.
New errors appeared since the last time I tried the code. I will need to do a pull request to the official repos, but for the moment, I try with mine. Of course this should not be merged for the moment.
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.
Just in case, I can quickly merge pull requests in named-data-iot/ndn-riot repo
04a2500
to
10cb7a7
Compare
@kaspar030, well actually adding what you said did not help. I don't know why it worked once, but I got the same error again for 3 builds of Murdock... Maybe it's a race condition like @gebart said ? But I can't reproduce the error even with -j9... |
pkg/ndn-riot/Makefile.include
Outdated
@@ -0,0 +1,3 @@ | |||
INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD) | |||
DIRS += $(BINDIRBASE)/pkg/$(BOARD)/ndn-riot |
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 line needs to go
pkg/ndn-riot/Makefile.include
Outdated
INCLUDES += -I$(BINDIRBASE) | ||
is this file taken in account ???? | ||
|
||
INCLUDES += -I$(PKGDIRBASE) |
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.
Ah, I think I see what is going on. You've been using $BINDIRBASE/pkg/$(BOARD)
, which locally is the same as $PKGDIRBASE
. But murdock overrides $BINDIR
and $PKGDIRBASE
(but not $BINDIRBASE
, thus the wrong path is set.
I wonder why this didn't pop up earlier. ;)
So, INCLUDES += -I$(PKGDIRBASE)
(as it is now) should work.
72b39dd
to
e40633e
Compare
Ok ! Almost there ! I just need to wait for the PR of ndn-riot, and we can move. Maybe tomorrow. |
Woo ! Murdock is ok (taking apart the static test, because squash is needed). I rolled back to the official ndn-riot repos. Everything is ready from my side, may I squash ? Also, someone else should test the last changes I made. |
55327d1
to
dbd049a
Compare
@cgundogan, @mfrey, can one of you test ndn-ping ? |
Just tested with samr21-xpro: it is working fine with client & server on two different boards. |
@@ -34,7 +34,8 @@ extern "C" { | |||
#define ETHERTYPE_RESERVED (0x0000) /**< Reserved */ | |||
#define ETHERTYPE_IPV4 (0x0800) /**< Internet protocol version 4 */ | |||
#define ETHERTYPE_ARP (0x0806) /**< Address resolution protocol */ | |||
#define ETHERTYPE_NDN (0x0801) /**< Parc CCNX */ |
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.
Could this change have an impact on other named data network (CCN-lite) implementations ?
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 think so. CCN-lite for RIOT uses only NDN for now (-> it does not support the other formats of CCN-lite).
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.
Actually, this should be changed to
#define ETHERTYPE_NDN 0x8624
This is the value we are using in other places. This, probably, was just a quick hack.
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 slightly confused by the PARC CCNX
comment.
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 just tested the ccn-lite-relay example, it behave the same as on master.
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.
Actually this line is the one deleted, ETHERTYPE_NDN is defined as 0x8624 in this PR (see this). But ETHERTYPE_CCNX is still defined as 0x0801. What do we do about these lines ? They are ok 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.
According to history, Oleg added an ETHERTYPE_NDN in 2015, and then Cenk did a commit in 2016 "ethertype: use correct type for NDN and CCNx", that introduced another name for ETHERTYPE_CCNX and a new proper value for ETHERTYPE_NDN.
I think this reflects properly the fact that NDN and CCNx became different protocols.
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.
No further question from anyone. ACK
This PR imports
ndn-riot
[1] as apkg
.Furthermore, I included a tests application that I adopted from [2].
@cawka I hope you don't mind that I included your changes proposed in #5648.
Can be tested by navigating into
tests/ndn-ping
and invoke the usualmake all term PORT=tap0/1
[1] https://github.com/named-data-iot/ndn-riot
[2] https://github.com/named-data-iot/ndn-riot-examples/tree/master/ndn-ping