-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review quinn crate for possible uses #37
Comments
BTW I've since updated the sketch (after some rereadings of the protocol, among other things): https://gist.github.com/eaglgenes101/9a37e7e15817ca76b6d96a5c54cdaf20 |
As one of the quinn maintainers, my primary goal is specifically to develop a cutting-edge transport protocol implementation for realtime multiplayer games, so if there are any barriers I'll be happy to help. It should be noted that QUIC can easily be applied out-of-the-box for any combination of reliable/unreliable ordered/unordered messaging. The partial reliability extension that @eaglgenes101 cites reduces demands on the application for the unreliable-ordered case, which is useful, but no extensions are required for the necessary primitive operations to be available. |
Fourth take. No need for too much extras, just plumbing of what already exists. https://gist.github.com/eaglgenes101/1a7d7350bebdbdfe0244915921b46d6a |
That seems basically reasonable. A few notes:
|
Fifth take, taking the above issues with the previous iteration into consideration: https://gist.github.com/eaglgenes101/a99438772511ecfc0542f3377796bb9e |
The extension you're proposing has some issues.
This will lead to inconsistent behavior under packet reordering. You can't rely on receiving frames in the same order they're sent.
This problem is already solved more robustly by using separate streams per-message.
It's unclear what a "channel" is. Sending unordered messages as separate streams does not require waiting for
Inter-packet timing is not preserved across the network.
What does this do that sending the message as a stream doesn't? Ultimately, it's not clear what problem this extension trying to solve. A QUIC extension should be motivated by enabling something that is otherwise difficult or impossible. If your problem can be solved effectively without inventing a new extension, that should be preferred, because you are hence able to maximize your benefit from the engineering that has already been done, leave open the door for interoperability, and reduce opportunity for error. |
Note that we are not ignoring this. We want to finish 0.1 before we dive into this. Once that is done, QUIC and proposed extensions will receive a lot of attention. The amount of work ya'll have put in will be invaluable, thank you for that. |
@Ralith can you elaborate more on the option of "It should be noted that QUIC can easily be applied out-of-the-box for any combination of reliable/unreliable ordered/unordered messaging" I can't directly find more information about this part of QUIC." Can I choose if QUIC sends packets: unreliable or reliable, ordered or unordered, sequenced or just reliable? |
QUIC does not send packets reliably or ordered; it retransmits information so long as it is relevant, always composing new packets to do so, and the application can declare a certain outgoing stream of data to no longer be relevant at any time by "resetting" it. Hence, you can take the following approaches at the application layer to implement every type of messaging:
For every form of unreliable messaging, you also have the option to abandon streams in favor of the QUIC datagram extension, which lets you transmit smaller-than-MTU data without fragmentation or a need to explicitly reset, while still retaining the benefits of operating within a QUIC connection (i.e. the handshake, flow control, congestion control, multiplexing, and security measures). I expect this to only very rarely be necessary. Note that "application layer" above (and in QUIC documentation in general) refers to the layer above the QUIC implementation, whether that's a literal application or another library providing domain-specific abstractions. |
Thanks for taking the time to answer, so, if I'm understanding you correctly, laminar - at the application level - 'could' wrap QUINN and provide some of the above-noticed delivery types? I've got twho other questions: 1: Are you familiar with ordering stream and would this be possible with QUINN/QUIC? |
Yes, these strategies are available to anyone calling into a QUIC implementation.
Yes, you can use the above strategies to implement whatever ordering relationships you like between your messages. For example, to have two independently ordered reliable message streams, you would use two QUIC streams with application framing--that's what they're for.
Current IETF QUIC mandates that all conforming implementations use a specific cryptographic protocol, which is an adaptation of TLS 1.3. Quinn uses rustls, a Rust-native TLS 1.3 implementation, for the bulk of this logic. The implementation is complete. Some patches to rustls were required, but are expected to be merged before the upcoming major release; see rustls/rustls#187 for details. |
Really thanks for helping out, last but probably not the least question, do you really think QUIC is a good fit for a high-performance game network protocol since it is originally developed for speeding up the web communication? I did a lot of research into QUIC last days however I'm probably not as updated as you are on how the internals work. And are there any weaknesses of QUINN that might be helpful to know in front |
QUIC has always been designed as a general-purpose protocol. While it will undoubtedly be a great boon for the web, the problems it solves are general problems, and it provides general solutions. In fact, my motivation for developing Quinn is specifically to have a secure, robust, and easy to use transport protocol for my own real-time multiplayer game projects.
|
@Ralith thank you so much for this great information. I took a look at quinn this morning and it's looking like its coming along really well (excited for I think our biggest blocker for using quinn right now the fact that it is based on I am really really excited to see where quinn goes and I hope that we can have a strong relationship and work together on a really good transport protocol for real time games :). I can totally see even amethyst moving off of laminar in favor of some |
In principle, it is possible to use |
@Ralith thats great to hear I guess I had flipped the level of abstraction that proto does. We are in the process of migrating |
QUIC allows you to have your own congestion control algorithms, does QUINN also provide that and or does QUINN have some already implemented? |
Quinn currently uses the congestion control algorithm specified in the IETF recovery draft, and fully supports explicit congestion notification. Pluggable congestion control would be interesting to support should a need arise. |
We did decide a while ago that for now, QUIC is not really a solution for us. We wrote a document on this: https://docs.google.com/document/d/1ypUNgELQ7jpxEEyjsWb7QBcXCUIg_hWPBGOQSzT0as4/edit?usp=sharing Conclusion: There are a few things needed to be done before we can switch to QUIC
The last one is the most speculative. "I am a bit skeptical of some of the reliability options of QUIC, for unreliable you could Create a new stream for every message and reset them when they are no longer relevant. However, this does not seems optimal to me." |
This is wrong. The IETF has taken care to ensure that QUIC is a general-purpose protocol, and they succeeded. HTTP/3 is built for the web; QUIC is not HTTP/3.
It's difficult to respond to such a vague criticism. Opening and resetting streams are both computationally trivial operations that have zero latency. This very issue also contains discussion of the simple QUIC datagram extension, which allows you to work with datagrams that have reliability similar to raw UDP packets, if for some reason this is deemed necessary. In practice, it should not be necessary except as a minor optimization for cases where both loss and reordering are acceptable. |
There was some circle in arguments but we, as a team, decided to not go for QUIC a long time ago. Thanks for putting your arguments here, when it is needed, we can always revisit it. But for now, it will be closed. |
https://github.com/djc/quinn is an implementation of QUIC. We should include reviewing it for 0.2 along with @eaglgenes101 work here: https://gist.github.com/eaglgenes101/55466ff21a2e7184e6499211086ea725
The text was updated successfully, but these errors were encountered: