A program on machine X attempts to open a UDP connection to port 5376 on a machine Y, and a TCP connection to port 8632 on machine Z. However, there are no applications listening at the corresponding ports on Y and Z. An ICMP Port Unreachable error will be generated by ?

My attempt:

ICMP Port unreachable is a code 3 within type 3

3.3.Port Unreachable - generated if the designated transport protocol (e.g., UDP) is unable to demultiplex the datagram in the transport layer of the final destination but has no protocol mechanism to inform the sender

I read many online content of related this topic. But ,still , I'm in doubt , I can't say anything for TCP with correct reference . I conclude that it should be for both TCP and UDP , Since ICMP is a network layer protocol , and it is not related with transport layer protocols(i.e. TCP , UDP) . Hence , it don't bother about TCP or UDP , it returns error for both TCP and UDP . I need verification .

  • It is not entirely accurate to say that L4 protocols are not "related" to common transport protocols, but more accurate to say that "we cannot gaurentee a relationship between every L4 protocol and every L3 protocol". That said however, there are no common L3 protocols that carry TCP other than IP, and ICMP was designed to work alongside ANY inter-network protocol, so it is reasonable that TCP/UDP have a channel to invoke a ICMP message response to an exception condition. Also note that TCP probably hasn't taken over control of the flow at the time the message is generated, and IP sends it. – Frank Thomas Aug 28 '15 at 14:56

Destination unreachable is generated by the host or its inbound gateway to inform the client that the destination is unreachable for some reason. A Destination Unreachable message may be generated as a result of a TCP, UDP or another ICMP transmission. Unreachable TCP ports notably respond with TCP RST rather than a Destination Unreachable type 3 as might be expected.

From: https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Destination_unreachable

  • So, it gives error for both ,right ? – ً ً Aug 28 '15 at 14:17
  • "A Destination Unreachable message may be generated as a result of a TCP, UDP or another ICMP transmission" – ChrisInEdmonton Aug 28 '15 at 14:46
  • Rt sir , Can you say ,It returns error for port too . :) – ً ً Aug 28 '15 at 14:57
  • It is my understanding that Destination unreachable and Port unreachable are differant messages. wildpackets.com/resources/compendium/tcp_ip/unreachable – Frank Thomas Aug 28 '15 at 15:31
  • 1
    @FrankThomas Port Unreachable is a subtype of Destination Unreachable. – Spiff Aug 31 '15 at 21:55

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