1

If one or more IP addresses can map to the same MAC address, why are MAC addresses necessary? Even though MAC is a data link layer address and IP is a network layer protocol, why isn't an IP sufficient?

This question talks about why MAC addresses are not sufficient but I was wondering why IP addresses are not sufficient.

5
  • What makes you think multiple devices can have the same up address? You cannot, you would cause a conflict in on the network obviously, breaks every network best practice that exists
    – Ramhound
    Commented Sep 7, 2022 at 3:52
  • @Ramhound the OP said the inverse. one device has multiple IP addresses, which is quite common capability, normally called IP aliasing.. Also, what you describe different devices having the same IP address is also quite common, most dns servers that server a lot of traffic use anycast, where the network will route to different devices based on availability and proximity. Of course there are issues, but for short transactional traffic like dns it provides a lot of value.
    – toppk
    Commented Sep 7, 2022 at 4:37
  • @toppk - When I use the phrase "device" I mean a network adapter. One typically does not assign the same network adapter multiple IP addresses.
    – Ramhound
    Commented Sep 7, 2022 at 5:04
  • @Ramhound: on the contrary, one does assign the same network adapter multiple IP addresses on a daily basis, so [citation needed] Commented Sep 7, 2022 at 10:18
  • @user1686 - I am seriously trying to think of an actual use case of where I have assigned a single network adapter multiple ip addresses. Perhaps it’s me who is confused by the author’s question
    – Ramhound
    Commented Sep 7, 2022 at 12:38

3 Answers 3

2

If one or more IP addresses can map to the same MAC address, why are MAC addresses necessary? Even though MAC is a data link layer address and IP is a network layer protocol, why isn't an IP sufficient?

At first there was indeed no such separation between layers, and Ethernet addresses were directly used as host addresses. But as soon as you have more than one network-layer protocol, the separation becomes inevitable as the original protocol's "network" address – whose format is set in stone at that point – becomes the "data link layer" address for the newly introduced protocols.

  • Originally, Ethernet wasn't built to carry IPv4 (which didn't quite exist yet) – it was built to carry Xerox's Pup protocol suite, and the early "Experimental Ethernet" did directly use 8-bit addresses that were the same as 8-bit Pup addresses.

    So when other people wrote specifications on how to carry IPv4 over Experimental Ethernet, those 8-bit Pup addresses became the 8-bit "MAC" addresses from IPv4's point of view.

  • Later, when Xerox switched to 48-bit addressing (because 8 bits wasn't long enough) they again directly used the 48-bit Ethernet address as part of the XNS host address. And at this point they were already in the situation where 8-bit Pup addresses had to be translated to 48-bit Ethernet addresses.

  • Now imagine that Ethernet hardware directly worked with 32-bit IPv4 addresses. If that were the case, in order transport other protocols such as IPv6 over existing networks (without having to rip and replace every single switch and NIC) you would still need to include a residual IPv4 header below the new IPv6 header, and you'd need a way to dynamically map a node's IPv6 address(es) to its IPv4 address (sounds a lot like ARP, doesn't it), and then you'd still end up with exactly the same situation as today except the "MAC" address would be 32-bit.

    (In a sense, you could say that this is exactly what happened. Because Ethernet addresses were (in part) XNS addresses, you could actually say that the 48-bit MAC address was originally an "IP" address from another world – it just became a "MAC" address when Ethernet was adapted to carry different kinds of protocols that did not use the same address format.)

The cause in all cases is that the "link layer" address isn't only known to the OS, it's also used by the hardware. For example, in old shared-bus Ethernet (where every node saw every packet), the hardware would look at the "destination MAC" field and discard unwanted packets so that the CPU would remain undisturbed.

With later improvements to Ethernet, the MAC addresses aren't limited to hosts only – they're also tracked by Ethernet switches. Every single switch builds an in-memory "Ethernet routing table" that says which MAC (L2) addresses are behind which physical (L1) port, so that it would correctly deliver L2 frames to only the specific port that wants them (instead of flooding every packet across the entire ethernet).

This means whatever header and address format was chosen, literally gets baked into the hardware of all Ethernet NICs and all Ethernet switches, and becomes mandatory to use by all other network-layer protocols.

0

it is easy to design a physical interface that only uses IP data and you could eliminate the macaddress entirely. You would have to rethink how dhcp works, since mac address are essential to how dhcp functions today, but many dhcp transactions already don't use macaddress as the unique id of the client. on the downside, much of the silicon involved will have to inspect a bigger and more dynamic portion of the header. imagine if your switch and ethernet adapter had to be replaced to move from ipv4 to ipv6.

Also, there are many networking capabilities like bonding and so forth which would have to be redesigned. even now, ip networks aren't universal, for example fibre channel and infiniband networks didnt' talk ip for a while, and many deployments have no interest in IP on those networks.

IP is slowly gobbling up much of the network, just as http3 is slowly gobbling up TCP. So it is entirely possible that a new network design skips operating with macaddresses all together, but this would probably only happen inside a cloud factory like aws or google.

0

MAC or media access control address started out by a unique identifier for a device. It was also called BIA or Burned In Address. It was in the firmware.

Then large companies started ordering network adapters with a particular range of MAC addresses. Which started destroying the uniqueness.

Now Mobiles often use random MAC addresses.

Still, for the most part, I can use it to identify devices on the network, especially when I want to assign some of them static IP addresses.

You must log in to answer this question.

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