r/linux • • 2d ago

Kernel Linux 7.5 To Introduce An In-Kernel QUIC Implementation

https://www.phoronix.com/news/Linux-7.5-Networking-QUIC
497 Upvotes

171 comments sorted by

71

u/cornmonger_ 2d ago

quic mtls has been my goto for the last few months

15

u/thomas-mc-work 2d ago

Would you mind sharing some details about your solution?

12

u/cornmonger_ 1d ago

right now, with rust: quinn / tokio / rustls

self-signed certs: authority + an entity per server and client

i use enums to represent the message protocol, one for server-to-client and one for client-to-server. i use the bitcode crate with the ub patched out to serialize / deserialize and the tokio frame library for frames

quic streams are cool in that, you can have the normal message stream and then you can open another for passing files (chunked)

that's basically the low-level stack

then there's the h3 crate that gives you http3 and you can roll mtls + self-signed there as well if you want a rest api instead of a binary protocol

so there's two well-supported routes depending on what you want to build out per use case

3

u/creeper6530 1d ago

What's notable to mention for non-Rusters is that Rust's enums are tagged unions, not enumerations. They can contain data like struts.

2

u/bogadana 1d ago

Idk if this is applicable to your application, but if receiving messages out of order is acceptable then you should open a stream per message. That way if part of one message gets lost you can still read all the others without waiting for retransmission.

2

u/cornmonger_ 1d ago

ooh good tip

2

u/Preisschild 1d ago

Mine too with https3. Unfortunately many load balancers dont support it well.

12

u/pilkyton 1d ago edited 1d ago

For those too lazy to read (most, judging by the questions in comments):

QUIC is a reliable low-level transport protocol built on top of UDP. It uses ACK ranges (dozens or hundreds of packages acknowledged at once) and delayed ACKs to minimize wasted transfer bandwidth and latency.

It is strictly a better protocol than TCP, which is already in the kernel.

QUIC can be used by SMB, NFS and other network file drivers inside the kernel to speed up network transfers.

Windows already does that.

70

u/eras 2d ago

20 QUIC-related CVEs this year—granted 50% of them are related to OpenSSL, which Linux won't use. Maybe they've been extra careful with this C impl? Apparently the protocol itself is solid.

At least using (or compiling it) is going to be optional, like most any kernel feature.

13

u/BCMM 2d ago

 20 QUIC-related CVEs this year

Where did you get that list from? I'd be interested to see how many involved the handshake.

-35

u/eras 2d ago

From ChatGPT. It suggests 9 are handshake-related (3 TLS interaction, 6 QUIC). Here's the list (obviously I didn't check them all, only random ones):

Direct QUIC transport implementation vulnerabilities (17)

OpenSSL (15)

Amazon s2n-quic (1)

  • CVE-2026-94450 — Incorrect destination connection ID length validation

Netty (1)

QUIC-specific TLS integration vulnerabilities (3)

Upper-layer vulnerabilities (9)

These do not necessarily depend on flaws in the QUIC transport implementation itself.

Uncertain classification (3)

Sources:

20

u/TheG0AT0fAllTime 1d ago

Sigh.

-2

u/eras 1d ago

What do you mean by this? Is the data inaccurate?

I mean I get it, some people are very much against using AI in any form. But can one suggest another way to compile such a list that doesn't involve doing a lot more work than is warranted for a comment in a Reddit discussion?

6

u/Adept_Percentage6893 1d ago

The reaction on the downvoting is probably a mixture of a lot of different things. The biggest contributor is probably because you basically just posted ChatGPT output which most people can already can do if they're curious. If you wanted to make a comment like this (and you had some experience with QUIC, security, and/or kernel development) the better approach would be using the chatbot as a search engine but providing your own response based on what you know and what you were able to find online.

But your top level comment refers to just the totals as if that's an accepted thing that has been published somewhere and you follow up reply is just what ChatGPT told you.

If all you do is copy/paste from ChatGPT then you're basically just a Human-in-the-loop Reddit comment bot.

0

u/eras 1d ago

I mean yes, the person I was responding did ask how I got the data, and I figured it would be useful for them to actually get the data if they wished to review it further. They can just copy-paste it for their further analysis needs.

Was the data wrong?

I did provide my own analysis on the 20 vulnerabilities (which data I don't think nobody is refuting, and besides the actual precise number doesn't even matter), and the analysis was that most of them would not apply to Linux. But it wasn't even the point, if they do or don't. The number would works as a proxy that tells how complicated QUIC is and how easy it is to get wrong.

History that shown that if we won't find security flaws in the new QUIC implementation, I'm sure it won't be due to the vigilence of people writing and reviewing the code.

1

u/Adept_Percentage6893 8h ago

I mean yes, the person I was responding did ask how I got the data, and I figured it would be useful for them to actually get the data if they wished to review it further.

That's a good impulse and I do that same sort of thing a lot. Even if I don't have someone's full answer if I have part of something I sometimes just point them in the right direction with the right context just to help them out. The community benefits from people wanting to be helpful like that (kind of what I feel like I'm hopefully doing now) but it's also helpful to just kind of understand how things might be viewed by others.

Like I was saying before, some people are just purely responding to "ChatGPT" and stopping their thought process there. Not much you can do about that. Like that guy sarcastically saying that you're being "persecuted for your use of AI" is himself being heavily downvoted and probably from the same group of people who just read the first part of his comment thought he was being genuine rather than actually agreeing with them in a joke-y way.

Was the data wrong?

For the downvotes coming from more reasonable people that's going to very much be the question. I would say that your original comment was better phrased as "Whenever I've looked I've only seen 20 QUIC related CVE's this year" rather than your statement which is pretty definitive and so people are going to naturally think you're drawing on some sort of authoritative source for information that says that exact thing.

With that phrasing, if people ask you for your information you can go to whatever sources ChatGPT gave you and say you were just basing your opinion on looking at things like that (as long as you actually were looking at the CVE's) and so your ChatGPT use is just some part of your personal workflow instead of being part of the comment. A chatbot can sometimes find information but it's not a source by itself.

But then you posted a huge comment where you freely admitted that you only checked some of the links. That's fine as a personal process where you don't feel like you really need to be an expert on QUIC's security situation but it's kind of off putting when you're on the receiving end of the information.

Just sharing the wall of links not only offloads the work of making sure ChatGPT didn't hallucinate or misunderstand something (a thing that still happens) onto whoever might be curious about QUIC (which basically gives them additional work) you're basically admitting that when you categorically said there were only 20 QUIC related CVE's you were just giving ChatGPT's response. So ChatGPT became the source of information rather than you.

The non-chatbot analog would be like linking someone to a google search that worked for you and just saying "the web page you're after is in these search results somewhere, hopefully your google search results look like mine) instead of just finding the page they're interested in and pointing them to the actual URL.

and the analysis was that most of them would not apply to Linux.

That is good analysis but AI just isn't to the point where you can just copy/paste the response and even if it was, ChatGPT is free and people can just have asked it the same thing you did if they wanted that level of certainty.

-7

u/DrinkMoreGlorp 1d ago

Take these negative internet points to heart, little one. You are being persecuted for your use of AI. Retreat from the unsafe open world, and become radicalized against these Luddites (derogatory), who fear and envy your skill and sexual attractiveness.

4

u/Ursa_Solaris 1d ago

Why are you speaking like an anime filler arc villain?

-2

u/DrinkMoreGlorp 1d ago

I'm saving his life with reverse psychology. If I didn't this man would be going into full cyberpsychosis 10 years from now.

2

u/AeroNotix 3h ago

'skill', lmao

-18

u/alex-weej 2d ago

Was the implementation code responsible for these defects written by humans?

11

u/arbv 2d ago

Whatever they add to kernel increases the attack surface.

Tannenbaum was right, btw

0

u/TURBOKAN 6h ago

Meanwhile they also remove old stuff, drivers etc. Ofc I don't know how much is the ratio but it is what it is

2

u/arbv 2h ago

They are adding a lot of stuff that is going to be actively using vs removing old, dormant stuff. Code lines are not balancing each other like that.

-25

u/EnUnLugarDeLaMancha 2d ago edited 2d ago

AI is already, right now, more important to make code secure than the implementation language. Any new code that goes into the kernel these days is heavily analized for vulnerabilities by AI agents and fuzzers before the release.

Using a memory safe or unsafe language may become much less important in the future than what it used to be.

17

u/Adept_Percentage6893 2d ago edited 2d ago • Bravo

AI is already, right now, more important to make code secure than the implementation language.

I feel like it would be more like just another tool in the toolbox along with code review, regular SCA, least privilege in the runtime environment, etc, etc. There doesn't appear to be a reason to avoid having another layer of security even if you feel like the AI helps a lot in all areas.

is heavily analized

I know it's likely a typo but I kind of imagine new code does get the proverbial rectal probe for deficiencies.

1

u/grat_is_not_nice 1d ago

Something something backdoor rootkit

5

u/AlexanderMomchilov 2d ago

Fuzzers are trying to guess at correctness after the fact, rather than just making something provably safe by construction.

6

u/eras 2d ago

Heavily what now?

That's probably quite true. And this bit of code is going to get an extra lake or two spent on it.

Still, it seems the protocol is big and complicated and difficult to get right. What we choose to do for better performance..

2

u/averi_fox 2d ago

I don't fully agree: AI has to been combined with tools. AI on its own makes too many mistakes, but AI with Rust + Aeneas + Lean formal verification can be flawless.

-1

u/SanityInAnarchy 2d ago

Bots are far better at finding and exploiting security holes than they are at writing secure code. Like humans, having tools to help automate that process -- particularly tools that are themselves deterministic code that can be audited for bugs, rather than a bunch of markdown saying "make no mistakes" -- makes the process easier and more efficient.

It even makes training more efficient.

3

u/m4uri 1d ago

The SMB over QUIC part is what I'm really curious about. Windows Server already does it, and for remote access it's a nice replacement for exposing 445 to the world, so having it in the Linux kernel would be useful.

On the security side, QUIC is invisible to a lot of older proxies and firewalls, because it's UDP 443 and encrypted from the first packets. Many shops just block UDP 443 so browsers fall back to TCP and TLS inspection keeps working. If this ends up under things like NFS or SMB, admins will have to handle that traffic on purpose instead of by accident. I'm also curious how the kernel people weigh the extra attack surface against the userspace libraries we have now.

53

u/clippy_is_a_prick 2d ago

Ah yes - lets put complex application logic in the kernel. Thats never gone wrong.

Anyone remember that the story about the arbitrary code execution bug in the windows kernel because of the fucking scroll bar

96

u/BCMM 2d ago

 Ah yes - lets put complex application logic in the kernel.

I don't think that's an accurate description of this patch. HTTP/3 is an application layer protocol and QUIC is the transport layer protocol that it uses. The two are often conflated because QUIC was originally developed for HTTP/3, but it's not tied to it in any way.

Also, note that the handshake is delegated to userspace, and with it, most of the complexity involved in encryption.

There's a draft RFC for NFSv4 over QUIC and Windows already supports SMB over QUIC, so there are clearly well-established kernel modules which would benefit from a kernel implementation.

So it's not really application logic, it seems like the complexity is pretty reasonable for kernel space, and there's a real need for it.

7

u/Booty_Bumping 2d ago

There are lots of cross-cutting concerns, it's not quite as simple as QUIC being on a different layer from HTTP/3 the way it was with TCP+HTTP/2.

10

u/tadfisher 2d ago

I'm a bit iffy on networked filesystems being a kernel feature myself. Maybe 9P is okay because of simplicity and by virtue of being closer to a protocol than a VFS, but even then there are plenty of userspace implementations.

If there is hardware supporting QUIC offload, I might change my tune.

8

u/chocopudding17 2d ago

Well NFS has been in-kernel forever, so idk what to tell you...I presume that most of its cryptographic complexity (e.g. with Kerberos) happens in userspace, much like this QUIC module might do.

6

u/Moscato359 2d ago

Quic uses tls 1.3 which is offloaded

But not full Quic itself 

1

u/zerosign0 1d ago

QUIC has pluggable custom congestion control, I'm not sure how this going to play out in kernel space ...

2

u/Adept_Percentage6893 1d ago

TCP also exposes congestion control algorithms as tunables:

bash ~> sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic

bash ~> sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = cubic

1

u/zerosign0 1d ago

But it is globally applied in kernel while in user space we can specify or even better implement the logic per process ...

2

u/Adept_Percentage6893 1d ago

Assuming I understand your point, what I linked was just the global setting but you can control what is used for congestion control by using TCP_CONGESTION in setsockopt().

Unless you're saying you want the congestion control to continue being user space so you can specify your own niche algorithm. I would be skeptical how beneficial that would be but usually that would be something you do by just forgoing the in-kernel implementation and just continuing to use user space QUIC.

1

u/zerosign0 1d ago

I see nvm then

1

u/bogadana 1d ago

being user space so you can specify your own niche algorithm

Can't ebpf be used instead like for tcp? https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_STRUCT_OPS/tcp_congestion_ops/

1

u/Adept_Percentage6893 1d ago

What I was metnioning predates eBPF by many years and I've never done anything that elaborate with eBPF but that does align with my understanding as well. The other user seemed to be saying that they felt the pluggable congestion algorithms of QUIC were a problem so I was just bringing up that TCP has long since been that sort of way.

88

u/get_homebrewed 2d ago

tcp is already in the kernel...??????

12

u/Preisschild 1d ago

And TLS (kTLS)

-35

u/clippy_is_a_prick 2d ago

TCP entered the linux kernel in like the 90s, i dont think anyone was thinking about how it go wrong back then.

45

u/get_homebrewed 2d ago

because it wouldn't. And yes that's when tcp was around. We got tls in the kernel, we have a bunch of networking protocols in the kernel. You just don't know anything

6

u/Liskni_si 2d ago

Wasn't there a RCE in MPTCP earlier this year? Surely there were similar in normal TCP back then in the 90s and 00s...

5

u/get_homebrewed 2d ago

yes, and there will continue to be for every driver in the kernel

-20

u/clippy_is_a_prick 2d ago

It never would, your right. While we are on the subject of TLS https://nvd.nist.gov/vuln/detail/cve-2025-39682

Just because its in, doesnt mean a) it doesnt come with risk b) i have to be okay with adding any of it or with adding more

26

u/get_homebrewed 2d ago

everything in the kernel has a risk. That's not a reason not to add it.

You do because that's how kernels work and will continue to work. Educate yourself

0

u/throwawayPzaFm 2d ago

That's not a reason not to add it.

It is, and a pretty good one. That's one of the main promises of microkernels.

-15

u/Cultural-Desk-9045 2d ago

No. Networking can be done at userspace.

17

u/get_homebrewed 2d ago

can, and it is. And it can also be done in the kernel, along with drivers in the kernel needing a quic driver for that.

So guess what happens next

-5

u/Cultural-Desk-9045 2d ago

CVE-2027-XXXXX: Use-After-Free in Kernel QUIC Transport Driver Allows Remote Code Execution

3

u/InadequateUsername 1d ago

Maybe you should email Linus and tell him why he’s wrong.

3

u/gmes78 2d ago

But it's much slower.

Sure, you can be paranoid and do everything in userspace, or you can just write correct code to do it in the kernel.

Despite what people claim, it is possible to do things correctly. You don't need to compromise on security or performance if you're willing to invest in a good implementation.

0

u/maigpy 2d ago

that's not always necessarily the case though. optimised implementations in user space can be faster for specific use cases.

2

u/gmes78 2d ago

Do you think the person I replied to was alluding to that level of nuance? Looking at their other comments, absolutely not.

19

u/autogyrophilia 2d ago

QUIC in the kernel is essentially a prerequisite to implement it for applications that really need it, such as Samba and could potentially offer performance advantages through kTLS .

8

u/Moscato359 2d ago

Samba can do Quic in userspace just fine

6

u/autogyrophilia 2d ago

Sorry for that brainfart, I meant the CIFS kernel module 

1

u/ZorbaTHut 2d ago

FUSE is still limited compared to in-kernel filesystems.

8

u/frymaster 2d ago

anyone remember when Windows put HTTP in the kernel? (to get better headline performance than Apache)

3

u/Irverter 1d ago

arbitrary code execution bug in the windows kernel because of the fucking scroll bar

wait, what?!

1

u/Dwedit 4h ago

There was famously kernel level code execution bugs from fonts that led to the original XBOX getting exploited.

10

u/QuantityInfinite8820 2d ago

Pulling a non-Rust variant of this into the kernel is insane

10

u/TehBrian 2d ago

Gotta give the CVE-finding LLMs something to do nowadays I guess

-21

u/InadequateUsername 1d ago

Rust is a meme

7

u/koczurekk 1d ago edited 1d ago

Ears covered, head buried in sand, and yet you managed to write this comment. I wonder how — did you wiggle your toes with utmost precision? Commendable indeed.

-6

u/InadequateUsername 1d ago edited 1d ago

No, only rust community pushes their language onto others like they're Jehovah's Witnesses going door to door. Rust evangelism fatigue does not equate to sticking one's head in the sand.

Rust isn't the best option everywhere. The networking stack is C, so a QUIC implementation makes sense to be in C or they'd be adding more complexity.

3

u/fekwrfnewlkfnkwle 1d ago

Just FFI, no?

-1

u/InadequateUsername 1d ago

FFI brings additional overhead, every call made to the rest of the stack is unsafe and then you need to work with memory ownership between the two languages which adds more overhead and scope.

3

u/koczurekk 1d ago

"Rust is a meme" is a dismissive comment implying that Rust is not a successful, widely used language that projects migrate to and integrate willingly. But they do.

You speak as if Rust users were a homogenous group externally targeting projects they have no involvement with, which is not the case. What you see are contributors and maintainers choosing to adopt Rust for its technical merit.

I'm sure you can link me a PR or two of bad-faith RIIR issues by randos on GitHub. I don't care.

-1

u/InadequateUsername 1d ago

No, what I'm seeing is a whole lot of people saying "Program XYZ should be rewritten in rust", it's increased everywhere on Reddit as if such migrations were cost free, or that rust is the best option everywhere. Or that the kernel maintainers are misguided for not choosing rust for quic, as if interfacing rust with the network c stack is a totally free option with 0 downsides.

And externally, as if people saying GTA6 for example should have been written in rust isn't memeing.

3

u/bogadana 1d ago

Well because generally C is so terrible that it should be thrown out. It just so happens that rust is the one language that is well known and fits all of Cs use cases and is also much better. Yes migrating to rust isn't free but new C code in a project that's already transitioning should be treated with utmost suspicion.

1

u/InadequateUsername 1d ago

Okay go let them know that on the kernel mailing list

2

u/bogadana 1d ago

Yes a mailing list filled to the brim with extreme C fetishists sounds like the perfect place for this conversation.

1

u/InadequateUsername 1d ago

Instead of dismissing their choice in language, maybe try to understand the reasoning behind it?

There is irony in calling they fetishists lol

→ More replies (0)

2

u/PhrancesTheMute 1d ago

The Rust evangelism strike force is out with the downvotes proving your point.

3

u/iBoMbY 1d ago

What could possibly go wrong with adding an overly complex network protocol to the Kernel?

7

u/AngryFker 2d ago

Wen libreoffice in kernel? /s

Everything should be userspace. Not kernel.

43

u/wowsomuchempty 2d ago

Wireguard in the kernel means faster networking.

Not good?

27

u/clippy_is_a_prick 2d ago

Vulnerability in QUIC means vulnerability in kernel space, kernel space can do whatever it wants.

7

u/wowsomuchempty 2d ago

Yeah. Still need it.

(love the handle, btw)

-4

u/pickle9977 2d ago

I’d argue what is needed is protocol implementations to move to hardware.

The kernel is the worst possible place to deal with untrusted inputs, especially in ring zero.

15

u/Vitus13 2d ago

Hardware implementations of TLS 1.2, and the ossification around it, are the reason why TLS 1.3 reports itself as TLS 1.2 with an extension that says "j/k, actually TLS 1.3".

Hardware implementations of IPv4 are why we still don't have ubiquitous IPv6.

Hardware will never iterate as fast as software.

13

u/user190423 2d ago

Then what happens if theres a hardware vulnerability in the hardware implementation of the protocol

2

u/Business_Reindeer910 1d ago

hardware is entirely too static for for full implementations. I do think we should rely on generic accelerators of the underlying operations though.

17

u/Sataniel98 2d ago

Are you Andrew Tanenbaum?

11

u/mort96 2d ago

Look I think microkernels are cool too. But Linux isn't a microkernel. That means stuff has to be in kernel space.

6

u/Luigi003 2d ago

Being a monolith or a microkernel doesn't have anything to do with being userspace or kernelspace

I'm not sure why Quic should be kernel space while other things that are more fundamentals and actual singletons like the display or audio servers are nor

5

u/Cultural-Desk-9045 2d ago

When MPEG codecs in kernel? /s

2

u/slashgrin 1d ago

I'm sympathetic to this position (I think we're well overdue for a true microkernel renaissance) but by the same logic TCP should also be evicted from the Linux kernel.

1

u/bluejekyll 2d ago

It is a monolithic kernel.

1

u/deanrihpee 1d ago

what's the benefit of it being an in-kernel?

1

u/coredit 23h ago

QUIC is a advertisement tumor and we all know it. Sure, less protocol overhead is commendable, but that's not what it is about.

-7

u/Important_Put_3331 2d ago

Eli5 : How is quic different from wireguard? Tcp vs udp?

98

u/anh0516 2d ago

QUIC is basically the spiritual successor to TCP. It runs on top of UDP.

WireGuard is a VPN protocol, a completely different thing.

8

u/BinkReddit 2d ago

WireGuard is a VPN protocol, a completely different thing.

Yes and no. Unlike TCP and UDP, QUIC supports encryption in the protocol by default and as a standard; TCP and UDP do not do this.

2

u/anh0516 2d ago

That I actually did not know. That's interesting, I'd expect most things using QUIC to implement encryption above. But I guess it could be useful for retrofitting encryption + QUIC on unencrypted protocols.

10

u/Top-Rub-4670 2d ago

I'd expect most things using QUIC to implement encryption above

You expect wrong, nothing encrypts on top of QUIC (short of E2EE). That's one of the main reason why quic was created btw, reducing the number of TLS roundtrips. Adding another layer of encryption would defeat the purpose.

2

u/anh0516 2d ago

You learn something new every day.

1

u/Business_Reindeer910 1d ago

cleartext quic exists. I'd definitely want to use it for local dev in many cases even if requires an explicit opt in.

4

u/user190423 2d ago

Its not even support, its obligated to use cryptography, no? I'd say it's closer to a TLS successor

14

u/ZorbaTHut 2d ago

There's some third-party "unencrypted QUIC" extensions, but they're (very intentionally) not supported by any of the major implementations. So yeah, practically speaking, QUIC means always-encrypted-all-the-time.

But it's not quite a TLS successor because it's also managing the transport-layer work. It's basically TCP 2.0, combined with TLS, all running on top of UDP.

(Arguably, the OSI model suggests that TLS was "layer 4.5", grafted on top of the existing layer 4, and QUIC just re-combines Layer 4 into what it was always supposed to be.)

1

u/bogadana 1d ago

If layer 4 was what it was always supposed to be then quic would be its own protocol and not rely on udp.

1

u/ZorbaTHut 1d ago

If that was practically possible, I'm sure they would have done that, but getting a new base transport protocol accepted would be harder than ipv6. It's not that big of a loss though, UDP was already designed as roughly-bare-metal.

2

u/HugoNikanor 21h ago

The UDP RFC is only a few pages long, and basically just "IP but add ports".

1

u/InadequateUsername 1d ago

Encryption is not encapsulation.

-6

u/alex2003super 2d ago

Both QUIC and WireGuard are encrypted protocols that run over UDP.

If one can be in the kernel the other should as well.

4

u/lkangaroo 2d ago

Wireguard "intentionally lacks cipher and protocol agility" to make it easier to implement and verify. TLS... good luck.

2

u/alex2003super 2d ago

TLS is already available in the kernel though

1

u/lkangaroo 2d ago edited 1d ago

I'm not saying TLS can't be made to work. I'm saying after wg is feature-complete, further dev effort can be more focused on security fixes on a smaller, relatively static codebase, as opposed to TLS constantly having to follow new standards, and deal with new bugs that arise each time. And the stakes are higher since they can turn out to be kernel CVEs. Plus fewer variations, fewer edge cases to test.

Another pitfall for crypto code in general is until recent years, they tended not to get scrutinized for non-crypto issues like memory safety. Again the potential impact gets higher because you're in the kernel.

33

u/IAm_A_Complete_Idiot 2d ago

quic is an alternative to TCP, built on UDP. It supports things like mobile roaming, as well as a few other features like being able to form connections faster with fewer round trips I think.

Edit: quic can be implemented in userspace on top of UDP. The kernel needs a QUIC implementation though for some other networking protocols built on top of it. I'm not sure if userspace programs are supposed to be able to use the kernel QUIC implementation though or if there's any benefits to that.

9

u/ZorbaTHut 2d ago

I've been using it in a few projects of mine, and one thing I really like is that it natively supports parallel streams, each of which is sequential but which are not guaranteed sequential compared to each other. There's some neat performance tricks you can do with this.

Before this, the only solutions were (1) open a shitload of TCP streams, (2) implement your own TCP-wannabe on top of UDP. QUIC is basically a competently-built general-purpose implementation of #2.

1

u/cs_office 1d ago

As a game developer, QUIC always reminded me of how we do connections, with reliable and unreliable streams built on top of UDP

2

u/ZorbaTHut 1d ago

Coincidentally, I am also a game developer, and while I haven't used it for exactly that yet, I am absolutely going to :)

There's a QUIC Datagram feature that's meant to mimic the UDP-drop-on-congestion behavior, but from what I understand this actually doesn't work too well, not because of QUIC but because drop-on-congestion was always a bad idea. Apparently the right solution here is to use the QUIC library to figure out if you're starting to get congested - the protocol tracks this stuff - and if so, start pre-emptively "dropping" messages before they're sent.

I have not tried any of this yet though.

1

u/bogadana 1d ago

QUIC datagram are a misfeature really and only relevant when you're sending data with unknown structure. If you actually know what the data you're sending means you can always do a better job by using proper streams. Congesting the link should be avoided like the plague by any real time application because then things get stuck in router buffers that are out of your control.

32

u/BinkReddit 2d ago

From the article:

...modern transport layer network protocol designed for lower latency and greater performance over traditional TCP while also being encrypted by default.

11

u/cheezus_crisco 2d ago

QUIC was developed by Google as an alternative for standard HTTPS connections with, among other things, better support for roaming across NICs, e.g. switching from cell data to wifi on a smartphone without dropping and renegotiating the TLS connection. It eventually became the standard for HTTP/3

13

u/dkopgerpgdolfg 2d ago

Just some pedantry: HTTP3 uses Quic, but still is its own thing. Using Quic doesn't necessarily require any HTTP things.

3

u/beefcat_ 2d ago

Time to bust out the trusty old OSI model diagram

3

u/msthe_student 2d ago

That's kinda out of date though, because you can run "DNS over HTTP" and "SMB over QUIC"

6

u/beefcat_ 2d ago edited 2d ago

Time to bust out the trusty old sharpie and start scribbling some complications on the trusty old OSI model diagram

2

u/cheezus_crisco 2d ago edited 2d ago

Fair note, yeah its origin was for HTTP, but isn't exclusive to it. I recall the days when QUIC was often blocked due to 443 widely being configured as TCP only in firewalls so, as a fan of it, seeing it become a part of the official standard was nice to see.

1

u/FostWare 2d ago

Nah, it was blocked in firewalls because it’s a pain to filter or monitor for those times you have a duty of care for those using the internet (saw this with previous roles in School IT)

1

u/bogadana 1d ago

Perhaps you should stop spying on people instead. Doing so on a network level is ineffective anyway.

1

u/No-Protection-7019 2d ago

Ca c'est cool

1

u/Grey_Ten 2d ago

honestly I don't know a damn thing about the linux kernel, and every single update that I have read so far seemed to be written in chinese or something.

I guess this QUIC thing is good lol

-10

u/Cultural-Desk-9045 2d ago

But… why?

45

u/dgm9704 2d ago

”This in-kernel implementation of QUIC allows for other kernel subsystems to leverage QUIC such as for SMB and NFS file sharing. QUIC in the kernel also allows for it to work with standard Socket API semantics, ALPN-based connection dispatching, and better performance. By having QUIC in the kernel allows for reducing system call overhead, zero-copy mechanisms, and future crypto hardware offload support.”

4

u/Zatrit 2d ago

So, faster QUIC networking?

4

u/30porn87 2d ago

And eventually faster networking for other things as well, through QUICK

0

u/Cultural-Desk-9045 2d ago

Why are SMB and NFS kernel level? It only needs a small bug and you get pwned.

20

u/dkopgerpgdolfg 2d ago

Considering that we have TCP and TLS in the kernel, why not?

-16

u/Cultural-Desk-9045 2d ago

That is waiting for a disaster to happen

6

u/dkopgerpgdolfg 2d ago

A bit more specifics please? Why?

If for userland programs this isn't much worse than bringing in their own impl, this is great for many use cases.

5

u/IAm_A_Complete_Idiot 2d ago

More stuff in the kernel without justification is generally bad. It makes it harder to maintain the kernel, and it's yet another attack surface for vulnerabilities. Especially when it comes to networking stuff like QUIC.

I think the kernel is justified in adding it, but it does need justification. Especially when something like QUIC can be implemented in userspace (and TCP has a lot of drawbacks to being there)

9

u/dkopgerpgdolfg 2d ago

More stuff in the kernel without justification is generally bad

I agree. Just, there's plenty justification.

And having 10 badly maintained userland impls, maybe even on top of DPDK if you like, isn't great for security either.

2

u/wowsomuchempty 2d ago

The vulnerabilities are more likely to be the legacy shit, that no one has looked at as hard for ages.

That is getting stripped out now (which I'm in favour of).

2

u/IAm_A_Complete_Idiot 2d ago

Fwiw there's several good userspace QUIC implementations. I find the argument that things should move to the kernel for 'trusted' code reuse to be pretty bad. The kernel isn't a code reuse layer - that's what libraries like glibc, or libcurl, etc. are for. Not to mention, it's not like everything in the kernel is well maintained anyways.

I think hardware offload and for other subsystems that may want to use QUIC is enough justification, but yeah.

2

u/dkopgerpgdolfg 2d ago

Just for completeness, I wasn't implying that you're "wrong" somehow. It's definitely a risk, and there definitely will be bugs too. At the same time, there's also beneifts, obviously.

And how much "should" be inside/outside the kernel is also a very opinionated topic, for everyone.

0

u/Cultural-Desk-9045 2d ago edited 2d ago

Hardware offload can be done at userspace level too. Not enough justification

3

u/IAm_A_Complete_Idiot 2d ago

Right, but eBPF and DPDK have a bunch of downsides and restrictions on each. eBPF is awesome, but it requires root access and it can't express a lot of algorithms that can't be proven by the eBPF VM to terminate, for instance. And for cryptographic code? I'd really want the eBPF VM to not be involved in that.

Designing for eBPF isnt trivial. DPDK meanwhile takes full control over the NIC. It's basically DOA for any end user use.

-4

u/Cultural-Desk-9045 2d ago

Security concerns

5

u/dkopgerpgdolfg 2d ago edited 2d ago

Quic isn't any worse than all the things that are already there. As said, TLS, or NFS, or LUKS, or wireguard, or hwrng things, or just literally any code line in C...

I'm more worried about known long-standing edge case issues in eg. IPv6 temp_addr and FUSE, than this

6

u/IAm_A_Complete_Idiot 2d ago

Hardware offloading support needs it in the kernel, as well as because other subsystems that use the network in the kernel might want QUIC (Samba for instance)

5

u/NatoBoram 2d ago

Why not?

-7

u/CoronaMcFarm 2d ago

Having more is never better in software except when you need it.

12

u/NatoBoram 2d ago

And we need it.

2

u/Cultural-Desk-9045 2d ago

And when it’s broken, you break into kernel space.

-3

u/superpowerpinger 2d ago

That was quick.

-9

u/JerryRiceOfOhio2 2d ago

why.......

-3

u/RayneYoruka 2d ago edited 2d ago

Oh dear.. me wants