[LARTC] newbie question - how to downgrade ftp-data traffic

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



   I'm new to the list and to traffic shaping, however I understand the
idea behind it I believe.  My home computer is connected via DSL.  I
run an ftp server and I have a home network behind the machine so that
it acts as the router/gateway for that network.
   I get a lot of ftp traffic, sometimes so much that traffic from the
home network is too slow to be useful.  What is the easiest way to give
all other traffic priority over ftp-data traffic so that it doesn't eat
up all my bandwidth and starve my wife's web browsing?  Here is what I
have tried:

I have tried to use iptables to change the TOS bits such that traffic
other than that to port 20 is given priority:

$IPTABLES -A PREROUTING -t mangle -p tcp --sport ! 20 \
          -j TOS --set-tos Minimize-Delay

or 

$IPTABLES -A OUTPUT -t mangle -p tcp --sport ! 20 \
          -j TOS --set-tos Minimize-Delay

However, this does not seem to have the desired effect (I have looked
at the packets with ethereal (tcpdump with a GUI) but the TOS bits do
not seem to be affected in either case.

I also tried using queuing:

tc qdisc add dev eth0 root handle 1: prio
tc qdisc add dev eth0 parent 1:1 handle 10: sfq
tc qdisc add dev eth0 parent 1:2 handle 20: sfq
tc qdisc add dev eth0 parent 1:3 handle 30: sfq
tc filter add dev eth0 protocol ip parent 1: prio 0 u32 match ip dport
119 0xffff flowid 1:1

I get limited success with this approach, in this test I gave nntp
(internet news) traffic (port 119) priority but if I try something
like:

tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip sport
20 0xffff flowid 1:2

This does not seem to move ftp-data packets into the lowest priority
bin.  I'm not sure what syntax to use to move all BUT ftp-data packets
to the high priority bin or how to move only ftp-data packets into the
lower priority bin.

This is probably something stupid and easy but it's not clear to me
right now.  Any help would be greatly appreciated.  What I'm looking
for is the simplest way to give other traffic higher priority than the
traffic to/from the ftp-data port (20).  Thanks in advance and thanks
for your patience.


=====
Troy Rockwood - troyrock@rocketmail.com

I have made this letter longer than usual because I lack the time to make it shorter.  -- Blaise Pascal

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux