What is subnetting? Subnetting is dividing a network into two or more sub networks. Each L2 network needs its own prefix. If you need to route more than one network then you need to divide your prefix allocation. The rule is basically to ensure that each prefix has enough IPs for the number of hosts on that network. A typical example is your campus network design: you would get an allocation from your original internet registry, you would typically take this prefix, a location, and divide it into different prefixes among your different campuses or buildings. As shown on the screen you have an end user allocation that you would like to divide into three sub networks. These networks don't have to be the same size as you can see on the screen. We will start off with the example that we had used previously. You've been given a prefix 192.0.2.128.27 however you want to build two layer two networks and route between them. The golden rules demand a different prefix for each of the networks. So how are we going to split this address space into two equal size pieces? We will show you the different bits of the IP address as we had shown you in the previous example in this case 192 is represented as shown on the screen. If we're subnetting a slash 27 you have to remember that the number of host bits is 5. If you want to divide this into two different prefixes you would simply move one bit from the host part to the prefix. Moving the bit to the prefix portion ensures that you divide the prefix into two. In this case you're going to now have four bits for the host for one subnet. So the first subnet will have an ip address of 192.0.2 The second prefix will have the first bit now being one. Remember that we moved one of the bits to the prefix portion so the first prefix had that bit being zero and the second prefix would have the first bit now being one. So the second prefix IP address will now be 192.0.2.144. How did we get 144 for the second prefix? Remember it's the same binary mathematics. In this case the last eight bits is going to be one zero zero one zero zero zero zero. If you convert this to decimal it's going to be 144. So we now know that dividing a subnet is simply moving one of the host bits to the prefix bits. So moving one bit simply divides by two. If you were to move two bits it would be division by four. So we're now going to check the correctness of what we did. We're going to expand each new prefix into lowest and highest addresses. The ranges should not overlap. The first prefix as we had shown you is 192.0.2.128 and it's in slash 28. Remember we moved one of the host bits to the prefix bits so it's now a slash 28. So the lowest address which is the network address is going to be 192.0. The highest IP address is going to be 192.0.2.143 which is the broadcast address. The second prefix starts off with 192.0.2. Remember that this is also a slash 28. The lowest address which is the network address is obviously the same IP address which is 192.0.2.144. And the highest address which is the broadcast address is 192.0.2.159 So we're now going to ask you how many usable addresses do you have now from the two /28 prefixes? Remember that the original slash 27 prefix had 32 IP addresses out of which two were unusable which is the network under broadcast address making it 30 usable ip addresses. However, if you have two /28 prefixes you're now going to end up with two network addresses and two broadcast addresses. So the total number of usable IP addresses will now be 32 minus 4 which is going to be 28 IP addresses. We're now going to show you an aggregation tree. If you continue dividing prefixes as required, you're going to end up with an aggregation tree as shown on the screen. As you can see the example you're using is a slash 24 prefix. You can divide the slash 24 prefix into two slash 25 prefixes. Similarly a slash 25 prefix can be divided into two equal slash 26 prefixes. A slash 26 prefix can also be divided into two slash 27 prefixes. If you want to visualize this tree you can see that a slash 25 prefix is either two 26 prefixes or four slash 27 prefixes. Similarly you can see that a slash 24 prefix will be 2 25 prefixes or if you want to expand it it will be equal to four /26 prefixes even though this is not shown on the screen. So it's very easy to visualize the aggregation tree by just sticking to one portion of the prefix and dividing it further downwards.

© Produced by Philip Smith and the Network Startup Resource Center, through the University of Oregon.

Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
This is a human-readable summary of (and not a substitute for) the license. Disclaimer. You are free to: Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms: Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. NonCommercial — You may not use the material for commercial purposes. No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.