What is a MAC Address?

So that is the topic of this blog. Now the MAC or media access control address is an identifier that every network device uses to uniquely identify itself on a network. So no 2 devices anywhere in the world will have the same MAC address. The MAC address is made up of a 6 byte, hexadecimal number that is burned into every NIC by its manufacturer.

Components of a MAC Address

The MAC address can contain any number and it also contains alphabets from A – F. The MAC address is broken up into 2 parts. The first 3 bytes identify the manufacturer of the NIC, such as Linksys, Netgear, TP-link, etc. The last 3 bytes are a unique number from the manufacturer that identifies each device on a network.

Formats of MAC Addresses

The MAC address is also referred to as the physical address or hardware address. MAC addresses are formatted in different ways. On a Windows computer, it will look like this, with dashes in between the digits. On Apple and Linux systems, it will have colons in between the digits. And Cisco will display the MAC address like this, where 4 sets of digits are separated by periods.

Purpose of the MAC Address

So what exactly is the purpose of the MAC address? The purpose of the MAC address is so network devices can communicate with each other. Whenever a device wants to talk to another device, it’s ultimately done using the MAC address. And this is whether the devices are close to each other, such as being on the same network, or if they are thousands of miles apart on a different network.

MAC Address vs. IP Address

The bottom line is that devices communicate with each other using the MAC address. Now you might be asking yourself, well if devices talk to each other using the MAC address, what is the purpose of an IP address? I mean aren’t IP addresses also unique? Well public IP addresses are unique. But public IP addresses can periodically change.

So you may have had a certain IP address for the past few months, but an internet service provider or a network administrator can change your IP address to a different one. But MAC addresses don’t change. They are permanent. Now the way TCP/IP works, which is the language that’s used on networks and the internet, a networking device needs both an IP address and a MAC address.

The IP and MAC addresses work together so devices can talk to each other. So as I stated before, the MAC address is used to identify a device, but an IP address is used to locate that device. So for example in a typical neighborhood, you have houses and you have people living in those houses. Each house has a mailing address and the person living inside has a name.

An IP address is like the mailing address of a house. The mailing address tells us what country, city, and the street of where the house is located. But it doesn’t necessarily tell us who lives in the house. But a MAC address is like the name of the person. It tells us who lives in the house. So an IP address tells us where a networking device is located. But a MAC address tells us specifically who the device is.

Communication Between Devices

So as I stated before the MAC address is ultimately used when devices want to talk to each other. So here we have a local area network that you would find in a typical home or business. So let’s say that computer A wanted to communicate with computer B on this local network.

So computer A is going to inspect computer B’s IP address to see if it’s on the same network or not. So after inspection, computer A now knows that computer B is on the same network because the IP addresses are in the same group. So now in order for communication to take place, computer A needs computer B’s MAC address and it finds this by sending what’s called an ARP or address resolution protocol broadcast.

So it will broadcast to every device on its local network, asking computer B to identify itself by asking for its MAC address. Then once computer B tells computer A its MAC address, communication can finally take place.

Communication Across Different Networks

So in another scenario, what if 2 devices wanted to communicate with each other but they are on different networks. So let’s say that computer A wanted to go to google.com. Now in order for computer A to go to google.com it needs the MAC address for Google’s web server. But the problem is, is that it doesn’t know what it is. So this is why it needs the IP address to get the web server’s MAC address.

So computer A will type in google.com in its web browser and then DNS will change google.com into an IP address so computers can understand it. So computer A will inspect Google’s IP address and realize that the IP is not in its local network because the IP address is not in the same group as its local network. So now computer A realizes that Google’s IP address is on a different network and since it’s on another network it’s going to forward the data to its default gateway which is the router and then it will let the router deal with it.

So again computer A will send out an ARP broadcast and this time it will ask for the MAC address of the default gateway. Then once it has the MAC address it will send the data to the default gateway. Then once the default gateway has the data it will inspect Google’s IP address and determine the best path for the data to reach the destination.

So it will forward the data to the next router. But before it can forward the data it also needs the next router’s MAC address. So it’s also going to do an ARP broadcast and ask for that router’s MAC address. Then once it has it, it will forward the data. And then that router needs the MAC address of the next router, and so on.

Then once the data reaches the final router in its path, that router needs the MAC address of Google’s web server. And then once it has it, the data has reached its final destination. So as you can see each time data is passed between a computer or a router device it uses the MAC address to forward the data at each step.

Summary

So to summarize, the IP Address is used to locate and get to the final destination. But the MAC address is used at each step on its way to the final destination.

Finding Your MAC Address

Now if you want to find the MAC address of a computer, this is how you do it. So on a Windows computer, you just open up a command prompt and type ipconfig /all. On Linux and MAC computers, you open up a terminal and type ifconfig. So here is our MAC address for this Windows computer and as you can see it’s listed as the physical address.

Now a computer can have more than one MAC address. It just depends on how many network interfaces it has. So for example, this computer has 3 MAC addresses. This one here is for the wired network adapter. This one here is for the wireless network adapter. And this one here is for the Bluetooth network adapter.

Categorized in:

Uncategorized,

Last Update: September 1, 2024