Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

why do we need ip addresses if mac address is enough to identify the machine???

share|improve this question

migrated from Apr 15 '10 at 7:46

This question came from our site for professional and enthusiast programmers.

why do we need street addresses if ADN secuence is enough to identify a person? In a similar way, this question mix the levels of abstraction and function for both numbers. – Hernán Eche Apr 14 '10 at 18:50

14 Answers 14

up vote 27 down vote accepted

IP addresses are hierarchical, so that routers throughout the internet know which direction to forward a packet. With MAC addresses, there is no hierarchy, and thus packet forwarding would not be possible.

share|improve this answer
It's worth noting that these are fundamental different layers in a network model as well. IP addresses deal with the network layer. mac addresses deals with the link layer(and a link layer is usualyl point-to-point). see e.g. – leeeroy Apr 14 '10 at 19:26
What's the reason that MAC addresses couldn't have been hierarchical in the first place (hence dismissing the need for an abstraction layer IP above it) ? – Pacerier Dec 31 '11 at 19:49
Because a MAC address is assigned to your network card when it is manufactured. It is then shipped and placed in random computers around the world, and thus no hierarchy :). IP addresses are assigned when you connect to your ISP, and so a hierarchy is maintained. – Martin Konecny Jan 18 '12 at 3:43

From MAC Address vs IP Address

When the packet is being sent out to a statipn that is on the same network LAN segment, only the MAC address is needed. When the packet goes beyond, to different networks and travels through routers, the MAC address is still contained in the packet, but only the IP address is used by the routers.

Also from What's the difference between a Mac Address and an IP Address?

MAC addresses aren't part of the discussion, simply because they never travel beyond your local network, and they can't be hidden as they're simply required for networking to work.

share|improve this answer

There are many reasons. For example: MAC address is bound to hardware. It means you can't or rather are not supposed to have the same MAC on different hardware. Imagine that google has to change DNS binding of "" to "MAC" address each time they change some network card on front-end server.

Another reason is that MAC addresses are assigned by producers while IP addresses are assigned by network admins. This allows building hierarchy of addresses that is root of packets routing. This is because way from IP A1.A2.A3.A4 to B1.B2.B3.B4 is easily predictable and way from MAC#1 to MAC#2 isn't.

Next reason is that MAC is Ethernet-related stuff and there are other network technologies that might not use MAC at all.

share|improve this answer

Sometimes we don't want to identify the machine. One machine can have two IP's, IP's can represent things that aren't machines, the list of reasons goes on and on, I'm sure others will come up with some better ones.

share|improve this answer

IP - means Internet Protocol which is used to communicate between Inter Connected Networks (Internet = Inter Connected Networks OR Group of Diffrent-2 Networks Connected together )

MAC - means Media Access Control , which is used to communicate in a SINGLE Network OR in Same Network ( Network = Group of 2 or more hosts )

IP Addresses are systematically distributed worldwide by IANA (Internet Assigned Number authority ) , So that END-TO-END Locations can be easily Find out by routers * BUT MAC Addresses are not Distributed Systematically ....Because MAC Addresses are assigned to your LAN card when it is Manufactured by some vendors. It is than Shipped and placed in random computers around the world

share|improve this answer

There are several layers in networking stacks, each designed to address a specific level of abstraction.

Layer3, also known as routing layer, is designed to make two machines in different networks communicate. At this layer, routers, need to be able to give each machine it knows a unique ID. This is the IPAddress. IPs are hierarchial ie. they have a part that tells the router, which network a ip address is in, and the rest specifies the specific machine (mostly).

Layer2 uses mac-addresses are to identify a specific networking card within a local network. There could be more than one card for a specific machine, that can then share the same IP. This is called Multihoming (

typically, the router uses ARP to find the mac that corresponds to a specific IP (if it doesn't know about it), and once it discovers the mac, it keeps a note of it for a specified time (ie. until the ARP cache is deleted, based on router config).

share|improve this answer

Once an ethernet packet from a host transits through a switch or router to its destination, the source MAC address of the original host is replaced with the MAC address of the port on the switch or router. At that point, only the source IP address references the sender.

share|improve this answer

Your ip address changes all the time, but your mac address is always fixed in the hardware of your network card.

When you connect your laptop at home, through your phone, in a cafe' - you need to get a different ip address.

share|improve this answer
not necessarily, there are cards on which you can change the mac-address (not consumer cards ofcourse ;) ). Ip changes only if you use dhcp. In data centers, for example, they might be statically configured. – shiva Apr 14 '10 at 18:33
Just illustrating a situation where they do change – user32771 Apr 14 '10 at 22:05

Routers deal with IP address. It learns about the network topology by IP addresses, not MAC. Also, there are things like private IP addresses, which are not applicable for MAC addresses.

share|improve this answer

The primary reason is due to the length of the mac address. Searching for a mac address (which happens in a switch) is more time consuming than doing a longest IP address match (which happens in a router).

Sometimes looking up for a longest Ip match is also time consuming, in which case MPLS is used in which a very small number (called a label) is looked up in a MPLS enabled router.

share|improve this answer

IP addresses and MAC addresses are used by two different layers of the OSI model. IP Addresses are used higher in the model than MAC addresses.

A good example of their uses is NAT or Network Address Translation. NAT allows multiple machines to send packets over a network but look like it's coming from one computer (i.e. your ISP gives you one IP address but you have multiple computers on your network).

What a NAT device does is it will receive a packet from your computer, rewrite the IP address with it's own, but keep the MAC address the same on the packet. It will then transmit the packet.

When it receives a response for that packet it will then look up the MAC address in that packet and rewrite the IP address with the IP address of your computer (most NAT devices keep a MAC -> IP address table internally) so the router knows where to send the packet!

Also note that MAC addresses are assigned by the manufacturer of the device while IP addresses are completely arbitrary.

share|improve this answer

This is because IP-Adresses are "routable". Those are divided in networks, those subnetworks relay to different parts in the world, like an address. The Mac Address is completely different for everybody, it can not be located.

It's like telling somebody how your house looks for him to find it. Rather give him the address, huh?

See this: OSI-Model on Wikipedia

From this model you see where things happen. MAC (Media Access Control) is on the 2nd layer from the bottom. IP is on the third. It uses MAC to identify PCs, but only on a very local scale.

share|improve this answer

The short answer has been given, but to repeat, it is organizational. The reason it is needed is because until every router has the memory and speed needed to store the Route to every MAC, something had to be done, hence IP Addresses.

Just to be clear. Devices communicate through a mixture of MAC / Protocol addresses. Both parts must be correctly implemented for the network to function.

If you browse this site from your home PC and looked at the packet as it left your computer, little, if any, of the packet overhead would resemble what it looked like as it entered the server that is this forum. When I say packet overhead I am talking about MAC address, IP Address, Port, etc.

share|improve this answer

I have read an article discuss about this issue. The title of the article is HTML 5 Geolocation API & IP Geolocation provided by It is very helpful for differentiate the features of Wireless geolocation technique by MAC address and traditional IP address detection.

share|improve this answer

You must log in to answer this question.

protected by Community Jan 23 '15 at 12:11

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .