Quality of Service

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 11:25, 30 August 2005 (edit)
81.176.65.247 (Talk)

← Previous diff
Current revision (22:34, 23 March 2018) (edit) (undo)
Ian5142 (Talk | contribs)
(Re-adding Moved sections.)
 
(325 intermediate revisions not shown.)
Line 1: Line 1:
-[http://work-from-home-opportunity.netfirms.com | Work From Home Opportunity]+You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Web_Interface|Web-GUI]] / NAT/QoS / QoS '''
-[http://work-from-home-moms.netfirms.com | Work From Home Moms]+{{Languages|Quality of Service}}
-[http://work-from-home-mom.netfirms.com | Work From Home Mom]+ 
-[http://work-from-home-business-opportunity.netfirms.com | Work From Home Business Opportunity]+==Introduction==
-[http://work-from-home-business.netfirms.com | Work From Home Business]+<font color=red>Be using a build NO OLDER than r32170 before proceeding!</font>
-[http://work-from-home-based-business.netfirms.com | Work From Home Based Business]+ 
-[http://work-from-home3.netfirms.com | Work From Home3]+ 
-[http://work-at-home-opportunity.netfirms.com | Work At Home Opportunity]+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.
-[http://work-at-home-moms1.netfirms.com | Work At Home Moms]+ 
-[http://work-at-home-mom1.netfirms.com | Work At Home Mom]+Please note, as of 336XX, if QoS is enabled, SFE (Shortcut Forwarding Engine) is disabled, even if it shows up as enabled in the GUI, it is disabled.
-[http://workathomeco.host.sk | Work At Home Computer Jobs]+ 
-[http://work-at-home-business-opportunity1.netfirms.com | Work At Home Business Opportunity1]+'''If you plan on using QoS, please read [[Quality_of_Service#Priorities_explained|Priorities explained]] and [[Quality_of_Service#Precedence|Precedence]] before going any farther.'''
-[http://work-at-home-business1.netfirms.com | Work At Home Business1]+ 
-[http://work-at-home12.netfirms.com | Work At Home]+==Priorities explained==
-[http://wholelifeins.fiberia.com | whole life insurance]+* Maximum - This class offers maximum priority and should be used sparingly.
-[http://washington-home-equity-loan.netfirms.com | Washington Home Equity Loan]+* Premium - Second highest bandwidth class, by default handshaking and ICMP packets fall into this class. Most VoIP and video services will function good in this class if Express is insufficient.
-[http://vs12loan-officer12.blogspot.com/ | Vs loan Officer]+* Express - The Express class is for interactive applications that require bandwidth above standard services so that interactive apps run smoothly.
-[http://va-home-mortgage-loan-rate.netfirms.com | Va Home Mortgage Loan Rate]+* Standard - All services that are not specifically classed will fall under standard class.
-[http://usajobsgove.host.sk | Usa Jobs Government]+* Bulk - The bulk class is only allocated remaining bandwidth when the remaining classes are idle. If the line is full of traffic from other classes, Bulk will only be allocated 1% of total set limit. Use this class for P2P and downloading services like FTP.
-[http://usahealthcwq.fiberia.com | usa health cwq]+ 
-[http://trurivingj.host.sk | Truck Driving Jobs No Experience]+ 
-[http://truckrivingj1.host.sk | Truck Driving Jobs In Georgia]+Bandwidth is allocated based on the following "minimum to maximum" percentages of downlink and uplink values for each class as of current builds:
-[http://truckdrivinsz.fiberia.com | truck drivins job]+ 
-[http://truckdrivingj.host.sk | Truck Driving Job In Iraq]+* Maximum: 75% - 100%
-[http://travelnursejob.fiberia.com | travel nurse job]+* Premium: 50% - 100%
-[http://travelhealthc.host.sk | Travel Health Care Jobs]+* Express: 25% - 100%
-[http://today-home-mortgage-rate.netfirms.com | Today Home Mortgage Rate]+* Standard: 15% - 100%
-[http://texasdentalq.fiberia.com | texas dental]+* Bulk: 5% - 100%
-[http://termlifeinsur.fiberia.com | term life insurance]+ 
-[http://termlifeins.fiberia.com | term life insurance]+ 
-[http://teachingjobs.host.sk | Teaching Job]+What this means is that if you have 10,000kbit of uplink traffic, "Standard" class traffic can be reduced and de-prioritized to 15% or 1,500kbit when a concurrent express or higher priority service requires the down/uplink pipe at the same time.
-[http://stonebridgelife.fiberia.com | stone bridge life insurance]+ 
-[http://starting-a-home-based-business.netfirms.com | Starting A Home Based Business]+Check which priorities are used with the command below:
-[http://smallbusiness.fiberia.com | small business insurance]+<pre>
-[http://shortterm.fiberia.com | short term insurance]+iptables -t mangle -vnL
-[http://send-money-32.blogspot.com/ | Send Money]+</pre>
-[http://second-home-mortgage.netfirms.com | Second Home Mortgage]+Then scroll down to the Chain SVQOS_SVCS section.
-[http://safeco.fiberia.com | safeco insurance]+ 
-[http://reswmoneymaking-143.blogspot.com/ | Resw money making]+ 
-[http://reswmoney-loans.blogspot.com/ | Reswmoney Loans]+===TCP Packet Priority===
-[http://rental-insurance-company.9k.com | rental insurance company]+ 
-[http://registerednurs.host.sk | Registered Nurse Jobs]+Builds before r21061 will not have this option. Update your build if you dont have it, stay up to date.
-[http://radiologyjobs.host.sk | Radiology Jobs]+ 
-[http://qwerloan-brokerqwer.blogspot.com/ | Qwerloan Brokerqwer]+Prioritize small TCP-packets with the following flags: ACK/SYN/FIN/RST
-[http://qwe-quick-money.blogspot.com/ | Qwe Quick Money]+ 
-[http://qazi-need-money.blogspot.com/ | Qazi Need Money]+For detailed info on what these packets do see: http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure
-[http://qa12house-loan21aq.blogspot.com/ | Qa12house Loan21aq]+ 
-[http://private-mortgage-insurance.9k.com | private mortgage insurance]+It is highly recommended to have at least, SYN, FIN & RST checked, OR, none at all. ACK can go both ways as P2P intensive applications such as uTorrent etc involve a lot of ACKs, so theoretically prioritizing ACKs means you "prioritized P2P" though that is not entirely' accurate. Read up & do your own testing to find out whats best for your network. If you do not do large amounts of P2P activity on your network or none at all, then enable ACK prioritization.
-[http://personal-loanie.blogspot.com/ | Personal Loanie]+ 
-[http://pennsylvania-home-mortgage-rate.netfirms.com | Pennsylvania Home Mortgage Rate]+ 
-[http://pennsylvania-car-insurance-quote.9k.com | pennsylvania car insurance quote]+==Precedence==
-[http://pay-day-loan12.blogspot.com/ | Pay Day Loan12]+With all these ways of marking traffic its easy to get confused about how seemingly contradictory requirements are resolved. For example, what happens if you have an IP rule setting IP 192.168.1.2 to priority "maximum" and have a MAC rule setting AA:BB:CC:DD:EE:FF to priority "bulk"?
-[http://owneroperator.host.sk | Owner Operator Truck Driving Jobs]+ 
-[http://ontario-car-insurance-rate.9k.com | ontario car insurance rate]+The order the precedence is as follows:
-[http://onlineeducatio.host.sk | Online Education Jobs]+ 
-[http://online-disability-insurance-quote.9k.com | online disability insurance quote]+* (1st) MAC Priority
-[http://online-credit-card21.blogspot.com/ | Online Credit Card21]+* (2nd) Netmask Priority
-[http://online-auto-insurance-quote.9k.com | online auto insurance quote]+* (3rd) Interface Priority
-[http://nursingjob.host.sk | Nursing Job]+* (4th) Services Priority
-[http://nursing-home.netfirms.com | Nursing Home]+* (5th) Ethernet Port Priority
-[http://north-carolina-home-mortgage-rate.netfirms.com | North Carolina Home Mortgage Rate]+ 
-[http://newyorkifei.host.sk | Newyork ife insurance]+ 
-[http://newyorkautoi.host.sk | Newyork auto insurance]+<font color="red">'''NOTE:''' Ethernet Port Priority only works on old 802.11g only models with ADMtek switch chips. If you don't have ethernet port priority listed, your router does not support it. Ethernet port priority is different than interface priority.</font>
-[http://new-jersey-home-mortgage-rate.netfirms.com | New Jersey Home Mortgage Rate]+ 
-[http://new-jersey-home-mortgage.netfirms.com | New Jersey Home Mortgage]+<font color="red">'''NOTE:''' Services can be used at the same time as netmask or MAC, such as limiting 192.168.1.2 to 6 Mbps down & 512 Kbps up while having http set to express, that device will have http packets prioritized within it's allocated bandwidth limit. This only applies to builds r21061 & newer</font>
-[http://new-home-loan-bad-credit-texas.netfirms.com | New Home Loan Bad Credit Texas]+ 
-[http://new-car-loanq.blogspot.com/ | New Car Loanq]+ 
-[http://nctruckd.host.sk | Nc Truck Driving Job]+For netmask, the IP address entries are applied in the order that they appear in your netmask table. Only the first match applies. Example, if you have an entry marking 192.168.1.10/32 as bulk, followed by an entry ABOVE IT, marking 192.168.1.0/24 (all 192.168.1.X) as premium, the traffic from 192.168.1.10 would be marked bulk because it was the first match.
-[http://nationwideinsu.host.sk | Nation wide insurance]+ 
-[http://nationwide-home-mortgage-loan-company.netfirms.com | Nationwide Home Mortgage Loan Company]+For services, The services entries are applied in the order that they appear in your services tables going from bottom to top. Again, only the first match will apply.
-[http://motorhomeinsu.host.sk | Motor home insurance]+ 
-[http://mortgage-loanw.blogspot.com/ | Mortgage Loanw]+==Initial Setup==
-[http://montanawholel.host.sk | Montana whole ]+* Log into the [[Web Interface]]
-[http://money-ordere.blogspot.com/ | Money Ordere]+ 
-[http://moneymarketsewq.blogspot.com/ | Moneymarketsewq]+* Select the NAT/QoS tab and then the QoS sub-tab.
-[http://money-comresw.blogspot.com/ | Money Comresw]+ 
-[http://money-at-homeresw.blogspot.com/ | Money At Homeresw]+* Click "Enable"
-[http://mishorttermh.host.sk | Mishort]+ 
-[http://michiganinsura.host.sk | Michigan insurance]+* Set Port to "WAN". This works for all QoS setups EXCEPT, when using QoS by interface on a BRIDGED interface under "interface priority", UNBRIDGED interfaces work fine with WAN port setting. If you want to use QoS on a BRIDGED interface you must select port as "LAN & WLAN", which also works for all other QoS setups, but with slightly more CPU usage.
-[http://mercuryinsuran.host.sk | mercury insurance]+ 
-[http://medicalsupply.host.sk | medical supply]+* Select HTB as your packet scheduler if you have "queuing discipline" listed below it, if not then use HFSC.
-[http://maryland-home-equity-loan.netfirms.com | Maryland Home Equity Loan]+ 
-[http://marriottotel.host.sk | Marriott Hotel Job Opportunity]+* Select FQ_CODEL as your queuing discipline.
-[http://making-moneyqwesrt.blogspot.com/ | Making Moneyqwesrt]+ 
-[http://make-money-nowress.blogspot.com/ | Make Money Nowress]+* Set your download and upload speeds. You can use a speed test like [http://www.speedtest.net Speedtest.net] or [http://www.dslreports.com/speedtest dslreports.com/speedtest] to check your actual connection speed. Some ISPs also provide their own bandwidth testing service, which may be more reliable than the links provided. Enter no higher than 95% of the values you measured into the proper fields. After you have everything set run the speed test again. If you get near 90% of your previous measurement in each direction then things are cool. If you get results which are way off then chances are that you have reversed these values. You must enter a value for the uplink field but if you want you can enter 0 for the downlink field in which case no QoS will occur in that direction, setting your downlink field to 0 isn't recommended.
-[http://lowlifeinsura.host.sk | lowlifeinsura]+ 
-[http://low-interest-home-equity-loan.netfirms.com | Low Interest Home Equity Loan]+ 
-[http://lowest-home-mortgage-rate.netfirms.com | Lowest Home Mortgage Rate]+It probably bugs you to set less than 100% of your available bandwidth in these fields but this is required. There will be a bottleneck somewhere in the system and QoS can only work if the bottleneck is in your router where it has control. The goal is to force the bottleneck to be in your router as opposed to some random location out on the wire over which you have no control. Some ISP's even have bursting ("powerboost") which will temporarily give you extra bandwidth when you first start using your connection but will later throttle down to a sustained rate. Fortunately there is usually a minimum level that you receive on a consistent basis and you must set your QoS limits below this minimum. The problem is finding this minimum and you may have to repeat speed tests many times before determining it. For this reason start with 80% of your measured speed and try things for a couple of days. If the performance is acceptable you can start to inch your levels up. If you go even 2% higher than you should be, your QoS will totally stop working (just too high) or randomly stop working (when your ISP node/DSLAM is slow aka saturated). This can lead to a lot of confusion on your part so get it working first by conservatively setting these speeds and then optimize later.
-[http://lorida-home-insuran.sbn.bz | Florida Home Insurance Orlando Owner]+ 
-[http://life-insurance-company.sbn.bz | life insurance company]+==Prioritizing by Application (Skype, Http) or Port Range (P2P) ==
-[http://life-insurance.host.sk | life insurance]+* Choose an available Service or Port Range from the list or create one, and then press "Add" next to it.
-[http://life-insuranc.host.sk | life insuranc]+* 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.
-[http://liability-insurance.greenline.ru | liability insurance]+* Add all your other selected Services and Port Ranges here
-[http://legitimate-home-business.netfirms.com | Legitimate Home Business]+* Choosing a Layer7 service based entry can work better than choosing a port range; though the router works harder as it has to dig into the packets beyond the header, to look at the data they contain.
-[http://jobtruckin.host.sk | Job Trucking]+ 
-[http://jobsinradiolo.host.sk | Jobs In Radiology]+If you wish to add more than one priority then use the "Add" button to create more entries.
-[http://jobsinheal.host.sk | Jobs In Health Care Management]+ 
-[http://jobsincompute.host.sk | Jobs In Computer]+ 
-[http://jobs12.jino-net.ru | Jobs]+==Prioritizing by Interface==
-[http://job-listing-in.jino-net.ru| | Job Listing In]+Select your preferred interference, click add, then select the speed or priority you want. You can also limit ethernet ports this way as well (ethX or vlanX). Any limits or priorities set are shared for that interface regardless how many clients are connected to it. Excellent for running a guest network/hotspot on eg, ath1.1, applying QoS on the entire interface makes it impossible for a greedy user to bypass it by MAC cloning, changing IPs etc, short of connecting to a different interface. The same interface can also be entered multiple times with different speed limits or priorities for different services, example, ath0 512/512 with ssl & ath0 0/1024 with http would mean ssl traffic on ath0 is limited to 512kbps down & up, http is unlimited on down (up to global limits is used) & limited to 1024 (1mbps) on up, remaining entered services are not limited (up to global limits for both directions).
-[http://internetjobs.fiberia.com | Internet jobs]+ 
-[http://internet-home-business-opportunity.netfirms.com | Internet Home Business Opportunity]+==Prioritizing by Netmask (IP address)==
-[http://internet-home-business1.netfirms.com | Internet Home Business]+These are entered in CIDR notation including the network prefix.
-[http://internet-home-based-business.netfirms.com | Internet Home Based Business]+ 
-[http://interest-only-home-mortgage.netfirms.com | Interest Only Home Mortgage]+For example, to specify a single IP address enter xxx.xxx.xxx.xxx/32. Be careful to enter netmask as /32 because leaving it /0 means ALL IPs!.
-[http://insurance-online-ont.cameroun.ws | insurance online]+ 
-[http://insurance-motorcycle.casino777.ru | insurance motorcycle]+The netmask is the number of bits of the IP address to match. For example, the entry 192.168.1.0/24 matches 192.168.1.x addresses. An entry of 192.168.0.0/16 matches 192.168.x.x addresses. If you're unsure of how to create CIDR subnet masks and what they mean, then use a [http://www.subnet-calculator.com subnet calculator].
-[http://insurance-life-rate-wh.wol.bz | insurance life rate]+ 
-[http://insurance-life-quote.sbn.bz | insurance life quote]+After you have filled it out, press "add" next to it. If you want to add multiple entries (make sure to have order correct!) click "save" before entering in another so any previous changes don't get deleted, only click "apply" when you want to start testing your current changes displayed.
-[http://insurance-lead-program.sbn.bz | insurance lead program]+ 
-[http://insurance-broker-min.sbn.bz | Insurance Broker Minneapolis]+ 
-[http://insurance-agent.sbn.bz | insurance agent]+==Prioritizing by MAC Address==
-[http://instant-online-insurance.sbn.bz | Instant Online Insurance Quote]+In the case you want to prioritize traffic from a particular device without a static IP address on your LAN, you can prioritize by MAC Address. Enter the MAC Address of the device and press "Add" next to it.
-[http://instant-auto-insuran.sbn.bz | instant auto insuran]+ 
-[http://injobparttime.fiberia.com | In job part time]+ 
-[http://in-home-business.netfirms.com | In Home Business]+ 
-[http://infertility-insurance-cov.sbn.bz | Infertility Insurance Coverage]+ 
-[http://individual-dental-ins.sbn.bz | individual dental insurance]+==How Do You Check What QoS Priorities Were Applied==
-[http://illinois-car-insurance.sbn.bz | Ilinois Car Insurance Quote]+The DDWRT web UI doesn't display any live traffic. Short of doing a practical test, you can get your hands dirty by checking the conntrack entries via telnet or ssh access in the router. When you're logged in run:
-[http://houstonitjob.fiberia.com | Houston it job]+<pre>
-[http://home-work.netfirms.com | Home Work]+iptables -t mangle -vnL
-[http://home-warranty-insurance.sbn.bz | home warranty insurance]+</pre>
-[http://home-theater-furniture.netfirms.com | Home Theater Furniture]+Then scroll down to the Chain SVQOS_SVCS section.
-[http://home-sale.netfirms.com | Home Sale]+ 
-[http://home-owner-insurance.sbn.bz | Home Owner Insurance Austin Texas]+With the above iptables mangle command you can see the inbound/outbound chains, entered IPs/MACs/services & whats being matched where.
-[http://home-owner-insurance.netfirms.com | Home Owner Insurance]+ 
-[http://home-mortgage-refinancing-loan.netfirms.com | Home Mortgage Refinancing Loan]+It will list out all currently open connection and protocol that is currently being routed by the router. This is what it would look like:
-[http://home-mortgage-refinancing.netfirms.com | Home Mortgage Refinancing]+<pre>
-[http://home-mortgage-refinance.netfirms.com | Home Mortgage Refinance]+tcp 6 113 ESTABLISHED src=192.168.1.5 dst=83.141.4.210 sport=48959 dport=21 src=83.141.4.210 dst=216.239.61.104 sport=21 dport=48959 [ASSURED] use=1 rate=73 l7proto=ftp mark=40
-[http://home-mortgage-rate-florida.netfirms.com | Home Mortgage Rate Florida]+udp 17 29 src=192.168.1.5 dst=128.63.2.53 sport=56105 dport=53 src=128.63.2.53 dst=216.239.61.104 sport=53 dport=56105 use=1 rate=157 l7proto=dns mark=10
-[http://home-mortgage-rate.netfirms.com | Home Mortgage Rate]+</pre>
-[http://home-mortgage-interest-rate.netfirms.com | Home Mortgage Interest Rate]+What you'll be interested to look at will be the first set of source and destination IP, including the port numbers. Next the presence of l7proto and the "mark" field. The entries indicate the current live connection QoS priority applied on them based on the "mark" field. The "mark" values corresponds to the following:
-[http://home-mortgage-florida.netfirms.com | Home Mortgage Florida]+* Maximum: 100
-[http://home-mortgage-company.netfirms.com | Home Mortgage Company]+* Premium: 10
-[http://home-mom-work.netfirms.com | Home Mom Work]+* Express: 20
-[http://homejobnursing.fiberia.com | home job nursing]+* Standard: 30
-[http://home-insurance-quote-uk.sbn.bz | home insurance quote uk]+* Bulk: 40
-[http://home-insurance-owner.netfirms.com | Home Insurance Owner]+* (no QoS matched): 0
-[http://home-insurance-new.sbn.bz | Home Insurance New York]+ 
-[http://home-insurance-motor.jackpot888.com | home insurance motor]+ 
-[http://home-insurance-chicago.sbn.bz | Home Insurance Chicago]+You may see "mark=0" for some l7proto service even though they are in configured in the list of QoS rules. This may mean that the layer 7 pattern matching system didn't match a new or changed header for that protocol. Custom service on port matches will usually take care of these.
-[http://home-in-sale.netfirms.com | Home In Sale]+ 
-[http://home-for-sale-in-denver.netfirms.com | Home For Sale In Denver]+==Time Based QoS==
-[http://home-for-sale-in.netfirms.com | Home For Sale In]+ 
-[http://home-for-sale1.netfirms.com | Home For Sale]+As described in [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=438664#438664 this thread] you can use [[CRON]] jobs to enable/disable QoS. This is just a simplistic approach but more complex things could be done if you put your mind to it. These commands will enable HTB QoS on the WAN port from 5PM to 1AM but you will still need to configure everything else in the GUI. If you want to use LAN&WLAN then change "`get_wanface`" to "imq1". To change the times, see the [[CRON]] page for information.
-[http://home-finance.netfirms.com | Home Finance]+ 
-[http://home-equity-second-mortgage.netfirms.com | Home Equity Second Mortgage]+ 1 17 * * * root /usr/sbin/svqos `nvram get wshaper_downlink` `nvram get wshaper_uplink` `get_wanface` `nvram get wan_mtu` 0
-[http://home-equity-loan.netfirms.com | Home Equity Loan]+ */6 1-17 * * * root /usr/sbin/svqos stop 0 `get_wanface` 0 0
-[http://home-equity-line1.netfirms.com | Home Equity Line1]+ 
-[http://home-equity1.netfirms.com | Home Equity1]+If you use HFSC then you would do something like this instead.
-[http://home-buying.netfirms.com | Home Buying]+ 
-[http://home-business-opportunity1.netfirms.com | Home Business Opportunity1]+ 1 17 * * * root /usr/sbin/svqos2 `nvram get wshaper_uplink` `nvram get wshaper_downlink` `get_wanface` `nvram get wan_mtu` 0
-[http://home-business32.netfirms.com | Home Business]+ */6 1-17 * * * root /usr/sbin/svqos2 stop 0 `get_wanface` 0 0
-[http://homebasedjobs.fiberia.com | home based jobs]+ 
-[http://home-based-business-work.netfirms.com | Home Based Business Work]+As described in [http://www.dd-wrt.com/forum/viewtopic.php?p=512889#512889 this thread] you can also set different rates at different times by doing something like this which changes the HTB rates.
-[http://home-based-business-opportunity.netfirms.com | Home Based Business Opportunity]+ 
-[http://home-based-business1.netfirms.com | Home Based Business1]+ 1 23 * * * root /usr/sbin/svqos '''[downlink rate]''' '''[uplink rate]''' `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink='''[downlink rate]'''; nvram set wshaper_uplink='''[uplink rate]''';
-[http://high-paying-tr.sbn.bz | high paying]+ 1 10 * * * root /usr/sbin/svqos '''[downlink rate]''' '''[uplink rate]''' `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink='''[downlink rate]'''; nvram set wshaper_uplink='''[uplink rate]''';
-[http://healthqwesd.fiberia.com | health qwesd]+ 
-[http://health-insurance-quote.sbn.bz | Health Insurance Quote Miami]+<font color="red">Edit: This will cause trouble on current firmware releases greater than r21061. Use the predefined service handler to stop/start QoS instead. Even if needed, use imq1 instead of br0 for internal traffic shaping.
-[http://health-insurance-i.sbn.bz | Health Insurance In Florida]+</font>
-[http://health-insurance-ca.sbn.bz | Health Insurance Ca]+<pre>stopservice wshaper
-[http://health-insurance12.sbn.bz | Health Insurance Orlando Quote]+startservice wshaper</pre>
-[http://health-insurance.sbn.bz | Health Insurance Louisville]+ 
-[http://health-care-jobs-in-mi.sbn.bz | Health Care Jobs In Michigan]+<font color="red">If you need to alter down/up rates edit the nvram variables before restarting wshaper</font>
-[http://health-care-jobs-houston.jino-net.ru | health care jobs houston]+<pre>
-[http://health-care-job-opening.jino-net.ru | health care job opening]+nvram set wshaper_downlink=20000
-[http://health-care-consultin.sbn.bz | health care consultin]+nvram set wshaper_uplink=800
-[http://grundy-collector-car.sbn.bz | Grundy Collector Car Insurance]+startservice wshaper
-[http://government-jobs-in-usa.sbn.bz | Government Jobs In Usa]+</pre>
-[http://geico-insurance-phone.sbn.bz | Geico Insurance Phone Number]+ 
-[http://from-home-job-real-work.sbn.bz | from home job real work]+ 
-[http://free-insurance-quo.sbn.bz | Free Insurance Quote Ontario]+ 
-[http://florida-truck-driving.sbn.bz | florida truck driving]+ 
-[http://florida-term-life-insu.sbn.bz | Florida Term Life Insurance Rate]+=External Links=
-[http://florida-home-equity-loan.netfirms.com | Florida Home Equity Loan]+* [http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm HTB Manual]
-[http://florida-health.sbn.bz | Florida Health Insurance Quote]+* [http://linux.die.net/man/8/iptables iptables man page]
-[http://finance-home.netfirms.com | Finance Home]+* [http://l7-filter.sourceforge.net/ L7-Filter]
-[http://federal-govern.pbnet.ru | federal govern.pbnet.ru]+* [http://frottle.sourceforge.net/ Frottle sourceforge]
-[http://erloan-personal4545.blogspot.com/ | Erloan Personal]+* [http://www.gargoyle-router.com/wiki/doku.php?id=qos Lots of QoS myths explained, what QoS can & can't do & much more info.]
-[http://equity-home.netfirms.com | Equity Home]+ 
-[http://dump-truck-driving-jobs.sbn.bz | dump truck driving jobs]+[[Category:Traffic moderation]]
-[http://driving-jobs-ontario-c.sbn.bz | driving jobs ontario car]+[[Category:Basic tutorials]]
-[http://driving-florida-in-job-tr.sbn.bz | driving florida in job truck]+
-[http://denver-home-sale.netfirms.com | Denver Home Sale]+
-[http://denver-home-for-sale.netfirms.com | Denver Home For Sale]+
-[http://cvqazfi21nd-money12.blogspot.com/ | Money]+
-[http://current-home-mortgage-rate.netfirms.com | Current Home Mortgage Rate]+
-[http://current-home-mortgage-interest-rate.netfirms.com | Current Home Mortgage Interest Rate]+
-[http://countrywide-home-loan-mortgage.netfirms.com | Countrywide Home Loan Mortgage]+
-[http://continental-airline-jo.wol.bz | continental airline job]+
-[http://com-truck-driving-jobs.sbn.bz | com truck driving jobs]+
-[http://computer-internet-job.sbn.bz | computer internet job]+
-[http://commercial-truck.greenline.ru | commercial truck]+
-[http://colorado-home-mortgage-rate.netfirms.com | Colorado Home Mortgage Rate]+
-[http://colorado-home-mortgage-loan-company.netfirms.com | Colorado Home Mortgage Loan Company]+
-[http://colorado-home-equity-loan.netfirms.com | Colorado Home Equity Loan]+
-[http://chicago-jobs.cameroun.ws | chicago jobs]+
-[http://chicago-computer-job.wol.bz | chicago computer job]+
-[http://car-in-insurance-ontario-rate.envy.nu/ | Car In Insurance Ontario Rate]+
-[http://car-florida-insurance-rate.blogspot.com/ | Car Florida Insurance Rate]+
-[http://care-health-job-usa.blogspot.com/ | Care Health Job Usa]+
-[http://care-health-in-job.sbn.bz | care health in job]+
-[http://car-dallas-insurance-lake.blogspot.com/ | Car Dallas Insurance Lake]+
-[http://car-cheap-compare-insurance.blogspot.com/ | Car Cheap Compare Insurance]+
-[http://canada-life-insurance-company.blogspot.com/ | Canada Life Insurance Company]+
-[http://california-job-nurse-travel.blogspot.com/ | California Job Nurse Travel]+
-[http://california-health-insurance-quote.blogspot.com/ | California Health Insurance Quote]+
-[http://california-driving-in-job-truck.jino-net.ru | california driving in job truck]+
-[http://business-opportunity-from-home.netfirms.com | Business Opportunity From Home]+
-[http://business-home-work.netfirms.com | Business Home Work]+
-[http://business-home-opportunity-work.netfirms.com | Business Home Opportunity Work]+
-[http://business-home-j.boom.ru/ | Business Home J]+
-[http://business-from-home-work.netfirms.com | Business From Home Work]+
-[http://business-from-home-opportunity-work.netfirms.com | Business From Home Opportunity Work]+
-[http://business-from-home.netfirms.com | Business From Home]+
-[http://boston-hotel-job.jino-net.ru | boston hotel job]+
-[http://best-refinance-home-mortgage-loan-rate.netfirms.com | Best Refinance Home Mortgage Loan Rate]+
-[http://best-home-based-business-opportunity.netfirms.com | Best Home Based Business Opportunity]+
-[http://based-business-home-work.netfirms.com | Based Business Home Work]+
-[http://based-business-home-starting.netfirms.com | Based Business Home Starting]+
-[http://based-business-home-opportunity.netfirms.com | Based Business Home Opportunity]+
-[http://based-business-home-job.jino-net.ru | based business home job]+
-[http://based-business-home-internet.netfirms.com | Based Business Home Internet]+
-[http://based-business-home.netfirms.com | Based Business Home]+
-[http://based-business-from-home-work.netfirms.com | Based Business From Home Work]+
-[http://bad-credit-wisconsin-home-loan.netfirms.com | Bad Credit Wisconsin Home Loan]+
-[http://bad-credit-home-mortgage-refinance-loan.netfirms.com | Bad Credit Home Mortgage Refinance Loan]+
-[http://bad-credit-home-mortgage.netfirms.com | Bad Credit Home Mortgage]+
-[http://bad-credit-home-loan-mobile.netfirms.com | Bad Credit Home Loan Mobile]+
-[http://bad-credit-equity-home-mortgage.netfirms.com | Bad Credit Equity Home Mortgage]+
-[http://bad-california-credit-home-loan.netfirms.com | Bad California Credit Home Loan]+
-[http://at-home-work1.netfirms.com | At Home Work]+
-[http://athomejobs.fiberia.com | at home jobs]+
-[http://ar-cheap-insurance-quote.blogspot.com/ | Ar Cheap Insurance Quote]+
-[http://american-home-loan.netfirms.com | American Home Loan]+
-[http://adt-home-security.netfirms.com | Adt Home Security]+
-[http://administrationj.fiberia.com | administration job]+
-[http://aames-home-loan.netfirms.com | Aames Home Loan]+
-[http://56rtyuiopof-debt343434.blogspot.com/ | Debt]+
-[http://49-your-money.blogspot.com/ | 49 Your Money]+
-[http://49-ways-to-make-money.blogspot.com/ | 49 Ways To Make Money]+
-[http://49-unclaimed-money.blogspot.com/ | 49 Unclaimed Money]+
-[http://499-unsecured-personal-loan.blogspot.com/ | Unsecured Personal Loan]+
-[http://32-save-money.blogspot.com/ | Save Money]+
-[http://32loans-for-bad-creditqwe.blogspot.com/ | loans For Bad Creditqwe]+
-[http://321lost-moneyqwest.blogspot.com/ | lost Moneyqwest]+
-[http://21loan-carerty.blogspot.com/ | loan Carerty]+
-[http://142how-to-make-moneyqazxcd.blogspot.com/ | how To Make Money]+
-[http://12qwe12hard-money.blogspot.com/ | hard Money]+
-[http://12qmoneymarketq.blogspot.com/ | money market]+
-[http://12make-moneyqwert.blogspot.com/ | make Money]+

Current revision

You are here: DD-WRT wiki mainpage / Web-GUI / NAT/QoS / QoS


Contents

[edit] Introduction

Be using a build NO OLDER than r32170 before proceeding!


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.

Please note, as of 336XX, if QoS is enabled, SFE (Shortcut Forwarding Engine) is disabled, even if it shows up as enabled in the GUI, it is disabled.

If you plan on using QoS, please read Priorities explained and Precedence before going any farther.

[edit] Priorities explained

  • Maximum - This class offers maximum priority and should be used sparingly.
  • Premium - Second highest bandwidth class, by default handshaking and ICMP packets fall into this class. Most VoIP and video services will function good in this class if Express is insufficient.
  • 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 standard class.
  • Bulk - The bulk class is only allocated remaining bandwidth when the remaining classes are idle. If the line is full of traffic from other classes, Bulk will only be allocated 1% of total set limit. Use this class for P2P and downloading services like FTP.


Bandwidth is allocated based on the following "minimum to maximum" percentages of downlink and uplink values for each class as of current builds:

  • Maximum: 75% - 100%
  • Premium: 50% - 100%
  • Express: 25% - 100%
  • Standard: 15% - 100%
  • Bulk: 5% - 100%


What this means is that if you have 10,000kbit of uplink traffic, "Standard" class traffic can be reduced and de-prioritized to 15% or 1,500kbit when a concurrent express or higher priority service requires the down/uplink pipe at the same time.

Check which priorities are used with the command below:

iptables -t mangle -vnL

Then scroll down to the Chain SVQOS_SVCS section.


[edit] TCP Packet Priority

Builds before r21061 will not have this option. Update your build if you dont have it, stay up to date.

Prioritize small TCP-packets with the following flags: ACK/SYN/FIN/RST

For detailed info on what these packets do see: http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure

It is highly recommended to have at least, SYN, FIN & RST checked, OR, none at all. ACK can go both ways as P2P intensive applications such as uTorrent etc involve a lot of ACKs, so theoretically prioritizing ACKs means you "prioritized P2P" though that is not entirely' accurate. Read up & do your own testing to find out whats best for your network. If you do not do large amounts of P2P activity on your network or none at all, then enable ACK prioritization.


[edit] Precedence

With all these ways of marking traffic its easy to get confused about how seemingly contradictory requirements are resolved. For example, what happens if you have an IP rule setting IP 192.168.1.2 to priority "maximum" and have a MAC rule setting AA:BB:CC:DD:EE:FF to priority "bulk"?

The order the precedence is as follows:

  • (1st) MAC Priority
  • (2nd) Netmask Priority
  • (3rd) Interface Priority
  • (4th) Services Priority
  • (5th) Ethernet Port Priority


NOTE: Ethernet Port Priority only works on old 802.11g only models with ADMtek switch chips. If you don't have ethernet port priority listed, your router does not support it. Ethernet port priority is different than interface priority.

NOTE: Services can be used at the same time as netmask or MAC, such as limiting 192.168.1.2 to 6 Mbps down & 512 Kbps up while having http set to express, that device will have http packets prioritized within it's allocated bandwidth limit. This only applies to builds r21061 & newer


For netmask, the IP address entries are applied in the order that they appear in your netmask table. Only the first match applies. Example, if you have an entry marking 192.168.1.10/32 as bulk, followed by an entry ABOVE IT, marking 192.168.1.0/24 (all 192.168.1.X) as premium, the traffic from 192.168.1.10 would be marked bulk because it was the first match.

For services, The services entries are applied in the order that they appear in your services tables going from bottom to top. Again, only the first match will apply.

[edit] Initial Setup

  • Select the NAT/QoS tab and then the QoS sub-tab.
  • Click "Enable"
  • Set Port to "WAN". This works for all QoS setups EXCEPT, when using QoS by interface on a BRIDGED interface under "interface priority", UNBRIDGED interfaces work fine with WAN port setting. If you want to use QoS on a BRIDGED interface you must select port as "LAN & WLAN", which also works for all other QoS setups, but with slightly more CPU usage.
  • Select HTB as your packet scheduler if you have "queuing discipline" listed below it, if not then use HFSC.
  • Select FQ_CODEL as your queuing discipline.
  • Set your download and upload speeds. You can use a speed test like Speedtest.net or dslreports.com/speedtest to check your actual connection speed. Some ISPs also provide their own bandwidth testing service, which may be more reliable than the links provided. Enter no higher than 95% of the values you measured into the proper fields. After you have everything set run the speed test again. If you get near 90% of your previous measurement in each direction then things are cool. If you get results which are way off then chances are that you have reversed these values. You must enter a value for the uplink field but if you want you can enter 0 for the downlink field in which case no QoS will occur in that direction, setting your downlink field to 0 isn't recommended.


It probably bugs you to set less than 100% of your available bandwidth in these fields but this is required. There will be a bottleneck somewhere in the system and QoS can only work if the bottleneck is in your router where it has control. The goal is to force the bottleneck to be in your router as opposed to some random location out on the wire over which you have no control. Some ISP's even have bursting ("powerboost") which will temporarily give you extra bandwidth when you first start using your connection but will later throttle down to a sustained rate. Fortunately there is usually a minimum level that you receive on a consistent basis and you must set your QoS limits below this minimum. The problem is finding this minimum and you may have to repeat speed tests many times before determining it. For this reason start with 80% of your measured speed and try things for a couple of days. If the performance is acceptable you can start to inch your levels up. If you go even 2% higher than you should be, your QoS will totally stop working (just too high) or randomly stop working (when your ISP node/DSLAM is slow aka saturated). This can lead to a lot of confusion on your part so get it working first by conservatively setting these speeds and then optimize later.

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

  • Choose an available Service or Port Range from the list or create one, and then press "Add" next to it.
  • 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.
  • Add all your other selected Services and Port Ranges here
  • Choosing a Layer7 service based entry can work better than choosing a port range; though the router works harder as it has to dig into the packets beyond the header, to look at the data they contain.

If you wish to add more than one priority then use the "Add" button to create more entries.


[edit] Prioritizing by Interface

Select your preferred interference, click add, then select the speed or priority you want. You can also limit ethernet ports this way as well (ethX or vlanX). Any limits or priorities set are shared for that interface regardless how many clients are connected to it. Excellent for running a guest network/hotspot on eg, ath1.1, applying QoS on the entire interface makes it impossible for a greedy user to bypass it by MAC cloning, changing IPs etc, short of connecting to a different interface. The same interface can also be entered multiple times with different speed limits or priorities for different services, example, ath0 512/512 with ssl & ath0 0/1024 with http would mean ssl traffic on ath0 is limited to 512kbps down & up, http is unlimited on down (up to global limits is used) & limited to 1024 (1mbps) on up, remaining entered services are not limited (up to global limits for both directions).

[edit] Prioritizing by Netmask (IP address)

These are entered in CIDR notation including the network prefix.

For example, to specify a single IP address enter xxx.xxx.xxx.xxx/32. Be careful to enter netmask as /32 because leaving it /0 means ALL IPs!.

The netmask is the number of bits of the IP address to match. For example, the entry 192.168.1.0/24 matches 192.168.1.x addresses. An entry of 192.168.0.0/16 matches 192.168.x.x addresses. If you're unsure of how to create CIDR subnet masks and what they mean, then use a subnet calculator.

After you have filled it out, press "add" next to it. If you want to add multiple entries (make sure to have order correct!) click "save" before entering in another so any previous changes don't get deleted, only click "apply" when you want to start testing your current changes displayed.


[edit] Prioritizing by MAC Address

In the case you want to prioritize traffic from a particular device without a static IP address on your LAN, you can prioritize by MAC Address. Enter the MAC Address of the device and press "Add" next to it.



[edit] How Do You Check What QoS Priorities Were Applied

The DDWRT web UI doesn't display any live traffic. Short of doing a practical test, you can get your hands dirty by checking the conntrack entries via telnet or ssh access in the router. When you're logged in run:

iptables -t mangle -vnL

Then scroll down to the Chain SVQOS_SVCS section.

With the above iptables mangle command you can see the inbound/outbound chains, entered IPs/MACs/services & whats being matched where.

It will list out all currently open connection and protocol that is currently being routed by the router. This is what it would look like:

tcp      6 113 ESTABLISHED src=192.168.1.5 dst=83.141.4.210 sport=48959 dport=21 src=83.141.4.210 dst=216.239.61.104 sport=21 dport=48959 [ASSURED] use=1 rate=73 l7proto=ftp mark=40
udp      17 29 src=192.168.1.5 dst=128.63.2.53 sport=56105 dport=53 src=128.63.2.53 dst=216.239.61.104 sport=53 dport=56105 use=1 rate=157 l7proto=dns mark=10

What you'll be interested to look at will be the first set of source and destination IP, including the port numbers. Next the presence of l7proto and the "mark" field. The entries indicate the current live connection QoS priority applied on them based on the "mark" field. The "mark" values corresponds to the following:

  • Maximum: 100
  • Premium: 10
  • Express: 20
  • Standard: 30
  • Bulk: 40
  • (no QoS matched): 0


You may see "mark=0" for some l7proto service even though they are in configured in the list of QoS rules. This may mean that the layer 7 pattern matching system didn't match a new or changed header for that protocol. Custom service on port matches will usually take care of these.

[edit] Time Based QoS

As described in this thread you can use CRON jobs to enable/disable QoS. This is just a simplistic approach but more complex things could be done if you put your mind to it. These commands will enable HTB QoS on the WAN port from 5PM to 1AM but you will still need to configure everything else in the GUI. If you want to use LAN&WLAN then change "`get_wanface`" to "imq1". To change the times, see the CRON page for information.

1 17 * * * root /usr/sbin/svqos `nvram get wshaper_downlink` `nvram get wshaper_uplink` `get_wanface` `nvram get wan_mtu` 0
*/6 1-17 * * * root /usr/sbin/svqos stop 0 `get_wanface` 0 0

If you use HFSC then you would do something like this instead.

1 17 * * * root /usr/sbin/svqos2 `nvram get wshaper_uplink` `nvram get wshaper_downlink` `get_wanface` `nvram get wan_mtu` 0
*/6 1-17 * * * root /usr/sbin/svqos2 stop 0 `get_wanface` 0 0 

As described in this thread you can also set different rates at different times by doing something like this which changes the HTB rates.

1 23 * * * root /usr/sbin/svqos [downlink rate] [uplink rate] `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink=[downlink rate]; nvram set wshaper_uplink=[uplink rate];
1 10 * * * root /usr/sbin/svqos [downlink rate] [uplink rate] `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink=[downlink rate]; nvram set wshaper_uplink=[uplink rate];

Edit: This will cause trouble on current firmware releases greater than r21061. Use the predefined service handler to stop/start QoS instead. Even if needed, use imq1 instead of br0 for internal traffic shaping.

stopservice wshaper
startservice wshaper

If you need to alter down/up rates edit the nvram variables before restarting wshaper

nvram set wshaper_downlink=20000
nvram set wshaper_uplink=800
startservice wshaper



[edit] External Links