Networking Forums

Networking Forums > Computer Networking > Linux Networking > broadcast problem under kernel 2.6

Reply
Thread Tools Display Modes

broadcast problem under kernel 2.6

 
 
Dan Miller
Guest
Posts: n/a

 
      02-15-2007, 09:29 PM
We have a hub-and-spoke network here, with two /30 subnets (deployed
network will typically have far more than two such subnets). The hub
interface is defined thus:

eth1 Link encap:Ethernet HWaddr 00:00:C0:A8:0B:01
inet addr:192.168.11.1 Bcast:192.168.11.255
Mask:255.255.255.252
inet6 addr: fe80::200:c0ff:fea8:b01/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:4 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1340 (1.3 Kb) TX bytes:4721 (4.6 Kb)

eth1:1 Link encap:Ethernet HWaddr 00:00:C0:A8:0B:01
inet addr:192.168.11.5 Bcast:192.168.11.255
Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Note that the BROADCAST flag is present on both interfaces. Normal
unicast traffic is passing between the hub and the remote machines fine.

The trick to this network is that hub's transmitter is received by all
the remote units, but each remote has a separate channel coming back to
the hub (which is why this "net of /30 subnets" is used).

Now I want to broadcast a udp message to all the remotes at once. So I
try the following, with net_addr=0xFFFFFFFF:

// set up data for sendto()
bzero(&servaddr, sizeof(servaddr)) ;
servaddr.sin_family = AF_INET ;
servaddr.sin_port = htons(PORT_REMOTE) ;
servaddr.sin_addr.s_addr = htonl(net_addr) ;

// set the SO_BROADCAST flag as well,
// so we can send broadcast messages
if (net_addr == 0xFFFFFFFF) {
int flag = 1 ;
int result = setsockopt(udp_send_fd, SOL_SOCKET, SO_BROADCAST,
&flag, sizeof(flag)) ;
if (result < 0) {
syslog(LOG_ERR, "setsockopt (BROADCAST): %s\n",
show_error(errno)) ;
}
else {
syslog(LOG_ERR, "setsockopt (BROADCAST) was successful\n") ;
}
}

// send the message
int result = sendto(udp_send_fd, mesg, mlen, flags, (SA *) &servaddr,
sizeof(SA)) ; //lint !e740

Under kernel 2.2, sendto() would succeed, but the network stack would
actually break this message up into separate messages on each of the
subnets, using the subnet broadcast address.

However, under kernel 2.6.11, setsockopt() returns success, sendto()
returns 20 (which is correct, the packet is 20 bytes), but no packet is
actually delivered to the eth1 driver. The packet just silently vanishes
into space. No errors (udp or otherwise) are logged anywhere.

What is happening here?? Is there something else that I need to do under
kernel 2.6, to enable udp broadcasts??

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
 
 
 
 
Dan Miller
Guest
Posts: n/a

 
      02-15-2007, 09:56 PM
Dan Miller <(E-Mail Removed)> wrote in
news:Xns98D8932B74C33dananacominccom@38.119.71.69:

> We have a hub-and-spoke network here, with two /30 subnets (deployed
> network will typically have far more than two such subnets). The hub
> interface is defined thus:
>
> eth1 Link encap:Ethernet HWaddr 00:00:C0:A8:0B:01
> inet addr:192.168.11.1 Bcast:192.168.11.255
> Mask:255.255.255.252
> inet6 addr: fe80::200:c0ff:fea8:b01/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:20 errors:0 dropped:0 overruns:0 frame:0
> TX packets:43 errors:0 dropped:4 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:1340 (1.3 Kb) TX bytes:4721 (4.6 Kb)
>
> eth1:1 Link encap:Ethernet HWaddr 00:00:C0:A8:0B:01
> inet addr:192.168.11.5 Bcast:192.168.11.255
> Mask:255.255.255.252
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>
> Note that the BROADCAST flag is present on both interfaces. Normal
> unicast traffic is passing between the hub and the remote machines
> fine.
>
> The trick to this network is that hub's transmitter is received by all
> the remote units, but each remote has a separate channel coming back
> to the hub (which is why this "net of /30 subnets" is used).
>
> Now I want to broadcast a udp message to all the remotes at once. So
> I try the following, with net_addr=0xFFFFFFFF:
>
> // set up data for sendto()
> bzero(&servaddr, sizeof(servaddr)) ;
> servaddr.sin_family = AF_INET ;
> servaddr.sin_port = htons(PORT_REMOTE) ;
> servaddr.sin_addr.s_addr = htonl(net_addr) ;
>
> // set the SO_BROADCAST flag as well,
> // so we can send broadcast messages
> if (net_addr == 0xFFFFFFFF) {
> int flag = 1 ;
> int result = setsockopt(udp_send_fd, SOL_SOCKET, SO_BROADCAST,
> &flag, sizeof(flag)) ;
> if (result < 0) {
> syslog(LOG_ERR, "setsockopt (BROADCAST): %s\n",
> show_error(errno)) ;
> }
> else {
> syslog(LOG_ERR, "setsockopt (BROADCAST) was successful\n") ;
> }
> }
>
> // send the message
> int result = sendto(udp_send_fd, mesg, mlen, flags, (SA *)
> &servaddr,
> sizeof(SA)) ; //lint !e740
>
> Under kernel 2.2, sendto() would succeed, but the network stack would
> actually break this message up into separate messages on each of the
> subnets, using the subnet broadcast address.
>
> However, under kernel 2.6.11, setsockopt() returns success, sendto()
> returns 20 (which is correct, the packet is 20 bytes), but no packet
> is actually delivered to the eth1 driver. The packet just silently
> vanishes into space. No errors (udp or otherwise) are logged
> anywhere.
>
> What is happening here?? Is there something else that I need to do
> under kernel 2.6, to enable udp broadcasts??
>

BTW, I noticed in the preceding ifconfig listing, that the broadcast
addresses on the interfaces were not correct!! Even though I specified a
/30 subnet, the broadcast addresses are still being generated as if these
were /24 subnets. So I manually corrected that, and the broadcast
addresses are now correct, but the symptoms that I describe are still
occuring.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Broadcast SSID Problem. Bill Wireless Networks 9 12-24-2007 09:25 AM
DLink SSID Broadcast problem Mbt6 Network Routers 1 08-01-2006 01:47 AM
SSID Broadcast Problem Roble Wireless Networks 5 08-09-2005 07:24 PM
MN-700 MAC broadcast problem Matt Broadband Hardware 4 08-15-2004 03:49 AM
Broadcast routing problem with duplicate IPs Thomas Boehne Linux Networking 0 06-24-2004 08:27 AM



1 2 3 4 5 6 7 8 9 10 11