feat(encoder): add Protocol Buffers as a third E3AP encoding#35
Open
Thecave3 wants to merge 4 commits into
Open
feat(encoder): add Protocol Buffers as a third E3AP encoding#35Thecave3 wants to merge 4 commits into
Thecave3 wants to merge 4 commits into
Conversation
Add a runtime-selectable Protocol Buffers encoder alongside ASN.1 and JSON, implemented the same way as the existing encoders and selected via E3Config.encoding. - messages/proto/V1/e3ap-1.0.0.proto and examples/sm_simple/e3sm_simple.proto grammars; protoc generates the pb_e3ap library at build time - ProtobufE3Encoder behind the E3Encoder factory, gated by LIBE3_ENABLE_PROTOBUF - build_libe3 --enable-protobuf flag and protobuf packages in the dependency installer; find_package(Protobuf) wiring in CMake - end-to-end protobuf path in the simple agent/dapp example (SM payload encoding follows the selected format) - round-trip unit tests for all 11 PDU types and encoding-size benchmark coverage - PR CI builds all three encodings together; the release workflow now publishes per-encoding .deb variants (all/asn1/json/protobuf) via create_deb.sh --variant Also fixes the unit-test framework summary, which never tallied passing tests (reported "0 passed ... out of 0"). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
⏱️ Full-loop Latency Benchmark (commit
|
| Phase | mean | p50 | p99 | max |
|---|---|---|---|---|
| 1. Collect indication data | 0 | 0 | 0 | 11 |
| 2. Create & encode indication | 0 | 0 | 0 | 7 |
| 3. Deliver indication (RAN -> dApp) | 88 | 87 | 150 | 158 |
| 4. Decode indication | 0 | 0 | 0 | 12 |
| 5. Process data | 0 | 0 | 0 | 0 |
| 6. Create & encode control | 0 | 0 | 0 | 5 |
| 7. Deliver control (dApp -> RAN) | 100 | 101 | 159 | 183 |
| 8. Decode & handle control | 0 | 0 | 0 | 6 |
| Total round-trip | 190 | 175 | 298 | 310 |
Benchmarked on
ubuntu-latest, Release build, ZMQ + IPC, ASN.1 APER.
Contributor
🔄 E2E dApp Integration Results (commit
|
Contributor
🔀 E2E Topologies — multi-dApp / multi-RAN (commit
|
…cy bench Accept --encoding protobuf and pass the selected encoding into every Simple SM wrapper call, so the SM payload matches the E3AP envelope encoding end-to-end (previously the payload was always ASN.1 APER regardless of --encoding). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Encode/decode the Simple SM payloads as camelCase JSON text when the selected encoding is JSON, mirroring the existing protobuf branch, so '-e json' runs are JSON end-to-end (envelope and SM payload). This fixes the previous 0-completion JSON runs: the JSON envelope encoder embeds the indication payload as a nested JSON object, which failed to parse when the SM payload was ASN.1 bytes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extend bench_encoding_size beyond wire size: time encode and decode of every PDU type per enabled encoding with Google Benchmark (auto- calibrated iteration batching, DoNotOptimize barriers, p50/p99 across 20 repetitions), and report each sample PDU's intrinsic information content in bytes so encoded_bytes/info_bytes reads as framing overhead. CSV columns become: encoding, message_type, encoded_bytes, info_bytes, encode_ns_p50, encode_ns_p99, decode_ns_p50, decode_ns_p99. Google Benchmark is fetched via FetchContent only when LIBE3_BUILD_INTEGRATION_TESTS=ON (system package used when present); nothing ships with the library. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
E3Config.encoding(EncodingFormat::PROTOBUF)..protogrammars for E3AP and the Simple SM;protocgenerates apb_e3aplibrary at build time. NewProtobufE3Encoderbehind theE3Encoderfactory, gated byLIBE3_ENABLE_PROTOBUF(off by default).build_libe3 --enable-protobufflag + dependency install; the Simple agent/dapp example runs protobuf end-to-end..debvariants (all/asn1/json/protobuf). Also fixes the unit-test framework summary that never tallied passing tests.Type of change
Linked issue
Closes #16
Mandatory test checklist
These mirror what CI (
.github/workflows/pr-tests.yml) enforces. All boxes must be ticked before review../build_libe3 -c -d build -j $(nproc) -r -tpasses (Release build + tests) — run with--enable-protobuf, 16/16 tests pass incl.test_protobuf_encoder./build_libe3 -c -d build -j $(nproc) -g -tpasses (Debug build + tests) — verified in Debug for the default and all-encodings configurationscd build && ctest --output-on-failureis clean (all-encodings build: 17/17; default build: 15/15 with the protobuf test correctly skipped)./build/test_bench_mpmc_queue) shows no regression vsmain(unchanged; passes as part of the suite)VERSIONbumped per SemVer (0.0.6 → 0.0.7; additiveEncodingFormat::PROTOBUFenumerator + new opt-in option)include/were touched,./build_libe3 --docsrenders without new Doxygen warnings — the only public-header change is the additiveEncodingFormat::PROTOBUFenumerator (Doxygen-commented); docs not re-rendered locally, covered by the release docs job./build_libe3 -I(addedprotobuf-compiler/libprotobuf-devfor apt, plus dnf/pacman/brew equivalents)libe3.pcinterface changed, downstream consumers still link cleanly —libe3.pcis unchangedCI checklist
Unit Testsworkflow is green (Debug + Release matrix onubuntu-latest) — will run on this PRMPMC Queue Benchmarkjob has posted results to this PR with no regression — will run on this PRTwin-repo coordination
libe3 is paired with
dappsanddApp-openairinterface5g. We do not accept patches that break or reduce compatibility with the twin repositories.LIBE3_ENABLE_PROTOBUFdefaults OFF, the newEncodingFormat::PROTOBUFenumerator is appended, and the existing ASN.1/JSON wire formats and ABI are unchanged.Paired PR(s): none required (additive, opt-in)
Workflow confirmation
CONTRIBUTING.md§ Pull Request Process.)CONTRIBUTING.md.