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
DNS over QUIC #1673
DNS over QUIC #1673
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1673 +/- ##
==========================================
- Coverage 79.88% 79.84% -0.05%
==========================================
Files 177 183 +6
Lines 18264 18602 +338
==========================================
+ Hits 14590 14851 +261
- Misses 3674 3751 +77 |
This is exciting! cc @Ralith |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have any feedback on Quinn, that would be interesting too!
So I ended up using the higher-level crate, Otherwise, I think it's working pretty well. The QuicStream impl I made for DNS appears to work fine in my tests. I have a bug in the server impl somewhere at the moment where the trust-dns server isn't responding to requests in the integration tests. So I'm trying to figure that one out. Anyway, overall, I think I like the higher-level interfaces, I was able to make progress relatively quickly, so I think it's really good. |
…t strictly necessary
This should be feasible. Quinn presently needs only two things from a runtime: the ability to wait on readiness of a file descriptor (or Windows equivalent), and the ability to spawn a task. Neither of these are fundamentally hard problems, they just need someone who cares enough to see them abstracted. There's some incidental helpers (e.g. channels) we currently pull from tokio as well, but I believe those are self-contained and should safely work on any runtime, or at worst replaced with independent or vendored code.
Great to hear! |
@djc, am I using write_chunks and read_exact correctly? I'm seeing some odd behavior where the first read for message length happens, then I do a second read, and it appears that there is a bit of extra data at the front of the second read: This data is sent: But on that second read exact this is received: It appears that these first 6 bytes are being prepended to the stream: |
This is writing a This is reading exactly two bytes, leaving exactly 6 left over if the sender is 64-bit: You probably meant to convert to |
Thank you, @Ralith, I was not seeing that, that resolved my issue. There's an additional check needed there too. |
This is pretty much what we've done: I wonder if we should build an abstraction over these executors that others can use? I don't know exactly what that would look like other than a library with a bunch of traits in it. |
This is difficult (though not necessarily impossible) due to the diversity of requirements. For example, the interface you quoted above is not sufficient for Quinn, because we rely on obscure platform-specific I/O primitives that don't fit a general purpose Library (e.g. Quinn) specific traits would allow us to move forwards with runtime portability without getting bogged down in trying to find One True Abstraction, and a survey of such traits across the ecosystem would be a strong foundation for future work to establish a shared interop crate. |
Maybe there's some work to be shared on abstracting over async runtimes: launchbadge/sqlx#1669 (comment). |
Ok, I think this is ready. There are probably some loose ends to tie up in regards to the RFC, but I think they're minor. I'm assuming there are bugs here to work through. So we should assume this is experimental at this point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quickly skimmed this, seems okay.
This is an implementation of DNS over QUIC (DoQ) using the
quinn
library.This is a draft right now, I still need to add a test harness for the full end-to-end configuration, but the stream implementation is done and working.
closes: #670