On networks that use the TCP/IP protocol, why is the IP address translated into a MAC address?
I mean, when every device knows its IP, why further use the MAC address and not use the IP number as the address directly?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The main difference is that the IP address is used by IP which is a network protocol, and the MAC address is used by Ethernet a link layer ( 2 ) protocol. IP can run over different layer 2 protocols, so it doesn't include the "media access" functionality. You can run IP over Serial lines, Ethernet, DSl, ISDN, etc.
For example, DHCP provides dynamic IP addresses over Ethernet; the DHCP server needs the MAC address so it can assign an IP address to a PC.
Because TCP/IP is used over Ethernet, which uses MAC addresses.
They are for different layers in the network stack. The MAC address is about the ethernet networking layer and the IP address is about, well the IP layer. You can use IP over different transports like SLIP where there is not MAC because there is not ethernet. You can also use protocol different than IP over ethernet if you wanted to.
If you think about it, if I dial in over a SLIP connection one IP packet could start with not MAC associated and then have a different MAC as it hops from one router to another as it is forwarded across the internet to the final IP destination.
I could answer your question with another question: You have a phone number, so why do you need a social security number/national identification number?
In other words, they serve different purposes. One is for identifying who you are (SSN, MAC), whereas the other is for defining how to reach you (phone number, IP address).
Further, it's possible to reach someone on the phone if they don't have a SSN (different country, for example) just like it's possible to reach someone on the Internet if they don't have a MAC (different type of link layer). Different link layers have different methods of identifying the destinations and sources of data packets.
Another way to look at this is to ask the reverse question: Why do we need IP addresses when we already have MAC addresses assigned to the hardware?
With MAC addresses, our computers can directly communicate to a single machine. But, in order to know how to get there, we need to have our packets routed to it. It's impractical to have a global MAC address lookup table on each of our computers.
IP addresses, on the other hand, are hierarchically organized. Our computers can determine which IP addresses are on the LAN and the rest get sent to the LAN's gateway (e.g. a home router). After leaving the LAN, successive routers look at the IP address and route the packets on to another router. Eventually, a router which has the destination IP address on its LAN can identify the MAC address and send the packet to the destination computer.
MAC addresses are guaranteed to be unique to the machine (the network card typically contains the MAC address) and unchanging, whereas you can redefine the IP address on any given machine.
Additionally, public IP addresses can be shared by a whole company using Network Address Translation, so public IP addresses are not guaranteed to have a one-to-one correspondence with a machine or person.
Your question is a very legitimate one! The truth is that theoretically an IP only system can be created and function well without the need for MAC addressing system. The Data Link layer can be made to ignore any MAC filtering, leaving this functionality to the Network layer, to filter out according to its own IP address. Such systems existed in the past, such as networks based on linking devices through their UART (e.g. RS232) ports. Obviously, these networking interfaces did not carry MAC addresses or any other form of a unique, physical identity. However, it can make centrally assigning IP addresses, e.g. by a DHCP server, a nightmare, because there would be no way to make sure a device will not get more then the predetermined number of IP addresses allowed to each device. Also, it would be difficult to unambiguously and individually identify each device. The MAC address being unique, at least within a sub-network, serves as a unique identification token. Of course, individually assigning IP addresses to devices may solve the problem, but where large number of devices are present on a network, it becomes impractical to establish and maintain such a scheme.
Lets take a example
If you apply for job in company.. will they give you that without knowing your identity? certainly not.... so your actual identity proof is Mac address
and when you join the company they will give another employee ID to communicate among that company employees.. this is IP address.
your employee ID can be modified if you change company but your actual info about you can never be changed (age,name,etc)....
IP address are like ZIP codes or like country codes or an ISD codes, wchich simplifies the location address otherwise its is very difficult to sort all the MAC address or to identify the exact location else the computer will take hell of time identifying the address or keeping huge database of MAC address on local computer.