## Notable Replies

### Continue the discussion forum.networklessons.com

24 more replies

In this lesson we’ll take a look how you can configure summaries. First i’ll show you some examples how to do so in binary and then we’ll take a look at some tricks how you can do it in decimal (which is much faster).

Let’s say we want to create the most optimal summary for the following 4 networks:

- 192.168.0.0 / 24 subnet mask 255.255.255.0
- 192.168.1.0 / 24 subnet mask 255.255.255.0
- 192.168.2.0 / 24 subnet mask 255.255.255.0
- 192.168.3.0 / 24 subnet mask 255.255.255.0

Let’s convert these network addresses to binary:

192.168.0.0 | 11000000 | 10101000 | 00000000 | 00000000 |

192.168.1.0 | 11000000 | 10101000 | 00000001 | 00000000 |

192.168.2.0 | 11000000 | 10101000 | 00000010 | 00000000 |

192.168.3.0 | 11000000 | 10101000 | 00000011 | 00000000 |

Now we have to look how many bits these network addresses have in common. The first and second octets are the same, so that’s 16 bits.

Let’s zoom in on the third octet:

00000000 |

00000001 |

00000010 |

00000011 |

The first 6 bits of the third octet are the same. Now we have enough information to create our summary address.

8 + 8 + 6 = 22 bits

Our summary address will be 192.168.0.0 /22 (subnet mask 255.255.252.0).

Now you have seen how to do this in binary, let’s do it in decimal. There’s a simple trick you can use to calculate this summary.

As you can see we have 4 networks, or when we speak in ‘blocks’ it’s a block of 4. Here’s a formula you can use:

256 – number of networks = subnet mask for summary address.

For example: 256 – 4 networks = 252

The subnet mask will be 255.255.252.0

Another way to look at it is by using the CIDR notation. You know a /24 is a block of 256 addresses. Using a /23 means you have 2 x 256, and a /22 means you have 4 x 256.

Let’s look at another example. Let’s say we want to summarize the following networks:

- 172.16.0.0 / 16 subnet mask 255.255.0.0
- 172.17.0.0 / 16 subnet mask 255.255.0.0
- 172.18.0.0 / 16 subnet mask 255.255.0.0
- 172.19.0.0 / 16 subnet mask 255.255.0.0
- 172.20.0.0 / 16 subnet mask 255.255.0.0
- 172.21.0.0 / 16 subnet mask 255.255.0.0
- 172.22.0.0 / 16 subnet mask 255.255.0.0
- 172.23.0.0 / 16 subnet mask 255.255.0.0

Let’s look at it in binary first. I’ll write down the second octet since the first one is the same for all network addresses:

16 | 00010000 |

17 | 00010001 |

18 | 00010010 |

19 | 00010011 |

20 | 00010100 |

21 | 00010101 |

22 | 00010110 |

23 | 00010111 |

The first 5 bits for all these addresses are the same. The first octet had 8 similar bits so that’s 8 + 5 = 13 bits.

The summary address will be 172.16.0.0 /13 (subnet mask will be 255.248.0.0).

Calculating in binary like this works but it’s slow. Let’s use our trick for this:

256 – number of networks = subnet mask for summary address.

So that’s 256 – 8 = 248. The subnet mask will be 255.248.0.0

We can also find it by just looking at the CIDR notations:

- 172.16.0.0 /16 is one network.
- 172.16.0.0 /15 are two networks.
- 172.16.0.0 /14 are four networks.
- 172.16.0.0 /13 are eight networks.

That’s a lot faster than looking at it in binary.

I hope this example is helpful for you to create summaries. If you have any questions, feel free to leave a comment.

Copyright protected by Digiprove © 2015 Rene Molenaar You must be a member to vote

Rene,

I have a doubt, all examples that you gave are "continuos" networks and an even number of networks.

And when we have networks like below? I just can solve them with binary method. Is there another form?

172.16.10.0/24

172.16.20.0/24

172.16.30.0/24

172.16.40.0/24

172.16.50.0/24

I choosed shortest and highest networks and convert them to binary, so the summary address will be

176.16.0.0/18 a block size 64 networks. I can't solve it using CIDR notation and block size method.

Another example with an odd number of networks, I can solve it with binary method

192.168.0.0 / 24

192.168.1.0 / 24

192.168.2.0 / 24

192.168.3.0 / 24

192.168.4.0 / 24

The summary address will be 192.168.0.0/21, but when I was writing this example I saw that if I use block

size it's able solve it too. It's need always think in block size like "powers of 2".

When you have a free time, please, detail below

8 + 8 + 6 = 24 bits

Hug and thanks for yours articles. It's helping a lot

Hi Gabriel,

Good question, let's look at these examples. First one:

172.16.10.0/24

172.16.20.0/24

172.16.30.0/24

172.16.40.0/24

172.16.50.0/24

Let's do it in binary first (in case someone else reads this):

10 = 00001010

20 = 00010100

30 = 00011110

40 = 00101000

50 = 00110010

Only the first 2 bits are the same. Our CIDR notation would be 8 + 8 + 2 = 18 bits and we'll use network address 172.16.0.0.

This works but it's slow...you can do it in decimal, just remember the block sizes:

2,4,8,16,32,64,128.

Now you only have to pick a block size that fits all of the networks that you want. The only block size that fits your networks is 64 or 128. We'll try to be as specific as possible so we'll go for the 64.

Now you only have to figure out the subnet mask, just use this trick:

256 - block size = subnet mask.

So that'll be 256 - 64 = 192. The subnet mask will be 255.255.192.0. You can calculate the subnet mask back to the CIDR notation.....

255 = 8

255 = 8

192 = 2

So that's a /18.

So in short, just "pick" a block size that matches all your networks and then figure out the subnet mask and/or CIDR notation.

The other quick method to look at it is like this:

172.16.0.0/24 = 1 network

172.16.0.0/23 = 2 networks

172.16.0.0/22 = 4 networks

172.16.0.0/21 = 8 networks

172.16.0.0/20 = 16 networks

172.16.0.0/19 = 32 networks

172.16.0.0/18 = 64 networks

Now you can see that 172.16.0.0/18 is the summary that will include all those networks that you want...this is the quickest method.

Let's look at the second example:

192.168.0.0 / 24

192.168.1.0 / 24

192.168.2.0 / 24

192.168.3.0 / 24

192.168.4.0 / 24

Let's do the "block size" method first. You can choose between 2,4,8,16,32,64 or 128. 2 and 4 are too small so we'll go for 8.

256 - 8 = 248 so the subnetmask will be 255.255.248.0

255 = 8 bits

255 = 8 bits

248 = 5 bits

So the CIDR notation is /21.

The other quick method to look at this is like this:

192.168.0.0/24 = 1 network

192.168.0.0/23 = 2 networks

192.168.0.0/22 = 4 networks

192.168.0.0/21 = 8 networks.

So we'll go for 192.168.0.0/21 as our summary. This is the quickest method to find the summary address.

Hope this helps! The only thing to be aware of is that your summaries include networks that you "don't have".

Rene

Hey Rene,

I was following you example but got confused on these:

172.1.4.0/25 10101100.00000001.00000100.00000000

172.1.128.0/25 10101100.00000001.10000000.00000000

172.1.5.0/24 10101100.00000001.00000101.00000000

172.1.6.0/24 10101100.00000001.00000110.00000000

172.1.7.0/24 10101100.00000001.00000111.00000000

Particularly the 2nd one 172.1.128.0/25. Following your example using the 3rd octet has a 128 in it, so how would I factor this in as the other octets are using the first 5 bits.

thanks

James

Hi James,

Where did you find this example? It's not on this page?

Rene

Arthur,

The answer to this depends on size of the networks you are wanting to summarize and whether or not they are contiguous. For the sake of simplicity, let's say you want to summarize the following into the smallest possible summary address:

When I do subnetting, I use a mental shortcut instead of going all the way down to binary. Instead, I used exponents using the following formula

2^X >= Y

This reads as "two to the Xth power greater than or equal to Y" where Y is the number of networks (or hosts) you are trying to solve for. X is the power of two necessary so that 2 to the Xth power is greater than or equal to the number of networks in question.

In our example, we are trying to solve for 10 networks (0 - 9). What power of 2 is necessary such that two to that number is greater than or equal to 10? The answer is 4, since 2^4 = 16. This gives us a value of X=4, but what exactly is X? X represents the number of bits that must be used, in this case, to represent the 10 networks for which we are summarizing.

This means that /20 mask (255.255.240.0) is the smallest possible mask that could cover 192.168.0.0 - 192.168.9.0.

So the summary address for 10 networks would be: 192.168.0.0/20.Note that it was NOT necessary to go all the way to a /16 summary in order to create the summary.