Repository navigation
Conversation
This was referenced Oct 15, 2026
Thecave3
marked this pull request as ready for review
October 15, 2026 19:34
Thecave3
force-pushed
the
ric-service-update
branch
2 times, most recently
from
October 15, 2026 19:53
2d1252e to
96bae1c
Compare
Collaborator
|
CI Build: #44 | Failed on the following stages: |
Thecave3
force-pushed
the
ric-service-update
branch
from
November 2, 2026 23:26
96bae1c to
9db627d
Compare
Collaborator
|
CI Build: #79 | Failed on the following stages: |
Thecave3
marked this pull request as draft
November 17, 2026 15:55
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>
Thecave3
force-pushed
the
ric-service-update
branch
from
November 27, 2026 13:59
9db627d to
6167100
Compare
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
RIC Service Update is the only way an E2 node can tell the RIC that its RAN function
list changed after E2 Setup — a function added, revised or withdrawn while the node is
running. In
devthe procedure is declared and then stops atassert(0 != 0 && "Untested code")in the v2.03 decoder, so a node that sends one takesthe RIC down.
Nothing in the tree exercises it today, which is why the gaps below have gone unnoticed.
They are not all "unimplemented": three are wrong rather than missing.
What this fixes
assert(0 != 0 && "Untested code")paths inv2_03/dec/e2ap_msg_dec_asn.creplaced with real decoding.eq_ric_service_update()compared the modified list inverted — in all three E2APversions. It returned equal for different lists and different for equal ones.
encoded as a revision.
TransactionID, which the procedure requires.Plus
trigger_ric_service_update_api(), so a service model that re-advertises itsdefinition at runtime has something to call, and a logged drop instead of an abort in
msg_handler_ric.cwhen an E2 node is not inconn_e2_nodes.Scope
This is a bug-fix PR against existing E2AP code. It carries no new service model and no
dApp or E3 content. It is a prerequisite for the E2SM-DAPP PR that follows, but it stands
on its own and is reviewable by anyone who does not care about that one.
Verification
Built against
devwith-DKPM_VERSION=KPM_V3_00; clean build, no new warnings.ctest12 of 14.The two failures are
Unit_test_Agent_RIC_xAppandUnit_test_nearRT_RIC, and they arepre-existing on
dev: both abort atsrc/ric/plugin_ric.c:187: sm_plugin_ric: Assertion 'it != end_it && "RAN function ID not found in the RAN"'. I built pristinedevseparately to confirm the same two fail thesame way, and
plugin_ric.cand both test harnesses are untouched by this PR.Worth knowing when reproducing: both tests
dlopeneverything in the plugin directory, sorun them with
-p <dir containing only this build's service models>or unrelated pluginsfrom another build will fail them for a different reason.