Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what would cause ICMPsendEcho to fail when ping.exe succeeds

I have an interesting situation on my hands, and I'm not quite sure how to go about troubleshooting it. I did a few searches for something similar to my situation, but nothing quite matches it. If the answer already exists somewhere here, I would appreciate anyone that could point me in the right direction.

Ok, to the point.

I'm writing a watchdog application for monitoring internet connectivity. Its designed to ping a set of domains at a set interval, and when any of them respond to the ping, the status timer is reset. If the status timer ever goes beyond a set threshold, several stages of corrective action are attempted to fix the problem.

Simple enough right?

Here's where it gets weird.

I'm using ICMPsendecho to issue the ping request. On my development environment (win7) it seems to work fine, testing and everything went smoothly. However, in the environment where its being deployed it fails to receive a response. The deployment environment is a windows XP sp3 machine.

Throughout the trouble shooting process I've noted several things, which may or may not be helpful in actually trying to solve this problem.

windows ping.exe works just fine on the deployment environment for all of the domains i'm using to test connectivity status, its only my ICMPsendecho calls that seem to fail to generate responses.

I've installed wireshark on deployment environment and I can see packets being issue successfully for the requests on both types of ping. the windows ping generates request packets with a length of 74 bytes, and my programs call generates packets with a length of 42 bytes. Windows response packets are similarly 74 bytes when they are received.

Switching to the development environment for a minute, with wireshark installed. Windows ping generates a similiar circumstance as in the deployment environment with the packets. However, my application, when it generates requests the packets are 42 bytes in length(same as the deployment environment), but the responses it receives are 60 bytes in length.

As i said, that information may or may not be useful, but I'm trying to find out why this application is failing to generate ICMP responses when windows ping seems to work fine on that machine.

Another little tidbit that may help, the internet connection were monitoring uses AT&T's elevate 4g hotspots, the actual device is a sierra wireless MC8790 AirPrime card.

Anyone have any ideas on why these pings are failing?

thanks ahead of time for any useful information you might have and for taking the time to read my post.

PS.

like image 852
PoultrySlave Avatar asked Feb 20 '12 20:02

PoultrySlave


2 Answers

The answer might be in the size of the ping you send (there seems to be an undocumented minimum size of 20 bytes for the payload). See this post for more info: http://groups.google.com/group/microsoft.public.win32.programmer.networks/browse_thread/thread/2b28b994a8067713?pli=1

like image 91
Gajib Avatar answered Sep 30 '22 11:09

Gajib


Have you checked the user permissions? Ping.exe does not require administrator rights, but the raw ICMP commands in Windows need administrator privileges.

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

Please note, however, that for Windows NT and Windows 2000 implementations, Raw Sockets are subject to security checks and are accessible only to members of the administrator's group.


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

like image 22
mjn Avatar answered Sep 30 '22 12:09

mjn