From owner-freebsd-current@FreeBSD.ORG Fri Nov 29 19:30:03 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B751134; Fri, 29 Nov 2013 19:30:03 +0000 (UTC) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D275B1AFB; Fri, 29 Nov 2013 19:30:02 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id k4so2174433qaq.15 for ; Fri, 29 Nov 2013 11:30:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=5EVsvFt8BXDMy6fHbQ+UGB+UcTX1Lgack40jddvYHjQ=; b=ZaQin9mepc8SYXmle4KOR2sGE4doXhOz8xxIk8jJu626r7eHTnm+PdY5OlmNPwI/d9 1n5k7pW4Yvmzcc7JouYee5Owu5xx5flR0T4TcVo6ztyuNvrLC5x4aY8ndby60OdtJwob 0SjUxBBcDcezHrRycvZLA3YSPBBiOitb9h/w2yfNZh9UhWfva3r84FDWEdY3XsOty4WY xBNgOAIoK7XpLL1gZj/10ao+Y8v6TN7obPES60RN4e1OhbXmUuALvLXO7iRwdZ/rnctE /znmGTbyjbp+g2b0jIlKlz9pdKXvYJj2EmXG24PO3v3n2J3ifY3gijbRFGf487riJLXe r2/g== MIME-Version: 1.0 X-Received: by 10.49.35.144 with SMTP id h16mr89637851qej.35.1385753402048; Fri, 29 Nov 2013 11:30:02 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Fri, 29 Nov 2013 11:30:01 -0800 (PST) In-Reply-To: References: <4053E074-EDC5-49AB-91A7-E50ABE36602E@freebsd.org> Date: Fri, 29 Nov 2013 11:30:01 -0800 X-Google-Sender-Auth: bw5zAjZQER44f0HmpPx0l8u5Gjk Message-ID: Subject: Re: [PATCH] SO_REUSEADDR and SO_REUSEPORT behaviour From: Adrian Chadd To: Oleg Moskalenko Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-1?Q?Ermal_Lu=E7i?= , freebsd-net , Tim Kientzle , "freebsd-current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2013 19:30:03 -0000 Sure, is there a TCP version of this patch floating around? How's it doing load balancing to multiple listeners? -a On 29 November 2013 11:28, Oleg Moskalenko wrote: > It would be nice to have this feature compiled and supported in FreeBSD > kernel by default. > > Thanks > Oleg > > > On Fri, Nov 29, 2013 at 11:01 AM, Ermal Lu=E7i wrote: > >> And some better marketing from Dragonfly about it >> http://forum.nginx.org/read.php?29,241283,241283 :) >> >> >> On Fri, Nov 29, 2013 at 7:55 PM, Ermal Lu=E7i wrote: >> >>> Also some discussions and improvements to it. >>> >>> http://unix.derkeiler.com/Mailing-Lists/FreeBSD/net/2013-09/msg00165.ht= ml >>> >>> >>> On Fri, Nov 29, 2013 at 7:42 PM, Ermal Lu=E7i wrote: >>> >>>> Well seems Dragonfly has some version of it already from commit [1]. >>>> >>>> In FreeBSD there is the framework for this with by defining PCBGROUP. >>>> Also the explanation of it at [2] and [3]. >>>> It can achieve approximately the same features of SO_RESUSEPORT of lin= ux. >>>> The only thing missing is the marketing behind it and i think and bett= er >>>> RSS support. >>>> By looking at dates the support is there before linux so all you guys >>>> looking for it can experiment with it. >>>> >>>> What i was trying to accomplish was something else from performance >>>> improvement and >>>> maybe put a sysctl behind it to make it more acceptable.. >>>> >>>> [1] >>>> http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/740d1d9f7b7bf9= c9c021abb8197718d7a2d441c9 >>>> [2] >>>> http://fxr.watson.org/fxr/source/netinet/in_pcbgroup.c?im=3Dbigexcerpt= s#L51 >>>> [3] >>>> http://lists.freebsd.org/pipermail/svn-src-head/2011-June/028190.html >>>> >>>> >>>> On Fri, Nov 29, 2013 at 7:03 PM, Oleg Moskalenko = wrote: >>>> >>>>> Tim, you are wrong. Read what is "multicast" definition, and read how >>>>> UDP and TCP sockets work in Linux 3.9+ kernels. >>>>> >>>>> Oleg . >>>>> >>>>> >>>>> On Fri, Nov 29, 2013 at 9:59 AM, Tim Kientzle w= rote: >>>>> >>>>>> >>>>>> On Nov 29, 2013, at 4:04 AM, Ermal Lu=E7i wrote: >>>>>> >>>>>> > Hello, >>>>>> > >>>>>> > since SO_REUSEADDR and SO_REUSEPORT are supposed to allow two >>>>>> daemons to >>>>>> > share the same port and possibly listening ip =85 >>>>>> >>>>>> These flags are used with TCP-based servers. >>>>>> >>>>>> I=92ve used them to make software upgrades go more smoothly. >>>>>> Without them, the following often happens: >>>>>> >>>>>> * Old server stops. In the process, all of its TCP connections are >>>>>> closed. >>>>>> >>>>>> * Connections to old server remain in the TCP connection table until >>>>>> the remote end can acknowledge. >>>>>> >>>>>> * New server starts. >>>>>> >>>>>> * New server tries to open port but fails because that port is =93st= ill >>>>>> in use=94 by connections in the TCP connection table. >>>>>> >>>>>> With these flags, the new server can open the port even though >>>>>> it is =93still in use=94 by existing connections. >>>>>> >>>>>> >>>>>> > This is not the case today. >>>>>> > Only multicast sockets seem to have the behaviour of broadcasting >>>>>> the data >>>>>> > to all sockets sharing the same properties through these options! >>>>>> >>>>>> That is what multicast is for. >>>>>> >>>>>> If you want the same data sent to all listeners, then >>>>>> that is multicast behavior and you should be using >>>>>> a multicast socket. >>>>>> >>>>>> > The patch at [1] implements/corrects the behaviour for UDP sockets= . >>>>>> >>>>>> You=92re trying to turn all UDP sockets with those options >>>>>> into multicast sockets. >>>>>> >>>>>> If you want a multicast socket, you should ask for one. >>>>>> >>>>>> Tim >>>>>> >>>>>> _______________________________________________ >>>>>> freebsd-net@freebsd.org mailing list >>>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.or= g" >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Ermal >>>> >>> >>> >>> >>> -- >>> Ermal >>> >> >> >> >> -- >> Ermal >> > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"