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
8a273192
Commit
8a273192
authored
May 23, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
5551dbea
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
46 deletions
+48
-46
src/ue/app/task.cpp
src/ue/app/task.cpp
+4
-37
src/ue/app/task.hpp
src/ue/app/task.hpp
+0
-1
src/ue/nas/sm/sap.cpp
src/ue/nas/sm/sap.cpp
+34
-0
src/ue/nas/sm/sm.hpp
src/ue/nas/sm/sm.hpp
+1
-0
src/ue/nas/task.cpp
src/ue/nas/task.cpp
+2
-2
src/ue/nts.hpp
src/ue/nts.hpp
+5
-5
src/utils/nts.hpp
src/utils/nts.hpp
+2
-1
No files found.
src/ue/app/task.cpp
View file @
8a273192
...
...
@@ -74,7 +74,10 @@ void UeAppTask::onLoop()
switch
(
w
->
present
)
{
case
NwUeTunToApp
:
:
DATA_PDU_DELIVERY
:
{
handleUplinkDataRequest
(
w
->
psi
,
std
::
move
(
w
->
data
));
auto
*
m
=
new
NwUeAppToNas
(
NwUeAppToNas
::
UPLINK_DATA_DELIVERY
);
m
->
psi
=
w
->
psi
;
m
->
data
=
std
::
move
(
w
->
data
);
m_base
->
nasTask
->
push
(
m
);
break
;
}
case
NwUeTunToApp
:
:
TUN_ERROR
:
{
...
...
@@ -224,40 +227,4 @@ void UeAppTask::setupTunInterface(const PduSession *pduSession)
allocatedName
.
c_str
(),
ipAddress
.
c_str
());
}
void
UeAppTask
::
handleUplinkDataRequest
(
int
psi
,
OctetString
&&
data
)
{
if
(
!
m_pduSessions
[
psi
].
has_value
())
return
;
if
(
m_cmState
==
ECmState
::
CM_CONNECTED
)
{
if
(
m_pduSessions
[
psi
]
->
uplinkPending
)
{
m_pduSessions
[
psi
]
->
uplinkPending
=
false
;
auto
*
w
=
new
NwUeAppToNas
(
NwUeAppToNas
::
UPLINK_STATUS_CHANGE
);
w
->
psi
=
psi
;
w
->
isPending
=
false
;
m_base
->
nasTask
->
push
(
w
);
}
auto
*
nw
=
new
NwUeAppToRls
(
NwUeAppToRls
::
DATA_PDU_DELIVERY
);
nw
->
psi
=
psi
;
nw
->
pdu
=
std
::
move
(
data
);
m_base
->
rlsTask
->
push
(
nw
);
}
else
{
if
(
!
m_pduSessions
[
psi
]
->
uplinkPending
)
{
m_pduSessions
[
psi
]
->
uplinkPending
=
true
;
auto
*
w
=
new
NwUeAppToNas
(
NwUeAppToNas
::
UPLINK_STATUS_CHANGE
);
w
->
psi
=
psi
;
w
->
isPending
=
true
;
m_base
->
nasTask
->
push
(
w
);
}
}
}
}
// namespace nr::ue
src/ue/app/task.hpp
View file @
8a273192
...
...
@@ -45,7 +45,6 @@ class UeAppTask : public NtsTask
private:
void
receiveStatusUpdate
(
NwUeStatusUpdate
&
msg
);
void
setupTunInterface
(
const
PduSession
*
pduSession
);
void
handleUplinkDataRequest
(
int
psi
,
OctetString
&&
data
);
};
}
// namespace nr::ue
src/ue/nas/sm/sap.cpp
View file @
8a273192
...
...
@@ -7,11 +7,14 @@
//
#include "sm.hpp"
#include <algorithm>
#include <lib/nas/proto_conf.hpp>
#include <lib/nas/utils.hpp>
#include <ue/app/task.hpp>
#include <ue/nas/mm/mm.hpp>
#include <ue/rls/task.hpp>
namespace
nr
::
ue
{
...
...
@@ -39,4 +42,35 @@ void NasSm::onTimerTick()
}
}
void
NasSm
::
handleUplinkDataRequest
(
int
psi
,
OctetString
&&
data
)
{
if
(
m_pduSessions
[
psi
]
->
psState
!=
EPsState
::
ACTIVE
)
return
;
if
(
m_mm
->
m_cmState
==
ECmState
::
CM_CONNECTED
)
{
// TODO: We should also check if radio resources are established by RRC.
// Checking CM state is not sufficient
if
(
m_pduSessions
[
psi
]
->
uplinkPending
)
{
m_pduSessions
[
psi
]
->
uplinkPending
=
false
;
handleUplinkStatusChange
(
psi
,
false
);
}
auto
*
nw
=
new
NwUeNasToRls
(
NwUeNasToRls
::
DATA_PDU_DELIVERY
);
nw
->
psi
=
psi
;
nw
->
pdu
=
std
::
move
(
data
);
m_base
->
rlsTask
->
push
(
nw
);
}
else
{
if
(
!
m_pduSessions
[
psi
]
->
uplinkPending
)
{
m_pduSessions
[
psi
]
->
uplinkPending
=
true
;
handleUplinkStatusChange
(
psi
,
true
);
}
}
}
}
// namespace nr::ue
src/ue/nas/sm/sm.hpp
View file @
8a273192
...
...
@@ -91,6 +91,7 @@ class NasSm
private:
/* Service Access Point */
void
handleNasEvent
(
const
NwUeNasToNas
&
msg
);
void
onTimerTick
();
void
handleUplinkDataRequest
(
int
psi
,
OctetString
&&
data
);
};
}
// namespace nr::ue
\ No newline at end of file
src/ue/nas/task.cpp
View file @
8a273192
...
...
@@ -88,8 +88,8 @@ void NasTask::onLoop()
auto
*
w
=
dynamic_cast
<
NwUeAppToNas
*>
(
msg
);
switch
(
w
->
present
)
{
case
NwUeAppToNas
:
:
UPLINK_
STATUS_CHANGE
:
{
sm
->
handleUplink
StatusChange
(
w
->
psi
,
w
->
isPending
);
case
NwUeAppToNas
:
:
UPLINK_
DATA_DELIVERY
:
{
sm
->
handleUplink
DataRequest
(
w
->
psi
,
std
::
move
(
w
->
data
)
);
break
;
}
default:
...
...
src/ue/nts.hpp
View file @
8a273192
...
...
@@ -196,19 +196,19 @@ struct NwUeAppToNas : NtsMessage
{
enum
PR
{
UPLINK_
STATUS_CHANGE
,
UPLINK_
DATA_DELIVERY
,
}
present
;
// UPLINK_
STATUS_CHANGE
// UPLINK_
DATA_DELIVERY
int
psi
{};
bool
isPending
{}
;
OctetString
data
;
explicit
NwUeAppToNas
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_APP_TO_NAS
),
present
(
present
)
{
}
};
struct
NwUe
App
ToRls
:
NtsMessage
struct
NwUe
Nas
ToRls
:
NtsMessage
{
enum
PR
{
...
...
@@ -219,7 +219,7 @@ struct NwUeAppToRls : NtsMessage
int
psi
{};
OctetString
pdu
;
explicit
NwUe
AppToRls
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_APP
_TO_RLS
),
present
(
present
)
explicit
NwUe
NasToRls
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_NAS
_TO_RLS
),
present
(
present
)
{
}
};
...
...
src/utils/nts.hpp
View file @
8a273192
...
...
@@ -57,7 +57,8 @@ enum class NtsMessageType
UE_RLS_TO_RRC
,
UE_RLS_TO_APP
,
UE_RLS_TO_RLS
,
UE_NAS_TO_APP
,
UE_NAS_TO_APP
,
UE_NAS_TO_RLS
,
};
struct
NtsMessage
...
...
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