From owner-freebsd-net@FreeBSD.ORG Wed Aug 22 07:25:18 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C35E16A417 for ; Wed, 22 Aug 2007 07:25:18 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.freebsd.org (Postfix) with ESMTP id 45F4413C45E for ; Wed, 22 Aug 2007 07:25:18 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 566C0695E; Wed, 22 Aug 2007 11:25:16 +0400 (MSD) Received: from localhost (is1.park.rambler.ru [81.19.64.121]) by relay0.rambler.ru (Postfix) with ESMTP id 346A56406; Wed, 22 Aug 2007 11:25:16 +0400 (MSD) Date: Wed, 22 Aug 2007 11:25:11 +0400 From: Igor Sysoev To: freebsd-net@freebsd.org Message-ID: <20070822072511.GD59317@rambler-co.ru> References: <20070820151142.GA20183@rambler-co.ru> <20070820165354.GN99491@funkthat.com> <20070820183012.GA27177@rambler-co.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20070820183012.GA27177@rambler-co.ru> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: John-Mark Gurney Subject: Re: maximum number of outgoing connections X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2007 07:25:18 -0000 On Mon, Aug 20, 2007 at 10:30:12PM +0400, Igor Sysoev wrote: > On Mon, Aug 20, 2007 at 09:53:55AM -0700, John-Mark Gurney wrote: > > > Igor Sysoev wrote this message on Mon, Aug 20, 2007 at 19:11 +0400: > > > It seems that FreeBSD can not make more than > > > > > > net.inet.ip.portrange.last - net.inet.ip.portrange.first > > > > > > simultaneous outgoing connections, i.e., no more than about 64k. > > > > > > If I made ~64000 connections 127.0.0.1:XXXX > 127.0.0.1:80, then > > > connect() to an external address returns EADDRNOTAVAIL. > > > > Isn't this more of a limitation of TCP/IP than FreeBSD? because you > > need to treat the srcip/srcport/dstip/dstport as a unique value, and > > in your test, you are only changing one of the four... Have you tried > > running a second we server on port 8080, and see if you can connect > > another ~64000 connections to that port too? > > No, TCP/IP limitation is for XXXX in 127.0.0.1:XXXX <> 127.0.0.1:80, > but FreeBSD limits all outgoing connections to the port range, i.e. > > local part remote part > 127.0.0.1:5000 <> 127.0.0.1:80 > 192.168.1.1:5000 <> 10.0.0.1:25 > > can not exist simultaneously, if both connections were started from > local host. To be exact - if connect() was called on unbound socket. -- Igor Sysoev http://sysoev.ru/en/