How does destination PC know where to send ICMP Echo Reply?

pamccabepamccabe Member Posts: 315 ■■■□□□□□□□
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

  • chapapachapapa 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 :)
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    pamccabe wrote: »
    If you ping a PC on another network, how does it know where to send the reply back?
    Since ICMP runs over IP, the destination device can look at the source IP address.
    It seems to me the destination IP never changes, but the source IP, source Mac, and destination Mac does change.
    That's false, and the 'source' of your confusion. The source and destination IP address do not change end-to-end. :)
  • sratakhinsratakhin Member Posts: 818
    Don't they change when NAT is used? ;)
  • pamccabepamccabe Member Posts: 315 ■■■□□□□□□□
    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. :)
    I'm sorry, I did not mean to come across like I know it all. I do apologize if that was the case. However, I am understanding that the source IP does change... is this not the case? I am talking about a ping request going from a network, across serial links, to another network. Sorry for my ignorance.
  • sratakhinsratakhin Member Posts: 818
    No, IP addresses remain the same. Routers change the MAC addresses, however.
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    pamccabe wrote: »
    I'm sorry, I did not mean to come across like I know it all.
    You did not come across as a know-it-all. IP addresses (source and destination) remain the same end-to-end.
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    sratakhin wrote: »
    Don't they change when NAT is used? ;)
    Hehe! Yes, Network Address Translation (NAT) is an interesting exception. Basics first, then special cases. :)
  • pamccabepamccabe Member Posts: 315 ■■■□□□□□□□
    Thanks everyone who replied to this thread. It really clears it up. Glad I decided to ask before test time lol icon_rolleyes.gif
  • Michael2Michael2 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.
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    Michael2 wrote: »
    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.
    NAT isn't sophisticated--it doesn't sip on lattes--it does directly modify the IP address of the packet. That's what 'retranslating the address' means. It changes not only how the packet 'looks', but also what the packet inherently 'is'.

    (Just to avoid any confusion by others since this is a CCNA/CCENT forum.)
  • Michael2Michael2 Member Posts: 305 ■■■□□□□□□□
    What do you mean "sip on lattes" NetVet?
  • gorebrushgorebrush Member Posts: 2,743 ■■■■■■■□□□
    Michael2 wrote: »
    What do you mean "sip on lattes" NetVet?


    Well isn't drinking latte's performed by those of us whom are "sophisticated"?
  • IvanjamIvanjam Member Posts: 978 ■■■■□□□□□□
    I don't think we should be talking about our friend coffeeluvr behind his back icon_lol.gif
    Fall 2014: Start MA in Mathematics [X]
    Fall 2016: Start PhD in Mathematics [X]
Sign In or Register to comment.