lartc.org : Linux Advanced Routing & Traffic Control
(Answer) (Category) lartc.org FAQ :
TC + Squid
If you have squid installed on your shaper and you want to shape the traffic, you have a problem because. Normally, you want to shape only internet traffic and objects fetched from the cache can go at full speed. But how can you tell tc the difference? Wel, you can't.


This is an other post on the lartc mailing list :

[LARTC] SQUID zero penalty for HIT traffic patch
From: "Marin Stavrev"

Hi,

I was reviewing the patch Patrick McHardy has contributed to squid QoS
features (http://trash.net/~kaber/squid-qos/), and decided to do something
similar which could classify client side traffic based on whether SQUID's
response is a cache HIT or a cache MISS. I think I got it working. I made
a quick home page for this patch, so anyone interested in trying it can
learn more here: http://www.it-academy.bg/zph/

The patch is currently working flawlessly for me and i hope it will evolve
in the near future (as it is extremely barebone by now).


Patrick hacked the squid source so you can use ACL lists to put packets in classes. He posted this hack on the lartc mailing list :

I just hacked a patch for squid 2.5-stable3 for setting classids for
connections based on the requesting src/user. The classids are set using
the SO_PRIORITY socket option (skb->priority field). Classification based
on this field needs support from the qdisc but iirc all classful qdiscs
support this.

Example:

Place all requests from 10.0.0.0/8 in class 10:100. No filters need to 
be set up.

---------
acl special_service_net src 10.0.0.0/255.255.255.0
tcp_outgoing_priority 10:100 special_service_net
---------

The patch is available at http://trash.net/~kaber/squid-qos/

Patrick

stef.coene@docum.org
[Append to This Answer]
Previous: (Answer) root qdisc - class - qdisc - filter
Next: (Answer) bit or byte ?
This document is: http://qos.dyndns.org:3389/cgi-bin/fom?file=65
[Search] [Appearance]
This is a Faq-O-Matic 2.719.