Queries for connectivity information

These sample queries extract data on connectivity within your network.

Connectivity includes connections between different devices, and VLAN-related connections within the same device. In addition, the NCIM database independently represents connectivity of entities in different layers, so that the connectivity at layer 2 is represented independently of the connectivity at layer 3.

NCIM can model complex connectivity scenarios. For example, within the MPLS VPN realm, NCIM can model the layer 3 connection between a provider-edge (PE) router and multiple customer-edge (CE) routers.

Connectivity information is stored in the connects table. This table stores each connection as a single record. However, because two entities are involved in a connection, the order of the connected entities in the connects table is random.

For example, the following figures shows the devices that are connected to the main node device VE001.example.net.

Figure 1. Devices connected to main node device VE001.example.net 
Concept diagram that shows an example of logical sub-interfaces that are contained in a trunk port

The following table shows how the connects table might store the data about the connectivity between the device VE001.example.net and neighboring devices.

Table 1. Example data from the connects table for connections to main node device VE001.example.net 
connectionId aEndEntityId zEndEntityId
101 VE001.example.net 192.168.35.225
102 VE001.example.net 192.168.34.86
103 192.168.39.175 VE001.example.net

It is arbitrary whether a device is designated at the start (the aEnd) or at the end (zEnd) of a connection. The following example from Table 1 shows why:

  • Connections 101 and 102 show the device VE001.example.net at the aEnd of the connection.
  • Connection 103 shows the device VE001.example.net at the zEnd of the connection.

Connections in NCIM can be bidirectional or unidirectional. A field in the connects table that specifies whether the connection is bidirectional or unidirectional.

To ensure that all connections are retrieved from the connects table for a given device, the query must take into account the random ordering of aEnd and zEnd data in the table. This is done using a UNION statement. The query works as follows:

Find all devices connected to the device VE001.example.net where VE001.example.net 
is the aEnd of the connection
UNION
Find all devices connected to the device VE001.example.net where VE001.example.net 
is the zEnd of the connection