[LARTC] Where to assign weights to different flows?
Dear all, I'm really a newbie in using 'tc's class and qdisc concepts. I have a question, for example, when I want to use SFQ, how to assign different weights to different flows? I mean, is there a parameter to be set **in SFQ** to allow some flows to get more bandwidth than others? -- Best Regards, Franklin ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Where to assign weights to different flows?
i think that what you are looking for is htb or prio ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] please guide me ...with regard to multipath dynamic routing in case of link failure
Hi, There's some very silly mistake i've done in my configuration. I did by reading material on web. I'm enclosing my configuration script below. The problem is its not routing the trafic from other interface in case the first interface is downwhich should be the wright case. Kindly please guide me what i can do to make it work..dynamically.. Also there is a very common situation which many of you might have face...the interface which is gateway for my device is my local router interface...and there's almost no chance of that's being down ever...How can one configure ip route to consider the ISP ends IP as the gateway when deciding on link status... Thanks, Pankaj Agarwal ~The Script #!/bin/sh #script written by Pankaj Agarwal <[EMAIL PROTECTED]> #defining location of ip binary IP=/sbin/ip #flushing all the IP/Routing cache echo "removing old rules" $IP rule del prio 50 table main $IP rule del prio 201 from 61.11.104.0/24 table 201 $IP rule del prio 202 from 220.227.153.48/28 table 202 $IP rule del prio 222 table 222 echo "flushing tables" $IP route flush table 201 $IP route flush table 202 $IP route flush table 222 echo "removing tables" $IP route del table 201 $IP route del table 202 $IP route del table 222 #setting loop interface $IP link set lo up $IP addr flush dev lo $IP addr add 127.0.0.1/8 brd + dev lo #setting up the private device $IP link set eth1 up $IP addr flush dev eth1 $IP addr add 192.168.2.5/24 brd + dev eth1 $IP rule add prio 50 table main $IP route del default table main #setting up the public devices $IP link set eth0 up $IP addr flush dev eth0 $IP addr add 61.11.104.63/24 brd 61.11.104.255 dev eth0 $IP link set eth2 up $IP addr flush dev eth2 $IP addr add 220.227.153.61/28 brd 220.227.153.63 dev eth2 #configuring route $IP rule add prio 222 table 222 $IP route add default table 222 proto static nexthop via 61.11.104.1 dev eth0 weight 1 nexthop via 220.227.153.51 dev eth2 weight 3 #configuring for static routes for one connection $IP rule add prio 201 from 61.11.104.0/24 table 201 $IP route add default via 61.11.104.1 dev eth0 src 61.11.104.63 proto static table 201 $IP route append prohibit default table 201 metric 1 proto static $IP rule add prio 202 from 220.227.153.48/28 table 202 $IP route add default via 220.227.153.51 dev eth2 src 220.227.153.61 proto static table 202 $IP route append prohibit default table 202 metric 1 proto static $IP route flush cache while : ; do /bin/ping -c 1 220.227.153.51 >> /dev/null /bin/ping -c 1 61.11.104.1 >>/dev/nyll sleep 60 done ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
RE: [LARTC] Where to assign weights to different flows?
But it seems that using htb, we are actually seperating different classes the flows into different rates. And The flows are independent with each other, right? For example: by seperating HTTP and FTP flows into two classes, we can assign different rates for them. But how about treating every HTTP flow differently, i.e. by assigning them different weights. BTW: Who knows how the weights are implemented in WFQ scheduling? How the weights are settled via 'tc' command? Thanks, Franklin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of pablo daniel rey Sent: Monday, February 07, 2005 7:47 PM To: LARTC@mailman.ds9a.nl Subject: Re: [LARTC] Where to assign weights to different flows? i think that what you are looking for is htb or prio ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Where to assign weights to different flows?
if you want to distinguish http flows form each other you must filter them by some criteria. the sfq treats flows equally. it doesn't have any weights assigned to the flows. you can achieve what you want by setting up some filters and assigning them to the bands of the prio qdisc something like this : tc qdisc add dev ppp0 handle 1:0 root prio tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip dport 80 flowid 1:1 -- band 0 (high priority) http tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip dport 21 flowid 1:2 -- band 1 (medium priority) ftp you can even filter the traffic by ip tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.0.1 flowid 1:1 -- band 0 hope that helps ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] [ANNOUNCE] iproute2 - 2.6.10-050207
Update to iproute2 utilities, mostly bug fixes. Only new functionality is integration of the ability to derive netem distribution table from experimental data; simple port from NISTnet. Download from http://developer.osdl.org/dev/iproute2/download/iproute2-050207.tar.gz [Mads Martin Joergensen] Don't mix address families when flushing [Jean-Marc Ranger] Need to call getline() with null for first usage Don't overwrite const arg [Stephen Hemminger] Add experimental distribution Validate classid is not too large to cause loss of bits. -- Stephen Hemminger <[EMAIL PROTECTED]> ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] multiple defaults
richard lucassen wrote: I have 1 100MB NIC with two 2MB-subnets trough a router behind it. I'd like to create multiple default classes: 1: + |\_ 1:10 default, ceiling 10kbit, rate 96000kbit | |\_ 1:11 ceiling 2048kbit, rate 2048kbit || ||\_1:110 ceiling 2048kbit, rate 1536kbit | \_1:111 ceiling 2048kbit, rate 512kbit (default subnet1) | \_ 1:12 ceiling 2048kbit, rate 2048kbit | |\_1:120 ceiling 2048kbit, rate 1536kbit \_1:121 ceiling 2048kbit, rate 512kbit (default subnet2) I want to use 1:110 for subnet1 sport 3389 I want to use 1:111 for subnet1 (the rest) I want to use 1:120 for subnet2 sport 3389 I want to use 1:121 for subnet2 (the rest) When selecting u32 match ip dst 10.106.18.0/24 \ match ip protocol 6 0xff \ match ip sport 3389 0x \ flowid 1:120 u32 match ip dst 10.106.18.0/24 \ flowid 1:121 All traffic goes to 1:121. The first filter for port 3389 is ok and works. What am I doing wrong? I'd rather do not use fw selectors. Or should I solve this problem another way? Richard. Does it work if you use the prio parameter on the tc filters with 1 for 1:120 rule and 2 for 1.121? Andy. ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Packet Level Load Balance inbound/outbound success with nth and route
Joe Nuts wrote: First of all, I'd like to thank Andy Furniss for his direction and for helping me get a working example up and running. For the following set up to work, you will need a linux computer at the ISP (server), a linux computer at the client location (client), and some a public range of IP's you plan to send down to your client. (as this configuration involves patching the linux kernel, I assume you have already downloaded it, and have previously compiled a kernel) steps to set up the linux computers are ) make sure both computers have forwarding allowed (i do this with a 'net.ipv4.ip_forward = 1' line in my /etc/sysctl.conf) download iptables source, and patch-o-matic files from netfilter.org unzip those files. run the patch-o-matic script. when you get to the 'nth' and 'ROUTE' packages, select Y. then, in the kernel config, under networking options, under netfilter configuration, under iptables support, select nth, and under packet mangling, select ROUTE. compile the kernel, reboot with new kernel. compile iptables, make && make install. even after running make install, on my system, the two iptables libraries didnt make it to /lib/iptables, so i had to copy them manually. (copy libipt_nth.so and libipt_ROUTE.so from the iptables source to /lib/iptables) now, I use GRE tunnels from the server to the client to send inbound traffic, I assume you can use any kind of tunnel, just make sure support for whatever you want to use is installed in to the kernel. for the sake of the example, IP's will be defined as follows : Local IP at client : 66.81.23.1 (eth0) DSL #1 at client : 64.20.12.46 (eth1) (64.20.12.45 is gateway) DSL #2 at client : 64.20.12.50 (eth2) (64.20.12.49 is gateway) Public IP of server : 66.80.22.30 Public IP Range sent to client : 66.81.23.0/24 the tunnels need to be set up on both the client and the server --server-- ip tunnel add client_tun1 mode gre remote 66.20.12.46 local 66.80.22.30 ttl 255 ip tunnel add client_tun2 mode gre remote 66.20.12.50 local 66.80.22.30 ttl 255 ip link set client_tun1 up ip link set client_tun2 up ip addr add 172.16.0.1/30 dev client_tun1 ip addr add 172.16.0.5/30 dev client_tun2 --client-- ip tunnel add client_tun1 mode gre remote 66.80.22.30 local 66.20.12.46 ttl 255 ip tunnel add client_tun2 mode gre remote 66.80.22.30 local 66.20.12.50 ttl 255 ip link set client_tun1 up ip link set client_tun2 up ip addr add 172.16.0.2/30 dev client_tun1 ip addr add 172.16.0.6/30 dev client_tun2 traffic outbound from the client doesnt need to go out the tunnel, but it does need to be split --client-- iptables -A POSTROUTING --source 66.81.23.0/24 -t mangle -m nth --counter 0 --every 2 --packet 0 -j ROUTE --oif eth1 --gw 64.20.12.45 iptables -A POSTROUTING --source 66.81.23.0/24 -t mangle -m nth --counter 0 --every 2 --packet 1 -j ROUTE --oif eth2 --gw 64.20.12.49 traffic inbound to the client will go to the server, and come to client through the tunnel --server-- iptables -A POSTROUTING --destination 66.81.23.0/24 -t mangle -m nth --counter 0 --every 2 --packet 0 -j ROUTE --oif client_tun1 --gw 172.16.0.2 iptables -A POSTROUTING --destination 66.81.23.0/24 -t mangle -m nth --counter 0 --every 2 --packet 1 -j ROUTE --oif client_tun2 --gw 172.16.0.6 Of course this set up can be used to divide across more than two links, just duplicate / modify the lines as needed. Computers behind the client can now be given public IP's in that range, set their gateway to 66.81.23.1, and they're up and running on both lines. I hope this helps someone like me! Sincerely, Joe Comeaux Glad you got it working and thanks for posting the solution - all credit to you for that setup - all my suggestions were untested and a bit vague, you did all the work :-) Andy. ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] ANNOUNCE: LQL# 0.8.0 and LQL 0.8.0
That's right! Yes, yes, yes. You can now control the QoS features of the Linux kernel from a high level language. LQL-Sharp provides a Mono (C#) binding to all of the methods in the LQL library. Hmm, this looks very clever! Well done. I hope that this will stimulate some interesting new gui interfaces Good luck Ed W ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] [Fwd: dummy as IMQ replacement]
Nguyen Dinh Nam wrote: The discussion about this carried on on netdev - http://marc.theaimsgroup.com/?l=linux-netdev&m=110712327422706&w=2 Andy. ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] PRIO / CBQ / HTB queue drop algorithm
[EMAIL PROTECTED] wrote: Hello all. I've been struggling to QoS VoIP at our site and have a successful implementation at this point. Basically I had to set aside enough bandwidth for VoIP by placing all other traffic behind an HTB (multiple classes and queues behind it). Everything is fine. Here's the diagram: --- | eth | --- | | PRIO | / \ 1/ 2\ - \ | PFIFO | - | VoIP | | Hier. Token Bucket | <-- throttled so it + VoIP won't overrun - -- the ethernet link (we know how many / 2|3| \ phones we have so this is possible 1/- -4\ until you get into conferencing etc) - | PFIFO | | PFIFO | - | PFIFO | | video | | inst. | | fair | |citrix | - | msgr | | SFQ | -- | bulk | - I tried using CBQ and HTB as the higher level queues, but it seems that with lending of traffic out, there is a delay (waiting for space in the queue) where packets from VoIP will get dropped until there's space. I'm guessing that the queues all use a basic tail-drop algorithm. Have I been doing something wrong? It sure would be cool to be able to provide immediate bandwidth to VoIP (and other interactive applications) while still letting those interactive traffic classes lend out bandwidth. For example, an option on PRIO that lets you specify random drop, and what bands to drop from. Thus, if a VoIP packet arrives and the queue is full, rather than dropping the VoIP packet, randomly drop a packet from the bulk traffic band of the PRIO queue. Any thoughts on this are very welcome. TIA! -Ron S. HFSC may be the best solution, but there aren't many examples/much support for it yet. You can lend out unused interactive bandwidth with HTB and keep latency low, the trick is to give interactive class much more bandwidth (rate) than it needs and make bulk classes have low rates. Give interactive prio 0 which is highest priority. Andy. ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] why fwmark don't work
saz wrote: Hi guys im trying to make a port redirecction using iproute together with iptables mangle option .. but for some strange reason is not working yet, I know i can do it in a diferent way, but the idea is using packet marking and redirect the packets with a rule. I have two computers PC1 and PC2 PC1: 192.168.0.1 this is the one connected to internet, and this machine make the redirection PC2: 192.168.0.2 this is the smtp server So this is what i do in PC1: first i mark all the packets incoming for 25 port with "1": iptables -t mangle -A PREROUTING -p tcp --dport 25 -j MARK --set-mark 1 then i create a table called smtp: echo 200 smtp >> /etc/iproute2/rt_tables after that i set PC2 as default via for my smtp table: ip route add default via 192.168.0.2 table smtp and finally i make the rule for smtp table ip rule add fwmak 1 table smtp this would have to work, but is not redirecting nothing... i can see that is making the packets with 1 using the command iptables -t mangle -L PREROUTING -v but is not working, any one can help me? I am not sure, but I think your rules will just make smtp packets try to use 192.168.0.2 as a gateway rather than whatever your normal gateway is. I guess you really need to dnat them to 192.168.0.2. using iptables. Andy. ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] How to route certain ports to other link
root linux wrote: Hi, I have one satellite link and one sdsl link. And, one LAN link. My load balancing is working great with a iptables's masquerading (no fw rules). Now, I need to route the following ports to my sdsl link: - 20, 21, 22, 25, 80, 110, 143, and 443 Whereas the others go to my satellite link. Does anyone done this before? Not me - but have a look at policy routing in the HowTo or on http://www.linux-ip.net . Andy. ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] problems with u32 fiter
[EMAIL PROTECTED] wrote: hello to all i'm trying to set a filter but doesn't want to work. i've set ut the qdiscs and the classes like this : tc qdisc add dev ppp0 root handle 1: htb default 20 tc class add dev ppp0 parent 1: classid 1:1 htb rate 120kbit tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 30kbit ceil 120kbit tc class add dev ppp0 parent 1:1 classid 1:21 htb rate 30kbit ceil 120kbit tc class add dev ppp0 parent 1:1 classid 1:22 htb rate 30kbit ceil 120kbit tc class add dev ppp0 parent 1:1 classid 1:23 htb rate 30kbit ceil 120kbit tc qdisc add dev ppp0 parent 1:20 handle 20: prio tc qdisc add dev ppp0 parent 1:21 handle 21: prio tc qdisc add dev ppp0 parent 1:22 handle 22: prio tc qdisc add dev ppp0 parent 1:23 handle 23: prio but when i try to set up the filters : tc filter add dev ppp0 parent 1:0 prio 1 u32 match ip src 192.168.0.2 flowid 1:23 tc filter add dev ppp0 parent 1:0 prio 1 u32 match ip src 192.168.2.2 flowid 1:22 tc filter add dev ppp0 parent 1:0 prio 1 u32 match ip src 192.168.0.1 flowid 1:21 you need protocol ip before u32 eg. tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip src 192.168.0.2 flowid 1:23 Andy. ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] TC GUI or graphs?
Here is a software for managing QoS (HTB) on multiple Linux system simultaneoulsy which a single remote GTK2 GUI. http://sourceforge.net/projects/rcc/ Read the INSTALL file before launching! I hope you will enjoy! Regards, Erwan Le Doeuff ___ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/