Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some lazy questions ...

> Since IPv6 addresses are 128 bits long, but IPv4 addresses are only 32 bits, it's possible to embed IPv4 addresses in IPv6 addresses. snid embeds the client's IP address in the lower 32 bits of the source address which it uses to connect to the backend.

How does this work? snid just makes up an IP address? What socket API calls do you make to do this? Just pick an address and bind, and the kernel is fine with that? And it all gets routed back and forth correctly? Do you have to configure this 64:ff9b:1::/48 prefix on the loopback interface?

> Encrypted Client Hello doesn't actually encrypt the initial Client Hello message. It's still sent in the clear, but with a decoy SNI hostname. The actual Client Hello message, with the true SNI hostname, is encrypted and placed in an extension of the unencrypted Client Hello. To make Encrypted Client Hello work with snid, I just need to ensure that the decoy SNI hostname resolves to the IPv6 address of the backend server. snid will see this hostname and route the connection to the correct backend server, as usual.

How does the decoy SNI hostname get chosen? This sounds like there needs to be a different decoy hostname for each backend service. Does that come from DNS somehow? The client doesn't just make it up at random?



Great questions!

> How does this work? snid just makes up an IP address? What socket API calls do you make to do this? Just pick an address and bind, and the kernel is fine with that? And it all gets routed back and forth correctly? Do you have to configure this 64:ff9b:1::/48 prefix on the loopback interface?

First you have to set the IP_FREEBIND socket option, which allows binding to nonlocal/nonexistent IP address and then you call bind with whatever address you like. To ensure the packets get routed back properly, you need a local route for the 64:ff9b:1::/96 prefix, which can be added with:

ip route add local 64:ff9b:1::/96 dev lo

> How does the decoy SNI hostname get chosen? This sounds like there needs to be a different decoy hostname for each backend service. Does that come from DNS somehow? The client doesn't just make it up at random?

The decoy hostname is specified in the ECHConfig struct[1], which is conveyed to the client via DNS in the HTTPS record[2].

It does indeed mean that each backend needs its own decoy hostname (which resolves to the IPv6 address of the backend). This means that ECH does not hide which backend is being connected to, but if a particular backend handles multiple hostnames, it can hide which of those hostnames the client is connecting to.

[1] https://www.ietf.org/archive/id/draft-ietf-tls-esni-14.html#...

[2] https://www.ietf.org/archive/id/draft-ietf-dnsop-svcb-https-...


If you have at least a /96 to dedicate for snid, then couldn't you just use that public prefix instead of 64:ff9b to encapsulate ipv4 address, making the setup somewhat simpler? Also if you used public prefix then I imagine you could even run this setup over the internet, i.e. have snid run on some public server with dualstack and forward connections to ipv6-only app servers. I'm imagining the common situation where you have cgnat ipv4 + native ipv6 at home, you could host snid on public cloud instance to expose services running at home.


Yup, that would work. Nice idea!


Oops, draft-ietf-dnsop-svcb-https-08 has expired.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: