# Dividing instances by subnets

Source: Internet
Author: User

Your job is to plan a company's network. This network requires three independent subnets. However. As the company grows. The number of subnets may be grayed out to 100 in the future. The maximum number of hosts in each subnet is 200. And does not increase. Use the network address 172.16.0.0. How do I divide subnets ??

N = 7. N = 8. Both of them can meet his requirements.

The subnet mask is a 32-digit subnet mask, where the host address is 0, the network address is 1, and the subnet address is 1, this also includes a subnet division problem. For ease of management. Generally, the host ID can start with a subnet number.

Subnet division refers to dividing the last few digits of the subnet into the network bit and the host bit. The number of subnets and hosts are divided by the Network bit and host bit.

Host count N = 8

There are 100 subnets, each of which has 200 hosts.

Because the number of hosts in each subnet is 200 and does not increase, the number of hosts is allocated first:

2 N-2> = 200 2 N = 202 N = 8

Therefore, the last eight bits serve as the host bit, and the first eight bits serve as the network bit.

Therefore, the network address range is from

172.16.00000001.000000000-17000000001100100.00000000

That is:

172.16.1.0/24-172.16.100.0/24

Host from 00000001-011001000

That is, 172. 16. *. 1/24-172. 16. *. 200/24

There are 27 remaining subnets that can be expanded,

The allocated subnet has 54 hosts that can be expanded.

Number of hosts N = 9

Only 100 subnets are required. Therefore, 7 digits are used as the network bit, and the rest are used as the host bit.

172.16.0000001 0 00000000 172.16.1100100 0 00000000

That is

172.16.2.0/23-172.16.172.16.200.0/23

Host from 0 00000001-0 011001000

That is, 172. 16. *. 1/23-172. 16. *. 200/23

Assume that you have applied for a network ID at InterNIC: 192.20.16.0, but you have two remote LANs that need to be interconnected, and each remote LAN has 60 hosts.

If you do not divide subnets, you can only use one network ID: 192.20.16.0, use the default subnet mask: 255.255.255.0, and the range of Host IDS that can be accommodated in this subnet is 1 92.20.16.1 ~ 192.20.16.254, that is, there can be 254 hosts.

Now, if you divide the subnet into two subnets as needed, that is, using two of the Host IDS as the network IDs, The subnet mask strain is: 255.255.255.255.192 (11000000) the purpose is to mask the borrowed bit used as the network I D. let's take a look at the subnet:

▲192.20.16. 65 ~ 126

192.20.16.0000001 ~ 01111110

Number of hosts in this section (01): 2n-2 = 26-2 = 62 or 126-65 + 1 = 62

▲192.20.16. 129 ~ 190

192.20.16.0000001 ~ 10111110

Number of hosts in this segment (10 segment): 2n-2 = 26-2 = 62 or 190-129 + 1 = 62

▲If the subnet number 00 is all 0, it indicates the current network. If the subnet number 11 is all 1, it is subnet shielded and unavailable.

This solution can meet the current needs, but if you need to add a new network segment, you must re-divide more subnets (that is, use more host ID bits as the network ID ), or, if you need more hosts in each subnet in the future, you must use the network I D bit to ensure more hosts.

If the network ID assigned to you by InterNIC is 129.255.0.0, then when the default subnet mask 255.255.0.0 is used, you will only have one network ID and-2 hosts (range: 1 29.20.0.1 ~ 129.255.255.254). Now you have four subnets.

1. manual calculation:

① Convert the number of subnets to binary.

4 → 00000100

② The number of digits required to represent the number of subnets in binary form is the number of digits added to the default Subnet Mask (the number of digits that should be borrowed from the host ID)

00000100 → 3

Default Value: 255.255.0.0

After the three digits of the host ID are used: Subnet Mask (11100000). 0, indicating that all bits are represented as 1 and used as the subnet mask.

④ Determine the available network ID

List all binary combinations caused by the additional bit, remove all combinations of 0 and 1

Code:

The actually obtained subnet ID of the combination

000 bytes

001 → 32 (00100000) 129.20.32.0

010 → 64 (01000000) 129.20.64.0

011 → 96 (01100000) 129.20.96.0

100 → 128 (10000000) 129.20.128.0

101 → 160 (10100000) 129.20.160.0

110 → 192 (11000000) 129.20.192.0

000 bytes

⑤ Determine the range of available Host IDS

Code:

The last IP address of the IP address starting from the subnet

129.20.32.0 129.20.32.1 129.20.63.254

129.20.64.0 129.20.64.1 129.20.95.254

129.20.96.0 129.20.96.1 129.20.127.254

129.20.128.0 129.20.128.1 129.20.159.254

129.20.160.0 129.20.160.1 129.20.191.254

129.20.192.0 129.20.192.1 129.20.223.254

2. Quick computing:

① Convert the number of subnets to binary.

4 → 00000100

② The number of digits required to represent the number of subnets in binary form is the number of digits added to the default Subnet Mask (the number of digits that should be borrowed from the host ID)

00000100 → 3

Default Value: 255.255.0.0

After the three digits of the host ID are used: Subnet Mask (11100000). 0, indicating that all bits are represented as 1 and used as the subnet mask.

④ Convert the rightmost "1" of 11100000 to decimal, that is, the increment between each subnet ID, recorded as delta = 32

⑤ The number of subnet IDs generated is 2m-2 (m: number of digits added to the default subnet mask)

Number of available subnet IDs: 23-2 = 6

⑥ The first subnet network ID 129.20.32.0 will be formed after being attached to the original network ID

7. Repeat 6th. Add the value of each subnet to obtain all subnet network IDs.

129.20.32.0

129.20.64.0

129.20.96.0

129.20.128.0

129.20.160.0 129.20.192.0

129.20.224.0 → 224 is the same as the subnet mask and is an invalid network ID.

Related Keywords:

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.