Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一台主机拥有多个IP地址时,brook链接失败 #2737

Open
duanchao01 opened this issue Feb 27, 2025 · 8 comments
Open

一台主机拥有多个IP地址时,brook链接失败 #2737

duanchao01 opened this issue Feb 27, 2025 · 8 comments
Labels
bug Issue concerning incorrect code operation

Comments

@duanchao01
Copy link

Describe the bug
A clear and conc

Image

ise description of what the bug is.
what is the current behavior

What is the expected behavior?
What is the motivation / use case for changing the behavior?

To Reproduce
Steps to reproduce the behavior:
Please provide a minimal working example of the bug if possible.

Environment (please complete the following information):

  • Operating System: [all | Windows | Mac | Linux]
  • Language Extension: [all | Python | MATLAB | Java | Octave| C | C++]
  • what compiler or setup process did you use
  • HELICS version:
$ helics_app --version

Additional context and information
(e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

@duanchao01 duanchao01 added the bug Issue concerning incorrect code operation label Feb 27, 2025
@trevorhardy
Copy link
Contributor

If you're using a JSON configuration for your federate, you can add broker_address: "172.21.200.111" to the JSON configuration file to specify which IP address a federate should use when connecting to a broker.

@duanchao01
Copy link
Author

I have used the json configuration file to specify the IP address, but if there are multiple IP addresses on the same host, the IP address that is not specified in the configuration file may be obtained when the zmq network topology is built, resulting in unsuccessful networking

@duanchao01
Copy link
Author

For example, in the figure above, I specified 172.21.200.36 in the configuration file, but when zmq is networked, it will obtain another IP address 172.21.200.111 on my host for connection, which will eventually lead to unsuccessful networking

@trevorhardy
Copy link
Contributor

trevorhardy commented Feb 28, 2025

You can also instantiate your broker and specify the IP address you want it to use: helics_broker -f<number of federates> --interface <IP address>.

Also try specifying the address as "localhost" or 127.0.0.1 (assuming broker and federates are on the same computer). If you do this, also add the --ipv4 flag when instantiating the broker.

@duanchao01
Copy link
Author

Currently the agent and the federation member are on the same server. Today I tried to disable all network cards, only keep the IP address of 172.21.200.36, and only use the address of 172.21.200.36 when configuring, but when the network topology is established, main_broker connect to the local loopback address: 127.0.0.1, and other nodes try to connect to 172.21.200.36, resulting in the network environment initialization failure.

@duanchao01
Copy link
Author

Image

Is the IP address specified in the create function when instantiating the IP address helics_broker -f100 --interface 172.21.200.36?

@trevorhardy
Copy link
Contributor

Image

Is the IP address specified in the create function when instantiating the IP address helics_broker -f100 --interface 172.21.200.36?

I'm going to loop in @phlptp to help answer this specific question.

@trevorhardy
Copy link
Contributor

Currently the agent and the federation member are on the same server. Today I tried to disable all network cards, only keep the IP address of 172.21.200.36, and only use the address of 172.21.200.36 when configuring, but when the network topology is established, main_broker connect to the local loopback address: 127.0.0.1, and other nodes try to connect to 172.21.200.36, resulting in the network environment initialization failure.

I'm definitely confused why the IP addresses are causing this much trouble so let's try something else. Can you try changing the HELICS core to TCP (--coretype tcp on the helics_broker and "core_type": "tcp" in the JSON config for the federates). I'm wondering if there are some details in ZMQ that we're missing and this will help us narrow down where the problem is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue concerning incorrect code operation
Projects
None yet
Development

No branches or pull requests

2 participants