UDP Broadcast

Hello,

I have some questions about UDP broadcast in DCRTCP.LIB.

Assume a node with default TCPCONFIG=1 (10.10.6.100/24).
TCPCONFIG = 1;
_PRIMARY_STATIC_IP = “10.10.6.100”;
_PRIMARY_NETMASK = “255.255.255.0”;
MY_GATEWAY = “10.10.6.1”;
MY_NAMESERVER = “10.10.6.1”;

For udp_open(udp_Socket *s, word lport, longword remip, word port, dataHandler_t datahandler), if remoteip is -1, the socket is for broadcast. Could you clarify the following:

  1. Which broadcast address is used? 255.255.255.255 (limited) or 10.10.6.255 (subnet)?

  2. The broadcast packet is destined to lport specified by udp_open(), right?

  3. Can I still use udp_sendto() to send out packet to a different destination (unicast or not) for such broadcast socket?

  4. If a packet destined to 10.10.255.255 (subnet broadcast for a different yet bigger subnet) with same lport is received by my Ethernet interface, will it be forwarded/received by this socket?

  5. If a node has multiple interfaces, which interface is the UDP broadcast packet sent out? all of them? Can I select an interface without using udp_extopen() to bind it to a specific interface in the first place?

  6. If a node has multiple interfaces, and a UDP socket not binding to any interface, is it possible to know which interface the packet is received from?

Thanks,