Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
f6aba399
Commit
f6aba399
authored
May 22, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
90f9633f
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
44 additions
and
39 deletions
+44
-39
src/ue/app/cmd_handler.cpp
src/ue/app/cmd_handler.cpp
+2
-2
src/ue/nas/mm/auth.cpp
src/ue/nas/mm/auth.cpp
+1
-1
src/ue/nas/mm/config.cpp
src/ue/nas/mm/config.cpp
+2
-2
src/ue/nas/mm/dereg.cpp
src/ue/nas/mm/dereg.cpp
+3
-3
src/ue/nas/mm/ecall.cpp
src/ue/nas/mm/ecall.cpp
+1
-1
src/ue/nas/mm/identity.cpp
src/ue/nas/mm/identity.cpp
+10
-9
src/ue/nas/mm/radio.cpp
src/ue/nas/mm/radio.cpp
+5
-5
src/ue/nas/mm/register.cpp
src/ue/nas/mm/register.cpp
+6
-6
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+2
-2
src/ue/nas/mm/timer.cpp
src/ue/nas/mm/timer.cpp
+1
-1
src/ue/nas/storage.cpp
src/ue/nas/storage.cpp
+6
-2
src/ue/nas/storage.hpp
src/ue/nas/storage.hpp
+5
-1
src/ue/nas/usim/usim.hpp
src/ue/nas/usim/usim.hpp
+0
-4
No files found.
src/ue/app/cmd_handler.cpp
View file @
f6aba399
...
...
@@ -115,8 +115,8 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg)
{
"mm-state"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_mmSubState
)},
{
"5u-state"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_usim
->
m_uState
)},
{
"sim-inserted"
,
m_base
->
nasTask
->
mm
->
m_usim
->
isValid
()},
{
"stored-suci"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_
usim
->
m_storedSuci
)},
{
"stored-guti"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_
usim
->
m_storedGuti
)},
{
"stored-suci"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_
storage
->
storedSuci
->
get
()
)},
{
"stored-guti"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_
storage
->
storedGuti
->
get
()
)},
{
"has-emergency"
,
::
ToJson
(
m_base
->
nasTask
->
mm
->
hasEmergency
())},
{
"pdu-sessions"
,
Json
::
Arr
(
std
::
move
(
pduSessions
))},
});
...
...
src/ue/nas/mm/auth.cpp
View file @
f6aba399
...
...
@@ -432,7 +432,7 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg)
switchUState
(
E5UState
::
U3_ROAMING_NOT_ALLOWED
);
// Delete the stored 5G-GUTI, TAI list, last visited registered TAI and ngKSI. The USIM shall be considered invalid
// until switching off the UE or the UICC containing the USIM is removed
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_taiList
=
{};
m_usim
->
m_currentNsCtx
=
{};
...
...
src/ue/nas/mm/config.cpp
View file @
f6aba399
...
...
@@ -39,8 +39,8 @@ void NasMm::receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &ms
if
(
msg
.
guti
.
has_value
()
&&
msg
.
guti
->
type
==
nas
::
EIdentityType
::
GUTI
)
{
hasNewConfig
=
true
;
m_
usim
->
m_storedSuci
=
{}
;
m_
usim
->
m_storedGuti
=
*
msg
.
guti
;
m_
storage
->
storedSuci
->
clear
()
;
m_
storage
->
storedGuti
->
set
(
*
msg
.
guti
)
;
m_timers
->
t3519
.
stop
();
}
...
...
src/ue/nas/mm/dereg.cpp
View file @
f6aba399
...
...
@@ -100,7 +100,7 @@ void NasMm::receiveDeregistrationAccept(const nas::DeRegistrationAcceptUeOrigina
m_timers
->
t3521
.
stop
();
m_timers
->
t3519
.
stop
();
m_
usim
->
m_storedSuci
=
{}
;
m_
storage
->
storedSuci
->
clear
()
;
m_sm
->
localReleaseAllSessions
();
...
...
@@ -195,7 +195,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
// set the 5GS update status to 5U2 NOT UPDATED and shall start timer T3502. A UE not supporting S1 mode may
// enter the state 5GMM-DEREGISTERED.PLMN-SEARCH in order to perform a PLMN selection according to 3GPP
// TS 23.122 [5]; otherwise the UE shall enter the state 5GMM-DEREGISTERED.ATTEMPTING-REGISTRATION."
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_usim
->
m_taiList
=
{};
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_equivalentPlmnList
=
{};
...
...
@@ -218,7 +218,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
||
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
)
{
switchUState
(
E5UState
::
U3_ROAMING_NOT_ALLOWED
);
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_taiList
=
{};
m_usim
->
m_currentNsCtx
=
{};
...
...
src/ue/nas/mm/ecall.cpp
View file @
f6aba399
...
...
@@ -90,7 +90,7 @@ bool NasMm::switchToECallInactivityIfNeeded()
return
false
;
// Perform item c) in 5.5.3
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_usim
->
m_taiList
=
{};
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_equivalentPlmnList
=
{};
...
...
src/ue/nas/mm/identity.cpp
View file @
f6aba399
...
...
@@ -33,12 +33,12 @@ void NasMm::receiveIdentityRequest(const nas::IdentityRequest &msg)
}
else
if
(
msg
.
identityType
.
value
==
nas
::
EIdentityType
::
GUTI
)
{
resp
.
mobileIdentity
=
m_
usim
->
m_storedGuti
;
resp
.
mobileIdentity
=
m_
storage
->
storedGuti
->
get
()
;
}
else
if
(
msg
.
identityType
.
value
==
nas
::
EIdentityType
::
TMSI
)
{
// TMSI is already a part of GUTI
resp
.
mobileIdentity
=
m_
usim
->
m_storedGuti
;
resp
.
mobileIdentity
=
m_
storage
->
storedGuti
->
get
()
;
if
(
resp
.
mobileIdentity
.
type
!=
nas
::
EIdentityType
::
NO_IDENTITY
)
{
resp
.
mobileIdentity
.
type
=
nas
::
EIdentityType
::
TMSI
;
...
...
@@ -57,15 +57,16 @@ void NasMm::receiveIdentityRequest(const nas::IdentityRequest &msg)
nas
::
IE5gsMobileIdentity
NasMm
::
getOrGenerateSuci
()
{
if
(
m_timers
->
t3519
.
isRunning
()
&&
m_usim
->
m_storedSuci
.
type
!=
nas
::
EIdentityType
::
NO_IDENTITY
)
return
m_usim
->
m_storedSuci
;
if
(
m_timers
->
t3519
.
isRunning
()
&&
m_storage
->
storedSuci
->
get
().
type
!=
nas
::
EIdentityType
::
NO_IDENTITY
)
return
m_storage
->
storedSuci
->
get
();
m_storage
->
storedSuci
->
set
(
generateSuci
());
m_usim
->
m_storedSuci
=
generateSuci
();
m_timers
->
t3519
.
start
();
if
(
m_
usim
->
m_storedSuci
.
type
==
nas
::
EIdentityType
::
NO_IDENTITY
)
if
(
m_
storage
->
storedSuci
->
get
()
.
type
==
nas
::
EIdentityType
::
NO_IDENTITY
)
return
{};
return
m_
usim
->
m_storedSuci
;
return
m_
storage
->
storedSuci
->
get
()
;
}
nas
::
IE5gsMobileIdentity
NasMm
::
generateSuci
()
...
...
@@ -99,8 +100,8 @@ nas::IE5gsMobileIdentity NasMm::generateSuci()
nas
::
IE5gsMobileIdentity
NasMm
::
getOrGeneratePreferredId
()
{
if
(
m_
usim
->
m_storedGuti
.
type
!=
nas
::
EIdentityType
::
NO_IDENTITY
)
return
m_
usim
->
m_storedGuti
;
if
(
m_
storage
->
storedGuti
->
get
()
.
type
!=
nas
::
EIdentityType
::
NO_IDENTITY
)
return
m_
storage
->
storedGuti
->
get
()
;
auto
suci
=
getOrGenerateSuci
();
if
(
suci
.
type
!=
nas
::
EIdentityType
::
NO_IDENTITY
)
...
...
src/ue/nas/mm/radio.cpp
View file @
f6aba399
...
...
@@ -223,7 +223,6 @@ void NasMm::handleRrcConnectionRelease()
void
NasMm
::
handleRrcEstablishmentFailure
()
{
}
void
NasMm
::
handleRadioLinkFailure
()
...
...
@@ -253,14 +252,15 @@ void NasMm::localReleaseConnection()
void
NasMm
::
handlePaging
(
const
std
::
vector
<
GutiMobileIdentity
>
&
tmsiIds
)
{
if
(
m_usim
->
m_storedGuti
.
type
==
nas
::
EIdentityType
::
NO_IDENTITY
)
auto
guti
=
m_storage
->
storedGuti
->
get
();
if
(
guti
.
type
==
nas
::
EIdentityType
::
NO_IDENTITY
)
return
;
bool
tmsiMatches
=
false
;
for
(
auto
&
tmsi
:
tmsiIds
)
{
if
(
tmsi
.
amfSetId
==
m_usim
->
m_storedGuti
.
gutiOrTmsi
.
amfSetId
&&
tmsi
.
amfPointer
==
m_usim
->
m_storedGuti
.
gutiOrTmsi
.
amfPointer
&&
tmsi
.
tmsi
==
m_usim
->
m_storedGuti
.
gutiOrTmsi
.
tmsi
)
if
(
tmsi
.
amfSetId
==
guti
.
gutiOrTmsi
.
amfSetId
&&
tmsi
.
amfPointer
==
guti
.
gutiOrTmsi
.
amfPointer
&&
tmsi
.
tmsi
==
guti
.
gutiOrTmsi
.
tmsi
)
{
tmsiMatches
=
true
;
break
;
...
...
src/ue/nas/mm/register.cpp
View file @
f6aba399
...
...
@@ -274,7 +274,7 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
{
if
(
msg
.
mobileIdentity
->
type
==
nas
::
EIdentityType
::
GUTI
)
{
m_
usim
->
m_storedGuti
=
*
msg
.
mobileIdentity
;
m_
storage
->
storedGuti
->
set
(
*
msg
.
mobileIdentity
)
;
m_timers
->
t3519
.
stop
();
sendComplete
=
true
;
}
...
...
@@ -392,7 +392,7 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
{
if
(
msg
.
mobileIdentity
->
type
==
nas
::
EIdentityType
::
GUTI
)
{
m_
usim
->
m_storedGuti
=
*
msg
.
mobileIdentity
;
m_
storage
->
storedGuti
->
set
(
*
msg
.
mobileIdentity
)
;
m_timers
->
t3519
.
stop
();
sendComplete
=
true
;
}
...
...
@@ -525,7 +525,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
||
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
)
{
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_taiList
=
{};
m_usim
->
m_currentNsCtx
=
{};
...
...
@@ -674,7 +674,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
||
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
UE_IDENTITY_CANNOT_BE_DERIVED_FROM_NETWORK
)
{
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_taiList
=
{};
m_usim
->
m_currentNsCtx
=
{};
...
...
@@ -814,7 +814,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType)
else
{
// The UE shall delete 5G-GUTI, TAI list, last visited TAI, list of equivalent PLMNs and ngKSI, ..
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_usim
->
m_taiList
=
{};
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_equivalentPlmnList
=
{};
...
...
@@ -889,7 +889,7 @@ void NasMm::resetRegAttemptCounter()
// the UE shall stop timer T3519 if running, and delete any stored SUCI"
m_regCounter
=
0
;
m_timers
->
t3519
.
stop
();
m_
usim
->
m_storedSuci
=
{}
;
m_
storage
->
storedSuci
->
clear
()
;
// TODO: Registration attempt counter shall be reset for these cases as well (not implemented yet)
// - the UE is powered on;
...
...
src/ue/nas/mm/service.cpp
View file @
f6aba399
...
...
@@ -142,7 +142,7 @@ void NasMm::sendServiceRequest(EServiceReqCause reqCause)
}
// Assign TMSI (TMSI is a part of GUTI)
request
->
tmsi
=
m_
usim
->
m_storedGuti
;
request
->
tmsi
=
m_
storage
->
storedGuti
->
get
()
;
if
(
request
->
tmsi
.
type
!=
nas
::
EIdentityType
::
NO_IDENTITY
)
{
request
->
tmsi
.
type
=
nas
::
EIdentityType
::
TMSI
;
...
...
@@ -286,7 +286,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
)
{
m_
usim
->
m_storedGuti
=
{}
;
m_
storage
->
storedGuti
->
clear
()
;
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_usim
->
m_taiList
=
{};
m_usim
->
m_currentNsCtx
=
{};
...
...
src/ue/nas/mm/timer.cpp
View file @
f6aba399
...
...
@@ -111,7 +111,7 @@ void NasMm::onTimerExpire(UeTimer &timer)
break
;
}
case
3519
:
{
m_
usim
->
m_storedSuci
=
{}
;
m_
storage
->
storedSuci
->
clear
()
;
break
;
}
case
3520
:
{
...
...
src/ue/nas/storage.cpp
View file @
f6aba399
...
...
@@ -25,6 +25,12 @@ namespace nr::ue
MmStorage
::
MmStorage
(
TaskBase
*
base
)
:
m_base
{
base
}
{
storedSuci
=
std
::
make_unique
<
nas
::
NasSlot
<
nas
::
IE5gsMobileIdentity
>>
(
0
,
std
::
nullopt
);
storedGuti
=
std
::
make_unique
<
nas
::
NasSlot
<
nas
::
IE5gsMobileIdentity
>>
(
0
,
std
::
nullopt
);
lastVisitedRegisteredTai
=
std
::
make_unique
<
nas
::
NasSlot
<
Tai
>>
(
0
,
std
::
nullopt
);
forbiddenTaiListRoaming
=
std
::
make_unique
<
nas
::
NasList
<
Tai
>>
(
FORBIDDEN_TAI_LIST_SIZE
,
FORBIDDEN_TAI_CLEAR_PERIOD
,
[
this
](
const
std
::
vector
<
Tai
>
&
buffer
,
size_t
count
)
{
BackupTaiListInSharedCtx
(
buffer
,
count
,
m_base
->
shCtx
.
forbiddenTaiRoaming
);
...
...
@@ -36,8 +42,6 @@ MmStorage::MmStorage(TaskBase *base) : m_base{base}
});
serviceAreaList
=
std
::
make_unique
<
nas
::
NasSlot
<
nas
::
IEServiceAreaList
>>
(
0
,
std
::
nullopt
);
lastVisitedRegisteredTai
=
std
::
make_unique
<
nas
::
NasSlot
<
Tai
>>
(
0
,
std
::
nullopt
);
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/nas/storage.hpp
View file @
f6aba399
...
...
@@ -19,10 +19,14 @@ class MmStorage
TaskBase
*
m_base
;
public:
std
::
unique_ptr
<
nas
::
NasSlot
<
nas
::
IE5gsMobileIdentity
>>
storedSuci
;
std
::
unique_ptr
<
nas
::
NasSlot
<
nas
::
IE5gsMobileIdentity
>>
storedGuti
;
std
::
unique_ptr
<
nas
::
NasSlot
<
Tai
>>
lastVisitedRegisteredTai
;
std
::
unique_ptr
<
nas
::
NasList
<
Tai
>>
forbiddenTaiListRoaming
;
std
::
unique_ptr
<
nas
::
NasList
<
Tai
>>
forbiddenTaiListRps
;
std
::
unique_ptr
<
nas
::
NasSlot
<
nas
::
IEServiceAreaList
>>
serviceAreaList
;
std
::
unique_ptr
<
nas
::
NasSlot
<
Tai
>>
lastVisitedRegisteredTai
;
public:
explicit
MmStorage
(
TaskBase
*
base
);
...
...
src/ue/nas/usim/usim.hpp
View file @
f6aba399
...
...
@@ -30,10 +30,6 @@ class Usim
// State related
E5UState
m_uState
{};
// Identity related
nas
::
IE5gsMobileIdentity
m_storedSuci
{};
nas
::
IE5gsMobileIdentity
m_storedGuti
{};
// Plmn related
nas
::
IE5gsTrackingAreaIdentityList
m_taiList
{};
nas
::
IEPlmnList
m_equivalentPlmnList
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment