What destination MAC address is used when communicating with a device on a local remote network?

All equipment that can be connected to computer networks (computers, routers, servers, printers, smartphones and so on) have a MAC address. It is an address which is written into the network interface of the device during manufacturing.

A MAC address consists of 12 hexadecimal characters and could look like this:

  • 01:23:45:67:89:ab
  • 00:fe:19:2a:73:dc
  • 02:0a:95:9d:68:16
Regarding Hexadecimal numbers:

In our decimal system that we use in everyday life each digit can have 10 values, ranging from zero to nine:

  • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

In the hexadecimal system, each digit can have 16 different values. Starting from zero and going up to nine, and then continuing further using letters A through F:

  • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

A has the value 10, B means 11, C means 12, D is 13, E is 14 and F has the value 15.

MAC addresses and IP addresses are two completely different types of addresses, but both are used by computers that communicate with each other. Each time a computer sends out network traffic the traffic has both a source and destination IP address, but it also has a source and destination MAC address.

IP addresses are relevant on a global scale. They hold the final destination of the packet and can tell us which address the packet is originally coming from. In contrast, MAC addresses are used on a more local scale, and hold information about the next hop destination in the local LAN network.

The difference can be compared to a journey to a final destination (IP address) where you can have multiple legs of the journey, each time stopping temporarily at interim stops (routers with local MAC addresses) before moving on.

An IP packet travelling over the Internet has many such temporary stops along the way in different routers that the packet must pass through. Each router forwards the packet to the next router on the path until the packet has reached its final destination.

The destination IP address on the IP packet must always stay the same throughout the whole journey, in the same way that the delivery address of a letter that is being sent cannot be changed along the way. The delivery address stays the same until the letter has been delivered no matter where along the delivery path that the letter is currently at.

But even with regular letters, the postal delivery service must use temporary destinations or next-hop addresses where the letter is going to be delivered next. The mailman who fetches the letter from the mailbox is not going to deliver the letter straight to the recipient. Instead, the mailman will fetch the letter to a mail sorting office. So even though the letter has a final destination address, the mailman will take it to another more temporary stop along the way where the letter can be sorted for further delivery toward the destination.

This can be repeated multiple times, with the letter passing by several such temporary next hop addresses before it is finally delivered.

What destination MAC address is used when communicating with a device on a local remote network?

In computer networks, it is the role of the MAC address to act as the next hop address on the local LAN. The mailman is replaced by Switches in the network environment. These switches can be located in a local LAN, or sit between routers on the Internet.

The switches do not deliver packets based on the destination IP address. Instead, the switches look at the destination MAC address to see where it should send the packet next.

When a computer has a packet to send it knows the destination IP address where it wants to send the traffic. But the computer must also make sure to add a destination MAC address to the traffic which points to the next hop router. This is how the computer makes sure that the packet will end up at its default gateway.

When the router receives the packet it will look at the destination IP address of the packet. Based on that destination IP address the router will know which way to forward the packet and which the next hop router will be. Then it can strip off the old destination MAC address (which was the router’s own MAC address) and replace it with a new destination MAC address that points to the next hop router.

What destination MAC address is used when communicating with a device on a local remote network?

So Source and Destination IP addresses don’t change as the packet is transmitted and routed over the Internet. The MAC addresses, however, are being changed for each new local network that the packet traverses as it is being sent between each pair of routers on its way to the final destination.

It is worth repeating that MAC addresses are always used in combination with IP addresses – even within small LANs where two computers want to communicate directly with each other.

What destination MAC address is used when communicating with a device on a local remote network?

Previous part:
Hubs are not Switches

Next part:
Broadcasts

Every computer or device on the internet has two types of addresses: its physical address and its internet address. The physical address -- which is also called a media access control, or MAC, address -- identifies a device to other devices on the same local network. The internet address -- or IP address -- identifies the device globally. A network packet needs both addresses to get to its destination.

MAC address vs. IP address: What's the difference?

Both 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 include the following:

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

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

Any piece of internet software, such as a web browser, directs data to a destination on the internet using the destination's IP address. That address is inserted into the data packets that the network software stack sends out. People rarely use the address numbers directly, instead using DNS names, which the application translates into the matching number.

Internet routers move the packets from the source network to the destination network and then to the LAN on which the destination device is connected. That local network translates the IP address to a MAC address, adds the MAC address to the data stream and sends the data to the right device.

Compare the differences between a MAC address and IP address.

Another difference between a MAC address and IP address is the way the addresses are assigned. An IP address is bound to a network device via software configurations, and network administrators can change it at any time.

Local network switches maintain Address Resolution Protocol (ARP) tables that map IP addresses to MAC addresses. When a router sends the switch a packet 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 piece of hardware that controls how data is pushed out onto a network. In the OSI reference model for networking, the MAC is a Layer 2 -- or data link layer -- device, and the MAC address is a Layer 2 address. In the current internet era, most devices are connected physically 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 hyphens. MAC addresses are available from 00-00-00-00-00-00 through FF-FF-FF-FF-FF-FF. The first half of the number is typically used as a manufacturer ID, while the second half is a device identifier. In nearly all enterprise network devices today, whether Wi-Fi or Ethernet, this number is hardcoded into the device during the manufacturing process.

Each MAC address is unique to the network card installed on a device, but the number of device-identifying bits is limited, which means manufacturers do reuse them. Each manufacturer has about 1.68 million available addresses, so when it burns a device with a MAC address ending in FF-FF-FF, it starts again at 00-00-00. This approach assumes it is highly unlikely two devices with the same address will end up in the same local network segment.

No two devices on a local network should ever have the same MAC address. If that does happen, both devices will have communications problems because the local network will get confused about which device should receive the packet. When a switch broadcasts a packet to all ports in order to find the intended recipient, whichever device responds first will receive the packet stream directed to it. If the device reboots, is taken away or shuts down, the other node may then 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 initially built around IP version 4 (IPv4) and is in transition 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 quad. Possible values range from 000.000.000.000 through 255.255.255.255, although many possible addresses are disallowed or reserved for specific purposes.

The address combines network identification and device identification data. The network prefix is anywhere from eight to 31 bits, and the remainder identify the device on the network. Steady, rapid growth in the number of internet-connected devices has led to the looming exhaustion of the IPv4 address list, one of several reasons for the development of IPv6.

An IPv6 address consists of 128 bits, with the first 64 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. Happily, many conventions are available to shorten an IPv6 address when writing it.