Section: 5.3.5.6.5 DRB addition/modification
Content: The UE shall: 1> for each drb-Identity value included in the drb-ToAddModList that is not part of the current UE configuration (DRB establishment including the case when full configuration option is used): 2> establish a PDCP entity and configure it in accordance with the received pdcp-Config; 2> if the PDCP entity of this DRB is not configured with cipheringDisabled: 3> if target RAT of handover is E-UTRA/5GC; or 3> if the UE is connected to E-UTRA/5GC: 4> if the UE is capable of E-UTRA/5GC but not capable of NGEN-DC: 5> configure the PDCP entity with the ciphering algorithm and KUPenc key configured/derived as specified in TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [10]; 4> else (i.e., a UE capable of NGEN-DC): 5> configure the PDCP entity with the ciphering algorithms according to securityConfig and apply the key (KUPenc) associated with the master key (KeNB) or secondary key (S-KgNB) as indicated in keyToUse, if applicable; 3> else (i.e., UE connected to NR or UE connected to E-UTRA/EPC): 4> configure the PDCP entity with the ciphering algorithms according to securityConfig and apply the KUPenc key associated with the master key (KeNB/KgNB) or the secondary key (S-KgNB/S-KeNB) as indicated in keyToUse; 2> if the PDCP entity of this DRB is configured with integrityProtection: 3> configure the PDCP entity with the integrity protection algorithms according to securityConfig and apply the KUPint key associated with the master (KeNB/KgNB) or the secondary key (S-KgNB) as indicated in keyToUse; 2> if an sdap-Config is included: 3> if an SDAP entity with the received pdu-Session does not exist: 4> establish an SDAP entity as specified in TS 37.324[ Evolved Universal Terrestrial Radio Access (E-UTRA) and NR; Service Data Adaptation Protocol (SDAP) specification ]  [24] clause 5.1.1; 4> if an SDAP entity with the received pdu-Session did not exist prior to receiving this reconfiguration: 5> indicate the establishment of the user plane resources for the pdu-Session to upper layers; 3> configure the SDAP entity in accordance with the received sdap-Config as specified in TS 37.324[ Evolved Universal Terrestrial Radio Access (E-UTRA) and NR; Service Data Adaptation Protocol (SDAP) specification ]  [24] and associate the DRB with the SDAP entity; 3> for each QFI value added in mappedQoS-FlowsToAdd, if the QFI value is previously configured, the QFI value is released from the old DRB; 2> if the DRB is associated with an eps-BearerIdentity: 3> if the DRB was configured with the same eps-BearerIdentity either by NR or E-UTRA prior to receiving this reconfiguration: 4> associate the established DRB with the corresponding eps-BearerIdentity; 3> else: 4> indicate the establishment of the DRB(s) and the eps-BearerIdentity of the established DRB(s) to upper layers; 1> for each drb-Identity value included in the drb-ToAddModList that is part of the current UE configuration and configured as DAPS bearer: 2> reconfigure the PDCP entity to configure DAPS with the ciphering function, integrity protection function and ROHC function of the target cell group as specified in TS 38.323[ NR; Packet Data Convergence Protocol (PDCP) specification ]  [5] and configure it in accordance with the received pdcp-Config; 2> if the masterKeyUpdate is received: 3> if the ciphering function of the target cell group PDCP entity is not configured with cipheringDisabled: 4> configure the ciphering function of the target cell group PDCP entity with the ciphering algorithm according to securityConfig and apply the KUPenc key associated with the master key (KgNB), as indicated in keyToUse, i.e. the ciphering configuration shall be applied to all subsequent PDCP PDUs received from the target cell group and sent to the target cell group by the UE; 3> if the integrity protection function of the target cell group PDCP entity is configured with integrityProtection: 4> configure the integrity protection function of the target cell group PDCP entity with the integrity protection algorithms according to securityConfig and apply the KUPint key associated with the master key (KgNB) as indicated in keyToUse; 2> else: 3> configure the ciphering function and the integrity protection function of the target cell group PDCP entity with the same security configuration as the PDCP entity for the source cell group; 2> if the sdap-Config is included and when indication of successful completion of random access towards target cell is received from lower layers as specified in [3]: 3> reconfigure the SDAP entity in accordance with the received sdap-Config as specified in TS 37.324[ Evolved Universal Terrestrial Radio Access (E-UTRA) and NR; Service Data Adaptation Protocol (SDAP) specification ]  [24]; 3> for each QFI value added in mappedQoS-FlowsToAdd, if the QFI value is previously configured, the QFI value is released from the old DRB; 1> for each drb-Identity value included in the drb-ToAddModList that is part of the current UE configuration and not configured as DAPS bearer: 2> if the reestablishPDCP is set: 3> if target RAT of handover is E-UTRA/5GC; or 3> if the UE is connected to E-UTRA/5GC: 4> if the UE is capable of E-UTRA/5GC but not capable of NGEN-DC: 5> if the PDCP entity of this DRB is not configured with cipheringDisabled: 6> configure the PDCP entity with the ciphering algorithm and KUPenc key configured/derived as specified in TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [10], clause 5.4.2.3, i.e. the ciphering configuration shall be applied to all subsequent PDCP PDUs received and sent by the UE; 4> else (i.e., a UE capable of NGEN-DC): 5> if the PDCP entity of this DRB is not configured with cipheringDisabled: 6> configure the PDCP entity with the ciphering algorithm and KUPenc key associated with the master key (KeNB) or the secondary key (S-KgNB), as indicated in keyToUse, i.e. the ciphering configuration shall be applied to all subsequent PDCP PDUs received and sent by the UE; 3> else (i.e., UE connected to NR or UE connected to E-UTRA/EPC (in EN-DC or capable of EN-DC)): 4> if the PDCP entity of this DRB is not configured with cipheringDisabled: 5> configure the PDCP entity with the ciphering algorithm and KUPenc key associated with the master key (KeNB/ KgNB) or the secondary key (S-KgNB/S-KeNB), as indicated in keyToUse, i.e. the ciphering configuration shall be applied to all subsequent PDCP PDUs received and sent by the UE; 4> if the PDCP entity of this DRB is configured with integrityProtection: 5> configure the PDCP entity with the integrity protection algorithms according to securityConfig and apply the KUPint key associated with the master key (KeNB/KgNB) or the secondary key (S-KgNB) as indicated in keyToUse; 3> if drb-ContinueROHC is included in pdcp-Config: 4> indicate to lower layer that drb-ContinueROHC is configured; 3> if drb-ContinueEHC-DL is included in pdcp-Config: 4> indicate to lower layer that drb-ContinueEHC-DL is configured; 3> if drb-ContinueEHC-UL is included in pdcp-Config: 4> indicate to lower layer that drb-ContinueEHC-UL is configured; 3> if drb-ContinueUDC is included in pdcp-Config: 4> indicate to lower layer that drb-ContinueUDC is configured; 3> re-establish the PDCP entity of this DRB as specified in TS 38.323[ NR; Packet Data Convergence Protocol (PDCP) specification ]  [5], clause 5.1.2; 2> else, if the recoverPDCP is set: 3> trigger the PDCP entity of this DRB to perform data recovery as specified in TS 38.323[ NR; Packet Data Convergence Protocol (PDCP) specification ]  [5]; 2> if the pdcp-Config is included: 3> reconfigure the PDCP entity in accordance with the received pdcp-Config. 2> if the sdap-Config is included: 3> reconfigure the SDAP entity in accordance with the received sdap-Config as specified in TS37.324[ Evolved Universal Terrestrial Radio Access (E-UTRA) and NR; Service Data Adaptation Protocol (SDAP) specification ]  [24]; 3> for each QFI value added in mappedQoS-FlowsToAdd, if the QFI value is previously configured, the QFI value is released from the old DRB; NOTE 1: Void. NOTE 2: When determining whether a drb-Identity value is part of the current UE configuration, the UE does not distinguish which RadioBearerConfig and DRB-ToAddModList that DRB was originally configured in. To re-associate a DRB with a different key (KeNB to S-KgNB, KgNB to S-KeNB, KgNB to S-KgNB, or vice versa), the network provides the drb-Identity value in the (target) drb-ToAddModList and sets the reestablishPDCP flag. The network does not list the drb-Identity in the (source) drb-ToReleaseList. NOTE 3: When setting the reestablishPDCP flag for a radio bearer, the network ensures that the RLC receiver entities do not deliver old PDCP PDUs to the re-established PDCP entity. It does that e.g. by triggering a reconfiguration with sync of the cell group hosting the old RLC entity or by releasing the old RLC entity. NOTE 4: In this specification, UE configuration refers to the parameters configured by NR RRC unless otherwise stated. NOTE 5: Ciphering and integrity protection can be enabled or disabled for a DRB. The enabling/disabling of ciphering or integrity protection can be changed only by releasing and adding the DRB. NOTE 6: In DAPS handover, the UE may perform PDCP entity re-establishment (if reestablishPDCP is set) or the PDCP data recovery (if recoverPDCP is set) for a non-DAPS bearer when indication of successful completion of random access towards target cell is received from lower layers as specified in TS 38.321[ NR; Medium Access Control (MAC) protocol specification ]  [3]. In this case, the UE suspends data transmission and reception for all non-DAPS bearers in the source MCG for duration of the DAPS handover.