Published: November 30, 2022
Updated: January 07, 2023
Tags: Networking
5 min read

Visualizing Network Topology Using Netdisco

This blog post describes a deployment that is not optimal for production. Use it only as part of development.
The deployment will be based on containers. It is possible to install binaries on an operating system.

Not all vendors are supported by Netdisco.

Introduction To Netdisco

Netdisco [1] is a web-based management network tool. It allows users to view and manage their network equipment.

Gathering Information

Netdisco uses SNMP [2], CLI or device-specific APIs to authenticate with equipment and collection information

Some of the gathered information includes:

  • MAC addresses, IP addresses, and SSIDs.
  • VLANs
  • Equipment inventory based on the model, hardware, software, and operating system.
  • Neighbors

If allowed, Netdisco can modify discovered configuration.

Visualizing Neighbors

One of the main benefits of Netdisco is the ability to visualize neighbors.
nd2-shot-2-1
This greatly helps to understand the networking stack and assists with debugging connectivity issues.

Reports

Netdisco can generate reports based on gathered information.
Some of the built-in reports include:

  • VLAN inventory
  • IP inventory
  • Port utilization

Users can create custom reports [3] using SQL queries from gathered information stored in the database.

How Netdisco Works

Netdisco is an application written in Perl [4].

Application Components

Netdisco is built from several components:

  • Backend agent (netdisco-backend) - responsible for gathering and updating information and storing it in a database.
  • Web (netdisco-web) - frontend component to display a web user interface to interact with the backend agent.
  • CLI (netdisco-do) - utility to interact with the backend from the command line.

Information gathered is stored in a PostgreSQL database [5].

Application Jobs

The backend agent has four principal jobs it can do:

  • Discover - Gather information about a Device, including interfaces, VLANs, PoE status, and chassis components (modules). Also learns about potential new Devices via neighbor protocols and adds jobs for their discovery to the queue.
  • Arpnip - Gather MAC to IP mappings from known Devices reporting layer 3 capability.
  • Macscuk - Gather MAC to port mappings from known Devices reporting Layer 2 capability. Wireless client information is also gathered from Devices supporting the 802.11 MIBs.
  • NBTstat - Poll a Node to obtain its NetBIOS name.

Configuration

Netdisco uses environment variables [6] for configuring and debugging the application itself (file paths, DB information, tracing, and more).

YAML [7] config is used to configure the application behavior and functionality.

Default configuration shipped with the application config.yml [8].

Getting Started

Installation

There are several ways to install Netdisco.

Installing Binaries

This method will not be covered in this blog post. Please refer to documentation hosted on CPAN [9].

Using Official Docker Images

Netdisco community provides official docker images [10].

Using All-In-One Container For Development Purposes

I have created an all-in-one container [11] that can be used for development purposes.

Discovering Devices

After installing and configuring an instance of Netdisco, we can start discovering our devices.

Via Web Interface

Logging into the web interface, we are greeted with a simple interface:
Screenshot-2022-11-28-at-9.58.31

To initiate discovery, fill in Device hostname or IP with the DNS/IP of the device and press search. After pressing search you will be redirected to the Job Queue page.
(Job queue page is accessible manually Admin -> Job Queue)
Screenshot-2022-11-28-at-9.59.40-1

A discovery job will start on the provided node.
Screenshot-2022-11-28-at-19.33.11

If the node is connected to neighbors and is discoverable using LLDP/CDP, Netdisco will automatically attempt to discover them.
Screenshot-2022-11-28-at-19.34.35

Discovered nodes are now accessible using the search bar at the top of the page.Screenshot-2022-11-28-at-19.34.49

Clicking on a node redirects to a page containing gathered information of the node.Screenshot-2022-11-28-at-19.35.03

Via CLI

To initiate device discovery:

netdisco-do discover -d <DNS_OR_IP>

Command will wait until timeout or completion:

[22229] 2022-11-28 17:59:08  info App::Netdisco version 2.058003 loaded.
[22229] 2022-11-28 17:59:08  info discover: [<DNS_OR_IP>] started at Mon Nov 28 17:59:08 2022
[22229] 2022-11-28 17:59:41  info discover: finished at Mon Nov 28 17:59:41 2022
[22229] 2022-11-28 17:59:41  info discover: status done: Ended discover for <DNS_OR_IP>

Collected data can be viewed (available fields [12]:

netdisco-do show -d <DNS_OR_IP> -e c_platform
[22427] 2022-11-28 18:55:02  info App::Netdisco version 2.058003 loaded.
[22427] 2022-11-28 18:55:03  info show: [10.46.93.1]/c_platform started at Mon Nov 28 18:55:03 2022
{
    11623.5   "cisco WS-C3750G-24T",
    11624.1   "DS-C9148-32P-K9",
    11624.6   "cisco WS-C3750G-24T"
}
[22427] 2022-11-28 18:55:04  info show: finished at Mon Nov 28 18:55:04 2022
[22427] 2022-11-28 18:55:04  info show: status done: Showed c_platform response from <DNS_OR_IP>

Viewing Reports

Based on the gathered information, Netdisco offers built-in reports.

One of the basic reports is the Port utilization (Reports -> Port Utilization):
Screenshot-2022-11-28-at-21.13.54

Drawing Network Topology

After discovering devices, we can draw the network topology.
Search for the required node, click on Neighbors, and filter accordingly.
Screenshot-2022-11-28-at-22.08.41-1

Final Notes

This blog post covered a small part of Netdisco's reporting and capabilities.
For more information, please visit the Netdisco's homepage or git repository [13].


  1. Netdisco Homepage ↩︎

  2. SNMP (Simple Network Management Protocol) ↩︎

  3. Netdisco documentation - Custom Reports ↩︎

  4. Perl Hompage ↩︎

  5. PostgreSQL Homepage ↩︎

  6. Netdisco Documentation - Environment Variables ↩︎

  7. Netdisco Documentation - Configuration ↩︎

  8. Netdisco - config.yml ↩︎

  9. metacpan - App:Netdisco ↩︎

  10. Dockerhub - netdisco/netdisco ↩︎

  11. vkhitrin/netdisco-all-in-one ↩︎

  12. Netdisco - Snapshot.pm ↩︎

  13. Netdisco Git Repository ↩︎