What is the difference between IP and MAC addresses?

Before knowing the difference between IP and MAC addresses, let’s first look at what each of them means.

IP address

An IP (Internet Protocol) address is a numerical label used to identify different devices in a network. An IP address lets a device communicate with other devices in the IP network.

IP addresses can be classified based on private or public, which will not be discussed here. IP addresses also have two versions that will be discussed below.

  1. IPv4 (Internet Protocol version 4): These contain 4 bytes32 bits. There are 2322^{32} IPv4 addresses, which is not enough for the world’s population, and creates the need for IPv6 addresses.
  2. IPv6 (Internet Protocol version 6): These contain 16 bytes128 bits. There are 21282^{128} IPv6 addresses.

However, not all devices can support IPv6 addresses, which is why IPv4 addresses are still in use. Sometimes, there’s a shortage of IPv4 addresses; so the devices connected to the same network have the same IP address. The question might arise as to how the network adapter can identify which device requested which network packet. This can be done using MAC addresses.

MAC address

A MAC (Media Access Control) address is a unique combination of 48 digits given to a network interface permanently. There are 2482^{48} MAC addresses, and they usually found at the bottom of a device. For each network interface in our device, there is a unique MAC address associated with it.

The internet can typically only be accessed using a Network Interface Card (NIC).

IP address vs MAC address

The network provider usually assigns an IP address through a DHCP server (usually our router). Due to fewer IPv4 addresses, a dynamic IP address is rented to every device on a lease period. Because of this, a DHCP server is set to change the IP address after the lease period ends.

The history of IP address changes, and the MAC address is used to track the computer whenever this happens. Since the MAC address was issued to a network interface when it was manufactured, this can be treated as a constant to verify an IP address.

Free Resources