I’m trying to find a method for enumerating a few possible routes a packet may take on the internet, specifically counting ASes it might pass on the route.
Is this possible at all, and will I be able to collect all the necessary information to compute them offline (namely a possibly consistent snapshot of all the BGP routes)?
Writing the kind of algorithm I think you are asking about is probably not as easy as you may hope for.
The answer to whether you can calculate potential AS paths for packets is an unqualified yes. You can obtain a large picture of the internet by connecting to a BGP Looking Glass. There are a number of BGP Looking Glasses that you can connect to and pull entire BGP tables from.
Whether you can calculate a packet’s future path with any consistent degree of probability is a significantly more difficult endeavor for the following reasons:
Sample output from routeviews.org’s Cisco IOS BGP Looking Glass:
Some relevant links associated with BGP analysis…
This is a sample AS graph from bgplay that you may find interesting… This is a screenshot from a time replay of BGP path information going to NASA’s BGP Autonomous System (AS297).
EDIT:
I am a professional network engineer; coding is something I do to enhance my network engineering skills. Regarding your question about whether routeviews.org has got good data, when I was working with the development team for a large network equipment manufacturer who shall remain nameless, Routeviews.org was my defacto source of live BGP table information. Plus, I always use Routeviews when debugging internet routing issues. Their raw bgp Looking Glass data is as good as you will get for free.