Bluehost.com Web Hosting $6.95

Full network level broadcast in Linux

This is a discussion on Full network level broadcast in Linux within the Linux Networking forums, part of the Linux Forums category; Hello all, I am somewhat new to Linux networking. I have done a lot of network programming on Windows. I ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-08-2003
amesser39@hotmail.com
 
Posts: n/a
Default Full network level broadcast in Linux

Hello all,

I am somewhat new to Linux networking. I have done a lot of
network programming on Windows. I am trying to do something that is
allowed on Windows but appears to not be allowed on Linux. I would
like to be able to do a full network broadcast (255.255.255.255) on a
simple Ethernet adapter.

When I try to do this I get a "network unreachable" error. I
even tried setting the adapter's broadcast address to 255.255.255.255,
but that is not allowed either. I can broadcast up to the level of the
adapter's broadcast address (i.e. 192.255.255.255).

am trying to help a friend with a problem. He has developed
an environment that works on Linux boxes. His customers are not
usually very tech savvy. They need to be able to hook up a WIndows
laptop (on a cross over cable) to the Linux boxes to configure them.
The problem is, is that the Linux box and the Windows box are, most
likely, configured for completely different networks. I told my friend
he could use UDP broadcasts to do what he wants. Problem is the Linux
boxes won't do it. I can do this with all embedded devices I have
developed and with Windows boxes, but not Linux.

If someone kind person out there can tell me how to do a full
network broadcast on a Linux box I would be very grateful.

TIA,
Adam Messer
amesser39@hotmail.com

Reply With Quote
  #2 (permalink)  
Old 11-10-2003
amesser39@hotmail.com
 
Posts: n/a
Default Re: Full network level broadcast in Linux

Hello All,

I discovered my own answer to the question. Just in case
anyone else out there has the same question, here is the answer. You
have to bind to the adapter you want to broadcast on. I have never had
to bind to send before, only to receive, but it makes sense. As long
as the broadcast level you are trying to use falls within the
adapter's set broadcast address, the protocol stack knows which
adapter to use. But, if you want to do a full (what Comer calls a
limited) network broadcast, the stack doesn't know where to send the
packet. So, binding to the appropriate adapter address is what does
the trick. Now, choosing the correct adapter can be another issue.
What I did was get the list of adapters with an ioctl() and choose the
first Ethernet adapter that was capable of broadcasting. In my case,
that will always work. In many more complex environments it may not. I
think you would have to have some outside information (i.e. know which
adapter they connected to) in order to bind properly.

Thanks again,
Adam



On Sat, 08 Nov 2003 01:47:18 GMT, amesser39@hotmail.com wrote:

>Hello all,
>
> I am somewhat new to Linux networking. I have done a lot of
>network programming on Windows. I am trying to do something that is
>allowed on Windows but appears to not be allowed on Linux. I would
>like to be able to do a full network broadcast (255.255.255.255) on a
>simple Ethernet adapter.
>
> When I try to do this I get a "network unreachable" error. I
>even tried setting the adapter's broadcast address to 255.255.255.255,
>but that is not allowed either. I can broadcast up to the level of the
>adapter's broadcast address (i.e. 192.255.255.255).
>
> am trying to help a friend with a problem. He has developed
>an environment that works on Linux boxes. His customers are not
>usually very tech savvy. They need to be able to hook up a WIndows
>laptop (on a cross over cable) to the Linux boxes to configure them.
>The problem is, is that the Linux box and the Windows box are, most
>likely, configured for completely different networks. I told my friend
>he could use UDP broadcasts to do what he wants. Problem is the Linux
>boxes won't do it. I can do this with all embedded devices I have
>developed and with Windows boxes, but not Linux.
>
> If someone kind person out there can tell me how to do a full
>network broadcast on a Linux box I would be very grateful.
>
>TIA,
>Adam Messer
>amesser39@hotmail.com


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0