IP Address vs MAC addresses

27

4

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

Jony

Posted 2010-04-14T18:08:02.637

Reputation: 385

1why 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. – None – 2010-04-14T18:50:13.837

Answers

27

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.

Martin Konecny

Posted 2010-04-14T18:08:02.637

Reputation: 1 147

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

– None – 2010-04-14T19:26:13.680

1What'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 – 2011-12-31T19:49:07.680

2Because 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 – 2012-01-18T03:43:23.390

16

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.

Adriaan Stander

Posted 2010-04-14T18:08:02.637

Reputation: 376

8

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.

iPhone beginner

Posted 2010-04-14T18:08:02.637

Reputation:

6

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.

Ocelot20

Posted 2010-04-14T18:08:02.637

Reputation: 160

2

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

Charanjeet singh

Posted 2010-04-14T18:08:02.637

Reputation: 21

1

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).

shiva

Posted 2010-04-14T18:08:02.637

Reputation: 111

0

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.

Larry

Posted 2010-04-14T18:08:02.637

Reputation:

0

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.

user32771

Posted 2010-04-14T18:08:02.637

Reputation:

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. – None – 2010-04-14T18:33:43.833

Just illustrating a situation where they do change – None – 2010-04-14T22:05:32.053

0

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.

manuel

Posted 2010-04-14T18:08:02.637

Reputation:

0

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.

Kasturi

Posted 2010-04-14T18:08:02.637

Reputation: 101

0

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.

bradhe

Posted 2010-04-14T18:08:02.637

Reputation:

0

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.

sinni800

Posted 2010-04-14T18:08:02.637

Reputation: 3 048

0

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.

dbasnett

Posted 2010-04-14T18:08:02.637

Reputation: 459

0

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.

RomiSupreme

Posted 2010-04-14T18:08:02.637

Reputation: 146