• What is the ANDing process?

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.

The source and destination IP addresses are compared to the source's subnet mask using the ANDing process. An AND result is created for each of the addresses. If the result is the same, the hosts are on the same network. If the result is different, the destination host is on a remote network. All traffic destined for that remote host should be directed to the router indicated in the source host's routing table. If no explicit route is defined in the routing table, the traffic is directed to the source host's default gateway.

For example two hosts that want to communicate. Host A (with IP address 172.16.2.4) wants to communicate with Host B (with IP address 172.16.3.5). If the subnet mask for Host A is 255.255.0.0, 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 172.16.2.4 is as follows:

10101100 00010000 00000010 00000100

When converted to binary, the address 172.16.3.5 is as follows:

10101100 00010000 00000011 00000101

If the ANDing process is performed, the result for Host A using its subnet mask of 255.255.0.0 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

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

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.

Day 5, "The Art of Subnet Masking," further examines the art of subnet masking. It also examines the use of nonstandard subnet masking to further segment a group of IP addresses into smaller segments. This process, which ignores the default subnet masks used by address classes, is commonly referred to as Classless Internet Domain Routing (CIDR).

Contents