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
5551dbea
Commit
5551dbea
authored
May 23, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
e3fa41ad
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
76 deletions
+46
-76
src/ue/nas/mm/mm.hpp
src/ue/nas/mm/mm.hpp
+9
-19
src/ue/nas/mm/sap.cpp
src/ue/nas/mm/sap.cpp
+0
-29
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+14
-0
src/ue/nas/sm/establishment.cpp
src/ue/nas/sm/establishment.cpp
+3
-3
src/ue/nas/sm/release.cpp
src/ue/nas/sm/release.cpp
+1
-1
src/ue/nas/sm/sap.cpp
src/ue/nas/sm/sap.cpp
+0
-0
src/ue/nas/sm/sm.hpp
src/ue/nas/sm/sm.hpp
+19
-24
No files found.
src/ue/nas/mm/mm.hpp
View file @
5551dbea
...
...
@@ -67,6 +67,8 @@ class NasMm
int64_t
m_lastTimeMmStateChange
{};
friend
class
UeCmdHandler
;
friend
class
NasSm
;
friend
class
NasTask
;
public:
NasMm
(
TaskBase
*
base
,
NasTimers
*
timers
);
...
...
@@ -97,14 +99,10 @@ class NasMm
private:
/* Transport */
void
receiveDlNasTransport
(
const
nas
::
DlNasTransport
&
msg
);
public:
/* Transport */
void
deliverUlTransport
(
const
nas
::
UlNasTransport
&
msg
);
public:
/* Registration */
void
sendMobilityRegistration
(
ERegUpdateCause
updateCause
);
private:
/* Registration */
void
sendMobilityRegistration
(
ERegUpdateCause
updateCause
);
void
sendInitialRegistration
(
EInitialRegCause
regCause
);
void
receiveRegistrationAccept
(
const
nas
::
RegistrationAccept
&
msg
);
void
receiveInitialRegistrationAccept
(
const
nas
::
RegistrationAccept
&
msg
);
...
...
@@ -132,10 +130,8 @@ class NasMm
void
receiveSecurityModeCommand
(
const
nas
::
SecurityModeCommand
&
msg
);
nas
::
IEUeSecurityCapability
createSecurityCapabilityIe
();
public:
/* De-registration */
void
sendDeregistration
(
EDeregCause
deregCause
);
private:
/* De-registration */
void
sendDeregistration
(
EDeregCause
deregCause
);
void
receiveDeregistrationAccept
(
const
nas
::
DeRegistrationAcceptUeOriginating
&
msg
);
void
receiveDeregistrationRequest
(
const
nas
::
DeRegistrationRequestUeTerminated
&
msg
);
void
performLocalDeregistration
();
...
...
@@ -154,6 +150,7 @@ class NasMm
void
sendServiceRequest
(
EServiceReqCause
reqCause
);
void
receiveServiceAccept
(
const
nas
::
ServiceAccept
&
msg
);
void
receiveServiceReject
(
const
nas
::
ServiceReject
&
msg
);
void
serviceNeededForUplinkData
();
private:
/* Network Slicing */
NetworkSlice
makeRequestedNssai
(
bool
&
isDefaultNssai
)
const
;
...
...
@@ -170,11 +167,9 @@ class NasMm
void
handlePaging
(
const
std
::
vector
<
GutiMobileIdentity
>
&
tmsiIds
);
void
updateProvidedGuti
(
bool
provide
=
true
);
p
ublic
:
/* Access Control */
p
rivate
:
/* Access Control */
bool
isHighPriority
();
bool
hasEmergency
();
private:
/* Access Control */
void
setN1Capability
(
bool
enabled
);
bool
isInNonAllowedArea
();
...
...
@@ -185,14 +180,9 @@ class NasMm
private:
/* Timer */
void
onTimerExpire
(
UeTimer
&
timer
);
public:
/* Interface */
void
handleRrcEvent
(
const
NwUeRrcToNas
&
msg
);
// used by RRC
void
handleNasEvent
(
const
NwUeNasToNas
&
msg
);
// used by NAS
bool
isRegistered
();
// used by SM
bool
isRegisteredForEmergency
();
// used by SM
void
serviceNeededForUplinkData
();
// used by SM
bool
isStateNonAllowedService
();
// used by SM
private:
/* Service Access Point */
void
handleRrcEvent
(
const
NwUeRrcToNas
&
msg
);
void
handleNasEvent
(
const
NwUeNasToNas
&
msg
);
};
}
// namespace nr::ue
\ No newline at end of file
src/ue/nas/mm/
interface
.cpp
→
src/ue/nas/mm/
sap
.cpp
View file @
5551dbea
...
...
@@ -10,8 +10,6 @@
#include <utils/common.hpp>
static
constexpr
const
int64_t
SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD
=
1000
;
namespace
nr
::
ue
{
...
...
@@ -72,31 +70,4 @@ void NasMm::handleNasEvent(const NwUeNasToNas &msg)
}
}
bool
NasMm
::
isRegistered
()
{
return
m_rmState
==
ERmState
::
RM_REGISTERED
;
}
bool
NasMm
::
isRegisteredForEmergency
()
{
return
isRegistered
()
&&
m_registeredForEmergency
;
}
void
NasMm
::
serviceNeededForUplinkData
()
{
auto
currentTime
=
utils
::
CurrentTimeMillis
();
if
(
currentTime
-
m_lastTimeServiceReqNeededIndForData
>
SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD
)
{
sendServiceRequest
(
m_cmState
==
ECmState
::
CM_CONNECTED
?
EServiceReqCause
::
CONNECTED_UPLINK_DATA_PENDING
:
EServiceReqCause
::
IDLE_UPLINK_DATA_PENDING
);
m_lastTimeServiceReqNeededIndForData
=
currentTime
;
}
}
bool
NasMm
::
isStateNonAllowedService
()
{
return
m_mmSubState
==
EMmSubState
::
MM_REGISTERED_NON_ALLOWED_SERVICE
;
}
}
// namespace nr::ue
src/ue/nas/mm/service.cpp
View file @
5551dbea
...
...
@@ -459,4 +459,18 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
}
}
void
NasMm
::
serviceNeededForUplinkData
()
{
static
constexpr
const
int64_t
SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD
=
1000
;
auto
currentTime
=
utils
::
CurrentTimeMillis
();
if
(
currentTime
-
m_lastTimeServiceReqNeededIndForData
>
SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD
)
{
sendServiceRequest
(
m_cmState
==
ECmState
::
CM_CONNECTED
?
EServiceReqCause
::
CONNECTED_UPLINK_DATA_PENDING
:
EServiceReqCause
::
IDLE_UPLINK_DATA_PENDING
);
m_lastTimeServiceReqNeededIndForData
=
currentTime
;
}
}
}
// namespace nr::ue
src/ue/nas/sm/establishment.cpp
View file @
5551dbea
...
...
@@ -41,13 +41,13 @@ void NasSm::sendEstablishmentRequest(const SessionConfig &config)
m_logger
->
debug
(
"Sending PDU Session Establishment Request"
);
/* Control the protocol state */
if
(
!
m_mm
->
isRegistered
()
)
if
(
m_mm
->
m_rmState
!=
ERmState
::
RM_REGISTERED
)
{
m_logger
->
err
(
"PDU session establishment could not be triggered, UE is not registered"
);
return
;
}
if
(
m_mm
->
isStateNonAllowedService
()
&&
!
m_mm
->
hasEmergency
()
&&
!
m_mm
->
isHighPriority
())
if
(
m_mm
->
m_mmSubState
==
EMmSubState
::
MM_REGISTERED_NON_ALLOWED_SERVICE
&&
!
m_mm
->
hasEmergency
()
&&
!
m_mm
->
isHighPriority
())
{
m_logger
->
err
(
"PDU session establishment could not be triggered, non allowed service condition"
);
return
;
...
...
@@ -59,7 +59,7 @@ void NasSm::sendEstablishmentRequest(const SessionConfig &config)
m_logger
->
err
(
"PDU session type [%s] is not supported"
,
nas
::
utils
::
EnumToString
(
config
.
type
));
return
;
}
if
(
m_mm
->
isRegisteredForEmergency
()
&&
!
config
.
isEmergency
)
if
(
m_mm
->
m_rmState
==
ERmState
::
RM_REGISTERED
&&
m_mm
->
m_registeredForEmergency
&&
!
config
.
isEmergency
)
{
m_logger
->
err
(
"Non-emergency PDU session cannot be requested, UE is registered for emergency only"
);
return
;
...
...
src/ue/nas/sm/release.cpp
View file @
5551dbea
...
...
@@ -19,7 +19,7 @@ namespace nr::ue
void
NasSm
::
sendReleaseRequest
(
int
psi
)
{
/* Control the protocol state */
if
(
m_mm
->
isStateNonAllowedService
()
&&
!
m_mm
->
hasEmergency
()
&&
!
m_mm
->
isHighPriority
())
if
(
m_mm
->
m_mmSubState
==
EMmSubState
::
MM_REGISTERED_NON_ALLOWED_SERVICE
&&
!
m_mm
->
hasEmergency
()
&&
!
m_mm
->
isHighPriority
())
{
m_logger
->
err
(
"PDU session release could not start, non allowed service condition"
);
return
;
...
...
src/ue/nas/sm/
interface
.cpp
→
src/ue/nas/sm/
sap
.cpp
View file @
5551dbea
File moved
src/ue/nas/sm/sm.hpp
View file @
5551dbea
...
...
@@ -32,22 +32,17 @@ class NasSm
std
::
array
<
ProcedureTransaction
,
255
>
m_procedureTransactions
{};
friend
class
UeCmdHandler
;
friend
class
NasMm
;
friend
class
NasTask
;
public:
NasSm
(
TaskBase
*
base
,
NasTimers
*
timers
);
public:
/* Base */
public:
/* Base */
void
onStart
(
NasMm
*
mm
);
void
onQuit
();
void
establishInitialSessions
();
/* Transport */
void
receiveSmMessage
(
const
nas
::
SmMessage
&
msg
);
void
receiveForwardingFailure
(
const
nas
::
SmMessage
&
msg
,
nas
::
EMmCause
cause
,
const
std
::
optional
<
nas
::
IEGprsTimer3
>
&
backoffTimer
);
/* Resource */
private:
/* Resource */
void
localReleaseSession
(
int
psi
);
void
localReleaseAllSessions
();
bool
anyEmergencySession
();
...
...
@@ -57,45 +52,45 @@ class NasSm
std
::
bitset
<
16
>
getUplinkDataStatus
();
std
::
bitset
<
16
>
getPduSessionStatus
();
/* Session Release */
void
sendReleaseRequest
(
int
psi
);
void
sendReleaseRequestForAll
();
private:
/* Transport */
private:
/* Transport */
void
receiveSmMessage
(
const
nas
::
SmMessage
&
msg
);
void
sendSmMessage
(
int
psi
,
const
nas
::
SmMessage
&
msg
);
void
receiveSmStatus
(
const
nas
::
FiveGSmStatus
&
msg
);
void
sendSmCause
(
const
nas
::
ESmCause
&
cause
,
int
pti
,
int
psi
);
void
receiveForwardingFailure
(
const
nas
::
SmMessage
&
msg
,
nas
::
EMmCause
cause
,
const
std
::
optional
<
nas
::
IEGprsTimer3
>
&
backoffTimer
);
/* Allocation */
private:
/* Allocation */
int
allocatePduSessionId
(
const
SessionConfig
&
config
);
int
allocateProcedureTransactionId
();
void
freeProcedureTransactionId
(
int
pti
);
void
freePduSessionId
(
int
psi
);
/* Session Establishment */
private:
/* Session Establishment */
void
establishInitialSessions
();
void
sendEstablishmentRequest
(
const
SessionConfig
&
config
);
void
receiveEstablishmentAccept
(
const
nas
::
PduSessionEstablishmentAccept
&
msg
);
void
receiveEstablishmentReject
(
const
nas
::
PduSessionEstablishmentReject
&
msg
);
/* Session Release */
private:
/* Session Release */
void
sendReleaseRequest
(
int
psi
);
void
sendReleaseRequestForAll
();
void
receiveReleaseReject
(
const
nas
::
PduSessionReleaseReject
&
msg
);
void
receiveReleaseCommand
(
const
nas
::
PduSessionReleaseCommand
&
msg
);
/* Timer */
private:
/* Timer */
std
::
unique_ptr
<
UeTimer
>
newTransactionTimer
(
int
code
);
void
onTimerExpire
(
UeTimer
&
timer
);
void
onTransactionTimerExpire
(
int
pti
);
/* Procedure */
private:
/* Procedure */
bool
checkPtiAndPsi
(
const
nas
::
SmMessage
&
msg
);
void
abortProcedureByPti
(
int
pti
);
void
abortProcedureByPtiOrPsi
(
int
pti
,
int
psi
);
public:
/* Interface */
void
handleNasEvent
(
const
NwUeNasToNas
&
msg
);
// used by NAS
void
onTimerTick
();
// used by NAS
private:
/* Service Access Point */
void
handleNasEvent
(
const
NwUeNasToNas
&
msg
);
void
onTimerTick
();
};
}
// namespace nr::ue
\ No newline at end of file
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