PNM File Retrieval Topologies¶
This page illustrates common network topologies for PNM file retrieval and how they map to the PnmFileRetrieval.retrieval_method.method setting in system.json.
Table Of Contents¶
Overview
Local File Retrieval With Local TFTP Server
SCP/SFTP File Retrieval With Remote TFTP Server
TFTP File Retrieval With Remote TFTP Server
Choosing A Topology With The Setup Script
Overview¶
Each topology shows how three components interact:
- Cable Modem (CM) - Generates PNM files (for example, RxMER, FEC summary, constellation).
- TFTP Server - Receives the PNM files from the CM.
- PyPNM Host - Retrieves the files from the server into the local
.data/pnmtree and performs decoding and analysis.
The selected topology is controlled by the PnmFileRetrieval.retrieval_method.method value in src/pypnm/settings/system.json (for example: local, tftp, scp, sftp).
Other methods (ftp, http, https) are currently stubbed in the configuration but not supported by the tools or helper scripts.
Local File Retrieval with Local TFTP Server¶
In this topology, the PyPNM host and the TFTP server are the same machine. The CM sends PNM files to a TFTP directory on the PyPNM host, and PyPNM uses a simple local file copy to ingest the captures.
Typical Lab use-case:
"PnmFileRetrieval": {
"retrieval_method": {
"method": "local",
"methods": {
"local": {
"src_dir": "/srv/tftp"
}
}
}
}
SCP/SFTP File Retrieval with Remote TFTP Server¶
In this topology, the TFTP server is remote (for example, on a CMTS lab host or a shared server), and PyPNM runs on a separate machine. The CM sends PNM files to the remote TFTP server; PyPNM then uses scp or sftp to pull the files down.
Typical Production use-case:
- Shared lab / production-like environments where TFTP is de-centralized.
- When SSH-based access is required for security or compliance.
"PnmFileRetrieval": {
"retrieval_method": {
"method": "scp",
"methods": {
"scp": {
"host": "tftp.example.com",
"port": 22,
"user": "pnm",
"password_enc": "",
"private_key_path": "",
"remote_dir": "/srv/tftp"
}
}
}
}
or:
"PnmFileRetrieval": {
"retrieval_method": {
"method": "sftp",
"methods": {
"sftp": {
"host": "tftp.example.com",
"port": 22,
"user": "pnm",
"password_enc": "",
"private_key_path": "",
"remote_dir": "/srv/tftp"
}
}
}
}
TFTP File Retrieval with Remote TFTP Server¶
In this topology, the PyPNM host retrieves files directly via TFTP from a remote TFTP server. The CM uploads PNM files to the remote TFTP server, and PyPNM pulls them using the tftp retrieval method.
Typical Production (Non-Secure) use-case :
- Simple environments where TFTP access from PyPNM is allowed.
- Legacy deployments that already use TFTP tooling and ACLs.
Note: PnmFileRetrieval.retrieval_method.tftp.remote_dir is typically left as an empty string. In most deployments, the TFTP root directory is already defined on the TFTP server itself, and remote_dir would only be used if you need to pull from a specific subdirectory beneath that root.
"PnmFileRetrieval": {
"retrieval_method": {
"method": "tftp",
"methods": {
"tftp": {
"host": "tftp.example.com",
"port": 69,
"timeout": 5,
"remote_dir": ""
}
}
}
}
Choosing A Topology With The Setup Script¶
Rather than editing system.json by hand, you can use the interactive setup script to select one of these topologies and populate the corresponding fields.
Directly run from the project root:
./tools/pnm/pnm_file_retrieval_setup.py
Script location on GitHub:
The helper will:
- Back up
src/pypnm/settings/system.jsonbefore any changes. - Ask which retrieval method you want (
local,tftp,scp,sftp). - Prompt for host, port, user, password, private key path, and remote directory where applicable.
- Update the
PnmFileRetrieval.retrieval_methodblock to match the chosen topology.
You can re-run the script at any time if your lab topology changes (for example, moving from a local TFTP server to a remote SCP/SFTP-based workflow).