Repository navigation
Update Spotter to comply with the Discovery Spec - #1487
Draft
khyatimahendru wants to merge 14 commits into
Draft
khyatimahendru wants to merge 14 commits into
khyatimahendru wants to merge 14 commits into
Conversation
…Upload - Add schema/upload_discovery.json defining DiscoveryUpload and ScanManifest for chunked packet capture streaming over upload/discovery. - Add 'upload' to SubType enum in schema/envelope.json and remove legacy schema/events_streams.json. - Regenerate Java and Python schema classes, HTML documentation, and .gencode_hash.txt. - Add schema validation fixtures under tests/schemas/upload_discovery/ and document depth: 'trace' in docs/specs/discovery.md and docs/specs/discovery_bacnet.md. - Ensure deterministic device ID ordering in SiteModel.getDeviceIds().
…entlib - Add --upload_pubsub_topic_id support in MqttToPubSubBridge to route subType='upload' messages to a dedicated Pub/Sub publisher with graceful shutdown draining. - Register uufi_upload flow in UdmiServicePod and udmis/etc/local_pod.json for local upload/# pass-through. - Add publish_upload helper to clientlib BaseManager and include upload/# in MessageConnection default subscribe topics. - Add unit tests in MqttToPubSubBridgeTest covering upload publisher routing and shutdown.
- Add PcapUploadHandler to reassemble gzip-compressed upload/discovery chunks in order, verify terminal SHA-256 digests, and archive .pcap and scan_manifest.json artifacts to GCS or local disk. - Exclude subType='upload' messages from RawFallbackHandler so raw PCAP chunks are never persisted in udmi_messages. - Add udmi_pcap_captures table in PostgresManager to track capture lifecycle metadata and URIs. - Add trigger_bacnet_trace and get_pcap_capture tools across Butler discovery, ButlerProvider, ButlerMcpServer, and ButlerClient with unit tests and schema docs.
…CAP streaming
- Enforce strict UDMI discovery depth compliance ('buckets', 'entries', 'system', 'details', 'trace') across Spotter providers and fail fast on non-canonical legacy depths.
- Emit canonical '<TYPE>/<INSTANCE>' BACnet refs, hyphenated object types and ancillary keys, explicit families.ipv4.port (47808), ARP-resolved families.ethmac, and routed MS/TP '<net>:<mac>' bindings.
- Decode BACnet/IP BVLL Forwarded-NPDU real controller IPs/ports behind BBMDs, NPDU SNET/SADR MS/TP headers, and I-Am-Router-To-Network DNET lists in PassiveFamilyProvider.
- Implement raw-socket (SOCK_RAW) BACnet Who-Is and Who-Is-Router-To-Network discovery rounds during depth: 'trace' without binding UDP 47808, and stream gzipped DiscoveryUpload chunks with SHA-256 and ScanManifest over upload/discovery.
- Update reassemble_pcap, compare_field_parity, Spotter documentation, and unit/integration test suites.
…odel - Lazily initialize Google Cloud Storage client in PcapUploadHandler._upload_to_gcs when BUTLER_PCAP_GCS_BUCKET is set and require sha256 on terminal EOF markers. - Guard SpotterDiscoveryManager against superseded scan generation races when active scans are cancelled or replaced. - Preserve BACnet I-Am enrichment and routed MS/TP re-emission across passive_sec holdoff intervals and bound I-Am-Router-To-Network parsing by bvlc_len. - Issue per-range BACnet Who-Is discovery calls instead of collapsing disjoint addrs ranges and validate Nmap target specifications. - Collect sorted device IDs into LinkedHashSet in SiteModel.getDeviceIds() and require connection spec in ButlerProvider.trigger_bacnet_trace.
- Wrap 101-character gracefulShutdown call in MqttToPubSubBridge.java to satisfy Checkstyle LineLength (<= 100 chars). - Code-quote protocol and compression terms (BVLL, BBMD, NPDU, MS/TP, DNET, gzip) in docs/specs/discovery.md, docs/specs/discovery_bacnet.md, and docs/tools/spotter.md for Docs Spelling Checks.
…it interface, exclude_capture_host, and I-Am manifest counts
1 task
khyatimahendru
added a commit
to khyatimahendru/udmi
that referenced
this pull request
Nov 27, 2026
…etsdn#1498 (FamilyDiscoveryConfig)
1 task
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overhauls the UDMI Spotter reference edge node (
edge/spotter/),upload/discoveryschema/transport, UDMISupload/#bridge routing, and Butler PCAP reassembly + MCP tools for strict UDMI discovery and ephemeral packet-capture (depth: "trace") compliance.Key changes in this PR:
upload/discovery): Spawnstcpdumpon an explicit host network interface (rejecting missing or"any"interfaces) and waits fortcpdumpreadiness before launching 3 broadcast-only raw-socket (SOCK_RAW, IPPROTO_UDP)Who-Isrounds spaced across the capture window (t = 0, T/3, 2T/3), withCAP_NET_RAWpre-flight validation, tail-buffered inlineI-Am/I-Am-Router-To-Networkdecoding, time- and size-based gzip chunk flushing, and optionaltrace.exclude_capture_hostBPF filtering.udmi.discovery.mode): Supports"full"(default; releasesBAC0UDP47808at the end of every scan and before trace) and"capture_only"(skipsBAC0registration and rejects non-traceBACnet scans with status500so Spotter can coexist with an external BACnet gateway on the same host).events_streamswithschema/upload_discovery.json(includingScanManifestdevice/duplicate counts), addsexclude_capture_hosttoschema/config_discovery_trace.json, routesupload/#in UDMIS, and addsPcapUploadHandler+trigger_bacnet_trace/get_pcap_captureMCP tools in Butler.Verification
edge/spotter/bin/run_spotter_tests unit— 98 unit tests + 3 self-tests passed (exit 0)bin/gencode check— schema/code/docs/presentation hashes verified (exit 0)bin/test_schema— schema fixture validation passed (exit 0)bin/test_generated_classes_py— 131 passed (exit 0)PYTHONPATH=".:common/src/main/python:gencode/python" venv/bin/python3 -m unittest discover -s butler/tests— 27 passed (exit 0)PYTHONPATH=".:common/src/main/python:gencode/python" venv/bin/python3 -m unittest tests/test_mcp_butler.py— 31 passed (exit 0)udmis/bin/build check && validator/bin/build check && pubber/bin/build check— all Java builds, JUnit suites, and Checkstyle passed (exit 0)bin/test_sites— all registrar site fixtures passed (exit 0)Author Declaration
Pull request created by Gemini