Overview

A MAC address is a hardware identifier burned into a network interface card and used to move frames across a single local link. An IP address is a logical network address assigned to a device and used to route packets across interconnected networks, including the internet. They operate at different OSI layers, working together to get data from one physical wire to a destination anywhere in the world.

Comparison Diagram

Host AIP 10.0.0.5Routerrewrites MAC per hopHost BIP 10.0.0.9MAC AA:01 to MAC RR:01MAC RR:02 to MAC BB:01Layer 2 - MAC changes at every hopIP 10.0.0.5 to 10.0.0.9Layer 3 - IP stays constant end-to-endMAC = local hop identity; IP = end-to-end address

Comparison Table

AspectMAC AddressIP Address
OSI layerLayer 2 (Data Link)Layer 3 (Network)
Format48-bit hex, e.g. 00:1A:2B:3C:4D:5E32-bit (IPv4) or 128-bit (IPv6) dotted/colon notation
AssignmentBurned in by the NIC manufacturer at productionAssigned by a network admin or DHCP server
StructureFlat, no hierarchy — vendor prefix plus serialHierarchical — network portion plus host portion for routing
PersistenceFixed to the physical interface (though spoofable)Can change when a device moves to a different network
Role in deliveryIdentifies the next-hop device on the local linkIdentifies source and destination across the whole path
Behavior across hopsRewritten by every router at each hopPreserved end-to-end (barring NAT)
Resolution mechanismDiscovered via ARP (IPv4) or NDP (IPv6)Discovered via DNS for hostnames

Key Differences

  • MAC address operates at Layer 2 while IP address operates at Layer 3.
  • MAC is burned into hardware by the manufacturer, whereas IP is assigned by the network.
  • A frame’s MAC addresses are rewritten at every hop, but the packet’s IP addresses stay end-to-end constant.
  • ARP maps an IP address to the MAC address needed for delivery on the local segment.
  • MAC addresses are flat with no structure, while IP addresses are hierarchical to support routing.

When to Use Each

MAC Address

  • Switch Forwarding: Switches build MAC address tables to forward Ethernet frames to the correct port within a LAN segment.
  • MAC-based Access Control: Wi-Fi or switch port security can allow or block traffic based on the known hardware address of a device.
  • DHCP Reservations: Binding a specific IP lease to a device’s MAC ensures it always receives the same address on the network.

IP Address

  • Routing Across Networks: Routers forward packets between distinct networks, including the internet, using destination IP addresses.
  • Firewall and ACL Rules: Access policies are typically defined against source and destination IP ranges rather than hardware addresses.
  • Subnetting and Network Design: The hierarchical structure of IP addresses lets engineers divide networks into logical, routable subnets.