ANDing
Devices use the AND computation to determine the subnet identifier for each IP address.
If the subnet identifier for the local IP address is the same as that of the IP address to which it wants to communicate, then the packet is sent on the local subnet.
If the subnet identifiers are different, then the packet is sent to the default gateway or local router to be routed to the remote subnet.