Skip to content

Commit 037a3d0

Browse files
authored
Update README.md
1 parent 442aa92 commit 037a3d0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# fast_ip2as
2-
Fast and accurate ip2as.
2+
Fast Mapping database generation and ip-to-AS mapping.
33

44
The ip2as mapping is accomplished by pyasn (https://github.com/hadiasghari/pyasn.git).
55

66
In this repository, we just provide a faster and more convenient way to obtain the mapping database. We use the routeviews Prefix-to-AS mappings (pfx2as) for IPv4 and IPv6 provided by CAIDA to generate the database.
77

88
You can download the pfx2as files from https://publicdata.caida.org/datasets/routing/routeviews-prefix2as/
99

10-
Steps:
10+
# Steps:
1111

1212
1. install
1313
pip install pyasn
1414
2. Download pfx2as file from CAIDA
1515
3. Generate the mapping db file
1616
4. Usage
1717

18-
import pyasn
19-
20-
asndb = pyasn.pyasn('ipasn.dat')
21-
22-
asndb.lookup('8.8.8.8') # should return: (15169, '8.8.8.0/24'), the origin AS, and the BGP prefix it matches
23-
24-
asndb.get_as_prefixes(1128) # returns ['130.161.0.0/16', '131.180.0.0/16', '145.94.0.0/16'], TU-Delft prefixes
18+
import pyasn
19+
20+
asndb = pyasn.pyasn('ipasn.dat')
21+
22+
asndb.lookup('8.8.8.8') # should return: (15169, '8.8.8.0/24'), the origin AS, and the BGP prefix it matches
23+
24+
asndb.get_as_prefixes(1128) # returns ['130.161.0.0/16', '131.180.0.0/16', '145.94.0.0/16'], TU-Delft prefixes
2525

0 commit comments

Comments
 (0)