Technical article 105526

I am getting: "Destination Unreachable - Network, Port, or Host Unreachable".

OpenServer 5

Written · Last revised

Problem

I have an application that uses ICMP (Internet Control Message Protocol) and I am getting one of the following error messages:

Destination Unreachable - Network Unreachable
Destination Unreachable - Host Unreachable
Destination Unreachable - Port Unreachable

Cause

There are three common and significant causes for these errors:

1. Network Unreachable: This can be sent by any router saying it has no way to reach the net via the destination IP address specified.

2. Host Unreachable: This is sent by the last router in the path in an existing network, when the host address cannot be resolved.

3. Port Unreachable: This is sent by the destination host on the destination network when the port process does not exist, has been incorrectly specified, or is unavailable.

Solution

1. NETWORK UNREACHABLE
When a router sends a Network Unreachable message, it is saying that
it has no way to reach the network or subnetwork as specified in the
destination IP address in a frame.  Since the destination is the
locator portion of the address, as it is configured in the router,
the Network Unreachable message could be the result of a
misconfigured netmask in the router.  It could be as simple as
specifying a nonexistent network on the command line for an
application.  If you try to telnet to <IP_addr_1> when there is no
network <IP_addr_1>, you will end up with a Network Unreachable
message from the router that finally figures it out. Remember that
the frame will be forwarded from the Default Gateway to Default
Gateway until it figures out that it can't forward it anywhere else
(the more routes you have the longer this will take).  This last
router will send the Destination Unreachable - Network Unreachable
message.  If a link is down or an interface failed (because of a
bad port) the networks that would be reached across the link or
through the port are now unreachable (assuming there is no other
way to reach them via an alternate path).

Summary: Network Unreachable, check for the following:

a. Is the specified destination address a valid network?

b. Is the link-up from the router sending the Network Unreachable message?

c. Is the port in the router configured with the correct netmask value?

d. Use ping, arp -a, netstat -rn (with "a" flag to check all
   routing tables) netstat -a, llistat -l and ifconfig -a or
   ifconfig <interface> for those releases prior to SCO OpenServer
   Release 5.0.x and Internet FastStart Release 1.x.
2. HOST UNREACHABLE
When a router sends a Host Unreachable message it is telling you
that it believed itself to be the router that was directly connected
to the network on which the host was configured.  That is, a frame
is passed from the originator to router, to router, to router,
finally ending up at the last router in the path - the one that has
the destination network attached to one of its ports.  It is this
last router that broadcasts an ARP frame onto the network looking
for the data link (DLC) address of the host. The host should answer
the ARP and the router can then forward the frame. If, however, the
router ARP's and receives no answer then it sends a Destination
Unreachable - Host Unreachable message back to the originator.  The
significance of this is that a Host Unreachable message implies that
the intervening communications infrastructure is working properly.
The frame has been forwarded all the way through the interconnected
network and has arrived successfully at the last router in the path.
This router was able to successfully transmit an ARP command onto
the correct network cable. The ARP simply wasn't answered. The
entire communications path, including the final interface and final
network segment (or ring) was working properly. The host simply
wasn't there.
On the very simplistic side, a Host Unreachable message could be the
result of an incorrectly typed IP address. It could be that the host
was down or otherwise offline. It could be that there were a high
number of physical errors on the destination network (but this is
unlikely since the last router was able to send ARP commands). In
any event, the next step in troubleshooting is to move your protocol
analyzer ("sniffer", if you have one) to the last network (the one
on which the host is located) and see what's happening there.
Sniffers can be useful in tracing really difficult transport problems           on the network/subnetwork.

Summary: Host Unreachable, you can look at the following:

a. Check to make sure that the intervening communications infrastructure is working properly.

b. Is the specified destination address the correct address for the host?

c. Is the Host currently online and active?

d. Are there any physical problems on the destination network?

e. Along with the commands in the previous section, llistat -l provides useful frame information that can be used to track down a number of different problems: frame errors, collisions, transit errors and other more obscure problems.

f. To examine the current settings of your TCP configuration: inconfig -v (Note: inconfig(ADMN) is not available for those releases prior to OpenServer 5.0.x and Internet FastStart 1.x. For these releases the TCP configuration values are found in /etc/conf/pack.d/tcp/space.c.)

3. PORT UNREACHABLE
Unlike the Network Unreachable and Host Unreachable message which
usually seem to 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'd for the host, got the
response, and sent the frame. Furthermore, the intended destination
host was online and willing to accept the frame into its
communications buffer. The frame was then processed by TCP or,
perhaps UDP, RIP, or some other protocol.  The protocol 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.
As a note, bear in mind that TCP socket connections are direct and
UDP socket connections are indirect or broadcast (UDP is also known
as NFS connections).  TCP socket connections can be increased via
netconfig, where UDP socket connections can be increased (once NFS
is configured) under the NFS runtime system in netconfig.

However, one of the more common Port Unreachable errors occurs when an SNMP console is polling a number of devices on the network. The console has been configured with an IP address list to poll for the acquisition of network management data. The assumption is that each of these managed devices has been configured with an SNMP agent program assigned to a particular port number. One standard SNMP port number is 161 (look in /etc/services for SCO's port configuration). If you see a Port 161 Unreachable then it would be reasonable to assume that a console was polling a device that didn't have an SNMP agent configured into it.

If you try to set up a NetBIOS connection on, for example, port 138
with a server that doesn't support NetBIOS (hence, no 138 processing
entity) you get a Port Unreachable.  Mounting a file volume to a
server that doesn't support NFS results in the same error message.

When troubleshooting a Port Unreachable error we need to know what is supposed to be at the indicated (unreachable) port. It may be as simple as looking up RFC 1700 (an industry standard port number document) and what SCO supports by default in the /etc/services file is a good start; or as complicated as working with your application to figure out what ports the program may be using, in that they may be using special port numbers other than the industry (or SCO) standard ports.

An error that might be associated with a Port Unreachable message
is seen when an otherwise normally operating connection is
interrupted by a Port Unreachable message. When you inspect the
conversation (for example, via netstat -a and llistat -l) you see
that the unreachable port was working at one point without a
problem.  Frames were sent to and from the port number when,
suddenly - Port Unreachable.  This is indicative of an overload
condition or process priority configuration problem in the reporting
host.  The process in question was swapped out of memory and was
not able to swap back in quickly enough to avoid the unreachable
indication.

The nice thing about a Port Unreachable message is that it confirms proper operation of the networking communications infrastructure and the presence of the destination host processor (the system).

Summary: Port Unreachable, some things to look at:

a. The host and the communications infrastructure are working properly.

b. The ICMP Port Unreachable message originates from a host, not a router.

c. The indicated port process was either not running or was swapped out. SNMP (Port 161) is a common missing port.

d. Find out what the port is used for and why it wasn't available.

e. Files you should check: /etc/services; /etc/inetd.conf; and /etc/protocols.

See also

TA107294, "Cannot ping another host, ping localhost works fine."

TA107436, "Getting: "lp: connect: network unreachable" when printing remotely."

TA107443, "recvfrom(SLIB) or sendto(SLIB) fail with errno set to ECONNREFUSED(115)."

TA107526, "Network unreachable, jobs queued but cannot start daemon."

The man pages: Intro(ADMP), udp(ADMP), tcp(ADMP)

From the Xinuos technical article database, record 105526. Reproduced with permission. The original is at www.sco.com/ta/105526, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.