88.7k views
0 votes
Why does a layer 3 device perform the anding process on a destination ip address and subnet mask?

1 Answer

5 votes
To get the network number and node number of the destination machine. The subnet mask is usually called the NETwork MASK, so anding it with the address gives you the network number. Using the not logical operator on the netmask then protects the node bits in a second and operation.

address & netmask = network number
address & not( netmask ) = node number

The not operator essentially just flips the bits of it's argument.
User Alves RC
by
8.0k points