In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
First, Overview of subnetting
IP address and subnetting Learning Notes related chapters:
1. "preliminary knowledge: progressive counting" of IP address and subnetting learning notes
2. "detailed explanation of IP address" in IP address and subnetting study notes
3. "detailed explanation of subnet mask" of learning notes on IP address and subnetting
4. "detailed explanation of subnetting" of IP address and subnetting study notes
5. "detailed explanation of supernet merging" of IP address and subnetting study notes
1. Why is subnetting necessary?
If only classful (class A, B, C) is used to divide IPv4 addresses, it will cause a lot of waste or insufficient use. In order to solve this problem, on the basis of classful networks, we can divide the host numbers of IP addresses into network numbers and divide some of them into network numbers to divide networks of various sizes.
2. Subnetting and aggregation of IPv4
In order to solve the deficiency of IPv4 and improve the flexibility of network division, two very important technologies have been born, namely VLSM (variable length subnet mask) and CIDR (classless inter-domain routing), which turn the traditional standard IPv4 classful network into a more efficient and practical classless network. The introduction of VLSM and CIDR is described in detail in the previous section on subnet mask.
VLSM is used for IPv4 subnet division, that is, a large network is divided into multiple small subnets, while CIDR is used for IPv4 subnet aggregation, which mainly refers to route aggregation, that is, route summary. Through CIDR, several small subnet routing entries can be summarized into a large network routing entries, so as to reduce the number of routing entries in the router and improve routing efficiency.
2. Subnetting method
The subnetting we are talking about is actually based on the division of the VLSM variable length subnet mask, and the subnetting is divided into equal length subnets and variable length subnets.
1. The basic idea of VLSM subnetting.
The basic idea of subnetting through VLSM is very simple: it uses the leftmost bits of the host bits of the existing network segment as subnet bits to divide multiple subnets.
①, borrow the "network ID" part of the original classful network IPv4 address to the "host ID" part
②, change some of the bits that originally belonged to the "host ID" part into part of the "network ID" (commonly referred to as "subnet ID").
③, original "network ID" + "subnet ID" = new "network ID". The length of "subnet ID" determines the number of subnets that can be subnetted.
The following is an example diagram:
2. All-0 subnet and all-1 subnet
① and "all-0 subnet" represent the "subnet ID" part of the corresponding subnet. All of you are 0, which is the first subnet.
② and "all-1 subnet" represent the "subnet ID" part of the corresponding subnet. All of you are 1, which is the last subnet.
③, according to the RFC950 reference, after subnetting, there are only 2 available subnets (n represents the total number of subnets).
④ and later RFC1878 refer to the stipulation that after subnetting, there can be n available subnets (n represents the total number of subnets).
The RFC950 reference stipulates that the first subnet (that is, "all-0 subnet") and the last subnet (that is, "all-1 subnet") are not available in order to avoid conflicts between the network address of all-0 subnet and the broadcast address of all-1 subnet with the network address and broadcast address before subnetting, respectively. However, in the later RFC1878 regulation, this regulation has been repealed, and now the equipment basically generally supports RFC1878.
Third, equal length subnet and variable length subnet division
Subnetting tasks include:
①, determine the length of the subnet mask.
②, determine the range of available addresses for hosts under the subnet (the first available IP and the last available IP).
③, determine the network address (host bits are all 0) and broadcast address (host bits are all 1), can not be assigned to the host computer.
Ⅰ, equal length subnetting
Equal length subnetting is to divide a classful network into multiple networks, that is, into multiple subnets, and all subnets have the same subnet mask.
1. Class C network subnetting example ①, equally divided into two subnets
Divide the 192.168.0.0 255.255.255.0 network into 2 subnets and write down the address information of each subnet.
Analysis:
The network subnet mask is / 24, to be divided into 2 subnets, to borrow the host bit 1 bit as the subnet bit.
Because the binary numbers 0 and 1 are arranged and combined according to one bit, there are only these two kinds, which are: 0pr 1, as shown in the following figure.
0 is the A subnet
1 is the B subnet
1 bit of host is borrowed, so the subnet mask + 1 bit is changed from 255.255.255.0 (/ 24) to 255.255.255.128 (/ 25).
Conclusion: class C network is equally divided into two subnets, and if the subnet mask is moved 1 bit to the right, it can be equally divided into two subnets, that is, 2 ^ 1.
End result:
The network address of the A subnet: 192.168.0.0x25, available address (192.168.0.1' 192.168.0.126), broadcast address: 192.168.0.127.
The network address of subnet B: 192.168.0.128Universe 25, available address (192.168.0.129' 192.168.0.254), broadcast address: 192.168.0.255.
② is divided into four subnets.
The network of 192.168.0.0 255.255.255.0 is equally divided into four subnets.
Analysis: to divide into 4 subnets, you need to move the subnet mask two bits to the right
In this way, bits 1 and 2 become network bits, which can be divided into four subnets.
Because the binary numbers 0 and 1 are arranged and combined according to two digits, there are only these four kinds, which are: 00mem01mem10 and 11 respectively, as shown in the following figure.
00 is the A subnet
01 is the B subnet
10 is the C subnet
11 is the D subnet
Borrow 2 bits from the host, so the subnet mask + 2 bits is changed from 255.255.255.0 (/ 24) to 255.255.255.192 (/ 26).
Conclusion: class C network is equally divided into 4 subnets, and if the subnet mask moves 2 bits to the right, it can be equally divided into 4 subnets, that is, 2 ^ 2.
End result:
The network address of the A subnet is 192.168.0.0Universe 26, the available address is 192.168.0.1' 192.168.0.62), and the broadcast address is 192.168.0.63umber 26.
The network address of subnet B: 192.168.0.64 Universe 26, available address (192.168.65) 192.168.0.126), broadcast address: 192.168.0.127.
The network address of the C subnet is 192.168.0.128G26, the available address is 192.168.129192.168.0.190), and the broadcast address is 192.168.0.191.
The network address of the D subnet is 192.168.0.192 xx26, the available address is 192.168.193xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
③, equally divided into eight subnets
A Class C network is equally divided into 8 subnets. As shown in the following figure, the subnet mask needs to be moved 3 bits to the right.
Only in this way can 8 subnets be divided, and the first, second, and third bits of the host bit will all become network bits.
Conclusion: class C network is equally divided into 8 subnets, and if the subnet mask is moved 3 bits to the right, it can be equally divided into 8 subnets, that is, 2 ^ 3.
End result:
Subnet mask: 255.255.255.224 (/ 27)
The network address of the A subnet is 192.168.0.0Comp27, the available address is 192.168.0.1' 192.168.0.30), and the broadcast address is 192.168.0.31.
The network address of subnet B is 192.168.0.32 Universe 27, the available address is 192.168.33), and the broadcast address is 192.168.0.63.
The network address of the C subnet is 192.168.0.64 Universe 27, the available address is 192.168.65, 192.168.0.94, and the broadcast address is 192.168.0.95.
The network address of the D subnet: 192.168.0.96Universe 27, available address (192.168.97' 192.168.0.126), broadcast address: 192.168.0.127.
The network address of the E subnet: 192.168.0.128Universe 27, available address (192.168.129' 192.168.0.158), broadcast address: 192.168.0.159.
The network address of the F subnet is 192.168.0.160x27, the available address is 192.168.161' 192.168.0.190, and the broadcast address is 192.168.0.191.
The network address of the G subnet is 192.168.0.192 xx27, the available address is 192.168.193192.168.0.222, and the broadcast address is 192.168.0.223.
The network address of the H subnet is 192.168.0.224Universe 27, the available address is 192.168.2250192.168.0.254, and the broadcast address is 192.168.0.255.
2. Example of subnetting of Class B network
Divide 131.107.0.0Compact 16 into 2 subnets and write down the first and last available IP addresses for each subnet.
Analysis: to divide into 2 subnets, it is necessary to borrow 1 bit of the host bit as the subnet bit.
0 is the A subnet
1 is the B subnet
Borrow 1 bit of host, so the subnet mask + 1 bit is changed from 255.255.0.0 (/ 16) to 255.255.128.0 (/ 17).
Conclusion: class B network is equally divided into two subnets, and if the subnet mask moves 1 bit to the right, it can be equally divided into two subnets, that is, 2 ^ 1.
End result:
A subnet
Network address: 131.107.0.0Universe 17
Available address (131.107.0.1 ~ 131.107.127.254)
Broadcast address: 131.107.127.255
B subnet
Network address: 131.107.128.0ax 17
Available address (131.107.128.1 ~ 131.107.255.254)
Broadcast address: 131.107.255.255
3. Example of class A network subnetting
Divide the class A network 42.0.0.0Univer 8 into 4 subnets, and write down the first and last available IP addresses for each subnet.
Analysis: to divide it into 4 subnets, it is necessary to borrow 2 host bits as subnet bits.
00 is the A subnet
01 is the B subnet
10 is the C subnet
11 is the D subnet
Borrow 2 bits from the host, so the subnet mask + 2 bits is changed from 255.0.0.0 (/ 8) to 255.192.0.0 (/ 10).
Conclusion: class A network is equally divided into 4 subnets, and if the subnet mask moves 2 bits to the right, it can be equally divided into 4 subnets, that is, 2 ^ 2.
End result:
The network address of A subnet: 42.0.0.0Action10, available address (42.0.0.1 ~ 42.63.255.254), broadcast address: 42.63.255.255
Network address of Subnet B: 42.64.0.0G10, available address (42.64.0.1 ~ 42.127.255.254), broadcast address: 42.127.255.255
The network address of the C subnet is 42.128.0.0x10, the available address is 42.128.0.1 ~ 42.191.255.254, and the broadcast address is 42.191.255.255
The network address of D subnet: 42.192.0.0Universe 10, available address (42.192.0.1 ~ 42.255.255.254), broadcast address: 42.255.255.255
Ⅱ, variable length subnetting
VLSM specifies how different subnets use different subnet masks in a subnetted network. This is effective in situations where different network segments require different sizes of subnets, and this subnetting is called variable length subnetting.
In fact, the division of variable-length subnets is to take one or more subnets from different equal molecular networks.
1. Example of variable length subnetting
Divide the analysis results as shown in the above example:
A subnet
Network address: 192.168.10.32255.255.255.224 (/ 27), available address (192.168.10.33 ~ 192.168.10.62), broadcast address: 192.168.10.63
It is equivalent to taking a subnet of equal length and dividing it into one of eight subnets.
B subnet
Network address: 192.168.10.64255.255.255.192 (/ 26), available address (192.168.10.65 ~ 192.168.10.126), broadcast address: 192.168.10.127
It is equivalent to taking an equal length subnet and dividing it into one of the four subnets.
C subnet
Network address: 192.168.10.128255.255.255.128 (/ 25), available address (192.168.10.129 ~ 192.168.10.254), broadcast address: 192.168.10.255
It is equivalent to taking a subnet of equal length and dividing it into one of two subnets.
D subnet
Network address: 192.168.10.0255.255.255.255.252 (/ 30), available address (192.168.10.1 ~ 192.168.10.2), broadcast address: 192.168.10.3
It is equivalent to taking the same length subnet and dividing it into the first of 64 subnets.
E subnet
Network address: 192.168.10.4255.255.255.255.252 (/ 30), available address (192.168.10.5 ~ 192.168.10.6), broadcast address: 192.168.10.7
It is equivalent to taking the same length subnet and dividing it into the second subnet out of 64 subnets.
2. Summarize the rules of ① and variable length subnetting.
If the address block of a subnet is the (1 / 2) ^ n of the original network segment, the subnet mask is shifted to the right of n bits based on the original network segment, and the subnet mask is not equal to the length of the subnet.
Subnet mask for ②, point-to-point network
Each subnet is the original network (1Compact 2) × (1Unix2) × (1amp2) × (1amp2) × (1Comp2) × (1Comp2) × (1Comp2) ^ 6, and the subnet mask is moved 6 bits to the right.
For example, 11111111.1111111111111111111100 is written as a decimal subnet mask of 255.255.255.252.
IV. Summary and skills of subnetting
1. Determine the number of subnets divided
Number of subnets = 2 ^ n, where n represents the number of bits the subnet mask moves to the right
For example:
To divide 2 subnets, the subnet mask needs to be moved 1 bit to the right, 2 ^ 1 = 2
To divide 4 subnets, the subnet mask needs to be moved 2 bits to the right, 2 ^ 2 = 4
To divide 8 subnets, the subnet mask needs to be moved 3 bits to the right, 2 ^ 3 = 8
.
The number of subnets can only be divided into two times the relationship.
2. Determine the address after subnetting
Block size of each subnet address (IP_block) = 2 ^ (8 Mei n)
The number of available addresses per subnet (IP_num) = 2 ^ (8 Mui n)-2
Network address of ①, subnet = from 0 to 255. take the first value of each address block
②, broadcast address of the subnet = network address of the next subnet-1
③, available address of the subnet = the network address of the subnet to the broadcast address range of the subnet
For example:
To be divided into 4 network segments (2 ^ 2), the subnet mask is shifted 2 bits to the right
Block size per subnet (IP_block) = 2 ^ (8-4) = 64
Number of available addresses per subnet (IP_num) = 2 ^ (8-4)-2 = 62
The values of each paragraph are: 0Perry 64128192
First subnet
①, network address = 0
②, broadcast address = 63
③, available address = 1 to 62
Second subnet
①, network address = 64
②, broadcast address = 127,
③, available addresses = 65 to 126
Third subnet
①, network address = 128,
②, broadcast address = 191
③, available addresses = 129to190th
Fourth subnet
①, network address = 192
②, broadcast address = 255,
③, available addresses = 193to 254A
3. Determine the subnet mask
The divided subnet mask CIDR = the subnet mask CIDR+n of the original network, if you want to write it in decimal: 256-2 ^ (8murn)
For example:
The original subnet mask is 255.255.255.0 (/ 24). If you move 3 bits to the right, it will be divided into 8 subnets.
The subnet mask becomes / 27256-2 ^ (8-3) = 256-2 ^ 5 = 256-32 = 224
Final subnet mask result: 255.255.255.224 (/ 27)
If you do not understand, please refer to the VLSM variable length subnet mask given above corresponding to the cidr value of this chart at a glance.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.