What is a MAC address?

MAC stands for Media Access Control. The MAC address is globally unique – which means that no two devices in the world (in theory) will share a MAC addresses.

What do the numbers mean in the MAC address?

A MAC address is typically represented by six groups of 2 hexadecimal numbers. When presented in a friendly format for humans to read, the six groups are generally separated by either a hypen (a “-“) or a colon (a “:”). So, a MAC address could look like this: 01-33-45-69-89-yz, or even this: 01:33:45:69:89:yz, where each group of 2 hexadecimal numbers is separated by the hyphen or by the colon. Each group is composed of 1 byte – or 1 octet – since both terms represent 8 bits.

The first three bytes of a MAC address (which is also the first half of the MAC address) are specific for each manufacturer of the hardware. What does that mean? Well, if you see a MAC address that starts with “00:05:69”, then you know that the hardware was manufactured by the company VMWare. Similarly, you can identify hardware manufactured by Intel just by looking at the first three bytes of the MAC address. The last three bytes (or the second half of the MAC address) are assigned by the manufacturer as they please – as long as those last three bytes are unique then the manufacturer can assign those bytes as they see fit.

Can a MAC address be changed?

MAC addresses were originally meant to be both globally unique and permanent, but in newer hardware it is actually possible to change the MAC address. So, yes, the MAC address can be changed on most new hardware.

Are MAC addresses only for devices with an ethernet interface?

No, this is a popular misconception. Even iPhones – which have no Ethernet interface – still have (and need) a MAC address.

How to get a MAC address using PHP?

Retrieving the MAC address of a client connecting to your website using PHP is not possible. This is not some limitation of PHP – this is simply because the MAC address is lost once the client’s packets have been routed from their local subnet to the gateway that leads out to the Internet. The client’s local router can of course access the MAC address, but once the packets proceed past that point and into the ‘outside’ world of the Internet, the MAC address simply can not be retrieved.

What are some uses for the MAC address?

One common method used to secure wireless routers is to add a list of all the MAC addresses of all devices that should have access to the router’s network. If a device’s MAC address is not on that list, then it is not allowed to access the Internet through that router. This is commonly known as MAC address filtering.

I’ve also seen hotels use MAC addresses to give their guests a fixed period of free time – like 30 minutes of free time daily – to access the Internet. Because guests will have to go through the hotel’s router to access the Internet, the hotel router can remember the MAC addresses of devices that accessed the Internet. This way, if you try to access the Internet again after exceeding your daily free 30 minutes, you will be denied. The reason these hotels don’t use cookies is because it is too simple to get around that – you can easily delete your cookies to access the Internet again. But, the only drawback is that if a guest has multiple devices – like an iPhone and a laptop – then he/she could get a full hour of free Internet time, since the MAC address is only different for every device, and they have no way of knowing that both devices (like the iPhone and the laptop) belong to the same guest.

Hiring? Job Hunting? Post a JOB or your RESUME on our JOB BOARD >>

Subscribe to our newsletter for more free interview questions.

One thought on “What is a MAC address?”