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

Redirected to mirrors which are far from client computer #77

Open
Hinaser opened this issue Oct 2, 2016 · 2 comments
Open

Redirected to mirrors which are far from client computer #77

Hinaser opened this issue Oct 2, 2016 · 2 comments

Comments

@Hinaser
Copy link

Hinaser commented Oct 2, 2016

Although accessing from Japan, I am always redirected to mirrors far from Japan like Poland and Russia.
I check where I am being redirected to by http://httpredir.debian.org/demo.html

For example, the redirection demo page shows that I'm redirected to ftp.vectranet.pl.
From Japan, average ping RTT for the mirror(ftp.vectranet.pl) was over 300ms, which definitely was not proper mirror for client in Japan.

Mirror selection algorithm should be checked and modified.

@Hinaser
Copy link
Author

Hinaser commented Oct 3, 2016

I read lines of source code and found out that detailed information for redirection is included in http response header.
The information contains distance between client computer and redirecting computer calculated by longitude/latitude which also calculated by IP address for each computers.

The response header that describes wrong behavior from http://httpredir.debian.org/demo is as follows:

HTTP/1.1 200 OK
Date: Mon, 03 Oct 2016 05:15:48 GMT
Server: Apache
Cache-Control: no-cache
Pragma: no-cache
Link: <http://giano.com.dist.unige.it/debian/>; rel=duplicate; pri=13948; depth=0, <http://ftp.cz.debian.org/debian/>; rel=duplicate; pri=13968; depth=0, <http://debian.ethz.ch/debian/>; rel=duplicate; pri=14283; depth=0
X-AS: 4713
X-City: Setagaya
X-Closest-Distance: 139.4834
X-Continent: AS
X-Country: JP
X-Distance: 142.8334
X-IP: 61.126.xxx.xxx
X-Match-Type: nearby-continent
X-Population: 8
X-Region: 40
X-Std-Dev: 4.58363229328008
X-Clacks-Overhead: GNU Terry Pratchett
Transfer-Encoding: chunked
Connection: Keep-Alive

When requested the demo page again after tens of minutes, I got correct response from the server as follows:

HTTP/1.1 200 OK
Date: Mon, 03 Oct 2016 05:45:34 GMT
Server: Apache
Cache-Control: no-cache
Pragma: no-cache
Link: <http://debian-mirror.sakura.ne.jp/debian/>; rel=duplicate; pri=10; depth=0
X-AS: 4713
X-City: Setagaya
X-Closest-Distance: 0.0966999999999913
X-Continent: AS
X-Country: JP
X-Distance: 0.0966999999999913
X-IP: 61.126.xxx.xxx
X-Match-Type: country
X-Population: 1
X-Region: 40
X-Std-Dev: 0
X-Clacks-Overhead: GNU Terry Pratchett
Transfer-Encoding: chunked
Connection: Keep-Alive

Comparing X-Closest-Distance in correct/incorrect response header shows the difference.

@Hinaser
Copy link
Author

Hinaser commented Oct 3, 2016

Maybe I've found out root cause of this issue.

There are 2 servers representing httpredir.debian.org .

appuser@debian-8:~$ nslookup httpredir.debian.org
Server:         10.0.2.3
Address:        10.0.2.3#53

Non-authoritative answer:
Name:   httpredir.debian.org
Address: 128.31.0.66
Name:   httpredir.debian.org
Address: 5.153.231.35

For the server whose ip is 5.153.231.35 always returns correct mirrors while the server of 128.31.0.66 always return incorrect mirrors.

I looked up those IP addresses in GeoIP and found that the server of 128.31.0.66 is managed by MIT.

IP Country Location Organization Domain
128.31.0.66 US Cambridge, North America Massachusetts Institute of Technology mit.edu
5.153.231.35 GB Great Britain, Europe Bytemark Limited debian.org

So I need to tell to the right persons that ./update.sh && ./build-main-db.pl should be run to update database of mirrors to the latest version.

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

No branches or pull requests

1 participant