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
7953b27f
Commit
7953b27f
authored
May 18, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
bcf1af2d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
33 deletions
+73
-33
src/ue/nts.hpp
src/ue/nts.hpp
+1
-0
src/ue/rls/task.cpp
src/ue/rls/task.cpp
+6
-0
src/ue/rrc/channel.cpp
src/ue/rrc/channel.cpp
+2
-0
src/ue/rrc/connection.cpp
src/ue/rrc/connection.cpp
+58
-0
src/ue/rrc/handler.cpp
src/ue/rrc/handler.cpp
+0
-31
src/ue/rrc/nas.cpp
src/ue/rrc/nas.cpp
+2
-1
src/ue/rrc/sap.cpp
src/ue/rrc/sap.cpp
+1
-0
src/ue/rrc/task.hpp
src/ue/rrc/task.hpp
+3
-1
No files found.
src/ue/nts.hpp
View file @
7953b27f
...
...
@@ -118,6 +118,7 @@ struct NwUeRrcToRls : NtsMessage
// RRC_PDU_DELIVERY
rrc
::
RrcChannel
channel
{};
uint32_t
pduId
{};
OctetString
pdu
{};
explicit
NwUeRrcToRls
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_RRC_TO_RLS
),
present
(
present
)
...
...
src/ue/rls/task.cpp
View file @
7953b27f
...
...
@@ -91,6 +91,12 @@ void UeRlsTask::onLoop()
break
;
}
case
NwUeRrcToRls
:
:
RRC_PDU_DELIVERY
:
{
auto
*
m
=
new
NwUeRlsToRls
(
NwUeRlsToRls
::
UPLINK_RRC
);
m
->
cellId
=
w
->
cellId
;
m
->
rrcChannel
=
w
->
channel
;
m
->
pduId
=
w
->
pduId
;
m
->
data
=
std
::
move
(
w
->
pdu
);
m_ctlTask
->
push
(
m
);
break
;
}
}
...
...
src/ue/rrc/channel.cpp
View file @
7953b27f
...
...
@@ -94,6 +94,7 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH_Message *msg)
}
auto
*
nw
=
new
NwUeRrcToRls
(
NwUeRrcToRls
::
RRC_PDU_DELIVERY
);
nw
->
cellId
=
cellId
;
nw
->
channel
=
rrc
::
RrcChannel
::
UL_CCCH
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
rlsTask
->
push
(
nw
);
...
...
@@ -109,6 +110,7 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH1_Message *msg)
}
auto
*
nw
=
new
NwUeRrcToRls
(
NwUeRrcToRls
::
RRC_PDU_DELIVERY
);
nw
->
cellId
=
cellId
;
nw
->
channel
=
rrc
::
RrcChannel
::
UL_CCCH1
;
nw
->
pdu
=
std
::
move
(
pdu
);
m_base
->
rlsTask
->
push
(
nw
);
...
...
src/ue/rrc/connection.cpp
0 → 100644
View file @
7953b27f
//
// 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 "task.hpp"
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
#include <ue/nts.hpp>
#include <asn/rrc/ASN_RRC_RRCSetupRequest-IEs.h>
#include <asn/rrc/ASN_RRC_RRCSetupRequest.h>
namespace
nr
::
ue
{
static
ASN_RRC_UL_CCCH_Message
*
ConstructSetupRequest
(
ASN_RRC_InitialUE_Identity_t
initialUeId
,
ASN_RRC_EstablishmentCause_t
establishmentCause
)
{
auto
*
pdu
=
asn
::
New
<
ASN_RRC_UL_CCCH_Message
>
();
pdu
->
message
.
present
=
ASN_RRC_UL_CCCH_MessageType_PR_c1
;
pdu
->
message
.
choice
.
c1
=
asn
::
NewFor
(
pdu
->
message
.
choice
.
c1
);
pdu
->
message
.
choice
.
c1
->
present
=
ASN_RRC_UL_CCCH_MessageType__c1_PR_rrcSetupRequest
;
auto
&
r
=
pdu
->
message
.
choice
.
c1
->
choice
.
rrcSetupRequest
=
asn
::
New
<
ASN_RRC_RRCSetupRequest
>
();
asn
::
DeepCopy
(
asn_DEF_ASN_RRC_InitialUE_Identity
,
initialUeId
,
&
r
->
rrcSetupRequest
.
ue_Identity
);
r
->
rrcSetupRequest
.
establishmentCause
=
establishmentCause
;
asn
::
SetSpareBits
<
1
>
(
r
->
rrcSetupRequest
.
spare
);
return
pdu
;
}
void
UeRrcTask
::
startConnectionSetup
(
OctetString
&&
nasPdu
)
{
// TODO: if it's already in progress
if
(
m_initialId
.
present
==
ASN_RRC_InitialUE_Identity_PR_NOTHING
)
{
m_initialId
.
present
=
ASN_RRC_InitialUE_Identity_PR_randomValue
;
asn
::
SetBitStringLong
<
39
>
(
static_cast
<
int64_t
>
(
utils
::
Random64
()),
m_initialId
.
choice
.
randomValue
);
}
m_initialNasPdu
=
std
::
move
(
nasPdu
);
int
activeCell
=
m_base
->
shCtx
.
currentCell
.
get
<
int
>
([](
auto
&
item
)
{
return
item
.
cellId
;
});
m_logger
->
debug
(
"Sending RRC Setup Request"
);
auto
*
rrcSetupRequest
=
ConstructSetupRequest
(
m_initialId
,
ASN_RRC_EstablishmentCause_mo_Data
);
sendRrcMessage
(
activeCell
,
rrcSetupRequest
);
asn
::
Free
(
asn_DEF_ASN_RRC_UL_CCCH_Message
,
rrcSetupRequest
);
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/rrc/handler.cpp
View file @
7953b27f
...
...
@@ -32,37 +32,6 @@
namespace
nr
::
ue
{
void
UeRrcTask
::
deliverInitialNas
(
OctetString
&&
nasPdu
,
long
establishmentCause
)
{
/*if (m_state != ERrcState::RRC_IDLE)
{
m_logger->warn("Initial NAS delivery while not in RRC_IDLE, treating as uplink delivery");
deliverUplinkNas(std::move(nasPdu));
return;
}
m_logger->debug("Sending RRC Setup Request");
auto *pdu = asn::New<ASN_RRC_UL_CCCH_Message>();
pdu->message.present = ASN_RRC_UL_CCCH_MessageType_PR_c1;
pdu->message.choice.c1 = asn::NewFor(pdu->message.choice.c1);
pdu->message.choice.c1->present = ASN_RRC_UL_CCCH_MessageType__c1_PR_rrcSetupRequest;
m_initialId.present = ASN_RRC_InitialUE_Identity_PR_randomValue;
asn::SetBitStringLong<39>(utils::Random64(), m_initialId.choice.randomValue);
auto &r = pdu->message.choice.c1->choice.rrcSetupRequest = asn::New<ASN_RRC_RRCSetupRequest>();
r->rrcSetupRequest.establishmentCause = establishmentCause;
asn::SetSpareBits<1>(r->rrcSetupRequest.spare);
asn::DeepCopy(asn_DEF_ASN_RRC_InitialUE_Identity, m_initialId, &r->rrcSetupRequest.ue_Identity);
// TODO: Start T300
m_initialNasPdu = std::move(nasPdu);
m_lastSetupReq = ERrcLastSetupRequest::SETUP_REQUEST;
sendRrcMessage(pdu);*/
}
void
UeRrcTask
::
deliverUplinkNas
(
OctetString
&&
nasPdu
)
{
auto
*
pdu
=
asn
::
New
<
ASN_RRC_UL_DCCH_Message
>
();
...
...
src/ue/rrc/nas.cpp
View file @
7953b27f
...
...
@@ -7,6 +7,7 @@
//
#include "task.hpp"
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
#include <ue/nts.hpp>
...
...
@@ -32,7 +33,7 @@ void UeRrcTask::deliverUplinkNas(uint32_t pduId, OctetString &&nasPdu)
}
else
if
(
m_state
==
ERrcState
::
RRC_IDLE
)
{
// TODO
startConnectionSetup
(
std
::
move
(
nasPdu
));
}
}
...
...
src/ue/rrc/sap.cpp
View file @
7953b27f
...
...
@@ -7,6 +7,7 @@
//
#include "task.hpp"
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
#include <ue/nts.hpp>
...
...
src/ue/rrc/task.hpp
View file @
7953b27f
...
...
@@ -75,7 +75,6 @@ class UeRrcTask : public NtsTask
private:
/* Handlers */
void
handleDownlinkRrc
(
int
cellId
,
rrc
::
RrcChannel
channel
,
const
OctetString
&
pdu
);
void
deliverInitialNas
(
OctetString
&&
nasPdu
,
long
establishmentCause
);
void
deliverUplinkNas
(
OctetString
&&
nasPdu
);
void
receiveRrcSetup
(
const
ASN_RRC_RRCSetup
&
msg
);
...
...
@@ -123,6 +122,9 @@ class UeRrcTask : public NtsTask
/* NAS Transport */
void
deliverUplinkNas
(
uint32_t
pduId
,
OctetString
&&
nasPdu
);
/* Connection Control */
void
startConnectionSetup
(
OctetString
&&
nasPdu
);
};
}
// 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