|
The network portion of an Internet
address can be determined by using the AND operation with the
Internet address and subnet mask. The ANDing process will be
performed twice: when the computer is initialized with its local IP
address and local subnet mask, and when it sends information to a
destination address with the destination address and the local
subnet mask. To use the ANDing function convert your local IP
address and subnet mask into binary form. To calculate the
corresponding bits use the following rules:
-
1 and 1=1
-
1 and 0=0
-
0 and 1=0
Look at the following example to
better understand the ANDing process:
Local IP address:
11100010 01010101
00000001
Local subnet mask:
11111111 00000000
00000000
First ANDing result:
11100010 00000000
00000000
If you notice we simply take each bit
of the IP address and calculates it with the subnet mask. The
calculation of 1 and 1is 1 and the calculation of 0 and 1 or 1 and 0
is 0. Look at another example showing our second ANDing
result:
Destination IP address:
11100010 00110010
00000100
Local subnet mask:
11111111 00000000
00000000
Second ANDing result:
11100010 00000000
00000000
Note: If you will notice the
ANDing results are the same so that means the data is being sent
locally and a router was not used. |