edited by
23,412 views
61 61 votes

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

  1. $Y$ but not $Z$
  2. $Z$ but not $Y$
  3. Neither $Y$ nor $Z$
  4. Both $Y$ and $Z$

11 Answers

Best answer
49 49 votes

Answer should be (D) ,

An ICMP packet with a message type $3$ (Destination Unreachable) and a message code $3$ (Port Unreachable) lets you know that the machine you tried to reach is not listening on this port. When you nmap a machine on a port it's not listening on, it sends back an ICMP packet like this to let you know that it's not listening on that port (if the port is not firewalled. If it is, then what happens depends on the config of your firewall).
ref @ http://www.linuxchix.org/content/courses/security/icmp

http://www.tcpipguide.com/free/t_ICMPv4DestinationUnreachableMessages-3.htm

http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Destination_unreachable

Port Unreachable

Unlike the Network Unreachable and Host Unreachable messages which come from routers, the Port Unreachable message comes from a host. The primary implication for troubleshooting is that the frame was successfully routed across the communications infrastructure, the last router ARP'ed for the host, got the response, and sent the frame. Furthermore, the intended destination host was on-line and willing to accept the frame into its communications buffer. The frame was then processed by, say, TCP or, perhaps UDP, RIP, OSPF, or some other protocol. The protocol (TCP or UDP) tried to send the data up to the destination port number (TCP or UDP port) and the port process didn't exist. The protocol handler then reports Destination Unreachable - Port Unreachable.

ref @ http://www.wildpackets.com/resources/compendium/tcp_ip/unreachable

  • $\text{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

http://support.microsoft.com/en-us/kb/325122

Port unreachable is a code $3$ within type $3$ @ http://tools.ietf.org/html/rfc792

http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml 

http://www.faqs.org/rfcs/rfc792.html

edited by
52 52 votes

Yes, for both $TCP$ & $UDP$  packet , an $ICMP$ port unreachable error will be generated. $ICMP$ packet contains $8$ $byte$ data (both from tcp and udp header) where it contains dummy port no just for checking trace rout. References  below from forouzan book--

edited by
40 40 votes
Whenever an IP packet is lost or discarded  ICMP packet will be generated by receiver or the router. It doesn't matter whether it's containing TCP or UDP inside it.

Hence answer is 'd'.
12 12 votes

ICMP (Internet Control Message Protocol) is an error reporting and query protocol that works at NL.

It could report quite a few errors through messages like:-

  • Destination unreachable
     
  • Source quench (destination reports the source to reduce its pace of sending data)
    Source quench is generally sent (via ICMP) after destination/receiver has to discard a packet because of buffer overflow.
     
  • Time exceeded.
    This error message indicates that TTL reached 0.

Now, since it works at NL, the functionality of TL is transparent to ICMP (Transparency is computer science means being unaware because "it is transparent — we can't see it")

So no matter what you use at TL, ICMP being at NL will do what it's designed to do.

Hence, Option D



Special cases.

ICMP error messages are NOT generated for:-

  1. Error in any fragmented packet that's not the first fragment
    (https://stackoverflow.com/questions/33986368/why-no-icmp-error-message-is-generated-for-a-fragmented-datagram-that-is-not-the)
     
  2. Multicasting error.
     
  3. Packets having addresses like 0.0.0.0 or 127.0.0.0 (loopback testing address)


Bonus:-

An algorithm called "traceroute" is employed to find the route of a packet.

It uses two ICMP messages 

  1. Destination unreachable
  2. Time exceeded

to figure out a packet's route. It uses UDP at TL.

6 6 votes

ICMP message will be sent in case of UDP but not TCP.

Please refer to this excerpt from Kurose & Ross

Answer:
Position:
Show:

Related questions

92 92 votes
11 answers 11 answers
22.4k
22.4k views
Ishrat Jahan asked Nov 1, 2014
22,405 views
A subnetted Class $B$ network has the following broadcast address: $144.16.95.255$Its subnet maskis necessarily $255.255.224.0$is necessarily $255.255.240.0$is necessaril...
78 78 votes
14 answers 14 answers
24.0k
24.0k views
Ishrat Jahan asked Nov 1, 2014
24,000 views
On a wireless link, the probability of packet error is $0.2$. A stop-and-wait protocol is used to transfer data across the link. The channel condition is assumed to be in...
69 69 votes
13 answers 13 answers
20.0k
20.0k views
Ishrat Jahan asked Nov 1, 2014
19,999 views
A link of capacity $100$ $\text{Mbps}$ is carrying traffic from a number of sources. Each source generates an on-off traffic stream; when the source is on, the rate of tr...