-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
proper support for IPv6 link-local addresses #2659
Comments
Moving the discussion that's now spread across multiple PRs here. My current take on this issue (I might be missing something though) is that a node should never advertise /ip6zone addresses in the first place. The /ip6zone component should be removed from the multiaddress before advertising it. This is what my PR #2662 does. The reason for that is that the interface is a local information that's of no use to the peer. All that a peer needs to dial me is the IP address. @jclab-joseph To make progress here, we'd need a detailed description of 1. how your setup looks like, 2. how you configure your libp2p nodes, 3. what currently happens and 4. what you'd expect to happen instead. |
demo application: https://github.com/jclab-joseph/libp2p-link-local-demo PR #2662 applied:
Sorry, I've seen the code properly now, and I see what you meant. #2660 (comment) Because on the other peer that received the announcement, PR #2660 applied: My PR results are as above. It can listen and connect to the link-local address, but it does not announce. |
I think this is an orthogonal issue. We could maybe optimize things and not advertise the address, but there's very little savings in doing so. We have some logic to filter addresses on the receiver side, depending on where we received them from, and we have some smart dialing logic (i.e. logic to prioritize which addresses we dial first), so the cost for that are minimal as well.
Yes, exactly. Thanks for checking! Does that mean that #2662 resolves your problem? |
So, #2662 solves the announce issue. Note that, |
Can you explain? If we’re filtering out the addresses with an ip6zone, then the peer won’t have that address, right? Can you also share your setup? It looks like you’re using virtual network namespaces. What command do you use to initialize / configure them? I’d like to reproduce this on my machine. |
Fixed #2660. Rolled back basic_host.go modification, fixed filtering in swarm_dial. Here's how to create veth:
To create more than three nodes you need bridge:
|
Ok, so things seem to be more complicated. If I understand correctly, in order to dial a link-local address, you MUST know the interface. That means it's not possible to dial The interface (here Therefore, #2662 is part of the fix here, namely it makes sure that we never advertise the zone. We should merge that PR, independent of the outcome of the discussion here. The zeroconf PR is libp2p/zeroconf#35, and it doesn't look wrong to me, but as libp2p maintainers, we don't see take responsibility for maintaining the zeroconf library, even if changes look reasonable on first sight. New features will only be merged once they're upstreamed to grandcat/zeroconf. While I agree that in principle libp2p as a p2p networking library should correctly handle IPv6 link-local addresses, I'm not sure if this should be high on our roadmap given the benefit-complexity tradeoff, to be honest. This also applies to the review of PRs that add this feature. As far as I can tell, link-local addresses seem to be more of a fringe use case, as evident by this coming up only now. For people reading this in the future, please comment here if you think this assessment is incorrect. The complexity lies in:
Supporting this is pretty subtle, and I don't know how we'd test it end-to-end. Without end-to-end tests, it's very likely that this will either never properly work, or we'll unknowingly break support for it at some point in the future. |
Make available p2p in before ip configure.
The problems I found were:
/ip6zone/br0/ip6/fe80::7369:44d4:4573:9c7f/tcp/12345
When listen to an IP like this, ip6zone is included when advertising the address. This is just for own interface, so don't need to advertise it.the code below roughly works.
link-local address cannot start with /ip6/ because an interface must be bound for communication. But it fails with CanDial.
It may be a good idea to listen on link-local addresses but not advertise them.
You can discover and connect with mdns.
The text was updated successfully, but these errors were encountered: