Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Sep 2006 09:19:04 GMT
From:      Dan Burzynski <dan@moo.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/102741: Multiple outbound connect() calls produce 'Network is unreachable'
Message-ID:  <200609010919.k819J4kR046968@www.freebsd.org>
Resent-Message-ID: <200609010920.k819KQBU094171@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         102741
>Category:       kern
>Synopsis:       Multiple outbound connect() calls produce 'Network is unreachable'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 01 09:20:26 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Dan Burzynski
>Release:        6.1
>Organization:
Moo
>Environment:
FreeBSD hendrix.moocards.com 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May  7 04:42:56 UTC 2006     root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386
>Description:
When doing multiple (but not nessesarlity concurrent) outbound socket connections (such as using HTTP) we're seeing the error message 'Network is unreachable' after a random amount. It then persists for a while and then we're back to it working for a little while.

I've run a tcpdump and it seems that the point at which it complains that the network is unreachable, it's not even tried to make the connection.

This problem occurs on two different boxes installed with the same version of BSD (although their hardware is identical):

CPU: 2 x PowerEdge 1850 Xeon 3.0Ghz/2MB, 800FSB
Memory: 4GB Dual Rank DDR2 Memory (2x2GB)
Network: Dual embedded Intel Gigabit3 NICs; single and dual port Intel PRO/1000 
MT Gigabit adapters
>How-To-Repeat:
The following simple Perl script reproduces the problem:

#!/usr/bin/perl -w

use strict;
use IO::Socket;

my $remote_host = 'other.server.com';
my $remote_port = '80';
my $times = 300;

for (my $i = 0; $i < $times; $i++) {
        my $socket = new IO::Socket::INET(
                PeerAddr => $remote_host,
                PeerPort => $remote_port,
                Proto => 'tcp',
                Type => SOCK_STREAM) || die ("Can't connect: $@");

        print $socket "HEAD / HTTP/1.1\r\nHost:$remote_host\r\n\r\n";
        my $answer = <$socket>;
        chomp($answer);

        close($socket);
}

It'll work a few times and the produce the error:

Can't connect: IO::Socket::INET: connect: Network is unreachable at ./stest.pl line 12.


Running Apache's 'ab' will also have the same effect, as will running something like portupgrade on something like vim where lots of little patches are required to be downloaded individually.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609010919.k819J4kR046968>