---
# System prepended metadata

title: VIAVI

---

# VIAVI

# 1. Map gNB-id E2 and VIAVI gNB:
## 1.1 Query from O1:
![image](https://hackmd.io/_uploads/B1DylA2XT.png)
```
[
    {
        "id": "1193047",
        "objectInstance": "ManagedElement=1193047",
        "GnbDuFunction": [
            {
                "id": "2",
                "objectInstance": "ManagedElement=1193047,GnbDuFunction=2",
                "attributes": {
                    "gnbId": "1193047",
                    "gnbIdLength": 24,
                    "gnbDuId": 2,
                    "gnbDuName": "S2"
                },
                "NrCellDu": [
                    {
                        "id": "2",
                        "objectInstance": "ManagedElement=1193047,GnbDuFunction=2,NrCellDu=2",
                        "attributes": {
                            "cellLocalId": 2,
                            "nrPci": 2,
                            "plmnInfoList": [
                                {
                                    "plmnId": {
                                        "mcc": "001",
                                        "mnc": "01"
                                    }
                                }
                            ],
                            "ssbFrequency": 3425,
                            "arfcnDL": 628333,
                            "arfcnUL": 628333,
                            "administrativeState": "UNLOCKED"
                        },
                        "viavi-attributes": {
                            "cellSize": "medium",
                            "cellName": "S2/N78/C1",
                            "siteName": "S2",
                            "latitude": 0.011049226644112328,
                            "longitude": 0.005038735277445361,
                            "advancedRfModel": {}
                        },
                        "CPCIConfigurationFunction": {
                            "id": "2",
                            "objectInstance": "ManagedElement=1193047,GnbDuFunction=2,NrCellDu=2,CPCIConfigurationFunction=2",
                            "attributes": {
                                "cSonPciList": {
                                    "NRPci": 2
                                }
                            }
                        }
                    }
                ],
                "NrSectorCarrier-Multiple": [
                    {
                        "id": "2",
                        "objectInstance": "ManagedElement=1193047,GnbDuFunction=2,NrSectorCarrier=2",
                        "attributes": {
                            "configuredMaxTxPower": 37
                        }
                    }
                ]
            }
        ],
        "GnbCuCpFunction": [
            {
                "id": "1",
                "objectInstance": "ManagedElement=1193047,GnbCuCpFunction=1",
                "attributes": {
                    "gnbId": "1193047",
                    "gnbIdLength": 24
                },
                "NrCellCu": [
                    {
                        "id": "2",
                        "objectInstance": "ManagedElement=1193047,GnbCuCpFunction=1,NrCellCu=2",
                        "attributes": {
                            "cellLocalId": 2
                        },
                        "CESManagementFunction": {
                            "id": "2",
                            "objectInstance": "ManagedElement=1193047,GnbCuCpFunction=1,NrCellCu=2,CESManagementFunction=2",
                            "attributes": {
                                "energySavingControl": "toBeNotEnergySaving",
                                "energySavingState": "isNotEnergySaving"
                            }
                        },
                        "NRCellRelation": [
                            {
                                "id": "1",
                                "objectInstance": "ManagedElement=1193047,GnbCuCpFunction=1,NrCellCu=2,NRCellRelation=1",
                                "attributes": {
                                    "adjacentNRCellRef": "ManagedElement=1193046,GnbCuCpFunction=1,NrCellCu=3",
                                    "isESCoveredBy": "FULL"
                                }
                            },
                            {
                                "id": "2",
                                "objectInstance": "ManagedElement=1193047,GnbCuCpFunction=1,NrCellCu=2,NRCellRelation=2",
                                "attributes": {
                                    "adjacentNRCellRef": "ManagedElement=1193048,GnbCuCpFunction=1,NrCellCu=1",
                                    "isESCoveredBy": "PARTIAL"
                                }
                            }
                        ]
                    }
                ]
            }
        ],
        "GnbCuUpFunction": [
            {
                "id": "1",
                "objectInstance": "ManagedElement=1193047,GnbCuUpFunction=1",
                "attributes": {
                    "gnbId": "1193047",
                    "gnbIdLength": 24,
                    "plmnInfoList": [
                        {
                            "plmnId": {
                                "mcc": "001",
                                "mnc": "01"
                            }
                        }
                    ]
                }
            }
        ]
    },
    {
        "id": "1193048",
        "objectInstance": "ManagedElement=1193048",
        "GnbDuFunction": [
            {
                "id": "1",
                "objectInstance": "ManagedElement=1193048,GnbDuFunction=1",
                "attributes": {
                    "gnbId": "1193048",
                    "gnbIdLength": 24,
                    "gnbDuId": 1,
                    "gnbDuName": "S1"
                },
                "NrCellDu": [
                    {
                        "id": "1",
                        "objectInstance": "ManagedElement=1193048,GnbDuFunction=1,NrCellDu=1",
                        "attributes": {
                            "cellLocalId": 1,
                            "nrPci": 1,
                            "plmnInfoList": [
                                {
                                    "plmnId": {
                                        "mcc": "001",
                                        "mnc": "01"
                                    }
                                }
                            ],
                            "ssbFrequency": 3425,
                            "arfcnDL": 628333,
                            "arfcnUL": 628333,
                            "administrativeState": "UNLOCKED"
                        },
                        "viavi-attributes": {
                            "cellSize": "medium",
                            "cellName": "S1/N78/C1",
                            "siteName": "S1",
                            "latitude": 0.006136459748603101,
                            "longitude": -0.01998398402001098,
                            "advancedRfModel": {}
                        },
                        "CPCIConfigurationFunction": {
                            "id": "1",
                            "objectInstance": "ManagedElement=1193048,GnbDuFunction=1,NrCellDu=1,CPCIConfigurationFunction=1",
                            "attributes": {
                                "cSonPciList": {
                                    "NRPci": 1
                                }
                            }
                        }
                    }
                ],
                "NrSectorCarrier-Multiple": [
                    {
                        "id": "1",
                        "objectInstance": "ManagedElement=1193048,GnbDuFunction=1,NrSectorCarrier=1",
                        "attributes": {
                            "configuredMaxTxPower": 37
                        }
                    }
                ]
            }
        ],
        "GnbCuCpFunction": [
            {
                "id": "1",
                "objectInstance": "ManagedElement=1193048,GnbCuCpFunction=1",
                "attributes": {
                    "gnbId": "1193048",
                    "gnbIdLength": 24
                },
                "NrCellCu": [
                    {
                        "id": "1",
                        "objectInstance": "ManagedElement=1193048,GnbCuCpFunction=1,NrCellCu=1",
                        "attributes": {
                            "cellLocalId": 1
                        },
                        "CESManagementFunction": {
                            "id": "1",
                            "objectInstance": "ManagedElement=1193048,GnbCuCpFunction=1,NrCellCu=1,CESManagementFunction=1",
                            "attributes": {
                                "energySavingControl": "toBeNotEnergySaving",
                                "energySavingState": "isNotEnergySaving"
                            }
                        },
                        "NRCellRelation": [
                            {
                                "id": "1",
                                "objectInstance": "ManagedElement=1193048,GnbCuCpFunction=1,NrCellCu=1,NRCellRelation=1",
                                "attributes": {
                                    "adjacentNRCellRef": "ManagedElement=1193046,GnbCuCpFunction=1,NrCellCu=3",
                                    "isESCoveredBy": "FULL"
                                }
                            },
                            {
                                "id": "2",
                                "objectInstance": "ManagedElement=1193048,GnbCuCpFunction=1,NrCellCu=1,NRCellRelation=2",
                                "attributes": {
                                    "adjacentNRCellRef": "ManagedElement=1193047,GnbCuCpFunction=1,NrCellCu=2",
                                    "isESCoveredBy": "PARTIAL"
                                }
                            }
                        ]
                    }
                ]
            }
        ],
        "GnbCuUpFunction": [
            {
                "id": "1",
                "objectInstance": "ManagedElement=1193048,GnbCuUpFunction=1",
                "attributes": {
                    "gnbId": "1193048",
                    "gnbIdLength": 24,
                    "plmnInfoList": [
                        {
                            "plmnId": {
                                "mcc": "001",
                                "mnc": "01"
                            }
                        }
                    ]
                }
            }
        ]
    },
    {
        "id": "1193046",
        "objectInstance": "ManagedElement=1193046",
        "GnbDuFunction": [
            {
                "id": "3",
                "objectInstance": "ManagedElement=1193046,GnbDuFunction=3",
                "attributes": {
                    "gnbId": "1193046",
                    "gnbIdLength": 24,
                    "gnbDuId": 3,
                    "gnbDuName": "S3"
                },
                "NrCellDu": [
                    {
                        "id": "3",
                        "objectInstance": "ManagedElement=1193046,GnbDuFunction=3,NrCellDu=3",
                        "attributes": {
                            "cellLocalId": 3,
                            "nrPci": 3,
                            "plmnInfoList": [
                                {
                                    "plmnId": {
                                        "mcc": "001",
                                        "mnc": "01"
                                    }
                                }
                            ],
                            "ssbFrequency": 900,
                            "arfcnDL": 180000,
                            "arfcnUL": 180000,
                            "administrativeState": "UNLOCKED"
                        },
                        "viavi-attributes": {
                            "cellSize": "medium",
                            "cellName": "S3/B8/C1",
                            "siteName": "S3",
                            "latitude": -0.008430883848154113,
                            "longitude": -0.007072224871557239,
                            "advancedRfModel": {}
                        },
                        "CPCIConfigurationFunction": {
                            "id": "3",
                            "objectInstance": "ManagedElement=1193046,GnbDuFunction=3,NrCellDu=3,CPCIConfigurationFunction=3",
                            "attributes": {
                                "cSonPciList": {
                                    "NRPci": 3
                                }
                            }
                        }
                    }
                ],
                "NrSectorCarrier-Multiple": [
                    {
                        "id": "3",
                        "objectInstance": "ManagedElement=1193046,GnbDuFunction=3,NrSectorCarrier=3",
                        "attributes": {
                            "configuredMaxTxPower": 37
                        }
                    }
                ]
            }
        ],
        "GnbCuCpFunction": [
            {
                "id": "1",
                "objectInstance": "ManagedElement=1193046,GnbCuCpFunction=1",
                "attributes": {
                    "gnbId": "1193046",
                    "gnbIdLength": 24
                },
                "NrCellCu": [
                    {
                        "id": "3",
                        "objectInstance": "ManagedElement=1193046,GnbCuCpFunction=1,NrCellCu=3",
                        "attributes": {
                            "cellLocalId": 3
                        },
                        "CESManagementFunction": {
                            "id": "3",
                            "objectInstance": "ManagedElement=1193046,GnbCuCpFunction=1,NrCellCu=3,CESManagementFunction=3",
                            "attributes": {
                                "energySavingControl": "toBeNotEnergySaving",
                                "energySavingState": "isNotEnergySaving"
                            }
                        },
                        "NRCellRelation": [
                            {
                                "id": "1",
                                "objectInstance": "ManagedElement=1193046,GnbCuCpFunction=1,NrCellCu=3,NRCellRelation=1",
                                "attributes": {
                                    "adjacentNRCellRef": "ManagedElement=1193048,GnbCuCpFunction=1,NrCellCu=1",
                                    "isESCoveredBy": "FULL"
                                }
                            },
                            {
                                "id": "2",
                                "objectInstance": "ManagedElement=1193046,GnbCuCpFunction=1,NrCellCu=3,NRCellRelation=2",
                                "attributes": {
                                    "adjacentNRCellRef": "ManagedElement=1193047,GnbCuCpFunction=1,NrCellCu=2",
                                    "isESCoveredBy": "PARTIAL"
                                }
                            }
                        ]
                    }
                ]
            }
        ],
        "GnbCuUpFunction": [
            {
                "id": "1",
                "objectInstance": "ManagedElement=1193046,GnbCuUpFunction=1",
                "attributes": {
                    "gnbId": "1193046",
                    "gnbIdLength": 24,
                    "plmnInfoList": [
                        {
                            "plmnId": {
                                "mcc": "001",
                                "mnc": "01"
                            }
                        }
                    ]
                }
            }
        ]
    }
]
```

* The `gnbId: 1193046` is decimal, converted to hexa will be `123456` which is displayed and seen in E2-KPM:
```kubectl logs -f -n ricxapp deployment/ricxapp-kpimon-go --tail=1000```
![image](https://hackmd.io/_uploads/r11m-R3Qp.png)

![image](https://hackmd.io/_uploads/HJzJWC2mT.png)


# 2 Example of KPM:
```
{"ts":1699704443314,"crit":"DEBUG","id":"kpimon","mdc":{"CONTAINER_NAME":"","HOST_NAME":"","PID":"1","POD_NAME":"","SERVICE_NAME":"","SYSTEM_NAME":"","time":"2023-11-11T12:07:23"},"msg":"Received message type: 12050"}
2023/11/11 12:07:23 RIC Indication message from {gnb_001_001_123458} received
2023/11/11 12:07:23 Indication Header format = 1
 parsing for cell metrics

 No of cell = 1

 No of cell metrics = 23
map[DRB_UEThpDl:0 DRB_UEThpUl:0 PEE_AvgPower:21 PEE_Energy:0.11317040114322215 QosFlow_TotPdcpPduVolumeDl:0 QosFlow_TotPdcpPduVolumeUl:0 RRC_ConnMax:1 RRC_ConnMean:0 RRU_PrbAvailDl:273 RRU_PrbAvailUl:273 RRU_PrbTotDl:0 RRU_PrbTotUl:0 RRU_PrbUsedDl:0 RRU_PrbUsedUl:0 Viavi_Geo_x:-2221 Viavi_Geo_y:682 Viavi_Geo_z:20 Viavi_GnbDuId:1 Viavi_NrCgi:591757313 Viavi_NrPci:1 Viavi_Radio_antennaType:0 Viavi_Radio_azimuth:0 Viavi_Radio_power:37]
2023/11/11 12:07:23 RIC Indication message from {gnb_001_001_123458} received
2023/11/11 12:07:23 Indication Header format = 1
Parsing Cell Metric Done parsing for UE metrics
 No of ue metrics = 28

 No of ue= 3
2023/11/11 12:07:23 no_of_ue_metrics != v.NumField()
{"ts":1699704443316,"crit":"INFO","id":"kpimon","mdc":{"CONTAINER_NAME":"","HOST_NAME":"","PID":"1","POD_NAME":"","SERVICE_NAME":"","SYSTEM_NAME":"","time":"2023-11-11T12:07:23"},"msg":"Wrote Cell Metrics to InfluxDB"}

```