Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Sending and receiving broadcast messages via the same interface: Page 1 of 2 (15 Items)
   
Sending and receiving broadcast messages via the same interface  
Hi,

We are would like to be able to send and recieve a broadcast message via the same Ethernet interface. 

We can successfully broadcast both a limited IP broadcast (255.255.255.255) and a subnet-directed IP boardcast (e.g. 192
.168.146.255, subnet mask 255.255.255.0) to another component on the local subnet. We are also able to receive broadcast
 messages sent from another component. 

However, we'd like to be able to send and receive a broadcast message from the same interface. We see that the 
IFF_SIMPLEX flag is set for interface "en0". There's not a lot of documentation about this flag but from the comments in
 the include files we suppose it implies this is not possible. We tried changing this via the ioctl() interface using 
SIOCSIFFLAGS. However, the socket call passes (no error) but when we retrieve the flag's value it is was set implying 
the ioctl() call has no effect.

Is there some way we can do this?

Thanks in advance...
RE: Sending and receiving broadcast messages via the same interface  
Hi Paul:
	I'm not sure I understand this...  Do you have two network
interfaces connected to the same subnet? What does your topology look
like? 

	Is this with io-net or io-pkt?

	Robert.

-----Original Message-----
From: Paul Kahn [mailto:community-noreply@qnx.com] 
Sent: Tuesday, December 16, 2008 3:25 PM
To: technology-networking
Subject: Sending and receiving broadcast messages via the same interface

Hi,

We are would like to be able to send and recieve a broadcast message via
the same Ethernet interface. 

We can successfully broadcast both a limited IP broadcast
(255.255.255.255) and a subnet-directed IP boardcast (e.g.
192.168.146.255, subnet mask 255.255.255.0) to another component on the
local subnet. We are also able to receive broadcast messages sent from
another component. 

However, we'd like to be able to send and receive a broadcast message
from the same interface. We see that the IFF_SIMPLEX flag is set for
interface "en0". There's not a lot of documentation about this flag but
from the comments in the include files we suppose it implies this is not
possible. We tried changing this via the ioctl() interface using
SIOCSIFFLAGS. However, the socket call passes (no error) but when we
retrieve the flag's value it is was set implying the ioctl() call has no
effect.

Is there some way we can do this?

Thanks in advance...

_______________________________________________
Technology
http://community.qnx.com/sf/go/post18759
Re: RE: Sending and receiving broadcast messages via the same interface  
Hi Robert,

The final network topology will be a little complicated. However, for purposes of discussion, let's assume the following
: 

The subnet is 10.0.0.0 with subnet mask of 255.255.255.0. There are two boards running QNX on this subnet. Each of the 
two boards has one Ethernet interface one with address 10.0.0.100 and the other with address 10.0.0.200. Our software 
will communicate using a proprietary protocol over UDP.

We are able to send broadcast messages from one board to another. However they are on separate boards and have different
 IP addresses. We'd also like to be able to receive broadcast messages sent from the same board. Ideally, we'd like to 
be able to send a broadcast out from 10.0.0.100:4000 and receive it via a socket bound to that address (actually the 
same socket). Alternatively we'd be happy to receive a broadcast message sent from 10.0.0.100:4000 and receive it via a 
different socket bound to 10.0.0.100:4001. 

However, it appears we cannot receive broadcast messages from the same Ethernet interface. Hence my question about the 
simplex flag which appears to be set for "en0".

Our code runs on both QNX and Windows and this works on Windows. However, I realize that the network stacks and even the
 sockets implementations are vastly different. 

Thanks,
--Paul
RE: RE: Sending and receiving broadcast messages via the same interface  
Hi Paul:

	This doesn't sound like it's supported in our stack.  There are
a few ways that I could see this working.  Having the driver listening
while it transmits (i.e. wholly in hardware), having the driver
recognize a broadcast packet and send it back up the stack in addition
to transmitting it and finally having the stack somehow loop back
certain packets before they hit the driver.  The stack option seems very
difficult to manage, so I'd guess that it would be something in the
driver or hardware.  Our drivers (and I would have thought most
hardware) don't support a "listen to what I transmit" scenario.

Do you have to do something special to Windows to make this happen or is
it a default behaviour?

	Robet.

-----Original Message-----
From: Paul Kahn [mailto:community-noreply@qnx.com] 
Sent: Tuesday, December 16, 2008 3:52 PM
To: technology-networking
Subject: Re: RE: Sending and receiving broadcast messages via the same
interface

Hi Robert,

The final network topology will be a little complicated. However, for
purposes of discussion, let's assume the following: 

The subnet is 10.0.0.0 with subnet mask of 255.255.255.0. There are two
boards running QNX on this subnet. Each of the two boards has one
Ethernet interface one with address 10.0.0.100 and the other with
address 10.0.0.200. Our software will communicate using a proprietary
protocol over UDP.

We are able to send broadcast messages from one board to another.
However they are on separate boards and have different IP addresses.
We'd also like to be able to receive broadcast messages sent from the
same board. Ideally, we'd like to be able to send a broadcast out from
10.0.0.100:4000 and receive it via a socket bound to that address
(actually the same socket). Alternatively we'd be happy to receive a
broadcast message sent from 10.0.0.100:4000 and receive it via a
different socket bound to 10.0.0.100:4001. 

However, it appears we cannot receive broadcast messages from the same
Ethernet interface. Hence my question about the simplex flag which
appears to be set for "en0".

Our code runs on both QNX and Windows and this works on Windows.
However, I realize that the network stacks and even the sockets
implementations are vastly different. 

Thanks,
--Paul


_______________________________________________
Technology
http://community.qnx.com/sf/go/post18766
RE: RE: Sending and receiving broadcast messages via the same interface  
How about using a switch to "re-route" the broadcast packet.  Does that make sense ...

> -----Original Message-----
> From: Robert Craig [mailto:community-noreply@qnx.com]
> Sent: December-16-08 4:10 PM
> To: technology-networking
> Subject: RE: RE: Sending and receiving broadcast messages via the same
> interface
> 
> Hi Paul:
> 
> 	This doesn't sound like it's supported in our stack.  There are
> a few ways that I could see this working.  Having the driver listening
> while it transmits (i.e. wholly in hardware), having the driver
> recognize a broadcast packet and send it back up the stack in addition
> to transmitting it and finally having the stack somehow loop back
> certain packets before they hit the driver.  The stack option seems
> very
> difficult to manage, so I'd guess that it would be something in the
> driver or hardware.  Our drivers (and I would have thought most
> hardware) don't support a "listen to what I transmit" scenario.
> 
> Do you have to do something special to Windows to make this happen or
> is
> it a default behaviour?
> 
> 	Robet.
> 
> -----Original Message-----
> From: Paul Kahn [mailto:community-noreply@qnx.com]
> Sent: Tuesday, December 16, 2008 3:52 PM
> To: technology-networking
> Subject: Re: RE: Sending and receiving broadcast messages via the same
> interface
> 
> Hi Robert,
> 
> The final network topology will be a little complicated. However, for
> purposes of discussion, let's assume the following:
> 
> The subnet is 10.0.0.0 with subnet mask of 255.255.255.0. There are two
> boards running QNX on this subnet. Each of the two boards has one
> Ethernet interface one with address 10.0.0.100 and the other with
> address 10.0.0.200. Our software will communicate using a proprietary
> protocol over UDP.
> 
> We are able to send broadcast messages from one board to another.
> However they are on separate boards and have different IP addresses.
> We'd also like to be able to receive broadcast messages sent from the
> same board. Ideally, we'd like to be able to send a broadcast out from
> 10.0.0.100:4000 and receive it via a socket bound to that address
> (actually the same socket). Alternatively we'd be happy to receive a
> broadcast message sent from 10.0.0.100:4000 and receive it via a
> different socket bound to 10.0.0.100:4001.
> 
> However, it appears we cannot receive broadcast messages from the same
> Ethernet interface. Hence my question about the simplex flag which
> appears to be set for "en0".
> 
> Our code runs on both QNX and Windows and this works on Windows.
> However, I realize that the network stacks and even the sockets
> implementations are vastly different.
> 
> Thanks,
> --Paul
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post18766
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post18768
> 
RE: RE: Sending and receiving broadcast messages via the same interface  
Oooohhh...  You'd have to put a loop back in the switch.  Can you say
broadcast storm? :->> 

	Robert.

-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com] 
Sent: Tuesday, December 16, 2008 4:14 PM
To: technology-networking
Subject: RE: RE: Sending and receiving broadcast messages via the same
interface

How about using a switch to "re-route" the broadcast packet.  Does that
make sense ...

> -----Original Message-----
> From: Robert Craig [mailto:community-noreply@qnx.com]
> Sent: December-16-08 4:10 PM
> To: technology-networking
> Subject: RE: RE: Sending and receiving broadcast messages via the same

> interface
> 
> Hi Paul:
> 
> 	This doesn't sound like it's supported in our stack.  There are
a few 
> ways that I could see this working.  Having the driver listening while

> it transmits (i.e. wholly in hardware), having the driver recognize a 
> broadcast packet and send it back up the stack in addition to 
> transmitting it and finally having the stack somehow loop back certain

> packets before they hit the driver.  The stack option seems very 
> difficult to manage, so I'd guess that it would be something in the 
> driver or hardware.  Our drivers (and I would have thought most
> hardware) don't support a "listen to what I transmit" scenario.
> 
> Do you have to do something special to Windows to make this happen or 
> is it a default behaviour?
> 
> 	Robet.
> 
> -----Original Message-----
> From: Paul Kahn [mailto:community-noreply@qnx.com]
> Sent: Tuesday, December 16, 2008 3:52 PM
> To: technology-networking
> Subject: Re: RE: Sending and receiving broadcast messages via the same

> interface
> 
> Hi Robert,
> 
> The final network topology will be a little complicated. However, for 
> purposes of discussion, let's assume the following:
> 
> The subnet is 10.0.0.0 with subnet mask of 255.255.255.0. There are 
> two boards running QNX on this subnet. Each of the two boards has one 
> Ethernet interface one with address 10.0.0.100 and the other with 
> address 10.0.0.200. Our software will communicate using a proprietary 
> protocol over UDP.
> 
> We are able to send broadcast messages from one board to another.
> However they are on separate boards and have different IP addresses.
> We'd also like to be able to receive broadcast messages sent from the 
> same board. Ideally, we'd like to be able to send a broadcast out from

> 10.0.0.100:4000 and receive it via a socket bound to that address 
> (actually the same socket). Alternatively we'd be happy to receive a 
> broadcast message sent from 10.0.0.100:4000 and receive it via a 
> different socket bound to 10.0.0.100:4001.
> 
> However, it appears we cannot receive broadcast messages from the same

> Ethernet interface. Hence my question about the simplex flag which 
> appears to be set for "en0".
> 
> Our code runs on both QNX and Windows and this works on Windows.
> However, I realize that the network stacks and even the sockets 
> implementations are vastly different.
> 
> Thanks,
> --Paul
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post18766
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post18768
> 


_______________________________________________
Technology
http://community.qnx.com/sf/go/post18769
RE: RE: Sending and receiving broadcast messages via the same interface  
Them Cisco switch are quite capable beast!

> -----Original Message-----
> From: Robert Craig [mailto:community-noreply@qnx.com]
> Sent: December-16-08 4:15 PM
> To: technology-networking
> Subject: RE: RE: Sending and receiving broadcast messages via the same
> interface
> 
> Oooohhh...  You'd have to put a loop back in the switch.  Can you say
> broadcast storm? :->>
> 
> 	Robert.
> 
> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: Tuesday, December 16, 2008 4:14 PM
> To: technology-networking
> Subject: RE: RE: Sending and receiving broadcast messages via the same
> interface
> 
> How about using a switch to "re-route" the broadcast packet.  Does that
> make sense ...
> 
> > -----Original Message-----
> > From: Robert Craig [mailto:community-noreply@qnx.com]
> > Sent: December-16-08 4:10 PM
> > To: technology-networking
> > Subject: RE: RE: Sending and receiving broadcast messages via the
> same
> 
> > interface
> >
> > Hi Paul:
> >
> > 	This doesn't sound like it's supported in our stack.  There are
> a few
> > ways that I could see this working.  Having the driver listening
> while
> 
> > it transmits (i.e. wholly in hardware), having the driver recognize a
> > broadcast packet and send it back up the stack in addition to
> > transmitting it and finally having the stack somehow loop back
> certain
> 
> > packets before they hit the driver.  The stack option seems very
> > difficult to manage, so I'd guess that it would be something in the
> > driver or hardware.  Our drivers (and I would have thought most
> > hardware) don't support a "listen to what I transmit" scenario.
> >
> > Do you have to do something special to Windows to make this happen or
> > is it a default behaviour?
> >
> > 	Robet.
> >
> > -----Original Message-----
> > From: Paul Kahn [mailto:community-noreply@qnx.com]
> > Sent: Tuesday, December 16, 2008 3:52 PM
> > To: technology-networking
> > Subject: Re: RE: Sending and receiving broadcast messages via the
> same
> 
> > interface
> >
> > Hi Robert,
> >
> > The final network topology will be a little complicated. However, for
> > purposes of discussion, let's assume the following:
> >
> > The subnet is 10.0.0.0 with subnet mask of 255.255.255.0. There are
> > two boards running QNX on this subnet. Each of the two boards has one
> > Ethernet interface one with address 10.0.0.100 and the other with
> > address 10.0.0.200. Our software will communicate using a proprietary
> > protocol over UDP.
> >
> > We are able to send broadcast messages from one board to another.
> > However they are on separate boards and have different IP addresses.
> > We'd also like to be able to receive broadcast messages sent from the
> > same board. Ideally, we'd like to be able to send a broadcast out
> from
> 
> > 10.0.0.100:4000 and receive it via a socket bound to that address
> > (actually the same socket). Alternatively we'd be happy to receive a
> > broadcast message sent from 10.0.0.100:4000 and receive it via a
> > different socket bound to 10.0.0.100:4001.
> >
> > However, it appears we cannot receive broadcast messages from the
> same
> 
> > Ethernet interface. Hence my question about the simplex flag which
> > appears to be set for "en0".
> >
> > Our code runs on both QNX and Windows and this works on Windows.
> > However, I realize that the network stacks and even the sockets
> > implementations are vastly different.
>...
View Full Message
RE: RE: Sending and receiving broadcast messages via the same interface  
As a side note, we can check into the stack implementation to verify
this.  Which stack are you using (io-net or io-pkt)?

	Robert. 

-----Original Message-----
From: Robert Craig 
Sent: Tuesday, December 16, 2008 4:10 PM
To: 'post18766@community.qnx.com'
Subject: RE: RE: Sending and receiving broadcast messages via the same
interface

Hi Paul:

	This doesn't sound like it's supported in our stack.  There are
a few ways that I could see this working.  Having the driver listening
while it transmits (i.e. wholly in hardware), having the driver
recognize a broadcast packet and send it back up the stack in addition
to transmitting it and finally having the stack somehow loop back
certain packets before they hit the driver.  The stack option seems very
difficult to manage, so I'd guess that it would be something in the
driver or hardware.  Our drivers (and I would have thought most
hardware) don't support a "listen to what I transmit" scenario.

Do you have to do something special to Windows to make this happen or is
it a default behaviour?

	Robet.

-----Original Message-----
From: Paul Kahn [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 16, 2008 3:52 PM
To: technology-networking
Subject: Re: RE: Sending and receiving broadcast messages via the same
interface

Hi Robert,

The final network topology will be a little complicated. However, for
purposes of discussion, let's assume the following: 

The subnet is 10.0.0.0 with subnet mask of 255.255.255.0. There are two
boards running QNX on this subnet. Each of the two boards has one
Ethernet interface one with address 10.0.0.100 and the other with
address 10.0.0.200. Our software will communicate using a proprietary
protocol over UDP.

We are able to send broadcast messages from one board to another.
However they are on separate boards and have different IP addresses.
We'd also like to be able to receive broadcast messages sent from the
same board. Ideally, we'd like to be able to send a broadcast out from
10.0.0.100:4000 and receive it via a socket bound to that address
(actually the same socket). Alternatively we'd be happy to receive a
broadcast message sent from 10.0.0.100:4000 and receive it via a
different socket bound to 10.0.0.100:4001. 

However, it appears we cannot receive broadcast messages from the same
Ethernet interface. Hence my question about the simplex flag which
appears to be set for "en0".

Our code runs on both QNX and Windows and this works on Windows.
However, I realize that the network stacks and even the sockets
implementations are vastly different. 

Thanks,
--Paul


_______________________________________________
Technology
http://community.qnx.com/sf/go/post18766
RE: RE: Sending and receiving broadcast messages via the same interface  
 
Does it help if you use multicast rather than broadcast?  Multicast
would provide much the same capabilities as broadcast though also does
explicitly allow looping back to the transmitting host (or so I
believe).
Re: RE: Sending and receiving broadcast messages via the same interface  
On Tue, Dec 16, 2008 at 03:51:45PM -0500, Paul Kahn wrote:
> Hi Robert,
> 
> The final network topology will be a little complicated. However, for purposes of discussion, let's assume the 
following: 
> 
> The subnet is 10.0.0.0 with subnet mask of 255.255.255.0. There are two boards running QNX on this subnet. Each of the
 two boards has one Ethernet interface one with address 10.0.0.100 and the other with address 10.0.0.200. Our software 
will communicate using a proprietary protocol over UDP.
> 
> We are able to send broadcast messages from one board to another. However they are on separate boards and have 
different IP addresses. We'd also like to be able to receive broadcast messages sent from the same board. Ideally, we'd 
like to be able to send a broadcast out from 10.0.0.100:4000 and receive it via a socket bound to that address (actually
 the same socket). Alternatively we'd be happy to receive a broadcast message sent from 10.0.0.100:4000 and receive it 
via a different socket bound to 10.0.0.100:4001. 
> 
> However, it appears we cannot receive broadcast messages from the same Ethernet interface. Hence my question about the
 simplex flag which appears to be set for "en0".
> 
> Our code runs on both QNX and Windows and this works on Windows. However, I realize that the network stacks and even 
the sockets implementations are vastly different. 
> 

We do loop a copy of broadcast packets sent on ethernet back
on loopback.  If you can receive any broadcast packets you
should also get the ones you send.  You can check the 'netstat -in'
counts to see if the localhost counts increase on receive.
'netstat -pudp' has a dropped broadcast count as well.

-seanb