Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Apr 15 '10 at 7:46

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

1  
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
add comment

14 Answers

up vote 21 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
1  
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. en.wikipedia.org/wiki/OSI_model –  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
1  
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
add comment

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
add comment

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 "google.com" 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
add comment

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
add comment

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
add comment

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 (http://en.wikipedia.org/wiki/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
add comment

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
add comment

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
add comment

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
add comment

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
add comment

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
add comment

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
add comment

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
add comment

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

share|improve this answer
add comment

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.