Entering the mosh pit
Entering the mosh pit
Posted May 17, 2017 12:41 UTC (Wed) by epa (subscriber, #39769)In reply to: Entering the mosh pit by paulj
Parent article: Entering the mosh pit
Or am I worrying too much about the latency imposed by AES?
Posted May 17, 2017 12:53 UTC (Wed)
by farnz (subscriber, #17727)
[Link] (4 responses)
Bear in mind that modern CPUs have dedicated AES assist instructions - this set of slides suggests that you end up using around 2 clock cycles per byte with an optimal implementation, and a latency on the order of 10 clock cycles from first byte in to first byte out. Given the clock speeds on modern CPUs, I suspect that you're going to hit network limits before AES is too slow.
Posted May 17, 2017 15:59 UTC (Wed)
by epa (subscriber, #39769)
[Link] (3 responses)
Ten clock cycles (or even ten thousand) is plenty fast enough to display a keystroke instantly.
Posted May 17, 2017 16:07 UTC (Wed)
by farnz (subscriber, #17727)
[Link] (1 responses)
Yeah - AES acceleration instructions mean that your latency is dominated by network latency, not compute latency, by a significant margin - a realistic implementation of AES decrypt using the acceleration instructions is going to add under a microsecond of latency, which is less than the minimum Ethernet latency you're going to see on a real 10G network.
Posted May 18, 2017 7:08 UTC (Thu)
by luto (guest, #39314)
[Link]
Posted May 18, 2017 15:30 UTC (Thu)
by flussence (guest, #85566)
[Link]
ChaCha20 is a bit faster than AES (4-15cpb), which is one of the reasons it's the default in OpenSSH now.
Posted May 17, 2017 15:25 UTC (Wed)
by itvirta (guest, #49997)
[Link] (1 responses)
Posted May 17, 2017 15:55 UTC (Wed)
by epa (subscriber, #39769)
[Link]
I suppose that if the UDP packets have a sequence number and a fixed length, you can still use the one-time pad to encrypt them (if a packet is lost, then that bit of the one-time pad is wasted too).
Others have pointed out how on modern CPUs AES is fast, so it may be a non-issue. (Although I would point out there is a difference between the average speed for decrypting a large block of data, and the speed if you are doing a single byte at a time. I doubt that decrypting just one byte on its own can be done in two clock cycles. But even if it takes a hundred thousand cycles that's still fast enough, on a modern CPU, to display the keystroke 'instantly' to a human user.)
Posted May 17, 2017 20:07 UTC (Wed)
by cgull (guest, #115681)
[Link]
Entering the mosh pit
Entering the mosh pit
Entering the mosh pit
Entering the mosh pit
Entering the mosh pit
Entering the mosh pit
the useful use-cases is that of roaming or sleeping laptop clients. Besides, what would you do when your megabyte runs out?
As for the latency of AES, that's what your SSH connections are encrypted with, too.
Entering the mosh pit
Entering the mosh pit
