GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
812 stars 263 forks source link

Adding a link to a stopped neighbor leads to changing interface state to UP #2002

Open andrei-korshikov opened 3 years ago

andrei-korshikov commented 3 years ago

GNS3 version and operating system:

To Reproduce

  1. Tick Replicate network connection states in Qemu.
  2. Add a link from running node to stopped one.
  3. See interface state on running node becomes up. So there is no sense in Replicate network connection states in Qemu checkbox, the node can't feel if the neighbor is down and erroneously believe the neighbor is constantly up.

Screenshots

Related issue Link becomes down when one host is down https://github.com/GNS3/gns3-gui/issues/3099

grossmj commented 3 years ago

This may because of the adapter type. For instance e1000 could report the link as always UP: https://github.com/GNS3/gns3-gui/issues/2821#issuecomment-520169971

What adapter type do you have?

andrei-korshikov commented 3 years ago

I've seen this behavior both with e1000 and virtio-net-pci.

Look at my aforementioned screenshots. At the beginning there is no link between nodes, and e1000 adapter inside re node correctly reported the link as DOWN. Then I just added a link between re and pfe. At this moment pfe is still powered off, but the link on re is reported as UP.

I believe that link should be reported as UP not when I attach "virtual patch-cord", but only at the moment when the neighbor is "powered on" (started).

I understand that there are situations when links are always reported as UP and not change their state irrespective of what's going on in the topology. But in my current case we can see that the link state changes, just at the wrong moment.

andrei-korshikov commented 3 years ago

I've made some experiments with Arch Linux VM and e1000, pcnet, virtio-net-pci and vmxnet3 adapters, and results are the same.

Now all states are UP, and also we can see LOWER_UP is present, indicating that physical (Ethernet) connection is active.

@grossmj Should I provide any additional info?

grossmj commented 3 years ago

@grossmj Should I provide any additional info?

No, all good. It makes sense because nodes operate independently from other nodes, in short they don't know the state of other nodes (running, stopped etc.) This will have to wait for version 3.0 since there is some re-factoring needed to correctly support this.