Re: [squid-users] How to mark sertain objects in the cache ?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 13 Feb 2003 02:56:46 +0100

Delian Krustev wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> > The first question to address is how to read the ToS/DS value on the
> > received traffic.
> >
> > I know how to set the ToS/DS value on traffic generated by Squid, but
> > have yet to find a method where UNIX applications can read the ToS/DS
> > value of received TCP/IP traffic (I know how to do so for UDP/IP
> > traffic, but the same method does not work for TCP/IP).
>
> Strange, tos is a part of ip header, not tcp, nor udp.

Not so strange. UDP is quite related packets so there is a hook when
receiving UDP messages where the ToS of of the message is returned
(usually from last fragment if the UDP message was too large and got
fragmented). This because IP reassembles the whole IP packet containing
the UDP message before sending it to UDP. When the application is
reading the UDP message it is infact reading the data portion of the IP
message.

TCP is not as closely related to packets.. Ontop of IP TCP collects all
data into a stream of bytes with no packet boundaries and then
practically discards the IP packet. Therefore there is no natural place
for such hook where the ToS value can be returned to the application.
The fact that things are sent as packets on the wire is not visible to
the TCP application.

> > Once that is done, forwarding the ToS/DS value on cache misses is not
> > very hard, and it should not be much of a problem to add this to the
> > object metadata either for future cache hits..
>
> That's what I'm asking for. If it's not very hard do You know how this could
> be achieved.

The MemObject is extended with one more attribute, ant the TLV
swapout/swapin functions extended to handle this new meta attribute.

Then the networking code in client_side_reply.cc is extended to
calculate the correct ToS/DS for this reply and sets it on the socket
when sending the reply using setsockopt() i think (see the code setting
ToS/DS for outgoing connections).

But first you need to solve the first problem..

Regards
Henrik
Received on Wed Feb 12 2003 - 19:27:11 MST

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