VLSM subnet division and route Summary

Source: Internet
Author: User

● Subnet division of VLSM
When deploying a new network, in addition to determining the size of the allocated IP subnet (including the number of IP addresses), we also need to consider how these subnets are summarized in the routing table.
When there are plenty of addresses, SLSM (equal-length mask) addresses are used, and the route table configuration is relatively simple. However, VLSM (variable-length mask) addresses are often used in scenarios where there are few addresses, to facilitate subsequent configuration, take the following steps when dividing subnets:
1) First, find the subnet prefix (mask) that contains the most addresses );
2) divide the existing address according to the prefix 1;
3) First, divide the subnet (I .e. 1) with the most required addresses, and the rest are unallocated address blocks;
4) Select an unallocated address block and divide the block according to the previous three steps (find the address that contains the most addresses in the remaining unallocated game network );
5) if a small subnet is allocated (used for connecting routers), we recommend that you select a subnet segment in the last address range.
Example: existing address blocks: 168.34.28.0/23 (168.34.28.0/255.255.254.0). The subnet to be divided: The three prefixes are 25 (the mask is 255.255.255.128 ), the three prefixes are 27 (the mask is 255.255.255.255.255.252) and 30 (the mask is 255.255.255.255.252 ). The division steps are as follows:
1) Find the subnet prefix with the most address required is 25;
2) divide the address block 168.34.28.0/23 by the prefix 25 and divide it into four parts: 168.34.28.0/25, 168.34.28.128/25, 168.34.29.0/25, and 168.34.29.128/25;
3) First, assign a subnet with a prefix of 25. There are three, so they occupy 168.34.28.0/25, 168.34.28.128/25, and 168.34.29.0/25 respectively;
4) among the remaining subnets, select the address block with the highest required address-the address block with the highest prefix of 27;
5) divide the remaining address blocks 168.34.29.128/25 into four segments based on the prefix 27: 168.34.29.128/27, 168.34.29.160/27, 168.34.29.192/27, and 168.34.29.20./ 27;
6) First, assign a subnet with a prefix of 27. There are three, so they occupy 168.34.29.128/27, 168.34.29.160/27, and 168.34.29.192/27 respectively;
7) the remaining subnet is already a small subnet (with a prefix of 30). Therefore, it is allocated from the end of the remaining address block (168.34.29.20./ 27). There are three, therefore, they occupy 168.34.29.244/30, 168.34.29.248/30, and 168.34.29.252/30 respectively.
 
● Route Summary
How to determine the optimal routing summary policy when a subnet is known? -- This problem is very common in IP address calculation. There are two ways to consider this problem:
1) includes a summary route: a single summary route contains all known subnets, and may also contain other non-existent subnets.
2) Exclusive route Summary: use as few routes as possible to include all known subnets, but not other non-existent subnets.
These two situations have their own reasons. For example, when the LAN needs to retain some addresses for future use (expansion needs), 1st methods will be considered; however, you may not want to include other addresses (because these addresses may already be used by other networks) in the summary of Inter-lan address routing. In this case, you will consider using the 2nd method.
 
● Calculation of a method containing a summary route
Standard Method (Binary ):
1) write the binary format of each subnet number;
2) Find the consecutive bits with the same value in these subnet numbers. These bits are the prefix values x;
3) write a new 32-digit copy of the first x-digit sub-network number. The value of the remaining digits is 0, which is the summarized route;
4) convert the number into a decimal format.
Quick Method (decimal ):
1) calculate the number of known subnets and find the minimum value x, so that 2x> = the number of subnets;
2) Find the largest prefix value y in the subnet, so that y = y-x;
3) assume that the subnet with the minimum address value is an IP address and its prefix is y. Then, the subnet number of the address is calculated;
4) assume that the subnet with the largest address value is an IP address and its prefix is y. Then, the subnet number of the assumed IP address is calculated. If the obtained subnet number is the same as 3, this is the summary route;
5) If 4) The obtained subnet number is different from 3), repeat steps 3) and 4), but y = y-1.
For example, if the subnet 168.34.12.0/24, 168.34.8.0/24, 168.34.14.0/24, 168.34.15.0/24, and 168.34.16.0/25 are known, the subnet contains a summary route. The procedure is as follows:
1) if the number of subnets is 5, x = 3 is obtained, so that 23 = 8> 5 is obtained;
2) The maximum subnet prefix value is 25, so y = 25-3 = 22;
3) if the smallest subnet number is 168.34.12.0, assuming that it is an IP address with a prefix of 22, the subnet is 168.34.12.0/22;
4) The maximum subnet number of the address value is 168.34.16.0. If it is an IP address with a prefix of 22, it is calculated that its subnet is 168.34.16.0/22;
5) if the smallest subnet number is 168.34.12.0, assuming that it is an IP address with a prefix of 21, it is calculated that its subnet is 168.34.8.0/21;
6) The maximum subnet number of the address value is 168.34.16.0. If it is an IP address with a prefix of 21, the subnet is 168.34.16.0/21;
7) if the smallest subnet number is 168.34.12.0, assuming that it is an IP address with a prefix of 20, it is calculated that its subnet is 168.34.0.0/20;
8) the maximum subnet number of the address value is 168.34.16.0. If it is an IP address with a prefix of 20, the subnet is 168.34.16.0/20;
9) If the smallest subnet number is 168.34.12.0, assuming it is an IP address with a prefix of 19, the subnet is 168.34.0.0/19;
10) If 168.34.16.0 is the largest subnet number and its prefix is 19, 168.34.0.0/19 is the same as 9, this is a summary route.
 
● Calculate the exclusive route aggregation method (bipartite and SLSM)
1) First, find a route that contains a summary route, which is called a candidate exclusive summary route;
2) check whether the candidate route contains a nonexistent subnet. If not, the candidate route is part of the request;
3) if the candidate route contains a subnet that does not exist, split it into two halves to form two new candidate routes (prefix 1 );
4) if one of the candidate routes contains a non-existing subnet, the route is split into two parts. If one of the candidate routes completely does not contain a known subnet, the route is discarded;
5) Repeat 2) and 4) until no new possible candidate routes are generated.
For example, if you know that the subnet 168.34.20.0/24, 168.34.21.0/24, 168.34.22.0/24, 168.34.23.0/24, and 168.34.24.0/24 are available, you can obtain the summary route as 168.34.16.0, follow these steps to obtain an exclusive route:
1) Because 168.34.16.0/20 contains a nonexistent subnet, it is split into two parts: 168.34.16.0/21 and 168.34.24.0/21;
2) If 168.34.16.0/21 still contains a nonexistent subnet, split it into two parts: 168.34.16.0/22 and 168.34.20.0/22. At this time, 168.34.20.0/22 does not contain a nonexistent subnet, therefore, it is part of the request, and 168.34.16.0/22 completely does not contain known subnets, so it is discarded;
3) Check 168.34.24.0/21 again, and then split it into two parts: 168.34.24.0/22 and 168.34.28.0/22. At this time, 168.34.28.0/22 completely does not contain known subnets, so it is discarded;
4) if 168.34.24.0/22 still contains a non-existent subnet, split it into two parts: 168.34.24.0/23 and 168.34.26.0/23. At this time, 168.34.26.0/23 does not contain any known subnet, so it is discarded;
5) If 168.34.24.0/23 still contains a non-existent subnet, split it into two parts: 168.34.24.0/24 and 168.34.25.0/24. At this time, 168.34.25.0/24 does not contain any known subnet, therefore, it is discarded, and 168.34.24.0/24 does not contain subnets that do not exist. Therefore, 168.34.24.0/24 is part of the request and no candidate route is available.
In summary, the exclusive route is obtained as follows: 168.34.20.0/22 and 168.34.24.0/24.
This article is from the "second sailing" blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.