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
79d9171f
Commit
79d9171f
authored
May 10, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RLS improvements
parent
9f8f3847
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
5 deletions
+63
-5
src/gnb/nts.hpp
src/gnb/nts.hpp
+22
-0
src/gnb/rls/udp_task.cpp
src/gnb/rls/udp_task.cpp
+34
-5
src/gnb/rls/udp_task.hpp
src/gnb/rls/udp_task.hpp
+6
-0
src/utils/nts.hpp
src/utils/nts.hpp
+1
-0
No files found.
src/gnb/nts.hpp
View file @
79d9171f
...
...
@@ -15,6 +15,7 @@
#include <lib/app/cli_base.hpp>
#include <lib/app/cli_cmd.hpp>
#include <lib/asn/utils.hpp>
#include <lib/rls/rls_pdu.hpp>
#include <lib/rrc/rrc.hpp>
#include <lib/sctp/sctp.hpp>
#include <utils/network.hpp>
...
...
@@ -86,6 +87,27 @@ struct NwGnbGtpToRls : NtsMessage
}
};
struct
NwGnbRlsToRls
:
NtsMessage
{
enum
PR
{
SIGNAL_DETECTED
,
SIGNAL_LOST
,
RECEIVE_RLS_MESSAGE
}
present
;
// SIGNAL_DETECTED
// SIGNAL_LOST
int
ueId
{};
// RECEIVE_RLS_MESSAGE
std
::
unique_ptr
<
rls
::
RlsMessage
>
msg
{};
explicit
NwGnbRlsToRls
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
GNB_RLS_TO_RLS
),
present
(
present
)
{
}
};
struct
NwGnbRrcToRls
:
NtsMessage
{
enum
PR
...
...
src/gnb/rls/udp_task.cpp
View file @
79d9171f
...
...
@@ -42,7 +42,7 @@ namespace nr::gnb
{
RlsUdpTask
::
RlsUdpTask
(
TaskBase
*
base
,
uint64_t
sti
,
Vector3
phyLocation
)
:
m_
sti
{
sti
},
m_phyLocation
{
phyLocation
},
m_lastLoop
{},
m_stiToUe
{},
m_ueMap
{}
:
m_
ctlTask
{},
m_sti
{
sti
},
m_phyLocation
{
phyLocation
},
m_lastLoop
{},
m_stiToUe
{},
m_ueMap
{},
m_newIdCounter
{}
{
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
"rls"
);
...
...
@@ -109,13 +109,15 @@ void RlsUdpTask::receiveRlsPdu(const InetAddress &addr, std::unique_ptr<rls::Rls
}
else
{
int
ueId
=
static_cast
<
int
>
(
m_stiToUe
.
size
())
+
1
;
int
ueId
=
++
m_newIdCounter
;
m_stiToUe
[
msg
->
sti
]
=
ueId
;
m_ueMap
[
ueId
].
address
=
addr
;
m_ueMap
[
ueId
].
lastSeen
=
utils
::
CurrentTimeMillis
();
// TODO notify upper layer new UE
auto
*
w
=
new
NwGnbRlsToRls
(
NwGnbRlsToRls
::
SIGNAL_DETECTED
);
w
->
ueId
=
ueId
;
m_ctlTask
->
push
(
w
);
}
rls
::
RlsHeartBeatAck
ack
{
m_sti
};
...
...
@@ -125,7 +127,16 @@ void RlsUdpTask::receiveRlsPdu(const InetAddress &addr, std::unique_ptr<rls::Rls
return
;
}
// TODO notify upper layer new message
if
(
!
m_stiToUe
.
count
(
msg
->
sti
))
{
// if no HB received yet, and the message is not HB, then ignore the message
return
;
}
auto
*
w
=
new
NwGnbRlsToRls
(
NwGnbRlsToRls
::
RECEIVE_RLS_MESSAGE
);
w
->
ueId
=
m_stiToUe
[
msg
->
sti
];
w
->
msg
=
std
::
move
(
msg
);
m_ctlTask
->
push
(
w
);
}
void
RlsUdpTask
::
sendRlsPdu
(
const
InetAddress
&
addr
,
const
rls
::
RlsMessage
&
msg
)
...
...
@@ -158,8 +169,26 @@ void RlsUdpTask::heartbeatCycle(int64_t time)
for
(
int
ueId
:
lostUeId
)
{
// TODO: notify upper layer
auto
*
w
=
new
NwGnbRlsToRls
(
NwGnbRlsToRls
::
SIGNAL_LOST
);
w
->
ueId
=
ueId
;
m_ctlTask
->
push
(
w
);
}
}
void
RlsUdpTask
::
initialize
(
NtsTask
*
ctlTask
)
{
m_ctlTask
=
ctlTask
;
}
void
RlsUdpTask
::
send
(
int
ueId
,
const
rls
::
RlsMessage
&
msg
)
{
if
(
!
m_ueMap
.
count
(
ueId
))
{
// ignore the message
return
;
}
sendRlsPdu
(
m_ueMap
[
ueId
].
address
,
msg
);
}
}
// namespace nr::gnb
src/gnb/rls/udp_task.hpp
View file @
79d9171f
...
...
@@ -33,11 +33,13 @@ class RlsUdpTask : public NtsTask
private:
std
::
unique_ptr
<
Logger
>
m_logger
;
udp
::
UdpServer
*
m_server
;
NtsTask
*
m_ctlTask
;
uint64_t
m_sti
;
Vector3
m_phyLocation
;
int64_t
m_lastLoop
;
std
::
unordered_map
<
uint64_t
,
int
>
m_stiToUe
;
std
::
unordered_map
<
int
,
UeInfo
>
m_ueMap
;
int
m_newIdCounter
;
public:
explicit
RlsUdpTask
(
TaskBase
*
base
,
uint64_t
sti
,
Vector3
phyLocation
);
...
...
@@ -52,6 +54,10 @@ class RlsUdpTask : public NtsTask
void
receiveRlsPdu
(
const
InetAddress
&
addr
,
std
::
unique_ptr
<
rls
::
RlsMessage
>
&&
msg
);
void
sendRlsPdu
(
const
InetAddress
&
addr
,
const
rls
::
RlsMessage
&
msg
);
void
heartbeatCycle
(
int64_t
time
);
public:
void
initialize
(
NtsTask
*
ctlTask
);
void
send
(
int
ueId
,
const
rls
::
RlsMessage
&
msg
);
};
}
// namespace nr::gnb
src/utils/nts.hpp
View file @
79d9171f
...
...
@@ -39,6 +39,7 @@ enum class NtsMessageType
GNB_RLS_TO_GTP
,
GNB_GTP_TO_RLS
,
GNB_RRC_TO_RLS
,
GNB_RLS_TO_RLS
,
GNB_NGAP_TO_RRC
,
GNB_RRC_TO_NGAP
,
GNB_NGAP_TO_GTP
,
...
...
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