(where a lot of IPs changed their AS from IANA to Digital Ocean)
A couple of minor notes regarding ASNs:
1) many IPs fall under a hierarchy of ASs where a large core-network provider (e.g. Level3) advertises a block and a second client leaf-AS advertises a sub- block. Sometimes the core AS advertises the smaller blocks though that has diminished with the CIDR route consolidation initiative. Also some ASs advertise bocks and sub-blocks. This shows up often with the CYMRU lookup data
dig +short D.C.B.A.origin.asn.cymru.com txt
and DNS will rotate the multiple advertisements, so one should sort the list by CIDR size and select the smallest block (i.e. largest CIDR "/" value). Possibly MaxMind takes care of all this in their data.
2) one can likely ignore AS changes when the IP has not changed, thus avoiding problems caused by network restructuring
3) perhaps many dynamic allocations where the IP changes to different AS can be detected by examining the AS owner identifiers and looking for a match
I agree guards are special and perhaps should not be allowed to change ASs at all without loosing the flag, maybe even should stay glued to one IP to avoid any failed client connections and the negative impact that may have on anonymity.
It seems reasonable to allow dynamic-IP middle and exit relays.
At 22:05 7/28/2015 -0400, you wrote:
A couple of minor notes regarding ASNs:
Also the AS number assigned to an IP address may legitimately vary depending on the source/observer. This is due to the relativistic nature of BGP routing. For example a Comcast address 74.95.187.105 is listed in AS 33287 by CYMRU (my preferred source), but Routeviews does not see the sub-block due to BGP aggregation and puts it in 7922.
Looking-glass servers are helpful when trying to understand AS-IP assignments, here are just two of many
http://lg.he.net http://lookingglass.level3.net/
=====
Much of the above applies equally to IPv6 except that by design, the IPv6 address space is far less fragmented and very often an AS will advertise only one and never more than a handful of address blocks.
AS does not indicate location. Live BGP AS does not necessarily indicate ownership at registrar, though any proxying effectively pools them. A relay IP shouldn't be in more than one AS at once, though it may shift around many over time.
dig doesn't really work via tor :(
tor-relays@lists.torproject.org