DD-WRT Tutorial 4: Defining Priorities with QoS - Page 2
December 15, 2006
Setting up QoS, continued:
Step 3. To add a network application to the QoS rules, first click on the drop down list beside the Add button. Scroll through to see if your application is already listed. DD-WRT includes so-called L7 filters for a long list of applications. An L7 filter is used to determine what application is sending traffic, not by static means like port usage, but by analyzing the packets and matching a known fingerprint. L7 filters are the most reliable way to assign QoS, because they can identify a data stream more accurately than port usage.
For each relevant network application you find in the menu, click the Add button and let the page refresh. In this example we first added bittorrent from the list followed by skypetoskype.
For each network application you can assign a priority class. Select the priority you want for each service and then be sure to click the Save Settings button at the bottom of the page.
In the example above, weve assign P2P Bittorrent traffic to the lowest priority, bulk, and real-time VoIP Skype traffic to the highest priority, premium.
Step 4. Suppose you want to assign QoS for an application that isnt listed click the Add/Edit Service button to launch a pop-up window where you can define custom services.
We want to add a new definition for Radmin, a remote desktop application. Due to a bizarre quirk in DD-WRT V23 SP1, some users find that when they try to define a new service, it cant later be added to the QoS rules. A workaround seems to be creating the new service two times, each with a different name. So, we create the radmin service twice, with the names radmin1 and radmin2.
Because there is no L7 filter for Radmin, we define this application the old-fashioned way. Above weve told DD-WRT to identify Radmin traffic as any TCP packets on port 4899.
Click the Add button to add the new service to the list, and then be sure to click Apply for the new list to actually be saved. The pop-up window now closes.
Returning to the services settings, we now see the newly created radmin1 (and radmin2) in the drop down list. Chose radmin1 and clicked the Add button, and then assign Express priority to this application.
Step 5. You can also define priorities based on originating IP address rather than network protocol.
To simply add a single IP address, type it into the fields and click Add. Here we added a single IP address, 192.168.0.10, and then assigned it Exempt priority. Because it is defined as exempt, traffic from this machine will not be subject to any of the QoS rules regardless of which application is creating the traffic.
To add a block of IP addresses, calculate the NetMask by visiting an online IP address calculator. For example, if we enter the range 192.168.0.1-192.168.0.15 into this calculator, the resulting NetMask in NetAddr notation is 192.168.0.0/28. Enter this value into the IP/Mask fields and click Add. You can then assign a priority level for all traffic originating from any machines within the 192.168.0.1-22.214.171.124 block.
Step 6. Similarly, you can also assign QoS to an individual machine identified by its MAC, rather than IP, address. This makes sense when, for instance, the machine in question might be assigned a dynamic IP. (Technically, a MAC address identifies a network adapter rather than a machine. A single machine could have multiple network adapters, and you can assign a given QoS priority to one adapter but not the other.)
Enter the six hex segments of your machine/network adapters MAC address and then click Add. When the page refreshes, you can select a QoS priority level and then be sure to click Save Settings at the bottom of the page.
Step 7. Users of certain router models can optionally set QoS levels per switched Ethernet port. As stated earlier, the Ethernet Port Priority settings only work with Linksys models WRT54G versions 1.0, 1.1, 2.0, and WRT54GS version 1.0, or other DD-WRT compatible routers with the ADM6996L chipset.
On supported routers you can set both a QoS priority level as well as a maximum throughput threshold, as low as 256Kbps, or even disable that port entirely.
In and Out
The nature of network traffic is such that QoS levels are better controlled for outgoing traffic than incoming. The router has great control over the rate it sends out packets it has less control over the rate they come in. To achieve incoming QoS priorities, the router may try to stall incoming traffic. Users reports indicate mixed success applying QoS levels to incoming traffic compared to outgoing.
Users also report mixed success with QoS levels in general, particularly with the current version of DD-WRT (V23). Some users get exactly the results they expect while others do not.
If your QoS settings dont seem to behave the way you expect, you may need to try several approaches. You can change a service priority from an L7 filter to a port-based definition, for example. You may find that QoS levels for a machine identified by its IP rather than its MAC are more reliable, or vice versa.
In preparing this tutorial, my DD-WRT administration interface exhibited odd behavior on several occasions. Sometimes, the interface would hang after applying or saving settings, such as adding a new service priority. Often, after creating a new service definition, the interface would revert to a blank page.
In most cases, reloading the main administration page and navigating back to the QoS page resolved the hiccups. One time, the router had to be power cycled. Despite the quirks with the interface, though, ultimately the QoS settings stuck. So stick with it.