RE: [squid-users] Squid delay pools using DS/Precedence field to limit BW

From: David Wilson <>
Date: Fri, 23 Nov 2001 08:51:13 +0200

Hi Henrik,

Thanks for your reply !
So from what you are saying it's almost impossible for me to build ACL's
that can discriminate between the value's of the DS/precedence bit field ?
Unfortunately I do not need to mark packets but only read them and apply
delay pool values to them.
I wonder if looking at the source of "tc" (Linux shaper) would shed some
light on how to implement the same feature into Squid ?
I also wonder how guys that produce hardware caches manage to get it right,
like Netcache, Allot etc etc. ?

Anyone got a "Learn c in 1 week" book for me, sheez I wish I knew how this
stuff worked so I could strip it to pieces and at least make an attempt at
building the feature in ? :)

Many thanks, your help is greatly appreciated.

-----Original Message-----
From: []On Behalf Of
Henrik Nordstrom
Sent: 22 November 2001 10:01
To: David Wilson
Cc:; Squid-Users@Squid-Cache. Org
Subject: Re: [squid-users] Squid delay pools using DS/Precedence field
to limit BW

David Wilson wrote:

> I've desperately been looking for some answers for about 2 years now
> regarding setting up Squid ACL's to match on IP DS/Precedence bit fields
> that I can apply them to Squid's delay pools.
> Please have a look at my posts below if you have time.
> If you could help in anyway possible I'd really appreciate it.

The problem is maintly that there is no way for applications to get
access to the DS value for TCP traffic.

DS is signalled per packet, TCP is stream oriented, hiding the packet
details from applications.

But theoretically it should be possible to extend the TCP/IP kernel to
keep track of the first or most recent DS value seen on the TCP
connection, and implement a getsockopt() call to get access to this

UDP sockets can make use of the IP_RECVTOS message option to receive the
DS flag on each message. Theoretically this should also be possible to
use on TCP sockets for reading the value.

> Another possibility of course is that if I could get Squid not to reset
> original DS/precedence bit field I could put a Packeteer between our
> and our Squid proxy. At the moment Squid resets the original value so it
> shows up as marked with a 0, "no value" so that doesn't work to well, if
> anyone can think of a patch that well tell Squid to keep the original
> DS/Precedence bit value please let me know.

First Squid need to be able to read the value. Then setting the TOS/DS
field is trivial. The latter is already included in Squid-2.5 as a
matter of fact (see the tcp_outgoing_tos directive)

Henrik Nordström
Squid Hacler
Received on Thu Nov 22 2001 - 23:51:21 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:04:27 MST