4

I am new to computer networking,and was reading about the topic routing.

According to my understanding,each router has a routing table associated with it. From that table it could know,which output link to choose for a particular destination, and also the distance.

If thats the case,then each router in 'Internet' has to maintain information about all other routers and hosts connected to Internet.

Since each address is 4 bytes long IPv4,each router would need atmost 17 GB of space to store the IP addresses alone (2^32*4=17179869184 Bytes =17 GB)

Is my understanding wrong ? I am not getting a clear picture of how this works.

0

2 Answers 2

5

So a couple of things - firstly, no, all routers connected to the Internet do not need the entire address space. If the device only has one connection to the Internet, they will have a default route eg: 0.0.0.0/0 pointed towards their upstream router and thats it. This represents any IP address that the router doesn't have a better route for.

Routers inside your ISP may contain the "entire" Internet routing table.

As to the second part of your question around the space required to hold the routing table - Internet routes aren't stored as individual host routes, but summary prefixes. The general rule for IPv4 Internet routes is that no ISP will advertise anything longer then a /24 (eg: a block of 255 addresses) as a single route update, and you will find that a lot of routes are aggregated even further than this (right up to /8s or 65K addresses per prefix).

Over time as the Internet grows, route-deaggregation (eg: taking a larger prefix and breaking it into smaller ones) has caused the number of required Internet routes to grow, and consequently the hardware requirements for holding the table have increased.

As of today (May 2018) there are 717,613 prefixes being advertised, which can be comfortably stored by a router with 2GB of memory with enough left to run the Router OS as well.

If you're interested, I recommend reading through https://www.cidr-report.org for up-to-date prefix counts and aggregation reports.

2

Router don't need to know every single address. Routers exchange prefixes (networks), and the ISPs generally will only advertise /24 or shorter prefixes for IPv4 (/48 or shorter for IPv6). The routing table contains prefixes, and an interface to reach each prefix. There are also opportunities to aggregate prefixes, so you only need one prefix to represent multiple consecutive prefixes that are all out the same interface. That is what a default route is: the ultimate aggregation of all possible prefixes to 0.0.0.0/0.

Remember that the traffic just needs to get to the LAN (network), and then layer-2 delivers the traffic on the LAN.

Having said that, there are many, many router that have the full Internet routing table, which is well over 600,000 routes, but those are real routers, not anything like a consumer-grade router, and, yes, they have a lot of GBs of RAM.

Business customers also have a choice:

  • A business can opt to receive the full Internet routing table from its ISPs, but that makes the most sense if the customer has multiple ISPs.
  • A business can opt to get only the routing table for its ISPs' networks, which could still be large, but not nearly the size of the full Internet routing table, but it could be multiple routing tables from multiple ISPs.
  • A business can opt to get only a default route from its ISP(s).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.