How does uTorrent choose between TCP and uTP?

Riccardo Ficarra Fiky picture Riccardo Ficarra Fiky · Jun 8, 2017 · Viewed 8.4k times · Source

I'm trying to analyse how uTorrent works using Wireshark to capture sent packets. There are three hosts in the same local network, one of them creates the torrent and starts seeding, while the other two download the torrent. From the trace it looks like uTorrent uses both TCP and uTP, sometimes switching between protocols in the middle of the download. How does uTorrent choose? I've checked on the bittorrent documentation and found nothing. Is there a way to force uTorrent to use only one of the two?

Answer

Encombe picture Encombe · Jun 8, 2017

Of what I have observed, uTorrent seems to prefer uTP over TCP, which is generally a good choice.

In Preferences > BitTorrent: Enable bandwidth management [uTP] can be used to turn uTP on/off.

More precise control can be done in Preferences > Advanced: bt.transp_disposition
Default value: 31

From µTorrent User Manual: (Press F1)

bt.transp_disposition: This option controls µTorrent's level of bias towards using TCP or uTP for transporting data (assuming the peer at the other end of the connection supports both transport protocols). The following is a list of the accepted values:

  • 1 allows µTorrent to attempt outgoing TCP connections
  • 2 allows µTorrent to attempt outgoing uTP connections
  • 4 allows µTorrent to accept incoming TCP connections
  • 8 allows µTorrent to accept incoming uTP connections
  • 16 tells µTorrent to use the new uTP header. This is an improved communication header, but is not backwards compatible with clients that do not understand it.

This option is interpreted as a bitfield, so values can be added together to obtain a combination of behaviors. Setting this value to 255 guarantees that all behaviors are enabled.