Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jan 2009 00:39:57 -0800
From:      "Kayven Riese" <kayvey@gmail.com>
To:        "Peter Steele" <psteele@maxiscale.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Having problems with limited broadcast
Message-ID:  <28b9b4180901070039x27a25bb4m6b50c8bfae63e0af@mail.gmail.com>
In-Reply-To: <2ACA3DE8F9758A48B8BE2C7A847F91F2479DF2@polaris.maxiscale.com>
References:  <2ACA3DE8F9758A48B8BE2C7A847F91F2479DF2@polaris.maxiscale.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 6, 2009 at 8:45 AM, Peter Steele <psteele@maxiscale.com> wrote:

> We have a Python app that implements a DHCP-like protocol using limited
> broadcast using address 255.255.255.255. Our code works fine on Linux
> and FreeBSD but we cannot seem to get broadcast to work on FreeBSD.
> We've tried both Python and C under FreeBSD 7.0.
>
>
>
> I've found a lengthy discussion of this problem here:
>
>
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/99558
>

More reaently,


------------------------------

>Message: 22
>Date: Tue, 6 Jan 2009 13:29:04 -0800
>From: "Peter Steele" <psteele@maxiscale.com>
>Subject: RE: Do UDP broadcasts work in FreeBSD?
>To: <freebsd-questions@freebsd.org>
>Message-ID:
 >      <2ACA3DE8F9758A48B8BE2C7A847F91F2479E3F@polaris.maxiscale.com>
>Content-Type: text/plain;       charset="us-ascii"
>
>> What you're trying to do with sending to the all-ones broadcast
>> address is known as sending a "link-local" packet.  On some systems,
>> sending a UDP packet to 255.255.255.255 will actually cause a packet
>> with that destination to be generated from all network interfaces
>> which are "UP".  That seems to be the behavior you are expecting.
>
>Yes it is. This is the behavior I've seen on every system I've used for
>20+ years, except for FreeBSD.
>

I've only been a UNIX luser since 1985 when I thought I learned "EVAX"
at the University of Wisconsin-Milwaukee.  I have done other things than
sysadmin since then, so if anyone has a better source for an EVAX operating
system (if I am not confusing it with something else) I would appreciate it.

>> On FreeBSD, IIRC, the behavior you get is that it will send to the
>> local network broadcast address for each interface [1] using the
>> network broadcast address (ie, if an interface is configured for
>> 10.1.1.1 with /16 netmask, the packet will have destination
>> 10.1.255.255).  If an interface is UP but not configured with an IP
>> +netmask, I don't believe a packet will be sent.  (In fact, it might
>> depend upon whether the BROADCAST flag is enabled, which gets set when
>
>> an inet-enabled interface is setup with a netmask...)

At the risk of digressing and in hopes that there is truly "no stupid
question
that is at least on topic", I want to say that I was some amount through the
book "TCP/IP Network Administration" by Hunt published by O'Reilly, when
I picked up "Writing a UNIX Device Driver" by Egan and Teixeira (I note
its regrettable emphasis on System V, though it mentiones "Berkeley
Systems") because I was really hoping to get up to speed to
contribute vis a vis Wireless USB adapters by Belkin that do not seem
to have a driver in FreeBSD (is this a bug?).

If anybody has any further suggestions for further reading, it would be
appreciated.
I already had the TCP/IP Hunt book but hadn't picked it up when I picked
up a book by the name of "TCP/IP Illustrated Volume 2."  Getting a bit into
that, and cogniscient of the fact that it was "Volume 2" I decided to put it
down and pick up Hunt, feeling like a TCP/IP newbie (at least a developer
level newbie fo'sho').

Anyway.. back to the topic.  I have also been exposed to TCP/IP recently
in UC-Berkeley's undergraduate operating systems course (CS 162) where
they discussed the fact that not all IP addresses are created equal. I
missed
some points on a test question claiming that "There are 2^32 IP adddresses"
or some such, since e.g. 0.0.0.0 and 255.255.255.255 and 127.0.0.1, right?
are not really legal addresses.  I don't remember off the top of my head the
exact IP numbers involved with this, but I vaguely recall that in addition
to
having IPs with "special meaning" i.e. do not exactly "point" to any "node"
on the "internet," there ARE a set of IPs that are specifically designed for
use
in LANs (is that what we are talking about with a "set of computers" that
have
"no IP," right?)


>
>In our case our systems have no IP identity of any kind, and we don't
>want to have to rely on whether or not our customers have a DHCP server
>available. So we've come up with our own "light" DHCP. It works fine for
>Linux and Windows. Not FreeBSD though.
>
>> Arguably, this is a bug in FreeBSD
>
>I don't think there is any doubt about that. And from what I understand
>it even used to work under FreeBSD a few years ago.

Okay, I jumped the gun.  Is this a bug to be absolutely ignorant of the
existance of an IP system that ..

am I wrong in saying this?..

MANDATES that every computer has an IP even if it is just in a LAN, and
acutally tries to claim it is not a part of the "internet," and, indeed, the
IP
system provides for this by having a set of IPs (was it 10.0.0.0/8 and
192.168.0.0/16 ?..I am professing absolute ignorance here, but hoping
that I am not mistaken).

We ARE talking about "just a LAN" here, right? Also, these computers
are "not on the internet?"  They have absolutely no connectivity?
(Unlikely).

I apologize for being incredibly stupid, and not having the time to
"thoroughly"
(umm.. well..I .. yeah. I feel that maybe the amount of background reading
to really get up to speed before this thread wistfully drifts into the
internet
archives  might be prohibitive).. research the background here, but feel
at least if I am OT on freebsd-net (I would have replied to -questions, but
I
am set up for this "daily digest" and fear that totally destroys these neato
email threads that have my name being a horses patoot all over the
internet).

>
>> but you can work around it by
>> using the BPF interface to send the traffic directly rather than using
>
>> the network stack via socket()+send()/write().  I believe the ISC DHCP
>
>> server software provides examples of how to do this, as dhclient is
>> commonly used to send DHCP requests to the all-ones broadcast addr,
>> without needing an interface being configured with an IP....
>
>I've already looked at the ISC DHCP source code. They use raw sockets to
>send their broadcasts, which seems to us to be a convoluted way of
>sending a simple broadcast. I've seen examples of DHCP client/server
>code written in Java using standard UDP. Unfortunately, our own system
>is already largely implemented in Java/Python, so we'll need to provide
>a JNI interface to support raw sockets. Alternatively we may patch the
>kernel to fix the bug at its source.
>

After having looked closely at this question, and feeling "the guantlet has
been tossed," I tossed an turned and suddenly knew I had to rise and
confront this assertion on the matter of "bug versus feature."

In my voluminous ignorance, I offer a simple question.  I have an intuition
that somebody really smart _just might_ jump in and having something
really interesting to say on this matter if (despite the fact??) I do.

It defintely sounds like this "feature" (I am hearby casting my pathetic
carcass into the line of fire in my assertion that his is not a "bug," but
a "feature.") is giving a certain Peter Steele more irritations in the form
of required configuration issues than he would otherwise like.

My very simple (but at the same time perhaps profoundly complex) question
is, "What are the security implications of pretending there is no such thing
as IP addresses that are designated for LANs that are isolated from TCP/IP
of the WAN as servers, while perhaps acting as clients?"

In case I am actually clueless, I also offer a potentially synonymic
question,
"What is the 'infinite wisdom' (note to any--feel free to replace with
'absolute
folly' if you are so inclined) behind the design of FreeBSD in contrast to
Penguinware and Uncle Bill's Windoze that is leading to the "feature"that
is making a certain Peter Steele's life so difficult?



>
> It appears some work has been done to correct this problem but if I
> understand the discussion correctly it still is not resolved, at least
> as of the timeframe of this thread.
>
>
>
> In our case, we have systems with no IP identity of any kind--no IP
> address and no gateway, and they are connected only by switches. There
> is no router in the network. They receive IP addresses through a special
> service that we've written that runs on one of the systems, in response
> to address request queries sent out by the systems. All communication is
> done through limited broadcast. As I said, this works fine one our Linux
> and Windows boxes but not FreeBSD.
>
>
>
> Based on the discussion in the link above, it doesn't seem like the
> problem was entirely resolved by the patches mentioned in this thread.
> Has anything been done since this discussion took place. Surely there
> must be a way to get limited broadcast to work under FreeBSD.
>
>
>
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



-- 

*----------------------------------------------------------*
 Kayven Riese, BSCS,
                     MS  (Physiology and Biophysics)
 (415) 902 5513 cellular
 http://kayve.net
 Webmaster http://ChessYoga.org
*----------------------------------------------------------*



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