
The correspondence between IP address segments and subnet masks is mainly reflected in the CIDR (Classless Inter-Domain Routing) representation.CIDR is represented by a slash followed by a numbersubnet maskThe number of consecutive 1's in the bits, which indicates the length of the network prefix.
I. Common IP address segments and their corresponding subnet masks
1, Common private IP address segments and their subnet masks.
-
Class A private address: 10.0.0.0 - 10.255.255.255
-
Usually the subnet mask: 255.0.0.0
( /8 ) -
Smaller subnets may also be used, for example: 255.255.0.0
(/16) or255.255.255.0
(/24) Depends on network size
-
-
Class B private address: 172.16.0.0 - 172.31.255.255
-
Usually the subnet mask: 255.255.0.0
(/16) -
Smaller subnets may also be used, for example: 255.255.255.0
(/24) Depends on network size
-
-
Class C private address: 192.168.0.0 - 192.168.255.255
-
Usually the subnet mask: 255.255.255.0
(/24)
-
2, Examples of common public IP address segments (examples only, actual assignments are managed by IANA and regional registries and are very complex):
Because the assignment of public IP addresses is complex and changes dynamically according to IANA and Regional Internet Registries (RIRs), it is difficult to give a complete and accurate list. The following examples are provided for illustrative purposesCIDRConcepts of representation and subnet masks:
-
Example. 203.0.113.0/24
Indicates IP address range203.0.113.0 - 203.0.113.255
The subnet mask is255.255.255.0
-
Example. 198.51.100.0/22
Indicates IP address range198.51.100.0 - 198.51.103.255
The subnet mask is255.255.252.0
II. CIDR and Subnet Mask Conversion
CIDR representation /n
Indicates that the first two digits of the subnet mask n
The bit is 1. You can convert the CIDR to a subnet mask using the following method:
-
Example. /24
Indicates that the subnet mask has 24 1s:11111111.11111111.11111111.00000000
Converted to decimal, that's255.255.255.0
-
Example. /16
Indicates that the subnet mask has 16 1s:11111111.11111111.00000000.00000000
Converted to decimal, that's255.255.0.0
III. Table of IP address segments corresponding to subnet masks
subnet mask | network prefix | Network address range | Available IP address range | broadcast address | Maximum number of available hosts |
---|---|---|---|---|---|
255.255.255.0 | /24 | 0.0.0.0 – 255.255.255.0 | 0.0.0.1 – 255.255.255.254 | 255.255.255.255 | 254 |
255.255.254.0 | /23 | 0.0.0.0 – 255.255.254.0 | 0.0.0.1 – 255.255.254.254 | 255.255.255.255 | 510 |
255.255.252.0 | /22 | 0.0.0.0 – 255.255.252.0 | 0.0.0.1 – 255.255.252.254 | 255.255.255.255 | 1022 |
255.255.248.0 | /21 | 0.0.0.0 – 255.255.248.0 | 0.0.0.1 – 255.255.248.254 | 255.255.255.255 | 2046 |
255.255.240.0 | /20 | 0.0.0.0 – 255.255.240.0 | 0.0.0.1 – 255.255.240.254 | 255.255.255.255 | 4094 |
255.255.224.0 | /19 | 0.0.0.0 – 255.255.224.0 | 0.0.0.1 – 255.255.224.254 | 255.255.255.255 | 8190 |
255.255.192.0 | /18 | 0.0.0.0 – 255.255.192.0 | 0.0.0.1 – 255.255.192.254 | 255.255.255.255 | 16382 |
255.255.128.0 | /17 | 0.0.0.0 – 255.255.128.0 | 0.0.0.1 – 255.255.128.254 | 255.255.255.255 | 32766 |
255.255.0.0 | /16 | 0.0.0.0 – 255.255.0.0 | 0.0.0.1 – 255.255.0.254 | 255.255.255.255 | 65534 |
255.254.0.0 | /15 | 0.0.0.0 – 255.254.0.0 | 0.0.0.1 – 255.254.0.254 | 255.255.255.255 | 131070 |
255.255.255.255 | /32 | 0.0.0.0 – 255.255.255.255 | 0.0.0.1 (not available) | no broadcast address | 0 |
PS
-
Public IP address allocation: Public IP addresses are allocated by IANA (Internet Assigned Numbers Authority) and by individual regional registries (RIRs) Management. The actual distribution is complex and changes over time. -
Private IP address: Private IP addresses are used for internal networks and are not routed over the Internet. -
subnetting:: Subnet masks are used to divide an IP network into smaller subnets to make more efficient use of IP addresses.