@NTUST
# E2AP (E2 Application Protocol) v02.01
###### tags:`ORAN SPEC - WG3:Near-RT RIC`
:::info
**Introduction:**
- In the SPEC "E2GAP", it introduces what/where is E2 Interface and some of RIC Services & E2AP Presedures in general. In this SPEC "E2AP", it focus on describing every **E2AP Presedures**, **messages of presedures**, **IEs (Information Elements)** of message in detail. This note doesn't describe the IEs because the numbers of IEs are too many, you can find the SPEC clause 9.2 or 9.3 when you want to understand the the IEs of specific E2AP Presedures.
**Goal:**
- [x] [Introduction of E2AP](#1-Introduction-E2AP-procedure)
- [x] [List all the E2AP Procedures](#2-Near-RT-RIC-Functional-Procedures)
- [x] [List all the Messages for E2AP Communication](#12-Elementary-Procedure-EP)
**Prior Knowledge:**
- [SPEC:E2 General Aspects and Principles](https://hackmd.io/@Min-xiang/rk_gODRVq)
**Main Reference:**
- [O-RAN.WG3.E2AP-v02.01](https://orandownloadsweb.azurewebsites.net/specifications)
- [Note of E2AP-v01.00 by Nick-Bowei](https://hackmd.io/@Nick-Bowei/rJ3i3Rs1v)
- [Elements for E2AP Communication by Nick-Bowei](https://hackmd.io/@Nick-Bowei/SJZEDdMxw)
:::
[toc]
## 1. Introduction E2AP procedure
### 1.1 E2AP procedure module
- The E2AP procedures are divided into two modules as follows:
- E2AP Near-RT RIC Functional Procedures
- E2AP Global Procedures
- The E2AP Near-RT RIC functional procedures module contains **Procedures** used to **pass application specific messages** between Near-RT RIC applications and a **target function** in an E2 node, for example:
- RIC Subscription procedure
- RIC Subscription Delete procedure
- RIC Indication procedure
- RIC Control procedure
- The Global Procedures module contains **procedures** that are **not directly related to a specific application**, for example:
- E2 Setup procedure
- Reset procedure
- Error Indication
- RIC Service Update procedure
- E2 Node Configuration Update procedure
- E2 Connection Update procedure
- E2 Removal procedure
### 1.2 Elementary Procedure (EP)
- An Elementary Procedure is a unit of interaction between a E2 Node and Near-RT RIC. An EP consists of an **initiating message** and possibly a **response message**. All EPs are divided into Class 1 and Class 2 EPs.
**Class 1 Elementary Procedures:** Need Successful/Unsuccessful Response
| Elementary Procedure | Initiated by | Initiating Message | Successful Outcome/Response Message | Unsuccessful Outcome/Response Message |
|:-------------------------------------------------------------------------------------------------------:|:----------------------:|:-------------------------------:|:----------------------------------------:|:-------------------------------------:|
| [RIC Subscription](#21-RIC-Subscription-procedure) | Near-RT RIC | RIC Subscription Request | RIC Subscription Response | RIC Subscription Failue |
| [RIC Subscription Delete](#22-Subscription-Delete-procedure) | Near-RT RIC | RIC Subscription Delete Request | RIC Subscription Delete Response | RIC Subscription Delete Failue |
| [RIC Service Update](#34-RIC-Service-Update-procedure) | E2 Node | RIC Service Update | RIC Service Update Acknowledge | RIC Service Update Failue |
| [RIC Control](#25-RIC-Control-procedure) | Near-RT RIC | RIC Control Request | RIC Control Acknowledge | RIC Control Failue |
| [E2 Setup](#31-E2-Setup-procedure) | E2 Node | E2 Setup Request | E2 Setup Response | E2 Setup Failue |
| **(New. v1.01 adding)** <br> [E2 Node Configuration Update](#35-E2-Node-Configuration-Update-procedure) | E2 Node | E2 NODE CONFIGURATION UPDATE | E2 NODE CONFIGURATION UPDATE ACKNOWLEDGE | E2 NODE CONFIGURATION UPDATE FAILURE |
| **(New. v1.01 adding)** <br> [E2 Connection Update](#36-E2-Connection-Update-procedure) | Near-RT RIC | E2 CONNECTION UPDATE | E2 CONNECTION UPDATE ACKNOWLEDGE | E2 CONNECTION UPDATE FAILURE |
| [Reset](#32-Reset-procedure) | Near-RT RIC or E2 Node | Reset Request | Reset Response | N/A |
| **(New. v2.01 adding)** <br> [E2 Removal](#37-E2-Removal-procedure) | Near-RT RIC or E2 Node | E2 REMOVAL REQUEST | E2 REMOVAL RESPONSE | E2 REMOVAL FAILURE |
**Class 2 Elementary Procedures:** Not Need Response
| Elementary Procedure | Initiated by | Initiating Message |
|:-----------------------------------------------------------------------------------------------------------------:|:----------------------:|:--------------------------------:|
| [RIC Indication](#24-RIC-Indication-procedure) | E2 Node | RIC Indication |
| [RIC Service Query](#341-Messages-of-RIC-SERVICE-QUERY) | Near-RT RIC | RIC Service Query |
| **(New. v2.00 adding)** <br> [RIC Subscription Delete Required](#223-Messages-of-RIC-SUBSCRIPTION-DELETE-FAILURE) | E2 Node | RIC SUBSCRIPTION DELETE REQUIRED |
| [Error Indication](#33-Error-Indication) | Near-RT RIC or E2 Node | Error Indication |
### 1.3 OSC use what version
- C Release E2AP 01.00
- D/E Release E2APv1.1
- F Release E2APv2.0
## 2. Near-RT RIC Functional Procedures
### 2.1 RIC Subscription procedure
:::success
**Goal:**
- **Establish a new E2 subscriptions on E2 Node** consisting of an event trigger and a sequence of actions, each with a corresponding subsequent action.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:Near-RT RIC initiates the procedure by sending the **RIC SUBSCRIPTION REQUEST message containing a unique RIC Request ID** to the target E2 Node, and **start the timer TRICEVENTcreate**.
- Part 2:The target E2 Node receive the RIC SUBSCRIPTION REQUEST message, it will need to:
- **Determine the target function** using the information in the RAN Function ID IE
- **Configure the requested event trigger** using information in the RIC Subscription Details IE
- **If one or more Report, Insert and/or Policy RIC service actions** are included in the RIC Subscription Details IE then the **target function shall validate the event trigger and requested action sequence** and, if accepted, **store the message of RIC SUBSCRIPTION REQUEST**.
- Part 3:If the requested trigger and at least one required action are accepted by the target E2 Node, the target E2 Node shall **reserve necessary resources** and send the **RIC SUBSCRIPTION RESPONSE message** back to the Near-RT RIC.
- Part 4:Upon reception of the RIC SUBSCRIPTION RESPONSE message the Near-RT RIC shall **stop the timer TRICEVENTcreate** and **terminate the Subscription Request procedure**.
**Flowchart by Nick-Bowei:**

:::
:::warning
**Case 2:Procedure is UnSucessful**
- Part 1:If the target E2 Node **does not admit at least one requested action**, or detects an inconsistency in the sequence of actions or in the subsequent action definitions, or a failure occurs during the RIC Subscription procedure, the target E2 Node shall **send the RIC SUBSCRIPTION FAILURE message** to the Near-RT RIC with **an appropriate cause value**.
- Part 2:Upon reception of the RIC SUBSCRIPTION FAILURE message the Near-RT RIC shall **stop the timer TRICEVENTcreate** and **terminate the RIC Subscription procedure**.
**Figure of unsuccessful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- Condition 1:RIC SUBSCRIPTION REQUEST message containing **RIC Subscription Details** IE that **does not align with** the Near-RT RIC **Service Model**
- Condition 2:RIC SUBSCRIPTION REQUEST message which contains a **RAN Function ID** IE that was **not previously announced** as a supported RAN function in the **E2 Setup** procedure or the **RIC Service Update** procedure
- Condition 3:RIC SUBSCRIPTION REQUEST message **containing identical contents**, that is, same RAN Function ID IE, same RIC Event Trigger Definition IE and same sequence of actions
:::
### 2.1.1 Messages of RIC SUBSCRIPTION REQUEST
- Direction: Near-RT RIC -> E2 Node

### 2.1.2 Messages of RIC SUBSCRIPTION RESPONSE
- Direction: E2 Node -> Near-RT RIC

### 2.1.3 Messages of RIC SUBSCRIPTION FAILURE
- Direction: E2 Node -> Near-RT RIC

### 2.2 RIC Subscription Delete procedure
:::success
**Goal:**
- Delete an existing E2 Subscription previously created by the Near-RT RIC.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:The Near-RT RIC initiates the procedure by **sending the RIC SUBSCRIPTION DELETE REQUEST message** to the target E2 Node, and it shall **start the timer TRICEVENTdelete**.
- Part 2:The target E2 Node receive the RIC SUBSCRIPTION REQUEST message, it will need to:
- **Determine the target function** using the information in the RAN Function ID IE
- If **one or more subsequent actions** were included in the previously received RIC Subscription, then the target function shall **delete the required actions** along with the corresponding RIC Request ID IE.
- **Delete the corresponding RIC EVENT trigger** using information in the RIC Request ID IE
- Part 3:The target E2 Node shall **release necessary resources** and **send the RIC SUBSCRIPTION DELETE RESPONSE** message back to the Near-RT RIC.
- Part 4:Upon reception of the RIC SUBSCRIPTION DELETE RESPONSE message the Near-RT RIC shall **stop the timer TRICEVENTdelete**, and **terminate the RIC Subscription Delete procedure**.
**Flowchart by Nick-Bowei:**

:::
:::warning
**Case 2:Procedure is UnSucessful**
- Part 1:If the target E2 Node **has no stored subscription** for the **same RIC Request ID IE** included in the RIC SUBSCRIPTION DELETE REQUEST message, or a **failure occurs during the RIC Subscription Delete procedure**, the target E2 Node shall send the RIC SUBSCRIPTION DELETE FAILURE message to the Near-RT RIC. The message shall contain with an **appropriate cause value**.
- Part 2:Upon reception of the RIC SUBSCRIPTION DELETE FAILURE message the Near-RT RIC shall **stop the timer TRICEVENTdelete**, and **terminate the RIC Subscription Delete procedure**.
**Figure of unsuccessful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- Condition 1:RIC SUBSCRIPTION DELETE REQUEST message containing a **RIC Request ID IE that is not known**.
- Condition 2:RIC SUBSCRIPTION DELETE REQUEST message contains a **RAN Function ID IE that was not previously announced as a supported RAN function** in the E2 Setup procedure or the RIC Service Update procedure
:::
### 2.2.1 Messages of RIC SUBSCRIPTION DELETE REQUEST
- Direction: Near-RT RIC -> E2 Node

### 2.2.2 Messages of RIC SUBSCRIPTION DELETE RESPONSE
- Direction: E2 Node -> Near-RT RIC

### 2.2.3 Messages of RIC SUBSCRIPTION DELETE FAILURE
- Direction: E2 Node -> Near-RT RIC

### 2.3 RIC Subscription Delete Required procedure
:::success
**Goal:** Enable the E2 Node to **request deletion of the existing RIC Subscriptions** in the E2 Node previously created by the Near-RT RIC.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:The E2 Node initiates the procedure by sending the **RIC SUBSCRIPTION DELTE REQUIRED** message to the Near-RT RIC. The message shall contain **an appropriate cause value for each RIC Subscription requesting to remove**. The E2 Node **shall not remove RIC Subscription(s)** on its own **until indicated by the Near-RT RIC** to do so.
- Part 2:The Near-RT RIC **receives the RIC SUBSCRIPTION DELETE REQUIRED**, for each RIC Subscription associated with the included RIC Request ID IE and RAN Function ID IE, it will need to:
- **Release necessary resources** related to that RIC Subscription and **initiate the RIC Subscription Delete procedure** toward the E2 Node.
**Figure of Successful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- Condition:RIC SUBSCRIPTION DELETE REQUIRED message for which the included **RIC Request ID IE and RAN Function ID IE are not associated with the previously subscribed**, the Near-RT RIC shall ignore this message.
:::
### 2.3.1 Messages of RIC SUBSCRIPTION DELETE REQUIRED
- Direction: E2 Node -> Near-RT RIC

### 2.4 RIC Indication procedure
:::success
**Goal:** **Transfer a message associated with a Report and/or Insert RIC Service to the Near-RT RIC** corresponding to a previously **successful RIC Subscription procedure** and the corresponding detection of the Event Trigger.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:An E2 Node initiates the procedure by sending RIC INDICATION message to the Near-RT RIC.
- If the RIC Indication message is in response to RIC Subscription with **RIC Action Type IE as "Insert"**, then the E2 Node shall **provide the RIC Call Process ID IE** within the RIC INDICATION message, and the E2 Node shall **store current call state**, **start the associated RIC Time to Wait timer**, and suspend further processing of the associated RAN function.
- Part 2:The receiving Near-RT RIC **shall use** the RIC Request ID IE to **route the Indication to the Near-RT RIC functionality** that originated the corresponding RIC Subscription procedure.
- Part 3:The receiving Near-RT RIC **may use the RIC Call Process ID IE (If present)** in a subsequent RIC Control procedure.
- Part 4:If the E2 Node **had stored an associated RIC Subsequent Action IE** then, after successful transmission of the RIC INDICATION message, the originating **E2 Node shall progress accordingly**:

**Flowchart by Nick-Bowei:**

:::
* RIC Subsequent Action : The subsequent action to be taken after completing a particular Action.
### 2.4.1 Messages of RIC INDICATION
- Direction: E2 Node -> Near-RT RIC

### 2.5 RIC Control procedure
:::success
**Goal:** **Initiate or Resume a specific functionality** in the E2 Node.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:The Near-RT RIC initiates the procedure by **sending the RIC CONTROL REQUEST message** to the E2 Node. When the Near-RT RIC sends the RIC CONTROL REQUEST message and the optional **RIC Control Ack Request IE has been set to "Ack", or is not present**, and the Near-RT RIC shall **start the timer TRICcontrol**.
- Part 2:The target E2 Node receives RIC CONTROL REQUEST message, and it shall:
- **Determine the target function** using the information in the RAN Function ID IE
- **Initiate the requested RIC Control procedure action** using information in the RIC Control Message IE.
- Part 2.1:If the **RIC Call Process ID IE** is included in the RIC CONTROL REQUEST message, the E2 Node shall use this IE to **identify a specific call process** that was **previously announced in the RIC INDICATION message** and, after confirming that the request has arrived prior to the RIC **Time to Wait timer had expired, clear the timer**.
- Part 2.2:If the RIC CONTROL REQUEST message contains the optional RIC Control Ack Request IE set to **“Ack” or "is not present"**, and the E2 Node has **successfully processed the requested RIC Control procedure action**, then the E2 Node shall **respond with the RIC CONTROL ACKNOWLEDGE message and continue call processing**.
- Part 2.3:If the RIC CONTROL REQUEST message contains the optional RIC **Control Ack Request IE set to “NoAck”** and the E2 Node has **successfully processed the requested RIC Control procedure action**, then the E2 Node **shall continue call processing**.
- Part 3:Upon reception of the RIC CONTROL ACKNOWLEDGE message, the **Near-RT RIC shall stop the timer TRICcontrol** and **terminate the RIC Control procedure**. The Near-RT RIC **may use** the information contained in the optional **RIC Control Outcome IE** to **determine subsequent actions**.
**Flowchart by Nick-Bowei:**

:::
:::warning
**Case 2:Procedure is UnSucessful**
- Part 1:The target E2 Node will shall **respond with the RIC CONTROL FAILURE message with an appropriate cause value** when the following conditions ocuur.
- The RIC CONTROL REQUEST message contains an optional **RIC Call Process ID IE that is invalid**
- The RIC CONTROL REQUEST message contains the optional RIC Call Process ID IE for which the **associated RIC Time to Wait timer had expired**
- The E2 Node **fails to execute the requested RIC Control procedure E2SM specific action**
- The E2 Node **detects an encoding or functional error in the E2SM specific IEs** contained in the RIC CONTROL REQUEST message
- The E2 Node receives a RIC CONTROL REQUEST message which contains a **RAN Function ID IE that was not previously announced as a supported RAN function** in the **E2 Setup procedure** or the **RIC Service Update procedure**, or the **E2 Node does not support the specific RIC Control procedure action**
- Part 2:Upon reception of the RIC CONTROL FAILURE message the Near-RT RIC shall **stop the timer TRICcontrol**, if running, and **terminate the RIC Control procedure**. The Near-RT RIC **may use** the information contained in the **Cause IE** and optional **RIC Control Outcome IE** to **determine subsequent actions**
**Figure of unsuccessful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- Condition 1:Upon **reception of the ERROR INDICATION message including the RIC Request ID IE** corresponding to the previous RIC CONTROL REQUEST message, the Near-RT RIC shall **stop the timer TRICcontrol**, if running, and **terminate the RIC Control procedure**.
- Condition 2:The timer **TRICcontrol was set** when sending the RIC CONTROL REQUEST message and there was **no response from the E2 node before the timer has expired**, the Near-RT RIC shall **send an ERROR INDICATION with the appropriate value for the Cause IE**.
:::
### 2.5.1 Messages of RIC CONTROL REQUEST
- Direction: Near-RT RIC -> E2 Node

### 2.5.2 Messages of RIC CONTROL ACKNOWLEDGE
- Direction: E2 Node -> Near-RT RIC

### 2.5.3 Messages of RIC CONTROL FAILURE
- Direction: E2 Node -> Near-RT RIC

## 3. Global Procedures
### 3.1 E2 Setup procedure
:::success
**Goal:** **Establish the signaling connection** between E2 Node and Near-RT RIC.
- This procedure **erases any existing application level configuration data** in the two nodes and replaces it by the one received.
- This procedure **also resets the E2 interface** like a Reset procedure would do.
==Note==:This procedure performs the **basic interface setup** and **transfers E2 Node specific configuration information to the Near-RT RIC**.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:An E2 Node initiates the procedure by **sending the E2 SETUP REQUEST message including the appropriate data** to a Near-RT RIC. The Near-RT RIC replies with the **E2 SETUP RESPONSE message** including the appropriate data.
- Part 2:If the Near-RT RIC has successfully **processed the RAN Functions Added List IE**, also present in the RIC SERVICE UPDATE message, then Near-RT RIC **shall contain**, in the E2 SETUP RESPONSE message, the **RAN Functions Accepted List IE and/or the RAN Functions Rejected List IE**, also present in the RIC SERVICE UPDATE ACKNOWLEDGE message.
- Part 3:If the Near-RT RIC has successfully **processed the E2 Node Component Configuration Addition List IE**, also present in the E2 NODE CONFIGURATION UPDATE message, then Near-RT RIC **shall contain**, in the E2 SETUP RESPONSE message, the **E2 Node Component Configuration Addition Acknowledge List IE**, also present in the E2 NODE CONFIGURATION UPDATE ACKNOWLEDGE message.
**Flowchart from SPEC "E2GAP"**

**Flowchart by Nick-Bowei:**

:::
:::warning
**Case 2:Procedure is UnSucessful**
- Part 1:If the Near-RT RIC cannot accept the setup it shall respond with an E2 SETUP FAILURE message with an appropriate cause value. The Near-RT RIC **may provide an alternative Transport Layer Information IE** for the E2 Node to use when **reinitiating the E2 Setup procedure** towards the Near-RT RIC.
- Part 2:If the E2 SETUP FAILURE message includes the **Time To Wait IE**, the E2 node **shall wait at least for the indicated time** before **reinitiating the E2 Setup procedure** towards the Near-RT RIC.
**Figure of unsuccessful case from SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- Condition 1:The **first message received for a specific TNL association** is not an E2 SETUP REQUEST, E2 SETUP RESPONSE, E2 SETUP FAILURE or E2 NODE CONFIGURATION UPDATE message then this **shall be treated as a logical error**.
- Condition 2:The E2 node **does not receive either the E2 SETUP RESPONSE message or the E2 SETUP FAILURE message**, the E2 node may **reinitiate the E2 Setup procedure** towards the same Near-RT RIC using the **same TNL association**, provided that the content of the new E2 SETUP REQUEST message is **identical to the content** of the previously unacknowledged E2 SETUP REQUEST message.
:::
### 3.1.1 Messages of E2 SETUP REQUEST
- Direction: E2 Node -> Near-RT RIC


### 3.1.2 Messages of E2 SETUP RESPONSE
- Direction: Near-RT RIC -> E2 Node


### 3.1.3 Messages of E2 SETUP FAILURE
- Direction: Near-RT RIC -> E2 Node

### 3.2 Reset procedure
:::success
**Goal:** **Align the resources** in E2 Node and Near-RT RIC in the **event of an abnormal failure**.
- The procedure **resets the E2 interface**.
- This procedure **doesn’t affect the application level configuration data exchanged** during the E2 Setup procedure, E2 Node Configuration Update procedure and RIC Service Update procedure.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:When the Reset procedure is initiated, the Near-RT RIC and E2 Node shall:
- **Delete any pre-established RIC Subscriptions**
- Gracefully **terminate any ongoing Near-RT RIC call processes** using INSERT, CONTROL or POLICY services while ensuring that **impact to ongoing calls for connected UE is minimized**.
- Part 2:After the **Reset has been completed**, the Near-RT RIC **shall re-issue any required Subscriptions**.
- Special Part:If the **RESET REQUEST message is received**, any other **ongoing procedure** (except for another Reset procedure) on the same E2 interface related to ongoing RIC Services **shall be aborted**.
**Flowchart from SPEC "E2GAP":**
- E2 Node initiate

- Near-RT RIC initiated

:::
:::danger
**Case 2:Abnormal Conditions**
- Condition:If the **initiating node does not receive the RESET RESPONSE message**, the initiating node may **reinitiate the Reset procedure** towards the same target node, provided that the content of the new RESET REQUEST message is **identical to the content** of the previously unacknowledged RESET REQUEST message.
:::
### 3.2.1 Messages of RESET REQUEST
- Direction: Near-RT RIC -> E2 Node, or E2 Node -> Near-RT RIC

### 3.2.2 Messages of RESET RESPONSE
- Direction: Near-RT RIC -> E2 Node, or E2 Node -> Near-RT RIC

### 3.3 Error Indication
:::success
**Goal:** **Report detected errors** when E2 Node or Near-RT RIC cannot be reported by an appropriate failure message.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:When the conditions defined in TS 36.413 are fulfilled, the Error Indication procedure is initiated by an **ERROR INDICATION message sent from the node detecting the error situation**.
- Part 2:The ERROR INDICATION message shall contain **at least either the Cause IE or the Criticality Diagnostics IE** and **may include RAN Function ID IE and RIC Request ID IE**.
**Flowchart from this SPEC:**

:::
### 3.3.1 Messages of ERROR INDICATION
- Direction: Direction: Near-RT RIC -> E2 Node, or E2 Node -> Near-RT RIC

### 3.4 RIC Service Update procedure
:::success
**Goal:** **Update application level configuration data** needed for E2 Node and Near-RT RIC to **interoperate correctly** over the E2 interface.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:An E2 Node initiates the procedure by **sending a RIC SERVICE UPDATE message** to the Near-RT RIC. Such message shall include **an appropriate set of up-to-date Near-RT RIC service-related configuration data**, including, but not limited to, **the complete lists of added, modified and deleted** supported Near-RT RIC Service functions that E2 Node has just taken into operational use along with a revision counter for each item in each list.
- Part 2:Upon reception of a RIC SERVICE UPDATE message, Near-RT RIC shall **update the information for E2 Node**.
- Part 3:These changes may be processed in the Near-RT-RIC and may **be used when issuing RIC SUBSCRIPTION REQUEST and RIC CONTROL to provide valid RAN Function ID IE**.
- Part 4:After successful update of requested information, Near-RT RIC shall **reply with the RIC SERVICE UPDATE ACKNOWLEDGE message to inform the initiating E2 Node** that the requested update of application data was performed successfully. In case the Near-RT RIC receives a RIC SERVICE UPDATE message **without any IE except for Message Type IE**, it shall reply with RIC SERVICE UPDATE ACKNOWLEDGE message **without performing any updates to the existing configuration**.
**Flowchart from SPEC "E2GAP":**

**Flowchart of RIC Service Update procedure by Nick-Bowei:**

:::
:::warning
**Case 2:Procedure is UnSucessful**
- Part 1:If the Near-RT RIC **cannot accept the update** it shall **respond with a RIC SERVICE UPDATE FAILURE message and appropriate cause value**.
- Part 2:If the RIC SERVICE UPDATE FAILURE message includes the **Time To Wait IE**, the E2 Node shall **wait at least for the indicated time before reinitiating the RIC Service Update procedure** towards the same Near-RT RIC. Both nodes shall continue to operate the E2 with their existing Near-RT RIC Service data.
**Figure of unsuccessful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- Condition 1:If the E2 Node after initiating a RIC Service Update procedure **receives neither the RIC SERVICE UPDATE ACKNOWLEDGE message nor the RIC SERVICE UPDATE FAILURE message**, the E2 Node may **reinitiate the RIC Service Update procedure** towards the same Near-RT RIC, provided that the content of the new RIC SERVICE UPDATE message is **identical to the content** of the previously unacknowledged RIC SERVICE UPDATE message.
- Condition 2:If the E2 Node receives a **RIC SERVICE QUERY message with one or more unknown entries** in the List of RAN Functions Accepted IE, then the E2 Node shall **ignore this list** and **resume with a complete list of supported functions**.
:::
* Update application level configuration data needed
* Unsuccessful :
* Near-RT RIC cannot accept the update
### 3.4.1 Messages of RIC SERVICE QUERY
- Direction: Near-RT RIC -> E2 Node

### 3.4.2 Messages of RIC SERVICE UPDATE
- Direction: E2 Node -> Near-RT RIC

### 3.4.3 Messages of RIC SERVICE UPDATE ACKNOWLEDGE
- Direction: Near-RT RIC -> E2 Node

### 3.4.4 Messages of RIC SERVICE UPDATE FAILURE
- Direction: Near-RT RIC -> E2 Node

### 3.5 E2 Node Configuration Update procedure
:::success
**Goal:** Update application level E2 Node configuration data needed for E2 Node and Near-RT RIC to interoperate correctly over the E2 interface and to support E2 Node initiated TNL association removal.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:An E2 Node initiates the procedure by **sending a E2 NODE CONFIGURATION UPDATE message** to the Near-RT RIC. Such message shall include **an appropriate set of up-to-date E2 Node-related configuration data** that the E2 Node has just taken into operational use.
- Part 2:Upon reception of the E2 NODE CONFIGURATION UPDATE message, Near-RT RIC shall **update the information for the E2 Node**.
- Part 3:If **Global E2 Node ID IE is contained** in the E2 NODE CONFIGURATION UPDATE message for a **newly established SCTP association**, the Near-RT RIC will associate this association with the related E2 Node.
- Part 4:After successful update of requested information, Near-RT RIC shall **reply with the E2 NODE CONFIGURATION UPDATE ACKNOWLEDGE message to inform the initiating E2 Node** that the requested update of application data was performed successfully.
**Flowchart from SPEC "E2GAP":**

:::
:::warning
**Case 2:Procedure is UnSucessful**
- Part 1:If Near-RT RIC **cannot accept the E2 NODE CONFIGURATION UPDATE message** it shall **respond with the E2 NODE CONFIGURATION UPDATE FAILURE message and appropriate cause value**.
- Part 2:If the E2 NODE CONFIGURATION UPDATE FAILURE message includes the **Time To Wait IE** the E2 Node **shall wait at least for the indicated time before reinitiating the E2 Node Configuration Update procedure** towards the same Near-RT RIC. Both nodes shall continue to operate with their existing configuration data.
**Figure of unsuccessful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- If an E2 Node, after initiating the E2 Node Configuration Update procedure, **receives neither the E2 NODE CONFIGURATION UPDATE ACKNOWLEDGE message nor the E2 NODE CONFIGURATION UPDATE FAILURE message**, the E2 Node may **reinitiate the E2 Node Configuration Update procedure** towards the same Near-RT RIC, provided that the content of the new E2 NODE CONFIGURATION UPDATE message is **identical to the content** of the previously unacknowledged E2 NODE CONFIGURATION UPDATE message.
:::
### 3.5.1 Messages of E2 NODE CONFIGURATION UPDATE
- Direction: E2 Node -> Near-RT RIC


### 3.5.2 Messages of E2 NODE CONFIGURATION UPDATE ACKNOWLEDGE
- Direction: Near-RT RIC -> E2 Node

### 3.5.3 Messages of E2 NODE CONFIGURATION UPDATE FAILURE
- Direction: Near-RT RIC -> E2 Node

### 3.6 E2 Connection Update procedure
:::success
**Goal:** Update procedure is to allow the Near-RT RIC to update the E2 interface connection between the E2 Node and Near-RT RIC.
:::
:::info
**Case 1:Procedure is Sucessful**
- Part 1:The Near-RT RIC initiates the procedure by **sending a E2 CONNECTION UPDATE message** to the E2 Node. Such message shall include **an appropriate set of up-to-date E2 interface connection data** that the E2 Node shall **take into account** when modifying the E2 interface connection.
- Part 2:Upon reception of a E2 CONNECTION UPDATE message, the E2 Node shall update.
- Part 3:After successful update of E2 interface connection(s), the E2 Node shall **reply with the E2 CONNECTION UPDATE ACKNOWLEDGE message** to inform the initiating Near-RT RIC that the requested E2 connection update was performed successfully. In case the E2 Node receives a E2 CONNECTION UPDATE message **without any IE except for Message Type IE and Transaction ID IE**, it shall reply with the E2 CONNECTION ACKNOWLEDGE message **without performing any updates to the existing connections**.
**Flowchart from this SPEC:**

:::
:::warning
**Case 2:Procedure is UnSucessful**
- Part 1:If the E2 Node **cannot accept the update**, it shall **respond with a E2 CONNECTION UPDATE FAILURE message and appropriate cause value**.
- Part 2:If the E2 CONNECTION UPDATE FAILURE message includes the **Time To Wait IE**, the Near-RT RIC shall **wait at least for the indicated time before reinitiating the E2 Connection Update procedure** towards the same E2 Node. Both nodes shall continue to operate with their existing connection(s).
**Figure of unsuccessful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- If the Near-RT RIC, after initiating E2 Connection Update procedure, **receives neither the E2 CONNECTION UPDATE ACKNOWLEDGE message nor the E2 CONNECTION UPDATE FAILURE message**, the Near-RT RIC may **reinitiate the E2 Connection Update procedure** towards the same E2 Node, provided that the content of the new E2 CONNECTION UPDATE message is **identical to the content** of the previously unacknowledged E2 CONNECTION UPDATE message.
:::
### 3.6.1 Messages of E2 CONNECTION UPDATE
- Direction: Near-RT RIC -> E2 Node

### 3.6.2 Messages of E2 CONNECTION UPDATE ACKNOWLEDGE
- Direction: E2 Node -> Near-RT RIC

### 3.6.3 Messages of E2 CONNECTION UPDATE FAILURE
- Direction: E2 Node -> Near-RT RIC

### 3.7 E2 Removal procedure
:::success
**Goal:** **Remove the E2 signaling connection** between the Near-RT RIC and the E2 node in a controlled manner.
- If successful, this procedure **erases any existing application level configuration data** in the Near-RT RIC and the E2 node, respectively.
:::
:::info
**Case 1:Procedure is Sucessful**
**E2 Node initiated**
- The E2 Node initiates the procedure by **sending the E2 REMOVAL REQUEST message** to the Near-RT RIC. Upon reception of the E2 REMOVAL REQUEST message, the Near-RT RIC shall **reply with the E2 REMOVAL RESPONSE message**.
- After receiving the E2 REMOVAL RESPONSE message, the E2 Node shall **initiate removal of the TNL association** towards the Near-RT RIC, and shall **remove all resources associated with that E2 signaling connection**.
- The Near-RT RIC **shall then remove all resources associated with that E2 signaling connection**.
**Near-RT RIC initiated**
- The Near-RT RIC initiates the procedure by **sending the E2 REMOVAL REQUEST message** to the E2 node. Upon reception of the E2 REMOVAL REQUEST message the E2 node shall **reply with the E2 REMOVAL RESPONSE message**.
- After receiving the E2 REMOVAL RESPONSE message, the Near-RT RIC may **initiate removal of the TNL association** towards the E2 node, and **shall remove all resources associated with that E2 signaling connection**.
- The E2 node shall then **remove all resources associated with that E2 signaling connection**.
**Special Part:** If the **E2 REMOVAL REQUEST message is received**, any **other ongoing procedure** on the same E2 interface related to ongoing RIC Services **shall be aborted**.
**Flowchart from SPEC "E2GAP":**
- E2 Node initiated

- Near-RT RIC initiated

:::
:::warning
**Case 2:Procedure is UnSucessful**
- If the E2 Node or Near-RT RIC **cannot accept the E2 REMOVAL REQUEST** it shall respond with **E2 REMOVAL FAILURE message with an appropriate cause value**.
**Figure of unsuccessful case from this SPEC:**

:::
:::danger
**Case 2.1:Abnormal Conditions**
- Condition 1:If the Near-RT RIC, after initiating E2 Removal procedure, **receives neither the E2 REMOVAL RESPONSE message nor the E2 REMOVAL FAILURE message**, the Near-RT RIC may **reinitiate the E2 Removal procedure** towards the same E2 Node, provided that the content of the new E2 REMOVAL REQUEST message is **identical to the content** of the previously unacknowledged E2 REMOVAL REQUEST message.
- Condition 2:If the E2 Node, after initiating E2 Removal procedure, **receives neither the E2 REMOVAL RESPONSE message nor the E2 REMOVAL FAILURE message**, the E2 Node may **reinitiate the E2 Removal procedure** towards the Near-RT RIC, provided that the content of the new E2 REMOVAL REQUEST message is **identical to the content** of the previously unacknowledged E2 REMOVAL REQUEST message.
:::
### 3.7.1 Messages of E2 REMOVAL REQUEST
- Direction: Near-RT RIC -> E2 Node or E2 Node -> Near-RT RIC

### 3.7.2 Messages of E2 REMOVAL RESPONSE
- Direction: Near-RT RIC -> E2 Node or E2 Node -> Near-RT RIC

### 3.7.3 Messages of E2 REMOVAL FAILURE
- Direction: Near-RT RIC -> E2 Node or E2 Node -> Near-RT RIC
