Monday, February 25, 2013

What port does ping use..... ?


What-port-does-Ping-Use1.jpg (608×345)

The article explains the reason as to why there are not ports associated with ping.
In the above diagram , there are two PC’s , PC1 and PC2. When PC1 initiates a ping to PC2, the ping packet is constructed on PC1. The source IP address of the IP header carrying the ping packet would be PC1′s IP address and destination IP address is that of PC2.
Ping uses ICMP at the network layer for communication. Ping does not use any transport layer protocols like TCP or UDP. It is a protocol which does not have a TCP or UDP header. ICMP does not use any port numbers unlike applications which use TCP or UDP. ICMP uses sequence numbers for tracking ICMP packets.
When PC1 pings PC2, the ICMP header generated by PC1 would contain sequence number, which would be used to track the packet. So when PC2 generates the response , the sequence number would be used and not port numbers.

No comments:

Post a Comment