Re: [squid-users] SQUID 2.4 stable mishandling socket mapping?????

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 21 Aug 2002 18:24:43 +0200

Persistent connections is identified by the host:port component of the
requested URL. If two requests have the same host:port component then they
may be sent on the same connection. Does not matter if these requests were
received from one client or different clients.

The flow is something like:

Squid has received a request from a client to a certain URL. Squid then picks
a connection to the requested server, or opens a new connection if there
isn't a connection open already. This is done based on the requested
host:port as received from the client. There is no (and should not be any per
the HTTP specifications) direct connection between client connections and
server connections.

1. Squid received a request from some client for a URL. Lets say
http://www.example.com/some/url/path

2. Squid checks if it already has a persistent connection open to the
requested server (www.example.com port 80). If no idle connection is found to
the requested server then a new connection is opened.

3. The request is forwarded to the server on the selected connection.

If you need to provide sessions ontop of HTTP then this has to be done by
other means than the TCP connection. The TCP connection is NOT a client or
server identifier in HTTP.

RFC 2616 defines connection persistance as a hop-by-hop feature, not a
end-to-end feature. The persistent connection management between a client and
a proxy is independent of the persistent connection management between a
proxy and a origin server (or peer proxy).

Regards
Henrik

Mort wrote:
> Henrick,
> Thank you for your response. I'm afraid your answer does not give me
> sufficient clarity.
> I've attached a drawing of the situation to help me and hopefully you as
> well.
>
> As the sockets in question are unique within our application space, why
> does the proxy(configured apparently as a HTTP1.0 system) consider sending
> data to different targets as supporting persistence? The data is intended
> to go to N unique app server sessions from N unique clients.
> Presuming my naivity, and that this is still how SQUID is supposed to work,
> can you suggest how I can force the result that I'm looking for?
>
> Thanks again for you patience and your sharing of your expertise.
>
> Mort Mackof
> ----- Original Message -----
> From: "Henrik Nordström" <hno@marasystems.com>
> To: "Mort" <mackof@iname.com>
> Cc: <squid-users@squid-cache.org>
> Sent: Tuesday, August 20, 2002 7:57 PM
> Subject: Re: [squid-users] SQUID 2.4 stable mishandling socket mapping?????
>
> > Yes. This is by RFC2616 (HTTP/1.1). Persistent connection management is a
> > hop-by-hop feature of the protocol, and a proxy SHOULD aggregate the
> > connections is has to make optimal use of them.
> >
> > What this means is that you cannot assume that only requests from one
> > client will be received on one TCP connection. A proxy might reuse the
> > same connection for requests from other clients. The proxy should only
> > open another TCP connection if there currently is no idle connection
> > between the proxy and the next hop in the request forwarding chain.
> >
> > Regards
> > Henrik
> >
> > On Mon, 19 Aug 2002, Mort wrote:
> > > My issue:
> > > I've client's talking to servers that work fine without going thru
> > > SQUID
>
> =
>
> > > proxy.=20
> > >
> > > Client side opens two socket connections thru Squid 2.4 stable to a =
> > > distant server.
> > > We are using HTTP 1.0 messages.
> > >
> > > On line one we get streaming data from the server. The second line is =
> > > used by the client to generate data inquiries to the server. Both lines
>
> =
>
> > > are persistent
> > >
> > > On first socket the client sends one POST after which the server sends
> > > = continuous chunked data
> > >
> > > Second socket, client sends an initial GET using Connection:
> > > keep-alive.
>
> =
>
> > > For each GET received by the server, a response of HTTP status 304 and
>
> =
>
> > > Connection: keep-alive is sent as an acknowledgment. The Client will =
> > > only send subsequent GETs after receipt of individual acknowledgements.
> > >
> > > PROBLEM:
> > > When I start up a second equivalent client thru same Squid proxy, the =
> > > POST sent on the first socket of this new client appears on second =
> > > socket of the first client and the acknowledgment sent by the server to
>
> =
>
> > > this POST appears on the first socket of this new client.
> > >
> > > Its as if squid reassigned the server side second socket
> > > belonging to the first client to the second client ??????
> > >
> > >
> > > Can anybody 1) understand this and 2) offer an explanation/cure?
> > >
> > > AGAIN THIS WORKS FINE WITHOUT THE SQUID IN THE MIDDLE !!!!
> > >
> > > Thanks
> > >
> > > Mort
Received on Wed Aug 21 2002 - 10:24:54 MDT

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