Currently trying to implement a simple ping program to teach myself about network programming in C# and .NET.
I have managed to initialize a raw socket and correctly build an ICMP echo request packet. When running my program, Wireshark confirms that I am sending an Echo Request to the desired destination, however the remote machine will never send back an echo reply. I have tried sending to multiple machines all with the same result (and each of these machines can be pinged using the Windows ping utility). My code goes like this:
IcmpPacket echoReq = new IcmpPacket;
/*Some code to initialize packet*/
rawSocket.Send(echoReq, destinationIP); //syntax may be wrong, dont have the code infront of me sorry
rawSocket.ReceiveFrom(buffer, remoteEndpoint);
If anyone could suggest any reasons why the remote machines do not send any reply, I'd be very grateful.