---
# System prepended metadata

title: Daily Note 14/07/2020
tags: [O-RAN, Daily Notes]

---

# Daily Note 14/07/2020
###### tags: `Daily Notes` , `O-RAN`
## Name : Christofel Rio Goenawan
## University : Bandung Institute of Technology (ITB)


---

## Schedule:
1. Study about services in A1 Protocol.
2. Study detailed about procedure of the A1 policy management services.
3. Try to use sudo command in NTUST server.
## Outcome : 
1. Explain the detailed use case of Non- RT RIC.
2. Explain detailed background of A1 interface.
3. Exlain works of A1 interface in O- RAN Architecture.
## Further Plan : 
- Study more detailed about AIO Installation in Kubernets
- Study more detailed about Acumos AI architectures in Kubernetes.
- Try to deploy AIO in NTUST server.


---

## Daily Log

### 1. Study about services in A1 Protocol. <mark>(9.00)</mark>
- Study more detail explanation in [documentation](https://static1.squarespace.com/static/5ad774cce74940d7115044b0/t/5d56c1f858dd040001fa1b71/1565966861943/ORAN-WG2.UsecaseRequirements.v01.00.pdf) and other resources.


### 2. Study detailed about procedure of the A1 policy management services. <mark>(10.30)</mark>
- Study more detail explanation in [documentation](https://docs.acumos.org/en/clio/submodules/system-integration/docs/oneclick-deploy/user-guide.html#deployment-notes-for-specific-k8s-distributions) and other resources.

### 3. Try to use sudo command in NTUST server. <mark>(14.30)</mark>
- Study more detail explanation in [documentation](https://docs.acumos.org/en/clio/submodules/system-integration/docs/oneclick-deploy/user-guide.html#deployment-notes-for-specific-k8s-distributions) and other resources.


---

## Report


### 1. Services in A1 Application Protocol (A1AP)

> In this note Writer use [Documentation](https://www.o-ran.org/s/O-RANWG2A1AP-v0101.docx) and [Akmal's Notes](https://hackmd.io/@akmalns/B1UNzzV1v) as study sources. 

:::success
#### Important Terms

There are 4 important terms in A1AP as below.

1. **A1 policy** : **Declarative policy** that is **identified by its PolicyID** and contains a scope identifier and one or more policy statements.
2. **Policy identifer** :**Identifier of an A1 policy** that is used in policy operations.
3. **Scope identifier** :	**Identifier of what the statements in the policy applies to** (UE, group of UEs, slice, QoS flow, network resource or combinations thereof).
4. **Policy Statement** : **Expression of a directive in an A1 policy that is related to policy objectives and/or policy resources** and are to be applied to/for the entities identified by the scope identifier.
5. **Policy object** :	**Representation of an A1 policy in JSON format** used as payload in HTTP based policy procedures.
:::

#### Services in A1AP

The A1AP contain three APIs that are:

1. A1-P : Policy Management Service
2. A1-ML : ML Model Management Service
3. A1-E1 : Enrichment Information Service

The A1AP is based on **signaling between an A1 service consumer and an A1 service producer residing in the non-RT RIC or in the near-RT RIC**. The simple diagram can be shown as below.

![](https://i.imgur.com/kjwr03O.png)


The interactions between Service Consumer and Service Producer is based on the service framework where requests are sent from the Consumer and responses and notifications are sent from the from the Producer. It is the Producer that handles the resources on which the Consumer performs operations.

---

### 2. How Policy Management Services Works ?

#### Policy Management Service

The A1AP realizes the A1 policy procedures defined in A1GAP using HTTP operations where a policy is represented as a JSON object. The simple model can be shown as below.

![](https://i.imgur.com/Zk6blS7.png)

#### Policy Representations

The following principles are used for A1 policies when JSON is used as resource representation format:

-	A policy corresponds to a resource (in the REST sense).
-	A policy is represented as a JSON object referred to as a policy object.
-	A policy object contains a scope identifier and at least one policy statement .
-	A policy is identified by a policyId that is included in the URI when operation is for a single policy.
-	The policyId is assigned by the A1-P Consumer when the policy is created.
-	The A1-P Producer cannot modify or delete a policy.
-	Policy feedback for a specifc policy is subscribed to when the policy is created by providing a callback URI in the create policy operation.
-	A policy object does not contain any information related to which internal function in the near-RIC that is to evaluate the policy.

#### Representation Objects

There are 3 representation objects in A1AP as below.

1. **PolicyObject** : The policy object is the JSON representation of a complete A1 policy.
2. **PolicyStatusObject** : The policy status object is the JSON representation of the enforcement status of an A1 policy.
3. **ProblemDetails** : The problem details object is the JSON representation of the content in a response message with other HTTP error response codes (4xx/5xx).

#### Resource Indetifiers

The main URI for A1 policies is:
```
…/policies
```

A single policy can be operated upon by adding the value of the policy identifier to the URI:

```
…/policies/{policyId}
```

The main URI for status of a single policy is:
```
…/policies/{policyId}/status
```
The URI for policy notification is referred to as the notificationDestination and is based on a callback URI provided when creating a policy.

#### Service Operation

The mapping between the A1 policy procedures and the HTTP methods used to realise them can be shown as below.

![](https://i.imgur.com/3NGU1Rp.png)

---
### 3. Service Operations

An A1 policy is created using a HTTP PUT request containing a policy object in the payload. The format of the policy object is checked, and the request is either accepted or rejected. If accepted, the policy is to be enforced. Some kind of service operations can be shown as below.

1. **Create Policy**
a. **Create Single Policy**
The procedure is as follows:
- The A1-P Consumer generates the policyId and sends a HTTP PUT request to the A1-P Producer. The target URI identifies the resource (policyId) under which the new policy shall be created. 
- The A1-P Producer returns the HTTP PUT response. On success, “201” is returned. The location header is present and carries the URI of the new policy and the message body the complete policy object. On failure, the appropriate error code is returned and the message body may contain additional error information.
![](https://i.imgur.com/2O49Th8.png)
b. **Create Multiple Policies**
The operation to create multiple policies is a sequence of operations to create a single policy.

2. **Query Policy**
A1-P Consumer can use the query policy procedure to read a single policy or to check which policies that exist.
a. **Query Single Policy**
![](https://i.imgur.com/b6u9eHr.png)
b. **Query Multiple Policies**
The operation to query multiple policies is a sequence of operations to query a single policy.
c. **Query All Policies**
![](https://i.imgur.com/4wKcyX9.png)

3. **Update Policy**
A1-P Consumer can use the update policy procedure to completely replace one policy.
a. **Update Single Policy**
![](https://i.imgur.com/3AF7zZe.png)
b. **Update Multiple Policy**
The operation to update multiple policies is a sequence of operations to update a single policy.
4. **Delete Policy**
A1-P Consumer can use the delete policy procedure to delete a single policy or to delete multiple policies.
a. **Delete Single Policy**
![](https://i.imgur.com/2iv9wcz.png)
b. **Delete Multiple Policies**
The operation to delete multiple policies is a sequence of operations to delete a single policy.

5. **Policy Feedback**
Policy feedback is an operation that **requires the A1-P Producer to have a reduced feature HTTP Client for sending HTTP POST requests and receiving HTTP POST responses. Correspondingly, the A1-P Consumer is required to have a reduced feature HTTP Server for receiving HTTP POST requests and sending HTTP POST responses**.
The A1-P Producer uses the policy feedback operation to notify the A1-P Consumer about **Changes in the policy enforcement status for an A1 policy**.
The simple scheme can be shown as below.
![](https://i.imgur.com/WXlDCzq.png)



---

### 3. API Definition

>In this note Writer use [Documentation](https://www.o-ran.org/s/O-RANWG2A1AP-v0101.docx)  as study sources. 

The A1-P service shall use the A1-P API.
The request URI used in HTTP request from the A1-P consumer towards the A1-P producer shall have the structure defined as below.

```
{apiRoot}/<apiName>/{apiVersion}/<apiSpecificResourceUriPart>
```

apiRoot should be a concatenation of the following parts:

- scheme (“https”)
- The fixed string “://”
- Authority (host and optional port) as defined in IETF RFC 3986

**apiName** should be **“A1-P”**
**apiVersion** should be **“v1”**

**apiSpecificResourceUriPart** should be as be defined below in resource section.

![](https://i.imgur.com/ycgT1Gt.png)


Overview of the resources and applicable HTTP methods can be shown as below.

![](https://i.imgur.com/vGivDjh.png)

#### Individual Policy Object
##### Resource Standard Methods

**HTTP PUT**

![](https://i.imgur.com/vpeBL5L.png)


**HTTP GET**

![](https://i.imgur.com/yGEvoBQ.png)

**HTTP DELETE**

![](https://i.imgur.com/dGins3o.png)

#### Individual Policy Status Object
##### Resource Standard Methods

**HTTP GET**
![](https://i.imgur.com/54rkAGU.png)

#### All Policy Indentities
##### Resource Standard Methods

**HTTP GET**
![](https://i.imgur.com/wZVPp7w.png)

---

### 4. A1 Interface Protocol Stack

The simple protocol stack can be shown as below.

![](https://i.imgur.com/3o6VzNi.png)

1. TCP provides the communication service at the transport layer
2. TLS is used to provide secure HTTP connections
3. HTTP/1.1 is used as application level protocol
4. The data interchange layer constitutes the transport of documents in the JSON format


--- 

### 5. Try Sudo Command in NTUST Server

Writer try to use sudo command in NTUST server by list all available command using the code below.

```
sudo -l
```
Then the result can be seen as below.

![](https://i.imgur.com/lMvyhEc.png)

From the result Writer successfully use sudo command in NTUST server and can use all sudo command. Yeaayyy....

---


## Reference
1. https://www.o-ran.org/s/O-RANWG2A1AP-v0101.docx
2. https://www.programmersought.com/article/3984216951/