Is ICMP port unreachable error generated by both TCP and UDP?

12,589

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

Share:
12,589

Related videos on Youtube

ً       ً
Author by

ً ً

Updated on September 18, 2022

Comments

  • ً       ً
    ً ً over 1 year

    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 .

    • Frank Thomas
      Frank Thomas over 8 years
      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.
  • ً       ً
    ً ً over 8 years
    So, it gives error for both ,right ?
  • ChrisInEdmonton
    ChrisInEdmonton over 8 years
    "A Destination Unreachable message may be generated as a result of a TCP, UDP or another ICMP transmission"
  • ً       ً
    ً ً over 8 years
    Rt sir , Can you say ,It returns error for port too . :)
  • Frank Thomas
    Frank Thomas over 8 years
    It is my understanding that Destination unreachable and Port unreachable are differant messages. wildpackets.com/resources/compendium/tcp_ip/unreachable
  • Spiff
    Spiff over 8 years
    @FrankThomas Port Unreachable is a subtype of Destination Unreachable.
  • ً       ً
    ً ً over 8 years
    @Spiff , well , what I concuded that "both UDP and TCP returns error when all 15 subtype of type 3 of ICMP , "