LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Destination Address

Solved!
Go to solution

Hi,

I’m currently using UDP read VI provided by NI to retrieve UDP broadcast messages.  Parsing the data out, it appears the VI only returns the data segment of the datagram and strips away the header information.  So I am not able to retrieve the destination address (i.e. broadcast address), but only the source address in which it was originated.  Is there a way that I could retrieve this information?

 

Thanks,

Nina

0 Kudos
Message 1 of 7
(2,962 Views)

There are very few possible broadcast addresses. The broadcast address of the current subnet and the generic broadcast address (255.255.255.255).

 

This does not seem to be useful information. What kind of information are you expecting to get out of it?

0 Kudos
Message 2 of 7
(2,951 Views)

You’re correct…  I guess what I’m asking is if the source was to broadcast to the network either on the current subnet or the generic address, would I be able to retrieve what address it was sent to.  I can see this information using wireshark, but not labview. 

0 Kudos
Message 3 of 7
(2,918 Views)

I still don't quite see the purpose. Do you want to determine if it was a broadcast versus an unicast?

 

Broadcasts typically don't cross subnet boundaries. In the old days routers often forwarded directed broadcasts, but this is now normally blocked to e.g. prevent smurf attacks and others. (except for special cases such as dhcp etc.)

 

Also don't forget spoofed packets. If a local machine would place a packet on the wire with a random destination IP, but with your MAC address in the Ethernet header (or the Ethernet broadcast address FF:FF:FF....FF), you'll still get it.

0 Kudos
Message 4 of 7
(2,910 Views)

I’m not well verse on network behavior and I apologize.  I’m looking at the message on the physical layer only and trying to retrieve the header information in that datagram.  The header information reserves 4 bytes for the destination address.  Rather its unicast or broadcast, can I retrieve those bytes prior to it being stripped away by the UDP read VI?     

0 Kudos
Message 5 of 7
(2,899 Views)
Solution
Accepted by topic author Ruthy_J.

LabVIEW does not provide access to the raw packet, but there are some examples that use the winpcap library (e.g. here). That migh allow you to do what you want.

0 Kudos
Message 6 of 7
(2,893 Views)

Perfect... Thank you!

0 Kudos
Message 7 of 7
(2,888 Views)