Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
lizhongxiao
OpenXG-RAN
Commits
208ab840
Commit
208ab840
authored
Dec 15, 2023
by
liuxu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add nas signal 231215
parent
be0b5c10
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
227 additions
and
119 deletions
+227
-119
executables/gnbSendToManager_client.c
executables/gnbSendToManager_client.c
+5
-4
executables/sever_manager_py.py
executables/sever_manager_py.py
+8
-8
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+89
-87
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+85
-3
openair2/RRC/NR/rrc_signaling_socket.h
openair2/RRC/NR/rrc_signaling_socket.h
+40
-17
No files found.
executables/gnbSendToManager_client.c
View file @
208ab840
...
...
@@ -17,7 +17,7 @@
#include "../openair2/RRC/NR/rrc_signaling_socket.h"
#define GNBSENDTOMANAGER_MAX_RE_SCHDULE_LEN (sizeof(sim_socket_t))
#define GNBSENDTOMANAGER_MAX_RRC_SIGNALING_LEN (sizeof(sim_rrc_signal
ing
_socket))
#define GNBSENDTOMANAGER_MAX_RRC_SIGNALING_LEN (sizeof(sim_rrc_signal_socket))
#define GNBSENDTOMANAGER_MAX_MEASUREMENT_LEN (sizeof(sim_measurement_t))
sem_t
gnbSendToManager_sem
;
...
...
@@ -73,9 +73,10 @@ void *gnbSendToManager_task(void *args_p)
// printf("message_flag %d\n", message_flag);
if
(
message_flag
==
1
){
// printf("data_len %d rrc_signaling_request_type %d rrc_signaling_type %d \n", sim_rrc_signaling_socket.data_len,
// sim_rrc_signaling_socket.rrc_signaling_request_type, sim_rrc_signaling_socket.rrc_signaling_type);
send_len
=
write
(
sockfd
,
&
sim_rrc_signaling_socket
,
GNBSENDTOMANAGER_MAX_RRC_SIGNALING_LEN
);
// printf("data_len %d rrc_signal_request_type %d rrc_signal_type %d \n", sim_rrc_signal_socket.data_len,
// sim_rrc_signal_socket.rrc_signal_request_type, sim_rrc_signal_socket.rrc_signal_type);
send_len
=
write
(
sockfd
,
&
sim_rrc_signal_socket
,
GNBSENDTOMANAGER_MAX_RRC_SIGNALING_LEN
);
memset
(
&
sim_rrc_signal_socket
,
0
,
sizeof
(
sim_rrc_signal_socket
));
}
else
if
(
message_flag
==
2
){
send_len
=
write
(
sockfd
,
&
sim_socket_manager
,
GNBSENDTOMANAGER_MAX_RE_SCHDULE_LEN
);
...
...
executables/sever_manager_py.py
View file @
208ab840
...
...
@@ -102,15 +102,15 @@ while True:
if
DEBUG_PRINT
:
print
(
"data_len %d message %d"
%
(
data_len
,
message
))
if
(
message
==
1
):
rnti
,
recv_send_flag
,
rrc_signal
ing_type
,
rrc_signaling
_request_type
=
struct
.
unpack
(
"2H2I"
,
data
[
4
:
16
])
rnti
,
recv_send_flag
,
rrc_signal
_type
,
rrc_signal
_request_type
=
struct
.
unpack
(
"2H2I"
,
data
[
4
:
16
])
# if DEBUG_PRINT:
print
(
"rrc_signal
ing_type %d rrc_signaling_request_type %d"
%
(
rrc_signaling_type
,
rrc_signaling
_request_type
))
if
rrc_signal
ing
_request_type
!=
0
:
rrc_data
.
append
([
hex
(
rnti
),
'gNB'
,
rrc_UE_to_gNB
[
rrc_signal
ing
_request_type
-
1
]])
print
(
"Send:UE(rnti:%x), Receive:gNB, RRC signaling:%s"
%
(
rnti
,
rrc_UE_to_gNB
[
rrc_signal
ing
_request_type
-
1
]))
if
rrc_signal
ing
_type
!=
0
:
rrc_data
.
append
([
'gNB'
,
hex
(
rnti
),
rrc_gNB_to_UE
[
rrc_signal
ing
_type
-
1
]])
print
(
"Send:gNB, Receive:UE(rnti:%x), RRC signaling:%s"
%
(
rnti
,
rrc_gNB_to_UE
[
rrc_signal
ing
_type
-
1
]))
print
(
"rrc_signal
_type %d rrc_signal_request_type %d"
%
(
rrc_signal_type
,
rrc_signal
_request_type
))
if
rrc_signal_request_type
!=
0
:
rrc_data
.
append
([
hex
(
rnti
),
'gNB'
,
rrc_UE_to_gNB
[
rrc_signal_request_type
-
1
]])
print
(
"Send:UE(rnti:%x), Receive:gNB, RRC signaling:%s"
%
(
rnti
,
rrc_UE_to_gNB
[
rrc_signal_request_type
-
1
]))
if
rrc_signal_type
!=
0
:
rrc_data
.
append
([
'gNB'
,
hex
(
rnti
),
rrc_gNB_to_UE
[
rrc_signal_type
-
1
]])
print
(
"Send:gNB, Receive:UE(rnti:%x), RRC signaling:%s"
%
(
rnti
,
rrc_gNB_to_UE
[
rrc_signal_type
-
1
]))
# print(rrc_data)
elif
(
message
==
3
):
rnti
,
dl_recv_bytes_high16
,
dl_recv_bytes_low16
,
ul_recv_bytes_high16
,
ul_recv_bytes_low16
,
\
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
208ab840
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
208ab840
...
...
@@ -72,6 +72,8 @@
#include "RRC/NR/rrc_gNB_radio_bearers.h"
#include "uper_encoder.h"
#include "rrc_signaling_socket.h"
#include "executables/nr-softmodem-common.h"
extern
RAN_CONTEXT_t
RC
;
...
...
@@ -436,6 +438,16 @@ int rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, instance_t
void
rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
)
//------------------------------------------------------------------------------
{
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
nas_to_rrc_signal_type
=
RRC_DefaultReconf_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
MessageDef
*
msg_p
=
NULL
;
int
pdu_sessions_done
=
0
;
int
pdu_sessions_failed
=
0
;
...
...
@@ -598,7 +610,15 @@ int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mu
protocol_ctxt_t
ctxt
=
{
0
};
ngap_downlink_nas_t
*
req
=
&
NGAP_DOWNLINK_NAS
(
msg_p
);
rrc_gNB_ue_context_t
*
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
instance
],
req
->
gNB_ue_ngap_id
);
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
nas_to_rrc_signal_type
=
RRC_DlInformationTransfer_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_p
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
if
(
ue_context_p
==
NULL
)
{
/* Can not associate this message to an UE index, send a failure to NGAP and discard it! */
MessageDef
*
msg_fail_p
;
...
...
@@ -646,7 +666,15 @@ rrc_gNB_send_NGAP_UPLINK_NAS(
MessageDef
*
msg_p
;
NR_ULInformationTransfer_t
*
ulInformationTransfer
=
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ulInformationTransfer
;
gNB_RRC_UE_t
*
UE
=
&
ue_context_pP
->
ue_context
;
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
rrc_to_nas_signal_type
=
RRC_UlInformationTransfer_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
if
(
ulInformationTransfer
->
criticalExtensions
.
present
==
NR_ULInformationTransfer__criticalExtensions_PR_ulInformationTransfer
)
{
NR_DedicatedNAS_Message_t
*
nas
=
ulInformationTransfer
->
criticalExtensions
.
choice
.
ulInformationTransfer
->
dedicatedNAS_Message
;
uint8_t
*
buf
=
malloc
(
nas
->
size
);
...
...
@@ -673,6 +701,16 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
)
//------------------------------------------------------------------------------
{
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
nas_to_rrc_signal_type
=
RRC_PduSessionEstablish_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
MessageDef
*
msg_p
;
int
pdu_sessions_done
=
0
;
int
pdu_sessions_failed
=
0
;
...
...
@@ -746,7 +784,15 @@ void rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(MessageDef *msg_p, instance_t ins
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
0
,
GNB_FLAG_YES
,
UE
->
rnti
,
0
,
0
,
0
);
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
ctxt
.
module_id
];
LOG_I
(
NR_RRC
,
"[gNB %ld] gNB_ue_ngap_id %u
\n
"
,
instance
,
msg
->
gNB_ue_ngap_id
);
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
rrc_to_nas_signal_type
=
RRC_PduSessionSetupRequest_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_p
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
if
(
ue_context_p
==
NULL
)
{
MessageDef
*
msg_fail_p
=
NULL
;
LOG_W
(
NR_RRC
,
"[gNB %ld] In NGAP_PDUSESSION_SETUP_REQ: unknown UE from NGAP ids (%u)
\n
"
,
instance
,
msg
->
gNB_ue_ngap_id
);
...
...
@@ -949,6 +995,15 @@ int rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(MessageDef *msg_p, instance_t ins
// TO implement return setup failed
return
(
-
1
);
}
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
rrc_to_nas_signal_type
=
RRC_PduSessionModifyRequest_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_p
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
gNB_RRC_UE_t
*
UE
=
&
ue_context_p
->
ue_context
;
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
GNB_FLAG_YES
,
UE
->
rrc_ue_id
,
0
,
0
);
ctxt
.
eNB_index
=
0
;
...
...
@@ -1021,6 +1076,15 @@ rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(
)
//------------------------------------------------------------------------------
{
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
nas_to_rrc_signal_type
=
RRC_PduSessionModify_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
MessageDef
*
msg_p
=
NULL
;
uint8_t
pdu_sessions_failed
=
0
;
uint8_t
pdu_sessions_done
=
0
;
...
...
@@ -1108,6 +1172,15 @@ void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(const module_id_t gnb_mod_idP, con
if
(
ue_context_pP
==
NULL
)
{
LOG_E
(
RRC
,
"[gNB] In NGAP_UE_CONTEXT_RELEASE_REQ: invalid UE
\n
"
);
}
else
{
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
rrc_to_nas_signal_type
=
RRC_PduSessionReleaseRequest_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
const
gNB_RRC_UE_t
*
UE
=
&
ue_context_pP
->
ue_context
;
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
0
,
NGAP_UE_CONTEXT_RELEASE_REQ
);
ngap_ue_release_req_t
*
req
=
&
NGAP_UE_CONTEXT_RELEASE_REQ
(
msg
);
...
...
@@ -1243,6 +1316,15 @@ rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(
)
//------------------------------------------------------------------------------
{
pthread_mutex_lock
(
&
sim_mutex_socket
);
message_flag
=
1
;
sim_rrc_signal_socket
.
data_len
=
sizeof
(
sim_rrc_signal_socket
);
sim_rrc_signal_socket
.
nas_to_rrc_signal_type
=
RRC_PduSessionRelease_manager
;
sim_rrc_signal_socket
.
recv_send_flag
=
0
;
sim_rrc_signal_socket
.
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
sim_rrc_signal_socket
.
message
=
1
;
pthread_mutex_unlock
(
&
sim_mutex_socket
);
sem_post
(
&
gnbSendToManager_sem
);
int
pdu_sessions_released
=
0
;
MessageDef
*
msg_p
;
gNB_RRC_UE_t
*
UE
=
&
ue_context_pP
->
ue_context
;
...
...
openair2/RRC/NR/rrc_signaling_socket.h
View file @
208ab840
...
...
@@ -8,26 +8,46 @@ typedef enum{
RRC_SetupComplete_manager
,
RRC_MeasurementReport_manager
,
RRC_ReestablishmentComplete_manager
,
RRC_ulInformationTransfer_manager
,
RRC_securityModeComplete_manager
,
RRC_securityModeFailure_manager
,
RRC_ueCapabilityInformation_manager
RRC_SecurityModeComplete_manager
,
RRC_SecurityModeFailure_manager
,
RRC_UeCapabilityInformation_manager
,
RRC_ResumeRequest_manager
,
RRC_SystemInfoRequest_manager
,
RRC_ResumeComplete_manager
,
RRC_LocationMeasurementIndication_manager
,
RRC_CounterCheckResponse_manager
,
RRC_UeAssistanceInformation_manager
,
RRC_FailureInformation_manager
,
RRC_UlInformationTransferMRDC_manager
,
RRC_ScgFailureInformation_manager
,
RRC_ScgFailureInformationEUTRA_manager
}
rrc_sigaling_fromUE_t
;
}
rrc_signal_fromUE_t
;
typedef
enum
{
RRC_UlInformationTransfer_manager
=
1
,
RRC_PduSessionSetupRequest_manager
,
RRC_PduSessionModifyRequest_manager
,
RRC_PduSessionReleaseRequest_manager
,
}
rrc_to_nas_signal_t
;
typedef
enum
{
RRC_DlInformationTransfer_manager
=
1
,
RRC_DefaultReconf_manager
,
RRC_DedicatedReconf_manager
,
RRC_PduSessionEstablish_manager
,
RRC_PduSessionModify_manager
,
RRC_PduSessionRelease_manager
,
RRC_ReestablishComplete_manager
}
nas_to_rrc_signal_t
;
typedef
enum
{
RRC_Reject_manager
=
1
,
RRC_S
ETUP
_manager
,
RRC_S
etup
_manager
,
RRC_Reestablishment_manager
,
RRC_REESTABLISH_COMPLETE_manager
,
RRC_DEFAULT_RECONF_manager
,
RRC_DEDICATED_RECONF_manager
,
RRC_PDUSESSION_ESTABLISH_manager
,
RRC_PDUSESSION_MODIFY_manager
,
RRC_PDUSESSION_RELEASE_manager
,
RRC_UECapabilityEnquiry_manager
RRC_UeCapabilityEnquiry_manager
}
rrc_sig
aling
_fromgNB_t
;
}
rrc_sig
nal
_fromgNB_t
;
typedef
struct
{
uint16_t
data_len
;
...
...
@@ -38,13 +58,16 @@ typedef struct {
/*0 represents recv(UE->GNB), 1 represents send(GNB->UE)*/
uint16_t
recv_send_flag
;
/*rrc sigaling type*/
rrc_sig
aling_fromgNB_t
rrc_signaling
_type
;
rrc_sig
nal_fromgNB_t
rrc_signal
_type
;
/*rrc sigaling request type*/
rrc_sigaling_fromUE_t
rrc_signaling_request_type
;
rrc_signal_fromUE_t
rrc_signal_request_type
;
/*rrc nas*/
rrc_to_nas_signal_t
rrc_to_nas_signal_type
;
nas_to_rrc_signal_t
nas_to_rrc_signal_type
;
}
sim_rrc_t
;
extern
sim_rrc_t
sim_rrc_signal
ing
_socket
;
extern
sim_rrc_t
sim_rrc_signal_socket
;
...
...
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