LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2009, 07:07 AM   #1
Bogdan
Member
 
Registered: May 2001
Location: Belarus
Distribution: Debian
Posts: 120

Rep: Reputation: 15
Shaping traffic with SFQ external classifier (flow hash key dst) - no packet forward.


Hello.

I have router running Debian 5.0 Lenny x86_64 with kernel 2.6.26

Fow now, I use ESFQ patch to fairly share bandwith acress all network hosts (common SFQ depend on tcp connection number).

I'd like to use to external classifier for SFQ which was added some time ago to get rid of foreign patches in distro kernel.

Here is example of my shaper (using patched for ESFQ iproute)

Code:
/opt/sbin/tc qdisc del dev eth2 root
/opt/sbin/tc qdisc add dev eth2 root handle 1 htb default 50 r2q 10
/opt/sbin/tc class add dev eth2 parent 1: classid 1:2 htb rate 100Mbit

#Some bandwidth for SSH
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:20 htb rate 200Kbit ceil 100Mbit prio 10
/opt/sbin/tc qdisc add dev eth2 parent 1:20 handle 20 esfq perturb 10 hash dst
/opt/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip sport 22 0xffff classid 1:20

#Internet access.
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:30 htb rate 1800Kbit ceil 2Mbit prio 30
/opt/sbin/tc qdisc add dev eth2 parent 1:30 handle 30 esfq perturb 10 hash dst
/opt/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 30 fw classid 1:30

#Local provider's resources available @ADSL speed
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:40 htb rate 6Mbit ceil 8Mbit prio 40
/opt/sbin/tc qdisc add dev eth2 parent 1:40 handle 40 esfq perturb 10 hash dst
/opt/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 15 fw classid 1:40

#Traffic from DMZ, locally generated and so on...
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:50 htb rate 85Mbit ceil 100Mbit prio 50
/opt/sbin/tc qdisc add dev eth2 parent 1:50 handle 50 esfq perturb 10 hash dst
Similar (I hope) code using new classifier (using common system iproute)

Code:
/sbin/tc qdisc del dev eth2 root
/sbin/tc qdisc add dev eth2 root handle 1 htb default 50 r2q 10

/sbin/tc class add dev eth2 parent 1: classid 1:2 htb rate 100Mbit

/sbin/tc class add dev eth2 parent 1:2 classid 1:20 htb rate 200Kbit ceil 100Mbit prio 10
/sbin/tc qdisc add dev eth2 parent 1:20 handle 20 sfq
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip sport 22 0xffff classid 1:20
/sbin/tc filter add dev eth2 parent 20: protocol ip handle 20 flow hash keys nfct-dst divisor 1024

/sbin/tc class add dev eth2 parent 1:2 classid 1:30 htb rate 1800Kbit ceil 2Mbit prio 30
/sbin/tc qdisc add dev eth2 parent 1:30 handle 30: sfq
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 30 fw classid 1:30
/sbin/tc filter add dev eth2 parent 30: protocol ip handle 30 flow hash keys nfct-dst divisor 1024

/sbin/tc class add dev eth2 parent 1:2 classid 1:40 htb rate 6Mbit ceil 8Mbit prio 40
/sbin/tc qdisc add dev eth2 parent 1:40 handle 40: sfq
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 15 fw classid 1:40
/sbin/tc filter add dev eth2 parent 40: protocol ip handle 40 flow hash keys nfct-dst divisor 1024


/sbin/tc class add dev eth2 parent 1:2 classid 1:50 htb rate 85Mbit ceil 100Mbit prio 50
/sbin/tc qdisc add dev eth2 parent 1:50 handle 50: sfq
/sbin/tc filter add dev eth2 parent 50: protocol ip handle 50 flow hash keys nfct-dst divisor 1024
So code in both cases should works same, but last example stop processing packets (I even unable ping box via eth2's IP) unless I remove shaper or reboot box.

Could someone point me on my mistake - how to replace ESFQ using filter with 'flow hash key dst' ?
 
Old 05-05-2009, 05:27 PM   #2
wizard580
LQ Newbie
 
Registered: May 2009
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by Bogdan View Post
Hello.

I have router running Debian 5.0 Lenny x86_64 with kernel 2.6.26

Fow now, I use ESFQ patch to fairly share bandwith acress all network hosts (common SFQ depend on tcp connection number).

I'd like to use to external classifier for SFQ which was added some time ago to get rid of foreign patches in distro kernel.

Here is example of my shaper (using patched for ESFQ iproute)

Code:
/opt/sbin/tc qdisc del dev eth2 root
/opt/sbin/tc qdisc add dev eth2 root handle 1 htb default 50 r2q 10
/opt/sbin/tc class add dev eth2 parent 1: classid 1:2 htb rate 100Mbit

#Some bandwidth for SSH
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:20 htb rate 200Kbit ceil 100Mbit prio 10
/opt/sbin/tc qdisc add dev eth2 parent 1:20 handle 20 esfq perturb 10 hash dst
/opt/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip sport 22 0xffff classid 1:20

#Internet access.
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:30 htb rate 1800Kbit ceil 2Mbit prio 30
/opt/sbin/tc qdisc add dev eth2 parent 1:30 handle 30 esfq perturb 10 hash dst
/opt/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 30 fw classid 1:30

#Local provider's resources available @ADSL speed
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:40 htb rate 6Mbit ceil 8Mbit prio 40
/opt/sbin/tc qdisc add dev eth2 parent 1:40 handle 40 esfq perturb 10 hash dst
/opt/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 15 fw classid 1:40

#Traffic from DMZ, locally generated and so on...
/opt/sbin/tc class add dev eth2 parent 1:2 classid 1:50 htb rate 85Mbit ceil 100Mbit prio 50
/opt/sbin/tc qdisc add dev eth2 parent 1:50 handle 50 esfq perturb 10 hash dst
Similar (I hope) code using new classifier (using common system iproute)

Code:
/sbin/tc qdisc del dev eth2 root
/sbin/tc qdisc add dev eth2 root handle 1 htb default 50 r2q 10

/sbin/tc class add dev eth2 parent 1: classid 1:2 htb rate 100Mbit

/sbin/tc class add dev eth2 parent 1:2 classid 1:20 htb rate 200Kbit ceil 100Mbit prio 10
/sbin/tc qdisc add dev eth2 parent 1:20 handle 20 sfq
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip sport 22 0xffff classid 1:20
/sbin/tc filter add dev eth2 parent 20: protocol ip handle 20 flow hash keys nfct-dst divisor 1024

/sbin/tc class add dev eth2 parent 1:2 classid 1:30 htb rate 1800Kbit ceil 2Mbit prio 30
/sbin/tc qdisc add dev eth2 parent 1:30 handle 30: sfq
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 30 fw classid 1:30
/sbin/tc filter add dev eth2 parent 30: protocol ip handle 30 flow hash keys nfct-dst divisor 1024

/sbin/tc class add dev eth2 parent 1:2 classid 1:40 htb rate 6Mbit ceil 8Mbit prio 40
/sbin/tc qdisc add dev eth2 parent 1:40 handle 40: sfq
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 200 handle 15 fw classid 1:40
/sbin/tc filter add dev eth2 parent 40: protocol ip handle 40 flow hash keys nfct-dst divisor 1024


/sbin/tc class add dev eth2 parent 1:2 classid 1:50 htb rate 85Mbit ceil 100Mbit prio 50
/sbin/tc qdisc add dev eth2 parent 1:50 handle 50: sfq
/sbin/tc filter add dev eth2 parent 50: protocol ip handle 50 flow hash keys nfct-dst divisor 1024
So code in both cases should works same, but last example stop processing packets (I even unable ping box via eth2's IP) unless I remove shaper or reboot box.

Could someone point me on my mistake - how to replace ESFQ using filter with 'flow hash key dst' ?
Hi. Do you found solution?
 
Old 05-06-2009, 08:47 AM   #3
Bogdan
Member
 
Registered: May 2001
Location: Belarus
Distribution: Debian
Posts: 120

Original Poster
Rep: Reputation: 15
No. I still use ESFQ.
 
Old 05-06-2009, 11:08 PM   #4
wizard580
LQ Newbie
 
Registered: May 2009
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by Bogdan View Post
No. I still use ESFQ.
is it stable for you?
what kernel version? I now testing 2.6.28.10
 
  


Reply

Tags
shaper, tc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Set Up A Linux Layer 7 Packet Classifier On CentOS 5.1 LXer Syndicated Linux News 0 08-01-2008 07:10 PM
A question regarding traffic shaping involving tc-tbf and tc-sfq 05020241 Linux - Networking 3 06-27-2008 06:08 AM
Application Layer Packet Classifier for Linux (l7-filter) stomach Linux - Software 1 09-10-2005 01:04 AM
Traffic Shaping (by type of packet) snufferz Linux - Networking 1 06-07-2004 11:40 AM
Traffic Shaping (by type of packet) snufferz Linux - Software 0 06-07-2004 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration