This commit is removing the storage of selected PLMN in NGAP UE context. We store the Serving PLMN in the RRC UE context instead. The Selected PLMN is the PLMN that the UE chose (or was directed to) for registration and it is sent in the RRCSetupComplete. This is different from the selected PLMN mentioned in the NG INITIAL UE MESSAGE for network sharing. Selected PLMN: determines which core network and AMF the UE is registered with GUAMI = Identifies the serving AMF and includes the PLMN of that AMF Serving PLMN: the PLMN that is currently serving the UE (e.g. contained in GUAMI) The AMF’s PLMN may match the selected PLMN, or not (especially in network sharing or roaming). Regardless, the UE always have a Serving PLMN. Initial UE message does not have a TAI IE per se, but TAI is a mandatory member of the mandatory UserLocationInformation CHOICE. NR CGI is also mandatory and carried inside UserLocationInformation: in network sharing, the PLMN ID in TAI takes on additional significance: RAN is shared but CN are different, so in this case PLMN in TAI is needed for the AMF route the message to the correct operator’s core. If network sharing applies (e.g., shared RAN between PLMN-A and PLMN-B): the UE or network may select PLMN-B instead, and that PLMN identity is included in the Initial UE Message’s TAI IE. Conclusion: 1) UE always sends the selected PLMN during the registration, regardless of whether it is shared or not. 2) Selected PLMN Identity is an actual IE sent in the RRCSetupComplete while in NGAP there's no Selected PLMN Identity IE, only PLMN Identity IEs in both TAI and NR CGI. It is a subtle difference. 3) The serving PLMN of the UE needs to be stored in RRC UE Context for later use in NAS procedures. e.g. at initial registration it matches the Selected PLMN 4) No need to store PLMN in NGAP UE Context, params are passed by RRC 5) TAI and NR CGI, which contain the PLMN identity, are mandatory in UserLocationInformation IE CHOICE, and should reflect current status Changes - Initial UE Message: pass UE-selected PLMN and NR cell id from RRC to NGAP - Uplink NAS Transport: use PLMN, TAC, and cell id provided by the message; - Build NR CGI from gNB ID + cell id - Store UE-selected PLMN only in RRC UE context at NAS_FIRST_REQ for later Uplink NAS, stop storing PLMN in NGAP UE context
83 lines
2.8 KiB
C
83 lines
2.8 KiB
C
/*
|
|
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
* this work for additional information regarding copyright ownership.
|
|
* The OpenAirInterface Software Alliance licenses this file to You under
|
|
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
|
* except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.openairinterface.org/?page_id=698
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*-------------------------------------------------------------------------------
|
|
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
|
* contact@openairinterface.org
|
|
*/
|
|
|
|
/*! \file ngap_gNB_ue_context.h
|
|
* \brief ngap UE context management within gNB
|
|
* \author Yoshio INOUE, Masayuki HARADA
|
|
* \date 2020
|
|
* \version 0.1
|
|
* \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com)
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include "ngap_gNB_defs.h"
|
|
#include "tree.h"
|
|
|
|
#ifndef NGAP_GNB_UE_CONTEXT_H_
|
|
#define NGAP_GNB_UE_CONTEXT_H_
|
|
|
|
// Forward declarations
|
|
struct ngap_gNB_amf_data_s;
|
|
struct gNB_amf_desc_s;
|
|
|
|
typedef enum {
|
|
/* UE has not been registered to a AMF or UE association has failed. */
|
|
NGAP_UE_DECONNECTED = 0x0,
|
|
/* UE ngap state is waiting for initial context setup request message. */
|
|
NGAP_UE_WAITING_CSR = 0x1,
|
|
/* UE association is ready and bearers are established. */
|
|
NGAP_UE_CONNECTED = 0x2,
|
|
NGAP_UE_STATE_MAX,
|
|
} ngap_ue_state;
|
|
|
|
typedef struct ngap_gNB_ue_context_s {
|
|
/* Tree related data */
|
|
RB_ENTRY(ngap_gNB_ue_context_s) entries;
|
|
|
|
/* Uniquely identifies the UE between AMF and gNB within the gNB.
|
|
* This id is encoded on 32bits.
|
|
*/
|
|
uint32_t gNB_ue_ngap_id;
|
|
|
|
uint64_t amf_ue_ngap_id;
|
|
|
|
/* Stream used for this particular UE */
|
|
int32_t tx_stream;
|
|
int32_t rx_stream;
|
|
|
|
/* Current UE state. */
|
|
ngap_ue_state ue_state;
|
|
|
|
/* Reference to AMF data this UE is attached to */
|
|
struct ngap_gNB_amf_data_s *amf_ref;
|
|
|
|
/* Reference to gNB data this UE is attached to */
|
|
ngap_gNB_instance_t *gNB_instance;
|
|
} ngap_gNB_ue_context_t;
|
|
|
|
void ngap_store_ue_context(const ngap_gNB_ue_context_t *ue_desc_p);
|
|
|
|
ngap_gNB_ue_context_t *ngap_get_ue_context(uint32_t gNB_ue_ngap_id);
|
|
ngap_gNB_ue_context_t *ngap_get_ue_context_from_amf_ue_ngap_id(uint32_t amf_ue_ngap_id);
|
|
ngap_gNB_ue_context_t *ngap_detach_ue_context(uint32_t gNB_ue_ngap_id);
|
|
|
|
#endif /* NGAP_GNB_UE_CONTEXT_H_ */
|