ANDING IN NETWORKING
ANDING
When a source host attempts to communicate with a destination
host, the source host uses its subnet mask to determine whether the
destination host is on the local network or a remote network. This is
known as the ANDing process.
The AND function has the following properties:
· If the two compared values are both 1, the result is 1.
· If one of the values is 0 and the other is 1, the result is 0.
· If both of the compared values are 0, the result is 0.
ANDING
For example two hosts that want to communicate. Host A (with IP
address [Link]) wants to communicate with Host B (with IP
address [Link]). If the subnet mask for Host A is [Link],
will the hosts communicate using local transmissions or will they
send information to the default gateway?
Using the ANDing process.
When converted to binary, the address [Link] is as follows:
10101100 00010000 00000010 00000100
When converted to binary, the address [Link] is as follows:
10101100 00010000 00000011 00000101
ANDING
If the ANDing process is performed, the result for Host A using its subnet mask
of [Link] is
HOST A's IP Address 10101100 00010000 00000010
00000100
Host A's Subnet Mask 11111111 11111111 00000000
00000000
ANDING Result 10101100 00010000 00000000 00000000
ANDING
The result for Host B is
HOST B's IP Address 10101100 00010000 00000011
00000101
Host A's Subnet Mask 11111111 11111111 00000000
00000000
ANDing Result 10101100 00010000 00000000 00000000
ANDING
As you can see, the two results match. This indicates that, as far as
Host A is concerned, the two hosts are on the same physical
network. Communication can occur directly between the two hosts.
In fact, the same holds true because host B would have the same
subnet mask since the hosts are on the same network.
If the results are different, the two computers belong to different
networks, the packets needs to be forwarded to the gateway server
for transmission to remote network