Thursday, March 13, 2014

Using Ping in Windows

The ping command from a Windows command prompt can be used to check the availability of a host:
Windows documentation.

Two options control how many pings to send. The default number is four.
ping -t
Keep sending Echo Requests until interrupted.
ping -n 5
Send the specified number of Echo Requests.
Two options can be used to test the size of the maximum transmission unit. Use one option to specify the size of the message to send and use the other option to prevent the message from being broken into smaller sizes. If the message is too large to send then the router will not send it.
ping -l 1500
Specify the size of the data field in the message to send.
ping -f
Do not fragment the message. The message must be sent as one unit or be rejected.
ping -f -l 1500
Combine both flags to test the size of the transmission unit. Try smaller numbers for the size until the message is sent.
One option can be used to find the time it takes to reach the host. It can also be used to find intermediate relay addresses.
ping -i 10
Specify the time that the message can live - time to live (TTL). If the time expires, then the message will not be sent. It may be that the message makes several hops before the time out is reached. The last name server to process the message may send a response indicating that the request timed out.
Start with a small number for the time to live and increase it until the host can respond.

Start with a TTL of 1 and you will get a response from a close name server to your machine. Increase the TTL by 1 on subsequent requests and you will get responses from different name servers along the route. Some requests may time out, since the name server that received the timed out packet did not forward the failure notification. Other servers will send a message that the request timed out.

The last procedure can also be used to check the name servers along the route. By increasing the TTL, different name servers will respond with messages. The flaw is that name servers are not required to send a response when a message expires. This is the procedure that the tracert command does.

Another option can be used to find the name servers along the route.
ping -r 9
Record the name servers that forward the message. The count must be in the range from 1 to 9.

No comments:

Post a Comment

Followers