Range of values and example of the subnet mask - STEP 7

Communications modules and network components

ft:publication_title
Communications modules and network components
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
Range of values and example of the subnet mask

Range of values for subnet mask

To separate the network ID from the host address in the IP address, the subnet mask was introduced.

The subnet mask consists of four decimal numbers from the range 0 to 255 separated by a period, for example 255.255.0.0.

In their binary representation, the four decimal numbers of the subnet mask must include a continuous series of "1" values without any gaps from the left and a series of "0" values without any gaps from the right.

The "1" values decide the network number within the IP address. The "0" values decide the host address within the IP address.

Example:

Correct values: 255.255.0.0 D = 1111 1111.1111 1111.0000 0000.0000 0000 B

255.255.128.0 D = 1111 1111.1111 1111.1000 0000.0000 0000 B

255.254.0.0 D = 1111 1111.1111 1110.0000 0000.0000.0000 B

Incorrect value: 255.255.1.0 D = 1111 1111.1111 1111.0000 0001.0000 0000 B

Relationship between the IP address and subnet mask

The first decimal number of the IP address (from the left) decides the structure of the subnet mask in terms of the number of "1" values (binary) as follows ("x" stands for the host address or "0" in the subnet mask):

  • First decimal number of the IP address subnet mask

    Class A: 0 to 126 255.x.x.x

    Class B: 128 to 191 255.255.x.x

    Class C: 192 to 223 255.255.255.x

    Note

    You can also enter a value between 224 and 255 for the first decimal number of the IP address. This is, however, not advisable since STEP 7 does not check these addresses.