Joel,

> Is my network stack screwy, or is there something strange
> about UDPSockets in ruby when broadcasting to 127.0.0.255?

I don't think it's supposed to be possible to send broadcasts
to loopback interfaces, going by what ifconfig tells me.
But if it were, I'd think they should go to 127.255.255.255.
That's the obvious choice of a broadcast address here.

Any address can function as the broadcast address for the
network that it's part of, and any address ending in 255
that isn't the broadcast address is just a normal address.
So I think 127.0.0.255 is just another loopback address.

[...]

> it just keeps on alternating

Try connecting to another address, say 127.0.0.1, on a port
where noone is listening, and send a bunch of packets.
I think you will see the same alternating behavior,
supporting the claim that 127.0.0.255 is just another
address on which noone is listening.

I can't explain the alternating per se, however, so I'll
leave that to someone who's more familiar with UDP.

> There's no problem when I broadcast on a *real* network,
> like 192.168.1.255.

That's probably because that's the real broadcast address
for that network (see ifconfig).

Linux seems to treat 127.255.255.255 as the broadcast
address even though ifconfig says there is no loopback
broadcast address, so you should be able to use that.


I hope this helps,

-- 
Daniel Brockman <daniel / brockman.se>