![]() Registered Member ![]()
|
I've read about DSCP on wikipedia (http://en.wikipedia.org/wiki/DSCP and http://en.wikipedia.org/wiki/DiffServ), and from what I can read, it tries to specify what kind of traffic IP-packages are carrying, and if it's high or low bandwidth, or if it needs low latency, etc.
But what is the best/proper value for torrent traffic? I assume it should be high bandwidth/traffic, and high latency. |
![]() Moderator ![]()
|
|
![]() Registered Member ![]()
|
|
![]() Moderator ![]()
|
There isn't really a specific value for this, and your ISP and your router will probably ignore this field anyway.
However you can use it to setup local quality of service using the commandline tool tc. If your router allows this sort of advanced quality of service stuff, you can set it up there also. With tc you can setup a bunch of htb queues on a network interface and then you can use the DSCP values set in KT to get your bittorrent traffic in the right queue. In such a situation the actual value doesn't matter all that much, you just pick one and use that for all bittorrent traffic. You can find more information about tc and htb queues here : http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm |
![]() Registered Member ![]()
|
|
![]() Registered Member ![]()
|
Note that you can only use DHCP+iptables+tc for outgoing packets. Usage example is fairly simple if you familiar with iptables packet mangling. For example, if you set DHCP for torrent packets to 30:
This will mark all torrent packets except for connections maded by outside. To mark them too you must use marking by your torrent port (because all incoming connections will be maded to that port). If it is one of 6881-6889:
Note that we check only packets which are not marked already (PRIONONE). You can also set CONNMARK here and it will be copied to packet mark in rules above. After that all packets related to torrent should be marked by PRIOTORRENT (2). After that you will need to add some queuing disciplines. This is a bit more difficult to understand.
The result will be: torrent packets will take all available 2.5mbit connection untill any other packets will be scheduled to send. In that case - other packets will be send with 2.5mbit-256kbit rate and torrent packets - 256kbit. This is extremely useful if you try to use torrent in dedicated server, because torrent traffic does not slowdown ssh connections to shell. I had tested this scheme (although really I have 6 traffic classifications on my server - in above example there are only two) - it's working perfectly. CISCO station which can do that costs ~5000$ :). To control incoming traffic you must have router and setup there same queue disciplines for OUTGOING traffic to your machine(s). For controlling local traffic you can also try to use ingress policing, but I dont recommend that:
That will drop all packets which come faster than desired rate. And sender (hopefully) should slowdown. But in real world this work for several fast connections, but not for dozens with random speeds. That will drop a lot of packets (which anyway hurt your bandwidth) and speed will be less than possible max. Have fun! :). |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]