Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Linux Networking

Re: UDP Broadcast

Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2006, 08:36 PM
Default Re: UDP Broadcast



Hi.

Patrick Klos schrieb:
> In article <e4s3ff$8lh$(E-Mail Removed)>,
> Michael Wuest <(E-Mail Removed)> wrote:
>
>>Hi @ all,
>>
>>I have the following problem:
>>
>>System is Debian Linux Sarge with Kernel 2.4.29. I want to
>>send and receive UDP Broadcasts. I have no firewall
>>installed, the system is very basic.
>>
>>The Broadcasts need to be received from systems not being
>>in the same subnet and to be sent to systems not being in
>>the same subnet.
>>
>>I am using sockets with SO_BROADCAST enabled. The packet
>>is sent out and received, but only in the same subnet, not
>>in other subnets being on the same physical network.

>
>
> By saying you have several subnets, you imply there is a router between
> these subnets. Generally, IP broadcasts are not propagated through routers
> unless the router is specifically set up to forward such broadcasts.


AFAIK broadcasts are possible to all systems on your physical
network through "255.255.255.255". In fact I do not want to route
anything since I do not know what the subnet is I want to adress.

The application is an configuration program for a linux machine
to set up ip adresses. To achieve this task I need to reach the
target machine if it is available and to ask the machine of its
current ip adress regardless if it fits into my TCP/IP subnet
or not.

>
>
>>What am I doing wrong? What is exactly the meaning of the
>>broadcast value in /etc/network/interfaces? Are there any
>>specific parameters to be set? Are there any special kernel
>>issues that need recompiling? Is the broadcast adress
>>255.255.255.255 correct?

>
>
> Again, it's not that you are necessarily doing anything wrong in your Linux
> box - it's more that the router between your machine and the target subnet
> does not forward broadcasts. (unless your Linux box IS the router between
> the subnets in question??)


To be more clearly, I want the linux machine to "forward" the
broadcast being sent to "255.255.255.255" to all subnets being
available on my physical network.

>
>
>>Maybe someone has any for functionality approved command
>>line test program that sends out any "text" by UDP broadcast
>>so that I can check whether the linux is blocking or my
>>configuration is or my programing is wrong.
>>
>>Any help appricated. Links to FAQs, PDFs appreciated too.

>
>
> Not a definitive answer, but I hope I helped shed some light on the
> situation? If not, describe the subnets and routers involved please?
>
> Patrick
> ========= For LAN/WAN Protocol Analysis, check out PacketView Pro! =========
> Patrick Klos Email: (E-Mail Removed)
> Klos Technologies, Inc. Web: http://www.klos.com/
> ==================== http://www.loving-long-island.com/ ====================


Bye,
Michael.



=?ISO-8859-1?Q?Michael_W=FCst?=
Reply With Quote
  #2  
Old 05-22-2006, 11:07 PM
Phil Frisbie, Jr.
Guest
 
Posts: n/a
Default Re: UDP Broadcast

Michael Wüst wrote:
> Hi.
>
> AFAIK broadcasts are possible to all systems on your physical
> network through "255.255.255.255". In fact I do not want to route
> anything since I do not know what the subnet is I want to adress.


Yes, but 'physical network' really means all devices that you can directly talk
to (a LAN segment), but NOT through a router. Routers separate LAN segments.

> The application is an configuration program for a linux machine
> to set up ip adresses. To achieve this task I need to reach the
> target machine if it is available and to ask the machine of its
> current ip adress regardless if it fits into my TCP/IP subnet
> or not.


But if it is not on the same segment then you will need to enable broadcast
forwarding on the router.

> To be more clearly, I want the linux machine to "forward" the
> broadcast being sent to "255.255.255.255" to all subnets being
> available on my physical network.


I understand what you want to do, but it is not simple. You either need to
enable broadcast forwarding to all routers that are between your LAN segments,
or you need to know the LAN segments and use directed broadcasts.

Actually, you have a cleaner option. Use multicast and enable it on your routers.

--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
Reply With Quote
  #3  
Old 05-22-2006, 11:43 PM
Rick Jones
Guest
 
Posts: n/a
Default Re: UDP Broadcast

Michael W?st <(E-Mail Removed)> wrote:
> AFAIK broadcasts are possible to all systems on your physical
> network through "255.255.255.255". In fact I do not want to route
> anything since I do not know what the subnet is I want to adress.


Do you mean your system is connected to more than one IP subnet at
once and you want the brodcast to go out all interfaces on the system?
Actually I'm not sure that all stacks do that automagically. You may
need to find some software which enumerates the interfaces on a system
and use that to learn all the locally connected subnet broadcast
addresses and send to them in turn.

> The application is an configuration program for a linux machine
> to set up ip adresses. To achieve this task I need to reach the
> target machine if it is available and to ask the machine of its
> current ip adress regardless if it fits into my TCP/IP subnet
> or not.


If the target system is in another IP subnet and that subnet is not
one to which your system is directly connected, the datagram sent to
the "all ones" (255.255.255.255) broadcast address will not be
forwarded to it by the router separating your system from the target.

And even if it were forwarded, there is no guarantee that the target
system will have a route back to the IP address which was used as the
source of the broadcast in the first place. That could still hold
true even if your system and the target were in the same local LAN
segment.

rick jones
--
oxymoron n, commuter in a gas-guzzling luxury SUV with an American flag
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Reply With Quote
  #4  
Old 05-23-2006, 08:00 PM
=?ISO-8859-1?Q?Michael_W=FCst?=
Guest
 
Posts: n/a
Default Re: UDP Broadcast

Hi.

Phil Frisbie, Jr. schrieb:
> Michael Wüst wrote:
>
>> Hi.
>>
>> AFAIK broadcasts are possible to all systems on your physical
>> network through "255.255.255.255". In fact I do not want to route
>> anything since I do not know what the subnet is I want to adress.

>
>
> Yes, but 'physical network' really means all devices that you can
> directly talk to (a LAN segment), but NOT through a router. Routers
> separate LAN segments.
>


I agree. no router. everything is connected to a hub/switch.
just different ip settings.

>> The application is an configuration program for a linux machine
>> to set up ip adresses. To achieve this task I need to reach the
>> target machine if it is available and to ask the machine of its
>> current ip adress regardless if it fits into my TCP/IP subnet
>> or not.

>
>
> But if it is not on the same segment then you will need to enable
> broadcast forwarding on the router.


as i said, the feature to broadcast through a router is not
requested.

>
>> To be more clearly, I want the linux machine to "forward" the
>> broadcast being sent to "255.255.255.255" to all subnets being
>> available on my physical network.

>
>
> I understand what you want to do, but it is not simple. You either need
> to enable broadcast forwarding to all routers that are between your LAN
> segments, or you need to know the LAN segments and use directed broadcasts.
>
> Actually, you have a cleaner option. Use multicast and enable it on your
> routers.
>


Reply With Quote
  #5  
Old 05-23-2006, 08:02 PM
=?ISO-8859-1?Q?Michael_W=FCst?=
Guest
 
Posts: n/a
Default Re: UDP Broadcast

Hi.

Rick Jones schrieb:

> Michael W?st <(E-Mail Removed)> wrote:
>
>>AFAIK broadcasts are possible to all systems on your physical
>>network through "255.255.255.255". In fact I do not want to route
>>anything since I do not know what the subnet is I want to adress.

>
>
> Do you mean your system is connected to more than one IP subnet at
> once and you want the brodcast to go out all interfaces on the system?
> Actually I'm not sure that all stacks do that automagically. You may
> need to find some software which enumerates the interfaces on a system
> and use that to learn all the locally connected subnet broadcast
> addresses and send to them in turn.
>


I have an GPS timeserver here that does exactly what I need. I also
know a lot of devices with a setup program to detect the device
and set it up whatever ip adress the device has actually. so it is
possible. the question is how.

>
>>The application is an configuration program for a linux machine
>>to set up ip adresses. To achieve this task I need to reach the
>>target machine if it is available and to ask the machine of its
>>current ip adress regardless if it fits into my TCP/IP subnet
>>or not.

>
>
> If the target system is in another IP subnet and that subnet is not
> one to which your system is directly connected, the datagram sent to
> the "all ones" (255.255.255.255) broadcast address will not be
> forwarded to it by the router separating your system from the target.
>


no router. all systems are connected to a hub/switch. they just have
different ip settings.

> And even if it were forwarded, there is no guarantee that the target
> system will have a route back to the IP address which was used as the
> source of the broadcast in the first place. That could still hold
> true even if your system and the target were in the same local LAN
> segment.
>
> rick jones


Reply With Quote
Reply

Tags
broadcast, udp

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
Forum Jump


All times are GMT. The time now is 05:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.