|
libe3 0.6.1
C++ library for E3AP RAN vendor integration
|
This chapter describes how an xApp learns which dApps exist, subscribes, receives reports, sends a control and gets the acknowledge. It places every E2SM-DAPP message on the E2AP message that carries it.
The index is README.md. The field lists are in 02-ie-mapping.md. The E2-E3 loop and its box numbers (A1 to A20, B1 to B19) are defined in ../control-loops/path-a-e3-loop.md and ../control-loops/path-b-e2-e3-loop.md. Code references for each step are in integrator-guide.md.
Table: Roles in the E2SM-DAPP flow
| Role | Description | Speaks |
|---|---|---|
| dApp | An application next to the RAN, for example a spectrum dApp | E3AP to the RAN |
| RAN | A gNB. It hosts the E3 agent, the E2 agent and the E2-E3 bridge (the "dApp RAN function") between them | E3AP to dApps, E2AP to the RIC |
| RIC | The near-RT RIC | E2AP to the RAN, and an internal interface to xApps |
| xApp | An application on the RIC, for example a decision engine | E2SM-DAPP, wrapped in E2AP by the RIC |
The E2 RAN function id of E2SM-DAPP is 255. All E2SM-DAPP traffic is RIC Subscription, RIC Indication, RIC Control and the RAN function advertisement. No dApp-to-RIC path bypasses the RAN.
Table: E2AP messages that carry E2SM-DAPP content
| # | Direction | E2AP message | E2SM-DAPP content | Described in |
|---|---|---|---|---|
| S1 | RAN to RIC | E2 Setup Request | RAN function item for id 255: definition, revision 1, OID | Discovery |
| S2 | RIC to RAN | E2 Setup Response | none (E2AP only) | |
| S3 | RAN to RIC | RIC Service Update | RAN function id 255 in "modified", with a fresh definition | Discovery |
| S4 | RIC to RAN | RIC Service Acknowledge | none (E2AP only) | |
| P1 | RIC to RAN | RIC Subscription Request | event trigger (format 1), one report action with an action definition (style 1 or 2) | Subscription |
| P2 | RAN to RIC | RIC Subscription Response | none (E2AP only), the single action is admitted | Subscription |
| P3 | RIC to RAN | RIC Subscription Delete Request | none | Subscription |
| P4 | RAN to RIC | RIC Subscription Delete Response | none | Subscription |
| R1 | RAN to RIC | RIC Indication (report) | style 1: indication header format 1 and message format 1 (one dApp report) | Indication delivery |
| R2 | RAN to RIC | RIC Indication (report) | style 2: indication header format 2 and message format 2 (the dApp subscription map) | Discovery, Indication delivery |
| C1 | RIC to RAN | RIC Control Request | control header format 1, control message format 1, with "ack" requested | Control relay |
| C2 | RAN to RIC | RIC Control Acknowledge | control outcome format 1 (timestamp, sequence id, optional Service-Model payload). Sent late, see the deferred acknowledge | Control relay |
The RAN shall not send a RIC Control Failure for E2SM-DAPP. Every control ends in a RIC Control Acknowledge, even a control that the RAN refused or that timed out.
E2SM-DAPP uses no other E2AP procedure. In particular it has no RIC Query, no insert and no policy. The reasons are in 02-ie-mapping.md.
An xApp needs a dapp-id and an E3 RAN function id for the control header. Both come from the dApp E3 subscription map. The map lists the dApps connected to the RAN, each with the E3 RAN functions it has subscribed to. The map reaches the xApp in three ways.
The map is the optional dappE3Subscriptions field of the report item (style 1) and of the control item (style 1) in the RAN function definition. The field list is in 02-ie-mapping.md.
Table: How the definition reaches the xApp
| Step | E2AP message | What happens |
|---|---|---|
| RAN builds the definition | inside S1 or S3 | The E2 agent asks the RAN for the definition. The agent replaces the name, the OID and the description with the constants of E2SM-DAPP. Then it encodes the definition. |
| RAN fills styles and map | The RAN offers two report styles and one control style. It offers no event trigger. It copies the map into report style 1 and into control style 1. | |
| E2 Setup | S1 | The definition goes in the RAN function item. |
| RIC stores it | The RIC keeps the definition in the node information that it exposes to xApps. | |
| xApp decodes it | The xApp finds RAN function 255 in the node information and decodes the definition. |
Procedure:
When a dApp connects or disconnects, the RAN does two things on the thread of the E3 agent.
The revision in the RIC Service Update starts at 1 and increases by one per update. The E2 Setup Request already announced revision 1, so the first update repeats it. See 01-identity-and-registration.md.
Each style-1 indication names the dapp-id that sent the report (indication header format 1). An xApp that only answers reports does not need the map. It shall echo the dapp-id and the ran-function-id of the header that it just received. A decision engine that stores the dapp-id with each detection and puts it in the control follows this method.
E2SM-DAPP has no per-dApp subscription. A subscription picks a report style and receives that style's indications from every dApp.
Table: Subscription steps
| Step | E2AP message | E2SM-DAPP content |
|---|---|---|
| xApp builds the request | P1 | Event trigger: format 1 (empty). One action: type report, id 1, action definition style = 1 or 2. |
| RAN decodes it | Event trigger and action definition. | |
| RAN registers the subscriber | Style 1 adds the RIC request id to the format-1 subscriber list. Style 2 adds it to the format-2 list. | |
| Admission | P2 | The RAN always admits the single action. |
| Teardown | P3, P4 | The RAN removes the subscriber. |
Procedure:
Pairing with a dApp happens at control time, not at subscription time. The xApp chooses a (dapp-id, ran-function-id) pair from what it learned during discovery and puts it in the control header. The RAN does not check that the dApp exists or has subscribed to that function before it relays the control. The RAN only learns whether its E3 library accepted the call.
This is the report-up leg of Path B, boxes B1 to B4, entered from A20.
Table: Report-up boxes
| Box | What happens | E2AP / E2SM-DAPP |
|---|---|---|
| A20 | The E3 report arrives from the dApp and goes to the bridge | E3AP E3-DAppReport with dAppIdentifier, ranFunctionIdentifier, sequenceId, reportData |
| B1 build | The bridge makes one indication per style-1 subscriber. The header is format 1 (ran-function-id, dapp-id, node identity, timestamp, sequence-id). The message is format 1 (data = the unchanged reportData). | R1: RIC Indication, type report |
| B1 encode | The E2 agent encodes header and message. It drops a header or message that the encoder declines. It does not abort. | |
| B1 send | RIC Indication, action id from the subscription, no sequence number, no call process ID | |
| B2 | E2AP decode at the RIC | |
| B3 decode | The RIC side decodes header and message. For format 1 it can also decode the inner payload, using ran-function-id as the key. | |
| B4 | The xApp processes the report |
Procedure:
This covers boxes B5 to B19.
Table: Policy-down boxes
| Box | What happens | E2AP / E2SM-DAPP |
|---|---|---|
| B4 to B5 | The xApp decides. It builds the control header (ran-function-id, dapp-id, timestamp, sequence-id echoed from the report) and the control message (data = the Service-Model control payload). | |
| B6 | E2AP framing | C1: RIC Control Request, ack requested |
| B7 | The E2 agent of the RAN decodes the request. | |
| B8 | E2SM decode of the control header and message | |
| B9 | The bridge relays the control over E3. | |
| B10, B11 | E3AP E3-XAppControlAction with dAppIdentifier, ranFunctionIdentifier, sequenceId (copied from the control header), xAppControlData (the control message data) | |
| B12 to B15 | The dApp receives, decodes and applies the policy |
Procedure:
Table: Mitigation boxes
| Box | What happens |
|---|---|
| B16 | The dApp re-issues the policy as an E3 control. It carries the same sequenceId. |
| A12 to A18 | E3AP E3-DAppControlAction travels from the dApp to the RAN. |
| B17 apply | The Spectrum service model of the RAN writes the mask into the MAC. It records the instant on the realtime clock, per sequenceId. |
| B18 live on air | The first scheduler tick that uses the mask records the instant, again on the realtime clock, with the frame and the slot. |
| A mask replaced before any tick ran | The RAN retires the control as superseded. The control is installed and has no on-air instant. |
The RAN shall send the RIC Control Acknowledge when the mitigation lands (B19). It shall not send it when it receives the request (B7). An acknowledge sent at B7 would say only that the request was forwarded. It would leave before the dApp has seen the control and long before any mask exists. A reader could not take it as completion.
Table: Steps of the deferred acknowledge
| Step | What happens |
|---|---|
| 1 | The E2 agent calls the RAN function handler. When the handler answers "no outcome yet", the agent returns a deferred result. It keys the result by the sequence-id of the control header. |
| 2 | The E2 agent parks the RIC request id under that key and sends no E2 message. If the table of parked controls is full (64 entries), it acknowledges at once. |
| 3 | The RAN function opened a pending control for the id before it forwarded the control. |
| 4 | When the mask is on the air (B18), the RAN builds the outcome and completes the parked control. |
| 5 | The E2 agent claims the parked RIC request id. It sends C2, a RIC Control Acknowledge, with the E2SM-DAPP control outcome in its control-outcome field. |
| 6 | The xApp receives C2 and reads sequence-id and the payload. |
The outcome carries the two instants B17 and B18 inside the Spectrum payload (installedTimestamp, onAirTimestamp) and the sequence-id of the procedure. The field list is in 02-ie-mapping.md.
Timeouts. A dApp that never answers shall not hold an xApp forever.
Table: Pending-control timeouts
| Timer | Value | Effect |
|---|---|---|
| RAN pending-control timeout | 150 ms | The RAN retires the control as failed. It still sends a RIC Control Acknowledge. The outcome holds the install instant only if the install happened, and holds no on-air instant. |
| E2 agent pending-control timeout | 200 ms | The timer would send an acknowledge without an outcome. The reference E2 agent never starts the sweep that runs it, so only the RAN timer is in effect. |
The RAN timer shall stay shorter than the E2 agent timer. The RAN then gives up first, and the acknowledge still carries information.
The xApp computes detection-to-mitigation from numbers that all come from the RAN side clock, CLOCK_REALTIME at the gNB:
The xApp adds no clock of its own to these two values. It moves the numbers and subtracts them. The fields control_sent_ts_ns and de_read_ts_ns in the same record use the xApp's own clock, and the xApp uses them only against each other. See 05-semantics-and-constraints.md for why the dApp, gNB and payload stamps can be subtracted and the latency recorder's stamps cannot.
This section shows the same boxes as Path B, with each E2SM-DAPP message on the box that produces or consumes it. Solid boxes are in the E2-E3 loop. The three E2SM-DAPP-only boxes on the right are discovery and teardown, outside the loop.
The last edge goes back to the xApp. The acknowledge arrives at the same process that decided (B4) and closes the procedure.
One identifier joins every hop. It starts at the dApp. No component reassigns it.
Table: Where the sequence-id is assigned or copied
| Hop | Field | Assigned or copied by |
|---|---|---|
| dApp report | E3-DAppReport.sequenceId, mandatory, E3-SequenceID (1..4294967295) | assigned by the dApp, per detection |
| indication | IndicationHeader-Format1.sequence-id | copied by the RAN bridge |
| xApp control | ControlHeader-Format1.sequence-id | echoed by the xApp |
| relayed control | E3-XAppControlAction.sequenceId, mandatory | copied by the RAN bridge |
| dApp re-issue | E3-DAppControlAction.sequenceId, optional | carried back by the dApp; absent on a control the dApp decided on its own |
| outcome | ControlOutcome-Format1.sequence-id | set by the RAN; also the key under which the E2 agent parked the request |
The two E3 messages in the middle use an id of 1..4294967295. The SequenceId of E2SM-DAPP is an unbounded INTEGER. A value of 0 or an absent field means "no procedure". The RAN cannot match such a control, and it acknowledges the control at once without applying it.
Implementations share the E2SM-DAPP messages and differ in what they do around them. Two kinds exist. Implementation A has both the E2 side and the E3 side in the RAN. Implementation B has the E2 side only, and it reaches the E3 side through two interfaces: a source of indications and a sink for controls. The code references and the product names are in integrator-guide.md.
Table: Behavior of implementation B
| Step | Behavior |
|---|---|
| Without an E3 side | No-op implementations advertise the RAN function and admit subscriptions. They never report. They refuse every control with the E2AP cause "system not ready". |
| Definition | The definition is fixed. It holds the name block, an event trigger section, two report styles (E3 Data Report with formats 1 and 1, E3 Subscription Map with formats 2 and 2) and one control style (dApp Control, formats 1, 1, 1). It never holds dappE3Subscriptions, because the map is dynamic. Implementation B sends no RIC Service Update for E2SM-DAPP. The RAN function revision in its E2 Setup Request is 0, although the packer holds 1. |
| Subscribe | The RAN admits a report action whose action definition has style 1 or 2. It refuses everything else. The E2 agent then reports "not admitted" and does not abort. The event trigger gives a fixed 10 ms poll period, because the E2 agent only runs periodic indications. The RAN sends at most one indication per poll and subscription. |
| Indicate | The RAN asks the source for the next indication of the subscription. It drops an indication whose formats do not match the style. It drops a style-1 indication whose data_size differs from the octet count of data. It drops an indication whose header and message exceed 16319 octets together. |
| Control | The RAN rejects a control whose data-size differs from the octet count of data, with the cause "control message invalid". Otherwise it hands the control to the sink and waits for the sink's task. The RIC Control Acknowledge, or the RIC Control Failure with the cause of the sink, goes out after that. The acknowledge is deferred in the same sense as in implementation A. A control without "ack requested" is applied and not answered. |
| Outcome | The RAN always echoes the timestamp and the sequence-id of the control header into the outcome. It adds the outcome payload of the sink when it fits within 16287 octets. Unlike implementation A, it does not stamp the build time of the outcome, and it also sends the outcome on a failure. |
Two more differences matter to a RIC-side implementer.