Repository navigation
Conversation
Thecave3
force-pushed
the
e2sm-dapp
branch
2 times, most recently
from
October 15, 2026 19:53
5787d54 to
db26db7
Compare
eq_ric_service_update() compared the entries of the modified list with
if (eq_ran_function(&m0->modified[i], &m1->modified[i]))
return false;
so it reported two RIC Service Updates as different precisely when their
modified lists matched, and as equal when they did not. The added and
deleted lists next to it both test for == false; only this one is missing
it. Present identically in v1_01, v2_03 and v3_01.
It has gone unnoticed because the only caller is the encode/decode round
trip test, and that test is not run: the RIC Service Update codec asserted
"Untested code", so the test was commented out of main(). The next commit
implements the codec and enables the test, which is how this surfaced.
Co-authored-by: Andrea Lacava <thecave003@gmail.com>
Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Lacava <thecave003@gmail.com>
Both e2ap_enc_service_update_asn_pdu() and e2ap_dec_service_update()
(and their Acknowledge counterparts) opened with
assert(0 != 0 && "Untested code");
so the procedure could not be exercised at all. Beneath the assert the
code did not match the ASN.1:
- The mandatory TransactionID IE was never encoded, although the
decoder read it from index 0 and E2AP marks it mandatory.
- All three RAN-function lists were encoded unconditionally, so an
update carrying only one of them still emitted two empty
RANfunctions-Lists, violating SIZE(1..maxofRANfunctionID).
- The decoder read the lists positionally, at fixed indices 1..3.
Since every list is optional, any update that omitted one read the
wrong IE, or an IE that was not there.
- The deleted list built RANfunction-ItemIEs and appended them to
ran_mod's list rather than ran_del's, using RANfunction-Item where
the ASN.1 asks for RANfunctionID-Item.
- RANfunctionsAdded and RANfunctionsModified are distinct CHOICE
members of the same generated type (RANfunctions_List and
RANfunctions_List_1). The encoder had them the other way round from
the decoder.
- In the Acknowledge, the accepted and rejected items were tagged
ProtocolIE_ID_id_RANfunction_Item instead of
ProtocolIE_ID_id_RANfunctionID_Item, and criticality was ignore
where the ASN.1 says reject.
The decoder now reads the TransactionID at index 0 and dispatches the
remaining IEs by id rather than by position, which is what makes the
optional lists work in any combination.
test_service_update() and test_service_update_ack() already existed but
were commented out of main(). They are enabled, given the transaction id
to round trip, and the update test now fills all three lists at once --
filling only one, as before, would not have caught the added/modified
member mix-up. test_service_update_empty() covers the other boundary: an
update carrying nothing but the mandatory TransactionID.
Co-authored-by: Andrea Lacava <thecave003@gmail.com>
Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Lacava <thecave003@gmail.com>
mv_rd_e2_setup() ended in assert(0 != 0 && "Unknown types"), so an E2 SETUP answer whose service-model definition type is not one of the eight handled here takes the whole process down. That is reachable without anything being wrong: the plugin directory is scanned, not enumerated, so a service model left in libs_dir by another install is loaded and answers E2 SETUP with a type this build has no case for. It is also what a build configured with a different service-model set hits against an agent that has more. Leave dst zeroed instead. A service model is selected by RAN-function id when a subscription arrives, so one that is not modelled here is simply never chosen; there is no path that consumes the zeroed definition. Co-authored-by: Andrea Lacava <thecave003@gmail.com> Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Lacava <thecave003@gmail.com>
With the codec in place the procedure still had no implementation on
either side: e2ap_handle_service_update_ric() was
assert(0 != 0 && "Not Implemented"), the agent had no way to send an
update, and RIC_SERVICE_UPDATE reached neither the iApp dispatch table
nor the E2 node registry.
A service model whose RAN function definition depends on state the RAN
only learns after E2 SETUP has no other way to tell the RIC: E2 SETUP
happens once per connection. This closes that gap.
Agent side:
- e2_send_ric_service_update() encodes and sends the update.
- trigger_ric_service_update_api(ran_func_id) re-advertises one RAN
function with a monotonically increasing revision, which is what
makes the RIC replace the stored definition instead of rejecting a
duplicate. It takes the RAN function id rather than picking a
service model itself, so it stays independent of which service
models a deployment loads.
- e2ap_handle_service_update_ack_agent() reports the outcome and
names any RAN function the RIC rejected.
RIC side:
- e2ap_handle_service_update_ric() applies the added and deleted
lists to the E2 node's accepted set and answers with a RIC Service
Update Acknowledge listing what it took.
- The update carries no node id, so near_ric resolves it from the
socket the message arrived on, via the new reverse lookup
find_map_sad_e2_node(). That lookup returns false rather than
asserting when the socket has no node registered, and an update for
an unknown node is logged and dropped: this path is driven by
whatever arrives on the SCTP socket, so an assertion there would let
a stale or malformed update from any peer take the RIC down.
- The update is forwarded to the iApp, which applies it to the E2 node
registry through the new update_reg_e2_node(), so an xApp connecting
afterwards sees the current RAN function list.
RIC Service Update Failure is still unimplemented; a rejected update is
reported through the Acknowledge's rejected list.
Co-authored-by: Andrea Lacava <thecave003@gmail.com>
Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Lacava <thecave003@gmail.com>
A dApp is a control application that runs on the same host as the E2 node
and talks to it over a local interface, so it can act inside the
scheduling loop -- microseconds to a slot -- where an xApp behind E2 and a
RIC platform cannot. The two are complementary, but nothing today lets
them agree: both can act on the same resources with no view of what the
other has asked for.
E2SM-DAPP is the E2 service model that carries that exchange. It relays
two things between an xApp and the dApps attached to an E2 node:
- reports, dApp to xApp: report style 1 forwards a dApp's payload
verbatim; report style 2 reports which dApps are attached and which
E3 RAN functions each of them subscribed to, so an xApp can discover
them and see them come and go.
- controls, xApp to dApp: control style 1 addresses a payload to one
dApp and one of its RAN functions.
The service model does not interpret the payload it relays: the
indication message and the control message carry it as an octet string.
What the E2 node does with a control, and what a dApp puts in a report,
is agreed between them and is not E2's business. RAN function id 255,
OID 1.3.6.1.4.1.53148.1.1.255.3.
The E2SM-DAPP grammar (e2sm_dapp_v0_standard.asn) follows the shape of
the O-RAN service models already here: RAN function definition with
report and control style lists, per-format indication headers and
messages, control header, message and outcome. Both the indication
header and the control header carry an optional producer timestamp and an
optional correlation id, inside the APER extension markers, so a
deployment that wants to attribute latency across the xApp-dApp loop can
without either field being required.
Alongside it, e3/ decodes the relayed payload for the one payload format
we can describe: the spectrum-sharing schema a dApp uses to report which
PRBs it has blacklisted, and an xApp uses to ask for PRBs to be blocked.
The xApp half of the service model decodes it into a typed struct so the
example xApp can read it without a second copy of the schema, while the
E2 node side stays payload-agnostic. e3sm_spectrum.asn is a copy of a
schema shared with the E2 node and the dApp library, kept byte-identical
with both; a change to it has to move in all three places.
asn1c output is committed and listed explicitly, as it is for every other
service model here, so building needs no asn1c. The plain and flatbuffers
encoders are the usual unimplemented placeholders, matching rc_sm.
Co-authored-by: Andrea Lacava <thecave003@gmail.com>
Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Lacava <thecave003@gmail.com>
Wires the new service model into the tables every service model has to appear in: the agent read/write/answer types, the E2 node registry, the xApp RAN-function definition union, and the iApp listeners, which now recognise a DAPP indication rather than asserting on an unknown type. The relayed payload is opaque to the RIC, so the sqlite writer and the stdout listener say so rather than inventing a column layout for it. The control-outcome path needed one change beyond registration. E2AP makes the control outcome optional and msg_handler_xapp discarded it unconditionally, with a comment noting it could be used. sm_ric_t already declares on_control_out and sm_alloc_t declares free_ctrl_out_data; neither had a caller. The outcome is now handed to the service model that owns the RAN function when the acknowledgement carries one, which is how an xApp learns whether the dApp accepted its control. Co-authored-by: Andrea Lacava <thecave003@gmail.com> Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Lacava <thecave003@gmail.com>
Three tests, registered with ctest:
- Unit_test_DAPP drives an agent and a RIC through the service model:
subscription with each report style, indication in each format,
control and control outcome.
- Unit_test_enc_dec_DAPP round trips every information element through
the ASN.1 codec against randomly filled data, and covers the refusal
paths: a PRB index or count outside what the schema allows, a NULL
argument, a truncated buffer.
- fill_rnd_data_dapp supplies the random fillers, in the shape the kpm
and rc fillers already use.
examples/xApp/c/spectrum is a worked example rather than a smoke test: it
subscribes twice to the same E2 node, once per report style, so the two
arrive on separate RIC request ids and can be deleted independently; it
prints what each report carries; and it sends spectrum controls, which is
what exercises the xApp-to-dApp direction end to end.
Co-authored-by: Andrea Lacava <thecave003@gmail.com>
Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Lacava <thecave003@gmail.com>
This was referenced Dec 1, 2026
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.
Why
E2SM-DAPP is the service model that lets them exchange intent instead. RAN function 255,
OID
1.3.6.1.4.1.53148.1.1.255.3.when that set changes.
The service model does not interpret what it relays. The indication message and the
control message carry the payload as an octet string. That is deliberate: the dApp
ecosystem is not ours to define, and the RIC has no business decoding it.
The ASN.1 codec is not in this repo.
dapp_enc_*_asnanddapp_dec_*_asncall libe3(
libe3::e2sm_dapp, >= 0.3.0), so flexRIC, OCUDU and any other stack share one codec andone specification rather than each carrying a copy of the grammar. That is why this PR is
~240 files rather than the ~580 an in-tree asn1c copy would have been. Build-time
dependency: a configure without libe3 stops with a message naming what to install.
One payload format is decoded, on purpose.
e3/transcodes the spectrum-sharingschema (PRB blacklist reports up, PRB block controls down) so the example xApp has
something concrete to read. Its generated sources are committed, matching how
rc_smships its asn1c output.
Open questions for the maintainers
…53148.1.1.255.3sit under the OAI enterprise arc. We would rather you bless or assignthe number than have us present it as settled.
opaque bytes only and leave that downstream? We include it because the example xApp is
not worth reading without a concrete payload.
Notes
E3_AGENTbuild option. Internally the whole model sits behind one; upstream that isbackwards — every other model calls its
iocallbacks unconditionally and it is theRAN's business whether they are implemented.
read_setupkeeps a NULL check for agentsthat only emulate the RAN side, which is what
ccc_sm_agent.cdoes."Not implemented" assert, nothing referenced them, and
SM_ENCODING_DAPPonly everaccepted
ASN.time_now_ns()is added next totime_now_us()insrc/util/. The timestamp field isnanoseconds and only the microsecond helper existed.
DAPP_CTRL_V0is 8, not 7: E2SM-CCC took 7 in v3.0.0.Verification
Built against #11 with
-DKPM_VERSION=KPM_V3_00and libe3 0.3.0; clean build, no newwarnings, all 9 service-model plugins produced.
ctest14 of 16, including the two newDAPP tests.
The two failures are
Unit_test_Agent_RIC_xAppandUnit_test_nearRT_RIC, pre-existingon
dev— both abort atplugin_ric.c:187 sm_plugin_ric, which this PR does not touch.See #11 for the pristine-
devbaseline.The RAN-side half is a separate contribution to OpenAirInterface.