Preface

Venkatesh Keshava Reddy is from India. He is working in the field of Internet related services for the past 6 years. You can contact him for issues concerning the TOS marking option in the ZPH series of SQUID patches.

Implementation

Mr. Reddy has modified the original ZPH patch in such a way that, SQUID can now change the TOS field in the IP header of packets containing cache hit responses to HTTP clients. Currently (as in the original patch) the actual value that is used for TOS is hardcoded in the patch, and can be changed only at compile time. The value being used is 0x10 (16 decimal), which corresponds to High Throughput (according to RFC795). You may consider changing this value, as it is common for some HTTP servers to mark the return traffic with this TOS. Alternatively you may (I recommend this approach) mangle TOS field on your ingress router(s) to appropriate values according to locally assigned policies.

INSTALL

1. Download SQUID 2.5 STABLE source (squid-2.5.STABLE7 is the latest currently supported).
2. Go to your favourite temporary directory and decompress the source:
tar -zxvf squid-2.5.STABLEX.tar.gz

or, for the bzip2 archive:

tar -jxvf squid-2.5.STABLEX.tar.bz2
3. Change to SQUID's source directory and apply the patch (check main page for info on the latest version):
cd squid-2.5.STABLEX
patch -p1 < ../squid-2.5.STABLEX-ToS_Hit.patch


How to use it

After having patched and installed SQUID, it is time to start classifying HIT packets. Here is a simple example, that sends all packets carrying TCP protocol (protocol number 6) and a TOS field of 0x10 to class 1:60. The actual class creation is irrelevant here (Check out the Linux Advanced Routing and Traffic Control for more information).

LANDEV=eth1
TC=/sbin/tc

....... class creation, other filters .....


$TC filter add dev $LANDEV parent 1:0 protocol ip prio 1 u32 \
match ip protocol 0x6 0xff \
match ip tos 0x10 0xff \
flowid 1:60

Support

If you have any questions considering the TOS version of ZPH, please contact Mr. Reddy. He has agreed to support this part of ZPH, and I believe that soon there'll be more information here.