From owner-freebsd-questions@FreeBSD.ORG Fri Mar 9 12:49:30 2007 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A924F16A400 for ; Fri, 9 Mar 2007 12:49:30 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mx1.freebsd.org (Postfix) with ESMTP id 737AB13C491 for ; Fri, 9 Mar 2007 12:49:30 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from vanquish.pgh.priv.collaborativefusion.com (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTP id C8B37EBC62; Fri, 9 Mar 2007 07:49:29 -0500 (EST) Date: Fri, 9 Mar 2007 07:49:22 -0500 From: Bill Moran To: Atis Message-Id: <20070309074922.48f3909c.wmoran@potentialtech.com> In-Reply-To: <945196e0703090343r347e31d1i4b1d85c65eb8033@mail.gmail.com> References: <85e0e3140703090253y262681aoca14fb522d18a076@mail.gmail.com> <945196e0703090343r347e31d1i4b1d85c65eb8033@mail.gmail.com> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.9; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org Subject: Re: 65535 outbound connections X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2007 12:49:30 -0000 In response to Atis : > On 3/9/07, Niklaus wrote: > > Hi > > > > I could be wrong in the below description or might have misunderstood > > many of the concepts , please correct appropriately. > > > > 65535 ports can allowed . So on a machine namely C you can have max > > 65535 outbound connections > > There can be simultaneous connections to one port. For example > apache's httpd - it listens port 80, does that mean, it can serve only > one connection? nope. Once connection is established, it's forwarded > to another thread, that have connection id, and processes it. > > Don't know about outgoing connections, but i think, they also can be > simultaneous. No. Outgoing connections must always grab a unique port. The upshot is that the "socket pair", which is the IP:port of one end of the connection, plus the IP:port of the other end, must always be unique. Since a listening socket (server) will frequently have many connections to the same port, client side apps _must_ pick a unique port each time, to protect from network failure. This is enforce by the operating system. So, the total number of (theoretical) connections is limited by the product of IP space * port range. But the total number of available outgoing connections is limited by the port range, and that's where that 65536 comes from. -- Bill Moran http://www.potentialtech.com