[squid-users] New Squid prefers IPv4
Rob van der Putten
rob at sput.nl
Tue Feb 6 20:18:31 UTC 2024
Hi there
On 06/02/2024 16:24, Antony Stone wrote:
> On Tuesday 06 February 2024 at 16:16:24, Rob van der Putten wrote:
>
>>
>> On 05/02/2024 18:32, Antony Stone wrote:
>>>
>>> I believe ping (ICMP) timings are irrelevant. The client (squid in this
>>> case) does a DNS lookup for the hostname's A and AAAA records,
>>
>> A before AAAA. Bind responds within the same millisecond.
>
> I think the simultaneity of these lookups is unimportant.
>
>>> then makes two simultaneous HTTP connections to the server (one IPv4, on
>>> IPv6) and whichever one responds first *by HTTP* is then regarded as being
>>> the best way to route traffic thereafter.
>>
>> I do not see Squid opening two connections simultaneously and then
>> closing one. It's just one connection.
>
> Are you sure this is not because Squid has already made earlier connections to
> this name, decided that IPv4 is better, and continues to use that when you are
> now testing it?
>
> I would expect you to have to start from an "undecided" Squid setup (I have no
> idea where it keeps this informatin for later use, though) to find out whether
> this is what's going on.
I think i finally have figured this out.
The answer is more or less in netdb.state. I couldn't find the file
format, so I lookup it up in the source (net_db.cc). It's;
network
pings_sent
pings_recv
hops
rtt
next_ping_time
last_use_time
host name(s)
Squid does send pings. But only once per five minutes per host. Both
IPv4 and IPv6 (I checked with tcpdump). And then decides on the ping
results. At least, that's what the contents of netdb.state suggests.
Regards,
Rob
More information about the squid-users
mailing list