Skip to content
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

Anycast multi-region Caddy setup using QUIC's preferred address mechanism #6014

Open
marten-seemann opened this issue Jan 2, 2024 · 3 comments
Labels
deferred ⏰ We'll come back to this later feature ⚙️ New feature or request upstream ⬆️ Relates to some dependency of this project

Comments

@marten-seemann
Copy link
Contributor

The following setup should (in theory) be possible: Multiple Caddy instances authoritative for the same (set of) domain(s) running on geographically distributed servers reachable under the same anycast IP address. The browser connects to the ~closest server, completes the QUIC handshake, and then migrates to the unicast address (to guarantee stable routing over the lifetime of the connection) using QUIC's Server Preferred Address mechanism.

The blog post on quic.video (search for anycast) has a good description and some diagrams.

Protocol-wise, all the required elements are in place. Implementation-wise, this would need proper support for preferred address in quic-go, and I'm still trying to confirm if major browsers have actually implemented this feature.

I'm opening this issue to document the idea, and to see if there's interest in making it happen. I could see setups where this would be very interesting, but I don't know how peoples' deployments look like, so maybe this is just a crazy idea.

@francislavoie
Copy link
Member

francislavoie commented Jan 2, 2024

Would this be something users need to opt-in for, or would it just kinda work automatically? What would the config surface look like, etc?

@francislavoie francislavoie added deferred ⏰ We'll come back to this later feature ⚙️ New feature or request upstream ⬆️ Relates to some dependency of this project labels Jan 2, 2024
@marten-seemann
Copy link
Contributor Author

All that the QUIC layer needs to know is the unicast IP address(es). These would have to be passed into quic-go somehow (API still TBD). I'm not sure if Caddy already has access to that somewhere.

Other than that, you'd have to configure your server such that they're all reachable at the same Anycast IP address, of course. This requires a bit more work than just spinning a single machine, but you'd get a geographically distributed server setup in return (which is one of the selling points of CDN operators).

@mholt
Copy link
Member

mholt commented Mar 7, 2024

So this would make it almost effortless to stand up your own CDN? Just deploy replicas of your site to your Caddy instances around the world and configure them with the right IP addresses and boom?

That would be insanely cool if so.

Anyway, definitely open to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deferred ⏰ We'll come back to this later feature ⚙️ New feature or request upstream ⬆️ Relates to some dependency of this project
Projects
None yet
Development

No branches or pull requests

3 participants