Tommy Carpenter | 4249398 | 2019-11-06 07:27:16 -0500 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. SPDX-License-Identifier: CC-BY-4.0 |
| 3 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 4 | Overview |
| 5 | ======== |
Tommy Carpenter | 3959ac9 | 2019-11-19 13:13:40 -0500 | [diff] [blame] | 6 | |
Lott, Christopher (cl778h) | c91a4a1 | 2020-05-27 15:56:20 -0400 | [diff] [blame] | 7 | .. contents:: |
| 8 | :depth: 3 |
| 9 | :local: |
| 10 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 11 | The RAN Intelligent Controller (RIC) Platform's A1 Mediator component |
| 12 | listens for policy type and policy instance requests sent via HTTP |
| 13 | (the "northbound" interface), and publishes those requests to running |
| 14 | xApps via RMR messages (the "southbound" interface). |
Lott, Christopher (cl778h) | 14d016e | 2020-04-27 10:45:47 -0400 | [diff] [blame] | 15 | |
Tommy Carpenter | 50487bf | 2019-11-19 15:04:47 -0500 | [diff] [blame] | 16 | Code |
| 17 | ---- |
Lott, Christopher (cl778h) | 14d016e | 2020-04-27 10:45:47 -0400 | [diff] [blame] | 18 | |
| 19 | Code is managed in this Gerrit repository: |
| 20 | |
Tommy Carpenter | 50487bf | 2019-11-19 15:04:47 -0500 | [diff] [blame] | 21 | https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/a1 |
| 22 | |
Tommy Carpenter | dd29e4d | 2019-11-19 09:35:23 -0500 | [diff] [blame] | 23 | |
| 24 | Policy Overview |
Tommy Carpenter | 3959ac9 | 2019-11-19 13:13:40 -0500 | [diff] [blame] | 25 | ---------------- |
Tommy Carpenter | dd29e4d | 2019-11-19 09:35:23 -0500 | [diff] [blame] | 26 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 27 | There are two "object types" associated with policy: policy types and |
| 28 | policy instances. |
Tommy Carpenter | dd29e4d | 2019-11-19 09:35:23 -0500 | [diff] [blame] | 29 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 30 | Policy Types |
| 31 | ~~~~~~~~~~~~ |
Tommy Carpenter | dd29e4d | 2019-11-19 09:35:23 -0500 | [diff] [blame] | 32 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 33 | Policy types define the name, description, and most importantly the |
| 34 | schema of all instances of that type. Think of policy types as |
| 35 | defining a JSON schema for the messages sent from A1 to xapps. Xapps |
| 36 | do not receive policy types from A1; types are used only by A1 to |
| 37 | validate instance creation requests. However, xapps must register to |
| 38 | receive instances of type ids in their xapp descriptor. Xapp |
| 39 | developers can also create new policy types, though the exact process |
| 40 | of where these are stored is still TBD. For practical purposes, when |
| 41 | the RIC is running, A1s API needs to be invoked to load the policy |
| 42 | types before instances can be created. Xapps can "sign up" for |
| 43 | multiple policy types using their xapp descriptor. |
Tommy Carpenter | dd29e4d | 2019-11-19 09:35:23 -0500 | [diff] [blame] | 44 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 45 | Policy Instances |
| 46 | ~~~~~~~~~~~~~~~~ |
Tommy Carpenter | dd29e4d | 2019-11-19 09:35:23 -0500 | [diff] [blame] | 47 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 48 | Policy instances are concrete instantiations of a policy type. They |
| 49 | give concrete values of a policy. There may be many instances of a |
| 50 | single type. Whenever a policy instance is created in A1, messages are |
| 51 | sent over RMR to all xapps registered for that policy type; see below. |
| 52 | Xapps are expected to handle multiple simultaneous instances of each |
| 53 | type that they are registered for. |
Tommy Carpenter | 5957e31 | 2019-12-12 09:47:05 -0500 | [diff] [blame] | 54 | |
| 55 | |
| 56 | Known differences from A1 1.0.0 spec |
| 57 | ------------------------------------ |
Tommy Carpenter | 5957e31 | 2019-12-12 09:47:05 -0500 | [diff] [blame] | 58 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 59 | This is a list of some of the known differences between the API here |
| 60 | and the a1 spec dated 2019.09.30. In some cases, the spec is |
| 61 | deficient and RIC is "ahead", in other cases this does not yet conform |
| 62 | to recent spec changes. |
Tommy Carpenter | 5957e31 | 2019-12-12 09:47:05 -0500 | [diff] [blame] | 63 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 64 | #. [RIC is ahead] There is no notion of policy types in the spec, |
| 65 | however this aspect is quite critical for the intended use of the |
| 66 | RIC, where many Xapps may implement the same policy, and new Xapps |
| 67 | may be created often that define new types. Moreover, policy types |
| 68 | define the schema for policy instances, and without types, A1 |
| 69 | cannot validate whether instances are valid, which the RIC A1m |
| 70 | does. The RIC A1 Mediator view of things is that, there are a set |
| 71 | of schemas, called policy types, and one or more instances of each |
| 72 | schema can be created. Instances are validated against types. The |
| 73 | spec currently provides no mechanism for the implementation of A1 |
| 74 | to know whether policy [instances] are correct since there is no |
| 75 | schema for them. This difference has the rather large consequence |
| 76 | that none of the RIC A1m URLs match the spec. |
| 77 | #. [RIC is ahead] There is a rich status URL in the RIC A1m for policy |
| 78 | instances, but this is not in the spec. |
| 79 | #. [RIC is ahead] There is a state machine for when instances are |
| 80 | actually deleted from the RIC (at which point all URLs referencing |
| 81 | it are a 404); this is a configurable option when deploying the RIC |
| 82 | A1m. |
| 83 | #. [CR coming to spec] The spec contains a PATCH for partially |
| 84 | updating a policy instance, and creating/deleting multiple |
| 85 | instances, however the team agreed to remove this from a later |
| 86 | version of the Spec. The RIC A1m does not have this operation. |
| 87 | #. [Spec is ahead] The RIC A1 PUT bodies for policy instances do not |
| 88 | exactly conform to the "scope" and "statements" block that the spec |
| 89 | defines. They are very close otherwise, however. (I would argue |
| 90 | some of the spec is redundant; for example "policy [instance] id" |
| 91 | is a key inside the PUT body to create an instance, but it is |
| 92 | already in the URL.) |
| 93 | #. [Spec is ahead] The RIC A1m does not yet notify external clients |
| 94 | when instance statuses change. |
| 95 | #. [Spec is ahead] The spec defines that a query of all policy |
| 96 | instances should return the full bodies, however right now the RIC |
| 97 | A1m returns a list of IDs (assuming subsequent queries can fetch |
| 98 | the bodies). |
| 99 | #. [?] The spec document details some very specific "types", but the |
| 100 | RIC A1m allows these to be loaded in (see #1). For example, spec |
| 101 | section 4.2.6.2. We believe this should be removed from the spec |
| 102 | and rather defined as a type. Xapps can be created that define new |
| 103 | types, so the spec will quickly become "stale" if "types" are |
| 104 | defined in the spec. |
Tommy Carpenter | 0719e9e | 2020-01-16 11:23:02 -0500 | [diff] [blame] | 105 | |
| 106 | |
| 107 | Resiliency |
| 108 | ---------- |
| 109 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 110 | A1 is resilient to the majority of failures, but not all currently |
| 111 | (though a solution is known). |
Tommy Carpenter | 0719e9e | 2020-01-16 11:23:02 -0500 | [diff] [blame] | 112 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 113 | A1 uses the RIC SDL library to persist all policy state information: |
| 114 | this includes the policy types, policy instances, and policy statuses. |
| 115 | If state is built up in A1, and A1 fails (where Kubernetes will then |
| 116 | restart it), none of this state is lost. |
Tommy Carpenter | 0719e9e | 2020-01-16 11:23:02 -0500 | [diff] [blame] | 117 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 118 | The tiny bit of state that *is currently* in A1 (volatile) is its |
| 119 | "next second" job queue. Specifically, when policy instances are |
| 120 | created or deleted, A1 creates jobs in a job queue (in memory). An |
| 121 | rmr thread polls that thread every second, dequeues the jobs, and |
| 122 | performs them. |
Tommy Carpenter | 0719e9e | 2020-01-16 11:23:02 -0500 | [diff] [blame] | 123 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 124 | If A1 were killed at *exactly* the right time, you could have jobs |
| 125 | lost, meaning the PUT or DELETE of an instance wouldn't actually take. |
| 126 | This isn't drastic, as the operations are idempotent and could always |
| 127 | be re-performed. |
Tommy Carpenter | 0719e9e | 2020-01-16 11:23:02 -0500 | [diff] [blame] | 128 | |
Lott, Christopher (cl778h) | 39c9ab6 | 2020-05-27 09:45:49 -0400 | [diff] [blame] | 129 | In order for A1 to be considered completely resilient, this job queue |
| 130 | would need to be moved to SDL. SDL uses Redis as a backend, and Redis |
| 131 | natively supports queues via LIST, LPUSH, RPOP. I've asked the SDL |
| 132 | team to consider an extension to SDL to support these Redis |
| 133 | operations. |