Complete newbie question:

Say for example the address:
How does the computer know that this address is on the internet, not the local network?

Could a device on the local network have the address too?


Your computer knows that is not on your local network, because that address is not part of the subnetwork that your computer interface card is configured for.

Let's say your PC has an ethernet adapter configured as When your computer wants to forward a packet to, it looks in its routing table to see which interface it should use. The routing table lists all the networks your computer knows about. On a typical PC, you will have two entries in the routing table:

  • Your local network,
  • A default route (listed as

First, your computer applies the subnet mask of each entry in the routing table to see if the destination matches any of the networks. So it applies the mask to and gets the network That doesn't match the first entry.

It also applies the mask from the default route, and gets the network That does match the entry so the computer looks to see where it should forward that packet. The entry lists a next-hop address (also called a default gateway), so your computer creates an ethernet packet with the following information:

  • Source IP address: the IP address of your computer interface>
  • Source MAC address: the MAC address of your interface
  • Destination IP:
  • Destination MAC: the MAC address of the default gateway

It then forwards it to the default gateway, which forwards it on to its destination.

On a Windows PC, you can see your routing table by typing "route print" at a command prompt.

There is no real distinction between "the Internet" and your local network, other than is not your directly connected network.

  • To be more precise, the netmask is a 32 bit binary number used to specify your local network. It is always contiguous (some version of WinNT permitted non-contiguous netmask... Hilarity ensued when troubleshooting) and is represented the same way than an IP address (Dotted Quads) The pc does a bitwise AND to validate if the destination is on the same network (if so, a simple ARP is done to get the IP) if not, the packet goes to the Default Gateway (an ARP is done for that one if not in cache, then frame is sent directly to the GW MAC) – Remi Letourneau Feb 12 '14 at 14:43

NAT (Network address translation) translates your local IP address from your private network(LAN) to a public IP address usually provided by your ISP to connect to the internet (WAN). Your private IP's are not routable IPs meaning they can't route through the internet to reach its destination network, while Public IPs are routable IPs that travel accross the internet through multiple WANs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.