Re: connect(2) behavior with unreacheable hosts

From: Barney Wolff <barney_at_pit.databus.com>
Date: Sat, 12 Apr 2003 23:08:59 -0400
On Sat, Apr 12, 2003 at 09:00:42PM -0600, M. Warner Losh wrote:
> I just read the rest of the thread:
> 
> 1) route loops don't matter.  connect should timeout after a while,
>    and on stable it is like 75 seconds.  loop elsewhere doesn't matter
>    because it is the same thing as a black hole.  You don't get the
>    handshake back, you timeout.  Doesn't matter why (and the sending
>    host can't tell them apart).
> 2) This is clearly TCP.
> 3) telnet 1.2.3.4 does the following bogusly:
> 	Trying 1.2.3.4...
> 	Connected to 1.2.3.4.
> 	Escape character is '^]'.
> 	Connection closed by foreign host.
> 
> All the lines are printed in < 1s.
> 
> However, this may be because I live behind a NAT box.  Any chance you
> did your testing in a similar environment, which is causing your
> confusion.  On my non-NAT'd boxes, this works as expected.

The catch is that connecting to 1.2.3.4 behaves differently depending
on whether:
1.  ICMP host-unreach
2.  Nothing at all
3.  ICMP time-exceeded
comes back.  The first two cases are handled correctly, the third is not.

-- 
Barney Wolff         http://www.databus.com/bwresume.pdf
I'm available by contract or FT, in the NYC metro area or via the 'Net.
Received on Sat Apr 12 2003 - 18:09:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:03 UTC