Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how computers in a LAN communicate with each other (all the Ethernet/MAC address/NAT etc stuff), but I wonder, how do Internet routers communicate? Are they connected into some kind of giant LAN? What protocol is used to deliver packets (e.g. IP and BGP packets)?

share|improve this question
up vote 5 down vote accepted

The routers form a mesh, of sorts. Each one is connected to several others (conceivably on a LAN, but typically just a direct connection, maybe over a long distance like an undersea cable or a T-carrier or fibre link), and each one knows which it is connected to. Each router typically has many IP addresses, one per link to another router it has.

The routers usually run routing protocols which allow them to discover what their neighbours (the routers to which they are directly connected) are connected to. These are IS-IS, BGP, EIGRP, RIP, OSPF, etc. They can also keep track of this statically; routing protocols are a labour-saving device that lets network administrators automate routing table maintenance in case of changes (either intentional or due to a failure). So, each router is connected to several others, and knows what is where more or less. This information can be allowed to filter through the Internet; routers will inform each other of their neighbours' neighbours also, so it is possible to build a view of everything reachable in every direction (approximately). Routers also keep track of how far away things are (how many routers are between, and potentially how fast the path is), to facilitate getting packets to their destination efficiently.

Some routers (eg. your LAN gateway, or some of your ISP's routers) have only a couple routes: the LAN they are the gateway for, and usually one default route for the rest of the internet (in IPv4 networking, this is, or the "default" route). They therefore know that packets going to their LAN go in one direction (out the LAN interface), and packets going elsewhere go in another direction (out the WAN interface).

Other routers with more links and more networks on either side extend this concept somewhat. They will know what prefixes (the network number part of an IP address, formally) are in each of several directions, and send packets along that route (thus their name). They relay the packet to each other this way until it reaches its destination; if this is impossible, there are several mechanisms to drop it and show that it has been dropped.

So, your packet gets to your ISP, possibly from your LAN router which knows what interface the Internet is on and sends it that way. Each successive router looks at the destination address and determines which network it is part of and so which direction it goes according to its routing table; it will know that addresses beginning with a certain number are in the "direction" of one particular other ISP, and send it that way (changing the layer 2 information at each hop in order to do this, so the MAC address for instance will change at each hop). Eventually, it reaches a router on the same network as the host you're trying to reach, and it gets to that destination.

Each of these relay steps is called a hop. You can see this work using the traceroute utility (tracert on windows), though you may not see all the hops due to ICMP filtering being very widespread.

share|improve this answer
Thanks! The info I was looking for is in the first paragraph, but the for the full story too :) – Roman Bodnarchuk Nov 13 '12 at 16:20
Haha, this is "Network and Communications" class from school summarized in 6 paragraphs. Nicely done :) – Ярослав Рахматуллин Nov 14 '12 at 23:21

You are looking for IP Forwarding.
See if you want to try this short Cisco Routing presentation on YouTube.

share|improve this answer
I do know what IP routing is. I am interested - which data link protocols are used for communication between routers? – Roman Bodnarchuk Nov 10 '12 at 20:06

Yes, BGP is used to exchange routing informations between ASes. Thus enabling successful routing on the internet. This happens using TCP (and obviously IP) Then you have IGRP and OSPF in use within ASes.

share|improve this answer
So how IGRP and OSPF packets are sent between routers? – Roman Bodnarchuk Nov 13 '12 at 12:56
They are routing protocols, thats the ruleset the router uses to figure out which path to send the packets. Still IP packets. – JustStoppingBy Nov 13 '12 at 13:00
Well, sure IP, but what protocols below? Are these routers connected into some kind of LAN? – Roman Bodnarchuk Nov 13 '12 at 13:05

The protocol is TCP/IP, they are connected through WAN connections not LAN. The routing protocol is only the "language" that your router speaks. In a basic network you configure the same routing protocol so that your routers can understand each other, and these routing protocols are known as Interior Gateway Protocols. The "language" used in the Internet is called BGP this is called Exterior gateway Protocol.

share|improve this answer
I believe the question was about lower-level protocols below IP. The accepted answer seems to cover BGP etc. – RedGrittyBrick Dec 13 '12 at 23:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .