Quality of Service

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 07:30, 4 April 2007 (edit)
Y23 (Talk | contribs)
(DD-WRT v23 SP2 (09/13/06) special -- UNEXPLAINED -- Default Bandwith Level 5000)
← Previous diff
Revision as of 17:14, 22 June 2007 (edit) (undo)
Stew2 (Talk | contribs)
m (just a minor update, added HTB/HFSC, increased the importance of shaping by port range for evolving P2P apps.)
Next diff →
Line 13: Line 13:
* Tick "Enabled" and save the settings * Tick "Enabled" and save the settings
* Set "Port" to WAN * Set "Port" to WAN
 +* Use the HTB Packet Scheduler (as of this writing HFSC seems to introduce lag and not work very well)
* Enter 85 percent of your up and down bandwidth in the boxes (eg: if you have a 1.5 Mbit (1536 kbps) cable modem with 256 kbps upload, enter 218 for uplink and 1306 for downlink. Beware not to mistakenly swap your up- and downspeeds, a common error that will greatly slow down your WAN connection!) You can have a free speed test done on your internet connection at [http://www.dslreports.com/stest DSL Reports]. * Enter 85 percent of your up and down bandwidth in the boxes (eg: if you have a 1.5 Mbit (1536 kbps) cable modem with 256 kbps upload, enter 218 for uplink and 1306 for downlink. Beware not to mistakenly swap your up- and downspeeds, a common error that will greatly slow down your WAN connection!) You can have a free speed test done on your internet connection at [http://www.dslreports.com/stest DSL Reports].
-These steps will enable Quality of Service (QoS) and cap your maximum connection speed to 85 percent of what your cable/DSL service is capable of providing. This decrease in speed is required to maintain a low latency. ISP tends to use large buffers that add lots of latency if you fill them up.+These steps will enable Quality of Service (QoS) and cap your maximum connection speed to 85 percent of what your cable/DSL service is capable of providing. '''This decrease in speed is required to maintain a low latency.''' ISP tends to use large buffers that add lots of latency if you fill them up. Traffic Shaping causes some 'lost' bandwidth, by moving traffic shaping to your router, instead of the ISP.
Line 43: Line 44:
-==Prioritizing by Application (Skype, Http, P2P)==+==Prioritizing by Application (Skype, Http) or Port Range (P2P) ==
-* Choose an available Service from the list. Look up Service definitions [http://protocolinfo.org/wiki/List_of_protocols here]. Then click Add.+* Choose an available Service or Port Range from the list, or create one.
-* Prioritize the Service to Express or Premium, or deprioitize to Bulk. Click Save. "Bulk" gives no guaranteed bandwidth, "Standard" ensures 10%, "Express" 15%, "Premium" 75% and "Exempt" 100% (values according to [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=3634 this post]).+* For P2P Applications, due to evolving protocols, encryption and obfuscation, it can be much better to define a Port Range [such as TCP/UDP, 60000-61000]. Set your P2P applications to operate within this range. This can significantly reduce the load on the router, avoid mis-identifying packets, and more efficiently shape your network traffic.
 +* For Service definitions [http://protocolinfo.org/wiki/List_of_protocols see here].
 +* Add all your selected Services and Port Ranges then:
 +* Prioritize to Express or Premium, or de-prioritize to Bulk. "Bulk" gives no guaranteed bandwidth, "Standard" ensures 10%, "Express" 15%, "Premium" 75% and "Exempt" 100% (values according to [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=3634 this post]).
* Services not configured are always Standard priority. * Services not configured are always Standard priority.
-* Choosing a L7 Protocol works better than choosing a port range; though the router works harder.+* Choosing a Service (L7 Protocol) can work better than choosing a port range; though the router works harder.
* Tip: If you have trouble modifying the drop-down list, suggest using [http://www.opera.com/download Opera 9.x] and the BrainSlayer router GUI style (worked for me, firefox and IE don't) * Tip: If you have trouble modifying the drop-down list, suggest using [http://www.opera.com/download Opera 9.x] and the BrainSlayer router GUI style (worked for me, firefox and IE don't)
-* Tip: Some protocols [http://protocolinfo.org/wiki/Bittorrent may not shape well] due to updates or obfuscation, or are mistaken for other traffic (too broad). Suggest changing the protocol to TCP/UDP, and enter the specific port(s) being used. 

Revision as of 17:14, 22 June 2007

Quality of Service (QoS) is a method to guarantee a bandwidth relationship between individual applications or protocols. This is very handy when you max out your connection so that you can allow for each application to have some bandwidth and so that no single application can take down the internet connection. This allows, for example, a full speed download via FTP without causing jittering on a VOIP chat. The FTP will slow down slightly as bandwidth is needed for the VOIP, provided VOIP was given greater priority.

If you would like to set hard coded bandwidth limits (throttling), this can be done using the tc command

NOTE: Ethernet Port Priority only works on older, ADM based, chipsets. That is, the Linksys WRT54G v1.0, 1.1, 2.0 and the WRT54GS v1.0.


Contents

Initial Setup

  • Log into the Web Interface
  • Click on the Applications and Gaming Category
  • Click on the QoS sub category
  • Tick "Enabled" and save the settings
  • Set "Port" to WAN
  • Use the HTB Packet Scheduler (as of this writing HFSC seems to introduce lag and not work very well)
  • Enter 85 percent of your up and down bandwidth in the boxes (eg: if you have a 1.5 Mbit (1536 kbps) cable modem with 256 kbps upload, enter 218 for uplink and 1306 for downlink. Beware not to mistakenly swap your up- and downspeeds, a common error that will greatly slow down your WAN connection!) You can have a free speed test done on your internet connection at DSL Reports.

These steps will enable Quality of Service (QoS) and cap your maximum connection speed to 85 percent of what your cable/DSL service is capable of providing. This decrease in speed is required to maintain a low latency. ISP tends to use large buffers that add lots of latency if you fill them up. Traffic Shaping causes some 'lost' bandwidth, by moving traffic shaping to your router, instead of the ISP.


Optimize for Gaming

The Optimize for Gaming option found under the QoS administration page enables QoS on some tcp/udp ports found in some games.

Here is the complete list from the source code:

  • DirectX 8 and above (Age of Empires I and many others): 6073/tcp&udp, 2302-2400/tcp&udp
  • Counter Strike: 1200/udp, 27000-27015/udp, 27030-27039/tcp
  • Diablo I & II: 4000/tcp, 6112-6119/tcp&udp
  • Everquest: 7000/tcp, 1024-6000/udp
  • Half Life & Half Life 2: 6003/tcp, 7002/tcp, 27005/udp, 27010/udp, 27011/udp, 27015/udp
  • Quake2: 27910/tcp&udp
  • Quake3/RTCW: 27660/tcp&udp, 27950/udp, 27960/udp, 27965/udp, 27952/udp
  • Return to Castle Wolfenstein: 27950/udp, 27960/udp, 27965/udp, 27952/udp
  • Unreal Tournament (NOT 2004): 8080/tcp&udp, 27900/tcp&udp, 7777-7783/tcp&udp

If you do not play any of the above game, you should keep this option disabled.


Notes:

  • DirectX 7 and previous are not supported (require 2300-2400).


Prioritizing by Application (Skype, Http) or Port Range (P2P)

  • Choose an available Service or Port Range from the list, or create one.
  • For P2P Applications, due to evolving protocols, encryption and obfuscation, it can be much better to define a Port Range [such as TCP/UDP, 60000-61000]. Set your P2P applications to operate within this range. This can significantly reduce the load on the router, avoid mis-identifying packets, and more efficiently shape your network traffic.
  • For Service definitions see here.
  • Add all your selected Services and Port Ranges then:
  • Prioritize to Express or Premium, or de-prioritize to Bulk. "Bulk" gives no guaranteed bandwidth, "Standard" ensures 10%, "Express" 15%, "Premium" 75% and "Exempt" 100% (values according to this post).
  • Services not configured are always Standard priority.
  • Choosing a Service (L7 Protocol) can work better than choosing a port range; though the router works harder.
  • Tip: If you have trouble modifying the drop-down list, suggest using Opera 9.x and the BrainSlayer router GUI style (worked for me, firefox and IE don't)


Prioritizing by IP Address

-If there is a specific ip address, enter xxx.xxx.xxx.xxx / 32
-If there is a range, enter it using netmask notation. The Netmask Calculator might be useful

For V23, enter the IP address and then press "Add" button.


Prioritizing by MAC Address

In the case you want to prioritize traffic from a particular device without ensuring it gains a static IP address on your LAN, you can prioritize by MAC Address.

  • Under 'MAC Priority', enter the MAC Address of the device
  • Click 'add'
  • click 'Save changes'

Default Bandwith Level

Bandwith in Kbits is set to 5000 on DD-WRT v23 SP2 (09/13/06) special (mispelled Default Bandwidth Level and Bandwidth on Kbits). This entry is as yet unexplained and even googleing it does not enlighten.

Priorities explained

Bandwidth classification based on the four categories will be enabled first on the hardware ports, then on MAC addresses, then netmasks and finally services. For example, if you enable classification based on a MAC address, this will override netmask and service classifications. However, the LAN port based classification will work together with MAC, netmask and service classifications, and will not override them.

  • Exempt - This class tries to keep the bandwith and packet flow untouched.
  • Premium - The top bandwidth class. By default handshaking and icmp packets fall into this class. This class should be used sparingly. Occasionally VoIP service may be placed in this class so that voice receives top priority.
  • Express - The Express class is for interactive applications that require bandwidth above standard services so that interactive apps run smoothly.
  • Standard - All services that are not specifically classed will fall under the standard class.
  • Bulk - The bulk class is only allocated bandwidth when the remaining classes are idle. Use this class for P2P services and downloading services like FTP.


External Links