Commit 637e4a58 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 84906d4c
...@@ -321,9 +321,9 @@ void NasMm::switchUState(E5UState state) ...@@ -321,9 +321,9 @@ void NasMm::switchUState(E5UState state)
void NasMm::onSwitchMmState(EMmState oldState, EMmState newState, EMmSubState oldSubState, EMmSubState newSubSate) void NasMm::onSwitchMmState(EMmState oldState, EMmState newState, EMmSubState oldSubState, EMmSubState newSubSate)
{ {
// The UE shall mark the 5G NAS security context on the USIM or in the non-volatile memory as invalid when the UE // "The UE shall mark the 5G NAS security context on the USIM or in the non-volatile memory as invalid when the UE
// initiates an initial registration procedure as described in subclause 5.5.1.2 or when the UE leaves state // initiates an initial registration procedure as described in subclause 5.5.1.2 or when the UE leaves state
// 5GMM-DEREGISTERED for any other state except 5GMM-NULL. // 5GMM-DEREGISTERED for any other state except 5GMM-NULL."
if (oldState == EMmState::MM_DEREGISTERED && newState != EMmState::MM_DEREGISTERED && newState != EMmState::MM_NULL) if (oldState == EMmState::MM_DEREGISTERED && newState != EMmState::MM_DEREGISTERED && newState != EMmState::MM_NULL)
{ {
if (m_usim->m_currentNsCtx || m_usim->m_nonCurrentNsCtx) if (m_usim->m_currentNsCtx || m_usim->m_nonCurrentNsCtx)
...@@ -335,8 +335,8 @@ void NasMm::onSwitchMmState(EMmState oldState, EMmState newState, EMmSubState ol ...@@ -335,8 +335,8 @@ void NasMm::onSwitchMmState(EMmState oldState, EMmState newState, EMmSubState ol
} }
} }
// If the UE enters the 5GMM state 5GMM-DEREGISTERED or 5GMM-NULL, // "If the UE enters the 5GMM state 5GMM-DEREGISTERED or 5GMM-NULL,
// The RAND and RES* values stored in the ME shall be deleted and timer T3516, if running, shall be stopped // The RAND and RES* values stored in the ME shall be deleted and timer T3516, if running, shall be stopped"
if (newState == EMmState::MM_DEREGISTERED || newState == EMmState::MM_NULL) if (newState == EMmState::MM_DEREGISTERED || newState == EMmState::MM_NULL)
{ {
m_usim->m_rand = {}; m_usim->m_rand = {};
...@@ -352,6 +352,10 @@ void NasMm::onSwitchMmState(EMmState oldState, EMmState newState, EMmSubState ol ...@@ -352,6 +352,10 @@ void NasMm::onSwitchMmState(EMmState oldState, EMmState newState, EMmSubState ol
{ {
localReleaseConnection(); localReleaseConnection();
} }
// "Timer T3512 is stopped when the UE enters ... the 5GMM-DEREGISTERED state over 3GPP access"
if (newState == EMmState::MM_DEREGISTERED)
m_timers->t3512.stop();
} }
void NasMm::onSwitchRmState(ERmState oldState, ERmState newState) void NasMm::onSwitchRmState(ERmState oldState, ERmState newState)
...@@ -387,23 +391,34 @@ void NasMm::onSwitchCmState(ECmState oldState, ECmState newState) ...@@ -387,23 +391,34 @@ void NasMm::onSwitchCmState(ECmState oldState, ECmState newState)
// 5.5.2.2.6 Abnormal cases in the UE (in de-registration) // 5.5.2.2.6 Abnormal cases in the UE (in de-registration)
else if (m_mmState == EMmState::MM_DEREGISTERED_INITIATED) else if (m_mmState == EMmState::MM_DEREGISTERED_INITIATED)
{ {
// The de-registration procedure shall be aborted and the UE proceeds as follows: // "The de-registration procedure shall be aborted and the UE proceeds as follows:
// if the de-registration procedure was performed due to disabling of 5GS services, the UE shall enter the // if the de-registration procedure was performed due to disabling of 5GS services, the UE shall enter the
// 5GMM-NULL state; // 5GMM-NULL state;"
if (m_lastDeregCause == EDeregCause::DISABLE_5G) if (m_lastDeregCause == EDeregCause::DISABLE_5G)
switchMmState(EMmSubState::MM_NULL_PS); switchMmState(EMmSubState::MM_NULL_PS);
// if the de-registration type "normal de-registration" was requested for reasons other than disabling of // "if the de-registration type "normal de-registration" was requested for reasons other than disabling of
// 5GS services, the UE shall enter the 5GMM-DEREGISTERED state. // 5GS services, the UE shall enter the 5GMM-DEREGISTERED state."
else if (m_lastDeregistrationRequest->deRegistrationType.switchOff == else if (m_lastDeregistrationRequest->deRegistrationType.switchOff ==
nas::ESwitchOff::NORMAL_DE_REGISTRATION) nas::ESwitchOff::NORMAL_DE_REGISTRATION)
switchMmState(EMmSubState::MM_DEREGISTERED_PS); switchMmState(EMmSubState::MM_DEREGISTERED_PS);
} }
// If the UE enters the 5GMM-IDLE, the RAND and RES* values stored // "If the UE enters the 5GMM-IDLE, the RAND and RES* values stored in the ME shall be deleted and timer T3516,
// in the ME shall be deleted and timer T3516, if running, shall be stopped // if running, shall be stopped"
m_usim->m_rand = {}; m_usim->m_rand = {};
m_usim->m_resStar = {}; m_usim->m_resStar = {};
m_timers->t3516.stop(); m_timers->t3516.stop();
// "Timer T3512 is reset and started with its initial value, when the UE changes from 5GMM-CONNECTED over 3GPP
// access to 5GMM-IDLE mode over 3GPP access"
m_timers->t3512.start();
}
if (oldState == ECmState::CM_IDLE && newState == ECmState::CM_CONNECTED)
{
// "Timer T3512 is stopped when the UE enters 5GMM-CONNECTED mode over 3GPP access or the 5GMM-DEREGISTERED
// state over 3GPP access"
m_timers->t3512.stop();
} }
} }
......
...@@ -138,6 +138,7 @@ class NasMm ...@@ -138,6 +138,7 @@ class NasMm
private: /* De-registration */ private: /* De-registration */
void receiveDeregistrationAccept(const nas::DeRegistrationAcceptUeOriginating &msg); void receiveDeregistrationAccept(const nas::DeRegistrationAcceptUeOriginating &msg);
void receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTerminated &msg); void receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTerminated &msg);
void performLocalDeregistration();
private: /* Configuration */ private: /* Configuration */
void receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &msg); void receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &msg);
......
...@@ -78,10 +78,22 @@ void NasMm::onTimerExpire(UeTimer &timer) ...@@ -78,10 +78,22 @@ void NasMm::onTimerExpire(UeTimer &timer)
break; break;
} }
case 3512: { case 3512: {
if (m_mmState == EMmState::MM_REGISTERED && m_cmState == ECmState::CM_CONNECTED) if (m_mmState == EMmState::MM_REGISTERED)
{ {
logExpired(); logExpired();
sendMobilityRegistration(ERegUpdateCause::T3512_EXPIRY);
if (m_registeredForEmergency)
performLocalDeregistration();
else
{
if (m_mmSubState == EMmSubState::MM_REGISTERED_NORMAL_SERVICE)
sendMobilityRegistration(ERegUpdateCause::T3512_EXPIRY);
else
{
// TODO: "the periodic registration update procedure is delayed until the UE returns to
// 5GMM-REGISTERED.NORMAL-SERVICE over 3GPP access." See 5.3.7
}
}
} }
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment