Ip – When a datagram moves through a network, do the MAC or IP addresses change

datainternetipip addressmac address

So there are 4 fields I'm considering. Source/destination of each the MAC address and the IP address.

If the datagram is going through a few hosts, which of these values will be changing. From what I understand, both of the destination addresses do not change, but one of the sources do change.

As each of the hosts process the data packet, I think they change only one of these values, and I think it's the source MAC address. Is that true?

Best Answer

Ideally, the source and destination IP addresses don't change. In practice, NAT may be used, and, depending on the NAT used, either the source, destination, or both IP addresses may be changed.

In a LAN, source and destination MAC addresses do not change; they are specific to the LAN on which the frame originated. You may be confused by the fact that a layer-3 device (e.g. a router) will strip off the frame, which contains the source and destination MAC addresses. If the layer-3 device sends the packet out a different interface, it will create a new frame, based on the new LAN, to which it is sending the packet. In this case, the new frame will have different source and destination MAC addresses.