Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know that in an Ethernet LAN, the ARP protocol is used to get a MAC address from an IP address. How does my router get the MAC address of another router on an external network if ARP is not possible?

share|improve this question
1  
if you can't arp, then you can't use a layer3 protocol like IP on most common types of modern networks (those at least partially based on ETHERNET_II/802.3). think of it this way, just as arp works on your LAN, there is a LAN between your router and the next physical machine it is connected to, and your router can arp it. –  Frank Thomas Jan 16 at 23:47
    
The main question asks about the MAC address of the "next hop router", but the question body asks about the MAC address of "another router on an external network". Are you specifically asking about an edge router, that is, one that has a next hop on an external network? –  David Schwartz Jan 17 at 6:02

6 Answers 6

up vote 3 down vote accepted

Why are you assuming ARP is not possible? ARP is the way its done. There is nothing special about your "internal network" vs an "external network", the same protocols are used on both.

Your router has a set of routes setup to route traffic to your internal network, but it also has a Default Gateway which points to a router in your ISP's network. Your router will use ARP to lookup the MAC address of that default gateway. Then that router will do the same to find its "next hop".

share|improve this answer

By "external network", I'm assuming one that isn't directly connected to your router.

It doesn't ARP. Your router looks up the target address in its routing table. The table will list a next hop address, which is the address of the next router to get closer to the target. your router will then ARP for the router address, because it is on the same network as your router (or to put it differently, they share a common network).

Now, it is possible that the next hop address is not on a network that your router is connected to. So your router looks in its route table to find the route to the next-hop address. That route will also have a next hop address (we'll call it NH2). NH2 will be on a common subnet, so your router will ARP for the MAC of NH2.

In the really bizarre case where NH2 is also not local, your router will continue to look in its routing table until it finds a local subnet, or it will drop the packet.

share|improve this answer

How does my router get the MAC address of another router on an external network if ARP is not possible?

Simplifying a bit, it's not possible and not needed.

In the simplest situation, a node has a NIC that is assigned an IP address and a netmask (i.e. subnet) and it knows of a "default gateway" that it got through DHCP.

Based on this, if it wants to send traffic to something in that same subnet, it can just throw the traffic out of that NIC and it will reach anything on that subnet.

If it wants to send traffic to any other subnet, it needs to send that traffic to the default gateway, which is on that subnet.

The default gateway will then forward (routing = forwarding) that traffic to another subnet if it has a route for it. In your typical residential situation, that will basically go to your cable or DSL ISP's router, and further on "upstream" from there.

Big networks (corporate, campus) use various gateway protocols to find out about routes that they are not directly connected to automatically, and ISPs use BGP to trade the rather large routing tables that make up the entire Internet.

The MAC is not needed for routing, just the default gateway.

MAC addresses cannot help in routing, because there is no such thing as a "subnet" for MAC addresses. The "MAC address layer" assumes that when it sends something to another MAC, it can do that just by throwing traffic on the wire. It has no concept of "middleman." So getting the MAC address of anything off your network is not helpful insofar as getting your traffic to it. This is why the IP layer exists and not everything is MAC addresses only.

share|improve this answer
    
You've correctly described what happens at layer 3 , but you've completely ignored everything that happens below layer 3. A NIC can't just "throw the traffic" out on an interface, it needs to have the MAC address of the next NIC in order to send the traffic to the right "next hop". –  heavyd Jan 17 at 15:16
    
Very true ... it does needs the destination MAC (guess broadcast MAC would be more literally "throwing it out of the NIC" lol). But layer 2 assumes it can get to that destination MAC with no middleman - that was my point. –  ultrasawblade Jan 17 at 15:56

Short Answer:

Data-link-layer (layer 2) technologies that use MAC addresses use ARP, even for "external" (WAN) links.

Data-link-layer technologies that are point-to-point don't necessarily need link-layer addresses, because there are only 2 endpoints, and each endpoint knows that if it's not the one transmitting the message, it must be the one supposed to receive it, and vice-versa. So they don't need anything like a MAC address or ARP.

Data-link-layer technologies that are multipoint-to-multipoint on a shared medium will need link-layer addresses of some kind, and an address resolution protocol of some kind, even if they don't call them "MAC addresses" and "ARP" respectively. But they often do call their ARP-equivalent "<this data link technology's name> ARP"

Long Answer:

In one sense, MAC addresses and ARP as you know them from Ethernet are only used on Ethernet-like data links, so finding the next hop MAC address is only necessary on Ethernet-like data links, and ARP is used for that.

Point-to-point serial links (as many business WAN links are) don't necessarily require data-link-layer addresses, because there's only one other device you could be talking to, because there's only one other device on the line. So you can assume that everything you receive is for you, and you can assume that the other endpoint of the link will process everything you transmit.

So what about multi-device (a.k.a. multipoint-to-multipoint) shared medium data link layers that aren't like Ethernet, and don't use Ethernet-like 48-bit MAC addresses? Well, those data links probably have some kind of link-layer addresses even if it's not a 48-bit MAC address, and they'll need some kind of way to map IPv4 address to their data link layer addresses, even if it's not traditional Ethernet ARP. In general, the people designing how to make IPv4 work over those other data links basically follow the Ethernet model and create an ARP protocol for their data link. These protocols are usually differentiated from traditional Ethernet ARP by being named "<insert name of data link layer protocol here> ARP".

So if you do IP over Fibre Channel, there's "IP over Fibre Channel ARP" (the simpler name "Fibre Channel ARP" or "FARP" was already in use for one of Fibre Channel's own protocols).

If you do IP over SONET/SDH (technically over "MAPOS", which is the way to do multipoint networking over SONET/SDH), you have "MAPOS ARP".

If you do IP over FireWire (the IEEE 1394 Serial Bus), you have "1394 ARP"

If you were time warped back to the early 90's and wanted to do IP over AppleTalk/LocalTalk, you do "NBP ARP" (the simpler name "AppleTalk ARP" or "AARP" was already used for the protocol that maps AppleTalk's network-layer addresses to data-link-layer addresses).

share|improve this answer

How does my router get the MAC address of another router on an external network if ARP is not possible?

Either the next hop is reached by Ethernet or not. If by Ethernet, then ARP works. If not by Ethernet, then no MAC is needed.

share|improve this answer
    
Are you saying that no Ethernet frame is being built when the router sends something? –  Gradient Jan 17 at 5:57
    
@Gradient If the router is using Ethernet to reach its next hop, then it does need to build an Ethernet frame to that next hop machine. So routers that use Ethernet do need to find the MAC addresses of their next hops via Ethernet, which is what ARP is for. (See updated answer.) –  David Schwartz Jan 17 at 6:01

It doesnt matter Ethernet or Wan link, the Frame but not the IP Packet only is sended out to network by Layer 1. On serial links used HDLC frame. Difference is that router does not ARP on serial link,in fact serial links doesnt have MAC address, it uses SLARP, Serial Line ARP a method for determining a link health. Serial link has only two endpoints no ARP or MAC needed. Now service providers often use Ethernet Wan, where ARP is the king :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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