Open gcibeira opened 1 year ago
So, after some research, I found 2 things:
It's not clear if a device must respond a "WhoIs" request with a unicast messagge to the caller, or a broadcast messagge as well. Most device implementations I've found respond with a broadcast (see traffic captures). If that's the case, we may change the iAmResponse() call with a broadcast (line 215 in bacnet-device.js file).
It is ok for a device to see the IP of the router when receive a response from another subnet. It's a normal behavior of NAT. But now I wonder how can a device initiate a unicast conversation after a discovery in another subnet.
Cheers!
References:
Wireshark bacnet traffic captures: http://kargs.net/captures/ https://wiki.wireshark.org/uploads/__moin_import__/attachments/Protocols/bacnet/bacnet-stack-services.cap
BBMD with NAT: http://www.bacnetwiki.com/wiki/index.php?title=Using_BACnet_over_the_Internet https://www.ashrae.org/File%20Library/Technical%20Resources/Standards%20and%20Guidelines/Standards%20Addenda/135-2008/Add-135-2008o_Final.pdf
Hi everyone! I'm working in developing a BBMD using the bacstack library. I'm using a virtual network made with virtualbox, with 2 subnet linked with a router.
Device1 is my BBMD implementation. Device2 is a simple bacnet client which call a WhoIs() on the broadcast address. Device3 is our bacnet-device made with this repository.
When a "WhoIs" request arrives from the BBMD, the response is directed to the BBMD tiself, instead of the caller device. I've solved it changeing the sender address to the "forwardedFrom" address before responding (line 210 in bacnet-device.js file):
The problem now is that the caller device sees the router's IP instead of the responding device, as seen in the wireshark capture
I'm not sure if it's ok, or it could be a problem when binding device instance with IP address.