gogoWebsite

Calculation of subnet masks, network addresses, and broadcast addresses

Updated to 3 hours ago

Reference Article:
/question/
/article/

For example 192.168.1.53/27 How to calculate its subnet mask, network address, broadcast address, number of available hosts and maximum number of hosts that can be accommodated, and available IP addresses.

这里写图片描述

Subnet mask and number of hosts:

192.168.1.53/27 as an example to explain, this is usually said to be the class C IP address, usually people use the192.168.0.*maybe192.168.1.*segment, the subnet mask is 255.255.255.0, then the subnet mask decimal to binary conversion is:11111111.11111111.11111111.00000000The first 24 bits indicate the network number and the last 8 bits indicate the number of hosts.

the reason why192.168.1.53/27The corresponding mask is11111111.11111111.11111111.11100000The number of hosts available is reduced because the number of network numbers is insufficient, so the number of hosts to the right has to be borrowed.

这里写图片描述

We are told that the corresponding mask for 192.168.1.53/27 is 11111111.11111111.11111111.11100000, and that the number of all available hosts is counted in the 5-digit mask left over from the host number.

Note: The 8-digit host number reduces the 3 digits borrowed from the network number, leaving 5 digits. That is, n=8-m=5. That is, the maximum number of hosts that can be accommodated is 32, and the number of available hosts is 30.

The formula is shown below:

这里写图片描述

We have learned that192.168.1.53/27 The corresponding mask is11111111.11111111.11111111.11100000which is converted to the corresponding decimal number is255.255.255.224

Network address and broadcast address:

The IP address is first converted to binary, and then the and operation is performed with the binary subnet mask to get the network address.

A broadcast address is obtained by filling in all the 1's in the binary of the host portion of the IP address denoted to the right of the network number on the basis of the network address, and then converting the resulting binary to decimal to obtain the broadcast address.

这里写图片描述

Draft calculations:

这里写图片描述

Available IP addresses are 192.168.1.33 - 192.168.1.62

For more details, you can refer to the link address above.