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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |