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
6055137b
Commit
6055137b
authored
Dec 28, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance improvements
parent
2fd25c41
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
54 deletions
+53
-54
src/ue/app/cmd_handler.cpp
src/ue/app/cmd_handler.cpp
+17
-17
src/ue/nas/layer.cpp
src/ue/nas/layer.cpp
+27
-26
src/ue/nas/layer.hpp
src/ue/nas/layer.hpp
+8
-11
src/utils/octet_string.hpp
src/utils/octet_string.hpp
+1
-0
No files found.
src/ue/app/cmd_handler.cpp
View file @
6055137b
...
...
@@ -118,19 +118,19 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
}
Json
json
=
Json
::
Obj
({
{
"cm-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
m_cmState
)},
{
"rm-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
m_rmState
)},
{
"mm-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
m_mmSubState
)},
{
"5u-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
m_storage
->
uState
->
get
())},
{
"sim-inserted"
,
m_base
->
nasTask
->
layer
->
mm
->
m_usim
->
isValid
()},
{
"cm-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_cmState
)},
{
"rm-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_rmState
)},
{
"mm-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_mmSubState
)},
{
"5u-state"
,
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_storage
->
uState
->
get
())},
{
"sim-inserted"
,
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_usim
->
isValid
()},
{
"selected-plmn"
,
::
ToJson
(
m_base
->
shCtx
.
selectedPlmn
.
get
())},
{
"current-cell"
,
::
ToJson
(
currentCellId
)},
{
"current-plmn"
,
::
ToJson
(
currentPlmn
)},
{
"current-tac"
,
::
ToJson
(
currentTac
)},
{
"last-tai"
,
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
m_storage
->
lastVisitedRegisteredTai
)},
{
"stored-suci"
,
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
m_storage
->
storedSuci
->
get
())},
{
"stored-guti"
,
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
m_storage
->
storedGuti
->
get
())},
{
"has-emergency"
,
::
ToJson
(
m_base
->
nasTask
->
layer
->
mm
->
hasEmergency
())},
{
"last-tai"
,
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_storage
->
lastVisitedRegisteredTai
)},
{
"stored-suci"
,
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_storage
->
storedSuci
->
get
())},
{
"stored-guti"
,
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
m_storage
->
storedGuti
->
get
())},
{
"has-emergency"
,
::
ToJson
(
m_base
->
nasTask
->
layer
->
m
_m
m
->
hasEmergency
())},
});
sendResult
(
msg
.
address
,
json
.
dumpYaml
());
break
;
...
...
@@ -141,7 +141,7 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
{
"hplmn"
,
ToJson
(
m_base
->
config
->
hplmn
)},
{
"imei"
,
::
ToJson
(
m_base
->
config
->
imei
)},
{
"imeisv"
,
::
ToJson
(
m_base
->
config
->
imeiSv
)},
{
"ecall-only"
,
::
ToJson
(
m_base
->
nasTask
->
layer
->
usim
->
m_isECallOnly
)},
{
"ecall-only"
,
::
ToJson
(
m_base
->
nasTask
->
layer
->
m_
usim
->
m_isECallOnly
)},
{
"uac-aic"
,
Json
::
Obj
({
{
"mps"
,
m_base
->
config
->
uacAic
.
mps
},
{
"mcs"
,
m_base
->
config
->
uacAic
.
mcs
},
...
...
@@ -154,18 +154,18 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
{
"class-14"
,
m_base
->
config
->
uacAcc
.
cls14
},
{
"class-15"
,
m_base
->
config
->
uacAcc
.
cls15
},
})},
{
"is-high-priority"
,
m_base
->
nasTask
->
layer
->
mm
->
isHighPriority
()},
{
"is-high-priority"
,
m_base
->
nasTask
->
layer
->
m
_m
m
->
isHighPriority
()},
});
sendResult
(
msg
.
address
,
json
.
dumpYaml
());
break
;
}
case
app
:
:
UeCliCommand
::
TIMERS
:
{
sendResult
(
msg
.
address
,
ToJson
(
m_base
->
nasTask
->
layer
->
timers
).
dumpYaml
());
sendResult
(
msg
.
address
,
ToJson
(
m_base
->
nasTask
->
layer
->
m_
timers
).
dumpYaml
());
break
;
}
case
app
:
:
UeCliCommand
::
DE_REGISTER
:
{
m_base
->
nasTask
->
layer
->
mm
->
deregistrationRequired
(
msg
.
cmd
->
deregCause
);
m_base
->
nasTask
->
layer
->
m
_m
m
->
deregistrationRequired
(
msg
.
cmd
->
deregCause
);
if
(
msg
.
cmd
->
deregCause
!=
EDeregCause
::
SWITCH_OFF
)
sendResult
(
msg
.
address
,
"De-registration procedure triggered"
);
...
...
@@ -175,12 +175,12 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
}
case
app
:
:
UeCliCommand
::
PS_RELEASE
:
{
for
(
int
i
=
0
;
i
<
msg
.
cmd
->
psCount
;
i
++
)
m_base
->
nasTask
->
layer
->
sm
->
sendReleaseRequest
(
static_cast
<
int
>
(
msg
.
cmd
->
psIds
[
i
])
%
16
);
m_base
->
nasTask
->
layer
->
m_
sm
->
sendReleaseRequest
(
static_cast
<
int
>
(
msg
.
cmd
->
psIds
[
i
])
%
16
);
sendResult
(
msg
.
address
,
"PDU session release procedure(s) triggered"
);
break
;
}
case
app
:
:
UeCliCommand
::
PS_RELEASE_ALL
:
{
m_base
->
nasTask
->
layer
->
sm
->
sendReleaseRequestForAll
();
m_base
->
nasTask
->
layer
->
m_
sm
->
sendReleaseRequestForAll
();
sendResult
(
msg
.
address
,
"PDU session release procedure(s) triggered"
);
break
;
}
...
...
@@ -190,13 +190,13 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
config
.
isEmergency
=
msg
.
cmd
->
isEmergency
;
config
.
apn
=
msg
.
cmd
->
apn
;
config
.
sNssai
=
msg
.
cmd
->
sNssai
;
m_base
->
nasTask
->
layer
->
sm
->
sendEstablishmentRequest
(
config
);
m_base
->
nasTask
->
layer
->
m_
sm
->
sendEstablishmentRequest
(
config
);
sendResult
(
msg
.
address
,
"PDU session establishment procedure triggered"
);
break
;
}
case
app
:
:
UeCliCommand
::
PS_LIST
:
{
Json
json
=
Json
::
Obj
({});
for
(
auto
*
pduSession
:
m_base
->
nasTask
->
layer
->
sm
->
m_pduSessions
)
for
(
auto
*
pduSession
:
m_base
->
nasTask
->
layer
->
m_
sm
->
m_pduSessions
)
{
if
(
pduSession
->
psi
==
0
||
pduSession
->
psState
==
EPsState
::
INACTIVE
)
continue
;
...
...
src/ue/nas/layer.cpp
View file @
6055137b
...
...
@@ -3,32 +3,32 @@
namespace
nr
::
ue
{
NasLayer
::
NasLayer
(
TaskBase
*
base
)
:
base
{
base
},
timers
{}
NasLayer
::
NasLayer
(
TaskBase
*
base
)
:
m_base
{
base
},
m_
timers
{}
{
logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"nas"
);
m_
logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"nas"
);
m
m
=
new
NasMm
(
base
,
&
timers
);
sm
=
new
NasSm
(
base
,
&
timers
);
usim
=
new
Usim
();
m
_mm
=
new
NasMm
(
base
,
&
m_
timers
);
m_sm
=
new
NasSm
(
base
,
&
m_
timers
);
m_
usim
=
new
Usim
();
}
void
NasLayer
::
onStart
()
{
usim
->
initialize
(
base
->
config
->
supi
.
has_value
());
m_usim
->
initialize
(
m_
base
->
config
->
supi
.
has_value
());
sm
->
onStart
(
mm
);
m
m
->
onStart
(
sm
,
usim
);
m_sm
->
onStart
(
m_
mm
);
m
_mm
->
onStart
(
m_sm
,
m_
usim
);
}
void
NasLayer
::
onQuit
()
{
mm
->
onQuit
();
sm
->
onQuit
();
m
_m
m
->
onQuit
();
m_
sm
->
onQuit
();
delete
mm
;
delete
sm
;
delete
m
_m
m
;
delete
m_
sm
;
delete
usim
;
delete
m_
usim
;
}
void
NasLayer
::
handleSapMessage
(
std
::
unique_ptr
<
NtsMessage
>
msg
)
...
...
@@ -36,7 +36,7 @@ void NasLayer::handleSapMessage(std::unique_ptr<NtsMessage> msg)
switch
(
msg
->
msgType
)
{
case
NtsMessageType
:
:
UE_RRC_TO_NAS
:
{
mm
->
handleRrcEvent
(
dynamic_cast
<
NmUeRrcToNas
&>
(
*
msg
));
m
_m
m
->
handleRrcEvent
(
dynamic_cast
<
NmUeRrcToNas
&>
(
*
msg
));
break
;
}
case
NtsMessageType
:
:
UE_TUN_TO_APP
:
{
...
...
@@ -44,7 +44,7 @@ void NasLayer::handleSapMessage(std::unique_ptr<NtsMessage> msg)
switch
(
w
.
present
)
{
case
NmUeTunToApp
:
:
DATA_PDU_DELIVERY
:
{
sm
->
handleUplinkDataRequest
(
w
.
psi
,
std
::
move
(
w
.
data
));
m_
sm
->
handleUplinkDataRequest
(
w
.
psi
,
std
::
move
(
w
.
data
));
break
;
}
default:
...
...
@@ -57,7 +57,7 @@ void NasLayer::handleSapMessage(std::unique_ptr<NtsMessage> msg)
switch
(
w
.
present
)
{
case
NmUeRlsToNas
:
:
DATA_PDU_DELIVERY
:
{
sm
->
handleDownlinkDataRequest
(
w
.
psi
,
std
::
move
(
w
.
pdu
));
m_
sm
->
handleDownlinkDataRequest
(
w
.
psi
,
std
::
move
(
w
.
pdu
));
break
;
}
}
...
...
@@ -65,35 +65,36 @@ void NasLayer::handleSapMessage(std::unique_ptr<NtsMessage> msg)
break
;
}
default:
logger
->
unhandledNts
(
*
msg
);
m_
logger
->
unhandledNts
(
*
msg
);
break
;
}
}
void
NasLayer
::
performTick
()
{
std
::
array
<
UeTimer
*
,
17
>
arr
=
{
&
timers
.
t3346
,
&
timers
.
t3396
,
&
timers
.
t3444
,
&
timers
.
t3445
,
&
timers
.
t3502
,
&
timers
.
t3510
,
&
timers
.
t3511
,
&
timers
.
t3512
,
&
timers
.
t3516
,
&
timers
.
t3517
,
&
timers
.
t3519
,
&
timers
.
t3520
,
&
timers
.
t3521
,
&
timers
.
t3525
,
&
timers
.
t3540
,
&
timers
.
t3584
,
&
timers
.
t3585
,
UeTimer
*
const
arr
[]
=
{
&
m_timers
.
t3346
,
&
m_timers
.
t3396
,
&
m_timers
.
t3444
,
&
m_timers
.
t3445
,
&
m_timers
.
t3502
,
&
m_
timers
.
t3510
,
&
m_timers
.
t3511
,
&
m_timers
.
t3512
,
&
m_timers
.
t3516
,
&
m_timers
.
t3517
,
&
m_timers
.
t3519
,
&
m_
timers
.
t3520
,
&
m_timers
.
t3521
,
&
m_timers
.
t3525
,
&
m_timers
.
t3540
,
&
m_timers
.
t3584
,
&
m_
timers
.
t3585
,
};
for
(
auto
*
timer
:
arr
){
for
(
auto
*
timer
:
arr
)
{
if
(
timer
->
performTick
())
{
if
(
timer
->
isMmTimer
())
mm
->
onTimerExpire
(
*
timer
);
m
_m
m
->
onTimerExpire
(
*
timer
);
else
sm
->
onTimerExpire
(
*
timer
);
m_
sm
->
onTimerExpire
(
*
timer
);
}
}
sm
->
onTimerTick
();
m_
sm
->
onTimerTick
();
}
void
NasLayer
::
performCycle
()
{
mm
->
performMmCycle
();
m
_m
m
->
performMmCycle
();
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/nas/layer.hpp
View file @
6055137b
...
...
@@ -14,13 +14,13 @@ namespace nr::ue
class
NasLayer
{
TaskBase
*
base
;
std
::
unique_ptr
<
Logger
>
logger
;
TaskBase
*
m_
base
;
std
::
unique_ptr
<
Logger
>
m_
logger
;
NasTimers
timers
;
NasMm
*
mm
;
NasSm
*
sm
;
Usim
*
usim
;
NasTimers
m_
timers
;
NasMm
*
m
_m
m
;
NasSm
*
m_
sm
;
Usim
*
m_
usim
;
friend
class
UeCmdHandler
;
...
...
@@ -28,16 +28,13 @@ class NasLayer
explicit
NasLayer
(
TaskBase
*
base
);
~
NasLayer
()
=
default
;
public:
void
onStart
();
void
onQuit
();
public:
void
handleSapMessage
(
std
::
unique_ptr
<
NtsMessage
>
msg
);
public:
void
performCycle
();
void
performTick
();
void
handleSapMessage
(
std
::
unique_ptr
<
NtsMessage
>
msg
);
};
}
// namespace nr::ue
\ No newline at end of file
src/utils/octet_string.hpp
View file @
6055137b
...
...
@@ -14,6 +14,7 @@
#include <cstdint>
#include <memory>
#include <vector>
#include <array>
class
OctetString
{
...
...
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