From owner-freebsd-net@FreeBSD.ORG Fri Nov 29 18:03:20 2013 Return-Path: Delivered-To: freebsd-net@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 EBCFCBC0; Fri, 29 Nov 2013 18:03:20 +0000 (UTC) Received: from mail-pd0-x22c.google.com (mail-pd0-x22c.google.com [IPv6:2607:f8b0:400e:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE5B1152F; Fri, 29 Nov 2013 18:03:20 +0000 (UTC) Received: by mail-pd0-f172.google.com with SMTP id g10so14184735pdj.17 for ; Fri, 29 Nov 2013 10:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BhNmunVCSddq8mAZO1KhluFZ5x5bdW8igmq/Thl3QqA=; b=budZvJZKK6+pwHXF6TZ7rRu5yVtX3GA0870RoHP6RCSN/zdjWawBWjsPGZX2g8FOUc 3Hm4A/byBEiQZ5r7VhrtfaYn6ZhxUFFftybmZdsx02F4RqjWxb73VRSYocRpepwR2S2z 9qBc6DnuphQ1W+hXt6RmYhwq7tiItEiHv81KwerRCL2HFzZW5WxsSxzPqgg0/9Lx0npU 4jXF9YUPyAzCKExfETq9NjFtAT2tJH51wMjHNhW98NU6maih3xpWa7NOUaigAfxThXXF PGag+safbi6YzYXB2S9L51Qk+13MQnFbD4+ZnGqwrem1PfNw16+20w2adihSn/5B0iaX 3ksA== MIME-Version: 1.0 X-Received: by 10.68.130.72 with SMTP id oc8mr3279709pbb.200.1385748200369; Fri, 29 Nov 2013 10:03:20 -0800 (PST) Received: by 10.68.147.131 with HTTP; Fri, 29 Nov 2013 10:03:20 -0800 (PST) In-Reply-To: <4053E074-EDC5-49AB-91A7-E50ABE36602E@freebsd.org> References: <4053E074-EDC5-49AB-91A7-E50ABE36602E@freebsd.org> Date: Fri, 29 Nov 2013 10:03:20 -0800 Message-ID: Subject: Re: [PATCH] SO_REUSEADDR and SO_REUSEPORT behaviour From: Oleg Moskalenko To: Tim Kientzle Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: =?ISO-8859-1?Q?Ermal_Lu=E7i?= , freebsd-net , "freebsd-current@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2013 18:03:21 -0000 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 wrote: > > 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 t= o > > 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 close= d. > > * 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 =93still i= n > 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.org" >