MAC Address Explained [Deep dive]
What is a MAC Address
A Media Access Control address (MAC address) is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment. This use is common in most IEEE 802 networking technologies, including Ethernet, Wi-Fi, and Bluetooth. Within the Open Systems Interconnection (OSI) network model, MAC addresses are used in the medium access control protocol sublayer of the data link layer.
MAC addresses are primarily assigned by device manufacturers that why they are called burned-it address, hardware address, or physical address.
Network nodes with multiple network interfaces, such as routers and multilayer switches, must have a unique MAC address for each NIC in the same network. However, two NICs connected to two different networks can share the same MAC address.
MAC Address format
As typically represented, MAC addresses are recognizable as six groups of two hexadecimal digits, separated by hyphens, colons, or without a separator.
Universal vs. local (U/L bit)
Addresses can either be universally administered addresses (UAA) or locally administered addresses (LAA). A universally administered address is uniquely assigned to a device by its manufacturer.
Locally administered addresses are distinguished from universally administered addresses by setting (assigning the value of 1 to) the second-least-significant bit of the first octet of the address.
In virtualisation, hypervisors such as QEMU and Xen have their own OUIs. Each new virtual machine is started with a MAC address set by assigning the last three bytes to be unique on the local network. While this is local administration of MAC addresses, it is not an LAA in the IEEE sense.
Unicast vs. multicast (I/G bit)
The least significant bit of an address’s first octet is referred to as the I/G, or Individual/Group, bit.
- Unicast: When this bit is 0 (zero), the frame is meant to reach only one receiving NIC.This type of transmission is called unicast. A unicast frame is transmitted to all nodes within the collision domain. In a modern wired setting, the collision domain usually is the length of the Ethernet cable between two network cards. In a wireless setting, the collision domain is all receivers that can detect a given wireless signal.
If a switch does not know which port leads to a given MAC address, the switch will forward a unicast frame to all of its ports (except the originating port), an action known as a unicast flood. Only the node with the matching hardware MAC address will accept the frame; network frames with non-matching MAC addresses are ignored unless the device is in promiscuous mode.
- Multicast: If the least significant bit of the first octet is set to 1 (i.e. the second hexadecimal digit is odd) the frame will still be sent only once; however, NICs will choose to accept it based on criteria other than the matching of a MAC address: for example, based on a configurable list of accepted multicast MAC addresses. This is called multicast addressing.