1

I am trying to wrap my head around a concept and I am having some trouble. If I ping 8.8.8.8, 10.8.1.1 replies to me "Destination port unreachable".

Ping uses ICMP, so it does not have a 'port' (unless you use udp or tcping), so I am unclear as to what 'port' the ICMP response code is reffering to. Comrade google is very forthcoming when it comes to response codes to UDP/TCP traffic, but ping is icmp originating traffic. Can anyone clear this up a bit? Or at least point me in the right direction?

3
  • 3
    Your confusion is justified. As ICMP (echo request) has no port, there should not be a destination port unreachable error. Unless you know exactly what 10.8.1.1 is, your guess is as good as any as to this oddity.
    – Ricky
    Apr 5, 2022 at 21:11
  • Has any answer solved your question? Then please accept it or your question will keep popping up here forever. Please also consider voting for useful answers.
    – Zac67
    Nov 1, 2022 at 18:35
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Nov 19, 2022 at 22:41

1 Answer 1

2

ICMP is defined in RFC 792.

The Time Exceeded Message includes the original IP header and the first 64 bits of the IP packet payload. Your local IP stack extracts this information and generates a message to the originating process.

For ping - or ICMP Echo Request - there's a 16-bit identifier that serves the same purpose as the port number in a transport-layer protocol header. (NAT routers use the very same identifier to translate an inbound ICMP Echo Reply back to the originating host's private IP address of the previous request.)

Note that an ICMP Echo Request is an exception (the only one?) to the general rule

To avoid the infinite regress of messages about messages etc., no ICMP messages are sent about ICMP messages.

In any case, when "Destination port unreachable" is shown to come from 10.8.1.1, apparently a router on your own private network, then that's what that router has returned. As it seems, it's blocking your ICMP echo request and sending a misleading error message - when it should really return "Destination host unreachable" or possibly "Destination protocol unreachable" (depending on the nature of the block).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.