Skip to content

Latest commit

 

History

104 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bat-Q: A Streamlit App for Network Analysis with Batfish

Open in GitHub Codespaces

Bat-Q is a Streamlit app that lets you run various network analysis queries using Batfish, an open source network configuration analysis tool. You can upload your network configuration files as snapshots and analyze different scenarios or states. You can also select from a wide range of Batfish questions to get insights into your network's behavior and security. Bat-Q displays the answers in tables and diagrams for easy interpretation.

Bat-Q is designed to be simple, interactive, and flexible. You can use it for quick network configuration checks or for network troubleshooting and optimization tasks. Bat-Q is not a replacement for pyBatfish, the Python API for Batfish, but rather a complementary tool that can help you get started with network analysis using Batfish.

To learn more about Bat-Q and how to use it, please watch these YouTube tutorials (work in progress).

Try it instantly

No installation needed! Click the badge above to launch Bat-Q in a ready-to-use GitHub Codespace. Batfish and Streamlit start automatically; once the Codespace is ready, a browser tab will open with the app running. Use the abc_net.zip example provided to try out Bat-Q.

Release Notes - Version v0.2

Version v0.2 introduces key architectural updates, interactive visualization, improved snapshot management, and enhanced user feedback:

  • Improved navigation
  • Interactive topology visualization
  • Enhanced snapshot management
  • DataFrame & schema optimization
  • Report and spreadsheet generation

Requirements

To use Bat-Q, you will need:

  • A Batfish server capable of running Docker: See the recommended requirements for Batfish.
  • A host to run the Bat-Q app.

Note that for training purposes with small networks, you can use one computer to run both Batfish and Bat-Q (a reasonable laptop will work).

Installation

To use the app, follow these steps (assuming Ubuntu Linux, but Windows also works):

Batfish server

  1. Install Docker: There are multiple methods, but I recommend using the apt repository method.

  2. To use Docker as a non-privileged user, add the user to the Docker group:

    $ sudo usermod -aG docker $USER
  3. Install Batfish and run the Batfish services:

    $ docker pull batfish/allinone
    $ docker run --name batfish -d --restart unless-stopped -v batfish-data:/data -p 9997:9997 -p 9996:9996 batfish/allinone

    or, to run on local host:

    $ docker run --name batfish -d --net host -v batfish-data:/data batfish/allinone

This is all that is needed for Bat-Q, but you can consult the Batfish installation instructions for other details.

Bat-Q host

  1. Check Python version and install pip3. Bat-Q needs Python 3.11+[cite: 1, 2]:

    $ python3 --version
    $ sudo apt-get install python3-pip
  2. Clone this repository:

    $ git clone https://github.com/martimy/Bat-Q
    $ cd Bat-Q
  3. Install requirements[cite: 1, 2]:

    $ pip3 install -r requirements.txt
  4. Set the environment variable (skip this step if Docker and Streamlit are running on the same machine):

    $ export BATFISH_SERVER=<Batfish server IP address>
    $ echo $BATFISH_SERVER

    for Windows:

    Bat-Q>set BATFISH_SERVER=<Batfish server IP address>
  5. Start the Streamlit app (you may need to re-login before this step)[cite: 1, 2]:

    $ streamlit run Home.py

User Guide

Here is how to get started using Bat-Q

Author

Created by Maen Artimy - Personal Blog

About

An interactive Streamlit web application for network configuration analysis, verification, and differential testing using Batfish.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages