Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
On 24 December 2016 at 16:15, Alec Robertsonwrote: > My apologies for the unclear explanation. > > For background I am using OpenWRT/LEDE r2544-a032940, on a TP-LINK Archer > C7. Have you disabled option leasefile'/tmp/dhcp.leases'? Any time a client comes back it really should get the same IP it had back. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
Hi Alec, A bit disagree on that, at up-to-time Asus routers use hashed mac allocations, not sequential. Older ones – did sequential allocation with reuse of expired IP from the very start (original udhcpd behavior), and in my practice, it rose issues when the same ip was allocated to different interfaces of one particular host, first time – as a first lease, second – after a hibernate/sleep. Same code was merged into udhcpd@busybox and was fixed into sdbm hash several years ago. In my opinion, sequential reuse of ip pool does more harm than helps to keep the “things” in order. Best Regards, Vladislav Grishenko From: Dnsmasq-discuss [mailto:dnsmasq-discuss-boun...@lists.thekelleys.org.uk] On Behalf Of Alec Robertson Sent: Sunday, December 25, 2016 4:14 AM To: dnsmasq-discuss@lists.thekelleys.org.uk Subject: Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs I understand what you’re saying but I was suggesting this should be a feature enhancement. All the other routers I have used work the way I have described, be it NETGEAR, Asus, Huawei, etc. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
Thank you for your reply. It was just really to make it like every other router I’ve used. It’s not a “problem” as such. — Alec Robertson On 25 December 2016 at 11:03:35, Albert ARIBAUD (albert.arib...@free.fr) wrote: (TL;DR: skip to last paragraph of my reply) Hi Alec, Le Sat, 24 Dec 2016 18:13:46 -0500 Alec Robertsona écrit: > I understand what you’re saying but I was suggesting this should be a > feature enhancement. All the other routers I have used work the way I > have described, be it NETGEAR, Asus, Huawei, etc. Oh, ok. I was misled by the negative form in your message subject, which I read as pointing a perceived misbehavior as opposed to suggesting a new one. So, have I got it right that your point can be summed up as follows: "1. Right now, dnsmasq's DHCP server feature allocates IP based on either one of the two following (summarized) strategies: a) Select the IP based on a hash of the MAC, or b) Select the oldest free IP available. 2. It is suggested to add a strategy which would be summarized as: c) Select the lowest free IP." If so, then I'm sorry about the misunderstanding: while I could have helped on a perceived or real misbehavior diagnosis, I am not involved in any part of developing dnsmasq so my feedback on a feature request would be worthless. However, I do have a question about this feature request; please bear with me for a minute there. I do understand that strategy c above is easily implemented (it's basically a context-insensitive loop) as opposed to the other two, so it makes sense to implement that when developing a DHCP server from scratch, I do not see what benefit it brings to a DHCP server which already has two allocation options in place. IOW, what does option c bring that options a or b don't? Obviously, option c reduces the number of different IPs allocated over time with respect to option b, as option b goes through the whole range while option does not. But then, option a also keeps the number of allocated IPs to a minimum. There is a difference, though, between options c and a: option c keeps that minimum set of IPs tight, whereas option a (possibly) spreads the set over the whole range. So, the real distinguishing feature of option c is "keep the allocated IPs as grouped near the range base as possible". But that's a /characteristic/, not a /benefit/ -- at least, I cannot see the benefit yet. So I suspect there is something in the currently available options a and b which causes an issue in your use of dnsmasq to the point of making you want to see option c implemented. Now, this something may actually be solved by implementing option c, or it may be a symptom of another problem for which there is a better solution than option c. As I don't remember having seen a similar request (I might have missed it, though), I suspect that it is not widely seen as a solution, which makes me lean toward the "there is a better solution" side, but that's only a hunch; hence my questioning, to either get rid of a false hunch, or see it confirm and get to a better solution to your problem. And for that, we need the problem laid out (as opposed to laying out the perceived solution) So the question becomes in fact why is a 'tight low range' IP allocation strategy needed exactly, or more precisely, what is the problem that you have which dnsmasq's existing IP allocation strategies cause, or at least do not solve? Amicalement, -- Albert. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
(TL;DR: skip to last paragraph of my reply) Hi Alec, Le Sat, 24 Dec 2016 18:13:46 -0500 Alec Robertsona écrit: > I understand what you’re saying but I was suggesting this should be a > feature enhancement. All the other routers I have used work the way I > have described, be it NETGEAR, Asus, Huawei, etc. Oh, ok. I was misled by the negative form in your message subject, which I read as pointing a perceived misbehavior as opposed to suggesting a new one. So, have I got it right that your point can be summed up as follows: "1. Right now, dnsmasq's DHCP server feature allocates IP based on either one of the two following (summarized) strategies: a) Select the IP based on a hash of the MAC, or b) Select the oldest free IP available. 2. It is suggested to add a strategy which would be summarized as: c) Select the lowest free IP." If so, then I'm sorry about the misunderstanding: while I could have helped on a perceived or real misbehavior diagnosis, I am not involved in any part of developing dnsmasq so my feedback on a feature request would be worthless. However, I do have a question about this feature request; please bear with me for a minute there. I do understand that strategy c above is easily implemented (it's basically a context-insensitive loop) as opposed to the other two, so it makes sense to implement that when developing a DHCP server from scratch, I do not see what benefit it brings to a DHCP server which already has two allocation options in place. IOW, what does option c bring that options a or b don't? Obviously, option c reduces the number of different IPs allocated over time with respect to option b, as option b goes through the whole range while option does not. But then, option a also keeps the number of allocated IPs to a minimum. There is a difference, though, between options c and a: option c keeps that minimum set of IPs tight, whereas option a (possibly) spreads the set over the whole range. So, the real distinguishing feature of option c is "keep the allocated IPs as grouped near the range base as possible". But that's a /characteristic/, not a /benefit/ -- at least, I cannot see the benefit yet. So I suspect there is something in the currently available options a and b which causes an issue in your use of dnsmasq to the point of making you want to see option c implemented. Now, this something may actually be solved by implementing option c, or it may be a symptom of another problem for which there is a better solution than option c. As I don't remember having seen a similar request (I might have missed it, though), I suspect that it is not widely seen as a solution, which makes me lean toward the "there is a better solution" side, but that's only a hunch; hence my questioning, to either get rid of a false hunch, or see it confirm and get to a better solution to your problem. And for that, we need the problem laid out (as opposed to laying out the perceived solution) So the question becomes in fact why is a 'tight low range' IP allocation strategy needed exactly, or more precisely, what is the problem that you have which dnsmasq's existing IP allocation strategies cause, or at least do not solve? Amicalement, -- Albert. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
Bonjour, Le Sat, 24 Dec 2016 16:15:23 -0500 Alec Robertsona écrit: > My apologies for the unclear explanation. > > For background I am using OpenWRT/LEDE r2544-a032940, on a TP-LINK > Archer C7. > > For a test, if you set the leasetime to be very short, say 2 minutes > and connect multiple devices, they will at first be given IPs in > sequential order starting from the lowest allowed IP address, say > 192.168.0.20. So, the next device will be 192.168.0.21, the next > 192.168.0.22 and so on… > > If the device at 192.168.0.20 gets disconnected for over 2 minutes, > its lease expires. If the device reconnects to the network, it will > be given the IP address say 192.168.0.24, despite 192.168.0.20 being > available. The next new device added to the network will be given > 192.168.0.25. > > So, 192.168.0.20 will never be assigned again, unless the network is > entirely reset, i.e. dnsmasq is completely reset back to defaults. > > Does that make a bit more sense? It is certainly much more unambiguous, and appears to be consistent with my very first analysis of your problem. You seem to be thinking that (with --dhcp-sequential-ip, which I assume is specified in the case you describe) dnsmasq should have reused the IP address 192.168.0.20 as soon as possible after it was released. Now let's see the dnsmasq manpage description of --dhcp-sequential-ip: Dnsmasq is designed to choose IP addresses for DHCP clients using a hash of the client's MAC address. This normally allows a client's address to remain stable long-term, even if the client sometimes allows its DHCP lease to expire. In this default mode IP addresses are distributed pseudo-randomly over the entire available address range. There are sometimes circumstances (typ- ically server deployment) where it is more convenient to have IP addresses allocated sequentially, starting from the lowest available address, and setting this flag enables this mode. Note that in the sequential mode, clients which allow a lease to expire are much more likely to move IP address; for this reason it should not be generally used. Clearly, the documentation tates that a client which releases an IP address is likely to move IP address -- IOW, if IP address 192.168.0.20 is released, then it is likely that it *won't* be allocated again soon. This description is contrary to what you seem to be expecting. I do therefore stand by my initial comment : I suspect you are making an inexact assumption as to how --dhcp-sequential-ip works. Amicalement, -- Albert. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
I understand what you’re saying but I was suggesting this should be a feature enhancement. All the other routers I have used work the way I have described, be it NETGEAR, Asus, Huawei, etc. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
My apologies for the unclear explanation. For background I am using OpenWRT/LEDE r2544-a032940, on a TP-LINK Archer C7. For a test, if you set the leasetime to be very short, say 2 minutes and connect multiple devices, they will at first be given IPs in sequential order starting from the lowest allowed IP address, say 192.168.0.20. So, the next device will be 192.168.0.21, the next 192.168.0.22 and so on… If the device at 192.168.0.20 gets disconnected for over 2 minutes, its lease expires. If the device reconnects to the network, it will be given the IP address say 192.168.0.24, despite 192.168.0.20 being available. The next new device added to the network will be given 192.168.0.25. So, 192.168.0.20 will never be assigned again, unless the network is entirely reset, i.e. dnsmasq is completely reset back to defaults. Does that make a bit more sense? ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
Hi again Alec, Le Sat, 24 Dec 2016 06:55:09 -0800 Alec Robertsona écrit: > Thank you for your replies. > > What I mean (as I said I didn’t explain it very well), is that the > sequential IP feature results in lots of empty IP addresses, so > effectively you end up with a much smaller range of possible IP > addresses. > > I was requesting the ability for dnsmasq to look through the entire > possible range of IP addresses and if it finds one that is not > assigned, it assigns that first before then working its way up from > the last assigned address. Sorry, but I understand this less than I understood your first message :) -- there is no such concept of an "empty IP adresses" and the range of IP addresses available via DHCP does not depend on the allocation process (though the range of adresses actually used will depend on the method... and on the bumber and timings of the client requests, as the manpage hints). To clarify your problem and your need, the best would be to give a step by step example up to the point where the problematic situation occurs, and compare it with the expected situation, e.g. "1) The server is started with a range of available IPs from 192.168.0.1 to 192.168.0.30. 2) client A requests an IP and gets 192.168.0.1. 3) ... ... N) 'X' then happens." I would prefer to see 'Y' happen, rather than 'X', at step N." This mode of problem description will be far less susceptible to ambiguity. Amicalement, -- Albert. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
Thank you for your replies. What I mean (as I said I didn’t explain it very well), is that the sequential IP feature results in lots of empty IP addresses, so effectively you end up with a much smaller range of possible IP addresses. I was requesting the ability for dnsmasq to look through the entire possible range of IP addresses and if it finds one that is not assigned, it assigns that first before then working its way up from the last assigned address. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
On 12/23/2016 08:04 PM, Alec Robertson wrote: When using sequential IP, the IP allocation should start from the lowest available IP address. this depends on the implementation... some start at the bottom (lowest) and others start at the top (highest)... where they start does not really matter... the *nix systems i've worked with all started at the top when allocating IPs to non-psuedo-static systems... IIRC, winwhatever is the only one i've worked with that started at the bottom... -- NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list* unless private contact is specifically requested and granted. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
Hi Alec, Le Fri, 23 Dec 2016 20:04:55 -0500 Alec Robertsona écrit: > When using sequential IP, the IP allocation should start from the > lowest available IP address. > > However, if the lease time is quite short for the clients, the > clients can renew their IP addresses and be given IP addresses that > don’t use the entire range available, meaning that you could have a > range that starts at say 1 but this IP address is never used again > because the sequential IP system does not look for IPs that aren’t > “filled”. Instead, it simply goes for the lowest available IP that is > available after the last one that was allocated. > > I am sorry for my very poor description but I tried the best I could > to explain this problem. There might be a misunderstanding about "sequential" here. You seem to think that dhcp-sequential-ip will cause dnsmasq to react to every request by searching upward from the range start for the first available IP. I suspect what it does for every request is search for the first available IP from the last point it had reached so far; beginning at the range start is just what happens for the very first request received. IOW, you think it always allocates the lowest currently free IP whereas I suspect it will actually allocate the lowest free IP above the last one allocated. My suspicion comes from the fact that the sequential behavior is probably named after its visible effect, i.e. going over the full range in sequence even if older IP were freed in between. Amicalement, -- Albert. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
[Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
When using sequential IP, the IP allocation should start from the lowest available IP address. However, if the lease time is quite short for the clients, the clients can renew their IP addresses and be given IP addresses that don’t use the entire range available, meaning that you could have a range that starts at say 1 but this IP address is never used again because the sequential IP system does not look for IPs that aren’t “filled”. Instead, it simply goes for the lowest available IP that is available after the last one that was allocated. I am sorry for my very poor description but I tried the best I could to explain this problem. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss