Re: [squid-users] mapping a reply to a user request

From: Robert Collins <robertc@dont-contact.us>
Date: 23 Nov 2002 00:14:01 +1100

On Fri, 2002-11-22 at 03:23, Bilal Yousuf wrote:
> Hi, I just want to know how squid maps a reply from an origin to the
> original user request.
>
> A users request will have the IP address and port number of Squid as the
> destination address and port and its own IP address and port number as
> the source address and port.
> Squid will need to rewrite these addresses: the source IP address and
> port will be changed to that of Squid. The destination IP address and
> port will be changed to the Origin server's (if object is not in cache).
> Now, when a reply comes back to this request, the Squid will need to map
> it back to the original request and forward it to the correct user. What
> data is used to do this mapping?

Squid temporarily maps the socket that the request was sent to the
origin on to the in-memory request that was recieved from the client.
That is associated with the socket for writing back to the client.

Unlike UDP, the associations do not need to be recalculated all the
time, TCP has a stream based nature.

Rob

Received on Fri Nov 22 2002 - 07:13:24 MST

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