Route Summarization

We often take network routing for granted, but in an instance, it could bring down the whole of the Internet. Along with IP, TCP, Ethernet…

Photo by Stephen Monroe on Unsplash

Route Summarization

We often take network routing for granted, but in an instance, it could bring down the whole of the Internet. Along with IP, TCP, Ethernet and ARP, it was the thing that allowed the Internet to scale up. With this, I can turn my computer on, and almost instantly it can be part of the Internet and discovered if required. Without routing we would need a large database of look-up addresses, and every time you connected you would have to make sure that you had your IP and MAC address registered so that others could find you. A horrible little protocol called ARP does the magic within your local network — everything between you and the network gateway — so that you can be discovered when you are on- or off-line. But when routing goes, such as in the recent Cloudflare outage, it can have serious implications and can take out large-scale infrastructures.

So how do gateways and routers actually know how to find their way to the destination. Well, they often are configured with the places that they know about — typically the networks that they connect to, and for local traffic — and then just send anything they don’t know about to a default router, who they hope will know. And these routers, too, intercommunicate and pass on new information about networks that they have discovered, and the best way to get to them.

“Pick me”, they might say to another device. This all seems a bit of a nightmare for security — and it is — as Eve could create a routing service and route all the network packets through — while examining each of them. And so, the Internet is not actually designed the way we intended it, and where you could take alternative paths for data packets. Overall it is fairly structured, and this structure simplifies the complex task of providing routes. We thus often summarize the routes, in order that a router does not have to store all the possible route in its running memory.

Route Summarization is one of the more challenging areas of networking, so I thought I would outline my calculator, in order that you can check your solutions. The key thing is to determine the bits that are common in the bit sequences (starting from the left-hand side). All the examples given here are included on this Web page.

Example 1

For example: 172.16.128.0–172.16.159.255 gives:

10101100.00010000.10000000.00000000 (172.16.128.0)
10101100.00010000.10000001.00000000 (172.16.129.0)
10101100.00010000.10000010.00000000 (172.16.130.0)
...
10101100.00010000.10011111.11111111 (172.16.159.255)

where the common part is:

10101100.00010000.100

where 10101100 is 172 where 00010000 is 16 where 100xxxxx is 128 which gives: 172.16.128.0 and since we using 19 bits (8+8+3) to give a route summarization of: 172.16.128.0/19

Example 2

For example: 192.168.98.0 192.168.99.0 192.168.100.0 192.168.101.0 192.168.102.0 192.168.105.0 we get:

11000000.10101000.01100010.00000000 (192.168.98.0)
11000000.10101000.01100011.00000000 (192.168.99.0)
11000000.10101000.01100100.00000000 (192.168.100.0)
11000000.10101000.01100101.00000000 (192.168.101.0)
11000000.10101000.01100110.00000000 (192.168.102.0)
11000000.10101000.01101001.00000000 (192.168.105.0)

We can see that the first part is common to all the bit sequences: 11000000.10101000.0110 where 1100 0000 is 192 where 1010 1000 is 168 where 0110 0xxx is 96 giving: 192.168.96.0 and we have 20 bits shared, thus the result is 192.168.96.0/20

Example 3

In this example we have: 172.1.4.0 172.1.4.128 172.1.5.0 172.1.6.0 172.1.7.0 which gives:

10101100.00000001.00000100.00000000 (172.1.4.0)
10101100.00000001.00000100.10000000 (172.1.4.128)
10101100.00000001.00000101.00000000 (172.1.5.0)
10101100.00000001.00000110.00000000 (172.1.6.0)
10101100.00000001.00000111.00000000 (172.1.7.0)

which gives a common part of:

10101100.00000001.000001

where 10101100 is 174 where 00000001 is 1 where 000001xx is 4 which gives 174.1.4.0 and we have used 22 common bits to give: 172.1.4.0/22

Example 4

For example: 100.16.0.0 100.17.0.0 100.18.0.0 100.19.0.0 which gives:

01100100.00010000.00000000.00000000 (100.16.0.0)
01100100.00010001.00000000.00000000 (100.17.0.0)
01100100.00010010.00000000.00000000 (100.18.0.0)
01100100.00010011.00000000.00000000 (100.19.0.0)

The common part is:

01100100.000100

Where 01100100 is 100 Where 000100xx is 16 to give: 100.16.0.0/14

Other examples

There are other examples at: http://www.asecuritysite.com/IP/routesum

Examples:

  • 192.168.128.0–192.168.159.0 [Link]
  • 172.16.0.0–172.31.255.255 [Link]
  • 172.16.128.0–172.16.159.255 [Link]
  • 100.16.0.0 100.17.0.0 100.18.0.0 100.19.0.0 [Link]
  • 172.16.50.0 172.16.60.0 172.16.70.0 172.16.80.0 172.16.90.0 172.16.100.0 172.16.110.0 172.16.120.0 [Link]
  • 10.1.0.0 10.1.1.0 10.1.2.0 10.1.3.0 10.1.4.0 10.1.5.0 10.1.6.0 10.1.7.0 [Link]
  • 172.16.8.0 172.16.9.0 172.16.10.0 172.16.11.0 172.16.12.0 172.16.13.0 172.16.14.0 172.16.15.0 gives 172.16.8.0 /21 [Link][Check]
  • 72.16.50.0 72.16.60.0 72.16.70.0 72.16.80.0 72.16.90.0 72.16.100.0 72.16.110.0 72.16.120.0 gives 72.16.0.0/17 [Link][Check]
  • 172.16.12.0 172.16.13.0 172.16.14.0 172.16.15.0 gives 72.16.0.0/17 [Link][Check]
  • 172.16.0.1–172.31.1.1 gives 172.16.0.0/12 [Link][Check]
  • 192.168.0.0 192.168.1.0 192.168.2.0 192.168.3.0 gives gives 192.168.0.0/22 [Link][Check]
  • 10.1.138.0 10.1.138.64 10.1.138.32 gives gives 10.1.138.0/25 [Link][Check]

Conclusions

Did you follow that? If so, now take some tests: