Hi Guillaume, if it's any help...these are the responses I get from doing the lookup's from: 81.178.50.155...I looked up the responses IP's in the "City From IP" tool on dnsstuff.com:
0.ntp-pool-test.logidac.com - 81.178.50.155 - Kent, UK...ME! 1.ntp-pool-test.logidac.com - 62.4.94.155 - Unknown, Germany 2.ntp-pool-test.logidac.com - 217.107.71.7 - Izhevsk, Buryatiya 3.ntp-pool-test.logidac.com - 205.166.121.66 - San Jose, California 4.ntp-pool-test.logidac.com - 194.200.209.254 - Unknown, UK it picked the closest time source :o) oggy >>> Guillaume Filion <[EMAIL PROTECTED]> 15/04/2006 17:48 >>> Guillaume Filion a écrit : > I've been hacking together with a BGP aware DNS server for pool.ntp.org. > It has a list of servers that can answer for a particular hostname and > will return the closest one network-wise for each client. It could be > considered a poor man's ultradns. > > I've pretty rough right now, but I might be able to release a testing > version this week-end. Stay tuned. :-) Okay, let's give this a try. I've setup ntp-pool-test.logidac.com as a testing BGP-aware DNS server. So a query for 0.ntp-pool-test.logidac.com should give you the NTP server that is closest to you. 1.ntp-pool-test.logidac.com the 2nd closest, up to 4.ntp-pool-test.logidac.com. The idea is that NTP clients use 0.pool.ntp.org, 1.pool.ntp.org and 2.pool.ntp.org as their NTP servers, so that will return the three closest servers. A query for ntp-pool-test.logidac.com will give you the five closests NTP servers in random order. So pool.ntp.org would be a good choice for SNTP clients like Windows's net time. So please query 0.ntp-pool-test.logidac.com, 1.ntp-pool-test.logidac.com, etc and see what NTP server you are getting. If you know that you should be getting a closer NTP server, please send an email to me or this list with: 1) your IP address 2) the IP address that you got when querying the DNS server 3) the IP address of the NTP server that you know is closer to you. 4) if possible, traceroutes to both (bad and good) NTP servers. Of course, please post your comments, suggestions and ideas to the list. Please refrain from using ntp-pool-test.logidac.com in an actual NTP server, since I'm playing a lot with that server so you could get bad data or no data at all. == Background == BGP is the protocol for routing the whole Internet. Under BGP, the Internet is divided in Asynchronous Systems (AS). The BGP routing table gives the links betweens the different AS. This DNS server returns a server close (network-wise) to the client. It does this with the following logic: 1) Get the Asynchronous System Number (ASN) for the client. 2) If there is any server within this AS, return it. 3) Recursivly look for servers in AS adjacent to the AS of the client. This program makes the reassonable assuption that the client's DNS cache is located near the client. == Technical == The DNS server is based on pgeodns (http://geo.bitnames.com/) by Ask Bjørn Hansen. Right now, it's more of a proof of concept than a real piece of software. The DNS server needs three tables to work: - ASN Allows the software to deduce pretty fast (~5000/sec) an ASN from an IP address. The hash table key is the CIDR network and the value is the ASN. See lib/Net/BGP/ASN/Lookup.pm and tools/peers-parser.pl for the details. - Peers This table is a rough map of the BGP network. The hash table key is an ASN, the value is the list of peers for that AS. - Servers The actual list of NTP servers from pool.ntp.org. The hash table key is an ASN, the value is the list of servers in that ASN. The ASN and Peers tables are generated from a BGP dump file. Such a file can be generated from Zebra with "dump bgp routes-mrt ..." and is also available for download from RIPE (http://www.ripe.net/projects/ris/rawdata.html) and RouteViews (http://archive.routeviews.org/bgpdata/). Those three tables have last been generated last week-end, so that will be a source of inaccuraties. When I get a bit of free time I'll try to automate this so that they're regenerated every couple hours. == Source code == For the moment, the source code is available at: http://132.214.200.200/stats/bgpdns-dev4.tar.gz The tarball is 3.5 MB because it includes the three tables described above -- asn.cdb is 7.3 MB uncompressed. It should be merged with pgeodns when it gets more stable/clean. == Accuracy == By doing tests with traceroute.org, I found out that I get bad results roughtly 20% of the times. For example, my ISP Videotron is directly connected to TeleGlobe, and TeleGlobe is directly connected to a ton of networks all around the world (http://xrl.us/AS6453). So from a BGP point of view, I'm close to a ton of networks all around the world. While this may be good from a network or even a bandwidth point of view, NTP is all about latency. Latency requires both network proximity *and* physical proximity. One possible solution to this problem would be to use both BGP and GeoIP (http://www.maxmind.com/app/geoip_country) data with a scoring mechanism. For example: BGP: If the client and the server are in the same AS: $score+=100; If the AS distance between the client and the server is 1: $score+=50; If the AS distance between the client and the server is 2: $score+=25; If the AS distance between the client and the server is 3: $score+=13; If the AS distance between the client and the server is 4: $score+=7; GeoIP: If the client and the server are in the same country : $score+=50; If the client and the server are in the same continent: $score+=25; return the server with the highest score; Or something like that, of course this would be to be testing to see how well it performs in practice... Well, I think that's about it. Let me know how it works for you. Regards, GFK's -- Guillaume Filion, ing. jr Logidac Tech., Beaumont, Québec, Canada - http://logidac.com/ PGP Key and more: http://guillaume.filion.org/ _______________________________________________ timekeepers mailing list [email protected] https://fortytwo.ch/mailman/cgi-bin/listinfo/timekeepers _______________________________________________ timekeepers mailing list [email protected] https://fortytwo.ch/mailman/cgi-bin/listinfo/timekeepers
