edited by
13,939 views
41 votes
41 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$
edited by

9 Answers

Best answer
35 votes
35 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
44 votes
44 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
33 votes
33 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'.
Answer:

Related questions

30 votes
30 votes
5 answers
2
Kathleen asked Sep 22, 2014
19,445 views
Packets of the same session may be routed through different paths in:TCP, but not UDPTCP and UDPUDP, but not TCPNeither TCP nor UDP
1 votes
1 votes
1 answer
4
Jeetmoni saikia asked Nov 4, 2022
497 views
The underlying Transport layer protocol used by SMTP is ________(a) TCP(b) UDP(c) Either TCP or UDP