batfish / batfish

Batfish is a network configuration analysis tool that can find bugs and guarantee the correctness of (planned or current) network configurations. It enables network engineers to rapidly and safely evolve their network, without fear of outages or security breaches.

Home Page:http://www.batfish.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpectedly High Number of VLANs for Node in aristaevpn snapshot

amar-ox opened this issue · comments

Description:
While running Batfish with the snapshot aristaevpn as used in the documentation, Batfish produced an unexpectedly high number of VLANs for a node. Example, for the node dc1-svc3a, Batfish generated 4086 VLANs ranging from VLAN ID 1 to 4092. However, the VLANs that are actually declared in the snapshot (120, 130, 140, 3001, 3002, 3003, 4093, and 4094) and not present in the VLAN dataframe.

Runnable example

import requests
import os
from pybatfish.client.session import Session

SNAPSHOT_URL = "https://github.com/user-attachments/files/15539543/aristaevpn.zip"
SNAPSHOT_PATH = "aristaevpn.zip"
SNAPSHOT_NAME = "aristaevpn"

response = requests.get(SNAPSHOT_URL)

if response.status_code == 200:
    # Save the file to the local path
    with open(SNAPSHOT_PATH, 'wb') as file:
        file.write(response.content)

bf = Session(host="localhost")


bf.set_network("github-bug-report")
bf.init_snapshot(SNAPSHOT_PATH, name=SNAPSHOT_NAME, overwrite=True)

# Verify that Batfish recognized the vendor format correctly
print(bf.q.fileParseStatus().answer())

# Insert command(s) below to demonstrate the problem
vlans = bf.q.switchedVlanProperties(nodes=nodes).answer().frame()[['Node', 'VLAN_ID']]
vlans = vlans[vlans['Node'] == 'dc1-svc3a']
vlans      # about 4k Vlans are displayed