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

ccnl-riot: initialize fields for default options #209

Merged
merged 2 commits into from
Mar 13, 2018

Conversation

OlegHahm
Copy link
Collaborator

@OlegHahm OlegHahm commented Mar 4, 2018

No description provided.

@OlegHahm OlegHahm requested a review from cgundogan March 4, 2018 21:02
@mfrey mfrey self-assigned this Mar 5, 2018
@mfrey
Copy link
Collaborator

mfrey commented Mar 5, 2018

This is slightly related to the PR, but I did a quick check and the actual default value of the interest lifetime in NDN is 4 seconds and not 10 seconds. What is the rational? Is it different in other ICN flavors which provide a interest lifetime?

@@ -547,6 +547,9 @@ ccnl_send_interest(struct ccnl_prefix_s *prefix, unsigned char *buf, int buf_len
int ret = -1;
int len = 0;
ccnl_interest_opts_u default_opts;
default_opts.ndntlv.nonce = 0;
default_opts.ndntlv.mustbefresh = false;
default_opts.ndntlv.interestlifetime = CCNL_INTEREST_TIMEOUT;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you checked if the value is set later on in milliseconds? The define points to a constant which is in seconds, but the specification expects the value to be in milliseconds.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I haven't. I just checked that this value is asigned in src/ccnl-pkt/src/ccnl-pkt-ndntlv.c in ccnl_ndntlv_bytes2pkt() as a default value.

Copy link
Collaborator

@mfrey mfrey Mar 5, 2018

Choose a reason for hiding this comment

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

I have to check it (it's quite confusing). In ccnl_interest_new in ccnl_relay.c the value is divided by 1000 (so it is seconds).

Copy link
Contributor

@blacksheeep blacksheeep Mar 12, 2018

Choose a reason for hiding this comment

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

So this pull request is correct and can be applied?

I am not sure if you want to have nonce = 0 as default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, in line 570 a nonce will be generated if it was set to zero.

@@ -547,6 +547,9 @@ ccnl_send_interest(struct ccnl_prefix_s *prefix, unsigned char *buf, int buf_len
int ret = -1;
int len = 0;
ccnl_interest_opts_u default_opts;
default_opts.ndntlv.nonce = 0;
default_opts.ndntlv.mustbefresh = false;
default_opts.ndntlv.interestlifetime = CCNL_INTEREST_TIMEOUT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, in line 570 a nonce will be generated if it was set to zero.

@blacksheeep blacksheeep merged commit 810d325 into cn-uofbasel:master Mar 13, 2018
@mfrey
Copy link
Collaborator

mfrey commented Mar 13, 2018

I don't think that this was actually a very good idea on multiple levels. Again, the interest lifetime is expected to be in milliseconds and not seconds (CCNL_INTEREST_TIMEOUT is in seconds). However, the interest which is send out with these default options is in seconds.

The ccnl_do_ageging uses the last_used fields and adds the interestlifetime field in a check (and hence this has somehow to be seconds (why isn't the value of interestlifetime copied and transformed in the desired granularity?)). I've started to look into this and couldn't find a implementation for CCNL_NOW at all for RIOT. I've got distracted and couldn't check it in detail. Is there a default implementation?

Could we revert the merge? This is clearly not what we want (sending out interests with a second granularity).

@blacksheeep
Copy link
Contributor

But as far as I can see, it does not changes the behavior we already have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants