Pages

Thursday, August 16, 2012

What port does ping use !!




The article explains the reason as to why there are not ports associated with a 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 a 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.


Timestamp

Timestamp is used for time synchronization. The originating timestamp is set to the time (in milliseconds since midnight) the sender last touched the packet. The receive and transmit timestamps are not used.
Timestamp message
0001020304050607080910111213141516171819202122232425262728293031
Type = 13Code = 0Header checksum
IdentifierSequence number
Originate timestamp
Receive timestamp
Transmit timestamp
Where:
Type must be set to 13
Code must be set to 0
Identifier and Sequence Number can be used by the client to match the timestamp reply with the timestamp request.
Originate timestamp is the number of milliseconds since midnight Universal Time (UT). If a UT reference is not available the most-significant bit can be set to indicate a non-standard time value.

No comments:

Post a Comment