[squid-users] New Squid prefers IPv4

Alex Rousskov rousskov at measurement-factory.com
Tue Feb 6 16:39:24 UTC 2024


On 2024-02-06 10:16, Rob van der Putten wrote:
> On 05/02/2024 18:32, Antony Stone wrote:
> 
>> On Monday 05 February 2024 at 17:32:51, Rob van der Putten wrote:
>>
>>>
>>> On 05/02/2024 17:16, Dieter Bloms wrote:
>>>> On Mon, Feb 05, Rob van der Putten wrote:
>>>>> After upgrading Squid from 3 to 5 the percentage of IPv6 reduced from
>>>>> 61% to less then 1%.
>>>>> Any ideas?
>>>>
>>>> yes, since squid5 the happy eyeball algorithm as described in rfc 8305
>>>> is used.
>>>> If your ipv4 connectivity is better than ipv6 than ipv4 is used.
>>>
>>> I'm not quite sure how this is established. It prefers IPv4 even when
>>> the IPv6 ping is slightly smaller.
>>
>> 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.

If Squid sends two DNS queries, then the first DNS answer seen/processed 
by Squid will normally trigger the first (called "primary") TCP 
connection establishment attempt. A "spare" connection attempt may or 
may not happen a bit later. DNS cache and persistent connections may 
play their natural role.


>> 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.

What you see matches Squid code (and the Happy Eyeballs RFC/intent). As 
I said in my earlier response, it is easy to misinterpret Antony's 
high0-level summary. Please do not use it for low-level triage. See my 
response for details.


HTH,

Alex.



More information about the squid-users mailing list