1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 #ifndef __DU_CONFIG_H_
20 #define __DU_CONFIG_H__
25 #include "BIT_STRING.h"
30 #define DU_IP_V4_ADDR "10.0.2.20"
31 #define CU_IP_V4_ADDR "10.0.2.25"
34 #define DU_EGTP_PORT 39001
35 #define CU_EGTP_PORT 39002
38 #define DU_NAME "ORAN_OAM_DU"
39 #define CELL_TYPE SMALL
40 #define DUPLEX_MODE DUP_MODE_TDD
48 #define NR_ARFCN 2079427
50 #define NR_FREQ_BAND 257
56 #define FREQ_SHIFT_7P5KHZ FALSE
57 #define SSB_PBCH_PWR 0
58 #define BCH_PAYLOAD MAC_GEN_FULL_PBCH_PAYLD
59 #define SUBCARRIER_SPACING 3
61 #define BETA_PSS BETA_PSS_0DB
62 #define SSB_PERIODICITTY SSB_PRDCTY_MS_20
63 #define SSB_SUBCARRIER_OFFSET 0
64 #define SSB_MULT_CARRIER_BAND FALSE
65 #define MULT_CELL_CARRIER FALSE
67 #define PRACH_SEQ_LEN SHORT_SEQUENCE
68 #define PRACH_SUBCARRIER_SPACING 3
69 #define PRACH_RESTRICTED_SET_CFG UNRESTRICTED
70 #define NUM_PRACH_FDM 1
71 #define ROOT_SEQ_IDX 0
72 #define NUM_ROOT_SEQ 1
73 #define ZERO_CORRELATION_ZONE_CFG 2
74 #define NUM_UNUSED_ROOT_SEQ 1
75 #define UNUSED_ROOT_SEQ 1
76 #define SSB_PER_RACH 3
77 #define PRACH_MULT_CARRIER_BAND FALSE
78 #define TDD_PERIODICITY TX_PRDCTY_MS_2P5
79 #define RSS_MEASUREMENT_UNIT DONT_REPORT_RSSI
92 #define DU_SELECTOR_LC 0
93 #define DU_SELECTOR_TC 1
94 #define DU_SELECTOR_LWLC 2
97 /* Macro definitions for EGTP procedures */
98 #define EGTP_LCL_TEID 1 /* EGTP local tunnel id */
99 #define EGTP_REM_TEID 10 /* EGTP remote tinnel id */
103 /* Macro definitions for F1 procedures */
104 #define CU_DU_NAME_LEN_MAX 30 /* Max length of CU/DU name string */
105 #define MAX_F1_CONNECTIONS 65536 /* Max num of F1 connections */
106 #define DU_MAX_CELLS 512 /* Max num of cells served by gNB-DU */
107 #define MAX_PLMN 6 /* Max num of broadcast PLMN ids */
108 #define MAXNRARFCN 3279165 /* Maximum values of NRAFCN */
109 #define MAXNRCELLBANDS 2 /* Maximum number of frequency bands */
110 #define MAXNUMOFSLICEITEMS 1024 /* Maximum number of signalled slice support items */
111 #define MAXBPLMNNRMINUS1 1 /* Maximum number of PLMN Ids broadcast in an NR cell minus 1 */
112 #define MAXNUMOFSIBTYPES 32 /* Maximum number of SIB types */
113 #define MAX_UEID 512 /* Maximum number of UE Ids */
114 #define MAX_TNL_ASSOC 32 /* Max num of TNL Assoc between CU and DU */
115 #define MAXCELLINENB 256 /* Max num of cells served by eNB */
116 #define MAXNUMOFUEID 65536 /* Max num of UEs served by DU */
117 #define MAXNUMOFUACPLMN 12 /* Maximum number of PLMN ids*/
118 #define MAXNUMOFUACPERPLMN 64 /* Maximum number of signalled categories per PLMN */
119 #define DEFAULT_CELLS 1 /* Max num of broadcast PLMN ids */
131 INVALID_CU_UE_F1AP_ID,
132 INVALID_DU_UE_F1AP_ID,
133 INTERACTION_WITH_OTHER_PROC,
135 RADIO_RELATED_REASON,
136 INSUFFICIENT_RADIO_RESOURCE,
142 SLICE_RESOURCE_UNAVAILABLE,
143 AMF_ABNORMAL_RELEASE,
149 TRANS_CAUSE_UNSPECIFIED,
150 TRANSPORT_RESOURCE_UNAVAIL
156 ABSTRACT_SYNTAX_ERR_REJECT,
157 ABSTRACT_SYNTAX_ERR_NOTIFY,
158 INCOMPATIBLE_MESSAGE,
160 ABSTRACT_SYNTAX_ERR_MSG_CONSTRUCT,
161 PROTOCOL_CAUSE_UNSPECIFIED
166 CONTROL_PROC_OVERLOAD,
167 INSUFF_USER_PLANE_RESOURCE,
169 O_AND_M_INTERVENTION,
170 MISC_CAUSE_UNSPECIFIED
293 REJECT_RRC_CONN_NON_EMERG_MODT,
294 REJECT_RRC_CONN_SIGNALLING,
295 PERMIT_EMERG_SESSION_AND_MOBILE_TERM_SERVICE,
296 PERMIT_HIGH_PRIOR_SESSION_AND_MOBILE_TERM_SERVICE
297 }F1UacStandardAction;
299 typedef struct f1RrcVersion
301 char rrcVer[30]; /* Latest RRC Version */
302 U32 extRrcVer; /* Latest RRC version extended */
305 typedef struct f1FailCause
309 RadioNwCause radioNwCause; /* Radio Network Layer Cause */
310 TransLayerCause transLayerCause; /* Transport Layer Cause */
311 ProtocolCause protCause; /* Protocol Cause */
312 MiscCause miscCause; /* Miscellaneous Cause */
316 typedef struct f1ProcCode
322 typedef struct f1TriggMsg
328 typedef struct f1ProcCrit
334 typedef struct f1CritDignosIE
336 F1ProcCritVal ieCritVal;
341 typedef struct f1CritDiagnostic
344 F1ProcCode procCode; /* Procedure Code */
345 F1TriggMsg triggeringMsg; /* Triggering Message */
346 F1ProcCrit procCrit; /* Criticality of Triggering msg/proc */
348 F1CritDignosIE diagnosIE;
351 typedef struct f1FailureIE
353 U32 transId; /* Uniquely identify transaction */
354 F1FailCause cause; /* Failure cause */
355 U8 timeToWait; /* Seconds to be waited before retry */
356 F1CritDiagnostic critDiagnostic; /* Critical diagnostics */
359 typedef struct f1LogicalConnUeAssoc
363 }F1LogicalConnUeAssoc;
365 typedef struct f1ResetType
369 F1ResetAll resetAll; /* Reset All */
370 F1LogicalConnUeAssoc ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* In case of Partial Reset : UE associated logical F1 conn list*/
374 typedef struct f1PLMN
380 typedef struct nrEcgi
386 typedef struct f1SibType
393 typedef struct f1TxBw
395 F1NrScs nrScs; /* NR subcarrier spacing */
396 F1Nrb nrb; /* Transmission bandwidth expressed in units of RBs */
399 typedef struct f1SulInfo
401 U32 sulArfcn; /* SUL ARFCN */
402 F1TxBw sulTxBw; /* SUL transmission bandwidth */
405 typedef struct f1FreqBand
408 U16 sulBand[MAXNRCELLBANDS];
411 typedef struct f1NrFreqInfo
415 F1FreqBand freqBand[MAXNRCELLBANDS];
418 typedef struct f1NrFddInfo
420 F1NrFreqInfo ulNrFreqInfo; /* UL NR Frequency Info */
421 F1NrFreqInfo dlNrFreqInfo; /* DL NR Frequency Info */
422 F1TxBw ulTxBw; /* UL Transmission bandwidth */
423 F1TxBw dlTxBw; /* DL Transmission bandwidth */
426 typedef struct f1NrTddInfo
428 F1NrFreqInfo nrFreqInfo; /* NR Frequency Info */
429 F1TxBw nrTxBw; /* NR Transmission Bandwidth */
432 typedef struct f1NrModeInfo
441 typedef struct f1EutraFddInfo
443 U16 ulOffset; /* UL offset to Point A */
444 U16 dlOffset; /* DL offset to Point A */
447 typedef struct f1EutraTddInfo
449 U16 tddOffset; /* Offset to Point A */
452 typedef struct f1EutraModeInfo
461 typedef struct f1Snsaai
467 typedef struct epIpAddr
469 char transportAddr[20]; /* Transport Layer Address */
472 typedef struct epIpAddrPort
478 typedef struct f1TaiSliceSuppLst
481 F1Snsaai snssai[MAXNUMOFSLICEITEMS];
484 typedef struct f1SrvdPlmn
487 F1TaiSliceSuppLst taiSliceSuppLst;
490 typedef struct f1BrdcstPlmnInfo
492 PlmnId plmn[MAX_PLMN]; /* PLMN id list */
493 PlmnId extPlmn[MAX_PLMN]; /* Extended PLMN id list */
494 U16 tac; /* 5GS-TAC */
495 U32 nrCellId; /* NR Cell id */
496 U8 ranac; /* RAN Area code */
499 typedef struct f1CellInfo
501 NrEcgi nrCgi; /* Cell global Identity */
502 U32 nrPci; /* Physical Cell Identity */
503 PlmnId plmn[MAX_PLMN]; /* Available PLMN list */
504 PlmnId extPlmn[MAX_PLMN]; /* Extended available PLMN list */
507 typedef struct f1DuCellInfo
509 F1CellInfo cellInfo; /* cell info */
510 U16 tac; /* tracking area code */
511 U16 epsTac; /* Configured EPS TAC */
512 NrModeInfo f1Mode; /* NR mode info : FDD/TDD */
513 U8 measTimeCfg; /* Measurement timing configuration */
514 F1CellDir cellDir; /* Cell Direction */
515 F1CellType cellType; /* Cell Type */
516 F1BrdcstPlmnInfo brdcstPlmnInfo[MAXBPLMNNRMINUS1]; /* Broadcast PLMN Identity Info List */
519 typedef struct f1DuSysInfo
521 U8 *mibMsg; /* MIB message */
522 U8 *sib1Msg; /* SIB1 message */
525 typedef struct f1CuSysInfo
527 F1SibType sibTypeToUpd[MAXNUMOFSIBTYPES]; /* SIB types to be updated */
530 typedef struct f1DuSrvdCellInfo
532 F1DuCellInfo duCellInfo; /* gNB-DU served cell info */
533 F1DuSysInfo duSysInfo; /* gNB-DU System Information */
536 typedef struct f1DuSrvdCellToDel
538 NrEcgi oldNrCgi; /* Old NR CGI */
539 F1DuSrvdCellInfo srvdCellInfo; /* Info of served cell to be deleted */
542 typedef struct f1CuActCellInfo
544 F1CellInfo cuCellInfo; /* gNB-CU available cell info */
545 F1CuSysInfo cuSysInfo; /* gNB-CU System Information */
548 typedef struct f1ActCellFail
554 typedef struct srvStatus
557 Bool switchOffOngoing;
560 typedef struct f1CellStatus
563 SrvStatus status; /* Service status */
566 typedef struct f1DedSIDelUE
572 typedef struct tnlAssocInfo
575 EpIpAddr epIpAddr; /* Endpoint-IP Address */
576 EpIpAddrPort epIpAddrport; /* Endpoint-IP Address and Port */
579 typedef struct f1TnlAssocUsage
585 typedef struct f1TnlAssoc
587 F1TnlAssocAddr assocInfo; /* TNL Assoc Transport Layer Info */
588 F1TnlAssocUsage assocUsage; /* TNL Assoc usage */
591 typedef struct f1TnlAssocToRmv
593 F1TnlAssocAddr assocInfoCu; /* TNL Assoc Transport Layer Info of CU */
594 F1TnlAssocAddr assocInfoDu; /* TNL Assoc Transport Layer Info of DU */
597 typedef struct f1TnlAssocSetupFail
599 F1TnlAssocAddr assocInfo;
601 }F1TnlAssocSetupFail;
604 typedef struct f1CellBarred
607 CellBarred cellBarred;
610 typedef struct f1EutraCell
612 U32 eutraCellId; /* EUTRA cell id */
613 F1EutraModeInfo mode; /* EUTRA mode info : FDD/TDD */
614 U8 rsrcInd; /* Protected EUTRA resource Indication */
617 typedef struct f1ProtectEUTRARsrc
619 U32 specShareGrpId; /* Spectrum sharing group id */
620 F1EutraCell eutraCellList[MAXCELLINENB]; /* EUTRA cells list */
623 typedef struct f1UacOperatorDefined
627 }F1UacOperatorDefined;
629 typedef struct f1UacCategoryType
633 F1UacStandardAction action; /* UAC standardized action */
634 F1UacOperatorDefined operatorDef; /* UAC operator defined */
638 typedef struct f1UacType
640 U8 uacReducInd; /* Value 0 means no access rate reduction. Value 100 means full access rate reduction */
641 F1UacCategoryType uacCategoryType; /* UAC Category type */
644 /* Unified Access Class Assistance Information */
645 typedef struct f1UacAssistInfo
647 PlmnId plmn[MAXNUMOFUACPLMN]; /* UAC PLMN list */
648 F1UacType uacType[MAXNUMOFUACPERPLMN]; /* UAC Type list */
651 /* F1 setup related structures */
653 typedef struct f1SetupReq
655 U32 transId; /* Uniquely identify transaction */
656 U32 duId; /* DU ID */
657 char duName[CU_DU_NAME_LEN_MAX]; /* DU name */
658 F1DuSrvdCellInfo srvdCellLst[DU_MAX_CELLS]; /* Serving cell list */
659 F1RrcVersion rrcVersion; /* RRC version */
662 typedef struct f1setupRsp
664 U32 transId; /* Uniquely identify transaction */
665 char cuName[CU_DU_NAME_LEN_MAX]; /* CU Name */
666 F1CuActCellInfo actCellInfo; /* cells to be activated */
667 F1RrcVersion rrcVersion; /* RRC version */
670 typedef struct f1SetupFail
672 F1FailureIE setupFail;
675 /* At reception of the RESET message the gNB-DU shall release all allocated resources on F1
676 * and radio resources related to the UE association(s) indicated explicitly or implicitly in
677 * the RESET message and remove the indicated UE contexts including F1AP ID. */
678 typedef struct f1Reset
680 U32 transId; /* Uniquely identify transaction */
681 F1FailCause cause; /* Failure cause */
682 F1ResetType resetType; /* type of reset */
685 /* After the gNB-CU has released all assigned F1 resources and the UE F1AP IDs for all indicated
686 * UE associations which can be used for new UE-associated logical F1-connections over the F1 interface,
687 * the gNB-CU shall respond with the RESET ACKNOWLEDGE message. */
688 typedef struct f1ResetAck
690 U32 transId; /* Uniquely identify transaction */
691 F1LogicalConnUeAssoc ueAssocLogicalConn[MAX_F1_CONNECTIONS]; /* UE associated logical F1-connection list */
692 F1CritDiagnostic critDiagnostic; /* Critical diagnostics */
695 typedef struct f1ErrorInd
697 U32 transId; /* Uniquely identify transaction */
698 F1Entity errorOrigin; /* Specifies if error is originated at DU or CU */
699 F1FailCause cause; /* Failure cause */
700 /* If failure is due to Ue related message. */
701 U32 gnbCuUeF1apId; /* gNB-CU UE F1AP Id */
702 U32 gnbDuUeF1apId; /* gNB-DU UE F1AP Id */
703 F1CritDiagnostic critDiagnostic; /* Critical diagnostics */
706 typedef struct f1GnbDuCfgUpd
708 U32 transId; /* Uniquely identify transaction */
709 F1DuSrvdCellInfo srvdCellLstAdd[DU_MAX_CELLS]; /* Served cell list to be added */
710 F1DuSrvdCellToDel srvdCellLstMod[DU_MAX_CELLS]; /* Served cell list to be modified */
711 NrEcgi srvdCellLstDel[DU_MAX_CELLS]; /* Served cell list to be deleted */
712 F1CellStatus cellStatus[DU_MAX_CELLS]; /* Cell status */
713 F1DedSIDelUE ueLst[MAX_UEID]; /* Ue list that requires dedicated SI delivery */
715 F1TnlAssocToRmv gnbDuTnlAssocRmv[MAX_TNL_ASSOC]; /* TNL Assoc list to remove */
718 typedef struct f1GnbDuCfgUpdAck
720 U32 transId; /* Uniquely identify transaction */
721 F1CuActCellInfo cellLstAct[DU_MAX_CELLS]; /* List of cells to be activated */
722 F1CritDiagnostic critDiagnostic; /* Critical diagnostics */
723 NrEcgi cellLstDeact[DU_MAX_CELLS]; /* List of cells to be deactivated */
726 typedef struct f1GnbDuCfgUpdFail
728 F1FailureIE gnbDuCfgUpdFail;
731 /* Sent by the gNB-CU to transfer updated information associated to an F1-C interface instance */
732 typedef struct f1GnbCuCfgUpd
734 U32 transId; /* Uniquely identifies transaction */
735 F1CuActCellInfo cellLstAct[DU_MAX_CELLS]; /* List of cells to be activated */
736 NrEcgi cellLstDeact[DU_MAX_CELLS]; /* List of cells to be deactivated */
737 F1TnlAssoc assocLstAdd[MAX_TNL_ASSOC]; /* List of TNL assocs to be added */
738 F1TnlAssoc assocLstUpd[MAX_TNL_ASSOC]; /* List of TNL assocs to be updated */
739 F1TnlAssocToRmv assocLstRmv[MAX_TNL_ASSOC]; /* List of TNL assocs to be removed */
740 F1CellBarred cellToBarList[DU_MAX_CELLS]; /* List of Cells to be barred */
741 F1ProtectEUTRARsrc protectEutraRsrcList[MAXCELLINENB]; /* List of Protected EUTRA resources */
744 /* Sent by a gNB-DU to a gNB-CU to acknowledge update of information
745 * associated to an F1-C interface instance */
746 typedef struct f1GnbCuCfgUpdAck
748 U32 transId; /* Uniquely identify transaction */
749 F1ActCellFail actCellFailList[DU_MAX_CELLS]; /* Cells failed to be activated list */
750 F1CritDiagnostic critDiagnostic; /* Critical diagnostics */
751 F1TnlAssocAddr assocSetupList[MAX_TNL_ASSOC]; /* TNL Assoc Setup list */
752 F1TnlAssocSetupFail assocSetupFailList[MAX_TNL_ASSOC]; /* TNL Assoc Setup fail list */
753 F1DedSIDelUE dedSiDelUelist[MAXNUMOFUEID]; /* Dedicated SI delivery needed UE list */
756 typedef struct f1GnbCuCfgUpdFail
758 F1FailureIE gnbCuCfgUpdFail;
761 /* This procedure enables coordination of radio resource allocation between a gNB-CU and
762 * a gNB-DU. Coordination request is sent by CU to DU */
763 typedef struct f1GnbDuRsrcCoordReq
765 U32 transId; /* Uniquely identifies transaction */
766 F1ReqType reqType; /* Request type */
767 U8 cellResCoordReqCont; /* Container for X2AP E-UTRA - NR cell resource coordination request */
768 F1IgnoreReq ignoreReq; /* Ignore coordination request */
769 }F1GnbDuRsrcCoordReq;
771 /* This message is sent by a gNB-DU to a gNB-CU, to express the desired resource allocation
772 * for data traffic, as a response to the GNB-DU RESOURCE COORDINATION REQUEST. */
773 typedef struct f1GnbDuRsrcCoordRsp
775 U32 transId; /* Uniquely identifies transaction */
776 U8 cellResCoordRspCont; /* Container for X2AP E-UTRA - NR cell resource coordination response */
777 }F1GnbDuRsrcCoordRsp;
779 /* This message is sent by the gNB-DU to indicate to the gNB-CU its status of overload */
780 typedef struct f1GnbDuStatusInd
782 U32 transId; /* Uniquely identifies transaction */
783 F1GnbDuOvrloadInfo ovrloadInfo; /* gNB-DU overloaded information */
786 /* This message is sent by either the gNB-DU or the gNB-CU to intiate the removal
787 * of the interface instance and the related resources */
788 typedef struct f1RmvReq
790 U32 transId; /* Uniquely identifies transaction */
793 /* This message acknowledges the initiation of removal of the interface
794 * instance and the related resources */
795 typedef struct f1RmvRsp
797 U32 transId; /* Uniquely identifies transaction */
798 F1CritDiagnostic critDiagnos; /* Crititcality diagnostics */
801 /* This message indicates that removing the interface instance and the related
802 * resources cannot be accepted */
803 typedef struct f1RmvFail
805 U32 transId; /* Uniquely identifies transaction */
806 F1FailCause cause; /* Failure cause */
807 F1CritDiagnostic critDiagnostic; /* Criticality diagnostics */
810 /* This message is sent by the gNB-CU to indicate to the gNB-DU a need to reduce
811 * the rate at which UEs access the network. */
812 typedef struct f1NwkAccessRateRed
814 U32 transId; /* Uniquely identifies transaction */
815 F1UacAssistInfo uacAssistInfo; /* UAC Assistance Information */
818 typedef struct f1Ipaddr
824 typedef struct f1SctpParams
832 typedef struct f1EgtpParams
834 F1IpAddr localIp; /* Ip address of local node */
835 U16 localPort; /* Sender Port at local node */
836 F1IpAddr destIp; /* Ip address of peer node */
837 U16 destPort; /* Sender port at peer node */
842 typedef struct cellCfgParams
844 NrEcgi nrEcgi; /* ECGI */
846 U16 fiveGsTac; /* 5gSTac */
847 PlmnId plmn[MAX_PLMN]; /* List of serving PLMN IDs */
848 U8 ranac; /* RAN Area Code */
849 U32 maxUe; /* max UE per slot */
852 typedef struct schedulerCfg
854 U8 numTxAntPorts; /*!< Number of Tx antenna ports */
855 U8 ulSchdType; /*!< Indicates which UL scheduler to use, range
856 * is 0..(number of schedulers - 1) */
857 U8 dlSchdType; /*!< Indicates which DL scheduler to use, range
858 * is 0..(number of schedulers - 1) */
859 U8 numCells; /*!< Max number of cells */
860 U8 maxUlUePerTti; /*!< Max number of UE in UL per TTI */
861 U8 maxDlUePerTti; /*!< Max number of UE in DL per TTI */
864 typedef struct duCfgParams
866 F1SctpParams sctpParams; /* SCTP Params */
867 F1EgtpParams egtpParams; /* EGTP Params */
870 U8 duName[CU_DU_NAME_LEN_MAX];
871 SchedulerCfg schedCfg;
872 CellCfgParams cellCfg[DU_MAX_CELLS]; /* Cell info config*/
873 F1DuSrvdCellInfo srvdCellLst[DU_MAX_CELLS]; /* Serving cell list *///TODO: this must be removed eventually
874 F1RrcVersion rrcVersion; /* RRC version */
875 ClCellCfg clCellCfg; /* CL cell configuration */
879 typedef struct duCellCb
881 U32 cellId; /* Internal cell Id */
882 CellCfgParams cellInfo; /* Cell info */
883 CellStatus cellStatus; /*Cell status */
886 /*function declarations */
887 void fillSlotConfig();
891 S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val);
893 #endif /* __DU_CONFIG_H__ */
895 /**********************************************************************
897 **********************************************************************/