Sei sulla pagina 1di 2

24/04/13

Classic QOS setup tutorial - Coyote Linux & BrazilFW Add-ons

Classic QOS setup tutorial


QoS and bandwidth management | QoS documentation | QoS tutorial This tutorial shows you how to setup QOS configuration when you are using Coyote or BrazilFW init scripts. It shows you how to setup correct upstream and downstream values and contains information about other QOS 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, enforcing policies, congestion management, and fairness. Traffic shaping provides a mechanism to control the amount and volume of traffic being sent into a network (bandwidth throttling), and the rate at which the traffic is being sent (rate limiting). For this reason, traffic shaping schemes need to be implemented at the network edges to control the traffic entering the network. It also may be necessary to identify traffic flows at the ingress point (the point at which traffic enters the network) with a granularity that allows the traffic-shaping control mechanism to separate traffic into individual flows and shape them 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 describe what the configuration options meen.
Q O S init type

QOS configuration script init type. You can either use Wondershaper configuration or Coyote Linux (BrazilFW) QOS scripts configuration. This tutorial focuses on the second option. You can choose between default config and manual class config. default config - There is only one QOS class created for all computers. Use this option if you want all computers to share full bandwidth and only categorize traffic to QOS subclasses based on QOS filters (covered later). Setting QOS with this configuration type is the easyest way. For example you can tell that p2p traffic belongs to slow priority class and Voice over IP belong to high priority class. 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 configuration option you can for example setup that one computer can use maximaly 128kB downstream and the other one only 64kB.
Re al Downstre am bandwidth

Real value of your downstream bandwidth..not the value your ISP pretends you have. For QOS to function properly it's very important to setup you downstream and mainly upstream maximal values properly. The correct values is almost every time even lower than the 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(BrazilFW) router and Cable/ADSL/Modem or whatever is a lot faster than your internet connection, if you setup you upstream/downstream speed too high, the queue is not build at the Coyote(BrazilFW) router but at Cable modem for example and QOS does not work.
Re al Upstre am bandwidth

Same as downstream bandwidth, only for upstream values. We will look how to setup correct values later.
Dire ct route r -> ine t class re se rve d 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 classe s re se rve d bandwidth

Theese are percentage values of bandwidth reserved for priority classes. Ig there is not other traffic, the bandwidth is borrowed to lower priority classes.
Burst se ttings

Burst size is the limit of transfered data that can be transfered at full speed before any shaping occurs. It's goot for WWW traffic which mades requests 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 : \ D o c u m e n t sa n dS e t t i n g s \ D o l l y 2 2 > t r a c e r tw w w . g o o g l e . c o m t h eo u t p u ts h o u l dl o o ks o m e t h i n gl i k et h i s : T r a c i n gr o u t et ow w w . g o o g l e . a k a d n s . n e t[ 2 1 6 . 2 3 9 . 5 9 . 1 0 4 ] o v e ram a x i m u mo f3 0h o p s : 1 1m s 2 1 0m s 3 1 8m s . . . < 1m s 1 0m s 1 0m s < 1m s c o y o t e . s p o r i l o v . c z f[ 1 9 2 . 1 6 8 . 0 . 1 ] 1 2m s a c 2 . m i s t r a l . c z[ 6 2 . 2 4 . 9 4 . 2 ] 1 2m s 1 h o p s e m v 1 0 3 . d k m . c z[ 6 2 . 2 4 . 6 8 . 8 1 ]

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 measure your free line latency with command
C : \ D o c u m e n t sa n dS e t t i n g s \ D o l l y 2 2 > p i n gn2 0a c 2 . m i s t r a l . c z t h eo u t p u ts h o u l dl o o ks o m e t h i n gl i k et h i s : P i n g i n ga c 2 . m i s t r a l . c z[ 6 2 . 2 4 . 9 4 . 2 ]w i t h3 2b y t e so fd a t a : R e p l yf r o m6 2 . 2 4 . 9 4 . 2 :b y t e s = 3 2t i m e = 3 0 6 m sT T L = 2 5 4 R e p l yf r o m6 2 . 2 4 . 9 4 . 2 :b y t e s = 3 2t i m e = 2 1 9 m sT T L = 2 5 4 P i n gs t a t i s t i c sf o r6 2 . 2 4 . 9 4 . 2 : P a c k e t s :S e n t=2 0 ,R e c e i v e d=2 0 ,L o s t=0( 0 %l o s s ) , A p p r o x i m a t er o u n dt r i pt i m e si nm i l l i s e c o n d s : M i n i m u m=8 m s ,M a x i m u m=3 7 m s ,A v e r a g e=1 4 m s

dolly.czi.cz/coyote/tutorial/qos-setup.asp

1/2

24/04/13

Classic QOS setup tutorial - Coyote Linux & BrazilFW Add-ons

Note average ping value somewhere. Now look at this info from wonder shaper readme, it has some information what minimal latency you can expect on your connection (when full uploading with QOS enabled). Following text uses MTU term, you can read it from ifconfig output.
s u b s t i t u t ee t h 1w i t hy o u ri n e ti n t e r f a c e. . . b r a z i l f w #i f c o n f i ge t h 1 e t h 1 L i n ke n c a p : E t h e r n e t H W a d d r0 0 : A 0 : C 9 : C 5 : 4 B : B 7 i n e ta d d r : 6 2 . 2 4 5 . 6 7 . 1 9 3 B c a s t : 6 2 . 2 4 5 . 6 7 . 2 5 5 M a s k : 2 5 5 . 2 5 5 . 2 5 5 . 0 U PB R O A D C A S TR U N N I N GM U L T I C A S T M T U : 1 5 0 0 M e t r i c : 1 ^ ^ ^ ^ ^ ^ ^ ^ . . .

Now here we go ...


U p l i n ks p e e d | E x p e c t e dl a t e n c yd u et ou p l o a d 3 2 | 2 3 4 m s 6 4 | 1 1 7 m s 1 2 8 | 5 8 m s 2 5 6 | 2 9 m s

S ot oc a l c u l a t ey o u re f f e c t i v el a t e n c y ,t a k eab a s e l i n em e a s u r e m e n t( p i n go na nu n l o a d e dl i n k ) ,a n dl o o ku pt h en u m b e ri nt h et a b l e ,a n da d di t .T h a ti sa b o u tt h eb e s ty o uc a ne x p e c t .T h i sn u m b T h i sb o i l sd o w nt o : m t u*0 . 5*1 0 - +b a s e l i n e _ l a t e n c y k b i t T h ef a c t o r1 0i sn o tq u i t ec o r r e c tb u tw o r k sw e l li np r a c t i c e .

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
p i n gta c 2 . m i s t r a l . c z ^ ^ ^ ^ s u b s t i t u t ew i t hy o u rI S P ' sg a t e w a y o u t p u to ft h i sc o m m a n dl o o kl i k et h i s( i tg o e so nf o r e v e r: ) ). . . . . . R e p l yf r o m6 2 . 2 4 . 6 4 . 4 :b y t e s = 3 2t i m e = 1 5 9 m sT T L = 6 2 R e p l yf r o m6 2 . 2 4 . 6 4 . 4 :b y t e s = 3 2t i m e = 1 7 9 m sT T L = 6 2 R e p l yf r o m6 2 . 2 4 . 6 4 . 4 :b y t e s = 3 2t i m e = 3 4 7 m sT T L = 6 2 R e p l yf r o m6 2 . 2 4 . 6 4 . 4 :b y t e s = 3 2t i m e = 2 8 3 m sT T L = 6 2 R e p l yf r o m6 2 . 2 4 . 6 4 . 4 :b y t e s = 3 2t i m e = 3 2 9 m sT T L = 6 2 . . .

Your ping values should be quite high now, it's because you have initialized your upstream value with true line upstream. Now slowly lower your real upstream value and see what happens to your pings in other window. You will have to RELOAD QOS configuration after every change. Lower the UPSTREAM value, until your pings drop somewhere to theoreticaly computed latency value. Then free your upstream and repeat the same steps for DOWNSTREAM value (fill up downstream and slowly lower DOWNSTREAM value until the pings drop down). Now save your coyote configuration and voila, you should have QOS set up and running.

dolly.czi.cz/coyote/tutorial/qos-setup.asp

2/2

Potrebbero piacerti anche