GNS3 / gns3-gui

GNS3 Graphical Network Simulator
http://www.gns3.com
GNU General Public License v3.0
2.17k stars 436 forks source link

Duplicated packets with Cloud node #2228

Closed grossmj closed 7 years ago

grossmj commented 7 years ago

This needs to be investigated: https://gns3.com/qa/gns3-2-0-3-duplicate-packets-are

grossmj commented 7 years ago

This could be related to the problem too: https://gns3.com/qa/connectivity-fails-to-gns3-route

grossmj commented 7 years ago

One more complaint: https://gns3.com/qa/cloud-does-not-works-after-upgra

grossmj commented 7 years ago

The problem comes from uBridge and Winpcap. On at least some platforms, sending packets through pcap will, by default, cause those packets to loop back. Windows is one of them, so that applies to WinPcap.

Looped back packets corrupts the MAC address table of the Ethernet switch if used to connect to the cloud node, making it believe all packets come from the same port.

The standard libpcap API call to turn this off, pcap_setdirection() is not supported by WinPcap. The only way is to set the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag in pcap_open(). However, it seems this was broken starting with Windows 8 due to compatibility break with NDIS5.

Only npcap supports PCAP_OPENFLAG_NOCAPTURE_LOCAL, however it needs to be tested with GNS3 to make sure everything works well.

grossmj commented 7 years ago

The only possible fix is to install npcap by default on Windows however there is an issue with the latest version of npcap while capturing packets: see https://github.com/GNS3/gns3-gui/issues/2235

grossmj commented 7 years ago

GNS3 will automatically use the npcap DLLs even when both winpcap and npcap are installed.