Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we need MAC addresses when you have local IP addresses

From what I understood, MAC addresses are physical addresses only used in LAN to identify a device.
However, local IP addresses can also identify a device on a local network as it is unique. So why do we bother to include MAC addresses when we could have only used IP addresses for both LAN and WAN ?
I understand that this is what the OSI model and some protocols are based on but my question is rather why has it been made that way in the first place ? It seems like additional unnecessary data to send through the network and MAC addresses it can be spoofed.

like image 825
Segfolt Avatar asked Sep 05 '25 03:09

Segfolt


2 Answers

Why are dynamic IP addresses a problem ? For example routers have a routing table for MAC adresses. Why couldn't we make a dynamic routing table that would store local IP adresses and that would be updated upon connection / disconnection of a device ? Or maybe the problem is elsewhere, I'm a bit confused why the dynamic part is a problem.

A packet can sure get to the target device with an IP table instead of MAC table, but with dynamic IP, the packet may finally get to the wrong device(when the old device get offline and a new device takes the same IP), the new device cannot decide if the packet is to itself without the an identifier, that's when the MAC come in.

like image 122
Felix Huang Avatar answered Sep 07 '25 19:09

Felix Huang


Let me give you a simple answer. THE local IP address will dynamically change when you are disconnected from the WIFI network or ethernet. (sometimes it's not changing because that anyone else is not connected to the network to reserve your recent IP). so MAC address is a unique address for your network card. We can uniquely identify your device from it. It cannot be changed but nowadays also can change it.

like image 24
Thirasha Avatar answered Sep 07 '25 20:09

Thirasha