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

fix(iroh-net): improve hole punching when relying on call-me-maybe #1983

Merged
merged 10 commits into from
Feb 1, 2024

Conversation

dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented Jan 29, 2024

  • only consider active endpoints for call-me-maybe checks
  • insert call me maybe addrs into the peer map

@Arqu
Copy link
Collaborator

Arqu commented Jan 30, 2024

/netsim branch arqu/direct_derp

Copy link

debug-connections.c44ce4323b88cbb88e54e055b0662cea86d42bf4
Perf report:

test case throughput_gbps throughput_transfer
iroh_latency_20ms 1_to_1 1.00 2.39
iroh_latency_20ms 1_to_3 3.09 6.60
iroh_latency_20ms 1_to_5 4.21 6.52
iroh_latency_20ms 1_to_10 5.26 6.40
iroh_latency_20ms 2_to_2 1.83 3.77
iroh_latency_20ms 2_to_4 4.19 8.62
iroh_latency_20ms 2_to_6 5.70 9.70
iroh_latency_20ms 2_to_10 7.88 11.70
iroh 1_to_1 1.17 2.88
iroh 1_to_3 3.04 6.59
iroh 1_to_5 4.43 7.23
iroh 1_to_10 5.18 6.26
iroh 2_to_2 1.89 3.99
iroh 2_to_4 3.99 7.86
iroh 2_to_6 5.47 8.99
iroh 2_to_10 7.02 10.26
iroh_latency_200ms 1_to_1 1.03 2.50
iroh_latency_200ms 1_to_3 3.05 6.30
iroh_latency_200ms 1_to_5 4.36 7.30
iroh_latency_200ms 1_to_10 5.70 7.31
iroh_latency_200ms 2_to_2 2.12 5.13
iroh_latency_200ms 2_to_4 3.98 8.04
iroh_latency_200ms 2_to_6 5.46 9.14
iroh_latency_200ms 2_to_10 7.57 10.91

@@ -673,7 +672,8 @@ mod tests {
let mut buf = [0u8, 5];
stream.read_exact(&mut buf).await.unwrap();
info!("Accepted 1 stream, received {buf:?}. Closing now.");
ep.close(7u8.into(), b"bye").await.unwrap();
// close the stream
conn.close(7u8.into(), b"bye");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by not awaiting this you're never closing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no way to actually wait for a connection close asfaik

@@ -438,7 +438,7 @@ impl Endpoint {
})
.collect();
let ping_needed = !pings.is_empty();
let have_endpoints = !self.direct_addr_state.is_empty();
let have_alive_endpoints = self.direct_addr_state.values().any(|e| e.is_alive());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm currently convinced this condition is pointless, the ping_needed condition is all that is needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

@dignifiedquire dignifiedquire marked this pull request as ready for review January 31, 2024 16:49
@dignifiedquire dignifiedquire changed the title [WIP] debug connection issues debug connection issues Jan 31, 2024
@dignifiedquire dignifiedquire changed the title debug connection issues fix(iroh-net): improve connectivity Jan 31, 2024
@dignifiedquire dignifiedquire added this pull request to the merge queue Feb 1, 2024
@dignifiedquire dignifiedquire changed the title fix(iroh-net): improve connectivity fix(iroh-net): improve hole punching when relying on call-me-maybe Feb 1, 2024
Merged via the queue into main with commit 4b58de5 Feb 1, 2024
18 checks passed
@ramfox ramfox added this to the v0.13.0 milestone Feb 6, 2024
fubuloubu pushed a commit to ApeWorX/iroh that referenced this pull request Feb 21, 2024
- only consider active endpoints for call-me-maybe checks
- insert call me maybe addrs into the peer map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants