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
72059c9f
Commit
72059c9f
authored
Apr 04, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE SRA dev.
parent
06832037
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
33 deletions
+107
-33
src/gnb/sra/transport.cpp
src/gnb/sra/transport.cpp
+1
-1
src/ue/nts.hpp
src/ue/nts.hpp
+5
-0
src/ue/rrc/channel.cpp
src/ue/rrc/channel.cpp
+17
-17
src/ue/sra/task.cpp
src/ue/sra/task.cpp
+13
-2
src/ue/sra/task.hpp
src/ue/sra/task.hpp
+3
-0
src/ue/sra/transport.cpp
src/ue/sra/transport.cpp
+18
-1
src/urs/sra_pdu.cpp
src/urs/sra_pdu.cpp
+26
-7
src/urs/sra_pdu.hpp
src/urs/sra_pdu.hpp
+24
-5
No files found.
src/gnb/sra/transport.cpp
View file @
72059c9f
...
...
@@ -15,7 +15,7 @@ void GnbSraTask::receiveSraMessage(const InetAddress &addr, const sra::SraMessag
{
switch
(
msg
.
msgType
)
{
case
sra
:
:
Sra
MessageType
::
CELL_INFO_REQUEST
:
case
sra
:
:
E
MessageType
::
CELL_INFO_REQUEST
:
handleCellInfoRequest
(
addr
,
(
const
sra
::
SraCellInfoRequest
&
)
msg
);
break
;
default:
...
...
src/ue/nts.hpp
View file @
72059c9f
...
...
@@ -224,12 +224,17 @@ struct NwUeRrcToSra : NtsMessage
{
PLMN_SEARCH_REQUEST
,
CELL_SELECTION_COMMAND
,
RRC_PDU_DELIVERY
}
present
;
// CELL_SELECTION_COMMAND
GlobalNci
cellId
{};
bool
isSuitableCell
{};
// otherwise 'acceptable'
// RRC_PDU_DELIVERY
rrc
::
RrcChannel
channel
{};
OctetString
pdu
{};
explicit
NwUeRrcToSra
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_RRC_TO_SRA
),
present
(
present
)
{
}
...
...
src/ue/rrc/channel.cpp
View file @
72059c9f
...
...
@@ -9,7 +9,7 @@
#include "task.hpp"
#include <rrc/encode.hpp>
#include <ue/
mr
/task.hpp>
#include <ue/
sra
/task.hpp>
#include <asn/rrc/ASN_RRC_RRCReject.h>
#include <asn/rrc/ASN_RRC_RRCSetup.h>
...
...
@@ -107,10 +107,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_BCH_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
BCCH_BCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
sendRrcMessage
(
ASN_RRC_BCCH_DL_SCH_Message
*
msg
)
...
...
@@ -122,10 +122,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_DL_SCH_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
BCCH_DL_SCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
sendRrcMessage
(
ASN_RRC_DL_CCCH_Message
*
msg
)
...
...
@@ -137,10 +137,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_DL_CCCH_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
DL_CCCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
sendRrcMessage
(
ASN_RRC_DL_DCCH_Message
*
msg
)
...
...
@@ -152,10 +152,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_DL_DCCH_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
DL_DCCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
sendRrcMessage
(
ASN_RRC_PCCH_Message
*
msg
)
...
...
@@ -167,10 +167,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_PCCH_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
PCCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
sendRrcMessage
(
ASN_RRC_UL_CCCH_Message
*
msg
)
...
...
@@ -182,10 +182,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_CCCH_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
UL_CCCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
sendRrcMessage
(
ASN_RRC_UL_CCCH1_Message
*
msg
)
...
...
@@ -197,10 +197,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_CCCH1_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
UL_CCCH1
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
sendRrcMessage
(
ASN_RRC_UL_DCCH_Message
*
msg
)
...
...
@@ -212,10 +212,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
return
;
}
auto
*
nw
=
new
NwUeRrcTo
Mr
(
NwUeRrcToMr
::
RRC_PDU_DELIVERY
);
auto
*
nw
=
new
NwUeRrcTo
Sra
(
NwUeRrcToSra
::
RRC_PDU_DELIVERY
);
nw
->
channel
=
rrc
::
RrcChannel
::
UL_DCCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
mr
Task
->
push
(
nw
);
m_base
->
sra
Task
->
push
(
nw
);
}
void
UeRrcTask
::
receiveRrcMessage
(
ASN_RRC_BCCH_BCH_Message
*
msg
)
...
...
src/ue/sra/task.cpp
View file @
72059c9f
...
...
@@ -8,6 +8,7 @@
#include "task.hpp"
#include <ue/nts.hpp>
#include <utils/common.hpp>
#include <utils/constants.hpp>
static
const
int
TIMER_ID_MEASUREMENT
=
1
;
...
...
@@ -23,6 +24,8 @@ UeSraTask::UeSraTask(TaskBase *base)
for
(
auto
&
addr
:
m_base
->
config
->
gnbSearchList
)
m_cellSearchSpace
.
emplace_back
(
addr
,
cons
::
PortalPort
);
m_sti
=
utils
::
Random64
();
}
void
UeSraTask
::
onStart
()
...
...
@@ -49,10 +52,18 @@ void UeSraTask::onLoop()
{
case
NtsMessageType
:
:
UE_RRC_TO_SRA
:
{
auto
*
w
=
dynamic_cast
<
NwUeRrcToSra
*>
(
msg
);
if
(
w
->
present
==
NwUeRrcToSra
::
PLMN_SEARCH_REQUEST
)
switch
(
w
->
present
)
{
case
NwUeRrcToSra
:
:
PLMN_SEARCH_REQUEST
:
plmnSearchRequested
();
else
if
(
w
->
present
==
NwUeRrcToSra
::
CELL_SELECTION_COMMAND
)
break
;
case
NwUeRrcToSra
:
:
CELL_SELECTION_COMMAND
:
handleCellSelectionCommand
(
w
->
cellId
,
w
->
isSuitableCell
);
break
;
case
NwUeRrcToSra
:
:
RRC_PDU_DELIVERY
:
deliverUplinkRrc
(
w
->
channel
,
std
::
move
(
w
->
pdu
));
break
;
}
break
;
}
case
NtsMessageType
:
:
TIMER_EXPIRED
:
{
...
...
src/ue/sra/task.hpp
View file @
72059c9f
...
...
@@ -10,6 +10,7 @@
#include <memory>
#include <optional>
#include <rrc/rrc.hpp>
#include <thread>
#include <udp/server_task.hpp>
#include <ue/types.hpp>
...
...
@@ -34,6 +35,7 @@ class UeSraTask : public NtsTask
std
::
unordered_map
<
GlobalNci
,
UeCellMeasurement
>
m_pendingMeasurements
;
std
::
unordered_map
<
GlobalNci
,
UeCellMeasurement
>
m_activeMeasurements
;
uint64_t
m_sti
;
std
::
optional
<
UeCellInfo
>
m_servingCell
;
friend
class
UeCmdHandler
;
...
...
@@ -50,6 +52,7 @@ class UeSraTask : public NtsTask
private:
/* Transport */
void
receiveSraMessage
(
const
InetAddress
&
address
,
const
sra
::
SraMessage
&
msg
);
void
sendSraMessage
(
const
InetAddress
&
address
,
const
sra
::
SraMessage
&
msg
);
void
deliverUplinkRrc
(
rrc
::
RrcChannel
channel
,
OctetString
&&
pdu
);
private:
/* Measurement */
void
onMeasurement
();
...
...
src/ue/sra/transport.cpp
View file @
72059c9f
...
...
@@ -7,6 +7,7 @@
//
#include "task.hpp"
#include <utils/constants.hpp>
namespace
nr
::
ue
{
...
...
@@ -15,7 +16,7 @@ void UeSraTask::receiveSraMessage(const InetAddress &address, const sra::SraMess
{
switch
(
msg
.
msgType
)
{
case
sra
:
:
Sra
MessageType
::
CELL_INFO_RESPONSE
:
{
case
sra
:
:
E
MessageType
::
CELL_INFO_RESPONSE
:
{
receiveCellInfoResponse
((
const
sra
::
SraCellInfoResponse
&
)
msg
);
break
;
default:
...
...
@@ -32,4 +33,20 @@ void UeSraTask::sendSraMessage(const InetAddress &address, const sra::SraMessage
m_udpTask
->
send
(
address
,
stream
);
}
void
UeSraTask
::
deliverUplinkRrc
(
rrc
::
RrcChannel
channel
,
OctetString
&&
pdu
)
{
if
(
!
m_servingCell
.
has_value
())
{
m_logger
->
warn
(
"SRA uplink delivery requested without a serving cell"
);
return
;
}
sra
::
SraPduDelivery
msg
{};
msg
.
sti
=
m_sti
;
msg
.
pduType
=
sra
::
EPduType
::
RRC
;
msg
.
pdu
=
std
::
move
(
pdu
);
msg
.
payload
.
appendOctet4
(
static_cast
<
int
>
(
channel
));
sendSraMessage
(
InetAddress
{
m_servingCell
->
linkIp
,
cons
::
PortalPort
},
msg
);
}
}
// namespace nr::ue
src/urs/sra_pdu.cpp
View file @
72059c9f
...
...
@@ -50,16 +50,16 @@ void EncodeSraMessage(const SraMessage &msg, OctetString &stream)
stream
.
appendOctet
(
cons
::
Minor
);
stream
.
appendOctet
(
cons
::
Patch
);
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
msg
.
msgType
));
if
(
msg
.
msgType
==
Sra
MessageType
::
CELL_INFO_REQUEST
)
if
(
msg
.
msgType
==
E
MessageType
::
CELL_INFO_REQUEST
)
{
auto
m
=
(
const
SraCellInfoRequest
&
)
msg
;
auto
&
m
=
(
const
SraCellInfoRequest
&
)
msg
;
stream
.
appendOctet4
(
m
.
simPos
.
x
);
stream
.
appendOctet4
(
m
.
simPos
.
y
);
stream
.
appendOctet4
(
m
.
simPos
.
z
);
}
else
if
(
msg
.
msgType
==
Sra
MessageType
::
CELL_INFO_RESPONSE
)
else
if
(
msg
.
msgType
==
E
MessageType
::
CELL_INFO_RESPONSE
)
{
auto
m
=
(
const
SraCellInfoResponse
&
)
msg
;
auto
&
m
=
(
const
SraCellInfoResponse
&
)
msg
;
AppendGlobalNci
(
m
.
cellId
,
stream
);
stream
.
appendOctet4
(
m
.
tac
);
stream
.
appendOctet4
(
m
.
dbm
);
...
...
@@ -68,6 +68,16 @@ void EncodeSraMessage(const SraMessage &msg, OctetString &stream)
stream
.
appendOctet4
(
static_cast
<
int
>
(
m
.
linkIp
.
size
()));
stream
.
appendUtf8
(
m
.
linkIp
);
}
else
if
(
msg
.
msgType
==
EMessageType
::
PDU_DELIVERY
)
{
auto
&
m
=
(
const
SraPduDelivery
&
)
msg
;
stream
.
appendOctet8
(
m
.
sti
);
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
m
.
pduType
));
stream
.
appendOctet4
(
m
.
pdu
.
length
());
stream
.
append
(
m
.
pdu
);
stream
.
appendOctet4
(
m
.
payload
.
length
());
stream
.
append
(
m
.
payload
);
}
}
std
::
unique_ptr
<
SraMessage
>
DecodeSraMessage
(
const
OctetView
&
stream
)
...
...
@@ -83,8 +93,8 @@ std::unique_ptr<SraMessage> DecodeSraMessage(const OctetView &stream)
if
(
stream
.
read
()
!=
cons
::
Patch
)
return
nullptr
;
auto
msgType
=
static_cast
<
Sra
MessageType
>
(
stream
.
readI
());
if
(
msgType
==
Sra
MessageType
::
CELL_INFO_REQUEST
)
auto
msgType
=
static_cast
<
E
MessageType
>
(
stream
.
readI
());
if
(
msgType
==
E
MessageType
::
CELL_INFO_REQUEST
)
{
auto
res
=
std
::
make_unique
<
SraCellInfoRequest
>
();
res
->
simPos
.
x
=
stream
.
read4I
();
...
...
@@ -92,7 +102,7 @@ std::unique_ptr<SraMessage> DecodeSraMessage(const OctetView &stream)
res
->
simPos
.
z
=
stream
.
read4I
();
return
res
;
}
else
if
(
msgType
==
Sra
MessageType
::
CELL_INFO_RESPONSE
)
else
if
(
msgType
==
E
MessageType
::
CELL_INFO_RESPONSE
)
{
auto
res
=
std
::
make_unique
<
SraCellInfoResponse
>
();
res
->
cellId
=
DecodeGlobalNci
(
stream
);
...
...
@@ -102,6 +112,15 @@ std::unique_ptr<SraMessage> DecodeSraMessage(const OctetView &stream)
res
->
linkIp
=
stream
.
readUtf8String
(
stream
.
read4I
());
return
res
;
}
else
if
(
msgType
==
EMessageType
::
PDU_DELIVERY
)
{
auto
res
=
std
::
make_unique
<
SraPduDelivery
>
();
res
->
sti
=
stream
.
read8UL
();
res
->
pduType
=
static_cast
<
EPduType
>
(
stream
.
readI
());
res
->
pdu
=
stream
.
readOctetString
(
stream
.
read4I
());
res
->
payload
=
stream
.
readOctetString
(
stream
.
read4I
());
return
res
;
}
return
nullptr
;
}
...
...
src/urs/sra_pdu.hpp
View file @
72059c9f
...
...
@@ -17,18 +17,25 @@
namespace
sra
{
enum
class
Sra
MessageType
:
uint8_t
enum
class
E
MessageType
:
uint8_t
{
RESERVED
=
0
,
CELL_INFO_REQUEST
,
CELL_INFO_RESPONSE
,
PDU_DELIVERY
};
enum
class
EPduType
:
uint8_t
{
RESERVED
=
0
,
RRC
};
struct
SraMessage
{
const
Sra
MessageType
msgType
;
const
E
MessageType
msgType
;
explicit
SraMessage
(
Sra
MessageType
msgType
)
:
msgType
(
msgType
)
explicit
SraMessage
(
E
MessageType
msgType
)
:
msgType
(
msgType
)
{
}
};
...
...
@@ -37,7 +44,7 @@ struct SraCellInfoRequest : SraMessage
{
Vector3
simPos
{};
SraCellInfoRequest
()
:
SraMessage
(
Sra
MessageType
::
CELL_INFO_REQUEST
)
SraCellInfoRequest
()
:
SraMessage
(
E
MessageType
::
CELL_INFO_REQUEST
)
{
}
};
...
...
@@ -50,7 +57,19 @@ struct SraCellInfoResponse : SraMessage
std
::
string
gnbName
{};
std
::
string
linkIp
{};
SraCellInfoResponse
()
:
SraMessage
(
SraMessageType
::
CELL_INFO_RESPONSE
)
SraCellInfoResponse
()
:
SraMessage
(
EMessageType
::
CELL_INFO_RESPONSE
)
{
}
};
struct
SraPduDelivery
:
SraMessage
{
uint64_t
sti
{};
EPduType
pduType
{};
OctetString
pdu
{};
OctetString
payload
{};
SraPduDelivery
()
:
SraMessage
(
EMessageType
::
PDU_DELIVERY
)
{
}
};
...
...
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