Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com May 24 '10 at 17:19

9 Answers

up vote 13 down vote accepted

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.

share|improve this answer
2  
+1 This is really the key issue. IP can run over different physical layers. Different physical layers require different physical addressing. MAC is the addressing used by Ethernet. And there are other Ethernet-based protocols that do not use IP including BootP, DUX, and IPX. The same physical Ethernet may also handle IPv4 and IPv6 simultaneously. But in the end, everything is delivered to a MAC on Ethernet. – Rob Napier May 24 '10 at 16:35

Because TCP/IP is used over Ethernet, which uses MAC addresses.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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?

This was discussed in episode #29 of the Security Now podcast (HTML transcript).

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.

share|improve this answer
Why couldn't MAC addresses have been smart like the IP and have been implemented in such a way that it is hierarchically organized? Were they simply careless or is there a restriction which makes it impossible? – Pacerier Dec 31 '11 at 19:37
1  
MAC addresses are assigned by the hardware manufacturers and they have no idea where the network devices will be deployed nor in what configuration. There are lots of sites (such as this one) which allow you to identify the manufacturer of network cards by MAC address. – Doug Harris Jan 1 '12 at 0:02
Good argument (and explanation thx !) – Pacerier Jan 1 '12 at 13:40

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.

share|improve this answer

You don't know the MAC address of stackoverflow.com because it's not in your local network. MAC addresses are used as an identifier to the next hop in the chain. The "IP" is just used in a protocol that has a hint of in what direction it should send your packet (which gateway to use next).

share|improve this answer

Because MAC addresses are needed for communication on the Link Layer (IP addresses are used one layer up on the IP layer).

share|improve this answer

The IP is either defined in the OS or in the driver software for your network card, or given to you by your network, and can be changed dynamically. The MAC is an identifier for your network card, i.e. the hardware. There is not a 1-to-1 relationship between them.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.