Questions tagged [icmp]

Internet Control Message Protocol, designed for control and diagnostic messages. Used by common diagnostic tools like ping or traceroute.

583 questions
4
votes
1 answer

check ethernet connection periodically android

I'm trying to periodically check the network connection. However, this is for a Chinese Android Mini PC, not a tablet or smartphone. I'm using an ethernet to usb adapter instead of Wi-Fi. First I used a broadcastreceiver class: public class…
Armadillo
  • 457
  • 1
  • 9
  • 17
4
votes
1 answer

Checksum calculation issue for ICMPv6 using Asio Boost

I have used the ICMP example provided in the ASIO documentation to create a simple ping utility. However, the example covers IPv4 only and I have a hard time to make it work with IPv6. Upgrading the ICMP header class to support IPv6 requires a…
Marcus Frenkel
  • 691
  • 10
  • 19
4
votes
3 answers

recvfrom not returning -1 after signal

I am writing a ping program using raw sockets but recvfrom is not returning -1 with EINTR even though a SIGALRM is being handled.This SIGALRM is produced by my alarm(1).I want recvfrom to return so that i can decide that the packet has indeed been…
Sr1n4th
  • 251
  • 2
  • 8
4
votes
1 answer

localhost icmp packet found in capture file: why?

Here's my tcpdump filter (ip[8] is the IP ttl field and icmp[0]=11 corresponds to time-exceeded ICMP messages): (ip and ip[8]=2 and src host $myIPAddress) or (icmp and dst host $myIPAddress and icmp[0]=11) And here's what I found in the capture…
Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
4
votes
1 answer

Dont fragment flag for IPv6 packets in Linux using C++

I can not set the "don't fragment" flag for the IPv6/ICMPv6 packets. I am doing PMTUD and I want to force the router to drop packets bigger then the MTU. Using setsockopt with IPV6_MTU_DISCOVER is not working. int on = IPV6_PMTUDISC_DO; // tried…
4
votes
2 answers

struct: unpack Requires String Argument of Length 16

For my Computer Networking class, I'm trying to implement Traceroute using raw sockets with the ICMP protocol. I need to build a packet and then unpack the response packet using the Python struct class. Here is the code for building the…
Matt
  • 1,021
  • 4
  • 16
  • 25
4
votes
3 answers

Is there a way to make an android device answer to icmp pings addressed to the broadcast address?

I would like to programatically make my device answer to broadcast pings (i.e pinging 192.178.1.255) while connected to a wifi network. Is there a way i can do that ? Maybe a listener that will ping back, or a flag to set somewhere? Thanks.
Intrepidd
  • 19,772
  • 6
  • 55
  • 63
4
votes
3 answers

how to get icmp on udp socket on UNIX

Getting raw sockets requires root privilege, and tcp/udp doesn't have it, so I need to know how to get a udp socket and fetch icmp data. The programming language is C and the OS is BSD-like. (In other words I want to write a ping without root…
ziggear
  • 886
  • 7
  • 22
4
votes
2 answers

Block ping in Windows Server 2008 R2

I have deployed my Asp.Net web application on Windows Server 2008 R2 , and I want to block all ping requests to this server without effecting my application . Thanks in advance
Satinder singh
  • 10,100
  • 16
  • 60
  • 102
3
votes
1 answer

How to tell if computer is on and operating on a network

I have a computer that's configured for magic WOL packets, so the adapter will respond to ICMP. Pinging the computer doesn't seem like it'd provide a lot of useful information since it'll always respond even while off. The machine runs Windows 7 and…
chaz
  • 568
  • 1
  • 8
  • 22
3
votes
1 answer

Responsing on ICMP in select

The basic code sequence I'm interesting for is (pseudocode) sendto(some host); // host may be unreachable for now which is normal ... if(select(readfs, timeout)) // there are some data to read recvfrom(); Since Win2000, ICMP packet, which is sent…
Yury
  • 3,000
  • 2
  • 24
  • 24
3
votes
1 answer

Limiting ICMP echo replies when creating a PING program

I was writing a multithreaded ping program. I created rawsockets on each thread (for each IP) and sent ICMP Echo Request to each using sendto() and then I did recvfrom() in each thread. I am getting messages from IPs in various sockets(like if I had…
Gambit
  • 41
  • 3
3
votes
0 answers

Macos: ping: sendto: Socket is not connected

Using ping on Macos [Big Sur 11.01], I'm getting this error message: ping: sendto: Socket is not connected What is likely to be the problem? What can I do to prevent it? The call from bash is: ping -t2 -c1 time.com
Peter Brooks
  • 349
  • 3
  • 13
3
votes
2 answers

C# - Ping server with ICMP disabled

I am trying to ping a series of servers frequently using the PingReply class. Most of the time this is fine, but other times I get failed pings. I'm guessing this has something to do with ICMP being disabled on the remote server(s). Is there any…
user
  • 16,429
  • 28
  • 80
  • 97
3
votes
1 answer

socket connection "Operation not permitted" error even root with boost/pinger.cpp

I try to connect to socket to send icmp echo request with modified boost/pinger.cpp return Operation not permitted even I am root user. In Ubuntu 20.04, I am runnig the program with sudo there is no problem it works. But if I run at ARM with poky OS…
furkan
  • 79
  • 5