16
SI-PROFINET RT User Guide
Issue Number: 2
Table 5-2 IP address classes
5.5
Subnet mask
The subnet mask defines which part of the IP address constitutes the subnet address
and which part constitutes the host address.
The subnet mask is bit-wise ANDed with the IP address to give the network ID, the host
ID portion of the IP address is bit-wise ORed with the subnet mask to give the host ID.
•
A '1' in the subnet mask indicates that the corresponding bit in the IP address is part
of the network or subnet ID address
•
A '0' in the subnet mask indicates that the corresponding bit in the IP address is a
part of the host ID address
illustrates an example with a class C IP address.
Figure 5-1 Network and host ID
W
X
Y
Z
Class A
0
Net ID (7 bits)
Host ID (24 bits)
Class B
1 0
Net ID (14 bits)
Host ID (16 bits)
Class C
1 1 0
Net ID (21 bits)
Host ID (8 bits)
Class D
1 1 1 0
Multicast group ID (28 bits)
Class E
1 1 1 1
Reserved (28 bits)
=
SM-PROFINET IP address
192
W
X
Y
Z
168
0
2
Subnet mask
255
W
X
Y
Z
255
255
0
Bitwise
AND
Network ID:
192.168.0
Host ID:
2
W
X
Y
Z
0
2
Result
192
168
Bitwise
OR