## Shortcuts in Binary ANDing

Remember when I said that this was supposed to save you time when working with IP addressing and subnetting? Well, there are shortcuts when you AND two numbers together:

• An octet of all 1s in the subnet mask will result in the answer being the same octet as in the IP address.

• An octet of all 0s in the subnet mask will result in the answer being all 0s in that octet. Question 4

To what network does 172.16.100.45 belong, if its subnet mask is 255.255.255.0?

Proof

Step 1 Convert both the IP address and the subnet mask to binary: 172.16.100.45 = 10101100.00010000.01100100.00101101

255.255.255.0 = 11111111.11111111.11111111.00000000

Step 2 Perform the AND operation to each pair of bits - 1 bit from the address ANDed to the corresponding bit in the subnet mask. Refer to the truth table for the possible outcomes:

172.16.100.45 = 10101100.00010000.01100100.00101101 255.255.255.0 = 11111111.11111111.11111111.00000000 10101100.00010000.01100100.00000000

Notice that the first three octets have the same pattern both before and after they were ANDed. Therefore, any octet ANDed to a subnet mask pattern of 255 is itself! Notice that the last octet is all 0s after ANDing. But according to the truth table, anything ANDed to a 0 is a 0. Therefore, any octet ANDed to a subnet mask pattern of 0 is 0! You should only have to convert those parts of an IP address and subnet mask to binary if the mask is not 255 or 0.

Question 5

To what network does 68.43.100.18 belong, if its subnet mask is 255.255.255.0? Answer

68.43.100.0 (There is no need to convert here. The mask is either 255s or 0s.) Question 6

To what network does 131.186.227.43 belong, if its subnet mask is 255.255.240.0? Answer

Based on the two shortcut rules, the answer should be 131.186.???.0

So now you only need to convert one octet to binary for the ANDing process:

227= 11100011 240= 11110000 11100000 =224