More Memory Safety for Let's Encrypt: Deploying ntpd-rs

by Dunedanon 6/24/2024, 5:23 PMwith 163 comments

by NelsonMinaron 6/24/2024, 9:09 PM

I like the idea of NTPD in Rust. Is there anything to read about how well ntpd-rs performs? Would love a new column for chrony's comparison: https://chrony-project.org/comparison.html

Particularly interested in the performance stats, how well the daemon keeps time in the face of various network problems. Chrony is very good at this. Some of the other NTP implementations (not on that chart) are so bad they shouldn't be used in production.

by ComputerGuruon 6/24/2024, 9:43 PM

Unlike say, coreutils, ntp is something very far from being a solved problem and the memory safety of the solution is unfortunately going to play second fiddle to its efficacy.

For example, we only use chrony because it’s so much better than whatever came with your system (especially on virtual machines). ntpd-rs would have to come at least within spitting distance of chrony’s time keeping abilities to even be up for consideration.

(And I say this as a massive rust aficionado using it for both work and pleasure.)

by cogman10on 6/24/2024, 10:12 PM

This seems like a weird place to be touting memory safety.

It's ntpd, it doesn't seem like a place for any sort of attack vector and it's been running on many VMs without exploding memory for a while now.

I'd think there are far more critical components to rewrite in a memory safe language than the clock synchronizer.

by mreon 6/25/2024, 4:32 PM

I spoke with Folkert, one of the developers on this project, on the 'Rust in Production' podcast. Some of you might find it interesting: https://corrode.dev/podcast/s01e05-tweede-golf/

by akira2501on 6/24/2024, 9:05 PM

Why does your ntpd have a json dependency?

by hcfmanon 6/27/2024, 5:17 PM

If you want to setup a chrony time server that maintains accuracy to within a microsecond and doesn’t do this with a network connection then you could try my sbts-aru project and just not use the audio recorder parts of it.

https://github.com/hcfman/sbts-aru

It installs with a single command on all Raspberry Pi versions and takes care of all the dependencies, configuration and startup order details to install and start working with one command.

It’s a sound localizing audio recorder platform and that’s why it also sets up accurate time.

It’s using GPS to get its time from.

by _joelon 6/24/2024, 10:13 PM

Reading this reminded me of ntpsec, anyone actually use that?

by xvilkaon 6/25/2024, 7:01 AM

BGP probably should be the next.

by nubinetworkon 6/24/2024, 10:26 PM

The problem with ntp isn't the client, it's the servers having to deal with forged UDP packets. Will ntpd ever become TCP-only? Sadly I'm not holding my breath. I stopped running a public stratum 3 server ~10 years ago.

by hosejaon 6/25/2024, 11:24 AM

Free pair of knee-high socks with every cert.