Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: test TCP connection speed and return the fastest IP #715

Closed
Zxilly opened this issue Apr 12, 2019 · 26 comments
Closed

Feature request: test TCP connection speed and return the fastest IP #715

Zxilly opened this issue Apr 12, 2019 · 26 comments

Comments

@Zxilly
Copy link

Zxilly commented Apr 12, 2019

When upstream return a DNS resolved answer,could AdGuard try to connect all the ip and give the client the IP fastest?
This is because in China the “clean” always means slow.

@ameshkov
Copy link
Member

You mean this?

@Zxilly
Copy link
Author

Zxilly commented Apr 12, 2019

You mean this?

This means the fastest result from DNS server.Sometimes,the DNS server will return serveral IP,if the AdGuard could try to connect these IP and give the fastest IP to client,the client could get the better experience

@Zxilly
Copy link
Author

Zxilly commented Apr 14, 2019

@ameshkov Any suggestion?

@ameshkov
Copy link
Member

@Zxilly I got the idea, thank you!

Marked as a feature request, let's see how many people vote for it.

Meanwhile, do you have any examples of the software that actually does it?

@Zxilly
Copy link
Author

Zxilly commented Apr 15, 2019

@ameshkov
https://github.com/pymumu/smartdns
https://github.com/zwhFocus/Installtion/tree/master/DNS-choose/dnschooser
But both are not open-source and the document is in Chinese(Maybe because only China has such terrible network environment)

@ameshkov
Copy link
Member

ameshkov commented Apr 15, 2019

What I am interested in is how exactly do they check if IP is available.

Do they send ICMP (ping) the address, or do they actually try to connect to ports 80 or 443?

@Zxilly
Copy link
Author

Zxilly commented Apr 15, 2019

@ameshkov
According to the article of the second project,it choose to make TCP connect to 80 and 443 because ICMP sometimes is not not allowed by some server.
This means it can not make effort on those applications whick are not using standard http port,but it truly improve the experience of HTTP.

@alexsannikov
Copy link

  1. Test depends on protocol (HTTP/HTTPS/TCP/UDP/etc.);
  2. ICMP may be measured, not sure about others protocols;
  3. Idea sounds good, looks like some simplified PfR (Performance Routing);
    but:
  4. Realization of the check may be difficult enough;
  5. Fastest response doesn't guarantee fastest service (back-end may be overloaded, for example);
  6. Anyway, it must be a user's choice to turn this feature on.

@ameshkov ameshkov changed the title Could AdGuard support TCP test? Feature request: test TCP connection speed and return the fastest IP Apr 22, 2019
@ameshkov
Copy link
Member

Well, let's see how many upvotes does this feature request collect.

It is doable, but it is not easy of course.

@ghost
Copy link

ghost commented Apr 25, 2019

The Project "SmartDNS" 's document in English
https://github.com/pymumu/smartdns/blob/master/ReadMe_en.md

@WhoJave
Copy link

WhoJave commented Aug 16, 2019

Sometimes, I use parallel queries, it return an IP address that have no access to it . Cause we use Chinese public DNS... Maybe you could according the GEOIP to judge which DNS Server we could use , Or give us a choice . thx

@liang-hiwin
Copy link

I also requested to increase the DNS resolution to return the fastest ip to the user, otherwise this will cause the page to open very slowly.

@ameshkov ameshkov added this to the v1.0 milestone Oct 31, 2019
@rufengsuixing
Copy link

there are some downloads use muti cdn to speedup download,block slower ip may have bad influence,if you want to use,maybe you can set smartdns as the only upstream of AdGuardHome

@QiuSimons
Copy link

Well, let's see how many upvotes does this feature request collect.

It is doable, but it is not easy of course.

SmartDNS is finally open source, can you refer to its source code? I think this will be helpful for this project.

https://github.com/pymumu/smartdns

@ameshkov ameshkov modified the milestones: v1.0, v0.103 Jan 6, 2020
@ameshkov
Copy link
Member

ameshkov commented Jan 6, 2020

@QiuSimons thank you, we'll take a look!

@ameshkov ameshkov modified the milestones: v0.103, v0.102 Feb 17, 2020
@lordraiden
Copy link

lordraiden commented Mar 24, 2020

Is smartdns functionality going to be release in 0.102?
https://github.com/pymumu/smartdns/blob/master/ReadMe_en.md

@ameshkov
Copy link
Member

Yes

@lordraiden
Copy link

lordraiden commented Mar 24, 2020

Yes

This is a huge improvement, thanks a lot.
Please try to expose as much configuration settings as possible if not all through the interface, if this is too much put it somewhere more hidden under advanced settings but still available in the UI.
https://github.com/pymumu/smartdns/blob/master/ReadMe_en.md#configuration-parameter
Probably some of them doesn't make sense or are available somewhere else.

Having as well advanced settings for the cache avaialable in the interface would be nice.
Similar to what you can see in the right side of this screenshot.
https://forum.netgate.com/assets/uploads/files/1567263869587-settings.png

adguard pushed a commit that referenced this issue Apr 22, 2020
* API: /dns_info, /dns_config: add "parallel_requests" instead of "all_servers" from /set_upstreams_config
* API: /status: removed fields

#715

Squashed commit of the following:

commit 7dd913b
Merge: 4370697 8170955
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Apr 22 19:09:36 2020 +0300

    Merge remote-tracking branch 'origin/master' into 715-fastest-addr

commit 4370697
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Apr 22 19:08:55 2020 +0300

    minor

commit 9e713df
Merge: e3bf403 9b7c118
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Tue Apr 21 16:02:03 2020 +0300

    Merge remote-tracking branch 'origin/master' into 715-fastest-addr

commit e3bf403
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Tue Apr 21 15:40:49 2020 +0300

    minor

commit d6e6a82
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Apr 17 17:56:24 2020 +0300

    * API changes

    . removed POST /set_upstreams_config
    . removed fields from GET /status: bootstrap_dns, upstream_dns, all_servers
    . added new fields to /dns_config and /dns_info

commit 237a452
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Apr 17 16:43:13 2020 +0300

    * API: /dns_info, /dns_config: add "parallel_requests" instead of "all_servers" from /set_upstreams_config

commit 9976723
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Mar 23 10:28:25 2020 +0300

    openapi

commit 6f8ea16
Merge: 36e4d4e c8285c4
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Mar 20 19:18:48 2020 +0300

    Merge remote-tracking branch 'origin/master' into 715-fastest-addr

commit 36e4d4e
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Mar 20 18:13:43 2020 +0300

    + DNS: add fastest_addr setting
@szolin szolin closed this as completed Apr 23, 2020
@sassansh
Copy link

Any benefit in using this outside of China?

@ameshkov
Copy link
Member

ameshkov commented May 15, 2020

@sassansh regardless of your location, it can improve connection quality and make it more reliable as it will make sure that the IP addresses are really reachable from your location. Just don't use it with too many resolvers, 2-3 max.

@sassansh
Copy link

@ameshkov cool! can it be used with just 1 resolver?

@ameshkov
Copy link
Member

@sassansh sure, but in this case, it will simply filter out unreachable/slow IPs from domains with multiple IPs (different CDNs and such).

@sassansh
Copy link

@ameshkov so is it best to use 2-3 resolvers when using this feature?

@sassansh
Copy link

I set it up as such:
image
We'll see how it goes...

@yegle
Copy link

yegle commented May 27, 2020

Scratching my head for a while before realizing the options "Fastest IP address" and "Parallel requests" are mutual exclusive :-(

Why not changing them to radio?

@ameshkov
Copy link
Member

Yeah, we'll make it clear in the next update:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests