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

Autonat doesn't support multiple addresses well #4873

Open
Tracked by #4524
nazar-pc opened this issue Nov 16, 2023 · 3 comments
Open
Tracked by #4524

Autonat doesn't support multiple addresses well #4873

nazar-pc opened this issue Nov 16, 2023 · 3 comments

Comments

@nazar-pc
Copy link
Contributor

Right now autonat sends concatenation of other_addresses and listen_addresses, which are always processed in the same order by receiving side:

let addresses = self
.other_candidates
.iter()
.chain(self.listen_addresses.iter())
.cloned()
.collect();
let probe_id = self.probe_id.next();
let event = match self.do_probe(probe_id, addresses) {
Ok(peer) => OutboundProbeEvent::Request { probe_id, peer },
Err(error) => {
self.handle_reported_status(NatStatus::Unknown);
OutboundProbeEvent::Error {
probe_id,
peer: None,
error,
}
}
};

If my understanding of the code is correct, only the first successfully dialed address will be returned.

This is problematic in case of multiple addresses though:

  • out of multiple public addresses only the first one will be confirmed
  • mix of public and private addresses doesn't seem to play very nicely with this either

I think the solution here is that either sender of the probe or receiver should shuffle addresses such that we check different addresses.

I'm not very familiar with autonat right now to understand if it is architecturally supposed to support this use case at all since confirmations will be done for different addresses in different calls.

@mxinden
Copy link
Member

mxinden commented Nov 16, 2023

AutoNATv2 will allow us to probe addresses individually.

Instead of optimizing AutoNATv1, I suggest we tackle this as part of #4524.

@guillaumemichel
Copy link
Contributor

@umgefahren is this issue addressed by AutoNAT v2?

@umgefahren
Copy link
Contributor

At this moment this is not addressed. We don't shuffle the addresses as it stands. We considered shipping this in the future though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants