arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation

Home Page:http://libtorrent.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TOS isn't being applied

tiagogaspar8 opened this issue · comments

libtorrent version (or branch): 2.0.5 (in qbittorrent)

platform/architecture: Windows 11

compiler and compiler version: N/A

please describe what symptoms you see, what you would expect to see instead and
how to reproduce it.

The TOS doesn't seem to be applying correctly, it is configured to 4 by default but in wireshark the DSCP isn't changed and stays at CS0 (0).
I'd also like to suggest the change from the name TOS to DSCP since TOS is deprecated.

Thanks!

did you look at all traffic or just some connections?
I believe DSCP is only meant to apply to peer connections, not DHT or tracker connections for instance.

are you looking at both TCP and UDP peer connections? The DSCP is set via slightly different code paths for those.

do you see the SET_TOS messages in the log?

Hi,

My setup only has μtp enabled, and that doesn't have any dscp, I can't say about TCP, but I believe I can try if you'd like!

@arvidn This rename has broken compatibility and generating errors in Deluge with latest lt 1.2 code, was this applied to the wrong branch (for 2.0 not 1.2) and missing setting deprecated in settings_pack.cpp?

self.session.apply_settings(settings)
builtins.KeyError: 'unknown name in settings_pack: peer_tos'

good point. I need to fix the binding to support the old name as well.

Hi @arvidn , I'd just like to let you know that TCP also suffers from the same issue, dscp isn't marked

is it possible the process need a special privilege to set it?
Do you have any error messages in the log for setting DSCP?

I have tried to run it as an admin but it didn't help

@tiagogaspar8 can you get the log? Do you see entries saying SET_TOS or SET_DSCP? If so, they will contain error codes.

I'm using qbittorrent and I have no idea how to enable extra debug logging 😞
Do you have any idea?

commented

In the implementation of libtorrent, dscp/tos is always set after the application handshake instead of the TCP handshake. This behavior breaks possibility of traffic split via tos by proxy, because the traffic split in proxy application always happens at the moment TCP syn=1.

We have to solve the problem with some inelegant methods, see daeuniverse/dae#295.

The tos setting is wonderful, but the current timing of the option setting is preventing it from being used, hope you can fix it, thanks!