So basically my question is fairly straightforward (and I apologize if this is a duplicate question): how does my ISP find and connect to a server using just that servers IP address?

I understand basic networking concepts but after I enter a URL (say 'google.com') and its resolved into an IP address, what exactly does the ISP do with the IP address to physically connect to the (in this case google's) server?

The way I understand it, the internet is a very, very complicated network of computers, so does it use similar methods as my local router. Like, for example, when I request a local address such as, my router connects me to the machine on the network with the IP address that it has associated with a MAC address which in turn is associated with either a physical LAN port or is broadcasted to the correct wireless device. Is this also how the internet works just on a much, much larger scale. Or do I have the basic local concept of a network screwed up as well.

Sorry if it sounds like I'm rambling but I've always wondered how exactly this works.


closed as not constructive by Sven, EEAA, Brent Pabst, HopelessN00b, Wesley Oct 1 '12 at 3:14

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    You expect someone to answer how the internet works in the small textarea below. You're having a laugh. – Ben Lessani - Sonassi Sep 30 '12 at 23:18
  • Of course not. I completely understand how complicated the internet is. I was just wondering how my ISP goes from an IP Address to a physical machine. – Brandon Sep 30 '12 at 23:25
  • It usually doesn't. If it knows where the machine is (usually a local IP) then it routes to it, else it gets send to the default gateway. (and yes, I know I simplify things here. And ISP will have multiple routes, more and less expensive routes etc etc) – Hennes Sep 30 '12 at 23:28
  • 1
    @Brandon - the same way your local network does. It tries its own routed subnets, failing that, passes upstream to its gateway. Until it gets to an ASN, at which point it will look at its route table (of the entire internet) and pick the most appropriate route to the router responsible for the next hop. – Ben Lessani - Sonassi Sep 30 '12 at 23:30

The very short answer is:
Your ISP does it in the same way your network does it.

The long answer would be quite long, and large part of that have already been written.

I suggest you start with this post on subnetting. Once you understand how (IPv4) routing works you can imagine a small ISP with a similar setup, or a large ISP with several links to other providers.

Next, read up on routing cost and how that gets automatically implemented. Articles such as This Wikipedia article on the border gateway protocol will help.

For anything more than that you best buy a nice thick book and reserve a weekend.

  • Thanks, that wiki article was essentially what I was looking for. – Brandon Sep 30 '12 at 23:34

I think the fundamental concept here that you must first grasp is that the Internet is a packet-switched network, unlike a telephone network which is circuit-switched. This means that a circuit is never actually established between your server and the remote one, nor dedicated to it.

Instead what happens is that you send a packet of data out to your ISP with an address. Much like the postal service, the ISP's routers inspect the beginning of the packet's destination address to figure out in which direction (eg. to which other router, possibly at another ISP) to send it. It goes through this step (known as a hop) repeatedly until it reaches its destination.

However, it is entirely like relaying mail, and entirely unlike making a phone call. The establishment and teardown of a connection is entirely virtual; it does not correspond to physical connections.

  • So how does the ISP know which direction or other ISP to send the packet in/to? Is there some sort of global registry or something similar? – Brandon Sep 30 '12 at 23:28
  • It, too, is distributed. Every router has a routing table which hints the direction things go according to their prefix. You have a default route (if it doesn't know where else to send it, it sends it to the default gateway), and possibly several other routes (eg. Germany can be accessed through router X). – Falcon Momot Sep 30 '12 at 23:32

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