Help with Cisco routing table
-
Hello everyone, I am an IT student, and a beginner in networking issues. As a project, I want to develop a program to know the percentage of all routed IPv4 addresses by country. What I have so far is a class that maps IPv4 addesses to their country. I downloaded a Cisco format Internet routing table from RouteViews project site (http://www.routeviews.org) which is like an output of the "show ip bgp" command, and successfully extracted every BGP prefix, calculated the amount of addresses it had (depending on the mask) and added that number to the country to where it belongs. The problem is that I got as a result ridiculously enormous numbers. I saw that, in the routing table I downloaded, there are some "redundancies", for example, addresses 4.0.0.0/9, 4.0.0.0, 4.21.103.0/24, etc etc where al advertised individually. I realised I was counting the same IPv4 addresses many times, by adding those of 4.0.0.0/8 and 4.0.0.0/9 and 4.21.103.0/24 despite being most the same. So I am a little stuck here. I wonder if there is another way to see the routed addresses in the IPv4 world, or if there is an approach I should take towards analising the Internet routing table. I would greatly appreciate any help and want to thank you very much in advance. Cheers alemangui
-
Hello everyone, I am an IT student, and a beginner in networking issues. As a project, I want to develop a program to know the percentage of all routed IPv4 addresses by country. What I have so far is a class that maps IPv4 addesses to their country. I downloaded a Cisco format Internet routing table from RouteViews project site (http://www.routeviews.org) which is like an output of the "show ip bgp" command, and successfully extracted every BGP prefix, calculated the amount of addresses it had (depending on the mask) and added that number to the country to where it belongs. The problem is that I got as a result ridiculously enormous numbers. I saw that, in the routing table I downloaded, there are some "redundancies", for example, addresses 4.0.0.0/9, 4.0.0.0, 4.21.103.0/24, etc etc where al advertised individually. I realised I was counting the same IPv4 addresses many times, by adding those of 4.0.0.0/8 and 4.0.0.0/9 and 4.21.103.0/24 despite being most the same. So I am a little stuck here. I wonder if there is another way to see the routed addresses in the IPv4 world, or if there is an approach I should take towards analising the Internet routing table. I would greatly appreciate any help and want to thank you very much in advance. Cheers alemangui
WOW! Sorry chap but I really think you are biting more than you can chew here. To walk through each subnet on the Internet is time consuming, dangerous (i.e. your ISP will think you are a hacker) and frankly pointless. Let me try to explain why. IP addresses are assigned by IANA (http://www.iana.com/numbers/[^]) via regional authorities which you can see listed on the link I have included. So if you want to know what IP addresses go to which country just ask IANA via RIPE, ARIN etc... Not sure I exactly understand what it is you want to achieve, other than a list of IP addresses/country, but if you wanted to refocus your efforts then you could look at creating your own WHOIS application. It is not new, there are thousands out there already, but it would prove a useful excercise. Have a look at http://whois.domaintools.com/[^] Hope it helps a little.
Alan
-
WOW! Sorry chap but I really think you are biting more than you can chew here. To walk through each subnet on the Internet is time consuming, dangerous (i.e. your ISP will think you are a hacker) and frankly pointless. Let me try to explain why. IP addresses are assigned by IANA (http://www.iana.com/numbers/[^]) via regional authorities which you can see listed on the link I have included. So if you want to know what IP addresses go to which country just ask IANA via RIPE, ARIN etc... Not sure I exactly understand what it is you want to achieve, other than a list of IP addresses/country, but if you wanted to refocus your efforts then you could look at creating your own WHOIS application. It is not new, there are thousands out there already, but it would prove a useful excercise. Have a look at http://whois.domaintools.com/[^] Hope it helps a little.
Alan
Hi Alan, Thanks a lot for your reply. I took a look to the links you sent me. I guess my main goal is to create a program able to analize the whole Internet's BGP table. My main issue is that, sometimes, big chunks of IPv4 space are announced (i.e., 172.16.0.0/16), but also more specific and smaller routes are announced too (i.e., 172.16.64.0/18). So there are two redundant entries :confused:. I would like to figure out a way to end up with a list of non-redundant IP addresses, just the big chunks. I am thinking of maybe comparing all of them and storing them in a list, however, with a nearly-6-million line BGP table, I wonder if there's a more efficient method. Thanks a lot for all your help, alemangui
-
Hi Alan, Thanks a lot for your reply. I took a look to the links you sent me. I guess my main goal is to create a program able to analize the whole Internet's BGP table. My main issue is that, sometimes, big chunks of IPv4 space are announced (i.e., 172.16.0.0/16), but also more specific and smaller routes are announced too (i.e., 172.16.64.0/18). So there are two redundant entries :confused:. I would like to figure out a way to end up with a list of non-redundant IP addresses, just the big chunks. I am thinking of maybe comparing all of them and storing them in a list, however, with a nearly-6-million line BGP table, I wonder if there's a more efficient method. Thanks a lot for all your help, alemangui
-
-
Hello everyone, I am an IT student, and a beginner in networking issues. As a project, I want to develop a program to know the percentage of all routed IPv4 addresses by country. What I have so far is a class that maps IPv4 addesses to their country. I downloaded a Cisco format Internet routing table from RouteViews project site (http://www.routeviews.org) which is like an output of the "show ip bgp" command, and successfully extracted every BGP prefix, calculated the amount of addresses it had (depending on the mask) and added that number to the country to where it belongs. The problem is that I got as a result ridiculously enormous numbers. I saw that, in the routing table I downloaded, there are some "redundancies", for example, addresses 4.0.0.0/9, 4.0.0.0, 4.21.103.0/24, etc etc where al advertised individually. I realised I was counting the same IPv4 addresses many times, by adding those of 4.0.0.0/8 and 4.0.0.0/9 and 4.21.103.0/24 despite being most the same. So I am a little stuck here. I wonder if there is another way to see the routed addresses in the IPv4 world, or if there is an approach I should take towards analising the Internet routing table. I would greatly appreciate any help and want to thank you very much in advance. Cheers alemangui
alemangui wrote:
I realised I was counting the same IPv4 addresses many times, by adding those of 4.0.0.0/8 and 4.0.0.0/9 and 4.21.103.0/24 despite being most the same. So I am a little stuck here. I wonder if there is another way to see the routed addresses in the IPv4 world, or if there is an approach I should take towards analising the Internet routing table.
I would recommend converting the IP address range into a DWORD integer range. This will allow you to perform numeric comparisons on the address ranges. For example: In your example you find both the 4.0.0.0/8 and 4.21.103.0/24 ranges. Lets convert them to DWORD ranges and check for overlap. [4.0.0.0/8] 4.0.0.0 == 67108864 4.255.255.255 == 83886079 [4.21.103.0/24] 4.21.103.0 == 68511488 4.21.103.255 == 68511743 You can easily see that 68511488 is greater than 67108864 and 68511743 is less than 83886079. So the 4.21.103.0/24 address range can be identified as a redundancy and therefore be eliminated. Best Wishes, -David Delaune