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

Wrong displaying for multiple connections from a same IP (but different ports) #11845

Open
G2159687 opened this issue Jan 9, 2020 · 12 comments
Open

Comments

@G2159687
Copy link

@G2159687 G2159687 commented Jan 9, 2020

Please provide the following information

qBittorrent version and Operating System

qBittorrent/4.1.9.1, Windows 7 64-bit Ultimate

If on linux, libtorrent-rasterbar and Qt version

What is the problem

When I have multiple connections from a same IP in a single download task, only one source will be displayed.

Screenshot: https://imgur.com/a/wzgeoFy

For example, there is only one 10.56.0.82 displayed in the peer list, but actually there are many connections from this IP for this download, same IP but different ports.

What is the expected behavior

All of the connections are displaying correctly

Screenshot: https://imgur.com/a/Inbv2P0

Steps to reproduce

  1. Allow multiple connections from a same IP in advanced settings first.
  2. Open more than two bittorrent clients on the same PC, let all of them download a same file.
  3. You will see connections are established and data is being transmitted, but only one "127.0.0.1" peer will be displayed.

Extra info(if any)

This is not for fun or testing at all. All of these 10.56.0.82 peers are incoming connection tokens from my VPN provider, in fact they are real peers, just without their real IP displayed.

@G2159687

This comment has been minimized.

Copy link
Author

@G2159687 G2159687 commented Jan 9, 2020

Update: A screenshot which represents the problem more clearly.

https://imgur.com/a/L9WjM82

Like this, total upload speed is 308 KiB/s, but total upload speed in peers list is only <60 KiB/s. Also the connected peers is 12, but only 3 are displayed. The other 9 peers all have IP of 10.56.0.82, and they are committing ~240KiB/s upload traffic.

@Seeker2

This comment has been minimized.

Copy link

@Seeker2 Seeker2 commented Jan 9, 2020

Any peers or seeds found in "standard" LAN ip ranges can ignore the normal speed limits.
10.x.x.x is one such LAN ip range.
Limit LAN speeds as well in qBitTorrent and retest.

@G2159687

This comment has been minimized.

Copy link
Author

@G2159687 G2159687 commented Jan 9, 2020

Any peers or seeds found in "standard" LAN ip ranges can ignore the normal speed limits.
10.x.x.x is one such LAN ip range.
Limit LAN speeds as well in qBitTorrent and retest.

Unfortunately your answer does NOT match my problem at all. I'm not talking about limiting their speeds, but displaying them correctly.

@G2159687 G2159687 changed the title Wrong displaying for multiple connections from a same IP Wrong displaying for multiple connections from a same IP (but different ports) Jan 9, 2020
@Seeker2

This comment has been minimized.

Copy link

@Seeker2 Seeker2 commented Jan 9, 2020

It's obviously broken.
But has it ever worked correctly before?
Or does other BitTorrent clients do the same thing?
The bit about tokens needs a better explanation.

@G2159687

This comment has been minimized.

Copy link
Author

@G2159687 G2159687 commented Jan 9, 2020

@Seeker2 It never worked correctly before, but BiglyBT (modded from Vuze) is handling it well, as the screenshot in "expected behavior" shows. I also tried Tixati, and it doesn't support multi conns from one IP at all, so I'm not talking about that. qB CAN handle these connections, but just not displaying correctly.

About these 10.56.0.82 tokens, I can't say pretty much about that. Hardcoded into the VPN servers, any incoming connections will have this IP instead of their real ones. Perhaps this is a good approach for shared VPN servers (but also paid) to protect users' or other peers' privacy, but it sucks with this.

PS: BiglyBT is good with handling the connections, but I'm not using it as it is banned by PTs, and its performance is worse as it is written by Java.

@G2159687

This comment has been minimized.

Copy link
Author

@G2159687 G2159687 commented Jan 9, 2020

Ooooh, forgot the most important one, uTorrent/2.2.1 can handle that well too, but I'm not using that as its feature is so limited, and newer version just sucks.

@thalieht

This comment has been minimized.

Copy link
Contributor

@thalieht thalieht commented Jan 9, 2020

If this is the place that decides if a peer will be added to the list then it indeed checks if only the ip is unique:

auto itemIter = m_peerItems.find(ip);
isNewPeer = (itemIter == m_peerItems.end());
if (isNewPeer) {

@G2159687

This comment has been minimized.

Copy link
Author

@G2159687 G2159687 commented Jan 9, 2020

If this is the place that decides if a peer will be added to the list then it indeed checks if only the ip is unique:

auto itemIter = m_peerItems.find(ip);
isNewPeer = (itemIter == m_peerItems.end());
if (isNewPeer) {

Yep I guess it should check IP+Port instead of checking IP only, thanks for clarifying this. Maybe adding another "OR" judgement for "isNewPeer" is enough? Just guessing XD.

Anyway hope the thing will be fixed, but I'm not in a hurry as this is just a displaying issue, and I might won't update as soon as it is fixed, because I can only update after most of PTs' approval for the newer versions :)

@Seeker2

This comment has been minimized.

Copy link

@Seeker2 Seeker2 commented Jan 12, 2020

The other issue is these peers are from a VPN that may be acting as a proxy server -- at least for incoming connections into qBitTorrent.

Normally, qBitTorrent silently drops duplicate connections (ones on same ip) ...not invisibly connect them. I know because I ran into that problem (dropping same ips) when doing local loopback 127.0.0.1 tests using qBitTorrent. I ended up giving each BitTorrent client a different ip -- like 127.0.0.2 , 127.0.0.3 , etc.

@G2159687

This comment has been minimized.

Copy link
Author

@G2159687 G2159687 commented Jan 16, 2020

Normally, qBitTorrent silently drops duplicate connections (ones on same ip) ...not invisibly connect them. I know because I ran into that problem (dropping same ips) when doing local loopback 127.0.0.1 tests using qBitTorrent. I ended up giving each BitTorrent client a different ip -- like 127.0.0.2 , 127.0.0.3 , etc.

I highly recommend you to view all of available settings before saying here. Isn't there an 'Allow multi connections from same IP' in advanced settings section? Also I've shown the situation very clearly by posting the screenshots. Can you explain why the number in 'peers' column is more than entries shown in client view? The client is not dropping peers at all if you turn on that option. Do NOT assume I'm doing anything wrong about this, the contributor has already located the problem above so it IS on qBittorrent's side. Two obviously WRONG answers in a row means that you are not understanding the situation at all, and I don't think you are doing anything useful towards this. Please do not continue trying to search for anything I'm doing wrong. Thank you.

@Seeker2

This comment has been minimized.

Copy link

@Seeker2 Seeker2 commented Jan 18, 2020

My apology over that it looked like I was even implying you're doing something wrong.
The hard part of troubleshooting is figuring out what's going on the background if the interface is lying to you.

My first "answer" was unrelated and totally incorrect and off-topic, but the second one was from my own experience concerning duplicate ips -- and how it's expected to operate if "allow multiple connections from the same IP address" is set to false.

Of course I don't understand the situation!
Your networking and/or VPN is both awesome and crazy.
Awesome because qBitTorrent seems to get incoming connections...crazy because of how it's doing it.
Your ISP, whose name and location can remain unmentioned, may also be using carrier grade NAT to confound things further.

I will do a setup of multiple BitTorrent clients on my own computer or on multiple computers to retest duplicate ips.
This may take me a few days, and yes I'll be retesting both with/without "allow multiple connections from the same IP address" checked...and with TCP and/or uTP connections.
I might even be able to test using IPv6, but doesn't look like an issue in your case.

@G2159687

This comment has been minimized.

Copy link
Author

@G2159687 G2159687 commented Jan 19, 2020

I'm quite impressed by your enthusiasm towards this issue, and sorry for my impatience. If you want to make the issue reappear on your side, I recommend you to get 2 x uTorrent + 1 x qBittorrent. Enable multiple connections feature on all 3 clients, then let them download a same torrent together. Manually add peers, then you should see uTorrent clients are displaying 2 local peers but qBittorrent only one. But the number in 'peers' column should be one more than entries displayed. I'd recommend Process Hacker for connections analysis, as it can display details of connections, especially TCP ones. I also recommend forcing TCP connections on all clients for easier connection analysis.

As for my VPN, I'd say it's great, only except this problem. Cheap price, high speed and stability, even in complicated network here it is having great performance, besides it's not likely get banned as there are not many users in my district. So it's unlikely that I change my VPN provider soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.