News for hackers. Stuff that matters.
Re:TurboTLS: TLS connection establishment with 1 less round ... by r1ch on Tuesday February 14, 2023 @01:48PM (#34794055)
An interesting idea, but QUIC / HTTP/3 also avoids the extra RTT for TLS negotiation by bundling it with the connection handshake and in a less janky way than this. I don't see a good reason for a server or browser developer to implement this when QUIC exists.
Re:TurboTLS: TLS connection establishment with 1 less round ... by dwheeler on Tuesday February 14, 2023 @02:19PM (#34794503)
TLS is used for other protocols, e.g., SMTPS (SMTP + TLS). But there's an extra DNS query for this case, and I don't think TLS setup time is a significant cause of delays. So I don't know how useful this is.
Re:TurboTLS: TLS connection establishment with 1 less round ... by j16sdiz on Tuesday February 14, 2023 @02:25PM (#34794597)
I think most SMTP use STARTTLS with preetablished TCP connection..
Re:TurboTLS: TLS connection establishment with 1 less round ... by dwheeler on Tuesday February 14, 2023 @02:41PM (#34794805)
There's a big push to use implicit TLS with SMTP, instead of STARTTLS. Here's a post about that:

https://blog.apnic.net/2021/11/18/vulnerabilities-show-why-s...

Re:TurboTLS: TLS connection establishment with 1 less round ... by mananaysiempre on Tuesday February 14, 2023 @02:38PM (#34794766)
Not sure about real-world statistics, but the current IETF position is that SMTP STARTTLS for mail submission (not transport) is to be phased out in favour of “implicit” SMTP-over-TLS with no cleartext portion, due in part to the former being an implementation minefield[1].

[1] https://datatracker.ietf.org/doc/html/rfc8314#appendix-A

Re:TurboTLS: TLS connection establishment with 1 less round ... by fomine3 on Tuesday February 14, 2023 @08:53PM (#34799050)
Re:TurboTLS: TLS connection establishment with 1 less round ... by aseipp on Tuesday February 14, 2023 @04:45PM (#34796570)
The latency hit of the extra trip will definitely be felt by end users if the endpoint is far enough away (e.g. ~100-200ms.) You can mitigate the initial setup other ways though, like the CDN approach: terminate TLS much closer with a proxy and use a warm, pre-established backhaul connection to the origin.

Less round trips are always good, though, without any extra stuff to put in place.

Re:TurboTLS: TLS connection establishment with 1 less round ... by sam0x17 on Tuesday February 14, 2023 @09:33PM (#34799304)
Having debugged stuff for someone crazy who wanted less than 50ms global latency for a private search engine I can tell you the TLS negotiation adds significant time the first time you initialize the connection
Re:TurboTLS: TLS connection establishment with 1 less round ... by 8n4vidtmkvmk on Wednesday February 15, 2023 @02:56AM (#34801207)
50ms is impossible. Lowerbound is 68. One-way.
Re:TurboTLS: TLS connection establishment with 1 less round ... by sam0x17 on Wednesday February 15, 2023 @02:57PM (#34809720)
emphasis on wanted. And it was quite obtainable depending on geo location. Some locations 70 was best we could do, but most of the US east coast we were able to get around 40
Re:TurboTLS: TLS connection establishment with 1 less round ... by Karrot_Kream on Wednesday February 15, 2023 @03:38AM (#34801440)
I've designed my own private CDN and unless you have edges near each geo, you're not getting that kind of latency. And even after TLS negotiation you have no idea what the MSS on a link along the way will be causing fragmentation and retransmits. I've made do with some shenanigans with Noise and pre shared certs and have tried to make payload sizes as small as possible.
Re:TurboTLS: TLS connection establishment with 1 less round ... by sam0x17 on Wednesday February 15, 2023 @02:58PM (#34809731)
Yes this was using a presence in every GCP and Cloudflare and AWS edge location simultainiously all hooked together with latency based routing
Re:TurboTLS: TLS connection establishment with 1 less round ... by Karrot_Kream on Thursday February 16, 2023 @03:29AM (#34816367)
Hah gotcha. Hope you got paid well for that. I do it for my own pleasure, but it's a lot of work to do as the internet just isn't designed for low latency interconnect.
Re:TurboTLS: TLS connection establishment with 1 less round ... by drowsspa on Tuesday February 14, 2023 @04:22PM (#34796211)
Doesn't it require you to already have connected to the server once?
Re:TurboTLS: TLS connection establishment with 1 less round ... by r1ch on Tuesday February 14, 2023 @04:39PM (#34796451)
There's a couple of "previously connected" bits with QUIC:

- The very first connection to a site is usually HTTP/2, which requires an additional RTT compared to QUIC, as the browser doesn't yet know if the server supports QUIC. In the response, the server can advertise the presence of QUIC support with the Alt-Svc header. This support flag can also be present in a HTTPS DNS record for the domain but that isn't queried by all browsers yet. Future connections to the same server will default to QUIC once the browser is aware of support, saving an additional RTT.

- Once connected to a QUIC server, the encryption keys can be cached for future connections, allowing the client to send data with the initial connection request (so called 0-RTT). This is only safe for idempotent requests though as this part of the protocol could be replayed by an attacker.

Re:TurboTLS: TLS connection establishment with 1 less round ... by kixelated on Tuesday February 14, 2023 @07:22PM (#34798271)
You're right that HTTP/3 requires Alt-Svc at the moment. QUIC itself doesn't require a pre-established connection (1-RTT), which is notable for non-HTTP/3 protocols and WebTransport.
Re:TurboTLS: TLS connection establishment with 1 less round ... by drewg123 on Tuesday February 14, 2023 @06:14PM (#34797603)
QUIC is horribly inefficient on the server side, so there are legitimate reasons to use TLS 1.3 over TCP in high traffic scenarios (like CDN servers).
Re:TurboTLS: TLS connection establishment with 1 less round ... by 10000truths on Tuesday February 14, 2023 @06:22PM (#34797694)
Interesting, can you explain in more detail on what makes QUIC more inefficient than TLS over TCP on the server side?
Re:TurboTLS: TLS connection establishment with 1 less round ... by kixelated on Tuesday February 14, 2023 @07:18PM (#34798242)
Kernels and hardware have been optimized for TCP. QUIC will catch up eventually.
Re:TurboTLS: TLS connection establishment with 1 less round ... by 10000truths on Tuesday February 14, 2023 @08:07PM (#34798674)
AFAIK, kTLS and hardware TLS offload don't solve the latency problem anyways. Those only handle the AEAD and record encapsulation/decapsulation in the critical path, where maximizing throughput is the concern. Control messages are not handled, so session establishment with client hello, cipher exchange, key exchange etc. is still done entirely in userspace, and the handshaking process is where the latency issues arise.
Re:TurboTLS: TLS connection establishment with 1 less round ... by kixelated on Wednesday February 15, 2023 @11:59AM (#34806854)
Oh yeah, QUIC is an improvement in terms of latency and even throughput over TCP/TLS. The claim that "QUIC is horribly inefficient" centers around CPU utilization and the cost of delivering each byte. That's where hardware offload shines but it doesn't exist for QUIC yet.
Re:TurboTLS: TLS connection establishment with 1 less round ... by drewg123 on Saturday February 18, 2023 @01:02PM (#34849229)
The only reason QUIC delivers throughput improvements over TCP is because it uses the same congestion control as BBR, so occasional packet loss doesn't kneecap the connection. If you use BBR TCP (or RACK TCP) on FreeBSD, you'll see the same improvement in throughput vs older TCP congestion control.

The same server that will do 375Gb/s at close to 50% idle will maybe deliver 70-90Gb/s of QUIC with the CPU maxed.

TLS+TCP delivers that performance with a lot of optimizations that just don't exist for QUIC:

- inline TLS offload (Mellanox CX6DX)

- async sendfile -- note, the above 2 mean that the kernel never even maps data from a file being sent to a client into memory, much less copies it to/from userspace like with QUIC. This cuts memory bandwidth to roughly 1/4 of what it would be with a traditional read/encrypt/write to socket server.

- TCP segmentation offload

- TCP & IP checksum offload

- TCP large receive offload

Some of these optimizations are slowly becoming available, but until all are present, QUIC will cost 2x - 4x as much to serve as TCP for a CDN workload.