The purpose of this Ping implementation initially was to demonstrate the use of the Windows ICMP library. While it's still a good example in this regard it is also worth it in itself as a powerful ping utility. It's behavior was closely modeled after that of Linux with some extensions taken from traceroute.
Ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams (``pings'') have an IP and ICMP header, followed by a ``struct timeval'' and then an arbitrary number of ``pad'' bytes used to fill out the packet.
In trace mode Ping will print the route packets take to reach the specified network host. The Internet is a large and complex aggregation of network hardware connected together by gateways. Tracking the route one's packets follow (or finding the miscreant gateway that's discading your packets) can be difficult. In trace mode Ping uses the IP protocol ``time to live'' field and attempts to elicit an ICMP_ TIME_EXCEEDED response from each gateway along the path to some host.
Ping is quite versatile so there is not a single way to use it. Though here are some of its uses:
Microsoft's tools implement the source routing an record route options.
With Microsoft's ping you cannot specify the interval between two packets. Also this ping conforms to the Unices ping options so you may feel more comfortable with it.
Microsoft's tracert just sends 3 probes per host. You cannot configure it for more or get more interesting statistics. Also you cannot specify the maximum RTT to use.
Finally both Microsoft tools give you a RTT rounded down to a millisecond. Even worse the RTT can be underevaluated by up to 2 milliseconds. This ping tool can give you, most of the time, a RTT which is accurate to about 10 microseconds.
Everything that ping does not give you, you can implement it. Of course Microsoft's tools don't come with the source :-).
To compile ping you must also get the icmp package. It should be available from the same place as ping i.e. currently only http://fgouget.free.fr/bing/
You will also need Visual C++ 2.0 or higher. Note that with some modifications in the makefile you should be able to compile it with another compiler.
Go in the ping directory and just type:
nmake -f makefile.win
If the compiler does not find the "ipexport.h" header then specify where you have the icmp headers like in the command below:
name ICMP_DIR=../icmp_dev-0.1.2 -f makefile.win
There are options you may add to this command line to customize the result. All options are disabled by default:
Open the 'ping.dsw' file and compile. This is a Visual Studio 6 Workspace file but it should work in Visual Studio 5 too.
Go to the directory where ping is and run the following commands:
When running the configure script you may need to specify where Wine is if it is installed in a non standard location (in your home directory for instance). Do so as follows:
Run "./configure help" for more information on configure's other options. The makefile supports the following commands:
If you want to report a bug or make an enhancement suggestion or want your modifications to be integrated to this package, send a mail to: email@example.com
|firstname.lastname@example.org||This page is hosted for free by Free.fr|