If my computer has an IP address,why does it need a MAC address?

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 2
    In order to give the best answer to you, could you expand your question to include why you think you would not need a MAC address if your computer has an IP address? – Brett Lykins Sep 22 '13 at 16:10
  • 1
    I would recommend picking up a good basic book on Networking and reading it; will be worth it. It will answer this question and many more: amazon.com/Computer-Networking-Top-Down-Approach-Edition/dp/… – Manoj Pandey Sep 22 '13 at 18:02
  • 4
    This sounds pehaps snarky, but it is the simplest way to reduce the confusion. Why did you put an ethernet NIC in your computer? Answer that question, and it answers the question about the necessity of a mac address. – Mike Pennington Sep 22 '13 at 18:39
  • 4
    @Reprovo, the only place where comments/answers really make this statement is when the OP responds to Teun Vink's answer with a desire to avoid networking models in the answers. If you don't know the why's and how's of the network models, you really don't understand your network and "getting the job done" will either be much more painful or create additional problems. There are many things you don't really need to know as a network professional (for example, how bits are put on the wire, etc), but the network models are not something they can avoid getting at least a basic understanding. – YLearn Feb 9 '14 at 14:17
  • 2
    @user1369975, I think you are missing the point. We are not saying the question is invalid, nor are we saying people don't need to learn. However this is a site for network engineers/professionals and asking to frame an answer here while ignoring the basic foundations of networking is not reasonable. If you want an answer not directed at other network professionals, you should ask it on one of the other sites such as SuperUser. – YLearn Feb 10 '14 at 18:07
up vote 11 down vote accepted

without going into OSI model, TCP layer, etc.:

Back in time, networks were created: some computers would communicate with each other to share something. TO do that, they need to know who was talking and who was being talked to. So, instead of giving each computer a name, we gave them an ID. This ID is called MAC address, is should uniquely identity each computer.

(ok, identify each network card, but back that time, you could think one MAC address for each computer).

There wasn't a unique specification on how computers would talk to each other: many protocols appeared: TCP/IP, IPX/SPX, and so on. Each protocol would specify things as they thought was ok. For example, IPX/SPX would address each computer using the MAC address and some more information.

But the TCP/IP protocol was designed a little bit different: they decided that having an virtual address, made of 4 bytes (0.0.0.0 to 255.255.255.255) was enough, and was even easier to manage: it doesn't matter if your network cards all have a similar MAC address or not, we'll group our computer so that all TCP/IP address that began with 10.0.x.x. are part of the engineering group, and those of 10.1.x.x. are the printers, and...

So, if a TCP/IP address needs to comunicate with another, is just uses the TCP/IP address. But the network devices need to know to which network card that message is going, so they, somehow, translate the TCP/IP address with to the MAC address.

Why simply eliminate the MAC and use just TCP/IP ?

some reasons:

  • easy to group TCP/IP addresses,
  • all devices are built to take care of the MAC address, in that low-level requirement, and would need to be changed
  • despite being the vast majority (I think :-P ), some other protocols are still in use and they rely on the MAC address

MAC addresses and IP addresses operate on different layers of the internet protocol suite. MAC addresses are used to identify machines within the same broadcast network on layer 2, while IP addresses are used on layer 3 to identify machines throughout different networks.

Even if your computer has an IP address, it still needs a MAC address to find other machines on the same network (especially the router/gateway to the rest of the network/internet), since every layer is using underlying layers. On the page mentioned earlier you can find some nice diagrams explaining the protocol suite in detail.

  • ,thanks a lot for your answer but it would be better if anyone could give an answer,without going into the specifications of the O.S.I. Layer or T.C.P. Layer – user1369975 Sep 22 '13 at 16:44
  • 11
    If that's too hard, this really isn't the site for you. You could argue this question is off-topic as it is, since this is considered common knowledge for network engineers. – Teun Vink Sep 22 '13 at 17:04
  • 11
    @user1369975, the models you reference are the frameworks for how networks are designed to operate (both hardware and software). Without that basic understanding, there would be no meaningful answer to your question. That would be similar to asking (about a US citizen), "if they have a name why they need a social security number" without allowing mention of government in the answer. – YLearn Sep 22 '13 at 18:45
  • 5
    Think of a MAC address as a description of a house on your street. To your neighbors, they will all understand "The green house" or "Mr. Johnsons house" or "The duplex on the corner" -- These are comparable to a MAC address, descriptive only locally. An IP address is publically routable, so it would be like using the full addres: 123 Main St, Somewhere, CA 92069. Then I guess IP to MAC would be like the mailman coming to the street and yelling "WHO IS AT 123 MAIN?!?!?" and Mr. Johnson hearing him and saying "Here, the green house!" I guess? Horrible analogy. – David Houde Sep 26 '13 at 10:27
  • 2
    That explains why it's needed given the current architecture. But why was the architecture designed that way in the first place? I could easily imagine a world where there are only local IP addresses and WAN IP addresses. It's technically possible. – Hello World Jul 27 '15 at 10:34

When you understand that IP-to-IP communication is really just a series of MAC-to-MAC communication taking place at each router hop, then you'll see why both are necessary.

The IP header of a packet leaving your workstation destined to an IP in a different subnet will maintain the source IP and destination IP, forgetting about NAT for the moment. [Later, I will discuss what happens when the destination is within the same subnet.] The Ethernet header contains your source MAC and the destination MAC of your default gateway. There's no knowledge of the final destination MAC from your perspective. That first router will rewrite the source MAC to itself and the destination MAC to the next router hop, and so on, until the packet arrives at the last router that is directly connected to the destination subnet.

To attempt a simple illustration, consider the L2/L3 headers as a packet moves from the source IP (sIP) to a destination IP (dIP) and the source and destination MACs are rewritten along the way -- fs=first-source and ld=last-destination, and r1-r3 are routers:

fsMAC-r1MAC / sIP-dIP 
r1MAC-r2MAC / sIP-dIP
r2MAC-r3MAC / sIP-dIP
r3MAC-ldMAC / sIP-dIP

Any L2 switches involved will not modify the MAC addresses.

Now for communication to another IP within your subnet, direct MAC communication is needed, but to get that MAC addr requires the ARP protocol that uses a broadcast in the subnet to find it. By the way, this is how your workstation gets the MAC address of your default gateway that must exist in your same subnet.

  • 3
    So to summarize, MAC is what gets the message from one hop to another, while IP keeps track of the original source and destination. This seems analogous to a post office, where I address my letter to Grandma in Phoenix, but the mailman who picks it up from the mailbox only cares about bringing it to the post office, and the post office only cares about bringing it to the sorting center etc... – CodyBugstein Jun 24 '14 at 17:17
  • 3
    My question however is, why have a separate protocol for MAC? Why not just determine the next IP address to hop to, and store current source/destination IPs alongside original source/destination IPs? – CodyBugstein Jun 24 '14 at 17:18
  • @Imray: First problem with eliminating the MAC protocol requires a redesign/rewrite of the Ethernet and TCP/IP standards. Second, IP is not the only protocol at L3 that uses MAC addresses at L2 to communicate. Third, MAC addresses are normally tied to hardware (burned-in) addresses on NICs while the IP at the higher level are allowed to be somewhat arbitrary for flexibility. Fourth, MACs are only locally relevant while IPs are globally relevant (not considering more recent changes with NAT'ing and private addresses that were not part of the original design). – generalnetworkerror Jun 28 '14 at 8:20

There isn't anything physically stopping you from designing network which has just IP address for L2 and L3. Then 'ethernet switch' would learn SIP address of incoming packets and flood or forward towards DIP address.

However this network would only ever support IP, when next-generation of IPvX comes, it would not work, as the 'ethernet switch' couldn't support that protocol. You also couldn't run various other protocols, like IPX and AppleTalk, or some new protocol you're developing and testing in your home.

Abstraction layers increase development speed and encourage innovation, as you don't need to rebuild whole house to change a window.

Now you could have ran same ethernet switches and migrated your network in between from IPX to IPv4 to IPv6, without touching your LAN at all.

  • There is nothing physically stopping you from designing this network, other than these components, which exist only in your imagination: A) an ethernet switch that learns source IP addresses B) an ethernet NIC without a mac address – Mike Pennington Sep 23 '13 at 13:02

The IP address and MAC address serve different (but crucial) purposes:

The MAC address gets a frame from one NIC to the next. The IP address gets a packet from one Computer to the Server

So given the following:

Source Computer  <--->  RouterA  <--->  RouterB  <--->  Destination Server

What directs the packet to the from the "Source" to the "Destination" is the IP address. But what gets the packet from the Source Computer to RouterA, and then from RouterA to RouterB, and then from RouterB to Destination is the MAC addresses.

You can see the relationship in this illustration:

Packet Traveling - How Packets move through the Internet - pracnet.net/pt

  • Of course, it is very common for the router-to-router links to use a protocol that doesn't have MAC addresses. – Ron Maupin Apr 12 at 14:49
  • @RonMaupin Yes. Of course. But... how is that relevant given the question asked specifically about MAC addresses =)? – Eddie Apr 12 at 14:53
  • It just seems that your answer implies there will be a MAC address assigned at every hop, which can be misleading. It also works if your diagram shows MAC addresses on only the first and last hops. It is a bit incomplete, which is why I made the comment. – Ron Maupin Apr 12 at 14:58

The IP protocol provides the foundation to support the notion of subnets and routing. This means IP doesn't assume your destination is in the same network - if it's not, your traffic needs to be forwarded through an intermediary device such as a router. IP has TTL/Hop Limit fields and such that support this.

Ethernet assumes that the destination MAC is directly reachable when data is shipped out of its interface. Ethernet was originally designed when the most common way to connect computers in a network was through a physical bus topology. Even though almost all wired Ethernet traffic is switched now, logically it still works like a bus topology. So the underlying assumption with Ethernet is that the node with the destination MAC is physically on the same network. There is no such assumption with IP.

I guess you could "hack" Ethernet into doing subnets and routing, but you might as well engineer a protocol that doesn't rely on the low level details and assumptions of Ethernet, and that's why we have IP.

To be as simple as possible:

A Mac Address is the physical or virtual address of your NIC card or network interface. From a computer on a network's standpoint, it is the physical address of that computer's NIC card. It is used to bring information to that computer on Layer 2 of the OSI model.

The IP address is required on layer 3. You require it to communicate with computers on different subnets and devices.The IP Address verifies "where" the device is located within a network.

The IP addresses and Mac Addresses are used in tandem. Address Resolution Protocol is used to link the two together by resolving IP Addresses to Mac Addresses within the Link Layer within a single network.

You might want to also check here for a more in-depth explanation.

  • 1
    Keeping it Simple: If you have a Name, you identify yourself in the locality. You need to have a SSN, to keep you identified at the Global level – pulsarjune Mar 14 '14 at 11:57

MAC address represents the hardware ones its assembled it is constant and diffrent systems in our network made by diffrent vendors have very diiffrent range of mac addrees so that they are difficult to arrange as a network.but using ip addresss we can arrnge the devices in our network in arange that is simultaneous addresses.also we can not send our mac addrees to outside networks

To start with, this is a very good question, which touches upon the basic network foundations. The bottom line to your question is, we don't really need a MAC address in order to achieve connectivity. Theoretically, a network could be built implementing IP addresses alone! However, some practical difficulties may arise out of using such a scheme. If you expect to manually assign an IP address to each network device, then you may avoid the major pitfalls. However, if you need to automatically assign IP addresses, as when there are too many network nodes to manually administer, then there is no way to make sure each node is allocated exactly a single IP address, or a predetermined number of them, because you cannot tell one from the other, unless the address distribution entity can uniquely and unequivocally identify the requesting device, e.g. by its MAC address, which is assumed to be unique for any device in a LAN. Such an unidentifiable device may repeatedly ask for additional IP addresses and, eventually, wreak havoc on the network viability. Back to the topic, all you need to establish an IP-only network, is to let network interface adapter's Data Link Layer pass through any data frame it receives, directly to the Network Layer, regardless of any MAC comparable address type, where it can be filtered according to its destination IP address, instead of being filtered at the Data Layer. Just to illustrate the concept, assume a network is established by interconnecting RS-232 UART ports: UART devices don't have MAC addresses, or any other unique identifier, for that matter, yet you could construct a local network using UARTs and IP addresses alone, providing you install the proper UART drivers. Hope this passage gave you some insights on the subject.

protected by Community Mar 14 '14 at 12:07

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 or ask your own question.