id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 79,Bind outgoing connections to local port,peterdk,andar,"I am using QoS at home to manage my bittorrent traffic. Unfortunately not all trafic is caught with the L7 and IPP2P filters. Though it is possible to set incoming ports, it is not possible yet to define the outgoing port(s). QoS filtering is therefore not really possible, only if one would totally define all traffic except www traffic as ""low"" class. A solution to this problem is to bind all the outgoing Deluge connections to a specified local port instead of just letting the OS randomly assigning a unique port for every single one. Azureus has implemented this and this allows for a easy QoS rule that filters all traffic coming from the defined port. It is a ideal solution for home QoS filtering without having any effect on the QoS of ISP's, so possible encryption doesn't need to be turned off. Someone from the Azureus channel explained how it could be done: {{{ [17:55] so I'd like to know how it's possible to initiate multiple connections from the same port :) [17:58] tools -> options -> connections -> advanced network settings -> bind to port [17:58] I know, but how is it technically done, bind() fails if the port is already taken (EADDRINUSE [17:59] use SO_REUSEADDR [18:01] This socket option tells the kernel that even if this port is busy (in the TIME_WAIT state), go ahead and reuse it anyway. If it is busy, but with another state, you will still get an address already in use [18:02] error. [18:02] that only applies to the same socket pair [18:03] if it's a different socket pair then it does what you want [18:03] ok, thanks }}} Since I am planning to move from Azureus to a more native Linux app, I would like to request that the option of forced binding to a local port be added to Deluge. I also submitted this feature request to Transmission and I hope this will help making Deluge too a better client. Something from the Azureus wiki that maybe is good to know if this feature is added/developed: * Bind to local Port This sets outgoing connections to a fixed source port. This can be used with full cone NAT routers to reduce the number of NAT table entries and thus prevent crashes on some router models. When the outgoing port is bound to the same as the incoming port that might even solve NAT problems on full cone NAT routers. Note: Binding to the same port as the incoming port works under Windows 2k and greater only. Unix users should use a different port. It's not working at all under Mac OS X. ",feature-request,closed,minor,,Core,1.1.0_dev,Fixed,bind to local port tcp SO_REUSEADDR,deluge@…