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
37470ff1
Commit
37470ff1
authored
Apr 04, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SRA dev.
parent
5d844b4a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
141 additions
and
38 deletions
+141
-38
src/gnb/gtp/task.cpp
src/gnb/gtp/task.cpp
+17
-16
src/gnb/nts.hpp
src/gnb/nts.hpp
+34
-0
src/gnb/sra/handler.cpp
src/gnb/sra/handler.cpp
+9
-0
src/gnb/sra/task.cpp
src/gnb/sra/task.cpp
+12
-0
src/ue/app/task.cpp
src/ue/app/task.cpp
+42
-22
src/ue/nts.hpp
src/ue/nts.hpp
+16
-0
src/ue/sra/transport.cpp
src/ue/sra/transport.cpp
+8
-0
src/utils/nts.hpp
src/utils/nts.hpp
+3
-0
No files found.
src/gnb/gtp/task.cpp
View file @
37470ff1
...
...
@@ -10,6 +10,7 @@
#include <asn/ngap/ASN_NGAP_QosFlowSetupRequestItem.h>
#include <gnb/gtp/proto.hpp>
#include <gnb/sra/task.hpp>
#include <utils/constants.hpp>
#include <utils/libc_error.hpp>
...
...
@@ -75,17 +76,17 @@ void GtpTask::onLoop()
}
break
;
}
//case NtsMessageType::GNB_MR
_TO_GTP: {
// auto *w = dynamic_cast<NwGnbMr
ToGtp *>(msg);
//
switch (w->present)
//
{
// case NwGnbMrToGtp::UPLINK
_DELIVERY: {
// handleUplinkData(w->ueId, w->pduSessionId, std::move(w->data
));
//
break;
//
}
//
}
//
break;
//
}
case
NtsMessageType
:
:
GNB_SRA
_TO_GTP
:
{
auto
*
w
=
dynamic_cast
<
NwGnbSra
ToGtp
*>
(
msg
);
switch
(
w
->
present
)
{
case
NwGnbSraToGtp
:
:
DATA_PDU
_DELIVERY
:
{
handleUplinkData
(
w
->
ueId
,
w
->
psi
,
std
::
move
(
w
->
pdu
));
break
;
}
}
break
;
}
case
NtsMessageType
:
:
UDP_SERVER_RECEIVE
:
handleUdpReceive
(
*
dynamic_cast
<
udp
::
NwUdpServerReceive
*>
(
msg
));
break
;
...
...
@@ -238,11 +239,11 @@ void GtpTask::handleUdpReceive(const udp::NwUdpServerReceive &msg)
if
(
m_rateLimiter
->
allowDownlinkPacket
(
sessionInd
,
gtp
->
payload
.
length
()))
{
//auto *w = new NwGnbGtpToMr(NwGnbGtpToMr
::DATA_PDU_DELIVERY);
//
w->ueId = GetUeId(sessionInd);
//w->pduSessionId
= GetPsi(sessionInd);
//w->data
= std::move(gtp->payload);
//m_base->mr
Task->push(w);
auto
*
w
=
new
NwGnbGtpToSra
(
NwGnbGtpToSra
::
DATA_PDU_DELIVERY
);
w
->
ueId
=
GetUeId
(
sessionInd
);
w
->
psi
=
GetPsi
(
sessionInd
);
w
->
pdu
=
std
::
move
(
gtp
->
payload
);
m_base
->
sra
Task
->
push
(
w
);
}
delete
gtp
;
...
...
src/gnb/nts.hpp
View file @
37470ff1
...
...
@@ -44,6 +44,40 @@ struct NwGnbSraToRrc : NtsMessage
}
};
struct
NwGnbSraToGtp
:
NtsMessage
{
enum
PR
{
DATA_PDU_DELIVERY
,
}
present
;
// DATA_PDU_DELIVERY
int
ueId
{};
int
psi
{};
OctetString
pdu
{};
explicit
NwGnbSraToGtp
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
GNB_SRA_TO_GTP
),
present
(
present
)
{
}
};
struct
NwGnbGtpToSra
:
NtsMessage
{
enum
PR
{
DATA_PDU_DELIVERY
,
}
present
;
// DATA_PDU_DELIVERY
int
ueId
{};
int
psi
{};
OctetString
pdu
{};
explicit
NwGnbGtpToSra
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
GNB_GTP_TO_SRA
),
present
(
present
)
{
}
};
struct
NwGnbRrcToSra
:
NtsMessage
{
enum
PR
...
...
src/gnb/sra/handler.cpp
View file @
37470ff1
...
...
@@ -8,6 +8,7 @@
#include "task.hpp"
#include <cmath>
#include <gnb/gtp/task.hpp>
#include <gnb/rrc/task.hpp>
static
int
MIN_ALLOWED_DBM
=
-
120
;
...
...
@@ -57,6 +58,14 @@ void GnbSraTask::handleUplinkPduDelivery(int ueId, sra::SraPduDelivery &msg)
nw
->
pdu
=
std
::
move
(
msg
.
pdu
);
m_base
->
rrcTask
->
push
(
nw
);
}
else
if
(
msg
.
pduType
==
sra
::
EPduType
::
DATA
)
{
auto
*
nw
=
new
NwGnbSraToGtp
(
NwGnbSraToGtp
::
DATA_PDU_DELIVERY
);
nw
->
ueId
=
ueId
;
nw
->
psi
=
msg
.
payload
.
get4I
(
0
);
nw
->
pdu
=
std
::
move
(
msg
.
pdu
);
m_base
->
gtpTask
->
push
(
nw
);
}
}
void
GnbSraTask
::
handleDownlinkDelivery
(
int
ueId
,
sra
::
EPduType
pduType
,
OctetString
&&
pdu
,
OctetString
&&
payload
)
...
...
src/gnb/sra/task.cpp
View file @
37470ff1
...
...
@@ -67,6 +67,18 @@ void GnbSraTask::onLoop()
}
break
;
}
case
NtsMessageType
:
:
GNB_GTP_TO_SRA
:
{
auto
*
w
=
dynamic_cast
<
NwGnbGtpToSra
*>
(
msg
);
switch
(
w
->
present
)
{
case
NwGnbGtpToSra
:
:
DATA_PDU_DELIVERY
:
{
handleDownlinkDelivery
(
w
->
ueId
,
sra
::
EPduType
::
DATA
,
std
::
move
(
w
->
pdu
),
OctetString
::
FromOctet4
(
static_cast
<
int
>
(
w
->
psi
)));
break
;
}
}
break
;
}
case
NtsMessageType
:
:
UDP_SERVER_RECEIVE
:
{
auto
*
w
=
dynamic_cast
<
udp
::
NwUdpServerReceive
*>
(
msg
);
auto
sraMsg
=
sra
::
DecodeSraMessage
(
OctetView
{
w
->
packet
});
...
...
src/ue/app/task.cpp
View file @
37470ff1
...
...
@@ -9,6 +9,7 @@
#include "task.hpp"
#include "cmd_handler.hpp"
#include <nas/utils.hpp>
#include <ue/sra/task.hpp>
#include <ue/tun/tun.hpp>
#include <utils/common.hpp>
#include <utils/constants.hpp>
...
...
@@ -49,33 +50,30 @@ void UeAppTask::onLoop()
switch
(
msg
->
msgType
)
{
// case NtsMessageType::UE_MR
_TO_APP: {
// auto *w = dynamic_cast<NwUeMr
ToApp *>(msg);
//
switch (w->present)
//
{
// case NwUeMr
ToApp::DATA_PDU_DELIVERY: {
//
auto *tunTask = m_tunTasks[w->psi];
//
if (tunTask)
//
{
//
auto *nw = new NwAppToTun(NwAppToTun::DATA_PDU_DELIVERY);
//
nw->psi = w->psi;
// nw->data = std::move(w->data
);
//
tunTask->push(nw);
//
}
//
break;
//
}
//
}
//
break;
//
}
case
NtsMessageType
:
:
UE_SRA
_TO_APP
:
{
auto
*
w
=
dynamic_cast
<
NwUeSra
ToApp
*>
(
msg
);
switch
(
w
->
present
)
{
case
NwUeSra
ToApp
:
:
DATA_PDU_DELIVERY
:
{
auto
*
tunTask
=
m_tunTasks
[
w
->
psi
];
if
(
tunTask
)
{
auto
*
nw
=
new
NwAppToTun
(
NwAppToTun
::
DATA_PDU_DELIVERY
);
nw
->
psi
=
w
->
psi
;
nw
->
data
=
std
::
move
(
w
->
pdu
);
tunTask
->
push
(
nw
);
}
break
;
}
}
break
;
}
case
NtsMessageType
:
:
UE_TUN_TO_APP
:
{
auto
*
w
=
dynamic_cast
<
NwUeTunToApp
*>
(
msg
);
switch
(
w
->
present
)
{
case
NwUeTunToApp
:
:
DATA_PDU_DELIVERY
:
{
// auto *nw = new NwAppToMr(NwAppToMr::DATA_PDU_DELIVERY);
// nw->psi = w->psi;
// nw->data = std::move(w->data);
// m_base->mrTask->push(nw);
handleUplinkDataRequest
(
w
->
psi
,
std
::
move
(
w
->
data
));
break
;
}
case
NwUeTunToApp
:
:
TUN_ERROR
:
{
...
...
@@ -157,6 +155,12 @@ void UeAppTask::receiveStatusUpdate(NwUeStatusUpdate &msg)
}
return
;
}
if
(
msg
.
what
==
NwUeStatusUpdate
::
CM_STATE
)
{
m_cmState
=
msg
.
cmState
;
return
;
}
}
void
UeAppTask
::
setupTunInterface
(
const
PduSession
*
pduSession
)
...
...
@@ -218,4 +222,20 @@ void UeAppTask::setupTunInterface(const PduSession *pduSession)
allocatedName
.
c_str
(),
ipAddress
.
c_str
());
}
void
UeAppTask
::
handleUplinkDataRequest
(
int
psi
,
OctetString
&&
data
)
{
if
(
m_cmState
==
ECmState
::
CM_CONNECTED
)
{
auto
*
nw
=
new
NwUeAppToSra
(
NwUeAppToSra
::
DATA_PDU_DELIVERY
);
nw
->
psi
=
psi
;
nw
->
pdu
=
std
::
move
(
data
);
m_base
->
sraTask
->
push
(
nw
);
}
else
{
// TODO
m_logger
->
err
(
"Uplink data is pending"
);
}
}
}
// namespace nr::ue
src/ue/nts.hpp
View file @
37470ff1
...
...
@@ -202,6 +202,22 @@ struct NwUeAppToSra : NtsMessage
}
};
struct
NwUeSraToApp
:
NtsMessage
{
enum
PR
{
DATA_PDU_DELIVERY
}
present
;
// DATA_PDU_DELIVERY
int
psi
{};
OctetString
pdu
{};
explicit
NwUeSraToApp
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_SRA_TO_APP
),
present
(
present
)
{
}
};
struct
NwUeStatusUpdate
:
NtsMessage
{
static
constexpr
const
int
SESSION_ESTABLISHMENT
=
1
;
...
...
src/ue/sra/transport.cpp
View file @
37470ff1
...
...
@@ -7,6 +7,7 @@
//
#include "task.hpp"
#include <ue/app/task.hpp>
#include <ue/nts.hpp>
#include <ue/rrc/task.hpp>
#include <utils/constants.hpp>
...
...
@@ -63,6 +64,13 @@ void UeSraTask::deliverDownlinkPdu(sra::SraPduDelivery &msg)
nw
->
pdu
=
std
::
move
(
msg
.
pdu
);
m_base
->
rrcTask
->
push
(
nw
);
}
else
if
(
msg
.
pduType
==
sra
::
EPduType
::
DATA
)
{
auto
*
nw
=
new
NwUeSraToApp
(
NwUeSraToApp
::
DATA_PDU_DELIVERY
);
nw
->
psi
=
msg
.
payload
.
get4I
(
0
);
nw
->
pdu
=
std
::
move
(
msg
.
pdu
);
m_base
->
appTask
->
push
(
nw
);
}
}
}
// namespace nr::ue
src/utils/nts.hpp
View file @
37470ff1
...
...
@@ -36,6 +36,8 @@ enum class NtsMessageType
GNB_MR_TO_RRC
,
GNB_SRA_TO_RRC
,
GNB_SRA_TO_GTP
,
GNB_GTP_TO_SRA
,
GNB_RRC_TO_SRA
,
GNB_NGAP_TO_RRC
,
GNB_RRC_TO_NGAP
,
...
...
@@ -50,6 +52,7 @@ enum class NtsMessageType
UE_RRC_TO_SRA
,
UE_NAS_TO_NAS
,
UE_SRA_TO_RRC
,
UE_SRA_TO_APP
,
UE_NAS_TO_APP
,
};
...
...
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