Saturday, October 20, 2007

ICMP type 3, Destination unreachable message

ICMP type 3, Destination unreachable message

Links:
ICMP parameters.

Implementation

Host
Mandatory.

Router
Mandatory.

This message is generated by a router to inform the source host that the destination address is unreachable. This message is not generated in response to a datagram destined for a multicast address.

The IP header plus the first 8 bytes of the original datagram's data is returned to the sender. This data is used by the host to match the message to the appropriate process. If a higher level protocol uses port numbers, they are assumed to be in the first 64 data bits of the original datagram's data.

RFC 792, page 5:

If, according to the information in the gateway's routing tables, the network specified in the internet destination field of a datagram is unreachable, e.g., the distance to the network is infinity, the gateway may send a destination unreachable message to the internet source host of the datagram. In addition, in some networks, the gateway may be able to determine if the internet destination host is unreachable. Gateways in these networks may send destination unreachable messages to the source host when the destination host is unreachable.

If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module or process port is not active, the destination host may send a destination unreachable message to the source host.

Another case is when a datagram must be fragmented to be forwarded by a gateway yet the Don't Fragment flag is on. In this case the gateway must discard the datagram and may return a destination unreachable message.

RFC 1349, page 8:

The ICMP Destination Unreachable message contains a code which describes the reason that the destination is unreachable.

0
Network unreachable error.

1
Host unreachable error.

2
Protocol unreachable error. When the designated transport protocol is not supported.

3
Port unreachable error. When the designated transport protocol (e.g., UDP) is unable to demultiplex the datagram but has no protocol mechanism to inform the sender.

4
The datagram is too big. Packet fragmentation is required but the DF bit in the IP header is set.

5
Source route failed error.

6
Destination network unknown error.

7
Destination host unknown error.

8
Source host isolated error. Obsolete.

9
The destination network is administratively prohibited.

10
The destination host is administratively prohibited.

11
The network is unreachable for Type Of Service.

12
The host is unreachable for Type Of Service.

13
Communication Administratively Prohibited. This is generated if a router cannot forward a packet due to administrative filtering.

14
Host precedence violation. Sent by the first hop router to a host to indicate that a requested precedence is not permitted for the particular combination of source/destination host or network, upper layer protocol, and source/destination port.

15
Precedence cutoff in effect. The network operators have imposed a minimum level of precedence required for operation, the datagram was sent with a precedence below this level.