Re: BPF_MISC+BPF_COP and BPF_COPX
On 10/08/2013 7:23 AM, Matt Thomas wrote: > ... > The possibility of the COP/COPX functions doing bad things is over wrought. > It makes the assumption of avoiding BPF and then coding everything is safer > than using BPF and COP/COPX functions. Depends on what you mean by "bad things." Thus far I haven't seen a proper problem statement, only this: > The problem is simple: I want a generic mechanism to offload more complex > packet inspection operations, e.g. lookup IP address in some container or > walk IPv6 headers and return some offsets. IMHO, the IPv6 problem is and will be common enough to deserve its own instructionas happened with IPv4 and determining the offset of the first byte after the IPv4 header. But the generic offload problem hasn't been explained nearly enough. Is it required for NPF? Is it required for tcpdump? Is it required for dhcpd? ... I don't think we know nearly enough about what the problem is in order to be able to judge whether or not the solution is acceptable. Darren ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
Re: how define network with mask 8 for dhcp server?
hello again guys 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? thanks in advance SAM On Wed, Aug 7, 2013 at 11:07 AM, s m 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 wrote: > >> >> >> >> On Tue, Aug 6, 2013 at 11:29 AM, s m 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 wrote: >>> On Tue, Aug 6, 2013 at 10:59 AM, Andreas Nilsson wrote: > > > > On Tue, Aug 6, 2013 at 10:40 AM, Olivier Nicole < > olivier.nic...@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.nic...@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 0x000800c67a21 in _malloc_prefork () from /lib/libc.so.7 #1 0x000800c6b72a in malloc () from /lib/libc.so.7 #2 0x0047b43b in omapi_object_dereference () #3 0x004844db in do_ip4_hash () #4 0x00484571 in do_ip4_hash () #5 0x00438a45 in pool_timer () #6 0x0041dcd7 in trace_conf_stop () #7 0x0041fc4e in trace_conf_stop () #8 0x00420698 in trace_conf_stop () #9 0x00420ecc in trace_conf_stop () #10 0x00420197 in trace_conf_stop () #11 0x004247f3 in trace_conf_stop () #12 0x0041f210 in trace_conf_stop () #13 0x0040f3bf in lease_pinged () #14 0x0040d451 in ?? () #15 0x0008007d7000 in ?? () #16 0x in ?? () Best regards Andreas >>> >> > ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
Re: how define network with mask 8 for dhcp server?
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 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 >> wrote: >>> >>> >>> >>> >>> On Tue, Aug 6, 2013 at 11:29 AM, s m 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 wrote: > > > > > On Tue, Aug 6, 2013 at 10:59 AM, Andreas Nilsson > wrote: >> >> >> >> >> On Tue, Aug 6, 2013 at 10:40 AM, Olivier Nicole >> 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 >>> > >> >> 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 hav
Re: kern/181225: [infiniband] [patch] unloading ipoib crashes the kernel
Old Synopsis: unloading ipoib crashes the kernel New Synopsis: [infiniband] [patch] unloading ipoib crashes the kernel Responsible-Changed-From-To: freebsd-amd64->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Sun Aug 11 13:40:22 UTC 2013 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=181225 ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
Re: how calculate the number of ip addresses in a range?
Yup. Your available addresses are: (2 ^ (32 - netmask) ) - 2 Example for a 29: 2^3 - 2 Example for a /28: 2^4 - 2 On 11 Aug 2013, at 06:39, saeedeh motlagh wrote: > thank you all guys for your answers. > Peter, of course it's not my homework!! in fact, i have a program which > manages dhcp. i want to limit the number of ip address which can be assigned > by dhcp server. in order to do that, i should know how many ip addresses are > available in the range that is defined for server and if the number of > available ip addresses are greater than valid threshold, it's error. so as > you said, i should know the math for calculate this number. > > thank you again guys for your answers but they do not solve my problem. any > body knows what is the formula to calculate the valid ip addresses for any > desired ranges? > Thanks > > > On Sat, Aug 10, 2013 at 5:19 AM, Damien Fleuriot wrote: >> >> >> On 10 Aug 2013, at 01:07, Kimmo Paasiala wrote: >> >> > On Sat, Aug 10, 2013 at 1:44 AM, Peter Wemm wrote: >> >> On Fri, Aug 9, 2013 at 9:34 AM, Fleuriot Damien wrote: >> >>> >> >>> On Aug 8, 2013, at 10:27 AM, Peter Wemm wrote: >> >>> >> On Thu, Aug 8, 2013 at 12:04 AM, s m wrote: >> > hello guys, >> > >> > i have a question about ip addresses. i know my question is not >> > related to >> > freebsd but i googled a lot and found nothing useful and don't know >> > where i >> > should ask my question. >> > >> > i want to know how can i calculate the number of ip addresses in a >> > range? >> > for example if i have 192.0.0.1 192.100.255.254 with mask 8, how many >> > ip >> > addresses are available in this range? is there any formula to >> > calculate >> > the number of ip addresses for any range? >> > >> > i'm confusing about it. please help me to clear my mind. >> > thanks in advance, >> >> My immediate reaction is.. is this a homework / classwork / assignment? >> >> Anyway, you can think of it by converting your start and end addresses >> to an integer. Over simplified: >> >> $ cat homework.c >> main() >> { >> int start = (192 << 24) | (0 << 16) | (0 << 8) | 1; >> int end = (192 << 24) | (100 << 16) | (255 << 8) | 254; >> printf("start %d end %d range %d\n", start, end, (end - start) + 1); >> } >> $ ./homework >> start -1073741823 end -1067122690 range 6619134 >> >> The +1 is correcting for base zero. 192.0.0.1 - 192.0.0.2 is two >> usable addresses. >> >> I'm not sure what you want to do with the mask of 8. >> >> You can also do it with ntohl(inet_addr("address")) as well and a >> multitude of other ways. >> >>> >> >>> >> >>> Hold on a second, why would you correct the base zero ? >> >>> It can be a valid IP address. >> >> >> >> There is one usable address in a range of 10.0.0.1 - 10.0.0.1. >> >> Converting to an integer and subtracting would be zero. Hence +1. >> >> >> >> -- >> > >> > To elaborate on this, for every subnet regardless of the address/mask >> > combination there are two unusable addresses: The first address aka >> > the "network address" and the last address aka the "broadcast >> > address". There may be usable address in between the two that end in >> > one of more zeros but those addresses are still valid. Some operating >> > systems got this horribly wrong and marked any address ending with a >> > single zero as invalid, windows 2000 was one of them. >> > >> > -Kimmo >> >> >> Kimmo, >> >> That is untrue regarding /31 netmasks where you theoretically have 2^1 -2 >> addresses. >> >> With such a short netmask the only 2 addresses are usable. >> ___ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org" > > > > -- > Sa.M ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
Re: how define network with mask 8 for dhcp server?
you're right Olivier, but you know i have a user interface for dhcp and i should handle all the network and ranges which are inserted by user and logically are true. network with mask 8, logically is true and having million available ip address, too. i just wanna know if there is any solution to improve my performance or not. thanks On Sun, Aug 11, 2013 at 3:18 PM, Olivier Nicole wrote: > 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 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 > >> wrote: > >>> > >>> > >>> > >>> > >>> On Tue, Aug 6, 2013 at 11:29 AM, s m 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 > wrote: > > > > > > > > > > On Tue, Aug 6, 2013 at 10:59 AM, Andreas Nilsson > > > wrote: > >> > >> > >> > >> > >> On Tue, Aug 6, 2013 at 10:40 AM, Olivier Nicole > >> 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 > >>> > >>> >> 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
Re: how define network with mask 8 for dhcp server?
> you're right Olivier, but you know i have a user interface for dhcp and i > should handle all the network and ranges which are inserted by user and > logically are true. network with mask 8, logically is true and having > million available ip address, too. > i just wanna know if there is any solution to improve my performance or not. There is no solution with ISC DHCP. I doubt you'll find other suitable alternatives, but you're free to try of course. Steinar Haug, Nethelp consulting, sth...@nethelp.no ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"