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
14f9233e
Commit
14f9233e
authored
May 11, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RLS improvements
parent
739be8b1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
19 deletions
+42
-19
src/ue/nts.hpp
src/ue/nts.hpp
+4
-4
src/ue/rls/udp_task.cpp
src/ue/rls/udp_task.cpp
+33
-13
src/ue/rls/udp_task.hpp
src/ue/rls/udp_task.hpp
+5
-2
No files found.
src/ue/nts.hpp
View file @
14f9233e
...
@@ -250,13 +250,13 @@ struct NwUeRlsToRls : NtsMessage
...
@@ -250,13 +250,13 @@ struct NwUeRlsToRls : NtsMessage
SIGNAL_CHANGED
,
SIGNAL_CHANGED
,
}
present
;
}
present
;
// SIGNAL_CHANGED
uint64_t
sti
{};
int
dbm
{};
// RECEIVE_RLS_MESSAGE
// RECEIVE_RLS_MESSAGE
int
cellId
{};
std
::
unique_ptr
<
rls
::
RlsMessage
>
msg
{};
std
::
unique_ptr
<
rls
::
RlsMessage
>
msg
{};
// SIGNAL_CHANGED
int
dbm
{};
explicit
NwUeRlsToRls
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_RLS_TO_RLS
),
present
(
present
)
explicit
NwUeRlsToRls
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_RLS_TO_RLS
),
present
(
present
)
{
{
}
}
...
...
src/ue/rls/udp_task.cpp
View file @
14f9233e
...
@@ -25,7 +25,7 @@ namespace nr::ue
...
@@ -25,7 +25,7 @@ namespace nr::ue
{
{
RlsUdpTask
::
RlsUdpTask
(
TaskBase
*
base
,
uint64_t
sti
,
const
std
::
vector
<
std
::
string
>
&
searchSpace
)
RlsUdpTask
::
RlsUdpTask
(
TaskBase
*
base
,
uint64_t
sti
,
const
std
::
vector
<
std
::
string
>
&
searchSpace
)
:
m_ctlTask
{},
m_sti
{
sti
},
m_searchSpace
{},
m_cells
{},
m_
lastLoop
{}
:
m_ctlTask
{},
m_sti
{
sti
},
m_searchSpace
{},
m_cells
{},
m_
cellIdToSti
{},
m_lastLoop
{},
m_cellIdCounter
{}
{
{
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"rls-udp"
);
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"rls-udp"
);
...
@@ -77,16 +77,25 @@ void RlsUdpTask::sendRlsPdu(const InetAddress &addr, const rls::RlsMessage &msg)
...
@@ -77,16 +77,25 @@ void RlsUdpTask::sendRlsPdu(const InetAddress &addr, const rls::RlsMessage &msg)
m_server
->
Send
(
addr
,
stream
.
data
(),
static_cast
<
size_t
>
(
stream
.
length
()));
m_server
->
Send
(
addr
,
stream
.
data
(),
static_cast
<
size_t
>
(
stream
.
length
()));
}
}
void
RlsUdpTask
::
send
(
uint64_t
sti
,
const
rls
::
RlsMessage
&
msg
)
void
RlsUdpTask
::
send
(
int
cellId
,
const
rls
::
RlsMessage
&
msg
)
{
{
if
(
m_cells
.
count
(
sti
))
if
(
m_cellIdToSti
.
count
(
cellId
))
{
auto
sti
=
m_cellIdToSti
[
cellId
];
sendRlsPdu
(
m_cells
[
sti
].
address
,
msg
);
sendRlsPdu
(
m_cells
[
sti
].
address
,
msg
);
}
}
}
void
RlsUdpTask
::
receiveRlsPdu
(
const
InetAddress
&
addr
,
std
::
unique_ptr
<
rls
::
RlsMessage
>
&&
msg
)
void
RlsUdpTask
::
receiveRlsPdu
(
const
InetAddress
&
addr
,
std
::
unique_ptr
<
rls
::
RlsMessage
>
&&
msg
)
{
{
if
(
msg
->
msgType
==
rls
::
EMessageType
::
HEARTBEAT_ACK
)
if
(
msg
->
msgType
==
rls
::
EMessageType
::
HEARTBEAT_ACK
)
{
{
if
(
!
m_cells
.
count
(
msg
->
sti
))
{
m_cells
[
msg
->
sti
].
cellId
=
++
m_cellIdCounter
;
m_cellIdToSti
[
m_cells
[
msg
->
sti
].
cellId
]
=
msg
->
sti
;
}
int
oldDbm
=
INT32_MIN
;
int
oldDbm
=
INT32_MIN
;
if
(
m_cells
.
count
(
msg
->
sti
))
if
(
m_cells
.
count
(
msg
->
sti
))
oldDbm
=
m_cells
[
msg
->
sti
].
dbm
;
oldDbm
=
m_cells
[
msg
->
sti
].
dbm
;
...
@@ -98,7 +107,7 @@ void RlsUdpTask::receiveRlsPdu(const InetAddress &addr, std::unique_ptr<rls::Rls
...
@@ -98,7 +107,7 @@ void RlsUdpTask::receiveRlsPdu(const InetAddress &addr, std::unique_ptr<rls::Rls
m_cells
[
msg
->
sti
].
dbm
=
newDbm
;
m_cells
[
msg
->
sti
].
dbm
=
newDbm
;
if
(
oldDbm
!=
newDbm
)
if
(
oldDbm
!=
newDbm
)
onSignalChangeOrLost
(
m
sg
->
sti
);
onSignalChangeOrLost
(
m
_cells
[
msg
->
sti
].
cellId
);
return
;
return
;
}
}
...
@@ -109,34 +118,45 @@ void RlsUdpTask::receiveRlsPdu(const InetAddress &addr, std::unique_ptr<rls::Rls
...
@@ -109,34 +118,45 @@ void RlsUdpTask::receiveRlsPdu(const InetAddress &addr, std::unique_ptr<rls::Rls
}
}
auto
*
w
=
new
NwUeRlsToRls
(
NwUeRlsToRls
::
RECEIVE_RLS_MESSAGE
);
auto
*
w
=
new
NwUeRlsToRls
(
NwUeRlsToRls
::
RECEIVE_RLS_MESSAGE
);
w
->
cellId
=
m_cells
[
msg
->
sti
].
cellId
;
w
->
msg
=
std
::
move
(
msg
);
w
->
msg
=
std
::
move
(
msg
);
m_ctlTask
->
push
(
w
);
m_ctlTask
->
push
(
w
);
}
}
void
RlsUdpTask
::
onSignalChangeOrLost
(
uint64_t
sti
)
void
RlsUdpTask
::
onSignalChangeOrLost
(
int
cellId
)
{
{
int
dbm
=
INT32_MIN
;
if
(
m_cellIdToSti
.
count
(
cellId
))
{
auto
sti
=
m_cellIdToSti
[
cellId
];
dbm
=
m_cells
[
sti
].
dbm
;
}
auto
*
w
=
new
NwUeRlsToRls
(
NwUeRlsToRls
::
SIGNAL_CHANGED
);
auto
*
w
=
new
NwUeRlsToRls
(
NwUeRlsToRls
::
SIGNAL_CHANGED
);
w
->
sti
=
sti
;
w
->
cellId
=
cellId
;
w
->
dbm
=
m_cells
.
count
(
sti
)
?
m_cells
[
sti
].
dbm
:
INT32_MIN
;
w
->
dbm
=
dbm
;
m_ctlTask
->
push
(
w
);
m_ctlTask
->
push
(
w
);
}
}
void
RlsUdpTask
::
heartbeatCycle
(
uint64_t
time
,
const
Vector3
&
simPos
)
void
RlsUdpTask
::
heartbeatCycle
(
uint64_t
time
,
const
Vector3
&
simPos
)
{
{
std
::
set
<
uint64_t
>
stiT
oRemove
;
std
::
set
<
std
::
pair
<
uint64_t
,
int
>>
t
oRemove
;
for
(
auto
&
cell
:
m_cells
)
for
(
auto
&
cell
:
m_cells
)
{
{
auto
delta
=
time
-
cell
.
second
.
lastSeen
;
auto
delta
=
time
-
cell
.
second
.
lastSeen
;
if
(
delta
>
HEARTBEAT_THRESHOLD
)
if
(
delta
>
HEARTBEAT_THRESHOLD
)
stiToRemove
.
insert
(
cell
.
first
);
toRemove
.
insert
({
cell
.
first
,
cell
.
second
.
cellId
}
);
}
}
for
(
auto
sti
:
stiToRemove
)
for
(
auto
cell
:
toRemove
)
m_cells
.
erase
(
sti
);
{
m_cells
.
erase
(
cell
.
first
);
m_cellIdToSti
.
erase
(
cell
.
second
);
}
for
(
auto
sti
:
stiT
oRemove
)
for
(
auto
cell
:
t
oRemove
)
onSignalChangeOrLost
(
sti
);
onSignalChangeOrLost
(
cell
.
second
);
for
(
auto
&
addr
:
m_searchSpace
)
for
(
auto
&
addr
:
m_searchSpace
)
{
{
...
...
src/ue/rls/udp_task.hpp
View file @
14f9233e
...
@@ -28,6 +28,7 @@ class RlsUdpTask : public NtsTask
...
@@ -28,6 +28,7 @@ class RlsUdpTask : public NtsTask
InetAddress
address
;
InetAddress
address
;
int64_t
lastSeen
{};
int64_t
lastSeen
{};
int
dbm
{};
int
dbm
{};
int
cellId
{};
};
};
private:
private:
...
@@ -37,8 +38,10 @@ class RlsUdpTask : public NtsTask
...
@@ -37,8 +38,10 @@ class RlsUdpTask : public NtsTask
uint64_t
m_sti
;
uint64_t
m_sti
;
std
::
vector
<
InetAddress
>
m_searchSpace
;
std
::
vector
<
InetAddress
>
m_searchSpace
;
std
::
unordered_map
<
uint64_t
,
CellInfo
>
m_cells
;
std
::
unordered_map
<
uint64_t
,
CellInfo
>
m_cells
;
std
::
unordered_map
<
int
,
uint64_t
>
m_cellIdToSti
;
int64_t
m_lastLoop
;
int64_t
m_lastLoop
;
Vector3
m_simPos
;
Vector3
m_simPos
;
int
m_cellIdCounter
;
public:
public:
explicit
RlsUdpTask
(
TaskBase
*
base
,
uint64_t
sti
,
const
std
::
vector
<
std
::
string
>
&
searchSpace
);
explicit
RlsUdpTask
(
TaskBase
*
base
,
uint64_t
sti
,
const
std
::
vector
<
std
::
string
>
&
searchSpace
);
...
@@ -52,12 +55,12 @@ class RlsUdpTask : public NtsTask
...
@@ -52,12 +55,12 @@ class RlsUdpTask : public NtsTask
private:
private:
void
sendRlsPdu
(
const
InetAddress
&
addr
,
const
rls
::
RlsMessage
&
msg
);
void
sendRlsPdu
(
const
InetAddress
&
addr
,
const
rls
::
RlsMessage
&
msg
);
void
receiveRlsPdu
(
const
InetAddress
&
addr
,
std
::
unique_ptr
<
rls
::
RlsMessage
>
&&
msg
);
void
receiveRlsPdu
(
const
InetAddress
&
addr
,
std
::
unique_ptr
<
rls
::
RlsMessage
>
&&
msg
);
void
onSignalChangeOrLost
(
uint64_t
sti
);
void
onSignalChangeOrLost
(
int
cellId
);
void
heartbeatCycle
(
uint64_t
time
,
const
Vector3
&
simPos
);
void
heartbeatCycle
(
uint64_t
time
,
const
Vector3
&
simPos
);
public:
public:
void
initialize
(
NtsTask
*
ctlTask
);
void
initialize
(
NtsTask
*
ctlTask
);
void
send
(
uint64_t
sti
,
const
rls
::
RlsMessage
&
msg
);
void
send
(
int
cellId
,
const
rls
::
RlsMessage
&
msg
);
};
};
}
// namespace nr::ue
}
// namespace nr::ue
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