Each house number can be thought of as a unique identifier for that street. 3 San Francisco. Only a 1 ANDed with another 1 value will result in a 1 value. We need to compare the binary representation of the third octet of the mask with the binary representation of the third octets of the addresses. Since the masked bits in both addresses are the same, the router knows that these addresses belong to the same subnet.
Class B Let's use a class B address to illustrate how subnetting works.
First determine how many subnets you need, and how many nodes per subnet you need to define. So, an 8 bit subnet mask would be 255.255.255.0. You should not use subnet 0 or a subnet of all 1s. With an all 1s subnet mask, this is also your broadcast address. You can configure this, but it is neither proper nor recommended to make your subnet the same as your broadcast address.