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
f6d45224
Commit
f6d45224
authored
Mar 30, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5G SM Status handling
parent
3a883188
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
20 deletions
+54
-20
src/ue/sm/establishment.cpp
src/ue/sm/establishment.cpp
+1
-11
src/ue/sm/procedure.cpp
src/ue/sm/procedure.cpp
+37
-0
src/ue/sm/sm.hpp
src/ue/sm/sm.hpp
+3
-3
src/ue/sm/timer.cpp
src/ue/sm/timer.cpp
+1
-1
src/ue/sm/transport.cpp
src/ue/sm/transport.cpp
+12
-5
No files found.
src/ue/sm/establishment.cpp
View file @
f6d45224
...
...
@@ -177,7 +177,7 @@ void NasSm::receiveEstablishmentRoutingFailure(const nas::PduSessionEstablishmen
if
(
!
checkPtiAndPsi
(
msg
))
return
;
abort
EstablishmentRequest
(
msg
.
pti
);
abort
ProcedureByPti
(
msg
.
pti
);
}
void
NasSm
::
receiveEstablishmentReject
(
const
nas
::
PduSessionEstablishmentReject
&
msg
)
...
...
@@ -205,14 +205,4 @@ void NasSm::receiveEstablishmentReject(const nas::PduSessionEstablishmentReject
}
}
void
NasSm
::
abortEstablishmentRequest
(
int
pti
)
{
int
psi
=
m_procedureTransactions
[
pti
].
psi
;
m_logger
->
debug
(
"PDU Session Establishment Procedure aborted for PTI[%d], PSI[%d]"
,
pti
,
psi
);
freeProcedureTransactionId
(
pti
);
freePduSessionId
(
psi
);
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/sm/
utils
.cpp
→
src/ue/sm/
procedure
.cpp
View file @
f6d45224
...
...
@@ -8,6 +8,7 @@
#include "sm.hpp"
#include <nas/utils.hpp>
#include <set>
#include <ue/app/task.hpp>
#include <ue/mm/mm.hpp>
...
...
@@ -34,4 +35,40 @@ bool NasSm::checkPtiAndPsi(const nas::SmMessage &msg)
return
true
;
}
void
NasSm
::
abortProcedureByPti
(
int
pti
)
{
auto
&
pt
=
m_procedureTransactions
[
pti
];
if
(
pt
.
state
!=
EPtState
::
PENDING
)
return
;
int
psi
=
m_procedureTransactions
[
pti
].
psi
;
auto
&
ps
=
m_pduSessions
[
psi
];
m_logger
->
debug
(
"Aborting SM procedure for PTI[%d], PSI[%d]"
,
pti
,
psi
);
freeProcedureTransactionId
(
pti
);
if
(
ps
->
psState
==
EPsState
::
ACTIVE_PENDING
)
freePduSessionId
(
psi
);
if
(
ps
->
psState
==
EPsState
::
INACTIVE_PENDING
||
ps
->
psState
==
EPsState
::
MODIFICATION_PENDING
)
ps
->
psState
=
EPsState
::
ACTIVE
;
}
void
NasSm
::
abortProcedureByPtiOrPsi
(
int
pti
,
int
psi
)
{
std
::
set
<
int
>
ptiToAbort
{};
int
i
=
0
;
for
(
auto
&
pt
:
m_procedureTransactions
)
{
if
(
pt
.
state
==
EPtState
::
PENDING
&&
pt
.
psi
==
psi
)
ptiToAbort
.
insert
(
i
);
i
++
;
}
ptiToAbort
.
insert
(
pti
);
for
(
int
id
:
ptiToAbort
)
abortProcedureByPti
(
id
);
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/sm/sm.hpp
View file @
f6d45224
...
...
@@ -54,7 +54,6 @@ class NasSm
/* Transport */
void
sendSmMessage
(
int
psi
,
const
nas
::
SmMessage
&
msg
);
void
receiveSmStatus
(
const
nas
::
FiveGSmStatus
&
msg
);
void
receiveSmCause
(
const
nas
::
IE5gSmCause
&
msg
);
void
sendSmCause
(
const
nas
::
ESmCause
&
cause
,
int
pti
,
int
psi
);
/* Allocation */
...
...
@@ -68,15 +67,16 @@ class NasSm
void
receiveEstablishmentAccept
(
const
nas
::
PduSessionEstablishmentAccept
&
msg
);
void
receiveEstablishmentReject
(
const
nas
::
PduSessionEstablishmentReject
&
msg
);
void
receiveEstablishmentRoutingFailure
(
const
nas
::
PduSessionEstablishmentRequest
&
msg
);
void
abortEstablishmentRequest
(
int
pti
);
/* Timer */
std
::
unique_ptr
<
nas
::
NasTimer
>
newTransactionTimer
(
int
code
);
void
onTimerExpire
(
nas
::
NasTimer
&
timer
);
void
onTransactionTimerExpire
(
int
pti
);
/*
Utils
*/
/*
Procedure
*/
bool
checkPtiAndPsi
(
const
nas
::
SmMessage
&
msg
);
void
abortProcedureByPti
(
int
pti
);
void
abortProcedureByPtiOrPsi
(
int
pti
,
int
psi
);
public:
/* Interface */
...
...
src/ue/sm/timer.cpp
View file @
f6d45224
...
...
@@ -63,7 +63,7 @@ void NasSm::onTransactionTimerExpire(int pti)
else
{
m_logger
->
err
(
"PDU Session Establishment Procedure failure, no response from the network after 5 attempts"
);
abort
EstablishmentRequest
(
pti
);
abort
ProcedureByPti
(
pti
);
}
break
;
}
...
...
src/ue/sm/transport.cpp
View file @
f6d45224
...
...
@@ -64,12 +64,19 @@ void NasSm::receiveSmMessage(const nas::SmMessage &msg)
void
NasSm
::
receiveSmStatus
(
const
nas
::
FiveGSmStatus
&
msg
)
{
receiveSmCause
(
msg
.
smCause
);
}
m_logger
->
err
(
"SM Status received: %s"
,
nas
::
utils
::
EnumToString
(
msg
.
smCause
.
value
));
void
NasSm
::
receiveSmCause
(
const
nas
::
IE5gSmCause
&
msg
)
{
m_logger
->
err
(
"SM cause received: %s"
,
nas
::
utils
::
EnumToString
(
msg
.
value
));
if
(
msg
.
smCause
.
value
==
nas
::
ESmCause
::
INVALID_PTI_VALUE
)
{
// "The UE shall abort any ongoing 5GSM procedure related to the received PTI value and stop any related timer."
abortProcedureByPti
(
msg
.
pti
);
}
else
if
(
msg
.
smCause
.
value
==
nas
::
ESmCause
::
MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED
)
{
// "The UE shall abort any ongoing 5GSM procedure related to the PTI or PDU session Id and stop any related
// timer."
abortProcedureByPtiOrPsi
(
msg
.
pti
,
msg
.
pduSessionId
);
}
}
void
NasSm
::
sendSmCause
(
const
nas
::
ESmCause
&
cause
,
int
pti
,
int
psi
)
...
...
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