ICMP error message specifying that an IP packet cannot be delivered for whatever reason. The ICMP type is 3. The ICMP code indicates the reason that the packet cannot be delivered:
  • Code 0: Network is unreachable (ICMP_UNREACH_NET)
  • Code 1: Host is unreachable (ICMP_UNREACH_HOST)
  • Code 2: Bad Protocol (ICMP_UNREACH_PROTOCOL)
  • Code 3: Port Unreachable (ICMP_UNREACH_PORT)
  • Code 4: Fragmentation required, and the don't fragment bit was set in the IP header (ICMP_UNREACH_NEEDFRAG)
  • Code 5: Source route failed (ICMP_UNREACH_SRCFAIL)
  • Code 6: Network is unknown (ICMP_UNREACH_NET_UNKNOWN)
  • Code 7: Host is unknown (ICMP_UNREACH_HOST_PROHIB)
  • Code 8: Source host is isolated (ICMP_UNREACH_ISOLATED)
  • Code 9: Prohibited access to the network (ICMP_UNREACH_NET_PROHIB)
  • Code 10: Prohibited access to host (ICMP_UNREACH_HOST_PROHIB)
  • Code 11: Bad type of service for network (ICMP_UNREACH_TOSNET)
  • Code 12: Bad type of service for host (ICMP_UNREACH_TOSHOST)
  • Code 13: Filtered because access is prohibited (ICMP_UNREACH_ FILTER_PROHIB)
  • Code 14: Host precedence violation (ICMP_UNREACH_HOST_PRECEDENCE)
  • Code 15: Precedence too low (ICMP_UNREACH_HOST_PREFERENCE)
The data section of the ICMP Destination Unreachable responses has 32 bits of zero, and then the header of the IP packet followed by 64 bits of the original message. The exception to this is for the Fragmentation required (code 4), which RFC-1191 changes the 32 bits of zero to be 16 bits of zero followed by 16 bits containing the maximum transmission unit (MTU) of the next hop (the MTU which would have forced fragmentation). This change is to improve MTU discovery.

The most common ICMP Destination Unreachable codes by far are host unreachable, port unreachable, fragmentation required, and filtered. Some machines will return network unreachable when it is the case, but this is surprisingly uncommon. Source route failed can be seen if you are attempting source routing, which is not normal. The other codes occur rarely.

Log in or register to write something here or to contact authors.