Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

SendWhoIsRouterToNetwork #10

Description

@pelegelad

Hi,
I am trying to use the source code for discovering the network and I want to use WhoIsRouterToNetwork request but I don't find any reference to it in the source code.

My goal is to retrieve all of the routers which are behind the bbmd IP that I have.

This is my code:

public HashSet<BacnetDeviceNode> WhoIs()
  {
      _bacnetClient.OnIam += OnIAmResponse;
      _bacnetClient.RegisterAsForeignDevice(_ipAddress, 10);
      _bacnetClient.RemoteWhoIs(_ipAddress);

      _whoIsResponseTimer.Elapsed += OnWhoIsResponseTimerElapsed;
      _whoIsResponseTimer.Start();

      _autoResetEvent.WaitOne();
      return _discoveredDevices;
  }

in this section of code, I use BacnetClient object that I have created, and register my bbmd as foreign device and send RemoteWhoIs (in addition I open a timer of 3 seconds for retreiving all of the aware devices).
I retrieve the I-Am Device of the devices that the bbmd knows but not the devices which are connected to other routers that behind the bbmd (those that I can discover if I would get I-Am Router-To-Network).

This is a pcap for other bacnet discover tool from other programming langauge:

Send Who-Is-Router-To-Network
image

Retrieve response of I-Am-Router-To-Network
image

The I-Am-Router-To-Network response data
image

In this pcap you can see that I-Am-Router-To-Network response has a parameter of IP that defines a router behind the bbmd.

So my question is, how can I send this request so I could get all of the routers that behind the bbmd, or if there is another way to get the whole devices of a bbmd?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions