-
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
gnrc_ipv6_nib: add support for timestamp option in RAs, use for timesync #18121
base: master
Are you sure you want to change the base?
Conversation
08fc45d
to
d93e9f8
Compare
d93e9f8
to
67f000e
Compare
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.
Tending to NACK this. While, yes this option exists, time synchronization is not its intended use case, worse even: the usage for time synchronization directly contradicts the intended use case (detection of replay attacks).
uint64_t local = rtt64_get_counter(); | ||
now += diff; | ||
|
||
rtt64_set_counter(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.
This is not what the timestamp option is for. It is intended to detect replay attacks in unsolicited RA (see https://www.rfc-editor.org/rfc/rfc3971.html#section-5.3.1). Using it to synchronize the local time somewhat contradicts the standardized usage.
67f000e
to
749e177
Compare
749e177
to
1373c19
Compare
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.
Let's discuss #18121 (review) first.
The idea is to get multiple boards in a sensor network synced up with reasonable accuracy. Adding the timestamp to the RA basically gets me that 'for free' (avoiding round-trips with NTP / separate SNTP thread). I didn't expect to get this PR merged as is, but couldn't RAs as a source of timestamps make sense in an isolated network? |
Not if the timestamp has a completely different use case... The timestamp option, as far as I understand is there to detect repeat attacks with Secure Neighbor Discovery (SEND). If you set your clock from these timestamps (i.e. use these timestamps as your truth), any repeat attacks cannot be detected, in contrast, you use an attackers clock as your truth.
|
That´s my task btw. I agree with miri. I did not plan to implement this option because of the lack of time sync right now but I would be in favor not to misuse the option. |
1373c19
to
af60a3f
Compare
53c1f54
to
f97e982
Compare
Apart from the concerns that this could later result in pain when the timestamp option is used to detect replay attack, I personally would favor an application layer protocol. That would work with any network device using any L2 technology. Note that since the UDP SOCK API can expose hardware timestamps via the auxiliary data, we can even get accuracy in the order of < µs. I am doing just that for PTP synchronization via UDP multicast. I hope I get this upstream sometime soon :) |
Then it should go into the application layer and not misusing options in the network layer's control protocol ;-). But thanks for the clarification. |
The idea was to get the time sync 'for free' without any additional network traffic. |
If you are complicating the SEND implementation, I am not sure, you can say it is "for free". |
Contribution description
There is an option to include a timestamp with the router advertisement.
This gives us a simple way to propagate a common time base in the network.
Testing procedure
Enable the
gnrc_ipv6_nib_timestamp
module, router advertisements now include the router's RTT timestamp:Issues/PRs references
includes #18120