MAC Address


See this article in another language:

What is MAC address?

MAC stands for Media Access Control, a unique 48- or 64-bit physical address for each network device. The MAC address is defined on network NICs or network cards. MAC is a burn-in address, i.e. it is engraved on the hardware by the manufacturer.

Also, the NIC factory is not allowed to put any MACs on the NICs they manufacture. Imagine that all the factories that were going to make network cards randomly chose MAC.

If such an event occurs, it is possible that two network cards in a computer network have the same MAC address, the software finds it, and as a result, two devices in the network have the same MAC address and the same physical addresses.

So what's the solution?

There is an organization in the world called IEEE, one of the tasks of this organization is to manage all MAC addresses. IEEE stands for Institute of Electrical and Electronics Engineers and actually does the job of standardizing MAC addresses.

The standard that IEEE considered for the MAC address is called EUI-48. This standard replaced the MAC-48 and EUI-64 standards. Any devices such as home computers (PCs), laptops, printers, smartphones and gadgets, home modems, etc. that are supposed to work on a network must follow this standard.

EUI-48 means unique identifier extended by 48 bits. The EUI-48 and MAC-48 standards are very similar to each other.


Institute of Electrical and Electronics_EUI-48


The MAC address has 48 bits, of which 24 bits are always determined by the IEEE organization itself for factories. The second 24 bits are set at the factory. 24 bits means 24 to 0s and 1s. That is, the number of NICs a factory can produce with 24 bits will be 16,777,216.

The first part of the MAC address determined by the IEEE is called the OUI, and the second 24 bits of the MAC address, which are engraved on the hardware by the manufacturer, are called the device ID. Also, the physical MAC address has a written structure.

The MAC address is written in hexadecimal format and separated by a ":" character. In hexadecimal, the base numbers are 16. That is, in this system, the symbols 0 to 9 are used for the values 0 to 9 and the symbols A to F are used for the values 10 to 15.

After 0 to 15 the values are the digits with which the hexadecimal is created. You should know how to convert binary, hexadecimal and decimal numbers between them.





















































MAC های 64 بیتی


64-bit mac addresses

In some networks using IPv6, 64-bit MAC addresses are used for each network device. The reason for using these kinds of physical addresses is that the mirroring expectation of 48-bit MAC addresses will end someday.

By having 48 bits (that is, 48 numbers 0 and 1 next to each other), it is possible to produce 2 to the power of 48 different ways. This means you'll be able to have 281,474,976,710,656 different ways for 48-bit MAC addresses.

In the case of 48-bit MAC addresses, it is expected that until the year 2100 we will not have the problem of missing physical addresses on the basis of Ethernet technology, but nevertheless, in some network devices, the problem of missing these addresses is already expected.

Also, when all networks migrate from IPv4 to IPv6, we probably won't have 48-bit MAC addresses anymore. Using 64-bit we would have 18,446,744,073,709,551,616 different states.

MAC Address numbering

To determine the MAC address, two different numbering methods called UAA (Universally Administered Address) and LAA (Locally Administered Address) are used.


شماره گذاری MAC Address


Universally Administered Address

UAA is the physical address that the factory stamps on a NIC's hardware. That is, in fact, UAA includes the default MAC address of a hardware in the network platform, and as we explained above, its 24 bits including OUI are specified by IEEE and the other 24 bits are specified as Device ID from the factory yes .

OUI stands for Organizationally Unique Identifier and indicates a unique organizational identifier. For the first time, IEEE allocates one OUI to each company and if all MACs of this OUI are used up, companies can purchase a new OUI by paying a fee to IEEE and use it for their devices.

Therefore, through the first 24 bits of the MAC Address of a piece of hardware, it is possible to find out which company it belongs to. I wanted to list you the OUIs of different companies, but unfortunately the number of these OUIs for each company is large.

Through the ouilookup site, you can find out which company your hardware is made by, or what OUIs each company has.

Locally Administered Address

LLA is the address changing MAC value. If a device's LLA changes, that device will use that value as its MAC address on the network. There is a small chance that the MAC address of two devices is the same in networks.

Changing the LLA and changing the MAC address usually has other uses in computer networks. But if for any reason you see similar MAC addresses in your computer network, simply change the LLA of one of these devices.

For example, if your computer or servers receive a specific service using MAC address, you may need to change your device's MAC and physical address. Or it may be possible in some organizations to access a specific service only through a specific MAC.

There are other reasons to change the MAC address, many of these reasons are related to security issues and we will discuss them in the future. As can be seen from the name LAA, this type of MAC address is used for local networks.

The meaning of MAC Address

MAC addresses, in addition to specifying which company manufactured the NIC devices, can have other meanings as well. For example, you can find out if it's unicast or multicast from the MAC address.

Each 8 bit is called a byte or octet. Therefore, a 48-bit MAC address contains 6 bytes or 6 octets. The eighth bit of the first octet of a MAC address determines whether the MAC address is unicast or multicast.

So that if the 8th bit of the first octet equals 0, that MAC address is unicast and if the 8th bit of the first octet equals 1, that MAC address is multicast.

Also, the seventh bit of this octet determines whether a MAC address is set globally or locally.

The meaning of a global or local MAC address is that this MAC address is set by the network administrator or is set by default by the manufacturer.

If the MAC address is set or changed by the network administrator; The seventh bit of its first octet will be equal to 1, and in fact this type of MAC address is of type LAA. If the seventh bit of the first octet equals zero, this MAC address is of type UAA.


معنی MAC Address

Leave your comment