gnrc_ipv6_nib: add support for timestamp option in RAs, use for timesync#18121
gnrc_ipv6_nib: add support for timestamp option in RAs, use for timesync#18121benpicco wants to merge 9 commits intoRIOT-OS:masterfrom
Conversation
08fc45d to
d93e9f8
Compare
d93e9f8 to
67f000e
Compare
miri64
left a comment
There was a problem hiding this comment.
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.
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
miri64
left a comment
There was a problem hiding this comment.
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_timestampmodule, router advertisements now include the router's RTT timestamp:Issues/PRs references
includes #18120