Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Aug 2013 17:48:05 +0700
From:      Olivier Nicole <olivier.nicole@cs.ait.ac.th>
To:        s m <sam.gh1986@gmail.com>
Cc:        Olivier Nicole <on@cs.ait.ac.th>, FreeBSD Net <freebsd-net@freebsd.org>, Andreas Nilsson <andrnils@gmail.com>
Subject:   Re: how define network with mask 8 for dhcp server?
Message-ID:  <CA%2Bg%2BBvhvo0Tx0XjyGw7fTV=aribbev1BEh8cUsVLWjxD2d62pg@mail.gmail.com>
In-Reply-To: <CAA_1SgHWSwm62xsXzas7W0SOtDoLL-0o85%2BdqGeLzDbhb=KWQg@mail.gmail.com>
References:  <CAA_1SgERG9jQE8vApcv0GYsBhvpf9FYFW2Pw0rqGT%2B9FjP2ktQ@mail.gmail.com> <u9zjsv9rwc.fsf@banyan.cs.ait.ac.th> <CAA_1SgGR0XGPb2pCb0CaNB5xjUdubSynLOnFvzTVJGUroMyEzQ@mail.gmail.com> <CA%2Bg%2BBvgekEcdD=d8MG883ze02gnofTCV2wL7LA3gWXHSbMAUzQ@mail.gmail.com> <CAPS9%2BSuEd=az9HkJZfHv%2B4A=Nk-ZS1AzRH7FaoOOtugUr19mFw@mail.gmail.com> <CAPS9%2BSsm2VpDdu4bj33SJbpmZha74BLMmGZJVubAmDBf6eripw@mail.gmail.com> <CAA_1SgHCVFMAoUL1tcuXUhYPAMduNyL-aRr-ZuHj8FywM8WhTQ@mail.gmail.com> <CAPS9%2BSvGpCw%2BCCTs7Rp8DcDaXEOrJXgx2P7Kdc9h47C-gvNhTw@mail.gmail.com> <CAA_1SgG6MzZkqbQvuv16h63YrOaKz=2QwMRx4sHK5nZ92p8yNw@mail.gmail.com> <CAA_1SgHWSwm62xsXzas7W0SOtDoLL-0o85%2BdqGeLzDbhb=KWQg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Sam,

> after understanding why dhcp server core dumps with a wide range (it causes
> out of memory), if i limit my range it's ok. but some times user define a
> wide range for example some million available ip addresses while there is
> just some hundred client in the network. in this situation, dhcp server use
> a lot of ram memory which is not good at all. how dhcp server acts? why does
> it need a lot memory? is there any patch to optimize it? if not, is there
> any other any ports in freebsd to use instead and have better performance?

In the real life, it's very uncommon that you give millions of IP
addresses to a customer when he really needs only hundreds. If only
because you will usually charge your customers by the number of
devices on the network and most customers try to not pay in excess for
a service they will not use.

Installing and running a DHCP server is for people who know what they
are doing, because it has strong implications on the way the network
is running, so users who install DHCP are supposed to know what they
are doing.

It is also possible to have a centralized DHCP server that you
control, and each subnet of each customer make use of your centralized
DHCP. You can propose ways for your customers to upgrade the range for
their own subnet, but you are controlling the script they use and you
can install limitations.

It's really useless to loose time finding some patches that would get
DHCP run for million of addresses, in real life, a network is never a
/8 but rather a /22 or less, it makes the thing manageable.

Eventually, consider that a /8 subnet cannot be NATed, as a NAT can
only manage 2^16 connections at a given time.

Best regards,

Olivier

>
> thanks in advance
> SAM
>
>
> On Wed, Aug 7, 2013 at 11:07 AM, s m <sam.gh1986@gmail.com> wrote:
>>
>> yes, i solved my problem.
>>  thanks every body for your answers. it help me a lot.
>> SAM
>>
>>
>> On Tue, Aug 6, 2013 at 2:08 PM, Andreas Nilsson <andrnils@gmail.com>
>> wrote:
>>>
>>>
>>>
>>>
>>> On Tue, Aug 6, 2013 at 11:29 AM, s m <sam.gh1986@gmail.com> wrote:
>>>>
>>>> thanks Andreas, that's it!!!
>>>> you know i have user interface program for dhcp. users don't know how
>>>> dhcp works and just enter desired range in text box. i should handle all
>>>> entered ranges. in order to do that, i should know how dhcp works with all
>>>> different ranges and return errors if some ranges is not equivalent like the
>>>> sample one.
>>>
>>>
>>> Ok. Someone more versed in debugging should probably determine if the
>>> crash is in libc or just that dhcp does not handle malloc error.
>>>
>>>>
>>>>
>>>> so. if i want to have network with mask 8, i should limit my range,
>>>> right? have you any suggestion what is the maximum range for netmask 8?
>>>> thanks for your reply again. it clears my mind:)
>>>
>>>
>>> Exactly.
>>>
>>> I just tried
>>> 192.0.0.1-192.220.255.255 which works ( takes ~3 minutes to start, using
>>> 4.5gb of ram )
>>> and then
>>> 192.0.0.1-192.221.255.255 which segfaults.
>>>
>>> The machine I test on does have 16gb of ram and 16gb of swap, so there
>>> should be a lot more mem available.
>>>
>>> Best regards
>>> Andreas
>>>>
>>>>
>>>>
>>>> On Tue, Aug 6, 2013 at 1:35 PM, Andreas Nilsson <andrnils@gmail.com>
>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Aug 6, 2013 at 10:59 AM, Andreas Nilsson <andrnils@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Aug 6, 2013 at 10:40 AM, Olivier Nicole
>>>>>> <olivier.nicole@cs.ait.ac.th> wrote:
>>>>>>>
>>>>>>> Sam,
>>>>>>>
>>>>>>> > my problem is to know how define a network with mask 8 and dhcp
>>>>>>> > server
>>>>>>> > works correctly with it! you know if i config my dhcpd.conf like
>>>>>>> > below, i
>>>>>>> > have core dump either:
>>>>>>> > subnet 10.0.0.0 netmask 255.0.0.0
>>>>>>> > {
>>>>>>> >     range 10.0.0.1 10.255.255.254;
>>>>>>> > }
>>>>>>> >
>>>>>>> > do you know how should i define my range ??
>>>>>>>
>>>>>>> The reason may be that 2^24 machines in a subnet is such a non-sense
>>>>>>> that dhcp simply cannot manage it.
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Olivier
>>>>>>>
>>>>>>> >
>>>>>>> > On Tue, Aug 6, 2013 at 12:23 PM, Olivier Nicole
>>>>>>> > <Olivier.Nicole@cs.ait.ac.th
>>>>>>> >> wrote:
>>>>>>> >
>>>>>>> >> Sam,
>>>>>>> >>
>>>>>>> >> > subnet 192.0.0.0 netmask 255.0.0.0
>>>>>>> >>
>>>>>>> >> I know it is not the answer to your question, but you are wrong in
>>>>>>> >> your
>>>>>>> >> guess that 192.0.0.0/8 is all private IPs. Only 192.168.0.0/16 is.
>>>>>>> >>
>>>>>>> >> I know that for certain because my own IP starts with 192.
>>>>>>> >>
>>>>>>> >> If you want a full /8 private, you can only use 10.0.0.0/8
>>>>>>> >>
>>>>>>> >> Bets regards,
>>>>>>> >>
>>>>>>> >> Olivier
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >>
>>>>>>>
>>>>>>
>>>>>> Well, I would guess it may run out of memory... I did a few tests:
>>>>>> 192.0.0.0 - 192.128.255.255 does work ( using ~2.5Gb  RAM ).
>>>>>> 192.0.0.0 - 192.192.255.255 does work ( using ~4Gb RAM ).
>>>>>> 192.0.0.0 - 192.200.255.255 does work ( using ~4.2Gb RAM ).
>>>>>> 192.0.0.0 - 192.224.255.255 dumps core
>>>>>>
>>>>>> Why would you want to have such a huge range?
>>>>>>
>>>>>> Best regards
>>>>>> Andreas
>>>>>
>>>>>
>>>>> Also, a quick look at the core file gives same indications:
>>>>> #0  0x0000000800c67a21 in _malloc_prefork () from /lib/libc.so.7
>>>>> #1  0x0000000800c6b72a in malloc () from /lib/libc.so.7
>>>>> #2  0x000000000047b43b in omapi_object_dereference ()
>>>>> #3  0x00000000004844db in do_ip4_hash ()
>>>>> #4  0x0000000000484571 in do_ip4_hash ()
>>>>> #5  0x0000000000438a45 in pool_timer ()
>>>>> #6  0x000000000041dcd7 in trace_conf_stop ()
>>>>> #7  0x000000000041fc4e in trace_conf_stop ()
>>>>> #8  0x0000000000420698 in trace_conf_stop ()
>>>>> #9  0x0000000000420ecc in trace_conf_stop ()
>>>>> #10 0x0000000000420197 in trace_conf_stop ()
>>>>> #11 0x00000000004247f3 in trace_conf_stop ()
>>>>> #12 0x000000000041f210 in trace_conf_stop ()
>>>>> #13 0x000000000040f3bf in lease_pinged ()
>>>>> #14 0x000000000040d451 in ?? ()
>>>>> #15 0x00000008007d7000 in ?? ()
>>>>> #16 0x0000000000000000 in ?? ()
>>>>>
>>>>> Best regards
>>>>> Andreas
>>>>>
>>>>
>>>
>>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2Bg%2BBvhvo0Tx0XjyGw7fTV=aribbev1BEh8cUsVLWjxD2d62pg>