Internet Control Message Protocol, designed for control and diagnostic messages. Used by common diagnostic tools like ping or traceroute.
Questions tagged [icmp]
583 questions
3
votes
4 answers
Alternative to isReachable in InetAddress class
I want to check whether an active internet connection exists or not. For that I found out I can do that with the isReachable() method from the InetAddress class. Unfortunately (as the JavaDoc suggests and this post verifies), this only works with…

casaout
- 1,819
- 3
- 24
- 54
3
votes
1 answer
ICMP Ping in WinRT - Is it possible?
How to do an ICMP ping in a WinRT Modern UI application?
Ping is not implemented in WinRT currently (see related question here) and the previous strategies in Silverlight being:
Use a WCF Service
Call Javascript which then calls an ActiveX…

Dave Mateer
- 6,588
- 15
- 76
- 125
3
votes
3 answers
Receiving Data on an ICMP socket
When receiving on an ICMP socket, (SOCK_RAW with IPPROTO_ICMP), since
there is no concept of "port" in the ICMP protocol, how can an
application determine that a received packet is not part of some other
TCP/UDP/whatever socket transmission that is…
Charles Salvia
3
votes
2 answers
How to create an ICMP traceroute in Python
I am trying to implement an ICMP based Traceroute in Python.
I found a very helpful guide ( https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your ) that has allowed me to create a UDP based Traceroute (code below) so just needs…

Jamesla
- 1,378
- 7
- 31
- 62
3
votes
1 answer
ICMP echo requests are not sent while receiving "Destination Unreachable" packets
I am working on a network management application that pings managed hosts using ICMP via raw BSD sockets (sendto).
My question is not how to do that, in fact it works very well. I only seem to hit on a problem when the target host is sending…

pdinklag
- 1,241
- 1
- 12
- 28
2
votes
1 answer
Python ICMP ping implementation when pinging multiple ips from threads?
I've been using jedie's python ping implementation on Windows. I could be wrong, but when pinging two computers (A and B) from separate threads, ping will return the first ping it receives, regardless of source.
Since it could be an issue with…

Alex L
- 8,748
- 5
- 49
- 75
2
votes
1 answer
ICMP socket always timeout
I am trying to send an ICMP AddressMask request to my router in C#. However, my socket always time out, or, if the timeout isn't set, makes the application loop indefinitely.
Here is the code:
Socket socket = new Socket(AddressFamily.InterNetwork,…

Totem
- 454
- 5
- 18
2
votes
1 answer
How to properly assign cap_net_raw to a Python script
I have a Python script which periodically pings machines in the network by using aioping to do it.
It requires raw socket access for the ICMP messages and one way to do this is to run the script as root, which I don't want to do.
What I've resorted…

Daniel F
- 13,684
- 11
- 87
- 116
2
votes
1 answer
Is it possible to send an ICMP echo request from a swf?
ActionScript 3 can send UDP packets via flash.net.DatagramSocket. Is their any way to send an ICMP packet? I'd also like to set the TTL flag so I can implement traceroute in an SWF.

Justin Dearing
- 14,270
- 22
- 88
- 161
2
votes
0 answers
how to get icmp(ping) target ip addr by using "golang.org/x/net/icmp"
I have a icmp listening func :
func Start(url string) {
conn, err := icmp.ListenPacket("ip4:icmp", url)
if err != nil {
log.Fatal(err)
}
for {
var msg []byte
length, sourceIP, err := conn.ReadFrom(msg)
if err != nil {
…

mashaolong
- 21
- 1
2
votes
1 answer
golang.org/x/net/icmp: set Time To Live (TTL)
Go has built-in ICMP implementation that available on golang.org/x/net/icmp, is there any way to set TTL in this library ?, thankyou

Lobo Nokewe Ngewe
- 163
- 1
- 11
2
votes
1 answer
How to measure time from send and receive in scapy?
I write such code in scapy to make simple ping - nothing special but it looks promising.
def ping(ip):
answer = sr1(IP(dst=ip) / ICMP())
How can I measure travel time from send to receive in scapy. Question is very simple but also very…

Chameleon
- 9,722
- 16
- 65
- 127
2
votes
0 answers
C# create firewall rule to allow system to respond to pings?
I inherited a C# application and working on it. It creates some firewall rules programmatically. By default it disables everything on a specific interface, then allows a few specified TCP ports access, which is fine. I can't figure out how to…

fred basset
- 9,774
- 28
- 88
- 138
2
votes
1 answer
two bytes swapped in packet received from Python raw socket
My Python program is receiving ICMP destination unreachable messages from a raw socket. The socket is created with the following code:
socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP)
ICMP destination unreachable messages include…

Brian Edwards
- 311
- 3
- 5
2
votes
1 answer
Netfilter hook is not called in Ubuntu 18.04 - kernel 4.18
I am trying to create a netfilter hook which simply catches ICMP packets. I can't for the life of me figure out what I am doing wrong (I am new to writing kernel modules). The code i have so far is
#include
#include…

filterh
- 21
- 1