Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2001 13:44:03 +0300
From:      "Vladimir A. Jakovenko" <vovik@lucky.net>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        freebsd-net@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: SO_REUSEPORT on unicast UDP sockets
Message-ID:  <20010907134403.T2693@lucky.net>
In-Reply-To: <3B947922.F8B98DBD@mindspring.com>; from tlambert2@mindspring.com on Mon, Sep 03, 2001 at 11:48:02PM -0700
References:  <20010902054617.A47742@lucky.net> <3B947922.F8B98DBD@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 03, 2001 at 11:48:02PM -0700, Terry Lambert wrote:
>"Vladimir A. Jakovenko" wrote:
>> 
>> Hello!
>> 
>>  According to UNPv1 SO_REUSEPORT on UDP sockets can be used to bind more than
>>  one socket to the same port (even with same source ip address). But quick
>>  look on /sys/netinet/udp_usrreq.c function udp_input() shows that this will
>>  work as expected (data stream duplicate) only on multicast/broadcast local
>>  addresses. Please pay attention to the following code fragment comments:
>
>[ ... ]
>
>>  Is there still any real need in such backward compatibility? Can such
>>  functionality be added (fixed) with possibility to switch it off using
>> sysctl  or kernel-build option?
>> 
>>  I find such possibility realy useful at least for NetFlow data
>> processing and believe that it would be useful for many UDP-based
>> protocols.
>
>Bound UDP sockets have always been problematic; there's a lot
>of code out there that depnds on the historical behaviour for
>unicast, unfortunately, including a number of commercial
>applications that run on FreeBSD (e.g. Real Server).
>
>If you look at that code for any length of time, you will get
>to see it as an armpit: it's not a good place to stick your
>nose, and it tends to smell to high heaven.  At my current
>job, I'm up to my elbows in it...

Terry, I clearly understand all your explanations. Yes, we are living in
real life and there is a lot of programms with bad design.

But all what I want is possibility to receive UDP packets with corresponding 
dst IP and port by more than one process on a single host. This already works 
for Broadcast and Multicast addresses. If I want to get same functionality for
unicast (without any kernel changes) I have to use UDP-proxy, which redirects 
given datagrams to loopback broadcast address, where they can be received by
more that one process.

According to comment in udp_input() SO_REUSEPORT hack on unicast sockets could
be used in single process, right? 

How possibility to get duplicate traffic on two UDP sockets, which was created 
in _different_ processes with the same local address and port values, would 
break existing applications?

-- 
Regards,
Vladimir.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010907134403.T2693>