- Definitions
- Changing a MAC Address (MAC Spoofing)
- MAC/IP correspondence
Definitions
For the data routing protocol to work reliably and consistently, one key component is essential. As humans, we can easily identify a machine by its IP address or by its name retrieved through DNS. A machine, however, must be able to unambiguously recognize the destination device to deliver packets. To do this, it relies on a specific hardware identifier, directly used by its network interface: the MAC address (Media Access Control).
Note: This has nothing to do with a "physical address" in memory architecture. In computing, a physical memory address refers to a specific location on the memory bus, as opposed to a virtual address managed by the operating system. A MAC address, by contrast, relates strictly to network hardware.
A MAC address is permanently and uniquely assigned by the manufacturer the equipment is manufactured. The MAC address unequivocally identifies the network card whether it's a computer, smartphone, printer, or any other connected device. Unlike an IP address, which can change dynamically (via a DHCP server or manual configuration), the MAC address normally remains the same throughout the device's lifetime, unless it is deliberately altered.
Every network interface, wired or wireless, has its own MAC address. This address is used within the data link layer (layer 2 of the OSI model) to insert and manage the hardware address in each network frame exchanged. This is sometimes referred to as the Ethernet address or UAA (Universally Administered Address). Standardized on a length of 48 bits, or 6 bytes, it is written in hexadecimal notation, generally in the form of bytes separated by
: or -.For example:
5A:BC:17:A2:AF:15In this structure, the first three bytes identify the network card manufacturer: this is known as the OUI (Organisationally Unique Identifier). These prefixes, assigned by the IEEE, are also used in other hardware addressing schemes, such as Bluetooth and LLDP, to guarantee worldwide uniqueness.
Changing a MAC Address (MAC Spoofing)
In theory, the MAC address is designed to remain fixed, but there are ways of modifying it, notably to meet particular needs or to circumvent certain constraints. This operation, often referred to as spoofing MAC, involves replacing the original hardware address with a different value, defined at software level. Some operating systems facilitate this modification, particularly when the actual Ethernet address is not directly used by the driver.
The reasons for such a change are varied. It could be the need for a given application to require a specific Ethernet address in order to function correctly, or to resolve a conflict of identical addresses between two devices sharing the same local network.
Changing the MAC address can also be motivated by privacy considerations: by hiding the unique identifier engraved on the card, users reduce the possibility of their device being tracked by networks or surveillance services. However, this practice is not without consequences. Changing a MAC address can disrupt certain filtering devices, or require firewalls to be reconfigured to authorize the new hardware.
Some networks, particularly Wi-Fi, use MAC address filtering to allow only devices with approved addresses. While this adds a basic level of control, it is not secure on its own. An attacker can capture a valid MAC address already authorized on the network and clone it to bypass restrictions. For this reason, MAC filtering should always be combined with stronger security measures.
MAC/IP correspondence
For a local network to work efficiently, there must be a clear mapping between physical addresses (MAC addresses) and logical addresses (IP addresses). Without this link, a computer might know the IP address of a destination but wouldn't know how to physically send data to it on the local network.
This mapping is handled automatically by the ARP (Address Resolution Protocol).
In practice, when a user wants to know the MAC address corresponding to a specific IP address, the user can use the
arp utility. This tool checks the machine's local ARP table to display known matches between IP addresses and MAC addresses on the local network. In this way, it is possible to quickly verify the effective link between the logical and physical layers.Practical example: if you want to check which network card corresponds to the IP address
192.168.1.5, use the following command:arp –a 192.168.1.5
The output will display the associated physical address (MAC), the nature of the input (static or dynamic) and the Interface concerned.
Interface: 192.168.1.5 --- 0x5 IP Address MAC Address Type 192.168.1.5 00:54:BC:17:14:6E D
It's important to remember that the MAC address and the IP address are two completely different identifiers, yet closely complementary. The MAC address is uniquely engraved into each network interface by the manufacturer and is used to physically identify the device on the local network. The IP address, on the other hand, is a logical address assigned either dynamically or statically, allowing the machine to join the IP network and exchange packets beyond its local network.
- Visual example of MAC address:
- Visual example of an IP address:
In a corporate environment, these two addressing levels cannot function separately. For example, when a DHCP server automatically assigns an IP address, the MAC address of the equipment is used as the starting point. The computer sends a DHCP broadcast request containing its MAC address so the server can assign an available IP address to the correct device. Without this hardware identification, the DHCP server wouldn't know which device to deliver the address to.
The ARP protocol is therefore fundamental: it provides the link between IP addresses and physical addresses, enabling machines to translate a logical destination into an actual physical destination. When a computer needs to send a packet to a machine on the same network, it first consults its ARP table to check whether the recipient's MAC address is already known. If not, it broadcasts an ARP request to all hosts on the local network. The machine that recognizes the target IP address in this request responds by specifying its MAC address. The sender then writes this IP/MAC pair to his ARP cache, to avoid having to repeat the operation each time the request is sent.
This ARP table acts as a mini-mapping directory, dynamically updated in a similar way as DNS associates domain names with IP addresses. Without ARP, no local exchange would be possible, as the data link layer needs to know the MAC address in order to encapsulate Ethernet frames correctly.
Conversely, the RARP protocol (Reverse Address Resolution Protocol) was designed for the opposite situation: enabling a machine that knows only its MAC address to discover its IP address. This was common the case for older workstations without a local hard disk, which had to boot over the network and request an IP address. RARP was eventually replaced by BOOTP and then DHCP, which are more flexible and automated.
These association protocols play an important role in routing. A router is essentially a machine with multiple network interfaces, connecting different segments. When a router receives a frame, it processes it to extract the IP datagram and examines the IP header to determine the destination. If the destination is on a directly connected network, the datagram is delivered directly after updating the header. If the destination belongs to another network, the router consults its routing table to identify the best path, or next hop, to the destination.
This breaks the route into shorter, more manageable segments. Each intermediate router only knows the next step, not necessarily the final destination.
Reminder: Direct delivery happens when sender and receiver are on the same physical network. Otherwise, delivery is indirect and passes through one or more routers.
The routing table, managed either manually (static routing) or dynamically (dynamic routing), contains the information needed to decide which route to take. In small networks, a static configuration is enough. In larger infrastructures, dynamic routing is essential to automatically adjust routes when the topology changes or a link goes down.
The routing table acts as a mapping table between target IP addresses and next gateways. It usually stores network identifiers (network ID) rather than every individual host address, which greatly reduces its size.
| Destination Address | Next-Hop Router Address | Interface |
Using these entries, the router can quickly determine through which Interface and to which node each datagram should be sent. Combined with ARP for resolving the matching MAC addresses, this ensures efficient and reliable data transfer across the network.
Finally, dynamic routing protocols include standards such as RIP (Routing Information Protocol), based on the distance algorithm, and OSPF (Open Shortest Path First), which calculates the shortest paths in complex topology. These protocols constantly exchange updates to optimize routes, reduce transmission costs, and improve resilience against outages or congestion.
Quiz
Quiz1/5
net3023.4
Which term refers to the first three bytes of a MAC address?