How does destination PC know where to send ICMP Echo Reply?
pamccabe
Member Posts: 315 ■■■□□□□□□□
in CCNA & CCENT
I'm really drilling into the way a packet gets routed through a network. I am fine with the topic, however, I've come across this question. If you ping a PC on another network, how does it know where to send the reply back? I've been studying up on how a router will de-capsulate and then encapsulate with a frame to forward a packet onward. It seems to me the destination IP never changes, but the source IP, source Mac, and destination Mac does change. Is there something in the data of the packet that tells the pc how to reply? I hope my question makes sense.
Comments
-
chapapa Member Posts: 40 ■■□□□□□□□□the source IP and destination IP never changes when being routed in the network. but the source MAC and destination MAC changes whenever it hops in the network.
consider this.
PC1 -- SW1 -- (fa0/0)R1(se 0/0/0) -- (se 0/0/0)R2(fa0/1) -- SW2 -- PC2
When PC1 sends a ICMP echo to PC2 the header would look like this:
PC1 going to R1
Source IP: IP address of PC1
Destination IP: IP address of PC2
Source MAC: MAC address of PC1
Destination MAC: MAC address of Fa 0/0 in R1
R1 going to R2
Source IP: IP address of PC1
Destination IP: IP address of PC2
Source MAC: MAC address of se 0/0/0 in R1
Destination MAC: MAC address of se 0/0/0 in R2
When the packet arrives at PC2 the header would look like this
Source IP: IP address of PC1
Destination IP: IP address of PC2
Source MAC: MAC address of Fa 0/1 in R2
Destination MAC: MAC address of PC2
The same concept goes for the Echo-reply. here it is
Source IP: IP address of PC2
Destination IP: IP address of PC1
Source MAC: MAC address of PC2
Destination MAC: MAC address of Fa 0/1 in R2
R2 going to R1
Source IP: IP address of PC2
Destination IP: IP address of PC1
Source MAC: MAC address of se 0/0/0 in R2
Destination MAC: MAC address of se 0/0/0 in R1
R1 going to PC1
Source IP: IP address of PC2
Destination IP: IP address of PC1
Source MAC: MAC address of Fa 0/0 in R1
Destination MAC: MAC address of PC1
I hope this helps -
NetworkVeteran Member Posts: 2,338 ■■■■■■■■□□If you ping a PC on another network, how does it know where to send the reply back?It seems to me the destination IP never changes, but the source IP, source Mac, and destination Mac does change.
-
pamccabe Member Posts: 315 ■■■□□□□□□□NetworkVeteran wrote: »Since ICMP runs over IP, the destination device can look at the source IP address.
That's false, and the 'source' of your confusion. The source and destination IP address do not change end-to-end. -
sratakhin Member Posts: 818No, IP addresses remain the same. Routers change the MAC addresses, however.
-
NetworkVeteran Member Posts: 2,338 ■■■■■■■■□□I'm sorry, I did not mean to come across like I know it all.
-
NetworkVeteran Member Posts: 2,338 ■■■■■■■■□□Don't they change when NAT is used?
-
pamccabe Member Posts: 315 ■■■□□□□□□□Thanks everyone who replied to this thread. It really clears it up. Glad I decided to ask before test time lol
-
Michael2 Member Posts: 305 ■■■□□□□□□□NAT doesn't really change the IP address. It just retranslates the address of the packet for traveling out on the Internet. The only thing that's changed by NAT is the way your network looks to others.
-
NetworkVeteran Member Posts: 2,338 ■■■■■■■■□□NAT doesn't really change the IP address. It just retranslates the address of the packet for traveling out on the Internet. The only thing that's changed by NAT is the way your network looks to others.
(Just to avoid any confusion by others since this is a CCNA/CCENT forum.) -
gorebrush Member Posts: 2,743 ■■■■■■■□□□What do you mean "sip on lattes" NetVet?
Well isn't drinking latte's performed by those of us whom are "sophisticated"? -
Ivanjam Member Posts: 978 ■■■■□□□□□□I don't think we should be talking about our friend coffeeluvr behind his backFall 2014: Start MA in Mathematics [X]
Fall 2016: Start PhD in Mathematics [X]