Questions tagged [icmp]

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

583 questions
3
votes
1 answer

Sending ICMP ping

For ICMP ping request (echo request) do I need to get the MAC address of the destination ? I am trying to learn how to implement this in C using raw sockets but can not understand how to get the MAC address of the destination. Any help is…
Novak007
  • 426
  • 1
  • 9
  • 23
3
votes
2 answers

Regarding ICMP "Fragmentation needed, DF bit set" or ICMP packet too big message

I'm injecting ICMP "Fragmentation needed, DF bit set" into the server and ideally server should start sending packets with the size mentioned in the field 'next-hop MTU' in ICMP. But this is not working. Here is the server code: #!/usr/bin/env…
Aaron88
  • 177
  • 1
  • 8
  • 19
3
votes
1 answer

Purpose of NTP vs. ICMP Timestamp message

I know the purpose of the Network Time Protocol is to synchronize clocks over networks, primarily with the use of the Originate, Receive and Transmit timestamps to make the time calculations. But, the ICMP protocol also has a Timestamp control…
Reflection
  • 1,936
  • 3
  • 21
  • 39
3
votes
1 answer

Which router port address should respond with time to live exceeded in transit message?

Given the following situation: PC --- |aa RTR1 bb| --- |aa RTR2 bb| --- |aa RTR3 bb| etc Each of the |aa rtr bb| is meant to be a router with two ports aa and bb. When I do a trace route from my PC, which router port address should respond…
dbasnett
  • 11,334
  • 2
  • 25
  • 33
3
votes
3 answers

Sending back custom ICMP echo response

I've put together an ICMP client, and an ICMP listener. I can send custom echo requests to the listener and the listener unpacks them correctly. I would now like the listener to respond - not with an exact echo but with a different set of data. This…
Fidel
  • 7,027
  • 11
  • 57
  • 81
3
votes
2 answers

what exactly is passed as "address" in sendto for ipv6

I am trying to send an icmpv6 ping packet across running as root (python 2.7 on Linux) I understand that sendto uses two tuple struct in case of ipv4 (and it works) and know that ipv6 uses a 4 tuple struct. Still i can't get it to work. It either…
fkl
  • 5,412
  • 4
  • 28
  • 68
3
votes
0 answers

can't receive ICMP TTL exceeded packet for a UDP packet with small TTL in virtual machine

I wrote a program which uses raw socket to send UDP packets with TTL=1, when I run this program on my local host, I can receive ICMP packets. but when I run it on a Planetlab node, it can't receive ICMP packets. On planetlab node, each node is…
misteryes
  • 2,167
  • 4
  • 32
  • 58
3
votes
3 answers

How to receive ICMP response "Port unreachable" to UDP message in C#

I'm trying to receive ICMP response "Port unreachable" to UDP message in C# this is what I'm trying to do: IPEndPoint remoteEndpoint = new IPEndPoint(IPAddress.Parse("192.168.211.133"), 0); var udpClient = new UdpClient("192.168.211.133",…
Dima Daron
  • 548
  • 1
  • 7
  • 21
3
votes
1 answer

Calculate average Round Trip Time?

I have used the traceroute command and pinged my Amazon INstance. This is the result I got back: traceroute to 10.250.19.146 (10.250.19.146), 30 hops max, 60 byte packets 1 ip-10-8-145-1.us-west-2.compute.internal (10.8.145.1) 0.996 ms 1.234 ms …
user2241637
  • 43
  • 1
  • 1
  • 5
3
votes
1 answer

Maximum size of ICMP IPv6 packet

With reference to this question and to ASIO libary, I would like to know what is the maximum size of ICMP v6 reply packet. I'm using ASIO library to listen for and receive ICMPv6 packets, but I don't know what size of buffer to use in order to…
Marcus Frenkel
  • 691
  • 10
  • 19
3
votes
2 answers

Receiving ICMP Host Unreachable message on UDP socket in Python

I'm writing a simple UDP chat server in Python 2.7 on Linux 2.6.38. How can ICMP error messages be read that a host(client) receives when it sends UDP segments to say, an unreachable server? I tried sockFd.setsockopt( socket.IPPROTO_IP,…
crk
  • 617
  • 1
  • 8
  • 12
3
votes
2 answers

Smart methods for an Embedded Linux device to detect Internet connectivity

Our team is developing a Internet Media device based on Linux 2.6. Currently we detect whether Internet connectivity is established (via a wired Ethernet i/f) by pinging www.google.com Some networks we have tested the device on do not support ICMP…
sototozo
  • 227
  • 1
  • 7
3
votes
2 answers

Why do the 2 strings print the same value when I assigned them different values?

void got_packet(u_char *args, const struct pcap_pkthdr *header, const u_char *packet) { static int count = 1; /* packet counter */ /* declare pointers to packet headers */ const struct sniff_ethernet *ethernet; /* The ethernet…
homes
  • 265
  • 1
  • 3
  • 12
3
votes
1 answer

Reading ICMP reply with select in Linux using C++

I am sending an ICMP request using C++ and raw sockets to a router and after that I want to read the ICMP reply. My problem is, select() is not receiving the replay and times-out all the time. I am not getting any error (errno is returning success).…
3
votes
1 answer

Python raw socket not receiving ICMP packets

I'm trying to use raw sockets in Python to send UDP packets to a host and then get the ICMP response back for the packet -- basically reimplementing traceroute. I've managed to correctly construct my IP and UDP headers and send the packet. I can…
Rafael
  • 71
  • 1
  • 3