24/04/13
Cl assi c QOS setup tutor i al - Coyote Li nux & Br azi l FW Add- ons
Classic QOS setup tutorial QoS and bandwidth management | QoS documentation | QoS tutorial
This tutorial shows you how to s etup QOS configuration configuration when y ou are us ing Coyote or BrazilF BrazilFW W init scripts. It sh ows you how to s etup correct up stream and downstream values and co ntains information information about o ther QOS configuration configuration options.
What is QOS, Traffic Shaping and Bandwidth limiting QOS is an attempt to control computer network traffic in order to optimize or guarantee performance, low-latency, and/or bandwidth. QOS (Traffic shaping) deals with concepts of classification, queue disciplines, disciplines, en forcing forcing policies, policies, con gestion management, and fairness. fairness. Traffic Traffic shaping provides a mechanism to control the amount and volume volume of traffic being sent into a network (bandwidth (bandwidth throttling), and the rate at which the traffic is being s ent (rate limiting). limiting). For For this reas on, traffic traffic shaping s chemes need to be implem implemented ented at the net work edges to con trol the traffic traffic entering the network. It It also may be necessary to identify traffic traffic flows at the ingress point (the point at which traffic traffic enters th e network) with with a granularity granularity th at allows the traffic-shaping traffic-shaping cont rol mechanism mechanism to sep arate traffic traffic into individual flows flows an d s hape t hem differently. differently.
Basic QOS setup Basic QOS configuration is made in Web-admin configuration interface from "QOS configuration" panel. If you choose Coyote (BrazilFW) QOS init scripts, the configuration screen will look like this (click for large picture) ... Now we will will des cribe what th e configurat ion opt ions meen. QOS init type
QOS configuration script init type. You can either use Wondershaper configuration or Coyote Linux (BrazilFW) QOS scripts configuration. configuration. This tutorial focuses focuses on the s econd op tion. You You can ch oose b etween default config and manual class class config. default config - There is only one QOS QOS class created for all computers. computers. Use th is option if you want all computers computers t o sh are full band width and o nly cate gorize traffic to QOS QOS subc lass es ba sed o n QOS filters filters (covered later). Setting QOS with with th is configuration configuration ty pe is th e easyes t way. For exam example ple you can tell that p2p traffic traffic belongs to s low priority priority class and Voice over IP belong to high p riority class. manual manual class config - Use this option if you want to have more control over how the bandwidth is distributed between computers on your local network. With this con figuration figuration option you can for example example setup that one co mputer can use maxim aximaly aly 128kB downstream and the other one only 64kB. Real Downstream bandwidth
Real value value of you r downstream bandwidth..not bandwidth..not the value your ISP pretends yo u have. For QOS to function properly it's very important important to s etup you downstream and mainly mainly ups tream max maxim imal al values properly. The correct v alues is almost almost every time even lower than t he maximum value you download/upload from internet. The explanation of this effect is quite simple. QOS works on the principle of prioritizing some packet on the packet queue. Because the interface between you Coyote(Brazil Coyote(BrazilFW) FW) router and Cable/ADSL/Modem Cable/ADSL/Modem or whatever is a lot fast er than yo ur internet connection, if you setup you u pstream/downstream speed too high, th e queue is not build at the Coyote(BrazilFW) router but at Cable modem for example and QOS does not work. Real Upstream bandwidth
Same Same as downstream bandwidth, only for upst ream values. values. We will will look look how to setup correct values later. Direct router -> inet class reserved bandwidth
How many percent of total bandwidth (Real Upstream Bandwidth) is used for connections made directly from internet to your Coyote Linux (BrazilFW) router. For example remote administration over the internet, Web server of FTP server on your Coyote Linux (BrazilFW) Priority classes reserved bandwidth
Theese are percentage values of band width reserved for priority priority classes. Ig t here is not other traffic, traffic, the band width is borrowed to lower priority priority classes. Burst settings
Burst size size is the limit limit of transfered data that can be transfered at full speed before any s haping occurs. It's goot for WWW traffic traffic which mades mades reques ts in bursts .
Setting correct Upstream/Downstream values It's the time for upstream/downstream values tweaking. First measure your free line latency. You will need your ISP's gateway address. If you don't know it run command prompt on your windows workstation and issue following command. C:\Documents and Settings\Dolly22>tracert www.google.com the output should look something like this: Tracing route to www.google.akadns.net [216.239.59.104] over a maximum of 30 hops: 1 2 3 ...
1 ms 10 ms 18 ms
<1 ms 10 ms 10 ms
<1 ms 12 ms 12 ms
coyote.sporilov.czf [192.168.0.1] ac2.mistral.cz [62.24.94.2] 1hopsem-v103.dkm.cz [62.24.68.81]
ISP's gateway address is first public ip address in you tracert list, in my case it's ac2.mistral.cz [62.24.94.2]. You can use any address from your traceroute, but the closer the better (but DO NOT use your coyote linux IP address /by default 192.168.0.1/). Now meas meas ure you r free line line laten cy with command command C:\Documents and Settings\Dolly22>ping -n 20 ac2.mistral.cz the output should look something like this: Pinging ac2.mistral.cz [62.24.94.2] with 32 bytes of data: Reply from 62.24.94.2: bytes=32 time=306ms TTL=254 Reply from 62.24.94.2: bytes=32 time=219ms TTL=254 Ping statistics for 62.24.94.2: Packets: Sent = 20, Received = 20, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 8ms, Maximum = 37ms, Average = 14ms
dol l y.czi .cz/coyote/tutor ial/q os- setup.asp
1/2
24/04/13
Classic QOS setup tutorial - Coyote Linux & BrazilFW Add-ons
Note ave rage ping v alue so mewhere. Now look at this info from wonder sha per readme, it has so me information what minimal latency y ou can expect on yo ur conn ection (when fu ll uploading with QOS enabled). Following text uses MTU term, you can read it from ifconfig output. substitute eth1 with your inet interface ... brazilfw# ifconfig eth1 eth1
Link encap:Ethernet HWaddr 00:A0:C9:C5:4B:B7 inet addr:62.245.67.193 Bcast:62.245.67.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ^^^^^^^^ ...
Now here we go ... Uplink speed | Expected latency due to upload -------------------------------------------------32 | 234ms 64 | 117ms 128 | 58ms 256 | 29ms So to calculate your effective latency, take a baseline measurement (ping on an unloaded link), and look up the number in the table, and add it. That is about the best you can expect. This boils down to: mtu * 0.5 * 10 -------------kbit
+ baseline_latency
The factor 10 is not quite correct but works well in practice.
Count your theoretical mimimal latency and we can start with tweaking. Full up your internet upstream with some transfer (upload to fast ftp server, ...), open command line on your windows workstation and start command ping -t ac2.mistral.cz ^^^^ substitute with your ISP's gateway output of this command look like this (it goes on forever :)) ... ... Reply Reply Reply Reply Reply ...
from from from from from
62.24.64.4: 62.24.64.4: 62.24.64.4: 62.24.64.4: 62.24.64.4:
bytes=32 bytes=32 bytes=32 bytes=32 bytes=32
time=159ms time=179ms time=347ms time=283ms time=329ms
TTL=62 TTL=62 TTL=62 TTL=62 TTL=62
Your ping values should be quite high now, it's becaus e you have initialized you r upstream value with true line ups tream. Now slowly lower your real upstream value and see what happens to you r pings in other window. You will have to RELOAD QOS configuration after every change. Lower the UPSTREAM value, until your pings drop s omewhere to theoreticaly computed latency value. Then free your ups tream and repeat th e same st eps for DOWNSTREAM value (fill up downstream and slowly lower DOWNSTREAM value until the pings drop down). Now save yo ur coyo te con figuration an d voila, you s hou ld have QOS set up and run ning.
dolly.czi.cz/coyote/tutorial/qos-setup.asp
2/2