Re: [Dnsmasq-discuss] Is dnsmasq supposed to listen on UDP port 0.0.0.0:67 when listen-address is specified?

2017-12-22 Thread Ignat Korchagin
I think so as well. It may create issues when someone runs 2 dnsmasq
processes with different configurations (for different interfaces for
example - 1 dnsmasq process per interface). Kernel may "balance" incoming
UDP packets to another dnsmasq instance (which AFAIR will just ignore it),
so there will be more retries in general for DHCP traffic.

On Fri, Dec 22, 2017 at 2:46 AM, Parke <parke.ne...@gmail.com> wrote:

> On Thu, Dec 21, 2017 at 2:56 AM, Ignat Korchagin <ig...@cloudflare.com>
> wrote:
> > FYI a good overview of SO_REUSEPORT at least in Linux is here
> > https://blog.cloudflare.com/the-sad-state-of-linux-socket-balancing/
>
> Thanks.  The article deals with accepting on a TCP socket, not
> receiving on a UDP socket.
>
> But if the principles are similar for UDP, then, as I expected, it
> looks like SO_REUSEPORT provides load balancing.
>
> Does anyone believe that dnsmasq is intending to create load balancing
> when multiple instances bind to the same DHCP socket?  (I don't.  I
> believe dnsmasq is expecting mirroring, but I could be wrong.)
>
> Cheers,
>
> Parke
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Is dnsmasq supposed to listen on UDP port 0.0.0.0:67 when listen-address is specified?

2017-12-21 Thread Ignat Korchagin
FYI a good overview of SO_REUSEPORT at least in Linux is here
https://blog.cloudflare.com/the-sad-state-of-linux-socket-balancing/

On Thu, Dec 21, 2017 at 5:45 AM, Parke  wrote:

> On Wed, Dec 20, 2017 at 9:18 PM, Parke  wrote:
> > And there is the big question of: Will each incoming UDP packet be
> > sent to all receiving sockets?  Or just to one out of a pool of
> > receiving sockets?
>
> Looks like load balancing to me.
>
> From man 7 socket on Linux:
>
>SO_REUSEPORT (since Linux 3.9)
>
>   For UDP sockets, the use of this option  can
>   provide   better  distribution  of  incoming
>   datagrams to multiple processes (or threads)
>   as  compared to the traditional technique of
>   having multiple processes compete to receive
>   datagrams on the same socket.
>
> Perhaps dnsmasq is hoping that each separate instance is bound to a
> different device/interface via SO_BINDTODEVICE?  (Of course, dnsmasq
> lacks the ability to confirm that other instances are correctly
> configured.)
>
> And that device binding will give each incoming packet only a single
> path to the single (and correct) instance of dnsmasq?
>
> And the SO_REUSEADDR option is necessary to allow multiple bindings to
> the same address (even though each binding is to a separate interface
> via SO_BINDTODEVICE)?
>
> And given that FreeBSD lacks SO_BINDTODEVICE, this code will not work
> as intended on FreeBSD?  (I.e. FreeBSD will get undesired load
> balancing, rather than mirroring which would work?)
>
> But it seems that all the above can be done with just SO_REUSEADDR,
> and that SO_REUSEPORT is superfluous.  At least on Linux.  (As the
> purpose of SO_REUSEPORT is to load balance across processes while
> bypassing expensive inter-process contention for a single socket?)
> Hmmm.  Hopefully someone who understands it can decide if I am making
> any sense.
>
> -Parke
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Multiple subnets on a single broadcast domain

2017-08-05 Thread Ignat Korchagin
Hi,

We have a use-case, where there maybe more than one subnet in a broadcast
domain and we want one DHCP server to serve directly connected clients in
these subnets.

Currently, dnsmasq requires having one IP address from each subnet
configured on DHCP server, otherwise it ignores DHCP requests from hosts,
which are configured with static IPs from other "foreign" subnets.

We have a patch, which allows "binding" "foreign" subnets in dnsmasq
configuration file to an interface (that is to a broadcast domain), so
dnsmasq will allocate IPs from these subnets as well even if it doesn't
have an IP in them.

We can submit the patch for upstream dnsmasq adoption, if the community is
interested in such use-case.

Regards,
Ignat
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss