Difference between MAC and IP address

642 views

I’m aware that the mac address is part of the data link layer, but why can’t I just use my MAC address as IP address, too?
Why do I need both addresses?

In: 14

16 Answers

Anonymous 0 Comments

I like comparing it to your ID, vs your Passport.

Your ID (MAC Address) identifies you locally, with your countries authorities that have it registered somewhere, and as long as you are in your country (local network) it’s a perfectly useful way to identify yourself.

When you go to a different country, they don’t give a damn about your ID. You’ve got to use your passport (IP Address), a document that although it’s issued locally, every government has agreements about what they mean, which ones allow you to go to which places, and will help identify you if needed. When you go out of your country, most other places are not looking at you for who you are, they are mostly looking at the agreements with your country. And depending on those, how they’ll treat you will vary. You are basically masked by your country (so although you may have a local IP address, when going out of your network you use a public IP address for identification, masking your local IP address).

If any country needs to get back to you, they do it through whatever channels they have to communicate with your country of origin. And using your ID, your country can ensure everything gets back to you.

Anonymous 0 Comments

Your MAC address is your name. Your IP address is your location.

Name alone isn’t sufficient, because it doesn’t tell how to find you. Location alone isn’t sufficient, because there might be someone else there right now.

Anonymous 0 Comments

The MAC address is a specific hardware identifier. It might be more helpful to think of it as the name of the device rather than the address.

The IP address is a location to get to.

If I said “I need this to go to Bill Smith” without any further information, it would be very difficult to get a message to him. However, if I said “I need this to get to the occupant of suite 342 in Generic Fancy Hotel in Singapore,” that would be a pretty good set of instructions which would tell people where they need to go to bring a package to Mr. Smith. His name is Bill Smith regardless of whether he’s sleeping in Singapore, in London, or at home in Ashburn, Virginia, but each of those locations has a different address.

If you’re connecting to something on your laptop at home, and at a hotel on the other side of the world, it’s the same MAC address. However, that MAC address does not have any information on how to get to the recipient.

The laptop will connect to the internet through the network’s outward-facing IP address. Typing in https://www.netflix.com will result in a Domain Name System query: if an IP address for this domain name isn’t already saved in a local cache, it asks the default DNS server where to go. If that DNS server doesn’t have it, it will ask another DNS server, until it either comes up with an answer or decides that it can’t find an answer. With this IP address, the router will consult its routing tables to determine the best router to send your request in order to get a step closer to the destination, until it ultimately gets to Netflix’s network, where they will send your request to a computer called www, which will return a file called main.html to be displayed in your web browser. It will go through the same process of determining a route to get to your internet-facing IP address. Once it gets here, the router and other network devices figure out which MAC address on the network to send main.html to, and then you can click something on main.html to use the same process to request that www send you the Oaxaca episode from the new season of *Somebody Feed Phil* because you want to see a funny guy eat Mexican food for 45 minutes.

Anonymous 0 Comments

An IP address is like your address and the MAC address is like your fingerprint. You can change your address but you can’t change *who you are*. At least, not under normal circumstances. Someone wants to come talk to you, they need to know both where to find you and who you are.

It isn’t a perfect allegory but it functions for our purposes. The big difference is that computers don’t really care who they are talking to, they just know they need to talk to *some computer* in *some remote network*. The devices closest to the target computer are the ones that worry about the MAC <–> IP mapping.

If you want more details, then the ARP protocol and switch CAM tables is what you need to understand for the actual MAC –> IP map. That table exists on the same network as the remote computer. As far as the other remote computer, all they need is an IP address and a port number (assuming you are doing NAT/PAT) which will uniquely identify a network address.

Anonymous 0 Comments

IP addresses are used when communicating in an IP network. (Duh.)
MAC addresses are used when communicating over an ethernet (or ethernet based) network.

It is perfectly possible to communicate over IP, where one (or both) of the hosts are not connected to an ethernetbase network and therefore also don’t have a MAC address.
Ex: Your mobile device that uses IP over a cellular network, doesn’t have a MAC address on its cellular interface.

If you want to talk over IP to a device on a local network, the MAC address is required and there is a translation protocol (ARP) to discover the local MAC address based on the IP address.

A big difference between IP and MAC addresses is that IP is a routing based protocol, you can address devices outside of your own local network.
MAC addresses are only used locally, you can only reach things that are in your own network. (If you connect to an IP address outside of your local network, on ethernet it connects to the MAC address of your local router.)

In more advanced settings you can have a single IP address being used by multipe devices (and MAC addresses) to provide redundancy/clustering and other fun things.
As there is not always a 1-to-1 relationship between IP and MAC, you can’t really skip it and need both.

Anonymous 0 Comments

Ethernet is a way to make a small network. IP is a way to put small networks together to make a big network.

Because there are two kinds of networks happening at the same time, each one has its own rules, like its own type of address. IP addresses are for IP networks (like the Internet) and MAC addresses are for Ethernet networks.

Why does it work this way? History mostly, but it is convenient for things like IPv6. Your Ethernet network can be part of the IP network, and also part of the IPv6 network, at the same time.