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
2ab318fe
Commit
2ab318fe
authored
Apr 04, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE SAS dev.
parent
3a1d5581
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
95 additions
and
5 deletions
+95
-5
src/gnb/sas/handler.cpp
src/gnb/sas/handler.cpp
+1
-0
src/ue/mm/interface.cpp
src/ue/mm/interface.cpp
+3
-0
src/ue/mm/mm.hpp
src/ue/mm/mm.hpp
+1
-0
src/ue/mm/radio.cpp
src/ue/mm/radio.cpp
+30
-0
src/ue/nts.hpp
src/ue/nts.hpp
+8
-0
src/ue/rrc/task.cpp
src/ue/rrc/task.cpp
+6
-0
src/ue/sas/connection.cpp
src/ue/sas/connection.cpp
+18
-2
src/ue/sas/measurement.cpp
src/ue/sas/measurement.cpp
+1
-1
src/ue/sas/task.cpp
src/ue/sas/task.cpp
+1
-1
src/ue/sas/task.hpp
src/ue/sas/task.hpp
+3
-0
src/urs/sas_pdu.cpp
src/urs/sas_pdu.cpp
+3
-0
src/urs/sas_pdu.hpp
src/urs/sas_pdu.hpp
+1
-0
src/utils/common_types.hpp
src/utils/common_types.hpp
+19
-1
No files found.
src/gnb/sas/handler.cpp
View file @
2ab318fe
...
...
@@ -41,6 +41,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe
resp
.
tac
=
m_base
->
config
->
tac
;
resp
.
dbm
=
dbm
;
resp
.
gnbName
=
m_base
->
config
->
name
;
resp
.
linkIp
=
m_base
->
config
->
portalIp
;
sendSasMessage
(
addr
,
resp
);
}
...
...
src/ue/mm/interface.cpp
View file @
2ab318fe
...
...
@@ -40,6 +40,9 @@ void NasMm::handleRrcEvent(const NwUeRrcToNas &msg)
handleRadioLinkFailure
();
break
;
}
case
NwUeRrcToNas
:
:
SERVING_CELL_CHANGE
:
{
handleServingCellChange
(
msg
.
servingCell
);
}
}
}
...
...
src/ue/mm/mm.hpp
View file @
2ab318fe
...
...
@@ -145,6 +145,7 @@ class NasMm
void
handlePlmnSearchResponse
(
const
std
::
vector
<
UeCellMeasurement
>
&
measures
);
void
handleRrcConnectionSetup
();
void
handleRrcConnectionRelease
();
void
handleServingCellChange
(
const
UeCellInfo
&
servingCell
);
void
handleRadioLinkFailure
();
private:
/* Access Control */
...
...
src/ue/mm/radio.cpp
View file @
2ab318fe
...
...
@@ -151,6 +151,36 @@ void NasMm::handlePlmnSearchResponse(const std::vector<UeCellMeasurement> &measu
}
}
void
NasMm
::
handleServingCellChange
(
const
UeCellInfo
&
servingCell
)
{
if
(
m_cmState
==
ECmState
::
CM_CONNECTED
)
{
m_logger
->
err
(
"Serving cell change in CM-CONNECTED"
);
return
;
}
if
(
servingCell
.
cellCategory
!=
ECellCategory
::
ACCEPTABLE_CELL
&&
servingCell
.
cellCategory
!=
ECellCategory
::
SUITABLE_CELL
)
{
m_logger
->
err
(
"Serving cell change with unhandled cell category"
);
return
;
}
m_logger
->
info
(
"Serving cell determined [%s]"
,
servingCell
.
gnbName
.
c_str
());
if
(
m_mmState
==
EMmState
::
MM_REGISTERED
||
m_mmState
==
EMmState
::
MM_DEREGISTERED
)
{
bool
isSuitable
=
servingCell
.
cellCategory
==
ECellCategory
::
SUITABLE_CELL
;
if
(
m_mmState
==
EMmState
::
MM_REGISTERED
)
switchMmState
(
EMmState
::
MM_REGISTERED
,
isSuitable
?
EMmSubState
::
MM_REGISTERED_NORMAL_SERVICE
:
EMmSubState
::
MM_REGISTERED_LIMITED_SERVICE
);
else
switchMmState
(
EMmState
::
MM_DEREGISTERED
,
isSuitable
?
EMmSubState
::
MM_DEREGISTERED_NORMAL_SERVICE
:
EMmSubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
}
}
void
NasMm
::
handleRrcConnectionSetup
()
{
switchCmState
(
ECmState
::
CM_CONNECTED
);
...
...
src/ue/nts.hpp
View file @
2ab318fe
...
...
@@ -153,6 +153,7 @@ struct NwUeRrcToNas : NtsMessage
RRC_CONNECTION_SETUP
,
RRC_CONNECTION_RELEASE
,
RADIO_LINK_FAILURE
,
SERVING_CELL_CHANGE
,
}
present
;
// NAS_DELIVERY
...
...
@@ -161,6 +162,9 @@ struct NwUeRrcToNas : NtsMessage
// PLMN_SEARCH_RESPONSE
std
::
vector
<
UeCellMeasurement
>
measurements
{};
// SERVING_CELL_CHANGE
UeCellInfo
servingCell
{};
explicit
NwUeRrcToNas
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_RRC_TO_NAS
),
present
(
present
)
{
}
...
...
@@ -236,11 +240,15 @@ struct NwUeSasToRrc : NtsMessage
enum
PR
{
PLMN_SEARCH_RESPONSE
,
SERVING_CELL_CHANGE
}
present
;
// PLMN_SEARCH_RESPONSE
std
::
vector
<
UeCellMeasurement
>
measurements
{};
// SERVING_CELL_CHANGE
UeCellInfo
servingCell
{};
explicit
NwUeSasToRrc
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_SAS_TO_RRC
),
present
(
present
)
{
}
...
...
src/ue/rrc/task.cpp
View file @
2ab318fe
...
...
@@ -106,6 +106,12 @@ void UeRrcTask::onLoop()
m_base
->
nasTask
->
push
(
wr
);
break
;
}
case
NwUeSasToRrc
:
:
SERVING_CELL_CHANGE
:
{
auto
*
wr
=
new
NwUeRrcToNas
(
NwUeRrcToNas
::
SERVING_CELL_CHANGE
);
wr
->
servingCell
=
w
->
servingCell
;
m_base
->
nasTask
->
push
(
wr
);
break
;
}
}
break
;
}
...
...
src/ue/sas/connection.cpp
View file @
2ab318fe
...
...
@@ -16,8 +16,24 @@ namespace nr::ue
void
UeSasTask
::
handleCellSelectionCommand
(
const
GlobalNci
&
cellId
,
bool
isSuitable
)
{
m_logger
->
err
(
"TODO"
);
// TODO perform camp
}
if
(
!
m_activeMeasurements
.
count
(
cellId
))
{
m_logger
->
err
(
"Selected cell is no longer available for camping"
);
return
;
}
auto
&
measurement
=
m_activeMeasurements
[
cellId
];
m_servingCell
=
UeCellInfo
{};
m_servingCell
->
cellId
=
measurement
.
cellId
;
m_servingCell
->
tac
=
measurement
.
tac
;
m_servingCell
->
gnbName
=
measurement
.
gnbName
;
m_servingCell
->
linkIp
=
measurement
.
linkIp
;
m_servingCell
->
cellCategory
=
isSuitable
?
ECellCategory
::
SUITABLE_CELL
:
ECellCategory
::
ACCEPTABLE_CELL
;
auto
*
w
=
new
NwUeSasToRrc
(
NwUeSasToRrc
::
SERVING_CELL_CHANGE
);
w
->
servingCell
=
*
m_servingCell
;
m_base
->
rrcTask
->
push
(
w
);
}
}
// namespace nr::ue
src/ue/sas/measurement.cpp
View file @
2ab318fe
...
...
@@ -53,7 +53,7 @@ void UeSasTask::receiveCellInfoResponse(const sas::SasCellInfoResponse &msg)
meas
.
tac
=
msg
.
tac
;
meas
.
dbm
=
msg
.
dbm
;
meas
.
gnbName
=
msg
.
gnbName
;
meas
.
time
=
utils
::
CurrentTimeMillis
()
;
meas
.
linkIp
=
msg
.
linkIp
;
m_pendingMeasurements
[
meas
.
cellId
]
=
meas
;
}
...
...
src/ue/sas/task.cpp
View file @
2ab318fe
...
...
@@ -17,7 +17,7 @@ namespace nr::ue
{
UeSasTask
::
UeSasTask
(
TaskBase
*
base
)
:
m_base
{
base
},
m_udpTask
{},
m_cellSearchSpace
{},
m_pendingMeasurements
{},
m_activeMeasurements
{}
:
m_base
{
base
},
m_udpTask
{},
m_cellSearchSpace
{},
m_pendingMeasurements
{},
m_activeMeasurements
{}
,
m_servingCell
{}
{
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
m_base
->
config
->
getLoggerPrefix
()
+
"sas"
);
...
...
src/ue/sas/task.hpp
View file @
2ab318fe
...
...
@@ -9,6 +9,7 @@
#pragma once
#include <memory>
#include <optional>
#include <thread>
#include <udp/server_task.hpp>
#include <ue/types.hpp>
...
...
@@ -33,6 +34,8 @@ class UeSasTask : public NtsTask
std
::
unordered_map
<
GlobalNci
,
UeCellMeasurement
>
m_pendingMeasurements
;
std
::
unordered_map
<
GlobalNci
,
UeCellMeasurement
>
m_activeMeasurements
;
std
::
optional
<
UeCellInfo
>
m_servingCell
;
friend
class
UeCmdHandler
;
public:
...
...
src/urs/sas_pdu.cpp
View file @
2ab318fe
...
...
@@ -65,6 +65,8 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream)
stream
.
appendOctet4
(
m
.
dbm
);
stream
.
appendOctet4
(
static_cast
<
int
>
(
m
.
gnbName
.
size
()));
stream
.
appendUtf8
(
m
.
gnbName
);
stream
.
appendOctet4
(
static_cast
<
int
>
(
m
.
linkIp
.
size
()));
stream
.
appendUtf8
(
m
.
linkIp
);
}
}
...
...
@@ -97,6 +99,7 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream)
res
->
tac
=
stream
.
read4I
();
res
->
dbm
=
stream
.
read4I
();
res
->
gnbName
=
stream
.
readUtf8String
(
stream
.
read4I
());
res
->
linkIp
=
stream
.
readUtf8String
(
stream
.
read4I
());
return
res
;
}
...
...
src/urs/sas_pdu.hpp
View file @
2ab318fe
...
...
@@ -48,6 +48,7 @@ struct SasCellInfoResponse : SasMessage
int
tac
{};
int
dbm
{};
std
::
string
gnbName
{};
std
::
string
linkIp
{};
SasCellInfoResponse
()
:
SasMessage
(
SasMessageType
::
CELL_INFO_RESPONSE
)
{
...
...
src/utils/common_types.hpp
View file @
2ab318fe
...
...
@@ -131,13 +131,31 @@ struct GlobalNci
}
};
enum
class
ECellCategory
{
UNDEFINED
,
ACCEPTABLE_CELL
,
SUITABLE_CELL
,
BARRED_CELL
,
RESERVED_CELL
,
};
struct
UeCellMeasurement
{
GlobalNci
cellId
{};
int
tac
{};
int
dbm
{};
std
::
string
gnbName
{};
uint64_t
time
{};
std
::
string
linkIp
{};
};
struct
UeCellInfo
{
GlobalNci
cellId
{};
int
tac
{};
ECellCategory
cellCategory
{};
std
::
string
gnbName
{};
std
::
string
linkIp
{};
};
struct
Vector3
...
...
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