Questions about MAC addresses and IP addresses that change and are not changed during transmission:
Conclusion: MAC address is invariant in the same broadcast domain, it will change when it crosses broadcast domain, while IP address will not change during transmission (except NAT), it is summed up as route forwarding Mac unchanged, IP variable .
We know a few concepts:
First of all we need to know that the MAC address is used to consent to the physical or logical layer 2nd network communication between devices;
Third-tier addresses (IP addresses) can communicate across multiple network devices.
Let's take a look at the following:
MAC address is valid in the same broadcast domain, then go to another broadcast domain (network segment) MAC address must be changed;
The MAC address of the data frame in the same broadcast domain will not change, because all switches should know the MAC address of all the hosts in the broadcast domain (if they do not know how to learn by passive broadcasting). Now that I know all the MAC addresses, I'll look at the target MAC address when the switch receives the data frame, and then check the MAC Address table to get out of the corresponding interface.
IP address is effective throughout the network, the entire Internet network is the equivalent of a large map, also know how to get all the IP address, then in the transmission of the source IP and destination IP will not change. When the router receives the packet, check the destination IP address of the packet, then look for the routing table (routing forwarding) and choose the appropriate interface to send out.
The figure A-r4-r2-b assumes that there is a data frame x, during the transfer:
A to R4:mac address (if present) the source address is a, the destination address is R4;
R4 to R2:mac address (if present) the source address is R4, the destination address is R2;
R2 to B:mac address (if present) the source address is R2, the destination address is B;
In the absence of NAT, the source IP address and destination IP address cannot be changed throughout the transfer process.
A to R4:IP address source address is a, the destination address is R4;
R4 to R2:ip address source address is a, the destination address is R4;
R2 to B:ip address source address is a, the destination address is R4;
Network-packets in the Routing and forwarding process MAC address and IP address, change and constant