Division of subnet mask
Division of subnet mask:
The purpose of the subnet mask is to distinguish between network bits and host bits.
If the host bits are all zero, they are: network address
The host bits are all 1: broadcast address
Subnetting mask is to divide a large network segment into several small network segments, in order to save the waste of lp addresses.
The ip address corresponding to subnet mask 1 is the network bit
The ip address corresponding to the subnet mask 0 is the host bit
Examples are as follows:
Suppose a company has two departments, each department has 90 hosts, to make it in a different network segment, if the finance department is vlan1, the technical part vlan2, ip 192.168.22.0Unix24 is subnetted.
Next, we're going to subnetting.
# configuration idea: first, find out that there are up to 90 computers, first determine the host bit, and then determine the subnet bit
# 2 to the nth power should be greater than or equal to 90
Make sure that the value of n is 7
The host bit is 7 bits, and the network is 32-7 bits.
That is, the subnet mask has 25 1s.
255.255.255.10000000
255.255.255.128 / / converted to binary
192.168.22.0 000 0000 / 25 / / equivalent to borrowing a bit from the host to become a network bit, the borrowed bit can be 0 or 1
192.168.22.0 000 0000 / 25-192.168.22.01111111 / / a network segment
192.168.22.1000 0000 / 25-192.168.22.11111111 / / another network segment
192.168.22.0 000 0000 / 25-192.168.22.0 111 1111 / 25 / / borrowing one bit from the host bit is equivalent to one more bit in the network
(network address) 192.168.22.0Universe 25-192.168.22.127 (broadcast address) / / convert the above binary to decimal
Available ip addresses are: 192.168.22.1-192.168.22.126
The subnet mask is 255.255.255.10000000 / / borrowed a bit from the host bit to become a network bit.
Subnet mask: 255.255.255.128 / / converted to binary
Similarly, another network segment: 192.168.22.1 0000000-192.168.22.1 1111111
(network address) 192.168.22.128-192.168.22.255 (broadcast address) / / convert the above binary to decimal
Available ip address: 192.168.22.129-192.168.22.254
Summary: two subnets can be divided, namely 192.168.22.0-192.168.22.127 and 192.168.22.128-192.168.22.255
Subnet: 2 network segments
N to the power of 2 hosts-2 valid addresses 128-2 = 126