Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Help with Cisco routing table

Help with Cisco routing table

Scheduled Pinned Locked Moved IT & Infrastructure
helptutoriallearning
6 Posts 3 Posters 17 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alemangui
    wrote on last edited by
    #1

    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

    S L 2 Replies Last reply
    0
    • A 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

      S Offline
      S Offline
      Spawn Melmac
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • S Spawn Melmac

        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

        A Offline
        A Offline
        alemangui
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • A 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

          S Offline
          S Offline
          Spawn Melmac
          wrote on last edited by
          #4

          You really need to read the RFC's on the subject... specifically RFC 1918[^] and RFC 3330[^] Also RFC 1466[^] I don't mean to be cruel but you should get yourself a few books on IP and read up on the addressing before you embark on this project. P.S. Don't forget about IPv6 too.

          Alan

          A 1 Reply Last reply
          0
          • S Spawn Melmac

            You really need to read the RFC's on the subject... specifically RFC 1918[^] and RFC 3330[^] Also RFC 1466[^] I don't mean to be cruel but you should get yourself a few books on IP and read up on the addressing before you embark on this project. P.S. Don't forget about IPv6 too.

            Alan

            A Offline
            A Offline
            alemangui
            wrote on last edited by
            #5

            Thanks for the links Alan. You're right, I think my eyes might be bigger than my stomach for the moment, I will do some investigation and work before I start the project. Cheers, alemangui

            1 Reply Last reply
            0
            • A 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

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups