Subnet mask

A subnet mask can be used to subdivide the network classes even more finely. Like an IP address, the subnet mask is represented by 4 decimal numbers separated by dots.

Example: 255.255.255.128

Each decimal number stands for 1 byte (= 8 bits) of the subnet mask and can also be represented in binary form (see following table).

Byte 1

Byte 2

Byte 3

Byte 4

11111111

.

11111111

.

11111111

.

10000000

If you write the IP address and the subnet mask below one another, you will see that in the binary representation of the subnet mask, all ones define the share of the network address and all zeros identify the node address (see the following table).

Byte 1

Byte 2

Byte 3

Byte 4

IP address

Decimal

192

.

168.

.

10

.

129

binary

11000000

.

10101000

.

00001010

.

10000001

Subnet mask

Decimal

255

.

255

.

255

.

128

binary

11111111

.

11111111

.

11111111

.

10000000

The class C network with the address 192.168.10. Is further divided by subnet mask 255.255.255.128. 2 networks with addresses 192.168.10.0 and 192.168.10.128 are created.

The permitted node addresses in the two networks are:

  • 192.168.10.1 – 192.168.10.126
  • 192.168.10.129 – 192.168.10.254

The network nodes use the logical combination of IP address and subnet mask to determine whether a communication partner is in their own network or in another network. If the communication partner is in another network, the standard gateway for forwarding the data is addressed.