Why can the subnet mask be written like this

Why can the subnet mask be written like this: What is the corresponding relationship between
255.255.255.0
and the ip address: 192.168.1.247?

The maximum number of each group of numbers in the subnet mask is 255, which is the maximum number that can be expressed by one byte. The corresponding binary expression method is: 11111111, which is 255 in decimal. When the first bit of binary is 0 (ie: 11111110 corresponds to decimal 254) The range of the group of numbers corresponding to the ip address is: 11111110 is the inverted decimal number, for example: 11111110 after the inversion is: 00000001, then the value range of the third group of numbers corresponding to the ip address is: 0 -1, that is: 192.168.0.X and 192.168.1.X, and another example: 11111100 (corresponding to decimal: 252 subnet mask to fill in this number) after inversion is: 00000011, corresponding to decimal: 3, then take The value range is: 0-3, namely: 192.168.0.x and 192.168.1.x and 192.168.2.x and 192.168.3.x, note: the binary bits must be 0 consecutively, otherwise it is not supported.

Guess you like

Origin blog.csdn.net/hmwz0001/article/details/130635230