[LEAPSECS] Bulletin C and all that
Rob Seaman
seaman at noao.edu
Sun Jan 25 09:58:28 EST 2015
Howdy,
Since nobody objected I updated the encoding as implemented on leapsec.com to my most recent email, and batched info from all the Bulletins C (the first 9 are not online), and from all leap seconds. See below.
That format is:
Class E prefix | is_leap? flag | month count | is_neg? flag | TAI - UTC | CRC
or 1111 | F | MMMMMMMMMMM | F | LLLLLLL | CCCCCCCC (4+1+11+1+7+8 = 32)
with the various characteristics discussed previously.
Getting the codes from DNS is pretty simple:
def get_addr(host):
for res in socket.getaddrinfo(host, 0, socket.AF_INET, socket.SOCK_STREAM, 0, 0):
af, socktype, proto, canonname, sa = res
addr, port = sa
break
return addr
And looping over the names:
prefix = "leap"
for j in range(29):
host = prefix + "{0:02d}".format(j) + ".leapsec.com"
addr = get_addr(host)
print ("%30s -> %-15s -> %s" % (host, addr, dec(addr)))
(Choice of range(29) tests what happens both under and overflowing the list.)
The dec() function was hacked from PHK’s version to implement the new encoding/flags and I added validation like:
if ctest != 15:
r = "CLASS ERR"
elif crc8(j) != 0:
r = "BAD CRC"
elif (leap == 0) and (neg != 0):
r = "FLAG ERR"
elif leap_count < 10:
r = "RANGE ERR” (assumes no long sequence of negative leaps)
else:
r = “OK"
Range checking on the date should presumably be done in the calling application.
Please let me know about typos, suggestions, etc. Needless to say this remains a prototype.
Rob
—
(Display in a wide window with a fixed font)
As encoded from http://hpiers.obspm.fr/iers/bul/bulc/Leap_Second_History.dat:
YYYY MM before after encoded crc IP Decoded flags
--------------------------------------------------------------------------------
1972 1 9 10 f8000a00 f5 248.0.10.245 -> OK 1972 1 10 1 (1, 0)
1972 7 10 11 f8060b00 85 248.6.11.133 -> OK 1972 7 11 1 (1, 0)
1973 1 11 12 f80c0c00 d0 248.12.12.208 -> OK 1973 1 12 1 (1, 0)
1974 1 12 13 f8180d00 9e 248.24.13.158 -> OK 1974 1 13 1 (1, 0)
1975 1 13 14 f8240e00 4c 248.36.14.76 -> OK 1975 1 14 1 (1, 0)
1976 1 14 15 f8300f00 02 248.48.15.2 -> OK 1976 1 15 1 (1, 0)
1977 1 15 16 f83c1000 81 248.60.16.129 -> OK 1977 1 16 1 (1, 0)
1978 1 16 17 f8481100 06 248.72.17.6 -> OK 1978 1 17 1 (1, 0)
1979 1 17 18 f8541200 93 248.84.18.147 -> OK 1979 1 18 1 (1, 0)
1980 1 18 19 f8601300 9a 248.96.19.154 -> OK 1980 1 19 1 (1, 0)
1981 7 19 20 f8721400 55 248.114.20.85 -> OK 1981 7 20 1 (1, 0)
1982 7 20 21 f87e1500 81 248.126.21.129 -> OK 1982 7 21 1 (1, 0)
1983 7 21 22 f88a1600 28 248.138.22.40 -> OK 1983 7 22 1 (1, 0)
1985 7 22 23 f8a21700 80 248.162.23.128 -> OK 1985 7 23 1 (1, 0)
1988 1 23 24 f8c01800 7f 248.192.24.127 -> OK 1988 1 24 1 (1, 0)
1990 1 24 25 f8d81900 7c 248.216.25.124 -> OK 1990 1 25 1 (1, 0)
1991 1 25 26 f8e41a00 ae 248.228.26.174 -> OK 1991 1 26 1 (1, 0)
1992 7 26 27 f8f61b00 09 248.246.27.9 -> OK 1992 7 27 1 (1, 0)
1993 7 27 28 f9021c00 15 249.2.28.21 -> OK 1993 7 28 1 (1, 0)
1994 7 28 29 f90e1d00 c1 249.14.29.193 -> OK 1994 7 29 1 (1, 0)
1996 1 29 30 f9201e00 2d 249.32.30.45 -> OK 1996 1 30 1 (1, 0)
1997 7 30 31 f9321f00 8a 249.50.31.138 -> OK 1997 7 31 1 (1, 0)
1999 1 31 32 f9442000 dc 249.68.32.220 -> OK 1999 1 32 1 (1, 0)
2006 1 32 33 f9982100 e9 249.152.33.233 -> OK 2006 1 33 1 (1, 0)
2009 1 33 34 f9bc2200 a1 249.188.34.161 -> OK 2009 1 34 1 (1, 0)
2012 7 34 35 f9e62300 fe 249.230.35.254 -> OK 2012 7 35 1 (1, 0)
2015 7 35 36 fa0a2400 98 250.10.36.152 -> OK 2015 7 36 1 (1, 0)
--------------------------------------------------------------------------------
As retrieved from DNS:
bulletin-c.leapsec.com -> 250.10.36.152 -> OK 2015 7 36 1 (1, 0)
latest.leapsec.com -> 250.10.36.152 -> OK 2015 7 36 1 (1, 0)
previous.leapsec.com -> 249.230.35.254 -> OK 2012 7 35 1 (1, 0)
first.leapsec.com -> 248.0.10.245 -> OK 1972 1 10 1 (1, 0)
c00.leapsec.com -> 92.242.140.2 -> CLASS ERR
c01.leapsec.com -> 92.242.140.2 -> CLASS ERR
c02.leapsec.com -> 92.242.140.2 -> CLASS ERR
c03.leapsec.com -> 92.242.140.2 -> CLASS ERR
c04.leapsec.com -> 92.242.140.2 -> CLASS ERR
c05.leapsec.com -> 92.242.140.2 -> CLASS ERR
c06.leapsec.com -> 92.242.140.2 -> CLASS ERR
c07.leapsec.com -> 92.242.140.2 -> CLASS ERR
c08.leapsec.com -> 92.242.140.2 -> CLASS ERR
c09.leapsec.com -> 92.242.140.2 -> CLASS ERR
c10.leapsec.com -> 249.32.30.45 -> OK 1996 1 30 1 (1, 0)
c11.leapsec.com -> 241.38.30.122 -> OK 1996 7 30 0 (0, 0)
c12.leapsec.com -> 241.44.30.222 -> OK 1997 1 30 0 (0, 0)
c13.leapsec.com -> 249.50.31.138 -> OK 1997 7 31 1 (1, 0)
c14.leapsec.com -> 241.56.31.144 -> OK 1998 1 31 0 (0, 0)
c15.leapsec.com -> 241.62.31.121 -> OK 1998 7 31 0 (0, 0)
c16.leapsec.com -> 249.68.32.220 -> OK 1999 1 32 1 (1, 0)
c17.leapsec.com -> 241.74.32.253 -> OK 1999 7 32 0 (0, 0)
c18.leapsec.com -> 241.80.32.181 -> OK 2000 1 32 0 (0, 0)
c19.leapsec.com -> 241.86.32.92 -> OK 2000 7 32 0 (0, 0)
c20.leapsec.com -> 241.92.32.248 -> OK 2001 1 32 0 (0, 0)
c21.leapsec.com -> 241.98.32.204 -> OK 2001 7 32 0 (0, 0)
c22.leapsec.com -> 241.104.32.104 -> OK 2002 1 32 0 (0, 0)
c23.leapsec.com -> 241.110.32.129 -> OK 2002 7 32 0 (0, 0)
c24.leapsec.com -> 241.116.32.201 -> OK 2003 1 32 0 (0, 0)
c25.leapsec.com -> 241.122.32.86 -> OK 2003 7 32 0 (0, 0)
c26.leapsec.com -> 241.128.32.84 -> OK 2004 1 32 0 (0, 0)
c27.leapsec.com -> 241.134.32.189 -> OK 2004 7 32 0 (0, 0)
c28.leapsec.com -> 241.140.32.25 -> OK 2005 1 32 0 (0, 0)
c29.leapsec.com -> 241.146.32.106 -> OK 2005 7 32 0 (0, 0)
c30.leapsec.com -> 249.152.33.233 -> OK 2006 1 33 1 (1, 0)
c31.leapsec.com -> 241.158.33.190 -> OK 2006 7 33 0 (0, 0)
c32.leapsec.com -> 241.164.33.177 -> OK 2007 1 33 0 (0, 0)
c33.leapsec.com -> 241.170.33.46 -> OK 2007 7 33 0 (0, 0)
c34.leapsec.com -> 241.176.33.102 -> OK 2008 1 33 0 (0, 0)
c35.leapsec.com -> 241.182.33.143 -> OK 2008 7 33 0 (0, 0)
c36.leapsec.com -> 249.188.34.161 -> OK 2009 1 34 1 (1, 0)
c37.leapsec.com -> 241.194.34.165 -> OK 2009 7 34 0 (0, 0)
c38.leapsec.com -> 241.200.34.1 -> OK 2010 1 34 0 (0, 0)
c39.leapsec.com -> 241.206.34.232 -> OK 2010 7 34 0 (0, 0)
c40.leapsec.com -> 241.212.34.160 -> OK 2011 1 34 0 (0, 0)
c41.leapsec.com -> 241.218.34.63 -> OK 2011 7 34 0 (0, 0)
c42.leapsec.com -> 241.224.34.48 -> OK 2012 1 34 0 (0, 0)
c43.leapsec.com -> 249.230.35.254 -> OK 2012 7 35 1 (1, 0)
c44.leapsec.com -> 241.236.35.228 -> OK 2013 1 35 0 (0, 0)
c45.leapsec.com -> 241.242.35.151 -> OK 2013 7 35 0 (0, 0)
c46.leapsec.com -> 241.248.35.51 -> OK 2014 1 35 0 (0, 0)
c47.leapsec.com -> 241.254.35.218 -> OK 2014 7 35 0 (0, 0)
c48.leapsec.com -> 242.4.35.72 -> OK 2015 1 35 0 (0, 0)
c49.leapsec.com -> 250.10.36.152 -> OK 2015 7 36 1 (1, 0)
c50.leapsec.com -> 92.242.140.2 -> CLASS ERR
leap00.leapsec.com -> 92.242.140.2 -> CLASS ERR
leap01.leapsec.com -> 248.0.10.245 -> OK 1972 1 10 1 (1, 0)
leap02.leapsec.com -> 248.6.11.133 -> OK 1972 7 11 1 (1, 0)
leap03.leapsec.com -> 248.12.12.208 -> OK 1973 1 12 1 (1, 0)
leap04.leapsec.com -> 248.24.13.158 -> OK 1974 1 13 1 (1, 0)
leap05.leapsec.com -> 248.36.14.76 -> OK 1975 1 14 1 (1, 0)
leap06.leapsec.com -> 248.48.15.2 -> OK 1976 1 15 1 (1, 0)
leap07.leapsec.com -> 248.60.16.129 -> OK 1977 1 16 1 (1, 0)
leap08.leapsec.com -> 248.72.17.6 -> OK 1978 1 17 1 (1, 0)
leap09.leapsec.com -> 248.84.18.147 -> OK 1979 1 18 1 (1, 0)
leap10.leapsec.com -> 248.96.19.154 -> OK 1980 1 19 1 (1, 0)
leap11.leapsec.com -> 248.114.20.85 -> OK 1981 7 20 1 (1, 0)
leap12.leapsec.com -> 248.126.21.129 -> OK 1982 7 21 1 (1, 0)
leap13.leapsec.com -> 248.138.22.40 -> OK 1983 7 22 1 (1, 0)
leap14.leapsec.com -> 248.162.23.128 -> OK 1985 7 23 1 (1, 0)
leap15.leapsec.com -> 248.192.24.127 -> OK 1988 1 24 1 (1, 0)
leap16.leapsec.com -> 248.216.25.124 -> OK 1990 1 25 1 (1, 0)
leap17.leapsec.com -> 248.228.26.174 -> OK 1991 1 26 1 (1, 0)
leap18.leapsec.com -> 248.246.27.9 -> OK 1992 7 27 1 (1, 0)
leap19.leapsec.com -> 249.2.28.21 -> OK 1993 7 28 1 (1, 0)
leap20.leapsec.com -> 249.14.29.193 -> OK 1994 7 29 1 (1, 0)
leap21.leapsec.com -> 249.32.30.45 -> OK 1996 1 30 1 (1, 0)
leap22.leapsec.com -> 249.50.31.138 -> OK 1997 7 31 1 (1, 0)
leap23.leapsec.com -> 249.68.32.220 -> OK 1999 1 32 1 (1, 0)
leap24.leapsec.com -> 249.152.33.233 -> OK 2006 1 33 1 (1, 0)
leap25.leapsec.com -> 249.188.34.161 -> OK 2009 1 34 1 (1, 0)
leap26.leapsec.com -> 249.230.35.254 -> OK 2012 7 35 1 (1, 0)
leap27.leapsec.com -> 250.10.36.152 -> OK 2015 7 36 1 (1, 0)
leap28.leapsec.com -> 92.242.140.2 -> CLASS ERR
spurious.address.com -> 64.124.61.10 -> CLASS ERR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist6.pair.net/pipermail/leapsecs/attachments/20150125/de979871/attachment-0001.html>
More information about the LEAPSECS
mailing list