in Computer Networks edited by
14,007 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$
in Computer Networks edited by
14.0k views

2 Comments

As ICMP packet will not depend on the protocol at transport layer. So it will generate both for UDP and TCP. So option (d) is correct.
22
22
As ICMP is a network layer protocol ...so it has nothing to do with Transport layer protocol which you're using...so ans is D)

Additional info. : even though there are various types of ICMP messages broadly categorized into ICMP feedback messaging and ICMP request and reply messages..as there are no ack.s in IP datagram service (n/w layer protocol) even if there is ICMP with IP layer still it's unreliable because if ICMP ((generated to let the sender know that something went wrong)) is lost then there will not be any additional ICMP generated as it's created looping problems in the network...so IP Datagram service will be still unreliable...
5
5

9 Answers

35 votes
35 votes
Best answer

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

3 Comments

edited by
as i know TCP uses RST for  DESTINATION UNREACHABLE information.. it doesnt mean Destination Unreachable ICMP not genrated. TCP not going to use it but it is generated at network layer.
3
3

do we need to remember the type and code for ICMP Message for GATE? I hope not

3
3
No need to remember. Just knowing the basic functioning is sufficient for GATE.
0
0
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

4 Comments

@Aakash_ @Milicevic3306 @Arjun

For a TCP connection, TCP must have gone thorough 3 way handshaking before packets could be delieverd to destination process. So during initial connection creation time if TCP is not able to create the connection due to destination which is not available on some PORT then even in that case, will ICMP error message gets generated?

0
0
Please tell the name of the book.
0
0
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'.
15 votes
15 votes
According to rfc, the standard there's no where mentioned that ICMP messages depend upon transport layer protocol. Link https://tools.ietf.org/html/rfc792 So (d)
Answer:

Related questions