How do we get the router's MAC address without ARP?

4

How can a host that does not support Internet Protocol (it runs on layer 2 only) get the router's MAC address so that it can send Ethernet packets over?

Pacerier

Posted 2013-09-09T16:10:25.127

Reputation: 22 232

@Ramhound, With just a Ethernet address we would be able to send Ethernet packets from one computer to another right? – Pacerier – 2013-09-09T16:41:24.040

In all fairness, MAC addressing is used in many 802.x L2 protocols, including Ethernet/EthernetII, IEEE802.3, 802.5 (Token Ring), etc, so I've always treated the term 'Ethernet Address' as a colloquialism. – Frank Thomas – 2013-09-09T18:18:37.433

Answers

3

Short answer, depends on the protocols available on the L2 host.

Every Layer 2 protocol family has some means to advertise/discover the MACs of the systems on the lan. This is usually done by Broadcast, as HeavyD mentioned, and the technique is used in ARP.

Back in the old days (when your question was pertinent), the only people who performed network related tasks like these were the network admins, who could as easily read the MAC off the sticker on the router/bridge when doing things like setting up spanning trees, or other non-routed multi-segmented LANs. you will either have to rely on a name-mapping protocol (like old-school NetBUI, which relies on broadcasts in case your interested), or configure them by hand.

Frank Thomas

Posted 2013-09-09T16:10:25.127

Reputation: 29 039

By "configure them by hand", Do you mean if the sticker is lost the hardware is essentially useless? – Pacerier – 2013-09-09T16:47:42.850

you will have to figure it out somehow. if nothing else, connect directly to the router, and send a broadcast frame. the response should be your routers MAC. – Frank Thomas – 2013-09-09T16:49:05.480

but then again, keep in mind, connecting a L2-only or non-IP system to an IP router is already useless. if you are trying to use it as a just a switch, you wouldn't need to know the MAC of the router anyway. The switch fabric (port-destination tables maintained on the switch) will handle all the mapping questions invisibly. – Frank Thomas – 2013-09-09T16:54:07.297

2

You could always use the Ethernet broadcast address (FF:FF:FF:FF:FF:FF) if you don't know the actual MAC.

This is actually how ARP works, the request is sent out to the broadcast address then the host that has the IP being requested responds with its own MAC. If using the broadcast exclusively is not a viable option you'll need to implement a protocol similar to ARP to discover the host.

heavyd

Posted 2013-09-09T16:10:25.127

Reputation: 54 755

In ARP, the Ethernet broadcast will say "If you are 192.168.0.1 give me your mac address". But since our host does not speak IP, what message would it send in the Ethernet broadcast? – Pacerier – 2013-09-09T16:37:19.430

en.wikipedia.org/wiki/EtherType - The Ethernet frame tells the upper layer what protocol it is (i.e. should be). So speaking IP is not a requirement to process ARP (and it can't be because an ARP message can be for any protocol, not just IP), and the ARP message format is delineated nicely here: http://en.wikipedia.org/wiki/Address_Resolution_Protocol.

– LawrenceC – 2013-09-09T16:51:37.723

1@Pacerier,as Frank mentioned ARP should work for you, but you need some way to identify the host you're trying to talk to. Also, a lot of this assumes that you can change how the software on the host works to respond to an ARP request. If your device is not already programmed to respond to such a request, nothing external to the device is going to be able to help. I think some more detail about what kind of device you have an what you're really trying to accomplish would help. – heavyd – 2013-09-09T17:24:50.387

@heavyd, I'm just trying to understand how ARP works on a host that does not understand IP. And I'm trying to find out are there alternatives besides manual configuration. – Pacerier – 2013-09-09T17:57:29.800

I still am not sure I fully understand... with ARP the host has an IP address and is looking for the MAC of the host with that IP address. What do you have that you can use to identify the host you're looking for? – heavyd – 2013-09-09T19:07:05.663

@heavyd, Exactly. That is the whole point of this question. How do I use something like ARP to figure out the router's MAC when I don't have IP? – Pacerier – 2013-09-10T06:47:09.017

@Pacerier, yes but my question is what do you have that you can use to identify the router? I'm guessing the router supports IP, so if you know its IP address you could just use ARP. Like I said in my answer this discovery process is going to involve sending a packet which contains some kind of identifier (in ARP's case an IP address) to the broadcast address and then getting a response from the devices on the network that recognizes that identifier. What can you use to identify the router? Also can you change the software on your device and the router? – heavyd – 2013-09-10T19:09:43.940

1

If it doesn't support IPv4, it doesn't need the IPv4 router's MAC address.

If it doesn't even know what IPv4 is, how could it know what an IPv4 router even is? Why would it ever need to talk to the IPv4 router?

It's important to realize that the "router" you think about on your LAN is actually an IPv4 concept, up at the Network Layer (layer 3). There's no such thing as an "Ethernet-layer router"; inter-network routing is a Network-layer (layer 3) task. At the Ethernet layer, there could be a "forwarding path" through multiple switches (technically called "bridges") on the network, but that kind of Ethernet-layer path finding is called "switching" or "bridging", not "routing". When using precise terminology, we reserve the term "routing" for something that layer-3 devices do.

If a host supports some other routable layer-3 protocol, it will find that protocol's layer-3 router using protocols defined by that other routable layer-3 protocol.

For example, IPv6 uses a different EtherType (Ethernet protocol ID number) than IPv4. IPv4 uses 0x0800, whereas IPv6 uses 0x86dd. IPv6 hosts use IPv6's Neighbor Discovery Protocol (NDP) to find MAC addresses of their neighboring hosts and routers on the same Ethernet LAN. NDP is built on ICMPv6, which of course is built on IPv6.

As another example, AppleTalk was Apple's proprietary protocol stack for Macs in the 80's and 90's before TCP/IP took over. AppleTalk's Network layer (layer 3) was called DDP (Datagram Delivery Protocol). AppleTalk hosts found their DDP routers via the AppleTalk Address Resolution Protocol (AARP), EtherType 0x80f3.

Someone else could probably give you examples of how similar things were accomplished with all the 80's and 90's proprietary protocol stacks that TCP/IP eventually vanquished: Novell IPX/SPX, Banyan VINES, DECnet, etc.

The few non-IPv4/ARP/IPv6 Ethernet-based protocols still in use today are generally not directly routable beyond the edge of the current Ethernet LAN, and thus don't need to find any layer-3 routers. PPPoE, 802.1X (EAPOL), and 802.1D Spanning Tree Protocol (STP) spring to mind. PPPoE finds PPPoE Access Concentrators (servers) and their MAC addresses via a broadcast-based protocol called PPPoE Active Discovery (PAD). 802.1X and STP just multicast their packets to special multicast MAC addresses that were specified and reserved by the IEEE for those protocols' purposes.

Spiff

Posted 2013-09-09T16:10:25.127

Reputation: 84 656