Skip to content

nm: various additions to ADMs and some fixes - #104

Open
zebastian wants to merge 7 commits into
nasa-jpl:integrationfrom
zebastian:nm-sys
Open

nm: various additions to ADMs and some fixes#104
zebastian wants to merge 7 commits into
nasa-jpl:integrationfrom
zebastian:nm-sys

Conversation

@zebastian

@zebastian zebastian commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

sys:
Introduce a new "sys" Application Data Model for the NM agent/manager that reports host operating-system resource statistics: CPU count and utilization, load averages, physical/swap memory, disk capacity, open/ max file descriptors, process count, and uptime.

sdr heap and wm:
add working-memory and SDR heap usage EDDs to ionadmin ADM

fix memory leak for continious metric collection:
bound retained reports/tables with FIFO eviction

add more bundle metrics:
expose BP bundle-flow totals (count + bytes) as DTN/bp_agent EDDs

sys refinements:
gather stats always in byte (not in kb)
better mem usage estimation

Introduce a new "sys" Application Data Model for the NM agent/manager
that reports host operating-system resource statistics: CPU count and
utilization, load averages, physical/swap memory, disk capacity, open/
max file descriptors, process count, and uptime.

Register the ADM via dtn_sys_init() in adm_init.c and list it in
nm/doc/adms/index.json. Wire the new sources into both the autotools
build (Makefile.am) and the development build (Makefile.dev).

Also adds nm-unit coverage (tests/nm-unit/dotest.c) exercising every sys
collector for non-NULL typed values plus sanity bounds on Linux hosts.
Expose six new externally-defined data items on the dtn/ion/ionadmin
ADM so a manager can monitor a node's memory pressure:

working_memory_{total,free,used} - ionwm partition (psm_usage)
heap_{total,free,used}           - SDR heap (sdr_usage)

Free space is reported as small-pool + large-pool + never-allocated
regions, matching ionadmin's own accounting. All values are UVAST
bytes. Heap figures are read inside a read-only SDR transaction;
both getters return zero when the partition/SDR is unavailable.
agent->rpts and agent->tbls use auto-growing vectors, so vec_push()
never reported "full" and the old "discard on full" path was dead:
retained reports/tables accumulated without bound and leaked ION
working memory. Add vec_pop_front() (insertion-order FIFO removal,
permitted on stack-mode vectors) and use it in rx_data_rpt/rx_data_tbl
to evict the oldest entry once AGENT_DEF_NUM_RPTS/_TBLS is reached.

Also fix the rx_data_tbl unknown-sender warning to print
senderEid.name rather than the eid_t struct.
Add scalar EDDs to the DTN/bp_agent ADM for the node's lifetime bundle-flow
counters, each as both a bundle count and a byte count: sourced, forwarded,
transmitted, received, delivered and expired (EDDs 0x1d-0x28).

ION already tracks these but only via the by-priority map EDDs (0x09-0x0c),
The new collectors mirror libbpP.c reportStateStats(): sourceStats/xmitStats
/recvStats are summed across the three priority tallies, forwarded/expired
read the BP_DB_FWD_OKAY/BP_DB_EXPIRED dbStats tallies, and delivered is
aggregated over every endpoint of every scheme.
sysinfo(2)'s freeram counts only wholly-unused pages and ignores the
page cache and other reclaimable memory, badly underestimating free
RAM (and overestimating used RAM). Read the kernel's MemAvailable
estimate from /proc/meminfo instead, falling back to freeram on
kernels too old to publish it.
All byte-valued EDDs (mem/swap/disk total/free/used) now report bytes
instead of KiB, so the ADM no longer mixes orders of magnitude. The
EDD ids, getters, manager metadata, JSON and unit test are renamed
from the _kb suffix to _bytes accordingly.
@zebastian zebastian changed the title nm: add DTN/sys ADM exposing host OS resource statistics nm: various additions to ADMs and some fixes Jun 15, 2026
@zebastian

zebastian commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

see also prepared integration to the munin stats monitoring tool in a timeshifted way here:
https://github.com/zebastian/nm2munin
192 168 122 10_munin_dtn_comparison-day html (1)

@zebastian zebastian mentioned this pull request Jun 16, 2026
@zebastian

Copy link
Copy Markdown
Contributor Author

@edbirrane / @NasaDtn

  • please let me know, what you think about the above.
  • In case the sys adm / EDD additions are ok: Please let me know whether/how this should be added to the IETF process

…restart

Resume the rotation sequence across restarts: agent_next_log_num()
scans the log directory and continues after the highest existing file
number instead of reopening "0.log" in append mode and clobbering the
prior run's output.

Add a per-agent retention limit on rotated report/table log files so a
long-running Manager doesn't accumulate them unbounded. New -N /
--log-max-files option (default 100, 0 = unlimited) sets the cap; on each
rotation agent_prune_logs() deletes any of the agent's files whose rotation
number is more than max_files behind the newest.

Document -N in nm_mgr.pod and the usage text.
@SkyDeBaun

Copy link
Copy Markdown
Collaborator

Hi @zebastian ,
this looks very cool.

Will need to take some time to delve into this.
Regarding the IETF.. I do wonder what the standard states, or implies, regarding host metrics (am not sure at the moment).

Its certainly desirable information so I imagine that it has been considered.
But also it is possible that this information is already accounted for via different methods.

Will need to consider this after some research.

Also.. am curious about your testing methodology.
What does that look like?

@zebastian

Copy link
Copy Markdown
Contributor Author

thanks @SkyDeBaun

regarding host level metrics defined in IETF:

the only non-outdated draft i could find with specific edds is: draft-birrane-dtn-adm-agent
The are 8 outdated drafts for edds:
draft-birrane-dtn-adm--*

draft-birrane-dtn-adm-agent-05
draft-birrane-dtn-adm-bp-03
draft-birrane-dtn-adm-ltp-01
draft-birrane-dtn-adm-bpsec-01
draft-birrane-dtn-adm-ion-bpadmin-01
draft-birrane-dtn-adm-ion-ipnadmin-00
draft-birrane-dtn-adm-ionadmin-01
draft-birrane-dtn-adm-ionsec-01

which are the ones the currently present adms implement, but those are all ion-dtn internal metrics.

Maybe Mr Birrane can give some insight on this, or even rate the suggestions in this pull request.

regarding test setup (used for the screenshot):

@SkyDeBaun

Copy link
Copy Markdown
Collaborator

@zebastian - follows is some relevant information you may find useful.

APL has pivoted once more from NM/AMP to ANMS.
ANMS has moved from v1.0 to v2.0.

The IETF standards have changed (i.e. ANMS v1.0 & ION are not currently in alignment with those changes.
The changes include updates to ADM and ARI.

Now.. ANMS v1.0 (a containerized NM management "interface" - supporting a GUI and API tightly coupled with ION) could issue commands and request reports to/from remote ION nodes (to include the current 4.2.0).

ANMS v2.0 has moved to become implementation agnostic.
As mentioned above.. it no longer "speaks" the same ADM and ARI.

But.. thats not necessarily problematic because it has its own ARI processing library (and each implementation is expected to have their own implementation-specific ADM.

However, the required C bindings needed to interface with ION (via ANMS' CACE and distinct ION separated agent and manager services) remains to be.. developed.

In any case see the DTNMA Tools repo here (has links to updated draft IETF docs):
https://github.com/JHUAPL-DTNMA/dtnma-tools

And for your further elucidation:
https://github.com/NASA-AMMOS/anms

I'll try to make time soon to perform an investigation into your proposed updates here.

@edbirrane

Copy link
Copy Markdown

@zebastian Glad to see this kind of integration! My suggestion is to create a host-os resources ADM. I think this is needed and like your approach (to the extend I have reviewed to date).

I would encourage you to join the next DTNWG meeting in July (it will be taking place in Vienna, but you can also join remotely) and to register and put comments in the IETF DTNWG mailing list, which is open to all.

It is important to note that - as part of the IETF standards process - we are making syntactic updates to the YANG encoding of ADMs at the request and direction of the NETMOD and NETCONF WG's.

@SkyDeBaun Just to be clear APL did not pivot from NM/AMP to ANMS. Standards related to DTN network management are being advanced in the IETF and as part of the process it was determined that DTN network management should be branded as "DTNMA" the architecture for which is published in RFC 9675: https://datatracker.ietf.org/doc/rfc9675/. Within that ecosystem, AMP is a bundle protocol binding of ARIs.

ANMS is an open-source, NASA-supplied reference implementation of these standards.

@SkyDeBaun

Copy link
Copy Markdown
Collaborator

@edbirrane Appreciate the precise architectural breakdown and the RFC link! Glad to keep the terminology straight—things are moving fast out here.

@zebastian Thanks for detailing the KVM and Munin setup—that bridge approach is a really slick way to visualize node telemetry.

@zebastian

Copy link
Copy Markdown
Contributor Author

@SkyDeBaun
Thanks for your feedback, I have used munin now over a decade for stats monitoring, and it helps a lot to get an understanding of how a software / machine behaves (or misbehaves) over time.

@edbirrane
Thanks for the invite. I probably cannot attend in person, but I might be able to join remotely.
I can prepare some notes regarding possibly relevant os level metrics, though i am by no means an expert on the monitoring side.

@SkyDeBaun

Copy link
Copy Markdown
Collaborator

@zebastian I still need to find some time to delve into this PR. I think the memory monitoring features alone are quite nice.. and as you say, such capabilities provide much insight (vs raw data).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants