What will cause ICMPsendEcho to fail when ping.exe succeeds

I have an interesting situation on my hands, and I'm not quite sure how to solve the problem. I made several searches for something similar to my situation, but nothing matches this. If the answer already exists somewhere here, I would appreciate anyone who could point me in the right direction.

Ok, to the point.

I am writing a watchdog application to monitor my internet connection. It is designed to ping a set of domains with a given interval, and when any of them responds to ping, the status timer is reset. If the status timer ever goes beyond the set threshold, several steps of the corrective action try to fix the problem.

Simple enough?

Here where it is strange.

I am using ICMPsendecho to issue a ping request. In my development environment (win7) it works fine, testing and everything went smoothly. However, in the environment where it is deployed, it does not receive a response. The deployment environment is Windows XP sp3.

Throughout the troubleshooting process, I noticed several things that may or may not be helpful when trying to solve this problem.

windows ping.exe works fine in the deployment environment for all domains that I use to check the connection status, and only my ICMPsendecho calls, which seem to be unable to generate responses.

I installed wirehark in a deployment environment and I see that packets are successfully issued for requests for both types of ping. Windows ping generates request packets with a length of 74 bytes, and calls to my programs generate packets with a length of 42 bytes. Windows response packets are 74 bytes when received.

Switch to the development environment for a minute, with wirehark installed. Windows ping creates the same circumstances as in a package deployment environment. However, my application, when it generates requests, is 42 bytes long (just like the deployment environment), but the responses it receives are 60 bytes long.

As I said, this information may or may not be useful, but I'm trying to find out why this application cannot generate ICMP responses when Windows ping is working fine on this machine.

Another little tidbit that can help, the internet connection controls the use of AT&T, raises 4g hotspots, the actual device is a MC8790 AirPrime wireless card with sierra support.

Anyone have any ideas on why these pings fail?

in advance in advance for any useful information that you have, and for the time spent reading my message.

PS.

+8
networking delphi ping icmp
source share
3 answers

The response may be in the size of the ping message sent (it appears to be an undocumented minimum size of 20 bytes for the payload). See this post for more information: http://groups.google.com/group/microsoft.public.win32.programmer.networks/browse_thread/thread/2b28b994a8067713?pli=1

+3
source share

Have you checked the user permissions? Ping.exe does not require administrator privileges, but administrator privileges are required for raw ICMP commands on Windows.

See this example: http://www.delphi-central.com/tutorials/icmp-ping.aspx

Note, however, that for Windows NT and Windows 2000 implementations, Raw Sockets are subject to security checks and are only accessible to members of the Administrators group.


Another possible reason could be a firewall that blocks ICMP packets.

+2
source share

We had the same error with the client. The solution was to implement IcmpSendEcho2 as plan B when IcmpSendEcho fails. It worked!

0
source share

All Articles