How to Scan the Network Topology in a Computer Network

NetworkTopologyDiagram A Network Topology Diagram highlights the connections between switches and devices on the network.

Introduction

Understanding the network topology of a computer network is crucial for IT administrators and network engineers. It provides insights into how devices are connected, how data flows, and what dependencies exist. A clear view of the topology helps in several ways:

  • Troubleshooting Issues:
    When network problems occur, knowing the topology allows IT teams to identify affected areas quickly. For instance, if a switch fails, they can determine which devices and services are impacted and take appropriate action.
  • Optimizing Network Performance:
    A well-documented topology helps administrators balance network traffic, prevent bottlenecks, and ensure efficient data routing.
  • Security Management:
    Understanding the layout of network connections is essential for identifying potential security risks and implementing effective access controls.
  • Infrastructure Planning:
    As networks grow, having a topology map helps in adding new devices, upgrading infrastructure, and planning redundancy strategies to minimize downtime.

Without a clear understanding of the network topology, organizations risk inefficiencies, prolonged outages, and security vulnerabilities.

Methods to Obtain Network Topology

Network topology can be discovered using multiple techniques, including protocols such as LLDP, CDP, and analyzing the switch’s MAC forwarding table. Each method provides specific insights into network connections and can be used in combination for a complete topology view.

LLDP (Link Layer Discovery Protocol)

LLDP is an open-standard protocol used for network device discovery, defined by IEEE 802.1AB. It allows networking equipment such as switches, routers, and other devices to advertise their identity and capabilities to directly connected neighbors. LLDP-enabled devices periodically send LLDP data units (LLDPDUs) containing information such as:

  • System name and description
  • Port ID and description
  • VLAN assignments
  • IP management addresses
  • Device capabilities (e.g., switch, router, VoIP phone)

Since LLDP is vendor-neutral, it is widely supported across different hardware manufacturers, making it an essential tool for network topology mapping in heterogeneous environments. However, it is limited to directly connected devices, meaning deeper topology insights may require additional methods.

CDP (Cisco Discovery Protocol)

CDP is a proprietary protocol developed by Cisco for device discovery in Cisco networks. It functions similarly to LLDP but is specific to Cisco equipment. CDP-enabled devices exchange discovery messages containing details such as:

  • Device name and model
  • Software version
  • Interface information
  • IP addresses of directly connected devices

While CDP provides valuable information, it only works within Cisco networks. In mixed environments containing devices from other vendors, CDP may not provide a complete topology view. This can create blind spots in networks where both LLDP and CDP coexist but do not interact with each other.

MAC Address Table

The MAC forwarding table, also known as the MAC address table or forwarding database (FDB), is maintained by network switches. It records the MAC addresses of connected devices and the corresponding switch ports. This table helps in determining switch-to-end-device connections, as it shows which devices are connected to which ports on a switch. Unlike LLDP and CDP, which provide information about switch interconnections, the MAC forwarding table is essential for understanding the final hop to end devices.

When creating a network topology based on the mac forwarding table requires to get the mac address of the device connected to the switch. While that can easily be done in local networks using an ARP request.

This screenshot displays how to obtain the mac address for a device within the local network using the ARP command in order to build a network topology.

Obtain the MAC Address for a device within the same network using the ARP command

 

Network Topology: Challenges in Mixed Environments

In networks that include both LLDP and CDP-supported devices, topology discovery can become complex. Devices that only support CDP will not detect LLDP-enabled neighbors and vice versa. This can lead to gaps in topology information, making it difficult to get a comprehensive network map. In such environments, using a network discovery tool that consolidates information from multiple sources is essential. We didn’t find a good solution that works for all circumstances. Unfortunately, we have only heuristics that should work for most situations. So never expect a 100% accurate network topology resolution in mixed environments. However, if you have a pure LLDP or pure CDP environment, then you should be safe.

JDisc Discovery: An Efficient Network Topology Solution

JDisc Discovery provides a powerful solution for scanning and visualizing network topology. By leveraging LLDP, CDP, and MAC forwarding table data, JDisc Discovery can create detailed and accurate network topology diagrams. It automatically discovers devices, their connections, and dependencies, providing a clear view of the network structure. The ability to integrate information from mixed environments ensures comprehensive topology mapping, helping IT teams manage networks more effectively.

Displaying Raw CDP, LLDP, and MAC Address Tables

JDisc Discovery displays both raw data and also the network topology. The screenshot below displays the list of mac addresses. There are also other tabs displaying the raw CDP and LLDP tables. Those reports are very useful for troubleshooting network topology disocvery issues.

The MAC forwarding table for a switch.

Displaying the Network Topology in a Diagram

JDisc Discovery has a powerful diagram builder to visualize all kind of relationships between devices on the network. Following network topology is a great example of how to use the JDisc diagrams!

A Network Topology Diagram highlights the connections between switches and devices on the network.Conclusion

Understanding the network topology is vital for network management, troubleshooting, and planning. By utilizing protocols such as LLDP, CDP, and MAC forwarding tables, administrators can map out the network structure. However, mixed environments can present challenges due to protocol incompatibilities. JDisc Discovery simplifies this process by aggregating data from various sources and presenting a clear, visual representation of the network, making topology discovery efficient and hassle-free.

 

About The Author

Thomas Trenz
I own and manage JDisc and its network inventory and discovery products. Before I started JDisc, I worked quite a long time for Hewlett-Packard developing software for network assessments and inventory projects. Feel free to contact me on Linked-In or Xing.

Leave A Comment