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
1564ad57
Commit
1564ad57
authored
Dec 29, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance improvements
parent
23c5afa0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
181 deletions
+51
-181
src/ue/nts.hpp
src/ue/nts.hpp
+0
-3
src/ue/rls/ctl_layer.cpp
src/ue/rls/ctl_layer.cpp
+2
-30
src/ue/rls/ctl_layer.hpp
src/ue/rls/ctl_layer.hpp
+4
-9
src/ue/rls/ctl_task.cpp
src/ue/rls/ctl_task.cpp
+0
-74
src/ue/rls/ctl_task.hpp
src/ue/rls/ctl_task.hpp
+0
-36
src/ue/rls/task.cpp
src/ue/rls/task.cpp
+35
-20
src/ue/rls/task.hpp
src/ue/rls/task.hpp
+3
-2
src/ue/rls/udp_task.cpp
src/ue/rls/udp_task.cpp
+5
-5
src/ue/rls/udp_task.hpp
src/ue/rls/udp_task.hpp
+2
-2
No files found.
src/ue/nts.hpp
View file @
1564ad57
...
...
@@ -161,13 +161,10 @@ struct NmUeRlsToRls : NtsMessage
{
RECEIVE_RLS_MESSAGE
,
SIGNAL_CHANGED
,
UPLINK_DATA
,
UPLINK_RRC
,
DOWNLINK_DATA
,
DOWNLINK_RRC
,
RADIO_LINK_FAILURE
,
TRANSMISSION_FAILURE
,
ASSIGN_CURRENT_CELL
,
}
present
;
// RECEIVE_RLS_MESSAGE
...
...
src/ue/rls/ctl_layer.cpp
View file @
1564ad57
...
...
@@ -69,14 +69,6 @@ void RlsCtlLayer::handleRlsMessage(int cellId, rls::RlsMessage &msg)
}
}
void
RlsCtlLayer
::
handleSignalChange
(
int
cellId
,
int
dbm
)
{
auto
w
=
std
::
make_unique
<
NmUeRlsToRls
>
(
NmUeRlsToRls
::
SIGNAL_CHANGED
);
w
->
cellId
=
cellId
;
w
->
dbm
=
dbm
;
m_mainTask
->
push
(
std
::
move
(
w
));
}
void
RlsCtlLayer
::
handleUplinkRrcDelivery
(
int
cellId
,
uint32_t
pduId
,
rrc
::
RrcChannel
channel
,
OctetString
&&
data
)
{
if
(
pduId
!=
0
)
...
...
@@ -173,29 +165,9 @@ void RlsCtlLayer::onAckSendTimerExpired()
}
}
void
RlsCtlLayer
::
handleSapMessage
(
NmUeRlsToRls
&
msg
)
void
RlsCtlLayer
::
assignCurrentCell
(
int
cellId
)
{
switch
(
msg
.
present
)
{
case
NmUeRlsToRls
:
:
SIGNAL_CHANGED
:
handleSignalChange
(
msg
.
cellId
,
msg
.
dbm
);
break
;
case
NmUeRlsToRls
:
:
RECEIVE_RLS_MESSAGE
:
handleRlsMessage
(
msg
.
cellId
,
*
msg
.
msg
);
break
;
case
NmUeRlsToRls
:
:
UPLINK_DATA
:
handleUplinkDataDelivery
(
msg
.
psi
,
std
::
move
(
msg
.
data
));
break
;
case
NmUeRlsToRls
:
:
UPLINK_RRC
:
handleUplinkRrcDelivery
(
msg
.
cellId
,
msg
.
pduId
,
msg
.
rrcChannel
,
std
::
move
(
msg
.
data
));
break
;
case
NmUeRlsToRls
:
:
ASSIGN_CURRENT_CELL
:
m_servingCell
=
msg
.
cellId
;
break
;
default:
m_logger
->
unhandledNts
(
msg
);
break
;
}
m_servingCell
=
cellId
;
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/rls/ctl_layer.hpp
View file @
1564ad57
...
...
@@ -31,17 +31,12 @@ class RlsCtlLayer
public:
void
onStart
(
NtsTask
*
mainTask
,
RlsUdpTask
*
udpTask
);
void
onQuit
();
private:
void
handleRlsMessage
(
int
cellId
,
rls
::
RlsMessage
&
msg
);
void
handleSignalChange
(
int
cellId
,
int
dbm
);
void
handleUplinkRrcDelivery
(
int
cellId
,
uint32_t
pduId
,
rrc
::
RrcChannel
channel
,
OctetString
&&
data
);
void
handleUplinkDataDelivery
(
int
psi
,
OctetString
&&
data
);
public:
void
onAckControlTimerExpired
();
void
onAckSendTimerExpired
();
void
handleSapMessage
(
NmUeRlsToRls
&
msg
);
void
handleUplinkDataDelivery
(
int
psi
,
OctetString
&&
data
);
void
handleUplinkRrcDelivery
(
int
cellId
,
uint32_t
pduId
,
rrc
::
RrcChannel
channel
,
OctetString
&&
data
);
void
assignCurrentCell
(
int
cellId
);
void
handleRlsMessage
(
int
cellId
,
rls
::
RlsMessage
&
msg
);
};
}
\ No newline at end of file
src/ue/rls/ctl_task.cpp
deleted
100644 → 0
View file @
23c5afa0
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#include "ctl_task.hpp"
#include <utils/common.hpp>
static
constexpr
const
int
TIMER_ID_ACK_CONTROL
=
1
;
static
constexpr
const
int
TIMER_ID_ACK_SEND
=
2
;
static
constexpr
const
int
TIMER_PERIOD_ACK_CONTROL
=
1500
;
static
constexpr
const
int
TIMER_PERIOD_ACK_SEND
=
2250
;
namespace
nr
::
ue
{
RlsControlTask
::
RlsControlTask
(
TaskBase
*
base
,
RlsSharedContext
*
shCtx
)
{
layer
=
std
::
make_unique
<
RlsCtlLayer
>
(
base
,
shCtx
);
mainTask
=
{};
udpTask
=
{};
}
void
RlsControlTask
::
onStart
()
{
layer
->
onStart
(
mainTask
,
udpTask
);
setTimer
(
TIMER_ID_ACK_CONTROL
,
TIMER_PERIOD_ACK_CONTROL
);
setTimer
(
TIMER_ID_ACK_SEND
,
TIMER_PERIOD_ACK_SEND
);
}
void
RlsControlTask
::
onQuit
()
{
layer
->
onQuit
();
}
void
RlsControlTask
::
onLoop
()
{
auto
msg
=
take
();
if
(
!
msg
)
return
;
if
(
msg
->
msgType
==
NtsMessageType
::
TIMER_EXPIRED
)
{
auto
&
w
=
dynamic_cast
<
NmTimerExpired
&>
(
*
msg
);
if
(
w
.
timerId
==
TIMER_ID_ACK_CONTROL
)
{
setTimer
(
TIMER_ID_ACK_CONTROL
,
TIMER_PERIOD_ACK_CONTROL
);
layer
->
onAckControlTimerExpired
();
}
else
if
(
w
.
timerId
==
TIMER_ID_ACK_SEND
)
{
setTimer
(
TIMER_ID_ACK_SEND
,
TIMER_PERIOD_ACK_SEND
);
layer
->
onAckSendTimerExpired
();
}
}
else
if
(
msg
->
msgType
==
NtsMessageType
::
UE_RLS_TO_RLS
)
{
layer
->
handleSapMessage
(
dynamic_cast
<
NmUeRlsToRls
&>
(
*
msg
));
}
}
void
RlsControlTask
::
initialize
(
NtsTask
*
mainTask
,
RlsUdpTask
*
udpTask
)
{
this
->
mainTask
=
mainTask
;
this
->
udpTask
=
udpTask
;
}
}
// namespace nr::ue
src/ue/rls/ctl_task.hpp
deleted
100644 → 0
View file @
23c5afa0
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#pragma once
#include "ctl_layer.hpp"
namespace
nr
::
ue
{
class
RlsControlTask
:
public
NtsTask
{
private:
std
::
unique_ptr
<
RlsCtlLayer
>
layer
;
NtsTask
*
mainTask
;
RlsUdpTask
*
udpTask
;
public:
explicit
RlsControlTask
(
TaskBase
*
base
,
RlsSharedContext
*
shCtx
);
~
RlsControlTask
()
override
=
default
;
protected:
void
onStart
()
override
;
void
onLoop
()
override
;
void
onQuit
()
override
;
public:
void
initialize
(
NtsTask
*
mainTask
,
RlsUdpTask
*
udpTask
);
};
}
// namespace nr::ue
\ No newline at end of file
src/ue/rls/task.cpp
View file @
1564ad57
...
...
@@ -13,6 +13,11 @@
#include <utils/common.hpp>
#include <utils/random.hpp>
static
constexpr
const
int
TIMER_ID_ACK_CONTROL
=
1
;
static
constexpr
const
int
TIMER_ID_ACK_SEND
=
2
;
static
constexpr
const
int
TIMER_PERIOD_ACK_CONTROL
=
1500
;
static
constexpr
const
int
TIMER_PERIOD_ACK_SEND
=
2250
;
namespace
nr
::
ue
{
...
...
@@ -24,16 +29,18 @@ UeRlsTask::UeRlsTask(TaskBase *base) : m_base{base}
m_shCtx
->
sti
=
Random
::
Mixed
(
base
->
config
->
getNodeName
()).
nextL
();
m_udpTask
=
new
RlsUdpTask
(
base
,
m_shCtx
,
base
->
config
->
gnbSearchList
);
m_ctl
Task
=
new
RlsControlTask
(
base
,
m_shCtx
);
m_ctl
Layer
=
std
::
make_unique
<
RlsCtlLayer
>
(
base
,
m_shCtx
);
m_udpTask
->
initialize
(
m_ctlTask
);
m_ctlTask
->
initialize
(
this
,
m_udpTask
);
m_udpTask
->
initialize
(
this
);
}
void
UeRlsTask
::
onStart
()
{
m_udpTask
->
start
();
m_ctlTask
->
start
();
m_ctlLayer
->
onStart
(
this
,
m_udpTask
);
setTimer
(
TIMER_ID_ACK_CONTROL
,
TIMER_PERIOD_ACK_CONTROL
);
setTimer
(
TIMER_ID_ACK_SEND
,
TIMER_PERIOD_ACK_SEND
);
}
void
UeRlsTask
::
onLoop
()
...
...
@@ -42,12 +49,32 @@ void UeRlsTask::onLoop()
if
(
!
msg
)
return
;
if
(
msg
->
msgType
==
NtsMessageType
::
TIMER_EXPIRED
)
{
auto
&
w
=
dynamic_cast
<
NmTimerExpired
&>
(
*
msg
);
if
(
w
.
timerId
==
TIMER_ID_ACK_CONTROL
)
{
setTimer
(
TIMER_ID_ACK_CONTROL
,
TIMER_PERIOD_ACK_CONTROL
);
m_ctlLayer
->
onAckControlTimerExpired
();
}
else
if
(
w
.
timerId
==
TIMER_ID_ACK_SEND
)
{
setTimer
(
TIMER_ID_ACK_SEND
,
TIMER_PERIOD_ACK_SEND
);
m_ctlLayer
->
onAckSendTimerExpired
();
}
return
;
}
switch
(
msg
->
msgType
)
{
case
NtsMessageType
:
:
UE_RLS_TO_RLS
:
{
auto
&
w
=
dynamic_cast
<
NmUeRlsToRls
&>
(
*
msg
);
switch
(
w
.
present
)
{
case
NmUeRlsToRls
:
:
RECEIVE_RLS_MESSAGE
:
{
m_ctlLayer
->
handleRlsMessage
(
w
.
cellId
,
*
w
.
msg
);
break
;
}
case
NmUeRlsToRls
:
:
SIGNAL_CHANGED
:
{
auto
m
=
std
::
make_unique
<
NmUeRlsToRrc
>
(
NmUeRlsToRrc
::
SIGNAL_CHANGED
);
m
->
cellId
=
w
.
cellId
;
...
...
@@ -92,18 +119,11 @@ void UeRlsTask::onLoop()
switch
(
w
.
present
)
{
case
NmUeRrcToRls
:
:
ASSIGN_CURRENT_CELL
:
{
auto
m
=
std
::
make_unique
<
NmUeRlsToRls
>
(
NmUeRlsToRls
::
ASSIGN_CURRENT_CELL
);
m
->
cellId
=
w
.
cellId
;
m_ctlTask
->
push
(
std
::
move
(
m
));
m_ctlLayer
->
assignCurrentCell
(
w
.
cellId
);
break
;
}
case
NmUeRrcToRls
:
:
RRC_PDU_DELIVERY
:
{
auto
m
=
std
::
make_unique
<
NmUeRlsToRls
>
(
NmUeRlsToRls
::
UPLINK_RRC
);
m
->
cellId
=
w
.
cellId
;
m
->
rrcChannel
=
w
.
channel
;
m
->
pduId
=
w
.
pduId
;
m
->
data
=
std
::
move
(
w
.
pdu
);
m_ctlTask
->
push
(
std
::
move
(
m
));
m_ctlLayer
->
handleUplinkRrcDelivery
(
w
.
cellId
,
w
.
pduId
,
w
.
channel
,
std
::
move
(
w
.
pdu
));
break
;
}
case
NmUeRrcToRls
:
:
RESET_STI
:
{
...
...
@@ -118,10 +138,7 @@ void UeRlsTask::onLoop()
switch
(
w
.
present
)
{
case
NmUeNasToRls
:
:
DATA_PDU_DELIVERY
:
{
auto
m
=
std
::
make_unique
<
NmUeRlsToRls
>
(
NmUeRlsToRls
::
UPLINK_DATA
);
m
->
psi
=
w
.
psi
;
m
->
data
=
std
::
move
(
w
.
pdu
);
m_ctlTask
->
push
(
std
::
move
(
m
));
m_ctlLayer
->
handleUplinkDataDelivery
(
w
.
psi
,
std
::
move
(
w
.
pdu
));
break
;
}
}
...
...
@@ -136,11 +153,9 @@ void UeRlsTask::onLoop()
void
UeRlsTask
::
onQuit
()
{
m_udpTask
->
quit
();
m_ctl
Task
->
q
uit
();
m_ctl
Layer
->
onQ
uit
();
delete
m_udpTask
;
delete
m_ctlTask
;
delete
m_shCtx
;
}
...
...
src/ue/rls/task.hpp
View file @
1564ad57
...
...
@@ -8,7 +8,7 @@
#pragma once
#include "ctl_
task
.hpp"
#include "ctl_
layer
.hpp"
#include "udp_task.hpp"
#include <memory>
...
...
@@ -36,7 +36,8 @@ class UeRlsTask : public NtsTask
RlsSharedContext
*
m_shCtx
;
RlsUdpTask
*
m_udpTask
;
RlsControlTask
*
m_ctlTask
;
std
::
unique_ptr
<
RlsCtlLayer
>
m_ctlLayer
;
friend
class
UeCmdHandler
;
...
...
src/ue/rls/udp_task.cpp
View file @
1564ad57
...
...
@@ -25,7 +25,7 @@ namespace nr::ue
{
RlsUdpTask
::
RlsUdpTask
(
TaskBase
*
base
,
RlsSharedContext
*
shCtx
,
const
std
::
vector
<
std
::
string
>
&
searchSpace
)
:
m_server
{},
m_
ctl
Task
{},
m_shCtx
{
shCtx
},
m_searchSpace
{},
m_cells
{},
m_cellIdToSti
{},
m_lastLoop
{},
:
m_server
{},
m_
main
Task
{},
m_shCtx
{
shCtx
},
m_searchSpace
{},
m_cells
{},
m_cellIdToSti
{},
m_lastLoop
{},
m_cellIdCounter
{}
{
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"rls-udp"
);
...
...
@@ -121,7 +121,7 @@ void RlsUdpTask::receiveRlsPdu(const InetAddress &addr, std::unique_ptr<rls::Rls
auto
w
=
std
::
make_unique
<
NmUeRlsToRls
>
(
NmUeRlsToRls
::
RECEIVE_RLS_MESSAGE
);
w
->
cellId
=
m_cells
[
msg
->
sti
].
cellId
;
w
->
msg
=
std
::
move
(
msg
);
m_
ctl
Task
->
push
(
std
::
move
(
w
));
m_
main
Task
->
push
(
std
::
move
(
w
));
}
void
RlsUdpTask
::
onSignalChangeOrLost
(
int
cellId
)
...
...
@@ -136,7 +136,7 @@ void RlsUdpTask::onSignalChangeOrLost(int cellId)
auto
w
=
std
::
make_unique
<
NmUeRlsToRls
>
(
NmUeRlsToRls
::
SIGNAL_CHANGED
);
w
->
cellId
=
cellId
;
w
->
dbm
=
dbm
;
m_
ctl
Task
->
push
(
std
::
move
(
w
));
m_
main
Task
->
push
(
std
::
move
(
w
));
}
void
RlsUdpTask
::
heartbeatCycle
(
uint64_t
time
,
const
Vector3
&
simPos
)
...
...
@@ -167,9 +167,9 @@ void RlsUdpTask::heartbeatCycle(uint64_t time, const Vector3 &simPos)
}
}
void
RlsUdpTask
::
initialize
(
NtsTask
*
ctl
Task
)
void
RlsUdpTask
::
initialize
(
NtsTask
*
main
Task
)
{
m_
ctlTask
=
ctl
Task
;
m_
mainTask
=
main
Task
;
}
}
// namespace nr::ue
src/ue/rls/udp_task.hpp
View file @
1564ad57
...
...
@@ -34,7 +34,7 @@ class RlsUdpTask : public NtsTask
private:
std
::
unique_ptr
<
Logger
>
m_logger
;
udp
::
UdpServer
*
m_server
;
NtsTask
*
m_
ctl
Task
;
NtsTask
*
m_
main
Task
;
RlsSharedContext
*
m_shCtx
;
std
::
vector
<
InetAddress
>
m_searchSpace
;
std
::
unordered_map
<
uint64_t
,
CellInfo
>
m_cells
;
...
...
@@ -61,7 +61,7 @@ class RlsUdpTask : public NtsTask
void
heartbeatCycle
(
uint64_t
time
,
const
Vector3
&
simPos
);
public:
void
initialize
(
NtsTask
*
ctl
Task
);
void
initialize
(
NtsTask
*
main
Task
);
void
send
(
int
cellId
,
const
rls
::
RlsMessage
&
msg
);
};
...
...
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