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

Connection count on Transports page do not match established connections count #1793

Closed
Vort opened this issue Oct 12, 2022 · 7 comments
Closed

Comments

@Vort
Copy link
Contributor

Vort commented Oct 12, 2022

When I compare amount of address:port pairs on http://127.0.0.1:7070/?page=transports page with amount of established connections as reported by OS, I see that Transports page misses some of connections.
Especially noticeable difference happens with Yggdrasil addresses (NTCP2v6), but NTCP2 have significant difference too.
I'm not sure if it's a bug, but it worth investigation in my opinion.
i2pd_connections

@r4sas
Copy link
Member

r4sas commented Oct 12, 2022

Duplicate of #1551

@r4sas r4sas closed this as completed Oct 12, 2022
@r4sas r4sas marked this as a duplicate of #1551 Oct 12, 2022
@Vort
Copy link
Contributor Author

Vort commented Oct 13, 2022

Duplicate of #1551

No. Issue #1551 is about duplicate outgoing connections to the same nodes.
In this case, each IP:port pair is unique.

@r4sas
Copy link
Member

r4sas commented Oct 13, 2022

if (it.second && it.second->IsEstablished () && endpoint.address ().is_v4 ())

@r4sas r4sas reopened this Oct 13, 2022
@Vort
Copy link
Contributor Author

Vort commented Oct 14, 2022

I was not able to guess why you cited that line.
But I have to note one property of this problem:
Right after i2pd is launched, this problem is not reproducing.
It starts to show up after some time.
And looks like the longer uptime is, the more prominent problem is:
Amount of "lost" connections from my first post:
100*(1-385/413) = 7%
100*(1-9/16) = 44%
Same measurements now:
100*(1-316/375) = 16%
100*(1-7/16) = 56%

@simonvetter
Copy link
Contributor

simonvetter commented Oct 27, 2022

I've never noticed before but I'm seeing this as well : the Transports page consistently reports a lower number than actual TCP sockets in ESTABLISHED state, even if you force-refresh the page.
I see 143 NTCPv2 connections listed on the web interface vs 170 ESTABLISHED TCP sockets as we speak, on a router-only node (no socks/BOB/HTTP or otherwise client connections).

What I've found:

  • waiting 1-2 minutes will make some of those established TCP sockets show up on the web interface. Could it be that those are indeed established TCP sockets, but aren't yet established/active from an NTCPv2 perspective ?
  • if a node has both an active UDP (SSU, but maybe SSU2 as well, idk) association as well as an active TCP association, the NTCPv2 association isn't displayed (by active, I mean tcpdump does show traffic going both ways).
    If, later on, the SSU association is closed (disappears from the web interface, no UDP traffic anymore) but the TCP association stays active, the SSU association disappears from the web interface (as expected) and the NCTPv2 one stays hidden.

note: this node is ipv6-only, so no NAT trickery involved.

@Vort
Copy link
Contributor Author

Vort commented Oct 27, 2022

1-2 minutes

I doubt that i2p is that slow.

if a node has both an active UDP (SSU, but maybe SSU2 as well, idk) association as well as an active TCP association, the NTCPv2 association isn't displayed

I started i2pd without ssu and ssu2.
If nothing interrupts this test, I will post results later.

upd. Difference appeared earlier than I expected:
397 / 420 and 7 / 7
I'm reverting my config back to SSU2.

@Vort
Copy link
Contributor Author

Vort commented Dec 28, 2022

Fixed in 126dc0e.

@Vort Vort closed this as completed Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants