mTCP Ping 2011-10-29 Version Michael Brutman (mbbrutman@gmail.com) Introduction This is a DOS version of the 'Ping' utility commonly found on systems that support TCP/IP. Ping allows you to do a basic check to see if a remote system is alive and responding to TCP/IP even if it is not accepting connections on specific ports. Ping is also useful for measuring how far away (also known as the ping latency) of a remote system - lower ping times mean better performance. Hardware requirements 8088 processor or better 56KB available RAM CGA, Monochrome (MDA), EGA or VGA display Supported Ethernet card, SLIP or PPP connection Software requirements DOS 2.1 or newer Packet driver for your Ethernet adapter Setup instructions Ping is built using the mTCP library. The setup instructions for mTCP can be found in SETUP.TXT. Using Ping Usage is like this: ping [options] Options are: -help Show a help message -count Tell ping how many ping packets to send -size Set the size of the test data in each packet By default ping will send four packets and each packet will have a 32 byte test message in them. The total packet size will be 60 bytes, including the TCP/IP headers. You can tell ping to send more packets or to send bigger packets. The test data portion of a packet can be up to 256 bytes in size. Ping sends one packet per second. Here is some sample output: E:\ping -count 5 -size 256 www.brutman.com Ping by M Brutman (mbbrutman@yahoo.com) Version: Sep 30 2009 ICMP Packet payload is 256 bytes. Packet sequence number 0 received in 72.25 ms, ttl=49 Packet sequence number 1 received in 70.55 ms, ttl=49 Packet sequence number 2 received in 72.25 ms, ttl=49 Packet sequence number 3 received in 73.10 ms, ttl=49 Packet sequence number 4 received in 74.80 ms, ttl=49 Packets sent: 5, Replies received: 5, Replies lost: 0 Average time for a reply: 72.59 ms (not counting lost packets) You can press CTRL-C or CTRL-BREAK to stop. If you ping a non-existent machine you will either get a DNS error message or an ARP failure. Fun notes Normal timer resolution under DOS is limited to 55 milliseconds. This is how fast the BIOS timer clicks, and it works out to about 18 times a second. Ping can measure time down to 0.85 milliseconds. To do this it reprograms the hardware timer to generate interrupts faster, and then only passes the correct number of interrupts to the BIOS code. This way BIOS keeps correct track of the time and everything else works as it should, while Ping can get 1 millisecond accuracy while it needs it. This technique is highly accurate - try it! Support Have a comment or need help? Please email me at mbbrutman@gmail.com. Recent changes 2011-05-27: First open source release (GPL3) 2010-06-21: Ported to Open Watcom 2009-09-30: Higher resolution timing 2009-09-25: Initial version More information: http://www.brutman.com/mTCP Created September 25th, 2009, Last updated Oct 29th, 2011 (C)opyright Michael B. Brutman, mbbrutman@gmail.com