Add support for Insert type subscriptions 52/4552/1
authorAnssi Mannila <anssi.mannila@nokia.com>
Mon, 17 Aug 2020 10:00:20 +0000 (13:00 +0300)
committerAnssi Mannila <anssi.mannila@nokia.com>
Mon, 17 Aug 2020 10:02:02 +0000 (13:02 +0300)
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
Change-Id: Ie629ddc4c01ff4394a0f322f48108b02ed94075d

container-tag.yaml
docs/user-guide.rst
go.sum
pkg/control/registry.go
pkg/control/ut_messaging_test.go

index 9182b1e..4e396ef 100644 (file)
@@ -2,4 +2,4 @@
 # By default this file is in the docker build directory,
 # but the location can configured in the JJB template.
 ---
-tag: "0.5.1"
+tag: "0.5.2"
index 10a18e8..73a9cb7 100755 (executable)
@@ -37,8 +37,8 @@ sends response to xApp.
 There can be only one ongoing RIC Subscription or RIC Subscription Delete procedure towards RAN at any time. That is because Subscription
 Manager is able to merge new subscriptions only which those it has already received successful response from RAN. Subscriptions
 and delete subscriptions are therefore queued in Subscription Manager. Subscription Manager may need to do reties during subscribe or
-unsubscribe procedure. As it can increase completion time of the procedure, this needs to be considered when retries are implemented
-in xApp side. xApp's retry delay should not be too short.
+unsubscribe procedure. This needs to be considered when retries are implemented in xApp side, as it can increase completion time of the
+procedure. xApp's retry delay should not be too short.
 
     .. image:: images/PlaceInRICSoftwareArchitecture.png
       :width: 600
@@ -67,11 +67,9 @@ Architecture
       header when E2 Termination sends the subscribed message to xApp. When xApp wants to delete the subscription, the same sequence number
       must be included in the ASN.1 encoded RIC Subscription Delete Request message sent to Subscription Manager.
 
-      Subscription Manager responds to xApp with xApp allocated RIC Requestor ID. In merge case subscription is created only for the first
-      requestor. RAN gets the Requestor ID of the xApp who makes the first subscription. RAN uses that Requestor ID in all RIC Indication
-      messages it sends to RIC for the subscription. Therefore xApp may get Requestor ID in RIC Indication message that belongs to another xApp.
-      The xApp whose subscription is merged into the first subscription will also get Requestor ID of the first subscribed xApp in the RIC
-      Subscription Response and RIC Subscription Delete Response messages.
+      Subscription Manager allocates RIC Requestor ID. Currently the ID value is always 123. In merge case subscription is created only for
+      the first requestor. RAN gets the Request of the xApp who makes the first subscription. RAN uses Subscription Manager allocated Requestor
+      ID in all RIC Indication messages it sends to RIC for the subscription.
 
       TransactionId (Xid) in RMR message header is used to track messages between xApp and Subscription Manager. xApp allocates it. Subscription
       Manager returns TransactionId received from xApp in response message to xApp. xApp uses it to map response messages to request messages
@@ -90,13 +88,11 @@ Architecture
       RIC Indication messages which are used to transport subscribed messages from RAN are routed from E2 Termination to xApps
       directly using the routes created during Subscription procedure.
 
-      ``Routing manager has 1 second delay in routing create in R3 release before it responds to Subscription Manager. That is because of delay in route create to RMR.``
-
-      Subscription Manager supports REPORT and POLICY type subscriptions (RICActionTypes). CONTROL and INSERT are not supported. POLICY type
+      Subscription Manager supports REPORT, POLICY and INSERT type subscriptions (RICActionTypes). CONTROL is not supported. POLICY type
       subscription can be updated. In update case signaling sequence is the same as above, except route is not created to Routing manager.
       xApp uses initially allocated TransactionId and RIC Request Sequence Number in update case. Route in POLICY type subscription case is needed
       only that Subscription Manager can send response messages to xApp. RIC Subscription Request message contains list of RICaction-ToBeSetup-ItemIEs.
-      The list cannot have both REPORT and POLICY action types at the same time. Subscription Manager checks actions types in the message.
+      The list cannot have REPORT, POLICY, INSERT action types at the same time. Subscription Manager checks actions types in the message.
       If both action types is found the message is dropped.
 
 
@@ -232,6 +228,7 @@ Supported E2 procedures and RAN services
 
       - REPORT
       - POLICY
+      - INSERT
 
     * RIC Subscription Delete procedure
 
diff --git a/go.sum b/go.sum
index e2897ba..63bab2b 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -13,6 +13,8 @@ gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2 h1:UK7awyRKIkVdokWvvkYvazlg3EWIfM
 gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
 gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.17 h1:Cl/IVxvymTobUovUEiFc3mdMzhk1epSSKEYbBKEHkPE=
 gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.17/go.mod h1:bjhhEII07w+zPQzyvqTq84TjKQPa6IkcnSyWB1DfGHo=
+gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.18 h1:z/p6unCmbSAK2w8cwSPn1vISSiJ5PtPkheI6AwAmayI=
+gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.18/go.mod h1:bjhhEII07w+zPQzyvqTq84TjKQPa6IkcnSyWB1DfGHo=
 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
index 275d572..9e4eaaa 100644 (file)
@@ -196,6 +196,7 @@ func (r *Registry) AssignToSubscription(trans *TransactionXapp, subReqMsg *e2ap.
 func (r *Registry) CheckActionTypes(subReqMsg *e2ap.E2APSubscriptionRequest) (uint64, error) {
        var reportFound bool = false
        var policyFound bool = false
+       var insertFound bool = false
 
        for _, acts := range subReqMsg.ActionSetups {
                if acts.ActionType == e2ap.E2AP_ActionTypeReport {
@@ -204,9 +205,12 @@ func (r *Registry) CheckActionTypes(subReqMsg *e2ap.E2APSubscriptionRequest) (ui
                if acts.ActionType == e2ap.E2AP_ActionTypePolicy {
                        policyFound = true
                }
+               if acts.ActionType == e2ap.E2AP_ActionTypeInsert {
+                       insertFound = true
+               }
        }
-       if reportFound == true && policyFound == true {
-               return e2ap.E2AP_ActionTypeInvalid, fmt.Errorf("Report and Policy in same RICactions-ToBeSetup-List")
+       if reportFound == true && policyFound == true || reportFound == true && insertFound == true || policyFound == true && insertFound == true {
+               return e2ap.E2AP_ActionTypeInvalid, fmt.Errorf("Different action types (Report, Policy or Insert) in same RICactions-ToBeSetup-List")
        }
        if reportFound == true {
                return e2ap.E2AP_ActionTypeReport, nil
@@ -214,6 +218,9 @@ func (r *Registry) CheckActionTypes(subReqMsg *e2ap.E2APSubscriptionRequest) (ui
        if policyFound == true {
                return e2ap.E2AP_ActionTypePolicy, nil
        }
+       if insertFound == true {
+               return e2ap.E2AP_ActionTypeInsert, nil
+       }
        return e2ap.E2AP_ActionTypeInvalid, fmt.Errorf("Invalid action type in RICactions-ToBeSetup-List")
 }
 
index 548950a..36e4f29 100644 (file)
@@ -1593,3 +1593,63 @@ func TestSubReqAndSubDelOkTwoE2termParallel(t *testing.T) {
        e2termConn2.TestMsgChanEmpty(t)
        mainCtrl.wait_registry_empty(t, 10)
 }
+
+//-----------------------------------------------------------------------------
+// TestSubReqInsertAndSubDelOk
+//
+//   stub                          stub
+// +-------+     +---------+    +---------+
+// | xapp  |     | submgr  |    | e2term  |
+// +-------+     +---------+    +---------+
+//     |              |              |
+//     | SubReq       |              |
+//     |------------->|              |
+//     |              |              |
+//     |              | SubReq       |
+//     |              |------------->|
+//     |              |              |
+//     |              |      SubResp |
+//     |              |<-------------|
+//     |              |              |
+//     |      SubResp |              |
+//     |<-------------|              |
+//     |              |              |
+//     |              |              |
+//     | SubDelReq    |              |
+//     |------------->|              |
+//     |              |              |
+//     |              | SubDelReq    |
+//     |              |------------->|
+//     |              |              |
+//     |              |   SubDelResp |
+//     |              |<-------------|
+//     |              |              |
+//     |   SubDelResp |              |
+//     |<-------------|              |
+//
+//-----------------------------------------------------------------------------
+func TestSubReqInsertAndSubDelOk(t *testing.T) {
+       CaseBegin("TestInsertSubReqAndSubDelOk")
+
+       rparams1 := &teststube2ap.E2StubSubsReqParams{}
+       rparams1.Init()
+       rparams1.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypeInsert
+       cretrans := xappConn1.SendSubsReq(t, rparams1, nil)
+
+       crereq, cremsg := e2termConn1.RecvSubsReq(t)
+       e2termConn1.SendSubsResp(t, crereq, cremsg)
+       e2SubsId := xappConn1.RecvSubsResp(t, cretrans)
+       deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId)
+       delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
+
+       e2termConn1.SendSubsDelResp(t, delreq, delmsg)
+       xappConn1.RecvSubsDelResp(t, deltrans)
+
+       //Wait that subs is cleaned
+       mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+       xappConn1.TestMsgChanEmpty(t)
+       xappConn2.TestMsgChanEmpty(t)
+       e2termConn1.TestMsgChanEmpty(t)
+       mainCtrl.wait_registry_empty(t, 10)
+}