Submitted by Pete on July 1, 2010 - 8:17pm
Body:
Hosts in the same subnet are on the same data link and are therefore able to address each other directly by link layer (MAC) address. To communicate with hosts in other subnets, hosts send frames to their gateway.
On boot, a host applies its subnet mask (using logical AND) to its own IP address to find its network address. When sending packets, the host applies the subnet mask to destination addresses, and if a destination address is in the same network as the host, the host uses the ARP protocol (or NDP in IPv6) to resolve the destination host's MAC address and sends frames directly to that MAC. If the destination address is in a different network, the host sends frames to the gateway MAC (also resolved using ARP) and the gateway deals with internetwork routing.