Skip to contentSkip to conversation

255.255.255.255 won't broadcast to multiple NICs

DISCUSSION Rob Landley 2 participants 2 messages Nov 3, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines · --- Jeff Garzik
Quoted 2 lines · Rob Landley

Under 2.2.16, broadcast packets addressed to 255.255.255.255 do not go out to all interfaces in

a

Quoted 1 line

machine with multiple network cards. They're

getting

Quoted 1 line

routed out the default gateway's interface

instead.

Are the network cards on the same network?

Two subnets. (both martians: 10.blah and 192.168.blah). Gateway's off of 10.blah (beyond which lives the internet), the 192 thing is the small cluster I'm putting together in my office to test the software.

I take it this makes a difference? If there's some kind of "don't do that" here, I might be happy just documenting it. (In theory, I could iterate through the NICs and send out a broadcast packet to each interface's broadcast address (although for reasons that are a bit complicated to go into right now unless you really want to know, that's not easy to do in this case).) But that's just a workaround to cover up the fact that the IP stack isn't doing the obvious with global broadcasts.

So the question is, is the stack's behavior right? If not, what's involved in fixing it, and if so, is it documented anywhere?

(I checked google rather a lot before coming here, and linux/Documentation, and even glanced at the route.c source code. ip_route_output_slow has several explicit checks for "FFFFFFFF" which are easily searched for, but the upshot is that the packet gets mapped to a single interface anyway. Around line 1641 of my sources there's an #ifdef CONFIG_IP_MROUTE that looked very interesting, but it turns out only to be for multicast addresses and I don't know if IN_DEV_FORWARD is forking the packet or not...)

At which point I came here. :)

Rob

__________________________________________________
Do You Yahoo!?

Quoted 1 line

From homework help to love advice, Yahoo! Experts has your answer.

http://experts.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 29 lines · Rob Landley
Quoted 10 lines · --- Jeff Garzik
Quoted 2 lines · Rob Landley

Under 2.2.16, broadcast packets addressed to 255.255.255.255 do not go out to all interfaces in

a

Quoted 1 line

machine with multiple network cards. They're

getting

Quoted 1 line

routed out the default gateway's interface

instead.

Are the network cards on the same network?

Two subnets. (both martians: 10.blah and 192.168.blah). Gateway's off of 10.blah (beyond which lives the internet), the 192 thing is the small cluster I'm putting together in my office to test the software.

I take it this makes a difference? If there's some kind of "don't do that" here, I might be happy just documenting it. (In theory, I could iterate through the NICs and send out a broadcast packet to each interface's broadcast address (although for reasons that are a bit complicated to go into right now unless you really want to know, that's not easy to do in this case).) But that's just a workaround to cover up the fact that the IP stack isn't doing the obvious with global broadcasts.

Quoted 3 lines

So the question is, is the stack's behavior right? If not, what's involved in fixing it, and if so, is it documented anywhere?

I think historically, BSD stacks were routing 255.255.255.255 to the "primary interface" (whatever that means).

All the code I've encountered which actually needed to perform broadcast on all interfaces was sending subnet-directed broadcasts by hand on all interfaces.

Broadcast is ugly anyways, why don't you use multicast ?

Phil.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/