Layer 2 relationships not created for LLDP-discovered neighborsIssue When Discovery runs the Network Switch pattern with LLDP (Link Layer Discovery Protocol) neighbor detection enabled, neighbor information is successfully collected—but **"Connects To::Connected By" relationships (cmdb_rel_ci) are not created** in the CMDB, even though: - Neighbor device names and CI records exist in the CMDB - Neighbor information is stored in `discovery_device_neighbors` - No errors appear in the Discovery logs Symptoms The L2 Mapping algorithm that creates relationships requires **both** of the following to be populated in each `discovery_device_neighbors` record: - `neighbor_address` (IP address) - `neighbor_interface` (interface name) **At least one** of these must be non-empty for a relationship to be created. LLDP-derived neighbors often arrive with an empty `neighbor_address` because: 1. **IEEE 802.1AB specification** treats the Management Address Type-Length-Value (TLV) as **optional** 2. Many neighbor devices (especially in multi-vendor environments) do not send the Management Address TLV 3. Discovery has no way to populate the neighbor IP when this TLV is absent In contrast, **CDP** (Cisco Discovery Protocol) always includes the neighbor's primary IP address by design, so this issue does not occur in CDP-only environments or when CDP is running alongside LLDP. Facts ## Why This Matters Without L2 relationships: - Service Mapping cannot trace network paths through your infrastructure - Impact analysis and dependency visualization are incomplete - Network topology is fragmented in your CMDB ## Verify This Is Your Issue 1. Go to **Discovery** > **Inventory** and view a recent Horizontal Discovery run 2. Navigate to the discovery log for your Network Switch pattern 3. Check **discovery_device_neighbors** table for the affected CI 4. Filter by the CI name and look for records where: - `neighbor_id` is populated (neighbor hostname is known) - `neighbor_address` is **empty** - `neighbor_interface` is empty or incomplete If these conditions match, this article applies to you. Release Zurich or later versions. Resolution ## Solutions ### Solution 1: Enable Management Address TLV on Neighbor Devices (Recommended) Enable your neighbor devices to send the Management Address TLV in LLDP frames. This is the permanent fix. **Cisco IOS:** ``` interface <name> lldp tlv-select management-address ``` **Juniper Junos:** ``` set protocols lldp management-address ``` **Other vendors:** Consult your device documentation for the equivalent LLDP TLV setting. After enabling, re-run Discovery on the affected devices. New `discovery_device_neighbors` records should include the neighbor IP, and L2 relationships will be created automatically. ### Solution 2: Use CDP Instead of (or Alongside) LLDP If your devices support Cisco Discovery Protocol (CDP), enable CDP neighbor detection in your Discovery pattern. CDP always includes neighbor IP addresses. **Note:** This solution requires devices that support CDP and may not be available in strict multi-vendor environments. ### Solution 3: Custom L2 Mapping Strategy (Advanced) ServiceNow provides an extension point for custom L2 relationship creation: `JavaScriptLayer2ConnectionStrategy`. See **KB0683837** for technical details. This approach allows you to create relationships based on neighbor hostname alone, but requires: - Script Include development - Testing and maintenance through upgrades - Support responsibility for custom code **Contact ServiceNow Professional Services** if you need assistance implementing this customization. Related Links - **KB0683837** — Discovery of Layer 2 Network Connectivity (Physical Connections): https://support.servicenow.com/kb_view.do?sys_kb_id=f2c51830db818990904fa9fb139619b3 - **KB0826530** — Invalid discovery_device_neighbors or incorrect L2 Mapping: https://support.servicenow.com/kb_view.do?sys_kb_id=f74808dfdb399850b1b102d5ca9619a1