Re: Latency/burst problem with HTB

Linux Advanced Routing and Traffic Control

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

 



DervishD wrote:
> tc filter add dev eth0 ... ip sport 0x3000 0x3000 flowid 1:111
> tc filter add dev eth0 ... ip sport 0x4000 0x4000 flowid 1:111
> tc filter add dev eth0 ... ip sport 0x20 0xff flowid 1:111
> 
> I'm serving passive FTP only in ports from 0x3000 to 0x4fff, and
> active FTP in port 20.

Then you should use the following port numbers in your filters:

	0x3000 0xf000
	0x4000 0xf000
	20 0xffff

The first two of your filters were matching more ports than needed,
while the latter WAS NOT MATCHING YOUR ACTIVE FTP TRAFFIC AT ALL.

I suggest you read a tutorial on ip addresses and netmasks, that should
cover the basis of how bitmasks work.


> Is there any value I can tweak to make general ADSL traffic more
> responsive?

Yes, you can make another HTB class, let's call it 1:112, for ICMP
traffic (ie. ping, port unreachable...) and very small TCP packets 
(SYN, ACK, RST... all that stuff) and give it the highest priority. 
That's a good place to put interactive SSH traffic too, if you use it:

	#low-latency class
	#remember to give sibling classes different priorities, >0
	tc class add dev eth0 parent 1:11 classid 1:112 \
		htb rate 1kbit ceil 256kbit prio 0

	#small TCP packets, <64bytes
	tc filter add dev eth0 prio 2 protocol ip parent 1:0 u32 \
		match ip protocol 6 0xff \
		match u8 0x05 0x0f at 0 \
		match u16 0x0000 0xffc0 at 2 \
		flowid 1:112
		
	#ICMP
	tc filter add dev eth0 prio 2 protocol ip parent 1:0 u32 \
		match ip protocol 1 0xff \
		flowid 1:112

	#interactive SSH traffic (NOT including scp, x11 tunnels...)
	tc filter add dev eth0 prio 2 protocol ip parent 1:0 u32 \
		match ip dport 22 0xffff \
		match ip tos 0x10 0xff \
		flowid 1:112

By the way, I didn't invent all this, it's by Bert Hubert.
You should check his wondershaper script: http://lartc.org/wondershaper/


Toby

-- 
UNIX is a lever for the intellect.
			-John R. Mashey
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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