Networking InfiniBand Cluster Bring-up Procedure

Creating a Topology File

Topology File Generation

The topology file describes the physical connections between all cluster elements (switches, hosts, HCAs). It serves three purposes:

  • Documentation — standardized record of the planned topology

  • Validation baseline — serves as the reference for verifying deployed cabling. To confirm that the physical fabric matches the plan, the topology file must be compared against a live fabric discovery (e.g. using ibtopodiff against ibdiagnet2.lst or ibnetdiscover output). The topology file alone does not perform this verification.

  • Troubleshooting — maps and visualizes the topology when diagnosing issues

Scope: This procedure applies only to NDR (MQM9700 / ConnectX-7). For XDR (Q3400/ ConnectX-8) clusters, please refer to the Confirming Topology - XDR chapter in this document.

Prerequisites

Component

Details

Python

Version [pin exact tested version, e.g. 3.8+]

xlrd

Version [pin, e.g. 1.2.0] — must be <2.0 (xlrd ≥2.0 drops .xls support)

xlwt

Version [pin exact version]

ibutils2

Version [pin exact version] — provides ibdmchk for topology validation

IBNL model files

Correct .ibnl switch and HCA model definitions for your platform (e.g. MQM9700 for NDR, Q3400 for XDR). Must match the switch types in the PTP workbook. Location: [specify package or path]

PTP workbook

Completed Point-To-Point workbook in .xls format, including connection data with switch ports, host names, HCA port enumerations, and a Legend sheet (required by the parser)

Parser script

IB_Topology_files_data_for_RD.tgz version [pin exact version] — Download: [add exact internal URL]

Extract the parser:

tar xzf IB_Topology_files_data_for_RD.tgz

All pinned versions should be filled in from a known-working environment before using this procedure.

Understanding Port Identities

Three different port identities are used throughout this process. Do not confuse them:

Identity

Example

What It Is

PTP logical label

U1/P1

Enumeration used in the PTP workbook to number HCA ports per host. An arbitrary planning label — not a hardware identity.

Linux interface name

mlx5_3/P1

OS-assigned name for the HCA port. Based on PCI probe order and may vary across kernel versions, BIOS settings, or udev rules. Not a permanent physical identity.

Topology/IBNL model port

Defined in the .ibnl model file

The port identity used in the generated .topo file, determined by the IBNL switch/HCA model definition.

The hcaPortMapping dictionary in the parser script translates PTP logical labels → Linux interface names. The parser then maps these to the IBNL model ports in the generated topology file.

Step 1 — Verify the HCA Port Mapping

Inside parse_ptp_file.py (at the top of the source code), there is a dictionary named hcaPortMapping. It maps each PTP logical label to the corresponding Linux interface name.

hcaPortMapping = {
    'U1/P1': 'mlx5_3/P1',
    'U1/P2': 'mlx5_1/P1'
}

This means:

  • PTP label U1/P1 → Linux interface mlx5_3, port 1

  • PTP label U1/P2 → Linux interface mlx5_1, port 1

Verify the mapping for each server hardware profile — not just one representative node, unless all nodes in the cluster are physically identical in HCA placement and wiring.

For each hardware profile:

  1. SSH into a node of that profile.

  2. Identify each HCA by multiple attributes (OS name alone is not sufficient):

    Bash
    # HCA GUID, state, and port info
    ibstat
    
    # PCI location → interface mapping
    ls -l /sys/class/infiniband/*/device | awk -F/ '{print $(NF-2), $NF}'
    
    # Verify which switch port each local HCA port is connected to
    iblinkinfo | grep $(hostname)
    
    # Or from ibdiagnet output:
    grep $(hostname) ibdiagnet2.lst
    
    
  3. For each PTP label (U1/P1, U1/P2, …), confirm:

    • The correct Linux interface (mlx5_N)

    • The HCA GUID matches expectations

    • The PCI slot matches the physical HCA location

    • The connected switch peer port (from iblinkinfo or ibnetdiscover) matches the PTP plan

  4. Update the dictionary for any hardware profile that differs.

Step 2 — Pre-Generation Mapping Checks

Before running the parser, confirm the mapping passes these gates.

Generation must not proceed if any check fails.

Gate

Check

Fail Action

Completeness

Every PTP HCA label used in the workbook has exactly one entry in hcaPortMapping

Stop — add missing mappings

Uniqueness

No two PTP labels map to the same mlx5_N/P1 endpoint

Stop — resolve duplicate mappings

Model validity

Every mapped port exists in the selected IBNL model file for the HCA type

Stop — correct the mapping or update the IBNL model

Quick self-check:

Python
python3 -c "
from parse_ptp_file import hcaPortMapping
labels = list(hcaPortMapping.keys())
targets = list(hcaPortMapping.values())
print(f'Labels: {len(labels)}, Unique targets: {len(set(targets))}')
assert len(labels) == len(set(targets)), 'ERROR: duplicate target mapping detected'
print('Mapping OK - no duplicates')
"

Step 3 — Run the Parser Script

From the directory containing the script, IBNL model files, and PTP workbook:

python3 parse_ptp_file.py parse -f <ptp-workbook>.xls -of -mhp

Flag

Description

-f <file>

Path to the PTP workbook (.xls format required)

-of

Parse using the original PTP workbook format

-mhp

Translate PTP HCA port numbers (U1/Pn) to mlx5_N/P1 names using hcaPortMapping

Expected output:

  • output.topo — the generated topology file

  • ibdmchk validation output (run automatically by the script)

Generating output.topo alone does not mean success. You must check the ibdmchk result and pass all validation checks below.

Step 4 — Validate ibdmchk Results

Record the exact command (run by the script, or run manually):

ibdmchk -t output.topo

Acceptance criteria:

Outcome

Description

Action

Exit code 0, no errors, no warnings

Topology is valid

Proceed to Step 5

Exit code 0 with warnings

Topology parsed, but issues detected

Review every warning individually. Expected warnings (e.g. intentionally unused ports) must be documented and justified. Unexpected warnings must be resolved before proceeding.

Exit code ≠ 0, or parsing/model errors in stderr

Topology is invalid

Fatal — do not proceed. Fix the PTP data, mapping, or IBNL model files and regenerate.

Save the full ibdmchk output (stdout + stderr), it is a required archival artifact.

Step 5 — Post-Generation Validation Checks

5a — Authoritative Count Comparison

Compare the generated topology against the approved PTP workbook (the single source of truth for expected counts):

Check

Source of Truth

Method

Notes

Unique switch count

Count of unique switch names in PTP workbook

Count system header lines in .topo

Must be an exact match

Unique host count

Count of unique host names in PTP workbook

Count unique HCA system names in .topo

Must be an exact match

Unique endpoint pairs (cables)

Total cable count from PTP workbook

Count link lines (->) in .topo

Each connection appears once in the topology (from the switch side). Account for this when comparing against PTP row counts, which may list both endpoints.

Bash
# Count unique switches (system header lines)
grep -cP '^\S+.*CFG' output.topo

# Count unique hosts
grep -oP '(?<=-> )\S+ \S+' output.topo | awk '{print $2}' | sort -u | wc -l

# Count total links (endpoint pairs)
grep -c "\->" output.topo

5b — Structural Checks

Check

Method

Notes

Unresolved endpoints

Search for any system or port name that doesn’t match the IBNL model definitions

Any unresolved name is a failure

Duplicate endpoints

Extract all <system> <port> pairs and check for duplicates

Duplicates indicate PTP or mapping errors

Mapping translation

If -mhp was used, verify PTP labels have been translated to model port names

Some XDR topology models intentionally retain Uk/Pn notation — this is model-dependent, not universally an error

Link width/speed

Verify values are consistent with your platform design

4x-100G (NDR) and 4x-200G (XDR) are examples, not universal requirements — check against your specific design

Bash
# Check for duplicate endpoint pairs (should return nothing)
grep "\->" output.topo | awk '{print $1, $NF}' | sort | uniq -d

# List all unique system names for review
grep -oP '^\S+|(?<=-> )\S+ \S+' output.topo | sort -u

Step 6 — Rename and Archive

Rename the file with a meaningful convention:

mv output.topo <site>_<cluster>_topology_<YYYY-MM-DD>.topo

Mandatory archival checklist — store all items together in a shared, reachable location:

Artifact

Description

.topo file

The generated topology file

PTP workbook

The original, unmodified source .xls

Parser script

The complete edited parse_ptp_file.py (including your hcaPortMapping)

Mapping table

hcaPortMapping exported separately for quick reference

Dependency versions

Python version, xlrd version, xlwt version, ibutils2 version

IBNL model files

The .ibnl files used for the switch and HCA models

ibdmchk log

Full stdout + stderr from the validation run

Expected vs. actual counts

Switch count, host count, link count — expected (from PTP) and actual (from .topo)

File hashes

SHA-256 of the .topo file and source PTP workbook

Metadata

Site name, cluster name, date, operator

# Generate SHA-256 hashes
sha256sum <site>_<cluster>_topology_<YYYY-MM-DD>.topo <ptp-workbook>.xls > checksums.sha256

This topology file is used in subsequent stages including cable validation, fabric diagnostics, and maintenance verification.

Topology File Example

The following is an illustrative example. Exact system names, port identities, and link speeds depend on your platform, IBNL model, and hcaPortMapping. Replace with actual validated output from your generation run.

MQM9700 cl02s0lclf01 CFG : main=4x
    P1 -4x-100G-> HCA_mlx5_3 cl02s0ldgx01 P1
    P2 -4x-100G-> HCA_mlx5_3 cl02s0ldgx02 P1
    P3 -4x-100G-> HCA_mlx5_3 cl02s0ldgx03 P1
    P4 -4x-100G-> HCA_mlx5_3 cl02s0ldgx04 P1
    ...


When -mhp is used, the output should show the translated mlx5_N names — not the raw PTP labels (U1/Pn). If U1/Pn labels still appear in the output, the mapping was not applied correctly.


Saving the Topology File

After creating the Point-to-Point excel file and the topology file, make sure to save the file for future usage. 

If you do not save the file, you will have to repeat the cluster panning steps the next time you bring-up the cluster.

Facilitating the topology enables you to apply the master topology settings to the current topology, when the final topology is reached. This ensures that the fabric is in a consistent and optimal state. The master topology is a reference point that represents the desired state of the fabric. It can be set by selecting the latest topology or by uploading a predefined custom topology from a file.
Periodic comparison allows users to compare the current fabric topology with a preset master topology. By comparing the current topology with the master topology, users can detect any deviations, errors, or anomalies in the fabric and take corrective actions if needed.

Last updated: