Determining Whether an Address Is Local or Remote

The subnet mask and the IP address are used together to determine whether a destination IP address is local or remote.

At this point, configuration mistakes, such as a misconfigured subnet mask, can lead to the host becoming unable to reach other hosts on other local subnets, though it can still communicate with remote hosts on distant networks and hosts on its own subnet.

If the Destination Address Is Local, IP Uses ARP to Identify the Destination MAC Address

If the address is local, delivery requires little additional effort. ARP resolves the IP address into a hardware address, typically a Media Access Control (MAC) address for the destination Ethernet card. The problems found here are typically problems with the ARP cache (such as duplicate addresses) or the subnet mask, and can be solved by using the Arp or Ipconfig tools.

If the Address Is Remote, Determine the Correct Gateway

If the address is remote, the next step is to determine which gateway to use to reach the remote address. In a network with only a single router acting as an external connection, the problem is relatively straightforward. However, in any network with more than one router attached, determining which gateway to use is more difficult.

IP solves the problem by consulting its routing table This routing table serves as a decision tree that enables IP to decide which interface and which gateway it should use to send the outgoing traffic. The routing table contains many individual routes; each route consists of a destination, net mask, gateway interface and metric.

If two routes are identical, the route with the lowest metric is chosen over the route with a higher metric. Note that the routing table is parsed from the most specific to the most general, so the packet is sent to the first gateway whose routing table entry matches the packet's destination. In the case of a tie, the choice is made in round-robin fashion. Problems found here are addressed with the Route tool or with network configuration changes.

ARP for Gateway Address

Once the correct gateway is determined, the ARP process is performed for the gateway address just as it is for any other local address. The ARP broadcast returns a hardware address, and the message is sent to the gateway to be routed further.