Jump to content

IP type-of-service (ToS) support; flexible ul speed limits


shipwreck

Recommended Posts

First of all, let me thank the authors of this impressive piece of software for their efforts so far. This is truly a great client. For it to be perfect (at least for me), it just needs two features that are still missing, but should not be too hard to implement.

1) IP type-of-service (TOS) field for outbound data

So far, only the original BT Client and Azureus support changing the ToS field of IP-headers, marking (outbound) Bittorrent packets as bulk data and therefore making traffic shaping much easier. This is especially important in VoIP environments.

2) Different upload speed for downloading and seeding only

ABC has this feature, the upcoming Azureus 2.3.0.5 will have it, too. Especially for DSL users, it can be useful to automatically restrict global upload speed while downloading (configurable), so download speed isn't affected and responsiveness of the connection remains acceptable. Once the downloads are finished and the client ist seeding only, upload speed is automatically increased again (configurable also).

An alternative and more sophisticated approach to this is the Auto Speed plugin for Azureus, which automatically adjusts global upload speed limit based on network latency.

Link to comment
Share on other sites

  • Replies 73
  • Created
  • Last Reply

You're right, of course. Auto Speed is the better solution indeed, although I'm not sure if it is a good idea to have thousands of clients constantly pinging certain servers.

But for the time being, I'd be happy with the simple solution mentioned above. Since µTorrent has bandwidth scheduling already, it should be pretty simple to implement.

Or maybe implement both like Azureus 2.3.0.5 (+AutoSpeed plugin) has?

Link to comment
Share on other sites

1) IP type-of-service (TOS) field for outbound data

So far, only the original BT Client and Azureus support changing the ToS field of IP-headers, marking (outbound) Bittorrent packets as bulk data and therefore making traffic shaping much easier. This is especially important in VoIP environments.

...which was not supported under windows. I talked about this before, but here is the hard facts about why the Mainline and Azureus features are useless in Win32.

QoS tagging is handled by the operating system in Win2k, XP, 2003 server. Also, according to this KB article:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q248611

Please note that the ToS bits marking for TCP packets has never been available to Winsock even although the setsockopt call with the IP_TOS option on TCP sockets returns 0 (SUCCESS).

Meaning that there's no way to do this, and any other bittorrent client that says they set ToS bits is not currently either. However, there does exist a way to use the QoS API to have windows automatically set the DSCP bits (DSCP has replaced ToS). Of course, this only works if your link cap is accurate (the speed reported by your network interface is actually the symmetric speed of your internet connection). Almost all users would not be able to get a benefit.

If you want QoS, do it at the router.

Link to comment
Share on other sites

First of all, it does work. And I do QoS on the router, that's the whole point. But let me explain.

For it to work properly, you have to edit the (Win2k/XP) registry first. The DWORD...

Edited the wrong string:

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersDisableUserTOSSetting]

has to be set to '0'. Azureus 2.2.0.3+ does this automatically.

After a reboot, you can edit the ToS field of outbound bittorrent IP packets, 'marking' them als bulk traffic. Now, it is much easier (and more efficient) for the QoS-router which the (bittorrent-)client is connected to to identify outbound bittorrent traffic.

And it does work. I use Azureus in combination with the m0n0wall firewall software. m0n0wall supports ToS traffic shaping. I can identify and shape / prioritize bittorrent traffic with ease, give it a low priority, while VoIP traffic gets a higher priority, for example.

I have tested this thoroughly and I guarantee you that it works.

Link to comment
Share on other sites

Sorry neatofx, I made a mistake in that posting, this is the correct one:

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersDisableUserTOSSetting]

Or just copy / paste the following lines, save it as a .reg file and double click on it to change the registry setting:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters]
"DisableUserTOSSetting"=dword:00000000

chaosblade, you're right of course. But for ToS to work on Win2k / WinXP machines, it is necessary (more here).

Link to comment
Share on other sites

True, I agree.

But don't worry, you won't brake anything even if you don't use ToS. So for testing purposes, there not much risk involved.

To change it back to the original setting, use following .reg file:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters]
"DisableUserTOSSetting"=dword:00000001

Link to comment
Share on other sites

First of all, it does work. And I do QoS on the router, that's the whole point. But let me explain.

For it to work properly, you have to edit the (Win2k/XP) registry first. The DWORD...

has to be set to '0'. Azureus 2.2.0.3+ does this automatically.

Well what do you know about that? I had always believed that KB article that I posted, who knew there was another KB article which directly contradicted it!

I just checked both my systems (both XP Pro) with the latest Azureus on them and neither have this key. This would also explain why all my tests (Azureus packet captures, Mainline packet captures, and my own custom-written test app captures) backed up my theory. Is there a setting in Azureus that turns this on? I'm not seeing anything. Also, what does it set? ToS for maximum-throughput or does it do actual DSCP marking?

I actually try to prioritize torrent traffic at my router based solely on port ranges, so I'd like to see this working too.

Link to comment
Share on other sites

Well what do you know about that? I had always believed that KB article that I posted, who knew there was another KB article which directly contradicted it!

I just checked both my systems (both XP Pro) with the latest Azureus on them and neither have this key. This would also explain why all my tests (Azureus packet captures, Mainline packet captures, and my own custom-written test app captures) backed up my theory. Is there a setting in Azureus that turns this on? I'm not seeing anything. Also, what does it set? ToS for maximum-throughput or does it do actual DSCP marking?

I actually try to prioritize torrent traffic at my router based solely on port ranges, so I'd like to see this working too.

You have to enable it in Azureus also, of course. The setting is under "ToolsOptionsConnection" (scroll down). You have to check "Advanced Network Setting", then enter the code of your choice ('0x08' for 'throughput' (bulk traffic), for example; that's what I have) under "Outgoing packet type-of-service (TOS)". You can hover the mouse cursor over it for the complete list of ToS codes.

I made a screenshot to explain it better:

AzurToS.png

Once you have edited the registry key and changed your Azureus settings as explained above, outbound Bittorrent traffic should be marked with the ToS field of your choice. Please remember that your router has to support shaping / prioritisation based on the ToS of IP packets. Not all routers / firewalls do. But if your router does support it, shaping / QoS should be much more efficient than port range based rules.

Link to comment
Share on other sites

You have to enable it in Azureus also, of course. The setting is under "ToolsOptionsConnection" (scroll down). You have to check "Advanced Network Setting", then enter the code of your choice ('0x08' for 'throughput' (bulk traffic), for example; that's what I have) under "Outgoing packet type-of-service (TOS)". You can hover the mouse cursor over it for the complete list of ToS codes.

Ah I see. I thought it would just be on by default. I tried my test app last night after disabling the disableusertossetting and it sure does work. Seems like a reasonable enough request to implement this too, since it is the reg key and a

int tos = 8; setsockopt(hsocket, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(tos));

Link to comment
Share on other sites

Alright, I know that not that many people are going to actually use this feature, at least for now, but applications like VoIP are rapidly becoming more common, not just at companies. Identifying bittorrent traffic more efficiently could also make the life of admins easier, and increase the acceptance of the bittorrent technology in professional environments.

Knowing that implementing this feature won't be too hard, I'd say make us übernerds happy and go for it. Tomorrow, maybe not just nerds like us are going to appreciate it. Thanks.

Link to comment
Share on other sites

  • 1 month later...

I would also be very happy to see auto speed type functionality. It allows my bandwidth to be adjusted so that if I am not at home, and someone else hops on a computer on our network, my computer is not eating up all the bandwidth and making it hard for them to do whatever they are doing (eg. browsing websites or whatever).

If one of the qualms with this is hammering a particular site, like www.google.com, then make this configurable, and leave it blank so that the user is forced to specify what is pinged. This would allow for some variation. This is about the only thing I am currently missing from switching over from Azureus. And in my opinion, depending on your situation I suppose, can be very important.

Link to comment
Share on other sites

I guess its a good feature as it only has pros and no cons. But id also see if anyone actually needs that besides two or three very dedicated people ;)

Well, setting your BT-traffic do bulk can make up- and downloading go slower if your ISP actually uses ToS-shaping and there are bottlenecks in the network.

Link to comment
Share on other sites

@ksponge/#18

From what I understand, including auto-update and other downloads, the most recent version of µTorrent has had over 600,000 downloads, so that's a LOT of hammering. Granted, it would probably just get to the first router (probably the load balancer) and back, it might almost account for a DDoS attack in itself :X

Link to comment
Share on other sites

2) Different upload speed for downloading and seeding only

ABC has this feature, the upcoming Azureus 2.3.0.5 will have it, too. Especially for DSL users, it can be useful to automatically restrict global upload speed while downloading (configurable), so download speed isn't affected and responsiveness of the connection remains acceptable. Once the downloads are finished and the client ist seeding only, upload speed is automatically increased again (configurable also).

This is already there. :P

http://www.utorrent.com/faq.php#How_can_I_make_.C2.B5Torrent_use_a_different_upload_speed_when_seeding.3F

As for the ToS thing, it's still not that useful, since most QoS enabled routers allow priorities to be set to Ethernet ports. Since VoIP devices take up a physical port, you'd just specify your upload speed (or use auto I guess), set all other ports to low, and the VoIP ethernet port to high. Should work just fine, at least in theory. ;)

Link to comment
Share on other sites

  • 1 month later...

To put my two cents in here.. this is an extremely niche feature, but I would much appreciate its implementation. Between Azureus having a dominating DHT and supporting ToS, I am unable to move over to uTorrent. I can live with switching to the Mainline DHT because it is usable enough. But the ToS is a big sticking point for me. I have lots of other traffic that I would like to classify as more important than torrent traffic and given the arbitrary nature of torrent traffic and the fact that my "other" traffic is by definition undefined, ToS is an extremely simple way I am able to implement this rule.

Link to comment
Share on other sites

This is already there. :P

http://www.utorrent.com/faq.php#How_can_I_make_.C2.B5Torrent_use_a_different_upload_speed_when_seeding.3F

As for the ToS thing, it's still not that useful, since most QoS enabled routers allow priorities to be set to Ethernet ports. Since VoIP devices take up a physical port, you'd just specify your upload speed (or use auto I guess), set all other ports to low, and the VoIP ethernet port to high. Should work just fine, at least in theory. ;)

Thank you µTorrent developers for implementing my second request, greatly appreciated. This client is just great.

As far as ToS support goes, I'd still love to see this feature implemented. Firon, you're right of course, most QoS routers can prioritise certain ethernet ports, so this might be a (very simple) workaround for some. But the point is to identify bittorrent traffic easier. It's not just about giving VoIP traffic (or other low-latency traffic) a higher priority, it's about identifying bittorrent traffic and giving it a lower priority as well (lower than average, e.g. lower than HTTP requests etc.).

At least geekmug seems to understand me, now that's a relief. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...