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
fb77d5bc
Commit
fb77d5bc
authored
May 12, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RLS developments
parent
c8c4f47c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
2 deletions
+98
-2
src/gnb/rls/ctl_task.cpp
src/gnb/rls/ctl_task.cpp
+94
-1
src/gnb/rls/ctl_task.hpp
src/gnb/rls/ctl_task.hpp
+4
-1
No files found.
src/gnb/rls/ctl_task.cpp
View file @
fb77d5bc
...
...
@@ -8,10 +8,15 @@
#include "ctl_task.hpp"
#include <utils/common.hpp>
static
constexpr
const
size_t
MAX_PDU_COUNT
=
4096
;
static
constexpr
const
int
MAX_PDU_TTL
=
3000
;
namespace
nr
::
gnb
{
RlsControlTask
::
RlsControlTask
(
TaskBase
*
base
)
:
m_udpTas
k
{}
RlsControlTask
::
RlsControlTask
(
TaskBase
*
base
,
uint64_t
sti
)
:
m_sti
{
sti
},
m_udpTask
{},
m_pduMap
{},
m_pendingAc
k
{}
{
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
"rls-ctl"
);
}
...
...
@@ -70,4 +75,92 @@ void RlsControlTask::onQuit()
{
}
void
RlsControlTask
::
handleSignalDetected
(
int
ueId
)
{
// TODO: tranparently notify upper layer
}
void
RlsControlTask
::
handleSignalLost
(
int
ueId
)
{
// TODO: tranparently notify upper layer
}
void
RlsControlTask
::
handleRlsMessage
(
int
ueId
,
rls
::
RlsMessage
&
msg
)
{
if
(
msg
.
msgType
==
rls
::
EMessageType
::
PDU_TRANSMISSION_ACK
)
{
auto
&
m
=
(
rls
::
RlsPduTransmissionAck
&
)
msg
;
for
(
auto
pduId
:
m
.
pduIds
)
m_pduMap
.
erase
(
pduId
);
}
else
if
(
msg
.
msgType
==
rls
::
EMessageType
::
PDU_TRANSMISSION
)
{
auto
&
m
=
(
rls
::
RlsPduTransmission
&
)
msg
;
if
(
m
.
pduId
!=
0
)
m_pendingAck
[
ueId
].
push_back
(
m
.
pduId
);
if
(
m
.
pduType
==
rls
::
EPduType
::
DATA
)
{
// TODO: send to the upper layer
}
else
if
(
m
.
pduType
==
rls
::
EPduType
::
RRC
)
{
// TODO: send to the upper layer
}
else
{
m_logger
->
err
(
"Unhandled RLS PDU type"
);
}
}
else
{
m_logger
->
err
(
"Unhandled RLS message type"
);
}
}
void
RlsControlTask
::
handleDownlinkRrcDelivery
(
int
ueId
,
uint32_t
pduId
,
rrc
::
RrcChannel
channel
,
OctetString
&&
data
)
{
if
(
pduId
!=
0
)
{
if
(
m_pduMap
.
count
(
pduId
))
{
m_pduMap
.
clear
();
// TODO: Send RLF
return
;
}
if
(
m_pduMap
.
size
()
>
MAX_PDU_COUNT
)
{
m_pduMap
.
clear
();
// TODO: Send RLF
return
;
}
m_pduMap
[
pduId
].
pdu
=
data
.
copy
();
m_pduMap
[
pduId
].
rrcChannel
=
channel
;
m_pduMap
[
pduId
].
sentTime
=
utils
::
CurrentTimeMillis
();
}
rls
::
RlsPduTransmission
msg
{
m_sti
};
msg
.
pduType
=
rls
::
EPduType
::
RRC
;
msg
.
pdu
=
std
::
move
(
data
);
msg
.
payload
=
static_cast
<
uint32_t
>
(
channel
);
msg
.
pduId
=
pduId
;
m_udpTask
->
send
(
ueId
,
msg
);
}
void
RlsControlTask
::
handleDownlinkDataDelivery
(
int
ueId
,
int
psi
,
OctetString
&&
data
)
{
rls
::
RlsPduTransmission
msg
{
m_sti
};
msg
.
pduType
=
rls
::
EPduType
::
DATA
;
msg
.
pdu
=
std
::
move
(
data
);
msg
.
payload
=
static_cast
<
uint32_t
>
(
psi
);
msg
.
pduId
=
0
;
m_udpTask
->
send
(
ueId
,
msg
);
}
}
// namespace nr::gnb
src/gnb/rls/ctl_task.hpp
View file @
fb77d5bc
...
...
@@ -21,10 +21,13 @@ class RlsControlTask : public NtsTask
{
private:
std
::
unique_ptr
<
Logger
>
m_logger
;
uint64_t
m_sti
;
RlsUdpTask
*
m_udpTask
;
std
::
unordered_map
<
uint32_t
,
rls
::
PduInfo
>
m_pduMap
;
std
::
unordered_map
<
int
,
std
::
vector
<
uint32_t
>>
m_pendingAck
;
public:
explicit
RlsControlTask
(
TaskBase
*
base
);
explicit
RlsControlTask
(
TaskBase
*
base
,
uint64_t
sti
);
~
RlsControlTask
()
override
=
default
;
protected:
...
...
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