Skip to main content

Basically, the raw socket will capture all ICMP packets. The internal number you quote is exactly to identify packets from the current process. There's no port number in ICMP to allow per-socket demultiplexing by the protocol stack.

To answer your comment, if the packet has been received, it hasn't been lost, has it? All sockets set up like ping does get copies of all matching packets, so all running pings get copies of all received ICMP packets.

Basically, the raw socket will capture all ICMP packets. The internal number you quote is exactly to identify packets from the current process. There's no port number in ICMP to allow per-socket demultiplexing by the protocol stack.

Basically, the raw socket will capture all ICMP packets. The internal number you quote is exactly to identify packets from the current process. There's no port number in ICMP to allow per-socket demultiplexing by the protocol stack.

To answer your comment, if the packet has been received, it hasn't been lost, has it? All sockets set up like ping does get copies of all matching packets, so all running pings get copies of all received ICMP packets.

Source Link

Basically, the raw socket will capture all ICMP packets. The internal number you quote is exactly to identify packets from the current process. There's no port number in ICMP to allow per-socket demultiplexing by the protocol stack.