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.

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?

share|improve this question
    
@Ramhound, With just a Ethernet address we would be able to send Ethernet packets from one computer to another right? –  Pacerier Sep 9 '13 at 16:41
    
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 Sep 9 '13 at 18:18

3 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.

share|improve this answer
    
By "configure them by hand", Do you mean if the sticker is lost the hardware is essentially useless? –  Pacerier Sep 9 '13 at 16:47
    
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 Sep 9 '13 at 16:49
    
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 Sep 9 '13 at 16:54

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.

share|improve this answer
    
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 Sep 9 '13 at 16:37
    
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: en.wikipedia.org/wiki/Address_Resolution_Protocol. –  ultrasawblade Sep 9 '13 at 16:51
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 Sep 9 '13 at 17:24
    
@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 Sep 9 '13 at 17:57
    
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 Sep 9 '13 at 19:07

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.

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.