MJL85 / natlas

natlas - Network Discovery and Auto-Diagramming
GNU General Public License v2.0
511 stars 110 forks source link

Duplicated connections in diagram #42

Open zearthlink opened 5 years ago

zearthlink commented 5 years ago

Hi,

I consistently have duplicated connections in my diagram. I did try to have a look but I'm not a programmer so wasn't able to fix it. This happens every time so its easily reproduced.

Regards

duplicated

LaurentDumont commented 5 years ago

It's a bit hard to troubleshoot without details about the environment. The tool itself is not updated super often but we might be able to help you tweak it.

zearthlink commented 5 years ago

Hi Laurent,

thank you for your reply.

I've tried the Script in different OS, both with the same end result of duplicating connections. Gives alot of Parent and Child (IP Parent address example 192.168.1.1), then reversed Parent and Child (IP Parent address example 192.168.1.2) and in the end more duplicates of Parent and Child (IP Parent address example 192.168.1.1 and IP Child address 192.168.1.2)

OS: Redhat 7.6 python 3.6.3 pip freeze: graphviz==0.10.1 natlas==0.12.1 netaddr==0.7.19 ply==3.11 pyasnl==0.45 pycryptodomex==3.7.3 pydot==1.4.1 pyparsing==2.3.1 pysmi==0.3.3 pysnmp==4.4.9

Windows 10 python 3.7.1 pip freeze: argumentparser==1.2.1 asn1crypto==0.24.0 bcrypt==3.1.5 cffi==1.11.5 cryptography==2.4.2 DateTime==4.3 graphviz==0.10.1 idna==2.8 mnet==0.10 natlas==0.12.1 netaddr==0.7.19 netmiko==2.3.0 paramiko==2.4.2 ply==3.11 pyasn1==0.4.4 pycparser==2.19 pycryptodomex==3.7.0 pydot==1.3.0 PyNaCl==1.3.0 pyparsing==2.3.0 pyserial==3.4 pysmi==0.3.2 pysnmp==4.4.6 pytz==2018.9 PyYAML==3.13 scp==0.13.0 six==1.12.0 textfsm==0.4.1 zope.interface==4.6.0

I've run the script against vIOS from VIRL and real hardware (Cat4509, Cat4500x, Cat3850, Cat2960). They all present the same symptom.

I've tried to add a few prints to grab CDP before the script write it to the diagram but had zero output, so I'm clearly not doing it properly :/

Is there any other information I can give you ?

LaurentDumont commented 5 years ago

That's rough - I've just ran the script two weeks ago with 50 or so devices and had no issues with duplicate links. I'll see if anything changed. I'll see if I can run it again to replicate. Can you try a Ubuntu 18.04?

How are you installing Natlas?

zearthlink commented 5 years ago

Thank you for the suggestion, but the problem still remains. In a small network it doesn't matter much, but on a bigger (live one) renders the "diagram" function useless.

Ubuntu Desktop 18.04 apturl==0.5.2 asn1crypto==0.24.0 Brlapi==0.6.6 certifi==2018.1.18 chardet==3.0.4 command-not-found==0.3 cryptography==2.1.4 cupshelpers==1.0 defer==1.0.6 distro-info==0.18 graphviz==0.10.1 httplib2==0.9.2 idna==2.6 keyring==10.6.0 keyrings.alt==3.0 language-selector==0.1 launchpadlib==1.10.6 lazr.restfulclient==0.13.5 lazr.uri==1.0.3 louis==3.5.0 macaroonbakery==1.1.3 Mako==1.0.7 MarkupSafe==1.0 natlas==0.12.1 netaddr==0.7.19 netifaces==0.10.4 oauth==1.0.1 olefile==0.45.1 pexpect==4.2.1 Pillow==5.1.0 ply==3.11 protobuf==3.0.0 pyasn1==0.4.5 pycairo==1.16.2 pycrypto==2.6.1 pycryptodomex==3.7.3 pycups==1.9.73 pydot==1.4.1 pygobject==3.26.1 pymacaroons==0.13.0 PyNaCl==1.1.2 pyparsing==2.3.1 pyRFC3339==1.0 pysmi==0.3.3 pysnmp==4.4.9 python-apt==1.6.3+ubuntu1 python-debian==0.1.32 pytz==2018.3 pyxdg==0.25 PyYAML==3.12 reportlab==3.4.0 requests==2.18.4 requests-unixsocket==0.1.5 SecretStorage==2.3.1 simplejson==3.13.2 six==1.11.0 ssh-import-id==5.7 system-service==0.3 systemd-python==234 ubuntu-drivers-common==0.0.0 ufw==0.35 unattended-upgrades==0.1 urllib3==1.22 usb-creator==0.3.3 wadllib==1.3.2 xkit==0.0.0 zope.interface==4.3.2

test9

I just download the zip with wget, run the setup and install graphviz (ubuntu). In Centos I create a a venv so that Python3 doesn't screw the OS.

Looking forward to see the results of your tests again

MJL85 commented 5 years ago

I think the reason you are getting duplicate links in the smaller image may be because one device reports its interface name as "Et0/3" and the other reports the remote interface name as "Ethernet0/3". The logic prunes based off exact string matches. The original image you posted does not appear to have that problem though. Were either edited for clarity or is this actual output?

B3DTech commented 4 years ago

I'm seieing the same thing as the first diagram as well. Connections are entered 4 times to each device.

P:te1/1/6 C:eth0 Native 254 Allowed P: 36,254,266

is repeated for 4 connections to/from the same device. And not ever device but many have these duplications.