0

I learned that in a local network computers that communicate inside this network not only need the IP address, but also a MAC address.

Is this a relict from the early days of computer networking?

Because when I have the IP address, I have the "address" )or the identity) of the host I want to talk to. No need to get the MAC address of the destination host. You also do not require MAC addresses when you talk to a computer in the public network - here also you just need the IP address.

It seems that MAC addresses are used to do an IP-MAC mapping inside a switch in a LAN, but it seems redundant since the switch already should know which port leads to which host with a given IP address. The switch knows the IP addresses of the connected hosts, it knows at which port to send the data from to the correct host with the correct IP address.

I also know a MAC address identifies a physical hardware device in a host. Maybe it is needed when a host has multiple hardware network devices? In an analogy, the IP address would be the postal address where to deliver a package to, and the MAC address would identify the entry to take (like main entry, rear entry, chimney)? Is that the reason of a MAC address? But if so, it still would not matter. It would not matter through which hardware device the data has been delivered, as long as the data has been delivered to the correct address (IP address)...

I've read What is the exact use of a MAC address? but don't feel it provides a satisfactory answer.

Alex
  • 387

5 Answers5

3

Networking isn't quite as simple as it seems. We're talking about a layer cake, there's a lot of things happening under the surface. It's important to understand that communication has 2 levels; physical and logical.

Everything networking is defined by IEEE 802 standards. Ethernet is governed by 802.3, WiFi 802.11.

The first layer is Physical, OSI Model Layer 1. Here we have only electricity, radiomagnetic radiation and light; actual physical cables, antennas and interfaces. Everything on this layer is dumb, the devices have no awareness of each other whatsoever.

On top of physical is the Data Link Layer, OSI Model Layer 2. This is where the ones and zeros get translated to modulations of the signal, and vice versa. This is the minimum requirement for devices to be aware of each other, and to be able to communicate at all. Because multiple interfaces can be connected to a single L2 network segment, each interface must have a unique L2 identifier, i.e. hardware address - the MAC address.

The Protocol Data Unit on this layer is called frame, and the structure is:

+--------------+-----------------+---------+------------+
| SenderL2Addr | RecipientL2Addr | Payload | ErrorCheck |
+--------------+-----------------+---------+------------+

L2 frames can only be forwarded within the same subnet and broadcast domain. Devices in the same subnet / bcast domain communicate using L2 addressing.

Next one up is the Network Layer, OSI model Layer 3. This layer handles transmissions between networks. To allow communication on this layer each device must have a unique L3 identifier - the IP address.

The protocols on this layer neither do nor need to have any knowledge of physical medium, and they don't care about pysical transmission; that's L2 job. The PDU on this layer is called a packet, and the structure is:

+--------------+-----------------+---------+------------+
| SenderL3Addr | RecipientL3Addr | Payload | ErrorCheck |
+--------------+-----------------+---------+------------+

During transmission the L3 packet is encapsulated in the L2 frame, it's the payload. So when the data hits the wire, the frame actually looks like this:

+-----------+-----------+-----------+-----------+---------+--------+
| SndL2Addr | RcpL2Addr | SndL3Addr | RcpL3Addr | Payload | ErrChk |
+-----------+-----------+-----------+-----------+---------+--------+

Because IP is a L3 protocol, it has no method for handling actual data forwarding on the physical level. So without L2 protocols data simply cannot move between systems.

Of course it would be theoretically possible to remove L2 with its addressing from the picture entirely. However - as already said - this means we're not talking about 802.3 and .11 anymore. New standards would be required, all protocols would need to be re-written from the ground up, new chipsets would need to be designed, manufacturing processes changed to produce them, new devices would need to be designed, new manufacturing processes to produce those...

Excluding certain enterprise-class networking devices L3 is handled on software, but L2 is on hardware; i.e. chips. That means your phone wouldn't be able to communicate using WiFi, as its WiFi hardware is designed according to 802.11 standard.

The only realistic way for the transition to happen would be through natural device retirement cycle. That's a slllloooowwwww process.

The idea of re-designing networking this way is magnitudes more demanding than IPv6 adoption. It was introduced 1995, but took off only about a decade ago. The adoption globally is around 40%. So while I can imagine a future where MAC addressing is scrapped (tho' I don't really see a reason why) it's VERY far in the future indeed.

Peregrino69
  • 5,004
1

Some more context: I learned that MAC addresses are used in a Switch of a LAN to map the port of a switch to a certain MAC address. But why not map the port of a switch to a certain IP address? That should work exactly the same way to route a package from a source to a destination host ...

It would, but then your switch would be limited to IPv4/IPv6 (or even just IPv4 if it was older). It would practically just become an IP router.

But there actually exist various other things that run over Ethernet but are not IP, such as several "pro audio" protocols – and in the past, there used to be even more.

(For example, an IPv4 LAN would have coexisted with a NetWare IPX-based LAN, and/or a Xerox XNS LAN, and/or a DECnet LAN, and/or an OSI CLNP LAN... all on the same ethernet.)

When Xerox originally invented Ethernet, it did use the same addressing at both Ethernet level and network (Xerox Pup) level. According to their own articles, this turned out to be too inflexible.

grawity
  • 501,077
0

A MAC address (although it can be spoofed) is the only way to uniquely address a device or network interface. An IP address (I assume you're talking about IPv4) is not unique, can be randomly assigned to other interfaces and needs to be aligned to the network the device is connected to. A device can have more than one IP address and having a dynamic IPv4 address (as in DHCP) can be very useful. DHCP cannot work without a MAC address or something very much like it.

Then there is the important fact that IP (v4) is not the only network protocol.

StarCat
  • 1,280
0

I see it in the same way of Alex. When you want to ping someone on a LAN, you still do it using the IP address, not the MAC. The switch will ask around to whom that IP address belongs, find out the MAC, give it back to you and only then you can send the message. Why can’t the switch just use the IP address?

The answer I get is: because this is the OSI model. Then: why is the OSI model designed like this? Why there is this redundancy?

-1

No, MAC is not a rudiment. It's a requirement precisely for Ethernet and WiFi due to their multi-access feature, to distinguish peers behind the same link. MAC is not always needed; think of a serial link with IP running over PPP, there are no MAC addresses, because there is only one peer on the other side of the link, and no need to distinguish between them.

Think about physical city. There are postal addresses (like "100 East Davie Street Raleigh, NC 27601. United States"), and there are routes in terms of metro stations, like go to line 1 or A or "red" and travel up to station "station". And you can't use a car or a bus, you are required to use the metro to travel around the city.

The first (postal) is like IP address. The second (station name) is like MAC address. Continuing the example, if there is a single railroad line and there are no intermediate stops, there is no need to even have names for stations, you always travel to "other end"; this is how PPP works.