Testing and interop
The OT Fabric BACnet projects are tested against independent open-source BACnet stacks running in containers, and their requests are checked against Wireshark’s dissector. This is strong evidence of protocol correctness. It is not evidence about any vendor’s controller.
bacnet-interop: the reference stacks
Section titled “bacnet-interop: the reference stacks”bacnet-interop provides Dockerized BACnet/IP devices built from independent implementations, deterministic device fixtures, BBMD and routed-network scenarios and codec test vectors. It is maintained independently of go-bacnet and can be used by any BACnet client, and since v0.12.0 by any BACnet server too. The adapters never patch an upstream stack: they load a fixture, start the stack’s own server, and supply an object or service in adapter code only where the stack has none, which the capability matrix marks.
Latest release: v0.15.0 (container contract 1.1). go-bacnet v0.8.0 pins the eleven images of v0.14.0 by digest; v0.15.0 rebuilds them from the same pins and adds an image of OT Fabric’s own stack (below). v0.13.0 added cB-Sigma; v0.14.0 added ulbios/bacnet, legacy BACpypes and @bacnet-js/client, each as a device and as a client.
| Image | Upstream | Role |
|---|---|---|
bacnet-interop-bacnet-stack |
bacnet-stack 1.6.1 (C) | Device oracle (+ BBMD) |
bacnet-interop-bacpypes3 |
BACpypes3 0.0.110 (Python) | Device oracle (+ BBMD) |
bacnet-interop-bacnet4j |
BACnet4J 6.1.1 (Java) | Device oracle (+ BBMD) |
bacnet-interop-worldiety |
worldiety/bacnet 3cb2aa80 (Go) |
Native transport and APDU layer; the adapter supplies the object model |
bacnet-interop-sysiobacnet |
System.IO.BACnet, NuGet BACnet 4.0.0 (C#) |
Device oracle; the stack behind YABE |
bacnet-interop-cbsigma |
cB-Sigma bacnet v0.2.0 device role and bacnet-sim v0.1.0 (Go, Apache-2.0) | Device oracle; the simulator (CBSIGMA_ROLE=sim) adds ReadRange, alarms, a BBMD and fault switches for segmentation (new in 0.13.0) |
bacnet-interop-bacpypes |
Legacy BACpypes 0.19.0 (Python, PyPI bacpypes; the asyncore predecessor of BACpypes3) |
Device oracle (+ BBMD) and client (new in 0.14.0) |
bacnet-interop-ulbios |
ulbios/bacnet 227d6227 (Go, MIT, no upstream releases) |
A small codec library (Who-Is, I-Am, ReadProperty, WriteProperty); the adapter supplies the object model. Device and client (new in 0.14.0) |
bacnet-interop-bacnet-js |
@bacnet-js/client 3.3.2 (TypeScript on Node.js, MIT) | Device, with an adapter object model, and client (new in 0.14.0) |
bacnet-interop-bacnet-stack-router |
bacnet-stack 1.6.1 apps/router (C) |
Native BACnet/IP to BACnet/IP router |
bacnet-interop-bip-router |
none (Python, written for the tests) | Topology aid for routed scenarios; not evidence about any stack |
Fixtures
Section titled “Fixtures”Device models live under fixtures/device/ and are selected with DEVICE_FIXTURE_FILE and FIXTURE. Every device image serves device-baseline-v2 by default.
| Fixture | Adds | Served by |
|---|---|---|
| v1 | Device, Analog Value, Binary Value (frozen) | All device peers |
| v2 | Trend Log (default) | All device peers (BACpypes3 skips the Trend Log) |
| v3 | Notification Class, Event Enrollment, alarms | bacnet-stack, BACnet4J; System.IO.BACnet with an adapter alarm model |
| v4 | File objects | bacnet-stack, BACnet4J, System.IO.BACnet |
| v5 | Object lifecycle and list mutation | bacnet-stack, BACnet4J |
| v6 | Messaging and time synchronization | bacnet-stack, BACpypes3, BACnet4J |
| v7 | Identity (Who-Am-I / You-Are) | bacnet-stack |
| v8 | Life safety | bacnet-stack, BACnet4J |
| v9 | 40 more objects; an Object_List that does not fit a 50-octet APDU | bacnet-stack only |
fixtures/codec/ holds wire vectors for go-bacnet’s codec tests; fixtures/topology/ and fixtures/bbmd/ hold the routed and BBMD scenarios.
Consumer contract
Section titled “Consumer contract”Every image writes JSON Lines to stdout. The first line is the ready event, written once the BACnet/IP socket is bound:
{"event":"ready","adapter":"bacnet-stack","version":"0.15.0","fixture":"device-baseline-v2","address":"0.0.0.0:47808","peer_version":"bacnet-stack-1.6.1"}Some adapters then write operation events for requests that have no observable reply (for example time synchronization). Diagnostics go to stderr. A consumer pins images by digest from the release’s manifest.json:
# by tag, for a quick local runBACNET_STACK_IMAGE=ghcr.io/otfabric/bacnet-interop-bacnet-stack:0.15.0# by digest, for CIBACNET_STACK_IMAGE=ghcr.io/otfabric/bacnet-interop-bacnet-stack@sha256:<digest>Building and checking the images
Section titled “Building and checking the images”make validate-fixtures # manifest, schemas, fixture metadatamake dissect-fixtures # codec vectors against Wireshark's dissector (needs tshark)make build # all adapter images as bacnet-interop-<name>:localmake smoke # ready event (and a Who-Is probe) per imagemake ci # validate-fixtures + build + smokemake build-<name> builds one image. Published images are linux/amd64 and linux/arm64.
Client mode: testing a server
Section titled “Client mode: testing a server”Since v0.12.0 the bacnet-stack, BACnet4J and BACpypes3 images also run as clients against a device under test, each with the unmodified upstream stack: the bacnet-stack 1.6.1 command-line tools (built without segmentation), BACnet4J’s LocalDevice and RemoteDevice requests, and BACpypes3’s Application. v0.14.0 adds three more: legacy BACpypes’ Application, @bacnet-js/client’s BACnetClient, and ulbios/bacnet, which sends Who-Is, ReadProperty and WriteProperty only.
client --target HOST:PORT --device N --scenarios FILE # one client-result-line-v1 JSON line per scenario--broadcast, --bbmd and --fd-ttl (foreign-device registration) are options; BACNET_CLIENT_TIMEOUT_MS and BACNET_CLIENT_RETRIES tune the client. Four scenario files ship with JSON Schemas, plus the device fixture device-server-v1 for a server under test (a Notification Class with a recipient, a Trend Log, stream and record files, creatable and deletable objects):
| Scenario file | Covers |
|---|---|
server-baseline-v1 (23) |
Discovery, ReadProperty, ReadPropertyMultiple, WriteProperty, WritePropertyMultiple and their errors |
server-services-v1 (36) |
COV, ReadRange, DeviceCommunicationControl, ReinitializeDevice, files, lists, object creation and deletion, alarms, time synchronization, private transfer, WriteGroup |
server-bbmd-v1 (5) |
Foreign-device registration, BDT, FDT |
server-extended-v1 (23) |
Segmented requests and replies, SubscribeCOVProperty and SubscribeCOVPropertyMultiple, GetAlarmSummary, GetEnrollmentSummary, text messages, ConfirmedPrivateTransfer |
A result is pass, fail, infra-error, unsupported (the client stack does not send that service) or known-difference (a recorded behaviour of the client stack, in PEER_SUPPORT.md). make client-matrix runs every client image against the bacnet-stack device in CI, and the three new clients against the three new devices; EXPECTED_DIFFERENCES lists the scenarios each new pair answers differently, with the reason.
Test your stack against OT Fabric’s
Section titled “Test your stack against OT Fabric’s”ghcr.io/otfabric/bacnet-interop-otfabric is go-bacnet behind the same container and client-driver contracts as the reference images (adapter name otfabric), new with bacnet-interop v0.15.0. It runs as a device, as a BBMD (BACNET_BBMD=1) and as a client, so you can test your BACnet client or server against it, the way OT Fabric tests its own stack against yours:
docker run --rm -p 47808:47808/udp ghcr.io/otfabric/bacnet-interop-otfabric:<tag>docker run --rm --network host ghcr.io/otfabric/bacnet-interop-otfabric:<tag> \ client --target 192.0.2.10:47808 --device 1234 --scenarios /scenarios/server-baseline-v1.jsonAs a device it serves device-baseline-v1, -v2, -v4, -v5, -v6, -v9 and device-server-v1. The fixtures with Event Enrollment (v3), Audit Log (v7) and life safety objects (v8) are refused at start, because go-bacnet’s server has no constructor for those object types, so the image never serves part of a fixture. In client mode it runs every scenario file.
Its tags are go-bacnet versions, such as v0.8.0, and latest; a rebuild of a version replaces its tag, so pin the digest when you need an exact build. It is not part of a bacnet-interop release or its manifest.json, and it reports independentEngine: false: a result against it tells you about your stack, not something independent about OT Fabric’s. A result you publish, naming your implementation and version, is independent evidence. It is an unauthenticated device that answers WriteProperty, DeviceCommunicationControl and ReinitializeDevice, so it is for testing only and has no place on a network you do not control.
go-bacnet also runs its current code against the image of its latest release, in both roles, in a manual self-interop workflow. That catches regressions between releases; it is not independent evidence either.
Running the go-bacnet interop tests
Section titled “Running the go-bacnet interop tests”go-bacnet owns the assertions (interop/, build tag interop); bacnet-interop owns the images and fixtures. CI pulls the release pinned in interop/bacnet-interop-pin.json by digest, and a second lane builds the adapters from bacnet-interop main.
-
Install Docker and jq, and check out
go-bacnetandbacnet-interopside by side (or setBACNET_INTEROP_ROOT). -
From the go-bacnet checkout, run the target you need:
Terminal window make interop-pinned # pull the pinned images, run everything, fail on anything missingmake interop # run against locally built :local images, skip what is missingmake dissector # check the client's requests against Wireshark (needs tshark, no Docker) -
Select tests with
INTEROP_RUN, for examplemake interop-pinned INTEROP_RUN='TestReadRange'.interop/doc.golists the environment variables.
Each test starts its own peer container. On Linux the tests talk to the containers directly; on Docker Desktop each test re-executes inside a Go container on the peer’s network, and a full run takes eight to nine minutes. A peer that behaves differently is not skipped: the difference is asserted, so a change in the peer is noticed.
Against the published v0.14.0 images nothing fails; the skips are things a stack does not have and scenarios that need a newer adapter release. go-bacnet’s docs no longer give a total count; the last recorded one, against the v0.10.0 images, was 206 scenarios pass, 11 skip.
What is validated: the client
Section titled “What is validated: the client”go-bacnet grades its evidence: ✅ the peer stack executes the service and the result is asserted; A the adapter supplies the semantics; D codec evidence only (a stack’s decoder or encoder agrees, nothing executes); W only Wireshark checks the request layout.
| Area | Evidence |
|---|---|
Who-Is / I-Am, broadcast Discover, Who-Has |
Multi-peer, every device stack (Who-Has not with ulbios) |
| ReadProperty, ReadPropertyMultiple (with per-property errors), WriteProperty | Multi-peer |
| WritePriority / RelinquishPriority | BACpypes3, BACnet4J, System.IO.BACnet, cB-Sigma |
ReadRange by position, sequence number and time; ReadRangeAll |
bacnet-stack, BACnet4J, the cB-Sigma simulator (others through adapters) |
| Atomic file read and write, CreateObject / DeleteObject, list element services | bacnet-stack, BACnet4J |
| SubscribeCOV with renewal and cancel | bacnet-stack, BACpypes3, BACnet4J, cB-Sigma |
| GetAlarmSummary, GetEventInformation, AcknowledgeAlarm | bacnet-stack, BACnet4J |
| Segmented ComplexACK receive | BACpypes3, BACnet4J, System.IO.BACnet, cB-Sigma (receive windows 1, 2, 4 and 16) |
| Segmented request send | BACpypes3, System.IO.BACnet, cB-Sigma (BACnet4J rejects segmented requests) |
| Routed device through bacnet-stack-router and bip-router | Multi-peer |
| Foreign-device registration, Read-BDT, Read-FDT, Delete-FDT entry | bacnet-stack, BACpypes3, BACnet4J; registration, Distribute-Broadcast-To-Network and its NAK with the cB-Sigma simulator |
| Faults: a segment left out, a segmented answer stopped, RPM and WPM rejected | The cB-Sigma simulator’s fault switches. A left-out segment is recovered with a receive window of 4; with a window of 1 the client times out, because the simulator never resends on its own |
| SubscribeCOVPropertyMultiple, COVNotificationMultiple, audit, VT | Codec evidence only |
| AuthRequest | No stack implements it; each peer’s refusal is asserted |
The make dissector oracle captures 45 requests and has Wireshark’s tshark dissect them, verified with Wireshark 4.2, 4.4 and 4.6. It checks requests only, and agreement with Wireshark is not acceptance by a device.
Peer behaviour worth knowing
Section titled “Peer behaviour worth knowing”The tests pin down differences between stacks that also matter on real networks:
- Do not rely on the Device wildcard (instance 4194303) to identify a device: BACpypes3 and the Worldiety adapter answer
unknown-object. - Do not treat a clear MORE_ITEMS flag as the end of a trend log; page until LAST_ITEM.
- Expect a refusal as an Error or an Abort.
- Do not assume a failed WritePropertyMultiple names the element that failed, and assume the writes before it were applied.
- bacnet-stack cannot send segmented replies; BACnet4J rejects segmented requests.
- The peers differ in which broadcast address they receive (subnet-directed or 255.255.255.255), so go-bacnet sends both.
- Legacy BACpypes sends segments of Max APDU octets of service data plus the 5-octet header, 1481 octets to a client that accepts 1476, rejects a value of the wrong datatype with Reject invalid-tag, and answers FDT remaining time with TTL + 5 instead of + 30.
- ulbios/bacnet does not answer what it cannot decode where the standard asks for a Reject or Abort, and encodes Unsigned in two octets.
- bacnet-js encodes a GetAlarmSummary ACK with context tags where clause 13.10.2 has application tags, which go-bacnet refuses, and cannot send a segmented answer.
Legacy BACpypes found that the go-bacnet client dropped its oversized segments and timed out; v0.8.0 receives APDUs up to the datagram bound by default, as the server does, while still advertising at most 1476 octets. Wiring its BBMD scenarios also exposed a foreign device that gave its registration’s BVLC-Result to a BDT or FDT read made while the registration was pending, fixed in v0.8.0. With a receive window above 1, go-bacnet up to v0.5.x did not acknowledge segment 0 of a segmented answer, so every one timed out; cB-Sigma and BACpypes3 found it, and v0.6.0 fixed it. Earlier peer tests found real defects in go-bacnet, all fixed in v0.4.0: broadcasts only to 255.255.255.255, unreadable empty lists, ReadRangeAll stopping after one page, audit codec mismatches, dropped Errors with a foreign error-choice, and swapped Router-Busy and Router-Available codes.
What is validated: the server
Section titled “What is validated: the server”go-bacnet tests its server three ways. The go-bacnet client drives it over loopback UDP (e2e/server*_test.go), including every built-in object type read with ReadPropertyMultiple ALL. Every datagram the server sends in those tests is dissected by Wireshark (make dissector), except Abort and SegmentACK frames. And six independent clients drive it from bacnet-interop v0.14.0 client-mode containers (TestBACnetStackClientAgainstServer, TestBACnet4JClientAgainstServer, TestBACpypes3ClientAgainstServer, and since go-bacnet v0.8.0 TestBACpypesClientAgainstServer, TestBacnetJSClientAgainstServer and TestUlbiosClientAgainstServer):
| Client | server-baseline-v1 (23) |
server-services-v1 (36) |
server-bbmd-v1 (5) |
server-extended-v1 (23) |
|---|---|---|---|---|
| bacnet-stack 1.6.1 tools | All pass | 35 pass, 1 known difference | All pass | Not run: built without segmentation |
| BACnet4J 6.1.1 | All pass | All pass | 2 pass, 3 unsupported | 22 pass, 1 known difference |
| BACpypes3 0.0.110 | All pass | 35 pass, 1 known difference | All pass | 15 pass, 5 known differences, 3 unsupported |
| Legacy BACpypes 0.19.0 | All pass | All pass | All pass | 20 pass, 3 unsupported |
| @bacnet-js/client 3.3.2 | 21 pass, 2 known differences | 29 pass, 5 unsupported, 2 not tested | 2 pass, 3 unsupported | 13 pass, 9 unsupported, 1 not tested |
ulbios/bacnet 227d6227 |
5 pass, 5 known differences, 13 unsupported | 4 known differences, 32 unsupported | 1 known difference, 4 unsupported | 2 known differences, 21 unsupported |
None fail. The known differences are limits of the client stacks: bacnet-stack’s bacrle prints nothing for a RemoveListElement acknowledgement (the removal is checked by reading Recipient_List back), BACnet4J decodes SubscribeCOVPropertyMultiple-Error as a CHOICE, and BACpypes3 cannot decode a ChangeList-Error, an Error of SubscribeCOVProperty or an empty GetAlarmSummary or GetEnrollmentSummary acknowledgement, and has no SubscribeCOVPropertyMultiple. bacnet-js decodes a WritePropertyMultiple-Error with its plain Error decoder, so the first failed write is lost. ulbios only sends Who-Is, ReadProperty and WriteProperty, cannot decode a CharacterString or a ReadProperty-ACK shorter than its own, and its WriteProperty carries a REAL followed by a NULL, which the server refuses with invalid-data-type as clause 15.9.1.1.3 asks. Legacy BACpypes has no APDU for SubscribeCOVPropertyMultiple.
Not covered by any independent client: BBMD-to-BBMD forwarding, an empty GetEventInformation reply, and the object types outside device-server-v1 (Calendar, Schedule, Structured View and the value types are verified against the go-bacnet client only). Where the standard leaves an error code open the server follows bacnet-stack, so agreement on those codes is partly by construction. make chaos adds concurrent requesters, retransmissions and junk under -race, and FuzzServerReceive and FuzzHandleBVLC run in make fuzz and nightly.
The client runs found defects in the server, fixed before v0.6.0: a request repeated after its response was answered from a cache instead of being executed, AtomicWriteFile past the end of a file was refused, segment 0 of a segmented request was not acknowledged at once when the window was above 1, and BACpypes3’s segments, 6 octets longer than the server’s Max APDU, were dropped.
Recorded traffic of physical devices
Section titled “Recorded traffic of physical devices”Since v0.7.0 go-bacnet is also tested against 234 packet captures of physical BACnet devices, from kargs.net/captures and EmreEkin/ICS-Pcaps, committed byte for byte in testdata/captures. 38 of them identify the device by model and firmware, among them Trane Tracer SC and UC400, Tridium NiagaraAX, Reliable Controls, Delta Controls, Alerton, WattStopper and Lithonia. Every suite runs over every capture in make test: about 287,000 datagrams decoded and encoded again, about 124,000 confirmed transactions replayed by the client and 10,163 server answers equal to the recorded devices’, with the rest classified. 20 golden cases compare 1,072 datagrams field by field with Wireshark. The captures found three defects, fixed in v0.7.0: ReadRange on a Trend Log Multiple or an Event Log, ReinitializeDevice backup states acknowledged without a procedure, and an extended event notification with an empty parameter list.
This is offline evidence of how real controllers encode and answer. It is not a test against a live device.
bacnetctl testing
Section titled “bacnetctl testing”bacnetctl runs every command automatically against an in-process simulated device (internal/bactest) over loopback, in all three output formats. That proves commands, output and exit codes, but client and simulator share go-bacnet’s codecs, so it does not prove interoperability. Before 0.1.0 the commands were also run by hand against the five stacks of bacnet-interop v0.10.0 plus bacnet-stack’s router. events was tested against the simulated device only.
server run (bacnetctl v0.4.0) was run by hand against the same three client modes of bacnet-interop v0.12.0, serving the device fixture each scenario file needs. The baseline, services and BBMD files pass as for the library, apart from the client stacks’ known differences and unsupported services. In server-extended-v1 the text message and private transfer scenarios fail by design (three for BACnet4J and for BACpypes3), because bacnetctl does not serve those services. CI runs server run against the go-bacnet client and the bacnetctl commands only.
Field validation
Section titled “Field validation”go-bacnet’s docs/FIELD_VALIDATION.md is the checklist for recording physical-device evidence. For each device it records make and model, firmware, protocol revision, topology (local, routed, BBMD or foreign device), library version, interop pin and date, then which services were exercised (Who-Is, ReadProperty, ReadPropertyMultiple, WriteProperty only where safe, and optional COV, events, files and routed paths) and notes on segmentation, timeouts and Error, Reject and Abort responses. Completed runs go into the hardware table of docs/COMPATIBILITY.md, which is empty today.