What is the difference between a MAC address and an IP address?

0

Every computer or device on the Internet has two types of addresses: its physical address and its Internet address. The physical address – also called the Media Access Control address, or MAC address – identifies a device to other devices on the same local network. The Internet address – or IP address – globally identifies the device. A network packet needs both addresses to reach its destination.

MAC address vs IP address: what’s the difference?

MAC addresses and IP addresses are meant to identify a network device, but in different ways. Some of the main differences between a MAC address and an IP address are:

  • local identification versus global identification;
  • Layer 2 vs. Layer 3 operation;
  • physical address vs logical address;
  • number of bits;
  • allocation and permanence of address; and
  • address formatting.

A MAC address is responsible for local identification and an IP address for global identification. This is the main difference between a MAC address and an IP address, and it affects how they differ in their bit count, address assignment, and interactions. The MAC address is only meaningful on the LAN a device is connected to, and it is not used or retained in the data stream once packets leave that network.

Any Internet software, such as a Web browser, directs data to a destination on the Internet using the destination’s IP address. This address is inserted into the data packets that the network software stack sends. People rarely use address numbers directly, instead of using DNS names, which the app translates to the corresponding number.

Internet routers move packets from the source network to the destination network and then to the LAN where the destination device is connected. This LAN translates the IP address to MAC address, adds the MAC address to the data stream, and sends the data to the correct device.

Compare the differences between a MAC address and an IP address.

Another difference between a MAC address and an IP address is how addresses are assigned. An IP address is tied to a network device through software configurations and network administrators can change it at any time.

LAN switches maintain ARP (Address Resolution Protocol) tables that map IP addresses to MAC addresses. When a router sends a packet to the switch with a destination specified by an IP address, it uses the ARP table to know which MAC address to attach to the packet when it forwards the data to the device as Ethernet frames.

What is a MAC address?

Media access control refers to the hardware that controls how data is sent over a network. In the OSI reference model for networking, the MAC is a layer 2 device – or data link layer – and the MAC address is a layer 2 address. most devices are physically connected with Ethernet cables or wirelessly with Wi-Fi. Both methods use MAC addresses to identify a device on the network.

A MAC address is responsible for local identification and an IP address for global identification.

A MAC address consists of 12 hexadecimal digits, usually grouped into six pairs separated by dashes. MAC addresses are available from 00-00-00-00-00-00 to FF-FF-FF-FF-FF-FF. The first half of the number is generally used as a manufacturer identifier, while the second half is a device identifier. In almost all enterprise network devices today, whether Wi-Fi or Ethernet, this number is hard-coded into the device during the manufacturing process.

Each MAC address is unique to the network adapter installed in a device, but the number of device identification bits is limited, which means manufacturers reuse them. Each manufacturer has about 1.68 million addresses available, so when burning a device with a MAC address ending in FF-FF-FF, it starts over at 00-00-00. This approach assumes that two devices with the same address are highly unlikely to end up in the same LAN segment.

Two devices on a LAN should never have the same MAC address. If this happens, the two devices will have communication problems because the local network will no longer know which device should receive the packet. When a switch broadcasts a packet to all ports to find the intended recipient, the device that responds first will receive the stream of packets destined for it. If the device reboots, is removed, or shuts down, then the other node can receive the packets.

What is an IP address?

IP controls how devices on the Internet communicate and defines the behavior of Internet routers. It corresponds to layer 3, the network layer, of the OSI reference model. The Internet was originally built around IP version 4 (IPv4) and is in the process of transitioning to IPv6.

An IP address identifies a device on the global Internet, acting as the device’s logical address to identify that network connection. An IPv4 address consists of 32 bits, usually written as four decimal numbers or a dotted quarter. Possible values ​​range from 000.000.000.000 to 255.255.255.255, although many possible addresses are prohibited or reserved for specific purposes.

The address combines network identification and device identification data. The network prefix is ​​between eight and 31 bits, and the remainder identifies the device on the network. Steady and rapid growth of number of devices connected to the Internet led to the imminent exhaustion of the IPv4 address list, one of the many reasons for the development of IPv6.

An IPv6 address consists of 128 bits, the first 64 being reserved for network identification and the second 64 dedicated to identifying a device on the network. The address is written as eight sets of four hexadecimal digits separated by colons — for example, FEDC:BA98:7654:3210:0123:4567:89AB:CDEF. Fortunately, there are many conventions available for shortening an IPv6 address when writing it down.

Share.

Comments are closed.