From owner-freebsd-net@FreeBSD.ORG Thu Mar 21 01:06:41 2013 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD9085F5 for ; Thu, 21 Mar 2013 01:06:41 +0000 (UTC) (envelope-from markd-freebsd-net@bushwire.net) Received: from smtp1.bushwire.net (f5.bushwire.net [199.48.133.46]) by mx1.freebsd.org (Postfix) with SMTP id 936A7E93 for ; Thu, 21 Mar 2013 01:06:40 +0000 (UTC) Received: (qmail 98715 invoked by uid 1001); 21 Mar 2013 00:59:59 -0000 Delivered-To: qmda-intercept-freebsd-net@FreeBSD.org DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=2004; d=bushwire.net; b=5VKch5Qe/4PKKnpod3DpMPME5+sPBbTwUfAZT6sSmt+8mPfLWnjP8/z3lC3Nk4D9; Comments: DomainKeys? See http://en.wikipedia.org/wiki/DomainKeys DomainKey-Trace-MD: h=10; b=25; l=C18R71D32M65F47T27S69M17C39C27; Comments: QMDA 0.3 Received: (qmail 98707 invoked by uid 1001); 21 Mar 2013 00:59:59 -0000 Date: 21 Mar 2013 00:59:59 +0000 Message-ID: <20130321005959.98706.qmail@f5-external.bushwire.net> From: "Mark D" To: freebsd-net@FreeBSD.org Subject: Best way for an app to accept traffic on 30,000+ interfaces? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2013 01:06:41 -0000 (Hopefully this isn't too out-of-scope for this list..) I have an application in mind that I'd like to have accept/respond to UDP queries sent to perhaps 30K contiguous IP addresses (most likely IPV6 addresses because such ranges are easy to come by, but conceptually ipv4 as well). This would all be on a small number of FBSD instances. Though it could be done, I don't really want to create 30K interfaces and have the application bind 30K sockets as it's not clear if that will scale if I try an address range that expands to, say, 1M IPs wide. This address range would be internet-facing and responding to random remote clients. My first thought is to use SOCK_RAW in much the same way that natd does - at least to receive the traffic. Is that a sensible and viable approach or is there a better/easier way? Mark.