31 ms·
Why do we need MAC addresses?
- mmastrac 1y agoA MAC address is needed to bootstrap IP, even if non-routable - and because we don't want to bootstrap MAC addresses, we just assign them statically. From the very beginning (oversimplifying a bit, but I digress), a MAC has really just been the key in a hashed map from MAC to switch port. You _could_ design a system where MAC addresses were always randomized, but this technology evolved at a time where processing power and the bandwidth of your switches likely might have struggled with the additional load. If we were designing a system from scratch it would probably make sense for everything to have hierarchical, switch-local identities that were cheap to allocate and check and put a bit more extra routing storage in the switch chips to efficiently route these.
- themafia 1y ago> a MAC has really just been the key in a hashed map from MAC to switch port. Until you consider broadcast/multicast traffic.
- Polizeiposaune 1y agoIn the very beginning of ethernet there were no switches - you just had a bunch of transceivers connected to a length of coax cable. Every NIC on the wire saw every packet; the destination mac address indicated whether the packet was interesting enough to each node to be worth putting a copy in host memory and bothering the CPU to look at.
- kstrauser 1y agoFor the young’uns amongst us: switches use to be an expensive luxury. Most small LANs used cheap hubs at the edges, where every inbound Ethernet frame was sprayed out to all the other ports. They commonly had “collision” lights, and they used ‘em.
- eszed 1y agoYup. Was going to say the same thing. I remember my first encounter with a switched network bent my brain. What, I have to give everything an address? Where'd this 192.168 come from? Networking used to be so easy! Anyway, we all learned and adapted.
- windexh8er 1y ago> A MAC address is needed to bootstrap IP... This is fundamentally incorrect. IPv4 for LAN, sure - but "bootstrap" it is not. There's plenty of L2 that have no MAC: PPP, ATM, Frame Relay, etc. Also, MACs aren't needed for IPv6. ND works without MAC in v6. And, finally... There's no MAC for loopbacks.
- chasing0entropy 1y agoNone of those l2 protocols can traverse a wan without an encapsulation layer which always requires an address or link to the physical layer.
- immibis 1y agoSure they can - a WAN is the same as a LAN, but bigger. However, that comes with different tradeoffs, in particular the need to reduce bandwidth by using less chatty protocols. But you can absolutely rent a fiber between two buildings in the same city and run Ethernet on it.
- yusyusyus 1y agoa bit disappointed this only points to ethernet as its answer. it does help to understand why ethernet requires addressing versus some others that do not.
- kstrauser 1y agoPretty much everything that isn’t point to point, like PPP or a VPN, can carry IP traffic directly without needing to care about MACs (because they’re only talking to one other interface). Anything that routes physical packets around needs the equivalent of a MAC address.
- kmeisthax 1y agoEthernet was designed to be the cheapest way to network multiple machines together. Everything was connected to a single long loop of coax with "vampire taps" that literally bit into the coax to connect multiple machines. So there's no central machine routing packets, instead each machine needs to decide whether or not a packet is intended for it. So the packets have to have a unique[0] destination address, as well as a source address so you know who to reply to. Notably, none of this implies IP. IP was the expensive DARPA project that the military was building out. Ethernet is just "I am machine X, I want to talk to machine Y, here's some data". It just so happens that Ethernet was very popular, and people wanted to route IP over Ethernet. But you could route all sorts of other protocols over Ethernet as well and it would more or less work. So now we need two different classes of addressing: one for just the local network, and one for the IP network running on top of it. And to make matters even worse, we don't use Ethernet in its original configuration anymore. First we replaced the loop of coax and vampire taps with 8P8C wire and passive hubs, then switches got cheap enough that we stopped making hubs. Ethernet framing also wound up being used for Wi-Fi, except like 99% of all Wi-Fi connections are in Infrastructure mode running IP anyway. If Ethernet had been built to run IP exclusively, we wouldn't need Ethernet's header or MAC addresses at all. It would just need to encode IP packets and their boundaries. Even IPv6 wouldn't need a separate header as IP has its own version field. [0] MAC addresses are supposed to be unique, but let's just say it's "LAN-scoped" and leave it at that.
- ranger_danger 1y ago> The correct answer is simple: The Internet doesn't use MAC addresses, and Internet packets don't have MAC addresses. At all. > A typical packet found on a typical network has a structure like this: > Destination MAC address > Source MAC address
- userbinator 1y agoThat jumped out at me too and seemed an "LLM-ism", but the article looks entirely human-generated.
- jeannot12 1y agoThe fact the wrong ethertype is used in the packet at the beginning (0x88dd, IPv6 instead of 0x0800 for IPv4) made me think of an AI generated article too.
- userbinator 1y agoIt is consistent with the rest of the fields for IPv6, but normally one would write IPv6 explicitly, and implicitly IP to mean IPv4.
- kstrauser 1y agoIP packets and Ethernet frames are separate animals. Ethernet doesn’t know IP, except for a flag saying “interpret my payload as an IP packet”. It doesn’t have src or dst IP addresses. And an IP packet doesn’t know about its physical transport. It doesn’t have src or dst MAC addresses. You can put other things than IP packets inside Ethernet frames. You can put IP packets into non-Ethernet carriers. The short version is that small LANs route frames by MAC addresses and don’t know about IP addresses, and the Internet cares only about IP addresses and not MAC addresses.
- ranger_danger 1y agoYes I am aware, I was just pointing out that they are claiming that MAC addresses exist in "packets" (not frames) while simultaneously saying they don't.
- ajross 1y agoThe answer to this question is wrong: > Why don't we just make IP networks without Ethernet? The article implies that we need MACs, and of course we don't, and lots of protocols exist that don't use ethernet framing. SLIP and PPP only speak IPv4, for example. Also the real reason behind the "why" is more boring than the blog implies. Ethernet predates IP. It's a simple (almost the simplest possible) protocol for a bunch of hosts to share a single network without running into trouble talking to each other. And it decided on a hardware-unique "MAC" as its way of doing addressing. It was simple, so it was cheap. So everyone built out cheap ethernet hardware. And when it arrived, everyone wanted to run IP on their cheap ethernets.
- shrubble 1y agoWhen a router is used you still do see the MAC address but only of the directly connected next hop/device. If another router, then it would change the headers appropriately.
- jonathanlydall 1y agoA router is connected to multiple networks and for networks running on Ethernet, yes, each device on those networks has a MAC address its interface connected to it. The headers of IP packets wouldn’t be affected by MAC addresses, Ethernet packets carry IP packets as their payload and would have their own headers as appropriate. A router’s job is essentially to “pass on” or relay IP packets based on its routing tables, they are what connect networks together.
- Animats 1y agoThe MAC address is meaningful only for a single link. It doesn't get copied through routers and get carried along to the destination. (At least in theory. Between software defined network hardware and enterprise WiFi, there are cases where MAC addresses have wider scope. But they rarely leave an organization.) The Xerox plan for Ethernet was to use XNS, with a 32-bit network ID and a 48-bit MAC. Routers only had to know how to find a network ID, and once the packet hit the correct destination network, the MAC address routed it to the destination. Early on, there was a thing for "multi-protocol routers", that forwarded XNS, DECnet, IP, and a few other things such as Parc Universal Protocol, PUP. Cisco was once big on this, because Cisco came out of Stanford, which had a few of everything and tried to interconnect them. In the 1990s, most of those branded protocols died out, although as late as Windows 2000, Microsoft still supported TP4, a bad idea from circuit-oriented telco people. There was a telco approach to networking, where you dialed up a reliable circuit to your destination, transmitted what you had to send, and later got a bill for the call. This, fortunately, lost out to IP. (I had real doubts about pure datagram long distance networks. We didn't know how to deal with congestion in the middle of a pure datagram network. We still don't, but cheap fiber saved us from having to.)
- kstrauser 1y agoDon’t get me started on the ugly detour that was ATM, for when Bellheads wanted to build out the Internet like a phone switch, and when no one could agree on optimal cell sizes and they compromised on 53 bytes to piss off everyone equally. (Also, to have been a fly on the while when you worked out that whole congestion thing.)
- Animats 1y agoIt took over two decades for things to settle. The telco people had ATM and Frame Relay and DSL voice and a Bell Labs thing called Datakit. They were trying to get deterministic voice, so voice over packets wouldn't suck. What we ended up with is voice with lag, jitter, echo, dropout, and over-compression. So nobody talks on the phone much now.
- 1y ago
- userbinator 1y agoSomething seems a bit off about this article. "Because Ethernet came first" is the real answer; and it being a local network technology, was not readily scaled beyond that, despite the MAC address space being 64k times larger than the IPv4 address space. A key point worth noting about the IP address space, which enabled this crucial scaling to global networks, is its hierarchical structure. MAC addresses are assigned to hardware interfaces, independent of their location, while IP addresses are assigned hierarchically much like numbers in the telephone system, allowing for relatively easy routing at a global scale. A typical packet found on a typical network has a structure like this IPv6? That's... not really "typical", yet. IMHO even packets with 802.1q tags are going to be more commonly found and "typical" than IPv6.
- mrbluecoat 1y agoWhy do we need MAC addresses? So we can spoof them, of course.
- bschwindHN 1y agoAt university, our network required antivirus to be installed, which really sucked and destroyed the performance of your machine. So my laptop became an Xbox, which was exempt from antivirus policies :)
- 9front 1y agoMedia Access Control (MAC) address is the method to control access to the physical transmission medium. A switch doesn't care about your upper layers (IP, TCP, etc.) but won't find your host without a MAC address. That's why MACs are called hardware address and work on the local link only, from the port on your cool network interface to the other end of the cable or radio signal.
- Ekaros 1y agoIP and routing is actually the interesting question. Somehow we need to get these IP packets to right place. And this opens up question how would it be done with just IP packets? You would at least need some extra protocol over IP as IP itself really does not have idea where the next jump on the route is... Routing on Internet scale is messy question really. And then moving physical bits over any medium is also somewhat complicated always. So ethernet and MACs works relatively well for helping in both... Still, it is somewhat nice thought exercise to think how you would do without it.
- 9front 1y ago"The Internet doesn't use MAC addresses, and Internet packets don't have MAC addresses" is a wrong assumption. What's an "Internet packet"? Without MACs there's no networking. Without networking there's no Internet.
- immibis 1y agothe internet predates MAC addresses - it was originally running over serial modem connections.
- 9front 1y agoTrue. In the Second Edition the Preface mentioned that "Finally, the number of UNIX installations has grown to 10" and some of those systems were connected mostly via telephone lines. The article refers to a "typical packet found on a typical network" then describes an Ethernet frame, so the author clearly refers to MACs in an Ethernet setup. MAC is part of the Ethernet standard. The clue of why is needed for is in the name "access control". Without MAC there's no Ethernet. Without Ethernet there's no Internet. Wait ...there are other networking standards!
- immibis 1y agoAre any of them typical?
- ranger_danger 1y agoLayer 3 IP packets indeed do not contain MAC addresses, but layer 2 (ethernet or otherwise) frames might.
- negative_zero 1y agoNetwork people: Do we even need MAC addresses anymore? Can we not just have a UUID that the device generates? They seem to get more abuse over time i.e. MACs are how a car is uniquely identified and authenticated with fast charging CCS networks for Autocharge.
- rubatuga 1y agoWe don't NEED it, just like we don't need to use IP. But the standards are just easy to use. Feel free to develop your own L2 protocol. I remember using SLIP to make a point to point over FM radio, and there was no addressing used, just IP.
- kaelwd 1y ago> Can we not just have a UUID that the device generates? They kinda are already, your phone probably uses a random MAC address for each network it connects to.
- iqfareez 1y ago[dead]
- rubatuga 1y agoArticle is pretty spot on. We need MAC addresses for local area networking. Nothing is stopping you from using any physical layer outside of your home network. But of course everything client these days uses Ethernet based technology.