RE: [Leaf-user] Traffic Shaping using TC
Hi Simon I just finished my Dachstein QoS Add-On script. I'm did a lot of "research" in this topic. I'm still developing the final .lrp package but the core script (without a package arround it) is finished. I didn't announce it because I want to finish my advanced script and the package before I publish it. My script runs only on Dachstein/Eigerstein without changes because it uses variables from /etc/network.conf to make it "Plug&Play". The script can be found at: http://leaf.sourceforge.net/devel/sminola/files/scripts/qos1.sh This script does REALLY work! Please note that this is only my already finished script for home users. There isn't any possiblity to define which traffic should be priorized, but it removes most problems like lagging SSH session while downloading or slow downloads while uploading. Please read the comments in the script for further information. You may tune the rate of the bulk class. Edit the "95" in the following line (in both sections, Upstream and Downstream) # bulk - everything that don't match tc class add dev $EXTERN_IF parent 1:1 classid 1:30 cbq rate $(( 95 * $UPLINK / 100 ))kbit allot 1600 prio 3 avpkt 1000 ^^ I noticed that decreasing this value gives you better effect. I noticed that after uploading the script and because I didn't announce it yet I didn't correct it. I recommend a value between 85 and 90. If you have any problems or questions, please let me know. You'll be my first BETA-tester... --- Sandro Minola | LEAF Developer (http://leaf.sourceforge.net) mailto:[EMAIL PROTECTED] | mailto:[EMAIL PROTECTED] http://www.minola.ch| http://leaf.sourceforge.net/devel/sminola > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Simon Bolduc > Sent: Saturday, March 23, 2002 12:16 AM > To: [EMAIL PROTECTED] > Subject: [Leaf-user] Traffic Shaping using TC > > > Well I Couldn't get cbq.init to work - possibly because of the > busybox find > command, or because I'm not "getting" something. Either way I decided to > give up that dream and look at trying to create a script that > would just use > tc. What I'd like my end result to be is to limit the outgoing bandwidth > that is used by my ftp server to 16 K/s. From what I read I > should be able > to use tc, assuming all proper modules are loaded, without having > to change > anything else. I realize that this would probably be easier if > implemented > using network.conf but as I use seawall thats not really an option. > > Here is what I've got - but I could be (and quite likely am) hopelessly > confused. > > #!/bin/sh > > tc qdisc del dev eth0 root > tc qdisc add dev eth0 root handle 10: cbq bandwidth 10mbit avpkt 1000 > tc class add dev eth0 parent 10: classid 10:1 cbq bandwidth 10mbit / > rate 128kbit allot 1514 maxburst 20 avpkt 1000 bounded prio 3 > tc filter add dev eth0 parent 10: protocol ip prio 100 u32 match / > ip dport 21 0x flowid 10:10 > > #end script > > I have no idea whether this will work - and before I throw it on my box I > figured I might as well ask - can't be any harm in asking first. > Any help > would be greatly appreciated. > > S > > > _ > Join the worlds largest e-mail service with MSN Hotmail. > http://www.hotmail.com > > > ___ > Leaf-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/leaf-user > ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
RE: [Leaf-user] Traffic Shaping using TC
Hi Simon, hi all > slow - with a default setup my ftp server went from 40-43 K/s to > 8-12 K/s. How are you connecting to your FTP server? Is this server located on your LAN, your DMZ or on the internet? You wrote that you "portforward to an internal box". Is this internal box the FTP server? If yes, where is your client then? Looks your setup like this: My client --> internet --> Leaf box which is running my script --> FTP server ? Are you always talking about KBits/s if you write "K/s"? If yes, I assume that you're using a dial-up connection!? Well, I'm not sure if my script runs well with PPP (dial-up) connections becaus of the different MTU values. Please tell me more about your setup and what exactly goes wrong, and in which direction (up- or download)? I'm sure we can fix your problems. BTW: I didn't notice ANY problems yet and I'm even running a DMZ. --- Sandro Minola | LEAF Developer (http://leaf.sourceforge.net) mailto:[EMAIL PROTECTED] | mailto:[EMAIL PROTECTED] http://www.minola.ch| http://leaf.sourceforge.net/devel/sminola > -Original Message- > From: Simon Bolduc [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 3:56 PM > To: [EMAIL PROTECTED] > Subject: RE: [Leaf-user] Traffic Shaping using TC > > > I installed the script - and certain parts work - but somethings > got really > slow - with a default setup my ftp server went from 40-43 K/s to > 8-12 K/s. > While that doesn't really concern me it is a little frustrating. I also > tried (to no avail) to add rules that would govern traffic that uses both > UDP and TCP port 412 (thats the port I'm sending from internally and > receiving to internally) which are both port forwarded to an > internal box. > This box also runs other 'net services so I can't just throw the > IP into the > filter and make it work that way. The rules I added were (just as I test > setup - I know it'd be abismally slow - but they should indicate > that I have > set things up correctly) are: > > tc class add dev $EXTERN_IF parent 1:1 classid 1:30 cbq rate 40kbit / > allot 1600 prio 3 avpkt 1000 bounded > > tc qdisc add dev $EXTERN_IF parent 1:30 handle 30: sfq perturb 10 > > tc filter add dev $EXTERN_IF parent 1:0 protocol ip prio 25 u32 match / > ip dport 0x019c 0x flowid 1:30 > > and I moved the bulk class/filter to 1:40 > > I'm afraid I may have done this on the wrong interface - and I'm not sure > whether this rule actually has to come before the high priority > class or not > as I think the first filter/class that applies to a packet is used. Also > I'm unsure of how to specify a group of ports like the passive > ones used for > ftp would be setup. Through your script I've learned a lot more about > Traffic shaping but obviously not enough. > > S > > > ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
RE: [Leaf-user] Traffic Shaping using TC
When I'm talking about 8-12 K/s I mean Kilobytes per second. My connection is Cable with 384 Kilobits /s up, and 3 Megabits/s down. The FTP client is running on another ISP entirely so it looks like: My Client -> LEAF box (no QoS) -> Internet -> DCD box (QoS running) -> Server There is no DMZ in place. So thats what the FTP looks like. The other issue is the following: I have a file sharing program (family members getting music and such) that uses both TCP and UDP ports in order to communicate. The Port that I use is 412 TCP&UDP and is forwarded to a server not in a DMZ. My main goal is to limit the sending capabilities of the program to a value that is very low so it doesn't interfere with other more important outgoing information i.e. FTP, Mail, VPN. Any ideas or help would be appreciated. S >From: "Sandro Minola" <[EMAIL PROTECTED]> >To: "Simon Bolduc" <[EMAIL PROTECTED]>, "Leaf-User" ><[EMAIL PROTECTED]> >Subject: RE: [Leaf-user] Traffic Shaping using TC >Date: Tue, 26 Mar 2002 18:04:58 +0100 > >Hi Simon, hi all > > > slow - with a default setup my ftp server went from 40-43 K/s to > > 8-12 K/s. > >How are you connecting to your FTP server? Is this server located on your >LAN, your DMZ or on the internet? >You wrote that you "portforward to an internal box". Is this internal box >the FTP server? If yes, where is your client then? >Looks your setup like this: >My client --> internet --> Leaf box which is running my script --> FTP >server >? > >Are you always talking about KBits/s if you write "K/s"? > >If yes, I assume that you're using a dial-up connection!? >Well, I'm not sure if my script runs well with PPP (dial-up) connections >becaus of the different MTU values. > >Please tell me more about your setup and what exactly goes wrong, and in >which direction (up- or download)? > >I'm sure we can fix your problems. > >BTW: I didn't notice ANY problems yet and I'm even running a DMZ. > >--- >Sandro Minola | LEAF Developer (http://leaf.sourceforge.net) >mailto:[EMAIL PROTECTED] | mailto:[EMAIL PROTECTED] >http://www.minola.ch| http://leaf.sourceforge.net/devel/sminola > > > -Original Message- > > From: Simon Bolduc [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, March 26, 2002 3:56 PM > > To: [EMAIL PROTECTED] > > Subject: RE: [Leaf-user] Traffic Shaping using TC > > > > > > I installed the script - and certain parts work - but somethings > > got really > > slow - with a default setup my ftp server went from 40-43 K/s to > > 8-12 K/s. > > While that doesn't really concern me it is a little frustrating. I also > > tried (to no avail) to add rules that would govern traffic that uses >both > > UDP and TCP port 412 (thats the port I'm sending from internally and > > receiving to internally) which are both port forwarded to an > > internal box. > > This box also runs other 'net services so I can't just throw the > > IP into the > > filter and make it work that way. The rules I added were (just as I >test > > setup - I know it'd be abismally slow - but they should indicate > > that I have > > set things up correctly) are: > > > > tc class add dev $EXTERN_IF parent 1:1 classid 1:30 cbq rate 40kbit / > > allot 1600 prio 3 avpkt 1000 bounded > > > > tc qdisc add dev $EXTERN_IF parent 1:30 handle 30: sfq perturb 10 > > > > tc filter add dev $EXTERN_IF parent 1:0 protocol ip prio 25 u32 match / > > ip dport 0x019c 0x flowid 1:30 > > > > and I moved the bulk class/filter to 1:40 > > > > I'm afraid I may have done this on the wrong interface - and I'm not >sure > > whether this rule actually has to come before the high priority > > class or not > > as I think the first filter/class that applies to a packet is used. >Also > > I'm unsure of how to specify a group of ports like the passive > > ones used for > > ftp would be setup. Through your script I've learned a lot more about > > Traffic shaping but obviously not enough. > > > > S > > > > > > > _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
RE: [Leaf-user] Traffic Shaping using TC
Hi Simon Thanks again for the modified package! Do you notice that speed decrease only when uploading to this particular FTP server? Is it ok for you if we first try to find out why FTP uploads to this (or every FTP) server gets slower and then begin to implement to "music" rule? best wishes --- Sandro Minola | LEAF Developer (http://leaf.sourceforge.net) mailto:[EMAIL PROTECTED] | mailto:[EMAIL PROTECTED] http://www.minola.ch| http://leaf.sourceforge.net/devel/sminola > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Simon Bolduc > Sent: Tuesday, March 26, 2002 6:24 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [Leaf-user] Traffic Shaping using TC > > > When I'm talking about 8-12 K/s I mean Kilobytes per second. My > connection > is Cable with 384 Kilobits /s up, and 3 Megabits/s down. The FTP > client is > running on another ISP entirely so it looks like: > > My Client -> LEAF box (no QoS) -> Internet -> DCD box (QoS running) -> > Server > > There is no DMZ in place. So thats what the FTP looks like. > > The other issue is the following: > > I have a file sharing program (family members getting music and > such) that > uses both TCP and UDP ports in order to communicate. The Port > that I use is > 412 TCP&UDP and is forwarded to a server not in a DMZ. My main > goal is to > limit the sending capabilities of the program to a value that is > very low so > it doesn't interfere with other more important outgoing information i.e. > FTP, Mail, VPN. > > Any ideas or help would be appreciated. > > S > > > >From: "Sandro Minola" <[EMAIL PROTECTED]> > >To: "Simon Bolduc" <[EMAIL PROTECTED]>, "Leaf-User" > ><[EMAIL PROTECTED]> > >Subject: RE: [Leaf-user] Traffic Shaping using TC > >Date: Tue, 26 Mar 2002 18:04:58 +0100 > > > >Hi Simon, hi all > > > > > slow - with a default setup my ftp server went from 40-43 K/s to > > > 8-12 K/s. > > > >How are you connecting to your FTP server? Is this server located on your > >LAN, your DMZ or on the internet? > >You wrote that you "portforward to an internal box". Is this internal box > >the FTP server? If yes, where is your client then? > >Looks your setup like this: > >My client --> internet --> Leaf box which is running my script --> FTP > >server > >? > > > >Are you always talking about KBits/s if you write "K/s"? > > > >If yes, I assume that you're using a dial-up connection!? > >Well, I'm not sure if my script runs well with PPP (dial-up) connections > >becaus of the different MTU values. > > > >Please tell me more about your setup and what exactly goes wrong, and in > >which direction (up- or download)? > > > >I'm sure we can fix your problems. > > > >BTW: I didn't notice ANY problems yet and I'm even running a DMZ. > > > >--- > >Sandro Minola | LEAF Developer (http://leaf.sourceforge.net) > >mailto:[EMAIL PROTECTED] | mailto:[EMAIL PROTECTED] > >http://www.minola.ch| http://leaf.sourceforge.net/devel/sminola > > > > > -Original Message- > > > From: Simon Bolduc [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, March 26, 2002 3:56 PM > > > To: [EMAIL PROTECTED] > > > Subject: RE: [Leaf-user] Traffic Shaping using TC > > > > > > > > > I installed the script - and certain parts work - but somethings > > > got really > > > slow - with a default setup my ftp server went from 40-43 K/s to > > > 8-12 K/s. > > > While that doesn't really concern me it is a little > frustrating. I also > > > tried (to no avail) to add rules that would govern traffic that uses > >both > > > UDP and TCP port 412 (thats the port I'm sending from internally and > > > receiving to internally) which are both port forwarded to an > > > internal box. > > > This box also runs other 'net services so I can't just throw the > > > IP into the > > > filter and make it work that way. The rules I added were (just as I > >test > > > setup - I know it'd be abismally slow - but they should indicate > > > that I have > > > set things up correctly) are: > > > > > > tc class add dev $EXTERN_IF parent 1:1 classid 1:30 cbq rate > 40kbit / > > > allot 1600 prio 3 avpkt 1000 bou
RE: [Leaf-user] Traffic Shaping using TC
I think the problem might have been my ISP - after messing around with the script for a day or two - and completely mangling it - I disabled the script - didn't bother checking how my FTP server was doing, but the next day everything was fine without the script. I reloaded the script and all was well. I also added my own class (to the new package as well) for the file sharing program my brother uses. It seems to work fine if someone using an active connection connects to me (throttles the bandwidth appropriatly). Unfortunatly if they are using a passive connection I can't throttle them. Here is how the application works: Port 412 is forwarded to an internal computer. With active connections it is a direct (UDP) link 412 -> 412 so I just add a rule that says if the dport is 412 slow the connection down. With passive its (TCP) port 412 -> a random port. Adding a rule with a sport of 412 doesn't work cause it kills the incoming traffic as well. Here are the rules I came up with: tc filter add dev $EXTERN_IF parent 1:0 protocol ip prio 26 u32 match \ ip dport 412 0x flowid 1:10 tc filter add dev $EXTERN_IF parent 1:0 protocol ip prio 27 u32 \ match ip src 192.168.2.200/24 6 0xff \ match ip sport 412 0x \ flowid 1:20 The above filter doesn't seem to do anything at all. Any ideas would be appreciated. The reason my flow ids are different is because the first connection uses UDP and needs to go before the UDP filter (I think). The send is 1:20 just so I could keep everything together. Thanks again Sandro S >To: "Simon Bolduc" <[EMAIL PROTECTED]>, ><[EMAIL PROTECTED]> >Subject: RE: [Leaf-user] Traffic Shaping using TC >Date: Thu, 28 Mar 2002 20:09:18 +0100 > >Hi Simon > >Thanks again for the modified package! > >Do you notice that speed decrease only when uploading to this particular >FTP >server? > >Is it ok for you if we first try to find out why FTP uploads to this (or >every FTP) server gets slower and then begin to implement to "music" rule? > >best wishes > >--- >Sandro Minola | LEAF Developer (http://leaf.sourceforge.net) >mailto:[EMAIL PROTECTED] | mailto:[EMAIL PROTECTED] >http://www.minola.ch| http://leaf.sourceforge.net/devel/sminola > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]On Behalf Of Simon Bolduc > > Sent: Tuesday, March 26, 2002 6:24 PM > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > Subject: RE: [Leaf-user] Traffic Shaping using TC > > > > > > When I'm talking about 8-12 K/s I mean Kilobytes per second. My > > connection > > is Cable with 384 Kilobits /s up, and 3 Megabits/s down. The FTP > > client is > > running on another ISP entirely so it looks like: > > > > My Client -> LEAF box (no QoS) -> Internet -> DCD box (QoS running) -> > > Server > > > > There is no DMZ in place. So thats what the FTP looks like. > > > > The other issue is the following: > > > > I have a file sharing program (family members getting music and > > such) that > > uses both TCP and UDP ports in order to communicate. The Port > > that I use is > > 412 TCP&UDP and is forwarded to a server not in a DMZ. My main > > goal is to > > limit the sending capabilities of the program to a value that is > > very low so > > it doesn't interfere with other more important outgoing information i.e. > > FTP, Mail, VPN. > > > > Any ideas or help would be appreciated. > > > > S > > > > > > >From: "Sandro Minola" <[EMAIL PROTECTED]> > > >To: "Simon Bolduc" <[EMAIL PROTECTED]>, "Leaf-User" > > ><[EMAIL PROTECTED]> > > >Subject: RE: [Leaf-user] Traffic Shaping using TC > > >Date: Tue, 26 Mar 2002 18:04:58 +0100 > > > > > >Hi Simon, hi all > > > > > > > slow - with a default setup my ftp server went from 40-43 K/s to > > > > 8-12 K/s. > > > > > >How are you connecting to your FTP server? Is this server located on >your > > >LAN, your DMZ or on the internet? > > >You wrote that you "portforward to an internal box". Is this internal >box > > >the FTP server? If yes, where is your client then? > > >Looks your setup like this: > > >My client --> internet --> Leaf box which is running my script --> FTP > > >server > > >? > > > > > >Are you always talking about KBits/s if you write "K/s"? > > > > > >If yes, I assume that you're using a dial-up connection