From e3da2ca252021348d4131fabcd951c5fae9b580a Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 28 Sep 2022 10:56:12 +0200 Subject: [PATCH 01/48] removing pucch-ResourceCommon from dedicated BWP --- openair2/RRC/NR/nr_rrc_config.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index deb2c4965e..9a67d56184 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -1048,7 +1048,14 @@ void config_uplinkBWP(NR_BWP_Uplink_t *ubwp, ubwp->bwp_Common->rach_ConfigCommon = is_SA ? NULL : scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon; ubwp->bwp_Common->pusch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon; - ubwp->bwp_Common->pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon; + ubwp->bwp_Common->pucch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PUCCH_ConfigCommon)); + ubwp->bwp_Common->pucch_ConfigCommon->present= NR_SetupRelease_PUCCH_ConfigCommon_PR_setup; + ubwp->bwp_Common->pucch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUCCH_ConfigCommon)); + struct NR_PUCCH_ConfigCommon *pucch_ConfigCommon = ubwp->bwp_Common->pucch_ConfigCommon->choice.setup; + pucch_ConfigCommon->pucch_ResourceCommon = NULL; // for BWP != 0 as per 38.213 section 9.2.1 + pucch_ConfigCommon->pucch_GroupHopping = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping; + pucch_ConfigCommon->hoppingId = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId; + pucch_ConfigCommon->p0_nominal = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal; if (!ubwp->bwp_Dedicated) { ubwp->bwp_Dedicated = calloc(1,sizeof(*ubwp->bwp_Dedicated)); From 8b3322403a85be158d56a96133f716bca22ecf21 Mon Sep 17 00:00:00 2001 From: mir Date: Tue, 4 Oct 2022 09:25:08 +0200 Subject: [PATCH 02/48] OAI UE Mode complete ciphering bug --- openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c | 16 +++++++++++----- openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h | 14 ++++++++++++++ openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 1 + openair2/LAYER2/nr_pdcp/nr_pdcp_security_nea2.c | 3 +-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c index 2c853d8eb6..182f4c385f 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c @@ -111,13 +111,12 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity, entity->rb_id, rcvd_count, entity->is_gnb ? 0 : 1); if (entity->has_integrity) { - unsigned char integrity[4]; + unsigned char integrity[4] = {0}; entity->integrity(entity->integrity_context, integrity, buffer, size - integrity_size, entity->rb_id, rcvd_count, entity->is_gnb ? 0 : 1); if (memcmp(integrity, buffer + size - integrity_size, 4) != 0) { LOG_E(PDCP, "discard NR PDU, integrity failed\n"); -// return; entity->stats.rxpdu_dd_pkts++; entity->stats.rxpdu_dd_bytes += size; @@ -220,20 +219,27 @@ static void nr_pdcp_entity_recv_sdu(nr_pdcp_entity_t *entity, memcpy(buf + header_size, buffer, size); - if (entity->has_integrity) + if (entity->has_integrity){ + uint8_t integrity[4] = {0}; entity->integrity(entity->integrity_context, - (unsigned char *)buf + header_size + size, + integrity, (unsigned char *)buf, header_size + size, entity->rb_id, count, entity->is_gnb ? 1 : 0); + memcpy((unsigned char *)buf + header_size + size, integrity, 4); + } + // set MAC-I to 0 for SRBs with integrity not active else if (integrity_size == 4) memset(buf + header_size + size, 0, 4); - if (entity->has_ciphering) + if (entity->has_ciphering && (entity->is_gnb || entity->security_mode_completed)){ entity->cipher(entity->security_context, (unsigned char *)buf + header_size, size + integrity_size, entity->rb_id, count, entity->is_gnb ? 1 : 0); + } else { + entity->security_mode_completed = true; + } entity->tx_next++; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h index 19445887f4..302ea8f0be 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h @@ -22,6 +22,7 @@ #ifndef _NR_PDCP_ENTITY_H_ #define _NR_PDCP_ENTITY_H_ +#include #include #include "nr_pdcp_sdu.h" @@ -149,6 +150,19 @@ typedef struct nr_pdcp_entity_t { int rx_size; int rx_maxsize; nr_pdcp_statistics_t stats; + + // WARNING: This is a hack! + // 3GPP TS 38.331 (RRC) version 15.3 + // Section 5.3.4.3 Reception of the SecurityModeCommand by the UE + // The UE needs to send the Security Mode Complete message. However, the message + // needs to be sent without being ciphered. + // However: + // 1- The Security Mode Command arrives to the UE with the cipher algo (e.g., nea2). + // 2- The UE is configured with the cipher algo. + // 3- The Security Mode Complete message is sent to the itti task queue. + // 4- The ITTI task, forwards the message ciphering (e.g., nea2) it. + // 5- The gNB cannot understand the ciphered Security Mode Complete message. + bool security_mode_completed; } nr_pdcp_entity_t; nr_pdcp_entity_t *new_nr_pdcp_entity( diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index ece0b0274d..81b5e5e8ac 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -1267,6 +1267,7 @@ void pdcp_config_set_security( ciphering_algorithm = security_modeP & 0x0f; rb->set_security(rb, integrity_algorithm, (char *)kRRCint_pP, ciphering_algorithm, (char *)kRRCenc_pP); + rb->security_mode_completed = false; } else { LOG_E(PDCP, "%s:%d:%s: TODO\n", __FILE__, __LINE__, __FUNCTION__); exit(1); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_security_nea2.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_security_nea2.c index 52afe95673..a7479a5032 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_security_nea2.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_security_nea2.c @@ -54,14 +54,13 @@ void nr_pdcp_security_nea2_cipher(void *security_context, unsigned char *buffer, int length, int bearer, int count, int direction) { - unsigned char t[16]; + unsigned char t[16] = {0}; t[0] = (count >> 24) & 255; t[1] = (count >> 16) & 255; t[2] = (count >> 8) & 255; t[3] = (count ) & 255; t[4] = ((bearer-1) << 3) | (direction << 2); - memset(&t[5], 0, 16-5); nettle_ctr_crypt(security_context, nettle_aes128.encrypt, nettle_aes128.block_size, t, From e50ce393c39024c76c5887f6cf29978f83b1cecd Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 13:24:33 +0200 Subject: [PATCH 03/48] PSEA - Initialization of PduSessionEstablishmentAccept message capture --- CMakeLists.txt | 1 + .../ESM/MSG/PduSessionEstablishmentAccept.c | 23 ++++++++++++++++ .../ESM/MSG/PduSessionEstablishmentAccept.h | 27 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c create mode 100644 openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 06184ac619..d3fd4b4a2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2383,6 +2383,7 @@ set(libnrnas_emm_msg_OBJS ${NAS_SRC}COMMON/EMM/MSG/RegistrationComplete.c ${NAS_SRC}COMMON/EMM/MSG/FGSUplinkNasTransport.c ${NAS_SRC}COMMON/ESM/MSG/PduSessionEstablishRequest.c + ${NAS_SRC}COMMON/ESM/MSG/PduSessionEstablishmentAccept.c ) set(libnrnas_ies_OBJS diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c new file mode 100644 index 0000000000..aef93a6632 --- /dev/null +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -0,0 +1,23 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#include "PduSessionEstablishmentAccept.h" +#include "common/utils/LOG/log.h" \ No newline at end of file diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h new file mode 100644 index 0000000000..7fd4006fef --- /dev/null +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -0,0 +1,27 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#ifndef PDU_SESSION_ESTABLISHMENT_ACCEPT_H_ +#define PDU_SESSION_ESTABLISHMENT_ACCEPT_H_ + +#include + +#endif \ No newline at end of file From e057c85e60b49de47d4b598c03cf8d5f34be0176 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 13:33:25 +0200 Subject: [PATCH 04/48] PSEA - Macros for Optional IE Identifiers --- .../COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 7fd4006fef..bb5bc9304c 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -24,4 +24,17 @@ #include +/* PDU Session Establish Accept Optional IE Identifiers - TS 24.501 Table 8.3.2.1.1 */ + +#define IEI_5GSM_CAUSE 0x59 /* 5GSM cause 9.11.4.2 */ +#define IEI_PDU_ADDRESS 0x29 /* PDU address 9.11.4.10 */ +#define IEI_RQ_TIMER_VALUE 0x56 /* GPRS timer 9.11.2.3 */ +#define IEI_SNSSAI 0x22 /* S-NSSAI 9.11.2.8 */ +#define IEI_ALWAYSON_PDU 0x80 /* Always-on PDU session indication 9.11.4.3 */ +#define IEI_MAPPED_EPS 0x75 /* Mapped EPS bearer contexts 9.11.4.8 */ +#define IEI_EAP_MSG 0x78 /* EAP message 9.11.2.2 */ +#define IEI_AUTH_QOS_DESC 0x79 /* QoS flow descriptions 9.11.4.12 */ +#define IEI_EXT_CONF_OPT 0x7b /* Extended protocol configuration options 9.11.4.6 */ +#define IEI_DNN 0x25 /* DNN 9.11.2.1B */ + #endif \ No newline at end of file From 34e50a2fdf8e865e287df2e46ecbaf41376843ba Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 13:34:47 +0200 Subject: [PATCH 05/48] PSEA - Macros for PDU Session type values --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index bb5bc9304c..83a1a641b9 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -37,4 +37,10 @@ #define IEI_EXT_CONF_OPT 0x7b /* Extended protocol configuration options 9.11.4.6 */ #define IEI_DNN 0x25 /* DNN 9.11.2.1B */ +/* PDU Session type value - TS 24.501 Table 9.11.4.10.1*/ + +#define PDU_SESSION_TYPE_IPV4 0b001 +#define PDU_SESSION_TYPE_IPV6 0b010 +#define PDU_SESSION_TYPE_IPV4V6 0b011 + #endif \ No newline at end of file From 92e01d8346c2028d24028f84a611ed9b0018fb1f Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 13:40:48 +0200 Subject: [PATCH 06/48] PSEA - Macros for Rule Operation Codes --- .../COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 83a1a641b9..b95ee1b43e 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -43,4 +43,15 @@ #define PDU_SESSION_TYPE_IPV6 0b010 #define PDU_SESSION_TYPE_IPV4V6 0b011 +/* Rule operation codes - TS 24.501 Table 9.11.4.13.1 */ + +#define ROC_RESERVED_0 0b000 /* Reserved */ +#define ROC_CREATE_NEW_QOS_RULE 0b001 /* Create new QoS rule */ +#define ROC_DELETE_QOS_RULE 0b010 /* Delete existing QoS rule */ +#define ROC_MODIFY_QOS_RULE_ADD_PF 0b011 /* Modify existing QoS rule and add packet filters */ +#define ROC_MODIFY_QOS_RULE_REPLACE_PF 0b100 /* Modify existing QoS rule and replace all packet filters */ +#define ROC_MODIFY_QOS_RULE_DELETE_PF 0b101 /* Modify existing QoS rule and delete packet filters */ +#define ROC_MODIFY_QOS_RULE_WITHOUT_PF 0b110 /* Modify existing QoS rule without modifying packet filters */ +#define ROC_RESERVED_1 0b111 /* Reserved */ + #endif \ No newline at end of file From ff059d76077b7fd3c38c999504fb3daf6dba83f0 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:01:22 +0200 Subject: [PATCH 07/48] PSEA - Macro for DNN ASCII --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index b95ee1b43e..bd5c459640 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -54,4 +54,8 @@ #define ROC_MODIFY_QOS_RULE_WITHOUT_PF 0b110 /* Modify existing QoS rule without modifying packet filters */ #define ROC_RESERVED_1 0b111 /* Reserved */ +/* DNN - ASCII Codes */ + +#define ASCII_ACK 0x06 /* Delimiter in the DNN IEI */ + #endif \ No newline at end of file From b3abb8f64f5123c9ade2e64d282e69adea8f7d7c Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:11:50 +0200 Subject: [PATCH 08/48] PSEA - Mandatory Presence IE --- .../ESM/MSG/PduSessionEstablishmentAccept.h | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index bd5c459640..bc71ac846e 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -58,4 +58,45 @@ #define ASCII_ACK 0x06 /* Delimiter in the DNN IEI */ +/* Mandatory Presence IE - TS 24.501 Table 8.3.2.1.1 */ + +typedef struct packet_filter_create_qos_rule_s { + uint8_t pf_dir; /* Packet filter direction */ + uint8_t pf_id; /* Packet filter identifier */ + uint8_t length; /* Length of packet filter contents */ +} packet_filter_type1_t; /* TS 24.501 Figure 9.11.4.13.3 */ + +typedef struct packet_filter_modify_qos_rule_s { + uint8_t pf_id; /* Packet filter identifier */ +} packet_filter_type2_t; /* TS 24.501 Figure 9.11.4.13.4 */ + +typedef struct packet_filter_s { + union pf_type { + packet_filter_type1_t type_1; + packet_filter_type2_t type_2; + } pf_type; +} packet_filter_t; + +typedef struct qos_rule_s { + uint8_t id; /* QoS rule identifier */ + uint16_t length; /* Length of QoS Rule */ + uint8_t oc; /* Rule operation code (3bits) */ + uint8_t dqr; /* DQR bit (1 bit) */ + uint8_t nb_pf; /* Number of packet filters (4 bits) */ + uint8_t prcd; /* QoS rule precedence */ + uint8_t qfi; /* QoS Flow Identifier */ +} qos_rule_t; + +typedef struct auth_qos_rules_s { + uint16_t length; /* Length of QoS rules IE */ +} auth_qos_rule_t; /* QoS Rule as defined in 24.501 Figure 9.11.4.13.2 */ + +typedef struct session_ambr_s { + uint8_t length; /* Length of Session-AMBR contents */ + uint8_t unit_dl; /* Unit for Session-AMBR for downlink */ + uint16_t sess_dl; /* Session-AMBR for downlink */ + uint8_t unit_ul; /* Unit for Session-AMBR for uplink */ + uint16_t sess_ul; /* Session-AMBR for uplink */ +} session_ambr_t; /* TS 24.501 Figure 9.11.4.14.1 */ + #endif \ No newline at end of file From 724164c3954cc64a04f80ee3c2f8d7c1e3d6f862 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:14:53 +0200 Subject: [PATCH 09/48] PSEA - Optional Presence IE --- .../ESM/MSG/PduSessionEstablishmentAccept.h | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index bc71ac846e..27565f5bf0 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -99,4 +99,29 @@ typedef struct session_ambr_s { uint16_t sess_ul; /* Session-AMBR for uplink */ } session_ambr_t; /* TS 24.501 Figure 9.11.4.14.1 */ +/* Optional Presence IE - TS 24.501 Table 8.3.2.1.1 */ + +typedef struct pdu_address_s { + uint8_t pdu_iei; /* PDU Address IEI (0x29) */ + uint8_t pdu_length; /* Length of PDU address contents */ + uint8_t pdu_type; /* PDU session type value */ + uint8_t pdu_addr_oct1; /* PDU address information (1st Octet)*/ + uint8_t pdu_addr_oct2; /* PDU address information (2nd Octet)*/ + uint8_t pdu_addr_oct3; /* PDU address information (3rd Octet)*/ + uint8_t pdu_addr_oct4; /* PDU address information (4th Octet)*/ +} pdu_address_t; /* TS 24.501 9.11.4.10 */ + +typedef struct dnn_s { + uint8_t dnn_iei; /* DNN IEI (0x25) */ + uint8_t dnn_length; /* Length of DNN contents */ +} dnn_t; /* TS 24.501 9.11.2.1A */ + +typedef struct ext_pP_t { + uint16_t length; +} ext_pP_t; /* TS 24.008 10.5.6.3A - Ommited, only length is processed*/ + +typedef struct qos_fd_s { + uint16_t length; +} qos_fd_t; /* TS 24.501 9.11.4.12 - Ommited, only length is processed*/ + #endif \ No newline at end of file From 9682ba9bf669a7efec37cfdc05300ac0f68a5065 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:17:16 +0200 Subject: [PATCH 10/48] PSEA - Message struct definition --- .../ESM/MSG/PduSessionEstablishmentAccept.h | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 27565f5bf0..63a57cb229 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -124,4 +124,37 @@ typedef struct qos_fd_s { uint16_t length; } qos_fd_t; /* TS 24.501 9.11.4.12 - Ommited, only length is processed*/ +typedef struct pdu_session_establishment_accept_msg_s { + /* Mandatory presence */ + uint8_t epd; /* Extended Protocol Discriminator */ + uint8_t pdu_id; /* PDU Session ID */ + uint8_t pti; /* Procedure Transaction Identity */ + uint8_t msg_type; /* Message Type */ + uint8_t pdu_type; /* PDU Session Type */ + uint8_t ssc_mode; /* SSC mode */ + auth_qos_rule_t qos_rules; /* Authorized QoS rules */ + session_ambr_t sess_ambr; /* Session-AMBR */ + + /* Optional presence */ + dnn_t dnn_ie; /* Data Network Name */ + pdu_address_t pdu_addr_ie; /* PDU Address */ + ext_pP_t ext_pp_ie; /* Extended Protocol Configuration Options */ + qos_fd_t qos_fd_ie; /* QoS flow descriptions */ +} pdu_session_establishment_accept_msg_t; /* 24.501 Table 8.3.2.1.1 */ + +typedef struct security_protected_plain_nas_5gs_msg_s { + uint8_t epd; /* Extended Protocol Discriminator */ + uint8_t sht; /* Security Header Type */ + uint8_t msg_type; /* Message Type */ + uint8_t payload_type; /* Payload Container Type */ + uint16_t payload_len; /* Payload Container Length */ +} security_protected_plain_nas_5gs_msg_t; + +typedef struct security_protected_nas_5gs_msg_s { + uint8_t epd; /* Extended Protocol Discriminator */ + uint8_t sht; /* Security Header Type */ + uint32_t mac; /* Message Authentication Code */ + uint8_t sqn; /* Sequence Number */ +} security_protected_nas_5gs_msg_t; /* 24.501 Figure 9.1.1.2 */ + #endif \ No newline at end of file From e638715dcc5883419a5bc9c7d112d051712cc400 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:20:34 +0200 Subject: [PATCH 11/48] PSEA - Include the PSEA header file to NAS --- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 2b2d9b08a5..378ca3d848 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -38,6 +38,7 @@ #include "aka_functions.h" #include "secu_defs.h" #include "PduSessionEstablishRequest.h" +#include "PduSessionEstablishmentAccept.h" #include "intertask_interface.h" #include "openair2/RRC/NAS/nas_config.h" #include From 4148e5aae66f29525decd101f1228712a4604ead Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:30:31 +0200 Subject: [PATCH 12/48] PSEA - Init capture function --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 6 +++++- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index aef93a6632..d0b90d6f4c 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -20,4 +20,8 @@ */ #include "PduSessionEstablishmentAccept.h" -#include "common/utils/LOG/log.h" \ No newline at end of file +#include "common/utils/LOG/log.h" + +void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_length){ + return; +} \ No newline at end of file diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 63a57cb229..94a523285b 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -157,4 +157,6 @@ typedef struct security_protected_nas_5gs_msg_s { uint8_t sqn; /* Sequence Number */ } security_protected_nas_5gs_msg_t; /* 24.501 Figure 9.1.1.2 */ +void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_length); + #endif \ No newline at end of file From 0f1d68e2e38816a0e5a876e05ec846b6dc9b5afb Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:32:29 +0200 Subject: [PATCH 13/48] PSEA - Include necessary NAS header files --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index d0b90d6f4c..1ff1bb0614 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -21,6 +21,8 @@ #include "PduSessionEstablishmentAccept.h" #include "common/utils/LOG/log.h" +#include "nr_nas_msg_sim.h" +#include "openair2/RRC/NAS/nas_config.h" void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_length){ return; From 7a5e38399346390ec8d5465f3fe5f0aee5dcce89 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:37:44 +0200 Subject: [PATCH 14/48] PSEA - Capture - Security Protected NAS header & message --- .../ESM/MSG/PduSessionEstablishmentAccept.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 1ff1bb0614..5690f131ba 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -25,5 +25,21 @@ #include "openair2/RRC/NAS/nas_config.h" void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_length){ + uint8_t offset = 0; + security_protected_nas_5gs_msg_t sec_nas_hdr; + security_protected_plain_nas_5gs_msg_t sec_nas_msg; + pdu_session_establishment_accept_msg_t psea_msg; + sec_nas_hdr.epd = *(buffer + (offset++)); + sec_nas_hdr.sht = *(buffer + (offset++)); + sec_nas_hdr.mac = htonl(*(uint32_t *)(buffer + offset)); + offset+=sizeof(sec_nas_hdr.mac); + sec_nas_hdr.sqn = *(buffer + (offset++)); + sec_nas_msg.epd = *(buffer + (offset++)); + sec_nas_msg.sht = *(buffer + (offset++)); + sec_nas_msg.msg_type = *(buffer + (offset++)); + sec_nas_msg.payload_type = *(buffer + (offset++)); + sec_nas_msg.payload_len = htons(*(uint16_t *)(buffer + offset)); + offset+=sizeof(sec_nas_msg.payload_len); + return; } \ No newline at end of file From fbe010420c53b407989db69a3c7143a8c1180453 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:40:02 +0200 Subject: [PATCH 15/48] PSEA - Capture - PduSessionEstablishmentAccept message --- .../NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 5690f131ba..9e03b37299 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -40,6 +40,15 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng sec_nas_msg.payload_type = *(buffer + (offset++)); sec_nas_msg.payload_len = htons(*(uint16_t *)(buffer + offset)); offset+=sizeof(sec_nas_msg.payload_len); + /* Mandatory Presence IEs */ + psea_msg.epd = *(buffer + (offset++)); + psea_msg.pdu_id = *(buffer + (offset++)); + psea_msg.pti = *(buffer + (offset++)); + psea_msg.msg_type = *(buffer + (offset++)); + psea_msg.pdu_type = *(buffer + offset) & 0x0f; + psea_msg.ssc_mode = (*(buffer + (offset++)) & 0xf0) >> 4; + psea_msg.qos_rules.length = htons(*(uint16_t *)(buffer + offset)); + offset+=sizeof(psea_msg.qos_rules.length); return; } \ No newline at end of file From 352362ac975315acbfbf964a8dc8222d3a9308a8 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:46:05 +0200 Subject: [PATCH 16/48] PSEA - Capture - Authorized QoS Rules, but Ommit the Packet Filters --- .../ESM/MSG/PduSessionEstablishmentAccept.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 9e03b37299..96851c974f 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -49,6 +49,33 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng psea_msg.ssc_mode = (*(buffer + (offset++)) & 0xf0) >> 4; psea_msg.qos_rules.length = htons(*(uint16_t *)(buffer + offset)); offset+=sizeof(psea_msg.qos_rules.length); + /* Supports the capture of only one QoS Rule, + it should be changed for multiple QoS Rules */ + qos_rule_t qos_rule; + qos_rule.id = *(buffer + (offset++)); + qos_rule.length = htons(*(uint16_t *)(buffer + offset)); + offset+=sizeof(qos_rule.length); + qos_rule.oc = (*(buffer + offset) & 0xE0) >> 5; + qos_rule.dqr = (*(buffer + offset) & 0x10) >> 4; + qos_rule.nb_pf = *(buffer + (offset++)) & 0x0F; + + if(qos_rule.nb_pf) { + packet_filter_t pf; + + if(qos_rule.oc == ROC_CREATE_NEW_QOS_RULE || + ROC_MODIFY_QOS_RULE_ADD_PF || + ROC_MODIFY_QOS_RULE_REPLACE_PF) { + pf.pf_type.type_1.pf_dir = (*(buffer + offset) & 0x30) >> 4; + pf.pf_type.type_1.pf_id = *(buffer + offset++) & 0x0F; + pf.pf_type.type_1.length = *(buffer + offset++); + offset += (qos_rule.nb_pf * pf.pf_type.type_1.length); /* Ommit the Packet filter List */ + } else if (qos_rule.oc == ROC_MODIFY_QOS_RULE_DELETE_PF) { + offset += qos_rule.nb_pf; + } + } + + qos_rule.prcd = *(buffer + offset++); + qos_rule.qfi = *(buffer + offset++); return; } \ No newline at end of file From d9958e4e0f2582f7c8466ceab01e5eb5ff90fda2 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:48:13 +0200 Subject: [PATCH 17/48] PSEA - Capture - Session AMBR (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 96851c974f..c958f6d326 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -76,6 +76,8 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng qos_rule.prcd = *(buffer + offset++); qos_rule.qfi = *(buffer + offset++); + psea_msg.sess_ambr.length = *(buffer + offset++); + offset += psea_msg.sess_ambr.length; /* Ommit the Seassion-AMBR */ return; } \ No newline at end of file From 21c4415a37189cedd8c722c2f91d0bf9a4b38889 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:53:45 +0200 Subject: [PATCH 18/48] PSEA - Prepare the Optional Presence IE capture --- .../ESM/MSG/PduSessionEstablishmentAccept.c | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index c958f6d326..d921b2a956 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -79,5 +79,36 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng psea_msg.sess_ambr.length = *(buffer + offset++); offset += psea_msg.sess_ambr.length; /* Ommit the Seassion-AMBR */ + /* Optional Presence IEs */ + uint8_t psea_iei = *(buffer + offset++); + + while(offset < msg_length) { + switch (psea_iei) { + case IEI_5GSM_CAUSE: /* Ommited */ + break; + case IEI_PDU_ADDRESS: + break; + case IEI_RQ_TIMER_VALUE: /* Ommited */ + break; + case IEI_SNSSAI: /* Ommited */ + break; + case IEI_ALWAYSON_PDU: /* Ommited */ + break; + case IEI_MAPPED_EPS: /* Ommited */ + break; + case IEI_EAP_MSG: /* Ommited */ + break; + case IEI_AUTH_QOS_DESC: /* Ommited */ + break; + case IEI_EXT_CONF_OPT: /* Ommited */ + break; + case IEI_DNN: + break; + + default: + break; + } + } + return; } \ No newline at end of file From 3fee83e05b6ae509251f3f837149d9f1a5bb1ac1 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:56:17 +0200 Subject: [PATCH 19/48] PSEA - Capture - Position of 5GSM Cause (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index d921b2a956..833d763b29 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -85,7 +85,10 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng while(offset < msg_length) { switch (psea_iei) { case IEI_5GSM_CAUSE: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received 5GSM Cause IEI\n"); + offset++; break; + case IEI_PDU_ADDRESS: break; case IEI_RQ_TIMER_VALUE: /* Ommited */ From d355b1a7f2d1177e6bf14f775816a0dd0874c195 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:57:46 +0200 Subject: [PATCH 20/48] PSEA - Capture - PDU Address IE --- .../ESM/MSG/PduSessionEstablishmentAccept.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 833d763b29..77aa413735 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -24,6 +24,8 @@ #include "nr_nas_msg_sim.h" #include "openair2/RRC/NAS/nas_config.h" +extern char *baseNetAddress; + void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_length){ uint8_t offset = 0; security_protected_nas_5gs_msg_t sec_nas_hdr; @@ -90,7 +92,30 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_PDU_ADDRESS: + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received PDU Address IE\n"); + psea_msg.pdu_addr_ie.pdu_length = *(buffer + offset++); + psea_msg.pdu_addr_ie.pdu_type = *(buffer + offset++); + + if (psea_msg.pdu_addr_ie.pdu_type == PDU_SESSION_TYPE_IPV4) { + psea_msg.pdu_addr_ie.pdu_addr_oct1 = *(buffer + offset++); + psea_msg.pdu_addr_ie.pdu_addr_oct2 = *(buffer + offset++); + psea_msg.pdu_addr_ie.pdu_addr_oct3 = *(buffer + offset++); + psea_msg.pdu_addr_ie.pdu_addr_oct4 = *(buffer + offset++); + nas_getparams(); + sprintf(baseNetAddress, "%d.%d", psea_msg.pdu_addr_ie.pdu_addr_oct1, psea_msg.pdu_addr_ie.pdu_addr_oct2); + nas_config(1,psea_msg.pdu_addr_ie.pdu_addr_oct3, psea_msg.pdu_addr_ie.pdu_addr_oct4, "oaitun_ue"); + LOG_I(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received UE IP: %d.%d.%d.%d\n", + psea_msg.pdu_addr_ie.pdu_addr_oct1, + psea_msg.pdu_addr_ie.pdu_addr_oct2, + psea_msg.pdu_addr_ie.pdu_addr_oct3, + psea_msg.pdu_addr_ie.pdu_addr_oct4); + } else { + offset += psea_msg.pdu_addr_ie.pdu_length; + } + + psea_iei = *(buffer + offset++); break; + case IEI_RQ_TIMER_VALUE: /* Ommited */ break; case IEI_SNSSAI: /* Ommited */ From 7707669f9765692e46bdef0299cb714a6997d065 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:58:48 +0200 Subject: [PATCH 21/48] PSEA - Capture - Position of RQ Timer Value (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 77aa413735..632162e301 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -117,7 +117,12 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_RQ_TIMER_VALUE: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received RQ timer value IE\n"); + offset++; /* TS 24.008 10.5.7.3 */ + psea_iei = *(buffer + offset++); + break; + case IEI_SNSSAI: /* Ommited */ break; case IEI_ALWAYSON_PDU: /* Ommited */ From 1b89529719c5bb6e8e290003acb4be3e0fd8a346 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 14:59:42 +0200 Subject: [PATCH 22/48] PSEA - Capture - Position of S-NSSAI (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 632162e301..caf5ff05cb 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -120,11 +120,15 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received RQ timer value IE\n"); offset++; /* TS 24.008 10.5.7.3 */ psea_iei = *(buffer + offset++); - break; case IEI_SNSSAI: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received S-NSSAI IE\n"); + uint8_t snssai_length = *(buffer + offset); + offset += (snssai_length + sizeof(snssai_length)); + psea_iei = *(buffer + offset++); break; + case IEI_ALWAYSON_PDU: /* Ommited */ break; case IEI_MAPPED_EPS: /* Ommited */ From ff05fed29c12d02b7bf3028e99b3b778b8d8ca8d Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:00:22 +0200 Subject: [PATCH 23/48] PSEA - Capture - Position of Always-on PDU Session Indication (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index caf5ff05cb..2a156967b5 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -130,7 +130,11 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_ALWAYSON_PDU: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Always-on PDU Session indication IE\n"); + offset++; + psea_iei = *(buffer + offset++); break; + case IEI_MAPPED_EPS: /* Ommited */ break; case IEI_EAP_MSG: /* Ommited */ From ca903df0a821aba17b9f692b0e3a7edfdf1c83f9 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:01:01 +0200 Subject: [PATCH 24/48] PSEA - Capture - Position of Mapped EPS bearer contexts (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 2a156967b5..c7ddebcdcd 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -136,7 +136,12 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_MAPPED_EPS: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Mapped EPS bearer context IE\n"); + uint16_t mapped_eps_length = htons(*(uint16_t *)(buffer + offset)); + offset += mapped_eps_length; + psea_iei = *(buffer + offset++); break; + case IEI_EAP_MSG: /* Ommited */ break; case IEI_AUTH_QOS_DESC: /* Ommited */ From f001961e4eb63f2c6b1f16f2bd41793a1fec2eb4 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:01:45 +0200 Subject: [PATCH 25/48] PSEA - Capture - Position of EAP message (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index c7ddebcdcd..bedad2f5dd 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -143,7 +143,12 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_EAP_MSG: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received EAP message IE\n"); + uint16_t eap_length = htons(*(uint16_t *)(buffer + offset)); + offset += (eap_length + sizeof(eap_length)); + psea_iei = *(buffer + offset++); break; + case IEI_AUTH_QOS_DESC: /* Ommited */ break; case IEI_EXT_CONF_OPT: /* Ommited */ From 80542f05037ceed0faa08d22a9cc5e4dd0684385 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:02:23 +0200 Subject: [PATCH 26/48] PSEA - Capture - Position of Authorized QoS flow descriptions (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index bedad2f5dd..5916589e1c 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -150,7 +150,12 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_AUTH_QOS_DESC: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Authorized QoS flow descriptions IE\n"); + psea_msg.qos_fd_ie.length = htons(*(uint16_t *)(buffer + offset)); + offset += (psea_msg.qos_fd_ie.length + sizeof(psea_msg.qos_fd_ie.length)); + psea_iei = *(buffer + offset++); break; + case IEI_EXT_CONF_OPT: /* Ommited */ break; case IEI_DNN: From 844fec61a8ab16056965fb083a3f081e4001d58d Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:02:57 +0200 Subject: [PATCH 27/48] PSEA - Capture - Position of Extended protocol configuration options (Ommited) --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 5916589e1c..ddcbb65f2d 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -157,7 +157,12 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_EXT_CONF_OPT: /* Ommited */ + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Extended protocol configuration options IE\n"); + psea_msg.ext_pp_ie.length = htons(*(uint16_t *)(buffer + offset)); + offset += (psea_msg.ext_pp_ie.length + sizeof(psea_msg.ext_pp_ie.length )); + psea_iei = *(buffer + offset++); break; + case IEI_DNN: break; From 5ebfed3f90bab0a67faa7e506bb2943d8191e4ab Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:04:46 +0200 Subject: [PATCH 28/48] PSEA - Capture - DNN IE --- .../COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index ddcbb65f2d..7e16cd80bb 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -164,6 +164,19 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_DNN: + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received DNN IE\n"); + psea_msg.dnn_ie.dnn_length = *(buffer + offset++); + uint8_t i=0; + char apn[20]; + + while (*(buffer + offset + i) != ASCII_ACK) { + apn[i] = *(buffer + offset + i); + ++i; + } + + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - APN: %s\n", apn); + offset += psea_msg.dnn_ie.dnn_length; + psea_iei = *(buffer + offset++); break; default: From 5594594c97d8becc0d02fe391cb83e01513375d0 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:06:13 +0200 Subject: [PATCH 29/48] PSEA - Handle uknown IE, ommits the rest message length --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 7e16cd80bb..16e5d4ca8d 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -180,6 +180,8 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; default: + LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Not known IE\n"); + offset = msg_length; break; } } From c31b0f8fa0ebd5ee9706c8a5fca756349375152a Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:14:38 +0200 Subject: [PATCH 30/48] Use values from PSEA message to set QFI and PDU Session ID from CN --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 16e5d4ca8d..b689377ddb 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -23,6 +23,7 @@ #include "common/utils/LOG/log.h" #include "nr_nas_msg_sim.h" #include "openair2/RRC/NAS/nas_config.h" +#include "openair2/SDAP/nr_sdap/nr_sdap.h" extern char *baseNetAddress; @@ -186,5 +187,6 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng } } + set_qfi_pduid(qos_rule.qfi, psea_msg.pdu_id); return; } \ No newline at end of file From 99c77d6fc052c5efd6288a9de4c32d8c262d6b66 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:19:40 +0200 Subject: [PATCH 31/48] Use the new function to capture PSEA message --- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 38 ++--------------------------- 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 378ca3d848..9c4ea33e23 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -909,42 +909,8 @@ void *nas_nrue_task(void *args_p) LOG_I(NAS, "Send NAS_UPLINK_DATA_REQ message(PduSessionEstablishRequest)\n"); } } else if(msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC){ - uint8_t offset = 0; - uint8_t *payload_container = NULL; - offset += SECURITY_PROTECTED_5GS_NAS_MESSAGE_HEADER_LENGTH; - uint16_t payload_container_length = htons(((dl_nas_transport_t *)(pdu_buffer + offset))->payload_container_length); - if ((payload_container_length >= PAYLOAD_CONTAINER_LENGTH_MIN) && (payload_container_length <= PAYLOAD_CONTAINER_LENGTH_MAX)) { - offset += (PLAIN_5GS_NAS_MESSAGE_HEADER_LENGTH + 3); - } - - if (offset < NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.length) { - payload_container = pdu_buffer + offset; - } - offset = 0; - uint8_t pdu_id = *(pdu_buffer+14); - while(offset < payload_container_length) { - // Fixme: this is not good 'type' 0x29 searching in TLV like structure - // AND fix dirsty code copy hereafter of the same!!! - if (*(payload_container + offset) == 0x29) { // PDU address IEI - if ((*(payload_container+offset+1) == 0x05) && (*(payload_container +offset+2) == 0x01)) { // IPV4 - nas_getparams(); - sprintf(baseNetAddress, "%d.%d", *(payload_container+offset+3), *(payload_container+offset+4)); - int third_octet = *(payload_container+offset+5); - int fourth_octet = *(payload_container+offset+6); - LOG_I(NAS, "Received PDU Session Establishment Accept, UE IP: %d.%d.%d.%d\n", - *(payload_container+offset+3), *(payload_container+offset+4), - *(payload_container+offset+5), *(payload_container+offset+6)); - nas_config(1,third_octet,fourth_octet,"oaitun_ue"); - } - } - if (*(payload_container + offset) == 0x79) { - uint8_t qfi = *(payload_container+offset+3); - set_qfi_pduid(qfi, pdu_id); - break; - } - offset++; - } - } + capture_pdu_session_establishment_accept(pdu_buffer, NAS_CONN_ESTABLI_CNF (msg_p).nasMsg.length); + } break; } From 24241e1b97177410d36c6cdaab763f24ddb904e6 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:20:29 +0200 Subject: [PATCH 32/48] PSEA - Log - Change the debug to trace --- .../ESM/MSG/PduSessionEstablishmentAccept.c | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index b689377ddb..a3fe2100b1 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -88,12 +88,12 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng while(offset < msg_length) { switch (psea_iei) { case IEI_5GSM_CAUSE: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received 5GSM Cause IEI\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received 5GSM Cause IEI\n"); offset++; break; case IEI_PDU_ADDRESS: - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received PDU Address IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received PDU Address IE\n"); psea_msg.pdu_addr_ie.pdu_length = *(buffer + offset++); psea_msg.pdu_addr_ie.pdu_type = *(buffer + offset++); @@ -105,7 +105,7 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng nas_getparams(); sprintf(baseNetAddress, "%d.%d", psea_msg.pdu_addr_ie.pdu_addr_oct1, psea_msg.pdu_addr_ie.pdu_addr_oct2); nas_config(1,psea_msg.pdu_addr_ie.pdu_addr_oct3, psea_msg.pdu_addr_ie.pdu_addr_oct4, "oaitun_ue"); - LOG_I(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received UE IP: %d.%d.%d.%d\n", + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received UE IP: %d.%d.%d.%d\n", psea_msg.pdu_addr_ie.pdu_addr_oct1, psea_msg.pdu_addr_ie.pdu_addr_oct2, psea_msg.pdu_addr_ie.pdu_addr_oct3, @@ -118,54 +118,54 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng break; case IEI_RQ_TIMER_VALUE: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received RQ timer value IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received RQ timer value IE\n"); offset++; /* TS 24.008 10.5.7.3 */ psea_iei = *(buffer + offset++); break; case IEI_SNSSAI: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received S-NSSAI IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received S-NSSAI IE\n"); uint8_t snssai_length = *(buffer + offset); offset += (snssai_length + sizeof(snssai_length)); psea_iei = *(buffer + offset++); break; case IEI_ALWAYSON_PDU: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Always-on PDU Session indication IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Always-on PDU Session indication IE\n"); offset++; psea_iei = *(buffer + offset++); break; case IEI_MAPPED_EPS: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Mapped EPS bearer context IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Mapped EPS bearer context IE\n"); uint16_t mapped_eps_length = htons(*(uint16_t *)(buffer + offset)); offset += mapped_eps_length; psea_iei = *(buffer + offset++); break; case IEI_EAP_MSG: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received EAP message IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received EAP message IE\n"); uint16_t eap_length = htons(*(uint16_t *)(buffer + offset)); offset += (eap_length + sizeof(eap_length)); psea_iei = *(buffer + offset++); break; case IEI_AUTH_QOS_DESC: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Authorized QoS flow descriptions IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Authorized QoS flow descriptions IE\n"); psea_msg.qos_fd_ie.length = htons(*(uint16_t *)(buffer + offset)); offset += (psea_msg.qos_fd_ie.length + sizeof(psea_msg.qos_fd_ie.length)); psea_iei = *(buffer + offset++); break; case IEI_EXT_CONF_OPT: /* Ommited */ - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Extended protocol configuration options IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received Extended protocol configuration options IE\n"); psea_msg.ext_pp_ie.length = htons(*(uint16_t *)(buffer + offset)); offset += (psea_msg.ext_pp_ie.length + sizeof(psea_msg.ext_pp_ie.length )); psea_iei = *(buffer + offset++); break; case IEI_DNN: - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received DNN IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received DNN IE\n"); psea_msg.dnn_ie.dnn_length = *(buffer + offset++); uint8_t i=0; char apn[20]; @@ -175,13 +175,13 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng ++i; } - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - APN: %s\n", apn); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - APN: %s\n", apn); offset += psea_msg.dnn_ie.dnn_length; psea_iei = *(buffer + offset++); break; default: - LOG_D(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Not known IE\n"); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Not known IE\n"); offset = msg_length; break; } From 3f1d515aafca461286fdc8cce744b715f06e8e4a Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Wed, 5 Oct 2022 15:39:21 +0200 Subject: [PATCH 33/48] PSEA - Slight cosmetic changes --- .../NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 8 ++++---- .../NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 2 +- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index a3fe2100b1..cbcd767c11 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -27,7 +27,8 @@ extern char *baseNetAddress; -void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_length){ +void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_length) +{ uint8_t offset = 0; security_protected_nas_5gs_msg_t sec_nas_hdr; security_protected_plain_nas_5gs_msg_t sec_nas_msg; @@ -52,8 +53,7 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng psea_msg.ssc_mode = (*(buffer + (offset++)) & 0xf0) >> 4; psea_msg.qos_rules.length = htons(*(uint16_t *)(buffer + offset)); offset+=sizeof(psea_msg.qos_rules.length); - /* Supports the capture of only one QoS Rule, - it should be changed for multiple QoS Rules */ + /* Supports the capture of only one QoS Rule, it should be changed for multiple QoS Rules */ qos_rule_t qos_rule; qos_rule.id = *(buffer + (offset++)); qos_rule.length = htons(*(uint16_t *)(buffer + offset)); @@ -104,7 +104,7 @@ void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_leng psea_msg.pdu_addr_ie.pdu_addr_oct4 = *(buffer + offset++); nas_getparams(); sprintf(baseNetAddress, "%d.%d", psea_msg.pdu_addr_ie.pdu_addr_oct1, psea_msg.pdu_addr_ie.pdu_addr_oct2); - nas_config(1,psea_msg.pdu_addr_ie.pdu_addr_oct3, psea_msg.pdu_addr_ie.pdu_addr_oct4, "oaitun_ue"); + nas_config(1, psea_msg.pdu_addr_ie.pdu_addr_oct3, psea_msg.pdu_addr_ie.pdu_addr_oct4, "oaitun_ue"); LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received UE IP: %d.%d.%d.%d\n", psea_msg.pdu_addr_ie.pdu_addr_oct1, psea_msg.pdu_addr_ie.pdu_addr_oct2, diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 94a523285b..ca92e54418 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -157,6 +157,6 @@ typedef struct security_protected_nas_5gs_msg_s { uint8_t sqn; /* Sequence Number */ } security_protected_nas_5gs_msg_t; /* 24.501 Figure 9.1.1.2 */ -void capture_pdu_session_establishment_accept(uint8_t *buffer, uint32_t msg_length); +void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_length); #endif \ No newline at end of file diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 9c4ea33e23..890af23d1f 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -909,7 +909,7 @@ void *nas_nrue_task(void *args_p) LOG_I(NAS, "Send NAS_UPLINK_DATA_REQ message(PduSessionEstablishRequest)\n"); } } else if(msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC){ - capture_pdu_session_establishment_accept(pdu_buffer, NAS_CONN_ESTABLI_CNF (msg_p).nasMsg.length); + capture_pdu_session_establishment_accept_msg(pdu_buffer, NAS_CONN_ESTABLI_CNF (msg_p).nasMsg.length); } break; From 6c4b46864665247bd2308520a224eda971bda348 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 18 Jul 2022 11:47:43 +0100 Subject: [PATCH 34/48] Tutorials: updates to use 100 MHz with 2 DL layers MIMO to achieve 640 Mbps downlink throughput with a single UE (820 Mbps with 2 UEs) --- doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md | 7 +++---- doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md | 11 +++++------ doc/tutorial_resources/docker-compose-basic-nrf.yaml | 2 ++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md index fc0700c699..2f898b2b36 100644 --- a/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md @@ -158,7 +158,7 @@ cd cmake_targets cd ~/openairinterface5g source oaienv cd cmake_targets -./build_oai -w USRP --nrUE --gNB --build-lib all -c +./build_oai -w USRP --ninja --nrUE --gNB --build-lib all -c ``` @@ -191,10 +191,9 @@ With [PuTTY](https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe), send th AT+QMBNCFG="Select","ROW_Commercial" AT+QMBNCFG="AutoSel",0 AT+CFUN=1,1 -AT+CGDCONT=1 +AT+CGDCONT=1,"IP","oai" AT+CGDCONT=2 AT+CGDCONT=3 -AT+CGDCONT=1,"IP","oai" # (Optional, debug only, AT commands) Activate PDP context, retrieve IP address and test with ping AT+CGACT=1,1 @@ -205,7 +204,7 @@ AT+QPING=1,"openairinterface.org" ## 5.2 Ping test - UE host ```bash -ping 192.168.70.135 -n 1000 -S 12.1.1.2 +ping 192.168.70.135 -t -S 12.1.1.2 ``` - CN5G host ```bash diff --git a/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md index d68057fd08..abedda397e 100644 --- a/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md @@ -159,7 +159,7 @@ cd cmake_targets cd ~/openairinterface5g source oaienv cd cmake_targets -./build_oai -w USRP --nrUE --gNB --build-lib all -c +./build_oai -w USRP --ninja --nrUE --gNB --build-lib all -c ``` ## 3.3 N300 Ethernet Tuning @@ -195,7 +195,7 @@ python3 core-network.py --type start-basic --scenario 1 cd ~/openairinterface5g source oaienv cd cmake_targets/ran_build/build -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 ``` @@ -208,10 +208,9 @@ With [PuTTY](https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe), send th AT+QMBNCFG="Select","ROW_Commercial" AT+QMBNCFG="AutoSel",0 AT+CFUN=1,1 -AT+CGDCONT=1 +AT+CGDCONT=1,"IP","oai" AT+CGDCONT=2 AT+CGDCONT=3 -AT+CGDCONT=1,"IP","oai" # (Optional, debug only, AT commands) Activate PDP context, retrieve IP address and test with ping AT+CGACT=1,1 @@ -222,7 +221,7 @@ AT+QPING=1,"openairinterface.org" ## 5.2 Ping test - UE host ```bash -ping 192.168.70.135 -n 1000 -S 12.1.1.2 +ping 192.168.70.135 -t -S 12.1.1.2 ``` - CN5G host ```bash @@ -240,5 +239,5 @@ iperf -s -u -i 1 -B 12.1.1.2 - CN5G host ```bash -docker exec -it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -b 200M -c 12.1.1.2 +docker exec -it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -b 640M -c 12.1.1.2 ``` diff --git a/doc/tutorial_resources/docker-compose-basic-nrf.yaml b/doc/tutorial_resources/docker-compose-basic-nrf.yaml index b88020e6b0..7ad007f0e8 100644 --- a/doc/tutorial_resources/docker-compose-basic-nrf.yaml +++ b/doc/tutorial_resources/docker-compose-basic-nrf.yaml @@ -181,6 +181,8 @@ services: - UDM_PORT=80 - UDM_API_VERSION=v2 - UDM_FQDN=oai-udm + - INT_ALGO_LIST=["NIA1", "NIA2"] + - CIPH_ALGO_LIST=["NEA0", "NEA2"] depends_on: - mysql - oai-nrf From c0afb3490235b1e678270e14c757aa361c5b8652 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 26 Aug 2022 11:14:47 +0100 Subject: [PATCH 35/48] Tutorials: add instructions to run OAI gNB with USRP X300 --- doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md | 2 +- doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md index 2f898b2b36..c5561977a1 100644 --- a/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md @@ -7,7 +7,7 @@ - OAI 5G SA tutorial + OAI 5G SA tutorial for USRP B210 diff --git a/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md index abedda397e..0fbff802ad 100644 --- a/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md @@ -7,7 +7,7 @@ - OAI 5G SA tutorial + OAI 5G SA tutorial for USRP N300 or X300 @@ -46,7 +46,7 @@ Minimum hardware requirements: - CPU: 4 cores x86_64 - RAM: 8 GB - Windows driver for Quectel MUST be equal or higher than version **2.2.4** -- [USRP N300](https://www.ettus.com/all-products/USRP-N300/): Please identify the network interface(s) on which the N300 is connected. +- [USRP N300](https://www.ettus.com/all-products/USRP-N300/) or [USRP X300](https://www.ettus.com/all-products/x300-kit/): Please identify the network interface(s) on which the USRP is connected. - Quectel RM500Q - Module, M.2 to USB adapter, antennas and SIM card - Firmware version of Quectel MUST be equal or higher than **RM500QGLABR11A06M4G** @@ -192,10 +192,17 @@ python3 core-network.py --type start-basic --scenario 1 ## 4.2 Run OAI gNB ```bash +# USRP N300 cd ~/openairinterface5g source oaienv cd cmake_targets/ran_build/build sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 + +# USRP X300 +cd ~/openairinterface5g +source oaienv +cd cmake_targets/ran_build/build +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 -E --continuous-tx ``` From a578a5c4483babec3f40d5470e6091f6fac41895 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 29 Aug 2022 12:49:25 +0100 Subject: [PATCH 36/48] Tutorials: merge all the tutorials for different USRPs into a single page --- doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md | 226 ------------------ ...> NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md} | 52 ++-- 2 files changed, 34 insertions(+), 244 deletions(-) delete mode 100644 doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md rename doc/{NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md => NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md} (84%) diff --git a/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md deleted file mode 100644 index c5561977a1..0000000000 --- a/doc/NR_SA_CN5G_gNB_B210_COTS_UE_Tutorial.md +++ /dev/null @@ -1,226 +0,0 @@ - - - - - -
- - - - - - OAI 5G SA tutorial for USRP B210 -
- -**TABLE OF CONTENTS** - -1. [Scenario](#1-scenario) -2. [OAI CN5G](#2-oai-cn5g) - 1. [OAI CN5G pre-requisites](#21-oai-cn5g-pre-requisites) - 2. [OAI CN5G Setup](#22-oai-cn5g-setup) - 3. [OAI CN5G Configuration files](#23-oai-cn5g-configuration-files) - 4. [SIM Card](#24-sim-card) -3. [OAI gNB](#3-oai-gnb) - 1. [OAI gNB pre-requisites](#31-oai-gnb-pre-requisites) - 2. [Build OAI gNB](#32-build-oai-gnb) -4. [Run OAI CN5G and OAI gNB with USRP B210](#4-run-oai-cn5g-and-oai-gnb-with-usrp-b210) - 1. [Run OAI CN5G](#41-run-oai-cn5g) - 2. [Run OAI gNB](#42-run-oai-gnb) -5. [Testing with QUECTEL RM500Q](#5-testing-with-quectel-rm500q) - 1. [Setup QUECTEL](#51-setup-quectel) - 2. [Ping test](#52-ping-test) - 3. [Downlink iPerf test](#53-downlink-iperf-test) - - -# 1. Scenario -In this tutorial we describe how to configure and run a 5G end-to-end setup with OAI CN5G, OAI gNB and COTS UE. - -Minimum hardware requirements: -- Laptop/Desktop/Server for OAI CN5G and OAI gNB - - Operating System: [Ubuntu 20.04.4 LTS](https://releases.ubuntu.com/20.04.4/ubuntu-20.04.4-desktop-amd64.iso) - - CPU: 8 cores x86_64 @ 3.5 GHz - - RAM: 32 GB -- Laptop for UE - - Operating System: Microsoft Windows 10 x64 - - CPU: 4 cores x86_64 - - RAM: 8 GB - - Windows driver for Quectel MUST be equal or higher than version **2.2.4** -- [USRP B210](https://www.ettus.com/all-products/ub210-kit/) -- Quectel RM500Q - - Module, M.2 to USB adapter, antennas and SIM card - - Firmware version of Quectel MUST be equal or higher than **RM500QGLABR11A06M4G** - - -# 2. OAI CN5G - -## 2.1 OAI CN5G pre-requisites - -```bash -sudo apt install -y git net-tools putty - -sudo apt install -y apt-transport-https ca-certificates curl software-properties-common -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -sudo apt update -sudo apt install -y docker docker-ce - -# Add your username to the docker group, otherwise you will have to run in sudo mode. -sudo usermod -a -G docker $(whoami) -reboot - -# https://docs.docker.com/compose/install/ -sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -sudo chmod +x /usr/local/bin/docker-compose -``` - -## 2.2 OAI CN5G Setup - -```bash -# Git oai-cn5g-fed repository -git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git ~/oai-cn5g-fed - -# Pull docker images -docker pull oaisoftwarealliance/oai-amf:develop -docker pull oaisoftwarealliance/oai-nrf:develop -docker pull oaisoftwarealliance/oai-smf:develop -docker pull oaisoftwarealliance/oai-udr:develop -docker pull oaisoftwarealliance/oai-udm:develop -docker pull oaisoftwarealliance/oai-ausf:develop -docker pull oaisoftwarealliance/oai-spgwu-tiny:develop -docker pull oaisoftwarealliance/trf-gen-cn5g:latest - -# Tag docker images -docker image tag oaisoftwarealliance/oai-amf:develop oai-amf:develop -docker image tag oaisoftwarealliance/oai-nrf:develop oai-nrf:develop -docker image tag oaisoftwarealliance/oai-smf:develop oai-smf:develop -docker image tag oaisoftwarealliance/oai-udr:develop oai-udr:develop -docker image tag oaisoftwarealliance/oai-udm:develop oai-udm:develop -docker image tag oaisoftwarealliance/oai-ausf:develop oai-ausf:develop -docker image tag oaisoftwarealliance/oai-spgwu-tiny:develop oai-spgwu-tiny:develop -docker image tag oaisoftwarealliance/trf-gen-cn5g:latest trf-gen-cn5g:latest -``` - -## 2.3 OAI CN5G Configuration files -Download and copy configuration files: -- Copy [docker-compose-basic-nrf.yaml](tutorial_resources/docker-compose-basic-nrf.yaml) to `~/oai-cn5g-fed/docker-compose` -- Copy [oai_db.sql](tutorial_resources/oai_db.sql) to `~/oai-cn5g-fed/docker-compose/database` - -Change permissions on oai_db.sql to prevent mysql permission denied error: -```bash -chmod 644 ~/oai-cn5g-fed/docker-compose/database/oai_db.sql -``` - -## 2.4 SIM Card -Program SIM Card with [Open Cells Project](https://open-cells.com/) application [uicc-v2.6](https://open-cells.com/d5138782a8739209ec5760865b1e53b0/uicc-v2.6.tgz). - -```bash -sudo ./program_uicc --adm 12345678 --imsi 208990000000001 --isdn 00000001 --acc 0001 --key fec86ba6eb707ed08905757b1bb44b8f --opc C42449363BBAD02B66D16BC975D77CC1 -spn "OpenAirInterface" --authenticate -``` - - -# 3. OAI gNB - -## 3.1 OAI gNB pre-requisites - -### Build UHD from source -```bash -sudo apt install -y libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools cmake build-essential - -git clone https://github.com/EttusResearch/uhd.git ~/uhd -cd ~/uhd -git checkout v4.0.0.0 -cd host -mkdir build -cd build -cmake ../ -make -j 4 -make test # This step is optional -sudo make install -sudo ldconfig -sudo uhd_images_downloader -``` - -## 3.2 Build OAI gNB - -```bash -# Get openairinterface5g source code -git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ~/openairinterface5g -cd ~/openairinterface5g -git checkout develop - -# Install dependencies in Ubuntu 20.04 -cd ~/openairinterface5g -source oaienv -cd cmake_targets -./build_oai -I - -# Build OAI gNB -cd ~/openairinterface5g -source oaienv -cd cmake_targets -./build_oai -w USRP --ninja --nrUE --gNB --build-lib all -c -``` - - -# 4. Run OAI CN5G and OAI gNB with USRP B210 - -## 4.1 Run OAI CN5G - -```bash -cd ~/oai-cn5g-fed/docker-compose -python3 core-network.py --type start-basic --scenario 1 -``` - -## 4.2 Run OAI gNB - -```bash -cd ~/openairinterface5g -source oaienv -cd cmake_targets/ran_build/build -sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --sa -E --continuous-tx -``` - -Make sure that during USRP initialization, it shows that USB 3 is used. - -# 5. Testing with Quectel RM500Q - -## 5.1 Setup Quectel -With [PuTTY](https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe), send the following AT commands to the module using a serial interface (ex: COM2) at 115200 bps: -```bash -# MUST be sent at least once everytime there is a firmware upgrade! -AT+QMBNCFG="Select","ROW_Commercial" -AT+QMBNCFG="AutoSel",0 -AT+CFUN=1,1 -AT+CGDCONT=1,"IP","oai" -AT+CGDCONT=2 -AT+CGDCONT=3 - -# (Optional, debug only, AT commands) Activate PDP context, retrieve IP address and test with ping -AT+CGACT=1,1 -AT+CGPADDR=1 -AT+QPING=1,"openairinterface.org" -``` - -## 5.2 Ping test -- UE host -```bash -ping 192.168.70.135 -t -S 12.1.1.2 -``` -- CN5G host -```bash -docker exec -it oai-ext-dn ping 12.1.1.2 -``` - -## 5.3 Downlink iPerf test -- UE host - - Download iPerf for Microsoft Windows from [here](https://iperf.fr/download/windows/iperf-2.0.9-win64.zip). - - Extract to Desktop and run with Command Prompt: -```bash -cd C:\Users\User\Desktop\iPerf\iperf-2.0.9-win64\iperf-2.0.9-win64 -iperf -s -u -i 1 -B 12.1.1.2 -``` - -- CN5G host -```bash -docker exec -it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -b 125M -c 12.1.1.2 -``` diff --git a/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md similarity index 84% rename from doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md rename to doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md index 0fbff802ad..d5149a6c4e 100644 --- a/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md @@ -7,7 +7,7 @@ - OAI 5G SA tutorial for USRP N300 or X300 + OAI 5G SA tutorial @@ -24,9 +24,12 @@ 1. [OAI gNB pre-requisites](#31-oai-gnb-pre-requisites) 2. [Build OAI gNB](#32-build-oai-gnb) 3. [N300 Ethernet Tuning](#33-n300-ethernet-tuning) -4. [Run OAI CN5G and OAI gNB with USRP N300](#4-run-oai-cn5g-and-oai-gnb-with-usrp-n300) +4. [Run OAI CN5G and OAI gNB](#4-run-oai-cn5g-and-oai-gnb) 1. [Run OAI CN5G](#41-run-oai-cn5g) 2. [Run OAI gNB](#42-run-oai-gnb) + 1. [USRP B210](#usrp-b210) + 2. [USRP N300](#usrp-n300) + 3. [USRP X300](#usrp-x300) 5. [Testing with QUECTEL RM500Q](#5-testing-with-quectel-rm500q) 1. [Setup QUECTEL](#51-setup-quectel) 2. [Ping test](#52-ping-test) @@ -46,7 +49,8 @@ Minimum hardware requirements: - CPU: 4 cores x86_64 - RAM: 8 GB - Windows driver for Quectel MUST be equal or higher than version **2.2.4** -- [USRP N300](https://www.ettus.com/all-products/USRP-N300/) or [USRP X300](https://www.ettus.com/all-products/x300-kit/): Please identify the network interface(s) on which the USRP is connected. +- [USRP B210](https://www.ettus.com/all-products/ub210-kit/), [USRP N300](https://www.ettus.com/all-products/USRP-N300/) or [USRP X300](https://www.ettus.com/all-products/x300-kit/) + - Please identify the network interface(s) on which the USRP is connected and update the gNB configuration file - Quectel RM500Q - Module, M.2 to USB adapter, antennas and SIM card - Firmware version of Quectel MUST be equal or higher than **RM500QGLABR11A06M4G** @@ -162,25 +166,29 @@ cd cmake_targets ./build_oai -w USRP --ninja --nrUE --gNB --build-lib all -c ``` -## 3.3 N300 Ethernet Tuning +## 3.3 USRP N300 and X300 Ethernet Tuning Please also refer to the official [USRP Host Performance Tuning Tips and Tricks](https://kb.ettus.com/USRP_Host_Performance_Tuning_Tips_and_Tricks) tuning guide. The following steps are recommended. Please change the network interface(s) as required. Also, you should have 10Gbps interface(s): if you use two cables, you should have the XG interface. Refer to the [N300 Getting Started Guide](https://kb.ettus.com/USRP_N300/N310/N320/N321_Getting_Started_Guide) for more information. * Use an MTU of 9000: how to change this depends on the network management tool. In the case of Network Manager, this can be done from the GUI. -* Increase the kernel socket buffer (also done by the USRP driver in OAI): - ``` - sysctl -w net.core.rmem_max=8388608 - sysctl -w net.core.wmem_max=8388608 - sysctl -w net.core.rmem_default=65536 - sysctl -w net.core.wmem_default=65536 - ``` +* Increase the kernel socket buffer (also done by the USRP driver in OAI) * Increase Ethernet Ring Buffers: `sudo ethtool -G rx 4096 tx 4096` -* Disable hyper-threading in the BIOS -* Disable KPTI Protections for Spectre/Meltdown for more performance. **This is a security risk.** Add `mitigations=off nosmt` in your grub config and update grub. +* Disable hyper-threading in the BIOS (This step is optional) +* Optional: Disable KPTI Protections for Spectre/Meltdown for more performance. **This is a security risk.** Add `mitigations=off nosmt` in your grub config and update grub. (This step is optional) -# 4. Run OAI CN5G and OAI gNB with USRP N300 +Example code to run: +``` +for ((i=0;i<$(nproc);i++)); do sudo cpufreq-set -c $i -r -g performance; done +sudo sysctl -w net.core.wmem_max=62500000 +sudo sysctl -w net.core.rmem_max=62500000 +sudo sysctl -w net.core.wmem_default=62500000 +sudo sysctl -w net.core.rmem_default=62500000 +sudo ethtool -G enp1s0f0 tx 4096 rx 4096 +``` + +# 4. Run OAI CN5G and OAI gNB ## 4.1 Run OAI CN5G @@ -191,21 +199,29 @@ python3 core-network.py --type start-basic --scenario 1 ## 4.2 Run OAI gNB +### USRP B210 +```bash +cd ~/openairinterface5g +source oaienv +cd cmake_targets/ran_build/build +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --sa -E --continuous-tx +``` +### USRP N300 ```bash -# USRP N300 cd ~/openairinterface5g source oaienv cd cmake_targets/ran_build/build sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 +``` -# USRP X300 +### USRP X300 +```bash cd ~/openairinterface5g source oaienv cd cmake_targets/ran_build/build sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 -E --continuous-tx ``` - # 5. Testing with Quectel RM500Q ## 5.1 Setup Quectel @@ -246,5 +262,5 @@ iperf -s -u -i 1 -B 12.1.1.2 - CN5G host ```bash -docker exec -it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -b 640M -c 12.1.1.2 +docker exec -it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -b 100M -c 12.1.1.2 ``` From a5f95e19076746a2c0b45701b24899c16c1845bb Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 20 Sep 2022 10:50:23 +0100 Subject: [PATCH 37/48] Tutorials: update OAI CN5G docker-compose-basic-nrf.yaml to the latest develop version --- doc/tutorial_resources/docker-compose-basic-nrf.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/tutorial_resources/docker-compose-basic-nrf.yaml b/doc/tutorial_resources/docker-compose-basic-nrf.yaml index 7ad007f0e8..e08f834b09 100644 --- a/doc/tutorial_resources/docker-compose-basic-nrf.yaml +++ b/doc/tutorial_resources/docker-compose-basic-nrf.yaml @@ -143,7 +143,7 @@ services: - PLMN_SUPPORT_MNC=99 - PLMN_SUPPORT_TAC=0x0001 - SST_0=1 - - SD_0=0x1 + - SD_0=0xFFFFFF - AMF_INTERFACE_NAME_FOR_NGAP=eth0 - AMF_INTERFACE_NAME_FOR_N11=eth0 - SMF_INSTANCE_ID_0=1 @@ -229,7 +229,7 @@ services: - TYPE0=IPv4 - DNN_RANGE0=12.1.1.2 - 12.1.1.253 - NSSAI_SST0=1 - - NSSAI_SD0=0x1 + - NSSAI_SD0=0xFFFFFF - SESSION_AMBR_UL0=1000Mbps - SESSION_AMBR_DL0=1000Mbps - DEFAULT_CSCF_IPV4_ADDRESS=127.0.0.1 # only needed when ims is being used @@ -274,7 +274,7 @@ services: - NRF_API_VERSION=v1 - NRF_FQDN=oai-nrf - NSSAI_SST_0=1 - - NSSAI_SD_0=0xffffff + - NSSAI_SD_0=0xFFFFFF - DNN_0=oai depends_on: - oai-nrf @@ -296,6 +296,11 @@ services: "ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity" depends_on: - oai-spgwu + healthcheck: + test: /bin/bash -c "ip r | grep 12.1.1" + interval: 10s + timeout: 5s + retries: 5 networks: public_net: ipv4_address: 192.168.70.135 From 18cdef95108cb9691208e8c6aa4258718b4b6f7d Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 22 Sep 2022 14:53:17 +0100 Subject: [PATCH 38/48] Update SD to 0x1 to get PDUSession with COTS UE --- doc/tutorial_resources/docker-compose-basic-nrf.yaml | 6 +++--- .../CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/tutorial_resources/docker-compose-basic-nrf.yaml b/doc/tutorial_resources/docker-compose-basic-nrf.yaml index e08f834b09..dd441010c0 100644 --- a/doc/tutorial_resources/docker-compose-basic-nrf.yaml +++ b/doc/tutorial_resources/docker-compose-basic-nrf.yaml @@ -143,7 +143,7 @@ services: - PLMN_SUPPORT_MNC=99 - PLMN_SUPPORT_TAC=0x0001 - SST_0=1 - - SD_0=0xFFFFFF + - SD_0=0x1 - AMF_INTERFACE_NAME_FOR_NGAP=eth0 - AMF_INTERFACE_NAME_FOR_N11=eth0 - SMF_INSTANCE_ID_0=1 @@ -229,7 +229,7 @@ services: - TYPE0=IPv4 - DNN_RANGE0=12.1.1.2 - 12.1.1.253 - NSSAI_SST0=1 - - NSSAI_SD0=0xFFFFFF + - NSSAI_SD0=0x1 - SESSION_AMBR_UL0=1000Mbps - SESSION_AMBR_DL0=1000Mbps - DEFAULT_CSCF_IPV4_ADDRESS=127.0.0.1 # only needed when ims is being used @@ -274,7 +274,7 @@ services: - NRF_API_VERSION=v1 - NRF_FQDN=oai-nrf - NSSAI_SST_0=1 - - NSSAI_SD_0=0xFFFFFF + - NSSAI_SD_0=0x1 - DNN_0=oai depends_on: - oai-nrf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf index 6ac50b6aa6..0b9464a99c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf @@ -10,7 +10,7 @@ gNBs = ( // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; - plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1 }); }); + plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1; sd = 0x1; }); }); nr_cellid = 12345678L; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 7819bfe652..5efbac8024 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -11,7 +11,7 @@ gNBs = // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; - plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1 }) }); + plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1; sd = 0x1; }) }); nr_cellid = 12345678L; From e58eb7ac27001dc3a6e95d9d54e78e854e6b2d54 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 12 Oct 2022 11:28:59 +0100 Subject: [PATCH 39/48] Add automatic Table Of Contents --- ci-scripts/doc/vm_based_simulator_build.md | 6 ++--- .../doc/vm_based_simulator_check_build.md | 5 ++-- ci-scripts/doc/vm_based_simulator_create.md | 6 ++--- ci-scripts/doc/vm_based_simulator_destroy.md | 6 ++--- ci-scripts/doc/vm_based_simulator_env.md | 7 ++--- .../doc/vm_based_simulator_main_scripts.md | 6 ++--- ci-scripts/doc/vm_based_simulator_sources.md | 6 ++--- ci-scripts/doc/vm_based_simulator_test.md | 9 ++----- .../4g_rfsimulator_fdd_05MHz/README.md | 15 ++--------- .../yaml_files/5g_rfsimulator/README.md | 17 ++---------- doc/FEATURE_SET.md | 26 +------------------ doc/L1SIM.md | 8 ++---- doc/L2NFAPI_NOS1.md | 14 ++-------- doc/L2NFAPI_S1.md | 16 ++---------- doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md | 24 ++--------------- doc/TESTBenches.md | 7 ++--- doc/TESTING_5GSA_setup.md | 11 ++------ doc/TESTING_GNB_W_COTS_UE.md | 16 ++---------- docker/README.md | 7 +---- 19 files changed, 36 insertions(+), 176 deletions(-) diff --git a/ci-scripts/doc/vm_based_simulator_build.md b/ci-scripts/doc/vm_based_simulator_build.md index 16faa3ce9b..d75de46359 100644 --- a/ci-scripts/doc/vm_based_simulator_build.md +++ b/ci-scripts/doc/vm_based_simulator_build.md @@ -12,11 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Detailed Description](#2-detailed-description) -3. [Typical Usage](#3-typical-usage) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/doc/vm_based_simulator_check_build.md b/ci-scripts/doc/vm_based_simulator_check_build.md index 86d26ff8ed..a9d9177fab 100644 --- a/ci-scripts/doc/vm_based_simulator_check_build.md +++ b/ci-scripts/doc/vm_based_simulator_check_build.md @@ -12,10 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Detailed Description](#2-detailed-description) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/doc/vm_based_simulator_create.md b/ci-scripts/doc/vm_based_simulator_create.md index 4681738038..db5ba2daed 100644 --- a/ci-scripts/doc/vm_based_simulator_create.md +++ b/ci-scripts/doc/vm_based_simulator_create.md @@ -12,11 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Detailed Description](#2-detailed-description) -3. [Typical Usage](#3-typical-usage) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/doc/vm_based_simulator_destroy.md b/ci-scripts/doc/vm_based_simulator_destroy.md index d69e82a005..945c4a6475 100644 --- a/ci-scripts/doc/vm_based_simulator_destroy.md +++ b/ci-scripts/doc/vm_based_simulator_destroy.md @@ -12,11 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Detailed Description](#2-detailed-description) -3. [Typical Usage](#3-typical-usage) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/doc/vm_based_simulator_env.md b/ci-scripts/doc/vm_based_simulator_env.md index 95b9d920d5..066f63a24a 100644 --- a/ci-scripts/doc/vm_based_simulator_env.md +++ b/ci-scripts/doc/vm_based_simulator_env.md @@ -12,12 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Prerequisites](#2-prerequisites) - 1. [uvtool installation](#21-uvtool-installation) - 2. [apt-cacher-server installation](#22-apt-cacher-server-installation) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/doc/vm_based_simulator_main_scripts.md b/ci-scripts/doc/vm_based_simulator_main_scripts.md index d5df27529c..ccaf91ed12 100644 --- a/ci-scripts/doc/vm_based_simulator_main_scripts.md +++ b/ci-scripts/doc/vm_based_simulator_main_scripts.md @@ -12,11 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Sub BASH scripts](#2-sub-bash-scripts) -3. [Main script features](#3-main-script-features) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/doc/vm_based_simulator_sources.md b/ci-scripts/doc/vm_based_simulator_sources.md index 4bba6a8a09..33954ec39f 100644 --- a/ci-scripts/doc/vm_based_simulator_sources.md +++ b/ci-scripts/doc/vm_based_simulator_sources.md @@ -12,11 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Centralized Workspace](#2-centralized-workspace) -3. [Create the ZIP file](#3-create-the-zip-file) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/doc/vm_based_simulator_test.md b/ci-scripts/doc/vm_based_simulator_test.md index ab28101543..52bf36e255 100644 --- a/ci-scripts/doc/vm_based_simulator_test.md +++ b/ci-scripts/doc/vm_based_simulator_test.md @@ -12,14 +12,9 @@ -## Table of Contents ## +**Table of Contents** -1. [Introduction](#1-introduction) -2. [Detailed Description](#2-detailed-description) -3. [Typical Usage](#3-typical-usage) - 1. [Testing the physical simulators](#31-testing-the-physicals-simulators) - 2. [Testing the RF simulator](#33-testing-the-rf-simulator) - 3. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator) +[[_TOC_]] # 1. Introduction # diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md index 1a947d0389..d146c8abec 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md @@ -14,20 +14,9 @@ This page is only valid for an `Ubuntu18` host. -**TABLE OF CONTENTS** +**Table of Contents** -1. [Retrieving the images on Docker-Hub](#1-retrieving-the-images-on-docker-hub) -2. [Deploy containers](#2-deploy-containers) - 1. [Deploy and Configure Cassandra Database](#21-deploy-and-configure-cassandra-database) - 2. [Deploy OAI CN4G containers](#22-deploy-oai-cn4g-containers) - 3. [Deploy OAI eNB in RF simulator mode](#23-deploy-oai-enb-in-rf-simulator-mode) - 4. [Deploy OAI LTE UE in RF simulator mode](#24-deploy-oai-lte-ue-in-rf-simulator-mode) -3. [Check traffic](#3-check-traffic) -4. [Un-deployment](#4-un-deployment) -5. [Explanation on the configuration](#5-explanation-on-the-configuration) - 1. [UE IMSI and Keys](#51-ue-imsi-and-keys) - 2. [PLMN and TAI](#52-plmn-and-tai) - 3. [Access to Internet](#53-access-to-internet) +[[_TOC_]] # 1. Retrieving the images on Docker-Hub # diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index f457d4c3f6..f75d3721da 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -16,22 +16,9 @@ This page is only valid for an `Ubuntu18` host. **NOTE: this version (2022-01-27) has been updated for the `v1.3.0` version of the `OAI 5G CN`.** -**TABLE OF CONTENTS** +**Table of Contents** -1. [Retrieving the images on Docker-Hub](#1-retrieving-the-images-on-docker-hub) -2. [Deploy containers](#2-deploy-containers) - 1. [Deploy OAI 5G Core Network](#21-deploy-oai-5g-core-network) - 2. [Deploy OAI gNB in RF simulator mode and in Standalone Mode](#22-deploy-oai-gnb-in-rf-simulator-mode-and-in-standalone-mode) - 3. [Deploy OAI NR-UE in RF simulator mode and in Standalone Mode](#23-deploy-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) - 4. [Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode](#24-deploy-second-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) -3. [Check traffic](#3-check-traffic) - 1. [Check your Internet connectivity](#31-check-your-internet-connectivity) - 2. [Start the iperf server inside the NR-UE container](#32-start-the-iperf-server-inside-the-nr-ue-container) - 3. [Start the iperf client inside the ext-dn container](#33-start-the-iperf-client-inside-the-ext-dn-container) -4. [Un-deployment](#4-un-deployment) -5. [Explanations on the configuration in the docker-compose.yaml](##5-explanations-on-the-configuration-in-the-docker-composeyaml) - 1. [Making the NR-UE connect to the core network](#51-making-the-nr-ue-connect-to-the-core-network) - 2. [Making the gNB connect to the core network](#52-making-the-gnb-connect-to-the-core-network) +[[_TOC_]] # 1. Retrieving the images on Docker-Hub # diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index 38eaeac433..d08c1e9b2a 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -1,30 +1,6 @@ **Table of Contents** -1. [Functional Split Architecture](#functional-split-architecture) -2. [OpenAirInterface Block Diagram](#openairinterface-block-diagram) -2. [OpenAirInterface 4G-LTE eNB Feature Set](#openairinterface-4g-lte-enb-feature-set) - 1. [eNB PHY Layer](#enb-phy-layer) - 2. [eNB MAC Layer](#enb-mac-layer) - 3. [eNB RLC Layer](#enb-rlc-layer) - 4. [eNB PDCP Layer](#enb-pdcp-layer) - 5. [eNB RRC Layer](#enb-rrc-layer) - 6. [eNB X2AP](#enb-x2ap) - 7. [eNB/MCE M2AP](#enbmce-m2ap) - 8. [MCE/MME M3AP](#mcemme-m3ap) -3. [OpenAirInterface 4G-LTE UE Feature Set](#openairinterface-4g-lte-ue-feature-set) - 1. [LTE UE PHY Layer](#lte-ue-phy-layer) - 2. [LTE UE MAC Layer](#lte-ue-mac-layer) - 3. [LTE UE RLC Layer](#lte-ue-rlc-layer) - 4. [LTE UE PDCP Layer](#lte-ue-pdcp-layer) - 5. [LTE UE RRC Layer](#lte-ue-rrc-layer) -4. [OpenAirInterface 5G-NR gNB Feature Set](#openairinterface-5g-nr-feature-set) - 1. [General Parameters](#general-parameters) - 2. [gNB Physical Layer](#gnb-phy-layer) - 3. [gNB Higher Layers](#gnb-higher-layers) -5. [OpenAirInterface 5G-NR UE Feature Set](#openairinterface-5g-nr-ue-feature-set) - 1. [UE Physical Layer](#ue-phy-layer) - 2. [UE Higher Layers](#ue-higher-layers) - +[[_TOC_]] # Functional Split Architecture # diff --git a/doc/L1SIM.md b/doc/L1SIM.md index 9cae67a66c..7e6d893a2e 100644 --- a/doc/L1SIM.md +++ b/doc/L1SIM.md @@ -14,13 +14,9 @@ This page is valid for the develop branch -# Table of Contents: # +**Table of Contents** -* [How to build the eNB and the UE](#build) -* [How to run an eNB built with the noS1 option](#run-noS1-eNB) -* [How to run a UE built with the noS1 option](#run-noS1-UE) -* [Continuous Integration notes](#CInote) -* [How to ping an eNB from a UE and vice versa (with the noS1 option)](#noS1-pinging) +[[_TOC_]] The old oaisim is dead! Long live oaisim! :) diff --git a/doc/L2NFAPI_NOS1.md b/doc/L2NFAPI_NOS1.md index 4f56be3416..0d4d6b538c 100644 --- a/doc/L2NFAPI_NOS1.md +++ b/doc/L2NFAPI_NOS1.md @@ -16,19 +16,9 @@ **2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.** -## Table of Contents ## +**Table of Contents** -1. [Environment](#1-environment) -2. [Retrieve the OAI eNB-UE source code](#2-retrieve-the-oai-enb-ue-source-code) -3. [Setup of the USIM information in UE folder](#3-setup-of-the-usim-information-in-ue-folder) -4. [Setup of the Configuration files](#4-setup-of-the-configuration-files) - 1. [The eNB Configuration file](#41-the-enb-configuration-file) - 2. [The UE Configuration file](#42-the-ue-configuration-file) -5. [Build OAI UE and eNodeB](#5-build-oai-ue-and-enodeb) -6. [Start the eNB](#6-start-the-enb) -7. [Start the UE](#7-start-the-ue) -8. [Test with ping](#8-test-with-ping) -9. [Limitations](#9-limitations) +[[_TOC_]] # 1. Environment # diff --git a/doc/L2NFAPI_S1.md b/doc/L2NFAPI_S1.md index 824e9e469a..2d3de04b43 100644 --- a/doc/L2NFAPI_S1.md +++ b/doc/L2NFAPI_S1.md @@ -16,21 +16,9 @@ **2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.** -## Table of Contents ## +**Table of Contents** -1. [Environment](#1-environment) -2. [Prepare the EPC](#2-prepare-the-epc) -3. [Retrieve the OAI eNB-UE source code](#3-retrieve-the-oai-enb-ue-source-code) -4. [Setup of the USIM information in UE folder](#4-setup-of-the-usim-information-in-ue-folder) -5. [Setup of the Configuration files](#5-setup-of-the-configuration-files) - 1. [The eNB Configuration file](#51-the-enb-configuration-file) - 2. [The UE Configuration file](#52-the-ue-configuration-file) -6. [Build OAI UE and eNodeB](#6-build-oai-ue-and-enodeb) -7. [Start EPC](#7-start-epc) -8. [Start the eNB](#8-start-the-enb) -9. [Start the UE](#9-start-the-ue) -10. [Test with ping](#10-test-with-ping) -11. [Limitations](#11-limitations) +[[_TOC_]] # 1. Environment # diff --git a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md index d5149a6c4e..745659deb1 100644 --- a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md @@ -12,29 +12,9 @@ -**TABLE OF CONTENTS** - -1. [Scenario](#1-scenario) -2. [OAI CN5G](#2-oai-cn5g) - 1. [OAI CN5G pre-requisites](#21-oai-cn5g-pre-requisites) - 2. [OAI CN5G Setup](#22-oai-cn5g-setup) - 3. [OAI CN5G Configuration files](#23-oai-cn5g-configuration-files) - 4. [SIM Card](#24-sim-card) -3. [OAI gNB](#3-oai-gnb) - 1. [OAI gNB pre-requisites](#31-oai-gnb-pre-requisites) - 2. [Build OAI gNB](#32-build-oai-gnb) - 3. [N300 Ethernet Tuning](#33-n300-ethernet-tuning) -4. [Run OAI CN5G and OAI gNB](#4-run-oai-cn5g-and-oai-gnb) - 1. [Run OAI CN5G](#41-run-oai-cn5g) - 2. [Run OAI gNB](#42-run-oai-gnb) - 1. [USRP B210](#usrp-b210) - 2. [USRP N300](#usrp-n300) - 3. [USRP X300](#usrp-x300) -5. [Testing with QUECTEL RM500Q](#5-testing-with-quectel-rm500q) - 1. [Setup QUECTEL](#51-setup-quectel) - 2. [Ping test](#52-ping-test) - 3. [Downlink iPerf test](#53-downlink-iperf-test) +**Table of Contents** +[[_TOC_]] # 1. Scenario In this tutorial we describe how to configure and run a 5G end-to-end setup with OAI CN5G, OAI gNB and COTS UE. diff --git a/doc/TESTBenches.md b/doc/TESTBenches.md index 7bad43df65..9a2d9e22f2 100644 --- a/doc/TESTBenches.md +++ b/doc/TESTBenches.md @@ -1,9 +1,6 @@ -## Table of Contents ## +**Table of Contents** -1. [Machines](#machines) -2. [Networked devices](#networked-devices) -3. [Testbenches](#testbenches) -4. [Pipelines](#pipelines) +[[_TOC_]] ## Machines diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md index b12b3478e8..1828f967b1 100644 --- a/doc/TESTING_5GSA_setup.md +++ b/doc/TESTING_5GSA_setup.md @@ -12,16 +12,9 @@ -**TABLE OF CONTENTS** +**Table of Contents** -1. [SA setup with COTS UE](#1--sa-setup-with-cots-ue) - 1. [gNB build and configuration](#11--gnb-build-and-configuration) - 2. [OAI 5G Core Network installation and configuration](#12--oai-5g-core-network-installation-and-configuration) - 3. [Execution of SA scenario](#13--execution-of-sa-scenario) -2. [SA Setup with OAI NR UE Softmodem](#2-sa-setup-with-oai-nr-ue-softmodem) - 1. [Build and configuration](#21-build-and-configuration) - 2. [OAI 5G Core Network installation and configuration](#22--oai-5g-core-network-installation-and-configuration) - 3. [Execution of SA scenario](#23-execution-of-sa-scenario) +[[_TOC_]] In the following tutorial we describe how to deploy configure and test the two SA OAI setups: diff --git a/doc/TESTING_GNB_W_COTS_UE.md b/doc/TESTING_GNB_W_COTS_UE.md index 84f43bfc27..fa24d74d5d 100644 --- a/doc/TESTING_GNB_W_COTS_UE.md +++ b/doc/TESTING_GNB_W_COTS_UE.md @@ -1,20 +1,8 @@ STATUS 2020/10/15 : added External Resources section and links +**Table of Contents** -## Table of Contents ## - -1. [External Resources](#external-resources) -2. [Configuration Overview](#configuration-overview) -3. [SW Repository / Branch](#repository) -4. [Architecture Setup](#architecture-setup) -5. [Build / Install](#build-and-install) -6. [Run / Test](#run-and-test) -7. [Test case](#test-case) -8. [Log file monitoring](#log-file-monitoring) -9. [Required tools for debug](#required-tools-for-debug) -10. [Status of interoperability](#status-of-interoperability) -11. [CI integration](#ci-integration) - +[[_TOC_]] ## External Resources diff --git a/docker/README.md b/docker/README.md index c4d799c6ce..ace75161df 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,12 +16,7 @@ **Table of Contents** -1. [Build Strategy](#1-build-strategy) -2. [File organization](#2-file-organization) -3. [Building using docker under Ubuntu 18.04](#3-building-using-docker-under-ubuntu-1804) -4. [Building using podman under Red Hat Entreprise Linux 8.2](#4-building-using-podman-under-red-hat-entreprise-linux-82) -5. [Running modems using docker under Ubuntu 18.04](#5-running-modems-using-docker-under-ubuntu-1804) -6. [Running modems using podman under Red Hat Entreprise Linux 8.2](#6-running-modems-using-podman-under-red-hat-entreprise-linux-82) +[[_TOC_]] --- From 3839abebe7623576c10e9117deff096881a7f664 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 12 Oct 2022 16:11:50 +0100 Subject: [PATCH 40/48] Add section with optional advanced configurations --- doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md index 745659deb1..7cd277eea4 100644 --- a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md @@ -244,3 +244,9 @@ iperf -s -u -i 1 -B 12.1.1.2 ```bash docker exec -it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -b 100M -c 12.1.1.2 ``` + +# 6. Advanced configuration (optional) + +- If you get real-time problems on heavy UL traffic, reduce the maximum UL MCS using an additional command-line switch: `--MACRLCs.[0].ul_max_mcs 14`. + +- There is noise on the DC carriers on N300 and especially the X300 in UL. To avoid their use or shift them away from the center to use more UL spectrum, use the `--tune-offset ` command line switch, where `` is ideally half the bandwidth, or possibly less. From 89d6ddc482c9e6e9dbc9e1fb6c3253cfe562d35a Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 12 Oct 2022 16:40:32 +0100 Subject: [PATCH 41/48] Remove Dedicated BWPs from the 40 MHz configuration file used by the tutorials --- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 58 ------------------- 1 file changed, 58 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 5efbac8024..02418f9883 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -155,64 +155,6 @@ gNBs = ); -# Dedicated Serving Cell Configuration -servingCellConfigDedicated = ({ - # BWP-Downlink - # BWP 1 Configuration - dl_bwp-Id_1 = 1; - dl_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW) - # subcarrierSpacing - # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_bwp1_subcarrierSpacing = 1; - - # BWP 2 Configuration - dl_bwp-Id_2 = 2; - dl_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW) - # subcarrierSpacing - # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_bwp2_subcarrierSpacing = 1; - - # BWP 3 Configuration - dl_bwp-Id_3 = 3; - dl_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW) - # subcarrierSpacing - # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_bwp3_subcarrierSpacing = 1; - - firstActiveDownlinkBWP-Id = 1; #BWP-Id - defaultDownlinkBWP-Id = 1; #BWP-Id - - # bwp-InactivityTimer ENUMERATED {ms2, ms3, ms4, ms5, ms6, ms8, ms10, ms20, ms30, - # ms40,ms50, ms60, ms80,ms100, ms200,ms300, ms500, - # ms750, ms1280, ms1920, ms2560, spare10, spare9, spare8, - # spare7, spare6, spare5, spare4, spare3, spare2, spare1 } - - # UplinkConfig - # BWP-Uplink - # BWP 1 Configuration - ul_bwp-Id_1 = 1; - ul_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW) - # subcarrierSpacing - # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_bwp1_subcarrierSpacing = 1; - - # BWP 2 Configuration - ul_bwp-Id_2 = 2; - ul_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW) - # subcarrierSpacing - # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_bwp2_subcarrierSpacing = 1; - - # BWP 3 Configuration - ul_bwp-Id_3 = 3; - ul_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW) - # subcarrierSpacing - # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_bwp3_subcarrierSpacing = 1; - - firstActiveUplinkBWP-Id = 1; #BWP-Id - } -); # ------- SCTP definitions SCTP : From 94c74012e22ccb96127f93973c39e503acf787da Mon Sep 17 00:00:00 2001 From: mir Date: Thu, 13 Oct 2022 16:58:37 +0200 Subject: [PATCH 42/48] Remove threads_t struct from the code --- executables/nr-softmodem.h | 2 -- executables/threads_t.h | 21 --------------------- targets/COMMON/threads_t.h | 21 --------------------- targets/RT/USER/lte-softmodem.h | 1 - targets/RT/USER/lte-ue.c | 17 ----------------- 5 files changed, 62 deletions(-) delete mode 100644 executables/threads_t.h delete mode 100644 targets/COMMON/threads_t.h diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 22b213a8d9..69e441acb8 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -34,8 +34,6 @@ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ } -#include "threads_t.h" -extern threads_t threads; extern uint32_t target_dl_mcs; extern uint32_t target_dl_Nl; extern uint32_t target_ul_Nl; diff --git a/executables/threads_t.h b/executables/threads_t.h deleted file mode 100644 index c4b233ccc9..0000000000 --- a/executables/threads_t.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _EXECUTABLES_THREADS_T_H_ -#define _EXECUTABLES_THREADS_T_H_ - -typedef struct threads_s { - int main; - int sync; - int one; - int two; - int three; - int slot1_proc_one; - int slot1_proc_two; - int slot1_proc_three; - //int dlsch_td_one; - //int dlsch_td_two; - //int dlsch_td_three; - //int dlsch_td1_one; - //int dlsch_td1_two; - //int dlsch_td1_three; -} threads_t; - -#endif /* _EXECUTABLES_THREADS_T_H_ */ diff --git a/targets/COMMON/threads_t.h b/targets/COMMON/threads_t.h deleted file mode 100644 index 5fb1645444..0000000000 --- a/targets/COMMON/threads_t.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _TARGETS_COMMON_THREADS_T_H_ -#define _TARGETS_COMMON_THREADS_T_H_ - -typedef struct threads_s { - int main; - int sync; - int one; - int two; - int three; - int slot1_proc_one; - int slot1_proc_two; - int slot1_proc_three; - //int dlsch_td_one; - //int dlsch_td_two; - //int dlsch_td_three; - //int dlsch_td1_one; - //int dlsch_td1_two; - //int dlsch_td1_three; -} threads_t; - -#endif /* _TARGETS_COMMON_THREADS_T_H_ */ diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 774561e268..ca15c7ed31 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -19,7 +19,6 @@ #include #include #include -#include "threads_t.h" #include "sdr/COMMON/common_lib.h" //#undef MALLOC #include "assertions.h" diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 73520dd918..5b59e91f43 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -151,8 +151,6 @@ static const eutra_band_t eutra_bands[] = { }; -threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1}; - pthread_t main_ue_thread; pthread_attr_t attr_UE_thread; struct sched_param sched_param_UE_thread; @@ -469,9 +467,6 @@ static void *UE_thread_synch(void *arg) { cpu_set_t cpuset; CPU_ZERO(&cpuset); - if ( threads.sync != -1 ) - CPU_SET(threads.sync, &cpuset); - // this thread priority must be lower that the main acquisition thread sprintf(threadname, "sync UE %d\n", UE->Mod_id); init_thread(100000, 500000, FIFO_PRIORITY-1, &cpuset, threadname); @@ -774,15 +769,6 @@ static void *UE_thread_rxn_txnp4(void *arg) { cpu_set_t cpuset; CPU_ZERO(&cpuset); - if ( (proc->sub_frame_start+1)%RX_NB_TH == 0 && threads.one != -1 ) - CPU_SET(threads.one, &cpuset); - - if ( RX_NB_TH > 1 && (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.two != -1 ) - CPU_SET(threads.two, &cpuset); - - if ( RX_NB_TH > 2 && (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.three != -1 ) - CPU_SET(threads.three, &cpuset); - //CPU_SET(threads.three, &cpuset); init_thread(900000,1000000, FIFO_PRIORITY-1, &cpuset, threadname); @@ -1936,9 +1922,6 @@ void *UE_thread(void *arg) { cpu_set_t cpuset; CPU_ZERO(&cpuset); - if ( threads.main != -1 ) - CPU_SET(threads.main, &cpuset); - init_thread(100000, 500000, FIFO_PRIORITY, &cpuset, "UHD Threads"); /* while (sync_var<0) From cc8da80fbc49c5ea7231ea36f4ad76e0a093ccd4 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Oct 2022 18:45:08 +0200 Subject: [PATCH 43/48] Remove EXMIMO leftover - Remove all files referencing EXMIMO - Remove all targets/variables/defines that seem to be related to EXMIMO --- CMakeLists.txt | 24 +---- cmake_targets/build_oai | 47 +--------- cmake_targets/epc_test/CMakeLists.template | 58 ------------ .../s1c_mme_test/CMakeLists.template | 63 ------------- cmake_targets/tools/build_helper | 1 - .../tools/example_enb_exmimo_mme_hss.txt | 91 ------------------- cmake_targets/tools/exmimo2_2arxg.lime | 10 -- cmake_targets/tools/exmimo2_2brxg.lime | 10 -- cmake_targets/tools/exmimo_stop_octave.m | 4 - executables/nr-softmodem-common.h | 3 +- executables/nr-ue.c | 4 +- executables/softmodem-common.h | 1 - openair1/PHY/LTE_TRANSPORT/print_stats.c | 12 --- openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c | 12 --- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 2 +- openair1/PHY/TOOLS/calibration_test.c | 2 - openair1/PHY/TOOLS/smbv.h | 7 -- openair1/PHY/impl_defs_top.h | 6 -- openair1/PHY/impl_defs_top_NB_IoT.h | 6 -- openair1/SCHED_NR_UE/defs.h | 10 -- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 10 +- openair1/SCHED_UE/phy_procedures_lte_ue.c | 34 ------- openair1/SCHED_UE/sched_UE.h | 8 -- openair2/LAYER2/MAC/ue_procedures.c | 9 -- .../LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c | 3 - openair2/LAYER2/openair2_proc.c | 4 - openair2/RRC/LTE/rrc_eNB.c | 12 +-- openair2/RRC/LTE/rrc_eNB_S1AP.c | 8 -- sdr/BLADERF/USERSPACE/LIB/bladerf_lib.c | 5 +- sdr/COMMON/common_lib.c | 1 - sdr/COMMON/common_lib.h | 6 +- sdr/ETHERNET/USERSPACE/LIB/ethernet_lib.c | 4 +- sdr/ETHERNET/benetel/4g/benetel.c | 4 +- sdr/ETHERNET/benetel/5g/benetel.c | 4 +- sdr/IRIS/USERSPACE/LIB/iris_lib.cpp | 40 ++++---- sdr/LMSSDR/USERSPACE/LIB/lms_lib.cpp | 3 +- sdr/USRP/USERSPACE/LIB/usrp_lib.cpp | 21 ++--- sdr/rfsimulator/simulator.c | 2 +- targets/COMMON/openairinterface5g_limits.h | 63 ------------- targets/README.txt | 1 - targets/RT/LAUNCH_SCRIPTS/load_module.sh | 7 -- targets/RT/LAUNCH_SCRIPTS/nas_enb.sh | 21 ----- targets/RT/LAUNCH_SCRIPTS/nas_ue.sh | 18 ---- targets/RT/LAUNCH_SCRIPTS/nas_ue2.sh | 18 ---- targets/RT/LAUNCH_SCRIPTS/start_eNb_mode1.sh | 13 --- targets/RT/LAUNCH_SCRIPTS/start_eNb_mode2.sh | 10 -- targets/RT/LAUNCH_SCRIPTS/start_eNb_mode6.sh | 13 --- targets/RT/LAUNCH_SCRIPTS/start_emos.sh | 10 -- targets/RT/LAUNCH_SCRIPTS/start_rf.sh | 2 - targets/RT/LAUNCH_SCRIPTS/start_test_fs4.sh | 13 --- targets/RT/LAUNCH_SCRIPTS/start_ue.sh | 18 ---- targets/RT/LAUNCH_SCRIPTS/start_ue2.sh | 14 --- targets/RT/LAUNCH_SCRIPTS/stop_rf.sh | 7 -- targets/RT/USER/.runinfo | 40 -------- targets/RT/USER/eNB_exmimo2.gtkw | 64 ------------- targets/RT/USER/exmimo2_2arxg.lime | 10 -- targets/RT/USER/exmimo2_2brxg.lime | 10 -- targets/RT/USER/init_exmimo.sh | 12 --- targets/RT/USER/init_exmimo2.sh | 69 -------------- targets/RT/USER/lte-ru.c | 2 +- targets/RT/USER/lte-softmodem.h | 2 +- targets/RT/USER/lte-ue.c | 8 +- targets/RT/USER/lte-uesoftmodem.c | 3 - targets/RT/USER/ue_exmimo2.gtkw | 59 ------------ 64 files changed, 49 insertions(+), 1009 deletions(-) delete mode 100755 cmake_targets/epc_test/CMakeLists.template delete mode 100755 cmake_targets/s1c_mme_test/CMakeLists.template delete mode 100755 cmake_targets/tools/example_enb_exmimo_mme_hss.txt delete mode 100755 cmake_targets/tools/exmimo2_2arxg.lime delete mode 100755 cmake_targets/tools/exmimo2_2brxg.lime delete mode 100755 cmake_targets/tools/exmimo_stop_octave.m delete mode 100644 targets/RT/LAUNCH_SCRIPTS/load_module.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/nas_enb.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/nas_ue.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/nas_ue2.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_eNb_mode1.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_eNb_mode2.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_eNb_mode6.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_emos.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_rf.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_test_fs4.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_ue.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/start_ue2.sh delete mode 100644 targets/RT/LAUNCH_SCRIPTS/stop_rf.sh delete mode 100644 targets/RT/USER/.runinfo delete mode 100644 targets/RT/USER/eNB_exmimo2.gtkw delete mode 100644 targets/RT/USER/exmimo2_2arxg.lime delete mode 100644 targets/RT/USER/exmimo2_2brxg.lime delete mode 100644 targets/RT/USER/init_exmimo.sh delete mode 100644 targets/RT/USER/init_exmimo2.sh delete mode 100644 targets/RT/USER/ue_exmimo2.gtkw diff --git a/CMakeLists.txt b/CMakeLists.txt index 06184ac619..baffcf32fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ include_directories(${CRYPTO_INCLUDE_DIRS}) #uhd 4.0 and iris installs by default in /usr/local include_directories("/usr/local/include/") #use native cmake method as this package is not in pkg-config -add_list2_option(RF_BOARD "None" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU" "EXMIMO") +add_list2_option(RF_BOARD "None" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU") if (${RF_BOARD} STREQUAL "OAI_USRP") find_package(Boost REQUIRED) @@ -904,8 +904,6 @@ add_boolean_option(LINUX_LIST False "used only in lists.c: either u ########################## # PHY options ########################## -add_boolean_option(DRIVER2013 True "only relevant for EXMIMO") -add_boolean_option(EXMIMO_IOT True "????") add_boolean_option(LOCALIZATION False "???") add_integer_option(MAX_NUM_CCs 1 "????") add_boolean_option(SMBV False "Rohde&Schwarz SMBV100A vector signal generator") @@ -3084,7 +3082,7 @@ if (${T_TRACER}) nr_ulschsim ldpctest polartest smallblocktest cu_test du_test #all "add_library" definitions ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP - params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer + params_libconfig oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer oai_eth_transpro oai_mobipass coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB @@ -3181,24 +3179,6 @@ if(OAI_NW_DRIVER_USE_NETLINK) endif() make_driver(ue_ip ${OPENAIR2_DIR}/NETWORK_DRIVER/UE_IP ${ue_ip_src}) - -foreach(file IN ITEMS ${OCT_FILES}) - string(REGEX REPLACE "oct *$" "cc" src ${file}) - add_custom_command( - OUTPUT ${file} - DEPENDS ${OCT_DIR}/${src} OPENAIR0_LIB - COMMAND mkoctfile - ARGS ${OCT_FLAGS} ${OCT_INCL} ${OCT_LIBS} - ARGS -o ${file} ${OCT_DIR}/${src} - COMMENT "Generating ${file}" - VERBATIM - ) -endforeach(file) - -ADD_CUSTOM_TARGET(oarf - DEPENDS ${OCT_FILES} -) - include (${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_CMakeLists.txt) include(${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/CMakeLists.txt) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 5ed0ea3c9b..aaa1bee646 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -110,7 +110,7 @@ Options: --UE-gen-nvram [output path] Specify gen_nvram_path (default \"$gen_nvram_path\") -w | --hardware - EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default) + USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default) Adds this RF board support (in external packages installation and in compilation) -t | --transport Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g @@ -172,13 +172,7 @@ Options: --sanitize-undefined | -fsanitize=undefined Enable the undefined behavior sanitizer on all targets -h | --help - Print this help - -Usage (first build): - NI/ETTUS B201 + COTS UE : ./build_oai -I -i --eNB -w USRP -Usage (regular): - Eurecom EXMIMO + OAI ENB : ./build_oai --eNB - NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -w USRP" + Print this help" } @@ -293,9 +287,6 @@ function main() { -w | --hardware) # Use OAI_USRP as the key word USRP is used inside UHD driver case "$2" in - "EXMIMO") - HW="EXMIMO" - ;; "USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "ADRV9371_ZC706" | "SIMU" | "AW2SORI") HW="OAI_"$2 ;; @@ -491,16 +482,6 @@ function main() { echo_info "RF HW set to $HW" # If the user doesn't specify the Linux scheduler to use, we set a value - if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then - case "$HW" in - "EXMIMO") - DEADLINE_SCHEDULER_FLAG_USER="True" - ;; - *) - DEADLINE_SCHEDULER_FLAG_USER="False" - ;; - esac - fi #Disable CPU Affinity for deadline scheduler if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then @@ -712,22 +693,6 @@ function main() { compilations $BUILD_DIR test_$f done fi - - #################################### - # EXMIMO drivers & firmware loader # - #################################### - if [ "$HW" = "EXMIMO" ] ; then - echo_info "Compiling Express MIMO 2 board drivers" - compilations $BUILD_DIR openair_rf - compilations $BUILD_DIR updatefw - echo_info "Compiling oarf tools. The logfile for compilation is here: $dlog/oarf.txt" - make -C $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build oarf > $dlog/oarf.txt 2>&1 - if [ -s $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build/oarf_config_exmimo.oct ] ; then - echo_success "oarf tools compiled" - else - echo_error "oarf tools compilation failed" - fi - fi ###################### # Optional libraries # @@ -747,13 +712,7 @@ function main() { if [ "$HW" != "None" ] ; then rm -f liboai_device.so - # link liboai_device.so with the selected RF device library - if [ "$HW" == "EXMIMO" ] ; then - compilations $BUILD_DIR oai_exmimodevif - - ln -sf liboai_exmimodevif.so liboai_device.so - echo_info "liboai_device.so is linked to EXMIMO device library" - elif [ "$HW" == "OAI_USRP" ] ; then + if [ "$HW" == "OAI_USRP" ] ; then compilations $BUILD_DIR oai_usrpdevif ln -sf liboai_usrpdevif.so liboai_device.so diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template deleted file mode 100755 index 28da13437c..0000000000 --- a/cmake_targets/epc_test/CMakeLists.template +++ /dev/null @@ -1,58 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( ASN_DEBUG False) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( EMIT_ASN_DEBUG False ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING True ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME True ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U True) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_UE True) -set ( NAS_MME False ) -set ( NAS_UE True ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NO_RRM True ) -set ( OAISIM False ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR2 True ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "epc_test" ) -set ( PDCP_USE_NETLINK True ) -set ( PDCP_MSG_PRINT False ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( RF_BOARD "False" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RRC_DEFAULT_RAB_IS_AM True) -set ( RRC_MSG_PRINT False ) -set ( SECU False ) -set ( SMBV False ) -set ( TEST_OMG False ) -set ( USE_MME "R10" ) -set ( XER_PRINT True ) diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template deleted file mode 100755 index d2d2d3e053..0000000000 --- a/cmake_targets/s1c_mme_test/CMakeLists.template +++ /dev/null @@ -1,63 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING True ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_PDCP_NETLINK_FIFO False ) -set ( ENABLE_RAL False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME True ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U True) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_UE True) -set ( NAS_MME False ) -set ( NAS_UE True ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NO_RRM True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR2 True ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PDCP_USE_NETLINK True ) -set ( PDCP_MSG_PRINT False ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( RF_BOARD "False" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RRC_DEFAULT_RAB_IS_AM True) -set ( RRC_MSG_PRINT False ) -set ( SECU False ) -set ( SMBV False ) -set ( TEST_OMG False ) - -set ( TEST_S1C_MME True ) - -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( XER_PRINT False ) -set ( XFORMS False ) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index adc0a636db..396c8dd4aa 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -160,7 +160,6 @@ clean_kernel() { echo_info "Flushed iptables" $SUDO rmmod nasmesh > /dev/null 2>&1 $SUDO rmmod oai_nw_drv > /dev/null 2>&1 - $SUDO rmmod openair_rf > /dev/null 2>&1 $SUDO rmmod ue_ip > /dev/null 2>&1 echo_info "removed drivers from kernel" } diff --git a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt deleted file mode 100755 index b55266dfe7..0000000000 --- a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt +++ /dev/null @@ -1,91 +0,0 @@ -#/* -# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The OpenAirInterface Software Alliance licenses this file to You under -# * the OAI Public License, Version 1.1 (the "License"); you may not use this file -# * except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.openairinterface.org/?page_id=698 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# *------------------------------------------------------------------------------- -# * For more information about the OpenAirInterface (OAI) Software Alliance: -# * contact@openairinterface.org -# */ - -# file example_enb_exmimo_mme_hss.txt -# brief -# author Lionel Gauthier - -TODO: a document file, PDF for example, with nice pictures, etc -This example shows how to generate and launch enb, mme_gw, hss executables on the same host: - -################ -Configuration -################ -freediameter 1.2.0 (not 1.1.5, 1.1.6,...) has to be installed and patched (done by check_install_oai_software() calling install_freediameter_from_source() in script build_helper) - -Config File: -/etc/hosts must contain the fqdn of the MME and HSS (same since both run on the same host): -(assuming the realm is openair4G.eur) -127.0.0.1 localhost -127.0.1.1 yang.openair4G.eur yang -... - -################ -BUILDING, RUNNING -################ - -Building HSS: -yang@yang:~/openair4G/trunk/cmake_targets$ tools/build_hss -c --connect-to-mme yang.openair4G.eur -t -T --realm openair4G.eur - -Configuring the HSS: -In oai_db (easier for newbies to access HSS database through http://127.0.0.1/phpmyadmin) - In table mmeidentity, enter the record corresponding to your MME: - (idmmeidentity, mmehost, mmerealm) - In table pdn, enter the record allowing an IMSI to connect to an APN - In table users, enter the record corresponding to your USIM card. - -Running the HSS: -yang@yang:~/openair4G/trunk/cmake_targets$ sudo tools/run_hss -g - - - -Building the MME-GW: -yang@yang:~/openair4G/trunk/cmake_targets/tools$ ./build_epc -c -d -t -T --s6a-server - -Configuring the MME-GW: - You can configure in file openair4G/trunk/cmake_targets/tools/epc.local.enb.conf.in the following parameters: - MCC/MNC of your network - SGI interface (outgoing interface of the S/P-GW) - Integrity algorithms, Ciphering algorithms - Please note that DNS addresses are hardcoded in source code (TODO in list). - -Running the MME-GW: -yang@yang:~/openair4G/trunk/cmake_targets/tools$ sudo ./run_epc -l -g -K - - - -Building eNB: -yang@yang:~/openair4G/trunk/cmake_targets$ ./build_oai --eNB - -Running eNB: -yang@yang:~/openair4G/trunk/cmake_targets$ sudo tools/run_enb_s1_exmimo -c /home/yang/openair4G/trunk/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.yang.epc.eurecom.conf -S -K - - -################ -Tools available: -############### - -1) itti_analyser (list messages exchanged between protocol layers) -2) xforms (Layer 1) -3) vcd (timing mesurements) - - - diff --git a/cmake_targets/tools/exmimo2_2arxg.lime b/cmake_targets/tools/exmimo2_2arxg.lime deleted file mode 100755 index 0c24ef9992..0000000000 --- a/cmake_targets/tools/exmimo2_2arxg.lime +++ /dev/null @@ -1,10 +0,0 @@ -# this file contains the calibration values to compute the RSSI -# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning -# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB -# this is for Express MIMO2 without any additional RF frontend -# high gain -103 107 106 104 -# med gain -98 101 100 98 -# low gain (byp) -94 97 96 94 diff --git a/cmake_targets/tools/exmimo2_2brxg.lime b/cmake_targets/tools/exmimo2_2brxg.lime deleted file mode 100755 index e99c738cd0..0000000000 --- a/cmake_targets/tools/exmimo2_2brxg.lime +++ /dev/null @@ -1,10 +0,0 @@ -# this file contains the calibration values to compute the RSSI -# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning -# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB -# this is for Express MIMO2 without any additional RF frontend -# high gain -128 128 128 126 -# med gain -122 123 123 120 -# low gain (byp) -116 117 116 116 diff --git a/cmake_targets/tools/exmimo_stop_octave.m b/cmake_targets/tools/exmimo_stop_octave.m deleted file mode 100755 index 82aa1f2845..0000000000 --- a/cmake_targets/tools/exmimo_stop_octave.m +++ /dev/null @@ -1,4 +0,0 @@ -n=oarf_get_num_detected_cards; -for i=n-1:0 - oarf_stop(i); -end diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 36eedd2d3b..6d1c384c5d 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -53,7 +53,7 @@ #define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n" #define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n" #define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n" -#define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n" +#define CONFIG_HLP_DMAMAP "use DMA memory mapping\n" #define CONFIG_HLP_EXCCLK "tells hardware to use a clock reference (0:internal(default), 1:external, 2:gpsdo)\n" #define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n" #define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n" @@ -62,7 +62,6 @@ #define CONFIG_HLP_ULOFF "Set the uplink frequnecy offset for all component carriers\n" #define CONFIG_HLP_CHOFF "Channel id offset\n" #define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n" -#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n" #define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n" #define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n" #define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 1781ea3d91..030a8c3c48 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -572,7 +572,7 @@ static void UE_synch(void *arg) { openair0_cfg[UE->rf_map.card].rx_freq[0], openair0_cfg[UE->rf_map.card].tx_freq[0]); - UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); + UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0]); if (UE->UE_scan_carrier == 1) { UE->UE_scan_carrier = 0; } else { @@ -591,7 +591,7 @@ static void UE_synch(void *arg) { LOG_I(PHY, "Initial sync failed: trying carrier off %d Hz\n", freq_offset); - UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); + UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0]); } } break; diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index f0e60f54aa..67def9e2ef 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -67,7 +67,6 @@ extern "C" #define CONFIG_HLP_ULF "Set the uplink frequency offset for all component carriers\n" #define CONFIG_HLP_CHOFF "Channel id offset\n" #define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n" -#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n" #define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n" #define CONFIG_HLP_DLMCS "Set the maximum downlink MCS\n" #define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n" diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 44f57f4304..bdd3cb6f45 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -81,9 +81,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char *buffer, int length ue->measurements.n0_power_dB[0], ue->measurements.n0_power_dB[1]); */ -#ifdef EXMIMO - len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]); -#endif len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",ue->rx_total_gain_dB); len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz, estimated carrier frequency %f Hz\n",ue->common_vars.freq_offset,openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset); len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[ue->UE_mode[0]],ue->UE_mode[0]); @@ -496,15 +493,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char *buffer, int length 10*log10(ue->measurements.n0_power_tot), ue->measurements.n0_power_dB[0], ue->measurements.n0_power_dB[1]); -#ifdef EXMIMO - ue->rx_total_gain_dB = ((int)(10*log10(ue->measurements.rssi)))-input_level_dBm; - len += sprintf(&buffer[len], "[UE PROC] rxg_mode %d, input level (set by user) %d dBm, VGA gain %d dB ==> total gain %3.2f dB, noise figure %3.2f dB\n", - openair0_cfg[0].rxg_mode[0], - input_level_dBm, - (int)openair0_cfg[0].rx_gain[0], - 10*log10(ue->measurements.rssi)-input_level_dBm, - 10*log10(ue->measurements.n0_power_tot)-ue->rx_total_gain_dB+105); -#endif } len += sprintf(&buffer[len],"EOF\n"); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c index 4faa8367c3..6c05990929 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c @@ -481,18 +481,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; } -#if defined(EXMIMO) - - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; kcommon_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; - } -#endif #if defined(PRACH_WRITE_OUTPUT_DEBUG) LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index efaf386fe1..94ffee4fc5 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -456,7 +456,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, phich_string[fp->phich_config_common.phich_resource], fp->nb_antenna_ports_gNB);*/ -#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) +#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", ue->Mod_id, openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset, diff --git a/openair1/PHY/TOOLS/calibration_test.c b/openair1/PHY/TOOLS/calibration_test.c index 9e611b6766..838f6293f7 100644 --- a/openair1/PHY/TOOLS/calibration_test.c +++ b/openair1/PHY/TOOLS/calibration_test.c @@ -108,7 +108,6 @@ int main(int argc, char **argv) { //! timing_source .time_source=internal, //internal gpsdo external //! Manual SDR IP address - //#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) .sdr_addrs=usrp_addrs, //! Auto calibration flag .autocal={0}, @@ -260,7 +259,6 @@ int main(int argc, char **argv) { /*! \brief Set RX feaquencies * \param device the hardware to use * \param openair0_cfg RF frontend parameters set by application - * \param exmimo_dump_config dump EXMIMO configuration * \returns 0 in success */ .trx_set_freq_func=NULL, diff --git a/openair1/PHY/TOOLS/smbv.h b/openair1/PHY/TOOLS/smbv.h index f8fab67d01..47b9130121 100644 --- a/openair1/PHY/TOOLS/smbv.h +++ b/openair1/PHY/TOOLS/smbv.h @@ -48,13 +48,6 @@ #define MAX_CONFIG_FRAMES 4 unsigned short slen; // sequence length in frames, max is 4 -/* -#ifdef EXMIMO -const unsigned short config_frames[MAX_CONFIG_FRAMES]; -#else -extern const unsigned short config_frames[MAX_CONFIG_FRAMES]; -#endif -*/ // function sends the config file "fname" to SMBV through socket sockfd int smbv_configure_from_file(int sockfd, const char* fname); diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index ad68bc5769..c28a5b4f7e 100644 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -175,15 +175,9 @@ #define NB_ANTENNA_PORTS_ENB 6 // total number of eNB antenna ports -#ifdef EXMIMO -#define TARGET_RX_POWER 55 // Target digital power for the AGC -#define TARGET_RX_POWER_MAX 55 // Maximum digital power, such that signal does not saturate (value found by simulation) -#define TARGET_RX_POWER_MIN 50 // Minimum digital power, anything below will be discarded (value found by simulation) -#else #define TARGET_RX_POWER 50 // Target digital power for the AGC #define TARGET_RX_POWER_MAX 65 // Maximum digital power, such that signal does not saturate (value found by simulation) #define TARGET_RX_POWER_MIN 35 // Minimum digital power, anything below will be discarded (value found by simulation) -#endif //the min and max gains have to match the calibrated gain table //#define MAX_RF_GAIN 160 diff --git a/openair1/PHY/impl_defs_top_NB_IoT.h b/openair1/PHY/impl_defs_top_NB_IoT.h index f7e0c7ff7f..bfabb59c12 100644 --- a/openair1/PHY/impl_defs_top_NB_IoT.h +++ b/openair1/PHY/impl_defs_top_NB_IoT.h @@ -179,15 +179,9 @@ #define NB_ANTENNA_PORTS_ENB 6 // total number of eNB antenna ports -#ifdef EXMIMO -#define TARGET_RX_POWER 55 // Target digital power for the AGC -#define TARGET_RX_POWER_MAX 55 // Maximum digital power, such that signal does not saturate (value found by simulation) -#define TARGET_RX_POWER_MIN 50 // Minimum digital power, anything below will be discarded (value found by simulation) -#else #define TARGET_RX_POWER 50 // Target digital power for the AGC #define TARGET_RX_POWER_MAX 65 // Maximum digital power, such that signal does not saturate (value found by simulation) #define TARGET_RX_POWER_MIN 35 // Minimum digital power, anything below will be discarded (value found by simulation) -#endif //the min and max gains have to match the calibrated gain table //#define MAX_RF_GAIN 160 diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index c4436341fc..57fde873e9 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -143,16 +143,6 @@ void processSlotTX(void *arg); @param abstraction_flag Indicator of PHY abstraction @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying */ -//void phy_procedures_UE_S_TX(PHY_VARS_NR_UE *ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type); - -/*! \brief Scheduling for UE RX procedures in TDD S-subframes. - @param phy_vars_ue Pointer to UE variables on which to act - @param eNB_id Local id of eNB on which to act - @param abstraction_flag Indicator of PHY abstraction - @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying -*/ -//void phy_procedures_UE_S_RX(PHY_VARS_NR_UE *ue,uint8_t eNB_id,uint8_t abstraction_flag, relaying_type_t r_type); - /*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. @param frame_parms Pointer to DL frame parameter descriptor diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index d74e5ee0e8..e131bcef2a 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -78,7 +78,7 @@ fifo_dump_emos_UE emos_dump_UE; char nr_mode_string[NUM_UE_MODE][20] = {"NOT SYNCHED","PRACH","RAR","RA_WAIT_CR", "PUSCH", "RESYNCH"}; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) +#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; #endif @@ -1808,14 +1808,6 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ue->prach_vars[gNB_id]->amp = AMP; - /* #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - tx_amp = get_tx_amp_prach(ue->tx_power_dBm[nr_slot_tx], ue->tx_power_max_dBm, ue->frame_parms.N_RB_UL); - if (tx_amp != -1) - ue->prach_vars[gNB_id]->amp = tx_amp; - #else - ue->prach_vars[gNB_id]->amp = AMP; - #endif */ - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN); prach_power = generate_nr_prach(ue, gNB_id, frame_tx, nr_slot_tx); diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index cdf4cf39f9..08c199943e 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -1210,19 +1210,6 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; } -#if defined(EXMIMO) - - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; kcommon_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; - } -#endif - /* only for debug LOG_I(PHY,"ul-signal [subframe: %d, ulsch_start %d, TA: %d, rxOffset: %d, timing_advance: %d, hw_timing_advance: %d]\n",subframe_tx, ulsch_start, ue->N_TA_offset, ue->rx_offset, ue->timing_advance, ue->hw_timing_advance); @@ -2236,27 +2223,6 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue, } } -void phy_procedures_UE_S_TX(PHY_VARS_UE *ue, - uint8_t eNB_id, - uint8_t abstraction_flag) { - int aa;//i,aa; - LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; - - for (aa=0; aanb_antennas_tx; aa++) { -#if defined(EXMIMO) //this is the EXPRESS MIMO case - int i; - - // set the whole tx buffer to RX - for (i=0; isamples_per_tti; i++) - ue->common_vars.txdata[aa][i] = 0x00010001; - -#else //this is the normal case - // memset(&ue->common_vars.txdata[aa][0],0, - // (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)*sizeof(int32_t)); -#endif //else EXMIMO - } -} - void ue_measurement_procedures(uint16_t l, // symbol index of each slot [0..6] PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, diff --git a/openair1/SCHED_UE/sched_UE.h b/openair1/SCHED_UE/sched_UE.h index 0dbb779630..1c9f9a391d 100644 --- a/openair1/SCHED_UE/sched_UE.h +++ b/openair1/SCHED_UE/sched_UE.h @@ -70,14 +70,6 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr void *UE_thread_slot1_dl_processing(void *arg); #endif -/*! \brief Scheduling for UE TX procedures in TDD S-subframes. - @param phy_vars_ue Pointer to UE variables on which to act - @param eNB_id Local id of eNB on which to act - @param abstraction_flag Indicator of PHY abstraction - @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying -*/ -void phy_procedures_UE_S_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag); - /*! \brief Scheduling for UE RX procedures in TDD S-subframes. @param phy_vars_ue Pointer to UE variables on which to act @param eNB_id Local id of eNB on which to act diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index d7796d1d40..2c04bc247c 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -29,10 +29,6 @@ * \email: raymond.knopp@eurecom.fr, navid.nikaein@eurecom.fr javier.morgade@ieee.org */ -#ifdef EXMIMO - #include -#endif - #include "mac_extern.h" #include "mac.h" #include "mac_proto.h" @@ -2974,11 +2970,6 @@ ue_scheduler(const module_id_t module_idP, } while (msg_p != NULL); } - //Mac_rlc_xface->frameP=frameP; - //Rrc_xface->Frame_index=Mac_rlc_xface->frameP; - //if (subframe%5 == 0) - //LG#ifdef EXMIMO - // data to/from NETLINK is treated in pdcp_run. // one socket is used in multiple UE's L2 FAPI simulator and // only first UE need to do this. diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c index 4c047e3d92..7b77152e32 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c @@ -364,9 +364,6 @@ rlc_um_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP sdu_mngt_p->sdu_remaining_size, pdu_remaining_size - sdu_mngt_p->sdu_remaining_size); #endif -//#if !EXMIMO -// assert(1!=1); -//#endif memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size); // reduce the size of the PDU continue_fill_pdu_with_sdu = 0; diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index 7ffdc75195..6ef447df5f 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -85,11 +85,7 @@ int dump_eNB_l2_stats(char *buffer, int length) { unsigned int stat_timer_reordering_timed_out; unsigned int stat_timer_poll_retransmit_timed_out; unsigned int stat_timer_status_prohibit_timed_out; -#ifdef EXMIMO - number_of_cards=1; -#else number_of_cards=NB_eNB_INST; -#endif eNB_MAC_INST *eNB; UE_info_t *UE_info; diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index fb72899458..57f775f0f7 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1908,9 +1908,6 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( (LTE_DRB_ToReleaseList_t *)NULL, // DRB2_list, (struct LTE_SPS_Config *)NULL, // maybe ue_context_pP->ue_context.sps_Config, (struct LTE_PhysicalConfigDedicated *)ue_context_pP->ue_context.physicalConfigDedicated, - //#ifdef EXMIMO_IOT - // NULL, NULL, NULL,NULL, - //#else measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, // MeasObj_list, measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, // ReportConfig_list, measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, //quantityConfig, @@ -2889,7 +2886,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t /* Avoid gcc warnings */ (void)PDCP_rlc_AM; (void)PDCP_rlc_UM; -#ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT +#ifdef RRC_DEFAULT_RAB_IS_AM PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM)); DRB_pdcp_config->rlc_AM = PDCP_rlc_AM; PDCP_rlc_AM->statusReportRequired = false; @@ -3652,7 +3649,7 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt /* Avoid gcc warnings */ (void)PDCP_rlc_AM; (void)PDCP_rlc_UM; -#ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT +#ifdef RRC_DEFAULT_RAB_IS_AM PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM)); DRB_pdcp_config->rlc_AM = PDCP_rlc_AM; PDCP_rlc_AM->statusReportRequired = 0; // FALSE @@ -5328,7 +5325,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct /* avoid gcc warnings */ (void)PDCP_rlc_AM; (void)PDCP_rlc_UM; -#ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT +#ifdef RRC_DEFAULT_RAB_IS_AM PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM)); DRB_pdcp_config->rlc_AM = PDCP_rlc_AM; PDCP_rlc_AM->statusReportRequired = 0; // FALSE @@ -6084,9 +6081,6 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct NULL, // DRB2_list, (struct LTE_SPS_Config *)NULL, // *sps_Config, (struct LTE_PhysicalConfigDedicated *)*physicalConfigDedicated, - //#ifdef EXMIMO_IOT - // NULL, NULL, NULL,NULL, - //#else measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 7154b34962..e017083fcc 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -959,14 +959,6 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).security_key); { uint8_t send_security_mode_command = true; -#ifndef EXMIMO_IOT - - if ((ue_context_p->ue_context.ciphering_algorithm == SecurityAlgorithmConfig__cipheringAlgorithm_eea0) - && (ue_context_p->ue_context.integrity_algorithm == INTEGRITY_ALGORITHM_NONE)) { - send_security_mode_command = false; - } - -#endif rrc_pdcp_config_security( &ctxt, ue_context_p, diff --git a/sdr/BLADERF/USERSPACE/LIB/bladerf_lib.c b/sdr/BLADERF/USERSPACE/LIB/bladerf_lib.c index eb1873cc66..e79f1e5f47 100644 --- a/sdr/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/sdr/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -284,12 +284,9 @@ int trx_brf_stop(openair0_device* device) /*! \brief Set frequencies (TX/RX) * \param device the hardware to use * \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API) - * \param exmimo_dump_config (ignored) * \returns 0 in success */ -int trx_brf_set_freq(openair0_device* device, - openair0_config_t *openair0_cfg1, - int exmimo_dump_config) +int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1) { int status; brf_state_t *brf = (brf_state_t *)device->priv; diff --git a/sdr/COMMON/common_lib.c b/sdr/COMMON/common_lib.c index 4d681b8d62..a17fcb85c8 100644 --- a/sdr/COMMON/common_lib.c +++ b/sdr/COMMON/common_lib.c @@ -45,7 +45,6 @@ const char* devtype_names[MAX_RF_DEV_TYPE] = { "", - "EXMIMO", "USRP B200", "USRP X300", "USRP N300", diff --git a/sdr/COMMON/common_lib.h b/sdr/COMMON/common_lib.h index 71607cb27f..ab8f4ef85c 100644 --- a/sdr/COMMON/common_lib.h +++ b/sdr/COMMON/common_lib.h @@ -83,8 +83,6 @@ typedef enum { */ typedef enum { MIN_RF_DEV_TYPE = 0, - /*!\brief device is ExpressMIMO */ - EXMIMO_DEV, /*!\brief device is USRP B200/B210*/ USRP_B200_DEV, /*!\brief device is USRP X300/X310*/ @@ -226,7 +224,6 @@ typedef struct { //! timing_source clock_source_t time_source; //! Manual SDR IP address - //#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) char *sdr_addrs; //! Auto calibration flag int autocal[4]; @@ -500,10 +497,9 @@ struct openair0_device_t { /*! \brief Set RX feaquencies * \param device the hardware to use * \param openair0_cfg RF frontend parameters set by application - * \param exmimo_dump_config dump EXMIMO configuration * \returns 0 in success */ - int (*trx_set_freq_func)(openair0_device *device, openair0_config_t *openair0_cfg,int exmimo_dump_config); + int (*trx_set_freq_func)(openair0_device *device, openair0_config_t *openair0_cfg); /*! \brief Set gains * \param device the hardware to use diff --git a/sdr/ETHERNET/USERSPACE/LIB/ethernet_lib.c b/sdr/ETHERNET/USERSPACE/LIB/ethernet_lib.c index dfb136749b..eb23ef28cc 100644 --- a/sdr/ETHERNET/USERSPACE/LIB/ethernet_lib.c +++ b/sdr/ETHERNET/USERSPACE/LIB/ethernet_lib.c @@ -252,9 +252,7 @@ int trx_eth_stop(openair0_device *device) { } -int trx_eth_set_freq(openair0_device* device, - openair0_config_t *openair0_cfg, - int exmimo_dump_config) +int trx_eth_set_freq(openair0_device* device, openair0_config_t *openair0_cfg) { return(0); } diff --git a/sdr/ETHERNET/benetel/4g/benetel.c b/sdr/ETHERNET/benetel/4g/benetel.c index d3b72463b4..410a643089 100644 --- a/sdr/ETHERNET/benetel/4g/benetel.c +++ b/sdr/ETHERNET/benetel/4g/benetel.c @@ -57,9 +57,7 @@ int trx_benetel_stop(openair0_device *device) } -int trx_benetel_set_freq(openair0_device* device, - openair0_config_t *openair0_cfg, - int exmimo_dump_config) +int trx_benetel_set_freq(openair0_device* device, openair0_config_t *openair0_cfg) { printf("BENETEL: %s\n", __FUNCTION__); return(0); diff --git a/sdr/ETHERNET/benetel/5g/benetel.c b/sdr/ETHERNET/benetel/5g/benetel.c index cededa968e..79a9109868 100644 --- a/sdr/ETHERNET/benetel/5g/benetel.c +++ b/sdr/ETHERNET/benetel/5g/benetel.c @@ -56,9 +56,7 @@ int trx_benetel_stop(openair0_device *device) } -int trx_benetel_set_freq(openair0_device* device, - openair0_config_t *openair0_cfg, - int exmimo_dump_config) +int trx_benetel_set_freq(openair0_device* device, openair0_config_t *openair0_cfg) { printf("BENETEL: %s\n", __FUNCTION__); return(0); diff --git a/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp b/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp index 488876a4bc..94e9adf54d 100644 --- a/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp +++ b/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp @@ -361,31 +361,27 @@ void *set_freq_thread(void *arg) { * \param dummy dummy variable not used * \returns 0 in success */ -int trx_iris_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dont_block) { - iris_state_t *s = (iris_state_t *) device->priv; - pthread_t f_thread; - if (dont_block) - pthread_create(&f_thread, NULL, set_freq_thread, (void *) device); - else { - int r, i; - for (r = 0; r < s->device_num; r++) { - printf("Setting Iris TX Freq %f, RX Freq %f\n", openair0_cfg[0].tx_freq[0], openair0_cfg[0].rx_freq[0]); - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { - if (i < s->rx_num_channels) { - s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", openair0_cfg[0].rx_freq[i]); - } - } - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { - if (i < s->tx_num_channels) { - s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", openair0_cfg[0].tx_freq[i]); - } - } - } +int trx_iris_set_freq(openair0_device *device, openair0_config_t *openair0_cfg) +{ + iris_state_t *s = (iris_state_t *)device->priv; + pthread_t f_thread; + int r, i; + for (r = 0; r < s->device_num; r++) { + printf("Setting Iris TX Freq %f, RX Freq %f\n", openair0_cfg[0].tx_freq[0], openair0_cfg[0].rx_freq[0]); + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + if (i < s->rx_num_channels) { + s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", openair0_cfg[0].rx_freq[i]); + } } - return (0); + for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + if (i < s->tx_num_channels) { + s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", openair0_cfg[0].tx_freq[i]); + } + } + } + return (0); } - /*! \brief Set Gains (TX/RX) * \param device the hardware to use * \param openair0_cfg RF frontend parameters set by application diff --git a/sdr/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/sdr/LMSSDR/USERSPACE/LIB/lms_lib.cpp index 79a389bfeb..df3e0c8a9b 100644 --- a/sdr/LMSSDR/USERSPACE/LIB/lms_lib.cpp +++ b/sdr/LMSSDR/USERSPACE/LIB/lms_lib.cpp @@ -283,10 +283,9 @@ int trx_lms_stop(openair0_device *device) { /*! \brief Set frequencies (TX/RX) * \param device the hardware to use * \param openair0_cfg openair0 Config structure (ignored. It is there to comply with RF common API) - * \param exmimo_dump_config (ignored) * \returns 0 in success */ -int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { +int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg) { //Control port must be connected LMS_SetLOFrequency(lms_device,LMS_CH_TX,0,openair0_cfg->tx_freq[0]); LMS_SetLOFrequency(lms_device,LMS_CH_RX,0,openair0_cfg->rx_freq[0]); diff --git a/sdr/USRP/USERSPACE/LIB/usrp_lib.cpp b/sdr/USRP/USERSPACE/LIB/usrp_lib.cpp index cc58389c34..2a351dcce0 100644 --- a/sdr/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/sdr/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -794,22 +794,15 @@ void *freq_thread(void *arg) { * \param dummy dummy variable not used * \returns 0 in success */ -int trx_usrp_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dont_block) { +int trx_usrp_set_freq(openair0_device *device, openair0_config_t *openair0_cfg) +{ usrp_state_t *s = (usrp_state_t *)device->priv; - pthread_t f_thread; - printf("Setting USRP TX Freq %f, RX Freq %f, tune_offset: %f, dont_block: %d\n", - openair0_cfg[0].tx_freq[0],openair0_cfg[0].rx_freq[0], - openair0_cfg[0].tune_offset, dont_block); + printf("Setting USRP TX Freq %f, RX Freq %f, tune_offset: %f\n", openair0_cfg[0].tx_freq[0], openair0_cfg[0].rx_freq[0], openair0_cfg[0].tune_offset); - // spawn a thread to handle the frequency change to not block the calling thread - if (dont_block == 1) - pthread_create(&f_thread,NULL,freq_thread,(void *)device); - else { - uhd::tune_request_t tx_tune_req(openair0_cfg[0].tx_freq[0], openair0_cfg[0].tune_offset); - uhd::tune_request_t rx_tune_req(openair0_cfg[0].rx_freq[0], openair0_cfg[0].tune_offset); - s->usrp->set_tx_freq(tx_tune_req); - s->usrp->set_rx_freq(rx_tune_req); - } + uhd::tune_request_t tx_tune_req(openair0_cfg[0].tx_freq[0], openair0_cfg[0].tune_offset); + uhd::tune_request_t rx_tune_req(openair0_cfg[0].rx_freq[0], openair0_cfg[0].tune_offset); + s->usrp->set_tx_freq(tx_tune_req); + s->usrp->set_rx_freq(rx_tune_req); return(0); } diff --git a/sdr/rfsimulator/simulator.c b/sdr/rfsimulator/simulator.c index b9b2223bdb..d095a0c7d5 100644 --- a/sdr/rfsimulator/simulator.c +++ b/sdr/rfsimulator/simulator.c @@ -916,7 +916,7 @@ static void rfsimulator_end(openair0_device *device) { static int rfsimulator_stop(openair0_device *device) { return 0; } -static int rfsimulator_set_freq(openair0_device *device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { +static int rfsimulator_set_freq(openair0_device *device, openair0_config_t *openair0_cfg) { return 0; } static int rfsimulator_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) { diff --git a/targets/COMMON/openairinterface5g_limits.h b/targets/COMMON/openairinterface5g_limits.h index d68292bd39..79f3d6b8dd 100644 --- a/targets/COMMON/openairinterface5g_limits.h +++ b/targets/COMMON/openairinterface5g_limits.h @@ -1,7 +1,6 @@ #ifndef OPENAIRINTERFACE5G_LIMITS_H_ #define OPENAIRINTERFACE5G_LIMITS_H_ -#if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)*/ # define NUMBER_OF_eNB_MAX 1 # define NUMBER_OF_gNB_MAX 1 # define NUMBER_OF_RU_MAX 2 @@ -43,67 +42,5 @@ # define NUMBER_OF_CONNECTED_eNB_MAX 1 # define NUMBER_OF_CONNECTED_gNB_MAX 1 # endif -#else -# define NUMBER_OF_eNB_MAX 7 -# define NUMBER_OF_gNB_MAX 7 -# define NUMBER_OF_RU_MAX 32 -# define NUMBER_OF_NR_RU_MAX 32 -# ifndef UE_EXPANSION -/* if the value of MAX_MOBILES_PER_ENB and NUMBER_OF_UE_MAX is different, -eNB process will exit because unexpected access happens. -Now some parts are using NUMBER_OF_UE_MAX -and the other are using MAX_MOBILES_PER_ENB in for-loop. -*/ -# define NUMBER_OF_UE_MAX 16 -# define NUMBER_OF_UCI_VARS_MAX 56 -# define NUMBER_OF_CONNECTED_eNB_MAX 3 -# define NUMBER_OF_CONNECTED_gNB_MAX 3 -# else -# define NUMBER_OF_UE_MAX 256 -# define NUMBER_OF_UCI_VARS_MAX 256 -# define NUMBER_OF_CONNECTED_eNB_MAX 1 -# define NUMBER_OF_CONNECTED_gNB_MAX 1 -# endif -# if defined(STANDALONE) && STANDALONE==1 -# undef NUMBER_OF_eNB_MAX -# undef NUMBER_OF_gNB_MAX - -# undef NUMBER_OF_UE_MAX - -# undef NUMBER_OF_RU_MAX -# undef NUMBER_OF_NR_RU_MAX - -# define NUMBER_OF_eNB_MAX 3 -# define NUMBER_OF_gNB_MAX 3 - -# define NUMBER_OF_UE_MAX 3 - -# define NUMBER_OF_RU_MAX 3 -# define NUMBER_OF_NR_RU_MAX 3 -# endif -# if defined(LARGE_SCALE) && LARGE_SCALE -# undef NUMBER_OF_eNB_MAX -# undef NUMBER_OF_gNB_MAX - -# undef NUMBER_OF_UE_MAX - -# undef NUMBER_OF_CONNECTED_eNB_MAX -# undef NUMBER_OF_CONNECTED_gNB_MAX - -# undef NUMBER_OF_RU_MAX -# undef NUMBER_OF_NR_RU_MAX - -# define NUMBER_OF_eNB_MAX 2 -# define NUMBER_OF_gNB_MAX 2 - -# define NUMBER_OF_UE_MAX 120 - -# define NUMBER_OF_RU_MAX 16 -# define NUMBER_OF_NR_RU_MAX 16 - -# define NUMBER_OF_CONNECTED_eNB_MAX 1 // to save some memory -# define NUMBER_OF_CONNECTED_gNB_MAX 1 -# endif -#endif #endif /* OPENAIRINTERFACE5G_LIMITS_H_ */ diff --git a/targets/README.txt b/targets/README.txt index e50664bbe1..c3a8156d9a 100644 --- a/targets/README.txt +++ b/targets/README.txt @@ -4,7 +4,6 @@ This directory contains different targets for OpenAirInterface.org implementations -ARCH/EXMIMO - Kernel driver for EXMIMO1+2 RTAI/USER - Target to run .11p (uses openairITS) or LTE modem (uses openair1 and openair2) for x86 in RTAI user-space SIMU - Simulator/Emulator target for x86 DOCS - Doxygen documentation generation for openair1/openair2 diff --git a/targets/RT/LAUNCH_SCRIPTS/load_module.sh b/targets/RT/LAUNCH_SCRIPTS/load_module.sh deleted file mode 100644 index 0ddce88e5d..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/load_module.sh +++ /dev/null @@ -1,7 +0,0 @@ -sh /opt/XIO2000/xio_script.sh -cd ../USERSPACE_TOOLS/OPENAIR_RF -./openair_rf_cbmimo1_lte 0 4 1 -rmmod -f openair_rf -cd ../.. -make install_cbmimo1_softmodem_lte_emos_l2 -cd LAUNCH_SCRIPTS diff --git a/targets/RT/LAUNCH_SCRIPTS/nas_enb.sh b/targets/RT/LAUNCH_SCRIPTS/nas_enb.sh deleted file mode 100644 index ecc3164d5b..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/nas_enb.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -echo "start setting up eNB interface" - -cd $OPENAIR2_DIR -sudo rmmod nasmesh -#make nasmesh_netlink_address_fix.ko -#make nasmesh_netlink.ko -#make nasmesh.ko -#make rb_tool -#route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 -cd - - -sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko - -sudo ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255 - -$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.2 -r 3 - -$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.1.1 -t 10.0.1.3 -r 11 - -echo "end setting up NAS interface" diff --git a/targets/RT/LAUNCH_SCRIPTS/nas_ue.sh b/targets/RT/LAUNCH_SCRIPTS/nas_ue.sh deleted file mode 100644 index 6272dfb466..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/nas_ue.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -echo "setting up UE NAS interface" - -cd $OPENAIR2_DIR -sudo rmmod nasmesh -#make nasmesh_netlink_address_fix.ko -#make nasmesh_netlink.ko -#make nasmesh.ko -#make rb_tool -#route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 -cd - -sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko - -sudo ifconfig oai0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255 - -$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.2 -t 10.0.1.1 -r 3 - -echo "end setting up NAS interface" diff --git a/targets/RT/LAUNCH_SCRIPTS/nas_ue2.sh b/targets/RT/LAUNCH_SCRIPTS/nas_ue2.sh deleted file mode 100644 index f8b871fcc7..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/nas_ue2.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -echo "setting up UE NAS interface" - -cd $OPENAIR2_DIR -sudo rmmod nasmesh -#make nasmesh_netlink_address_fix.ko -#make nasmesh_netlink.ko -#make nasmesh.ko -#make rb_tool -#route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 -cd - -sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko - -sudo ifconfig oai0 10.0.1.3 netmask 255.255.255.0 broadcast 10.0.1.255 - -$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.3 -t 10.0.1.1 -r 3 - -echo "end setting up NAS interface" diff --git a/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode1.sh b/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode1.sh deleted file mode 100644 index 7da89f36d9..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode1.sh +++ /dev/null @@ -1,13 +0,0 @@ -sudo sh $OPENAIR1_DIR/xio_script.sh -sh stop_rf.sh -sh start_rf.sh - -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 0 1 # dump Config -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 110 110 100 100 #Set TX gains -#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 2 26 100 #Card v2_10 synched to v2_19 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0 #SET RX RF Mode -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 32 1 #Set DLSCH Transmission Mod -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 1 0 0 #Start Primary Clusterhead - -#$OPENAIR1_DIR/USERSPACE_TOOLS/SCOPE/lte_scope_ul 0 0 & -#$OPENAIR1_DIR/USERSPACE_TOOLS/SCOPE/lte_scope_ul 0 1 & \ No newline at end of file diff --git a/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode2.sh b/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode2.sh deleted file mode 100644 index 30b77a5069..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode2.sh +++ /dev/null @@ -1,10 +0,0 @@ -sudo sh $OPENAIR1_DIR/xio_script.sh -sh stop_rf.sh -sh start_rf.sh -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 1 1 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 110 110 100 100 -#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 2 26 100 #Card v2_10 synched to v2_19 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 32 2 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 1 1 0 - diff --git a/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode6.sh b/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode6.sh deleted file mode 100644 index c8a93adf4f..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_eNb_mode6.sh +++ /dev/null @@ -1,13 +0,0 @@ -cd USERSPACE_TOOLS/OPENAIR_RF -./openair_rf_cbmimo1_lte 0 4 1 -rmmod -f openair_rf -cd ../.. -make install_cbmimo1_softmodem_lte_emos_l2 -cd USERSPACE_TOOLS/OPENAIR_RF -./openair_rf_cbmimo1_lte 0 0 1 1 -./openair_rf_cbmimo1_lte 0 6 137 137 140 140 -./openair_rf_cbmimo1_lte 0 14 2 -./openair_rf_cbmimo1_lte 0 32 6 -source /opt/XIO2000/xio_script.sh -./openair_rf_cbmimo1_lte 0 1 1 0 -cd ../.. diff --git a/targets/RT/LAUNCH_SCRIPTS/start_emos.sh b/targets/RT/LAUNCH_SCRIPTS/start_emos.sh deleted file mode 100644 index f9d9e8edf0..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_emos.sh +++ /dev/null @@ -1,10 +0,0 @@ -gpsd /dev/ttyUSB0 -cd USERSPACE_TOOLS/OPENAIR_RF - -./openair_rf_cbmimo1_lte 0 4 1 -rmmod -f openair_rf -cd ../.. -make install_cbmimo1_softmodem_lte_emos_l2 -cd EMOS/LTE/GUI -./emos_gui & - diff --git a/targets/RT/LAUNCH_SCRIPTS/start_rf.sh b/targets/RT/LAUNCH_SCRIPTS/start_rf.sh deleted file mode 100644 index a2177b1a6a..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_rf.sh +++ /dev/null @@ -1,2 +0,0 @@ -sudo insmod $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_msg_kern.ko -sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko \ No newline at end of file diff --git a/targets/RT/LAUNCH_SCRIPTS/start_test_fs4.sh b/targets/RT/LAUNCH_SCRIPTS/start_test_fs4.sh deleted file mode 100644 index 72f24bbd0a..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_test_fs4.sh +++ /dev/null @@ -1,13 +0,0 @@ -sh $OPENAIR1_DIR/xio_script.sh -cd ../USERSPACE_TOOLS/OPENAIR_RF -./openair_rf_cbmimo1_lte 0 4 1 -rmmod -f openair_rf -cd ../.. -make install_cbmimo1_softmodem -cd USERSPACE_TOOLS/OPENAIR_RF -./openair_rf_cbmimo1_lte 0 0 1 1 -./openair_rf_cbmimo1_lte 0 26 100 -./openair_rf_cbmimo1_lte 0 6 150 150 140 140 -./openair_rf_cbmimo1_lte 0 14 0 -./openair_rf_cbmimo1_lte 0 8 1 -cd ../../LAUNCH_SCRIPTS diff --git a/targets/RT/LAUNCH_SCRIPTS/start_ue.sh b/targets/RT/LAUNCH_SCRIPTS/start_ue.sh deleted file mode 100644 index d504d2c0b0..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_ue.sh +++ /dev/null @@ -1,18 +0,0 @@ -sudo sh $OPENAIR1_DIR/xio_script.sh -sh stop_rf.sh -sh start_rf.sh -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 0 1 # dump config -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 100 100 100 100 #Set TX gains -#./openair_rf_cbmimo1_lte 0 25 0 -#./openair_rf_cbmimo1_lte 0 15 101 # Card v15 synched to card v38 -#./openair_rf_cbmimo1_lte 0 15 117 # Card v15 synched to card v5 -#./openair_rf_cbmimo1_lte 0 15 135 # Card v37 synched to card v5 -#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 89 # Card v42 synched to card v43 -#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 85 # Card v47 synched to card v43 -#./openair_rf_cbmimo1_lte 0 26 400 -#$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 103 # Card v47 synched to card v42 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 15 110 # Card v42 synched to card v47 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0 #RF mode 0 = mixer low gain, lna off -#./openair_rf_cbmimo1_lte 0 14 1 #RF mode 1 = mixer low gain, lna on -#./openair_rf_cbmimo1_lte 0 14 2 #RF mode 2 = mixer high gain, lna on -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 3 1 0 #Start Node - param 0/1 diff --git a/targets/RT/LAUNCH_SCRIPTS/start_ue2.sh b/targets/RT/LAUNCH_SCRIPTS/start_ue2.sh deleted file mode 100644 index f16a3aa984..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/start_ue2.sh +++ /dev/null @@ -1,14 +0,0 @@ -sudo sh $OPENAIR1_DIR/xio_script.sh -sh stop_rf.sh -sh start_rf.sh -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 0 0 1 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 6 100 100 100 100 -#./openair_rf_cbmimo1_lte 0 25 0 -#./openair_rf_cbmimo1_lte 0 15 101 # Card v15 synched to card v38 -#./openair_rf_cbmimo1_lte 0 15 117 # Card v15 synched to card v5 -#./openair_rf_cbmimo1_lte 0 15 135 # Card v37 synched to card v5 -#./openair_rf_cbmimo1_lte 0 26 400 -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 14 0 #RF mode 0 = mixer low gain, lna off -#./openair_rf_cbmimo1_lte 0 14 1 #RF mode 1 = mixer low gain, lna on -#./openair_rf_cbmimo1_lte 0 14 2 #RF mode 2 = mixer high gain, lna on -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 3 1 1 diff --git a/targets/RT/LAUNCH_SCRIPTS/stop_rf.sh b/targets/RT/LAUNCH_SCRIPTS/stop_rf.sh deleted file mode 100644 index 178ac6a16b..0000000000 --- a/targets/RT/LAUNCH_SCRIPTS/stop_rf.sh +++ /dev/null @@ -1,7 +0,0 @@ -killall lte_scope -killall lte_scope_ul -$OPENAIR1_DIR/USERSPACE_TOOLS/OPENAIR_RF/openair_rf_cbmimo1_lte 0 4 1 -sudo rmmod -f nasmesh -sudo rmmod -f openair_rf -sudo rmmod -f asn1_msg_kern - diff --git a/targets/RT/USER/.runinfo b/targets/RT/USER/.runinfo deleted file mode 100644 index a15bbc6c4b..0000000000 --- a/targets/RT/USER/.runinfo +++ /dev/null @@ -1,40 +0,0 @@ -sleeptest:lxrt+sem+mbx+msg+fifos:!./sleeptest;sleep 1;popall:control_c -synctest:lxrt+sem+mbx+msg+fifos:!./synctest -V;sleep 1;popall:control_c -condtest:lxrt+sem+mbx+msg+fifos:!sudo ./condtest;sleep 1;popall:control_c -msg_test:lxrt+sem+mbx+msg+fifos:!sudo ./msg_test;sleep 1;popall:control_c -msg_many:lxrt+sem+mbx+msg+fifos:!sudo ./msg_test;sleep 1;popall:control_c -eNB:lxrt+sem+mbx+msg+fifos:!sudo ./synctest;sleep 1;popall:control_c -eNB_test:lxrt+sem+mbx+msg+smi:!sudo ./lte-softmodem -S -F enb2tx;sleep 1;popall:control_c -UE:lxrt+sem+mbx+msg+fifos:!sudo ./synctest -U -d -T 108;sleep 1;popall:control_c -UE0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 2680000000 -V -K /tmp/itti_UE0.log;sleep 1;popall:control_c -#EXMIMO2 card 5 -#UE0_smbv:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907598252 -V;sleep 1;popall:control_c -#EXMIMO2 card 24 -#UE0_smbv:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907595776 -V;sleep 1;popall:control_c -#EXMIMO2 card 38 -#UE0_smbv:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907592704 -V;sleep 1;popall:control_c -#EXMIMO2 card 39 -UE0_smbv:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 2679998592 -V;sleep 1;popall:control_c -UE850:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 859498000 -F ex2_850;sleep 1;popall:control_c -eNB850:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -d -C 859500000 -F ex2_850;sleep 1;popall:control_c -UE0noL2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600480 --no-L2-connect;sleep 1;popall:control_c -UE0calib:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912600000 --calib-ue-rx -70 ;sleep 1;popall:control_c -UE0calibmed:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912600000 --calib-ue-rx-med -70 ;sleep 1;popall:control_c -UE0calibbyp:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912600000 --calib-ue-rx-byp -70 ;sleep 1;popall:control_c -UE0prach:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1912606900 -F ue1 --debug-ue-prach;sleep 1;popall:control_c -UE1:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue1 ;sleep 1;popall:control_c -UE1prach:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue1 --debug-ue-prach;sleep 1;popall:control_c -UE1noL2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue1 --no-L2-connect;sleep 1;popall:control_c -UE2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue2;sleep 1;popall:control_c -UE2prach:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue2 --debug-ue-prach;sleep 1;popall:control_c -UE2noL2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -U -d -C 1907600000 -F ue2 --no-L2-connect;sleep 1;popall:control_c -#eNB0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 1907600000 -d -V;sleep 1;popall:control_c -#eNB0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 1907598252 -d -V;sleep 1;popall:control_c -eNB0:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -d -O../../PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.conf -V -K /tmp/itti_eNB0.log;sleep 1;popall:control_c -eNB1:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 2680000000 -r 50 -d -V;sleep 1;popall:control_c -eNB2:lxrt+sem+mbx+msg+fifos:!sudo ./lte-softmodem -C 2680000000 -r 100 -d -V;sleep 1;popall:control_c -dot11:lxrt+sem+mbx+msg+fifos:!sudo ./dot11 -C 1907600000 -d;sleep 1;popall:control_c -dot11_tx_test: lxrt+sem+mbx+msg+fifos:!sudo ./dot11 -C 1907600000 -d -t;sleep 1;popall:control_c -eNB2_750:lxrt+sem+mbx+msg+fifos:!sudo ./synctest_eNB -C 746000000 -F enb1tx_750 -d;sleep 1;popall:control_c -eNB2_1900:lxrt+sem+mbx+msg+fifos:!sudo ./synctest_eNB -C 19076000000 -F enb1tx_1900 -d;sleep 1;popall:control_c -emos-raw:lxrt+sem+mbx+msg+fifos:!sudo ./emos-raw -d -V;sleep 1;popall:control_c diff --git a/targets/RT/USER/eNB_exmimo2.gtkw b/targets/RT/USER/eNB_exmimo2.gtkw deleted file mode 100644 index aede1bef19..0000000000 --- a/targets/RT/USER/eNB_exmimo2.gtkw +++ /dev/null @@ -1,64 +0,0 @@ -[*] -[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Wed Sep 9 13:46:33 2015 -[*] -[dumpfile] "/homes/kaltenbe/openair_dump_eNB_exmimo2_sequans.vcd" -[dumpfile_mtime] "Mon Sep 7 15:31:31 2015" -[dumpfile_size] 894802540 -[savefile] "/homes/kaltenbe/Devel/openair/openair4G/trunk/targets/RT/USER/eNB_exmimo2.gtkw" -[timestart] 362571890000 -[size] 1855 1056 -[pos] -176 -45 -*-21.066544 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -[sst_width] 257 -[signals_width] 230 -[sst_expanded] 1 -[sst_vpaned_height] 262 -@420 -variables.daq_mbox[63:0] -variables.diff2[63:0] -@28 -functions.rt_sleep -@24 -variables.missed_slot_enb[63:0] -variables.hw_subframe[63:0] -variables.hw_frame[63:0] -variables.frame_number_TX_eNB[63:0] -variables.frame_number_RX_eNB[63:0] -@28 -functions.eNB_thread_rx0 -functions.eNB_thread_tx0 -functions.eNB_thread_rx1 -functions.eNB_thread_tx1 -functions.eNB_thread_rx2 -functions.eNB_thread_tx2 -functions.eNB_thread_rx3 -functions.eNB_thread_tx3 -functions.eNB_thread_rx4 -functions.eNB_thread_tx4 -functions.eNB_thread_rx5 -functions.eNB_thread_tx5 -functions.eNB_thread_rx6 -functions.eNB_thread_tx6 -functions.eNB_thread_rx7 -functions.eNB_thread_tx7 -functions.eNB_thread_rx8 -functions.eNB_thread_tx8 -functions.eNB_thread_rx9 -functions.eNB_thread_tx9 -functions.phy_procedures_eNb_tx -functions.phy_procedures_eNb_rx -functions.phy_enb_prach_rx -functions.phy_eNB_dlsch_encoding -functions.phy_eNB_dlsch_modulation -functions.phy_eNB_dlsch_scrambling -functions.phy_enb_pdcch_tx -@29 -functions.phy_enb_ulsch_decoding -@28 -functions.phy_enb_rs_tx -functions.rrc_mac_config_req -functions.rlc_data_req -functions.udp_enb_task -[pattern_trace] 1 -[pattern_trace] 0 diff --git a/targets/RT/USER/exmimo2_2arxg.lime b/targets/RT/USER/exmimo2_2arxg.lime deleted file mode 100644 index 0c24ef9992..0000000000 --- a/targets/RT/USER/exmimo2_2arxg.lime +++ /dev/null @@ -1,10 +0,0 @@ -# this file contains the calibration values to compute the RSSI -# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning -# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB -# this is for Express MIMO2 without any additional RF frontend -# high gain -103 107 106 104 -# med gain -98 101 100 98 -# low gain (byp) -94 97 96 94 diff --git a/targets/RT/USER/exmimo2_2brxg.lime b/targets/RT/USER/exmimo2_2brxg.lime deleted file mode 100644 index e99c738cd0..0000000000 --- a/targets/RT/USER/exmimo2_2brxg.lime +++ /dev/null @@ -1,10 +0,0 @@ -# this file contains the calibration values to compute the RSSI -# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning -# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB -# this is for Express MIMO2 without any additional RF frontend -# high gain -128 128 128 126 -# med gain -122 123 123 120 -# low gain (byp) -116 117 116 116 diff --git a/targets/RT/USER/init_exmimo.sh b/targets/RT/USER/init_exmimo.sh deleted file mode 100644 index 6dc4121f1a..0000000000 --- a/targets/RT/USER/init_exmimo.sh +++ /dev/null @@ -1,12 +0,0 @@ -sudo rmmod openair_rf -sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko -sudo mknod /dev/openair0 c 127 0 -sudo chmod a+rw /dev/openair0 - -$OPENAIR1_DIR/USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $OPENAIR1_DIR/USERSPACE_TOOLS/OAI_FW_INIT/main -s 0x43fffff0 -sudo rmmod openair_rf -sudo insmod $OPENAIR1_DIR/ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko - -sudo rmmod nasmesh -sudo insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko - diff --git a/targets/RT/USER/init_exmimo2.sh b/targets/RT/USER/init_exmimo2.sh deleted file mode 100644 index 849c62f852..0000000000 --- a/targets/RT/USER/init_exmimo2.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -PCI=`lspci -m | grep Xilinx` -if [ -z "$PCI" ]; then - echo "No card found. Stopping!" - return -fi - -## This part corrects the wrong configuration of the endpoint done by the bios in some machines -echo "$PCI" | while read config_reg; do -SLOT_NUMBER=`echo $config_reg | awk -F\" '{print $1}'` -sudo setpci -s $SLOT_NUMBER 60.b=10 -done - -load_module() { - mod_name=${1##*/} - mod_name=${mod_name%.*} - if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules - then - echo "module $mod_name already loaded: I remove it first" - sudo rmmod $mod_name - fi - echo loading $mod_name - sudo insmod $1 -} - -load_module $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom/openair_rf.ko -sleep 1 - -if [ ! -e /dev/openair0 ]; then - sudo mknod /dev/openair0 c 127 0 - sudo chmod a+rw /dev/openair0 -fi - -DEVICE=`echo $PCI | awk -F\" '{print $(NF-1)}' | awk '{print $2}'` -DEVICE_SWID=${DEVICE:2:2} -if [ $DEVICE_SWID == '08' ]; then - echo "Using firmware version 8" - $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2 -else - if [ $DEVICE_SWID == '09' ]; then - echo "Using firmware version 9" - $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v9 - else - if [ $DEVICE_SWID == '0a' ]; then - echo "Using firware version 10" - #$OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR0_DIR/express-mimo/software/sdr/exmimo2/sdr_expressmimo2 - #$OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10_spectra - $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10 - else - echo 'No corresponding firmware found' - return - fi - fi -fi - -#load_module $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko - -#if [ "$1" = "eNB" ]; then -# echo "bring up oai0 interface for enb" -# sudo ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255 -# $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.9 -r 1 -#else -# if [ "$1" = "UE" ]; then -# echo "bring up oai0 interface for UE" -# sudo ifconfig oai0 10.0.1.9 netmask 255.255.255.0 broadcast 10.0.1.255 -# $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c0 -i0 -z0 -s 10.0.1.9 -t 10.0.1.1 -r 1 -# fi -#fi diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 5a103cf886..8d2b785e78 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1082,7 +1082,7 @@ static void do_ru_synch(RU_t *ru) { ru->rfdevice.openair0_cfg->tx_freq[i] = temp_freq1; } - ru->rfdevice.trx_set_freq_func(&ru->rfdevice,ru->rfdevice.openair0_cfg,0); + ru->rfdevice.trx_set_freq_func(&ru->rfdevice,ru->rfdevice.openair0_cfg); while ((ru->in_synch ==0)&&(!oai_exit)) { // read in frame diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 774561e268..61f64cf774 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -75,7 +75,7 @@ #define CONFIG_HLP_PRB "Set the PRB, valid values: 6, 25, 50, 100 \n" #define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n" #define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n" -#define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n" +#define CONFIG_HLP_DMAMAP "use DMA memory mapping\n" #define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n" #define CONFIG_HLP_TADV "Set timing_advance\n" diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 73520dd918..9b57b5631f 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -637,7 +637,7 @@ static void *UE_thread_synch(void *arg) { break; } - UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); + UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0]); //UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]); //UE->rfdevice.trx_stop_func(&UE->rfdevice); sleep(1); @@ -721,7 +721,7 @@ static void *UE_thread_synch(void *arg) { openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1; } - UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); + UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0]); }// initial_sync=0 break; @@ -858,10 +858,6 @@ static void *UE_thread_rxn_txnp4(void *arg) { (UE->frame_parms.frame_type == FDD) ) phy_procedures_UE_TX(UE,proc,0,0,UE->mode); - if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) && - (UE->frame_parms.frame_type == TDD)) - phy_procedures_UE_S_TX(UE,0,0); - proc->instance_cnt_rxtx--; if (IS_SOFTMODEM_RFSIM) { diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 24d444751f..acb762682f 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -703,9 +703,6 @@ int main( int argc, char **argv ) { printf("error reading from file\n"); } - //p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX; - - if(IS_SOFTMODEM_DOSCOPE) load_softscope("ue",NULL); diff --git a/targets/RT/USER/ue_exmimo2.gtkw b/targets/RT/USER/ue_exmimo2.gtkw deleted file mode 100644 index 5be62a28de..0000000000 --- a/targets/RT/USER/ue_exmimo2.gtkw +++ /dev/null @@ -1,59 +0,0 @@ -[*] -[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Tue Jun 23 10:22:38 2015 -[*] -[dumpfile] "/tmp/openair_dump_UE.vcd" -[dumpfile_mtime] "Tue Jun 23 10:21:56 2015" -[dumpfile_size] 15561726 -[savefile] "/home/stevens/openair4G/targets/RT/USER/ue_exmimo2.gtkw" -[timestart] 10448200000 -[size] 1215 640 -[pos] 105 102 -*-23.292629 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -[sst_width] 224 -[signals_width] 262 -[sst_expanded] 1 -[sst_vpaned_height] 155 -@24 -variables.hw_subframe[63:0] -variables.daq_mbox[63:0] -variables.diff2[63:0] -variables.ue_rx_offset[63:0] -variables.rx_offset_mbox[63:0] -@28 -functions.rt_sleep -@24 -variables.subframe_number_RX_UE[63:0] -variables.subframe_number_TX_UE[63:0] -variables.slot_number_RX_UE[63:0] -variables.slot_number_RX_UE[63:0] -@28 -functions.ue_thread_rx -functions.ue_thread_tx -@420 -variables.ue_inst_cnt_rx[63:0] -@421 -variables.ue_inst_cnt_tx[63:0] -@28 -functions.phy_procedures_ue_rx -functions.phy_procedures_ue_tx -@24 -variables.frame_number_RX_UE[63:0] -variables.frame_number_TX_UE[63:0] -@28 -functions.ue_slot_fep -functions.lte_ue_measurement_procedures -functions.ue_rrc_measurements -functions.ue_gain_control -functions.ue_adjust_synch -functions.lte_ue_pbch_procedures -functions.lte_ue_pdcch_procedures -functions.rx_pdcch -functions.dci_decoding -functions.phy_ue_generate_prach -functions.phy_ue_ulsch_encoding -functions.phy_ue_ulsch_modulation -functions.phy_ue_ulsch_scrambling -functions.phy_ue_config_sib2 -[pattern_trace] 1 -[pattern_trace] 0 From 634e38bd31d6caf4ebe9176d928741cae25fe88f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Oct 2022 18:45:51 +0200 Subject: [PATCH 44/48] Remove DEADLINE_SCHEDULER and CPU_AFFINITY defines --- CMakeLists.txt | 2 - cmake_targets/build_oai | 30 ------------- common/utils/system.c | 45 ------------------- common/utils/telnetsrv/telnetsrv_proccmd.c | 5 --- .../oai_enb.log | 5 +-- targets/RT/USER/lte-enb.c | 8 ---- targets/RT/USER/lte-ru.c | 9 ---- targets/RT/USER/lte-ue.c | 17 ------- 8 files changed, 1 insertion(+), 120 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index baffcf32fa..67b09f1e22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -877,8 +877,6 @@ include_directories ("${OPENAIR_DIR}/sdr/COMMON") ############################################################## add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????") -add_boolean_option(DEADLINE_SCHEDULER False "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") -add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs") add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????") add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????") diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index aaa1bee646..0537a93aea 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -40,7 +40,6 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf XFORMS="True" SKIP_SHARED_LIB_FLAG="False" PRINT_STATS="False" -DEADLINE_SCHEDULER_FLAG_USER="" HW="None" TP="Ethernet" EPC=0 @@ -346,26 +345,6 @@ function main() { BUILD_COVERITY_SCAN=1 echo_info "Will build Coverity-Scan objects for upload" shift;; - --disable-deadline) - DEADLINE_SCHEDULER_FLAG_USER="False" - CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=False" - echo_info "Disabling the usage of deadline scheduler" - shift 1;; - --enable-deadline) - DEADLINE_SCHEDULER_FLAG_USER="True" - CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=True" - echo_info "Enabling the usage of deadline scheduler" - shift 1;; - --enable-cpu-affinity) - CPU_AFFINITY_FLAG_USER="True" - CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=True" - echo_info "Enabling CPU Affinity (only valid when not using deadline scheduler)" - shift 1;; - --disable-cpu-affinity) - CPU_AFFINITY_FLAG_USER="False" - CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False" - echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)" - shift 1;; --disable-T-Tracer) CMAKE_CMD="$CMAKE_CMD -DT_TRACER=False" echo_info "Disabling the T tracer" @@ -483,15 +462,6 @@ function main() { echo_info "RF HW set to $HW" # If the user doesn't specify the Linux scheduler to use, we set a value - #Disable CPU Affinity for deadline scheduler - if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then - CPU_AFFINITY_FLAG_USER="False" - CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False" - fi - - echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER" - echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER" - ####################################################### # Setting and printing OAI envs, we should check here # ####################################################### diff --git a/common/utils/system.c b/common/utils/system.c index f13fd84289..aeea9a1595 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -280,28 +280,6 @@ void thread_top_init(char *thread_name, uint64_t deadline, uint64_t period) { -#ifdef DEADLINE_SCHEDULER - struct sched_attr attr; - - unsigned int flags = 0; - - attr.size = sizeof(attr); - attr.sched_flags = 0; - attr.sched_nice = 0; - attr.sched_priority = 0; - - attr.sched_policy = SCHED_DEADLINE; - attr.sched_runtime = runtime; - attr.sched_deadline = deadline; - attr.sched_period = period; - - if (sched_setattr(0, &attr, flags) < 0 ) { - perror("[SCHED] eNB tx thread: sched_setattr failed\n"); - fprintf(stderr,"sched_setattr Error = %s",strerror(errno)); - exit(1); - } - -#else //LOW_LATENCY int policy, s, j; struct sched_param sparam; char cpu_affinity[1024]; @@ -314,27 +292,6 @@ void thread_top_init(char *thread_name, /* Enable CPU Affinity only if number of CPUs > 2 */ CPU_ZERO(&cpuset); -#ifdef CPU_AFFINITY - if (affinity == 0) { - LOG_W(HW,"thread_top_init() called with affinity==0, but overruled by #ifdef CPU_AFFINITY\n"); - } - else if (get_nprocs() > 2) - { - for (j = 2; j < get_nprocs(); j++) - CPU_SET(j, &cpuset); - s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); - if (s != 0) - { - perror( "pthread_setaffinity_np"); - exit_fun("Error setting processor affinity"); - } - } -#else //CPU_AFFINITY - if (affinity) { - LOG_W(HW,"thread_top_init() called with affinity>0, but overruled by #ifndef CPU_AFFINITY.\n"); - } -#endif //CPU_AFFINITY - /* Check the actual affinity mask assigned to the thread */ s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (s != 0) @@ -384,8 +341,6 @@ void thread_top_init(char *thread_name, "???", sparam.sched_priority, cpu_affinity ); } - -#endif //LOW_LATENCY } diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c index 6a0da678e2..99d5ebd94e 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.c +++ b/common/utils/telnetsrv/telnetsrv_proccmd.c @@ -121,11 +121,6 @@ char toksep[2]; case SCHED_RR: lptr+=sprintf(lptr,"%s ","rt: rr"); break; -#ifdef SCHED_DEADLINE - case SCHED_DEADLINE: - lptr+=sprintf(lptr,"%s ","rt: deadline"); - break; -#endif default: lptr+=sprintf(lptr,"%s ","????"); break; diff --git a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log index 7356c0c88d..a24e22432a 100755 --- a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log +++ b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log @@ -343,7 +343,6 @@ Initializing RU threads [PHY] Starting RU 0 (eNodeB_3GPP,synch_to_ext_device), waiting for sync (ru_thread,-1/0xff4968,0x17af520,0x16952a0) channel 0, Setting tx_gain offset 0.000000, rx_gain offset 118.000000, tx_freq 2680000000.000000, rx_freq 2560000000.000000 -[HW] thread_top_init() called with affinity>0, but overruled by #ifndef CPU_AFFINITY. [PHY] Initializing frame parms for N_RB_DL 25, Ncp 0, osf 1 [PHY] lte_parms.c: Setting N_RB_DL to 25, ofdm_symbol_size 512 [PHY] Initializing RU signal buffers (if_south local RF) nb_tx 1 @@ -624,10 +623,8 @@ cnx_id 1 assoc_id 904 [PHY] init_eNB_proc(inst:0) RC.nb_CC[inst]:1 [PHY] Initializing eNB processes instance:0 CC_id 0 [PHY] eNB->single_thread_flag:0 -[HW] thread_top_init() called with affinity>0, but overruled by #ifndef CPU_AFFINITY. [HW] [SCHED][eNB] eNB_thread_prach started on CPU 0, sched_policy = SCHED_FIFO , priority = 99, CPU Affinity= CPU_0 CPU_1 CPU_2 CPU_3 [ENB_APP] ALL RUs ready - ALL eNBs ready -[HW] thread_top_init() called with affinity>0, but overruled by #ifndef CPU_AFFINITY. [HW] [SCHED][eNB] eNB_thread_prach_br started on CPU 0, sched_policy = SCHED_FIFO , priority = 99, CPU Affinity= CPU_0 CPU_1 CPU_2 CPU_3 [ENB_APP] Sending sync to all threads [MME_APP] Creating MME_APP eNB Task @@ -1908,4 +1905,4 @@ len = 336 [X2AP] X2 has 1 process ongoing [X2AP] X2 has 1 process ongoing [X2AP] X2 has 1 process ongoing - \ No newline at end of file + diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 5d01df15ef..de169417fc 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -917,14 +917,6 @@ void init_eNB_proc(int inst) { pthread_mutex_init( &proc->mutex_RU_PRACH_br,NULL); pthread_cond_init( &proc->cond_prach_br, NULL); pthread_attr_init( &proc->attr_prach_br); -#ifndef DEADLINE_SCHEDULER - attr0 = &L1_proc->attr; - attr1 = &L1_proc_tx->attr; - attr_prach = &proc->attr_prach; - attr_prach_br = &proc->attr_prach_br; - // attr_td = &proc->attr_td; - // attr_te = &proc->attr_te; -#endif if(get_thread_worker_conf() == WORKER_ENABLE) { init_te_thread(eNB); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 8d2b785e78..1595ce737f 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -2277,15 +2277,6 @@ void init_RU_proc(RU_t *ru) { pthread_mutex_init( &proc->mutex_rf_tx, NULL); pthread_cond_init( &proc->cond_rf_tx, NULL); #endif -#ifndef DEADLINE_SCHEDULER - attr_FH = &proc->attr_FH; - attr_FH1 = &proc->attr_FH1; - attr_prach = &proc->attr_prach; - attr_synch = &proc->attr_synch; - attr_asynch = &proc->attr_asynch_rxtx; - attr_emulateRF = &proc->attr_emulateRF; - attr_prach_br = &proc->attr_prach_br; -#endif if (ru->has_ctrl_prt == 1) pthread_create( &proc->pthread_ctrl, attr_ctrl, ru_thread_control, (void*)ru ); else { diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 9b57b5631f..26d37bff5e 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -203,22 +203,6 @@ void init_thread(int sched_runtime, int sched_fifo, cpu_set_t *cpuset, char *name) { -#ifdef DEADLINE_SCHEDULER - - if (sched_runtime!=0) { - struct sched_attr attr= {0}; - attr.size = sizeof(attr); - attr.sched_policy = SCHED_DEADLINE; - attr.sched_runtime = sched_runtime; - attr.sched_deadline = sched_deadline; - attr.sched_period = 0; - AssertFatal(sched_setattr(0, &attr, 0) == 0, - "[SCHED] %s thread: sched_setattr failed %s \n", name, strerror(errno)); - LOG_I(HW,"[SCHED][eNB] %s deadline thread %lu started on CPU %d\n", - name, (unsigned long)gettid(), sched_getcpu()); - } - -#else int settingPriority = 1; if (checkIfFedoraDistribution()) @@ -250,7 +234,6 @@ void init_thread(int sched_runtime, } CPU_FREE(cset); -#endif } void init_UE(int nb_inst, From 37e6021955bbbfba22cdf11854473c6a3635d9a9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 7 Oct 2022 08:28:51 +0200 Subject: [PATCH 45/48] Fix compilation warnings in oai_irisdevif --- sdr/IRIS/USERSPACE/LIB/iris_lib.cpp | 80 +++++++++++++---------------- 1 file changed, 35 insertions(+), 45 deletions(-) diff --git a/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp b/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp index 94e9adf54d..051efe7a53 100644 --- a/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp +++ b/sdr/IRIS/USERSPACE/LIB/iris_lib.cpp @@ -88,7 +88,7 @@ static int trx_iris_start(openair0_device *device) { for (r = 0; r < s->device_num; r++) { int ret = s->iris[r]->activateStream(s->rxStream[r], flags, timeNs, 0); int ret2 = s->iris[r]->activateStream(s->txStream[r]); - if (ret < 0 | ret2 < 0) + if (ret < 0 || ret2 < 0) return -1; } return 0; @@ -135,12 +135,7 @@ static void trx_iris_end(openair0_device *device) { static int trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { using namespace std::chrono; - static long long int loop = 0; - static long time_min = 0, time_max = 0, time_avg = 0; - struct timespec tp_start, tp_end; - long time_diff; - int ret = 0, ret_i = 0; int flag = 0; iris_state_t *s = (iris_state_t *) device->priv; @@ -161,20 +156,17 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf } } - clock_gettime(CLOCK_MONOTONIC_RAW, &tp_start); - // This hack was added by cws to help keep packets flowing if (flags) flag |= SOAPY_SDR_HAS_TIME; else { - long long tempHack = s->iris[0]->getHardwareTime(""); return nsamps; } if (flags == 2 || flags == 1) { // start of burst - } else if (flags == 3 | flags == 4) { + } else if (flags == 3 || flags == 4) { flag |= SOAPY_SDR_END_BURST; } @@ -196,7 +188,7 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf printf("\n"); //printf("\nHardware time before write: %lld, tx_time_stamp: %lld\n", s->iris[0]->getHardwareTime(""), timeNs); #endif - ret = s->iris[r]->writeStream(s->txStream[r], (void **) samps, (size_t)(nsamps), flag, timeNs, 1000000); + const int ret = s->iris[r]->writeStream(s->txStream[r], (void **) samps, (size_t)(nsamps), flag, timeNs, 1000000); if (ret < 0) printf("Unable to write stream!\n"); @@ -231,7 +223,7 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp bool time_set = false; long long timeNs = 0; int flags; - int samples_received; + int samples_received = 0; uint32_t *samps[2]; //= (uint32_t **)buff; int r; @@ -255,7 +247,7 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp if (ret < 0) { if (ret == SOAPY_SDR_TIME_ERROR) printf("[recv] Time Error in tx stream!\n"); - else if (ret == SOAPY_SDR_OVERFLOW | (flags & SOAPY_SDR_END_ABRUPT)) + else if (ret == SOAPY_SDR_OVERFLOW || (flags & SOAPY_SDR_END_ABRUPT)) printf("[recv] Overflow occured!\n"); else if (ret == SOAPY_SDR_TIMEOUT) printf("[recv] Timeout occured!\n"); @@ -344,15 +336,16 @@ void *set_freq_thread(void *arg) { device->openair0_cfg[0].rx_freq[0]); // add check for the number of channels in the cfg for (r = 0; r < s->device_num; r++) { - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + for (i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { if (i < s->rx_num_channels) s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", device->openair0_cfg[0].rx_freq[i]); } - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + for (i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { if (i < s->tx_num_channels) s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", device->openair0_cfg[0].tx_freq[i]); } } + return NULL; } /*! \brief Set frequencies (TX/RX) @@ -364,16 +357,15 @@ void *set_freq_thread(void *arg) { int trx_iris_set_freq(openair0_device *device, openair0_config_t *openair0_cfg) { iris_state_t *s = (iris_state_t *)device->priv; - pthread_t f_thread; int r, i; for (r = 0; r < s->device_num; r++) { printf("Setting Iris TX Freq %f, RX Freq %f\n", openair0_cfg[0].tx_freq[0], openair0_cfg[0].rx_freq[0]); - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + for (i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { if (i < s->rx_num_channels) { s->iris[r]->setFrequency(SOAPY_SDR_RX, i, "RF", openair0_cfg[0].rx_freq[i]); } } - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + for (i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { if (i < s->tx_num_channels) { s->iris[r]->setFrequency(SOAPY_SDR_TX, i, "RF", openair0_cfg[0].tx_freq[i]); } @@ -495,11 +487,9 @@ extern "C" { */ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { - size_t i, r, card; int bw_gain_adjust = 0; openair0_cfg[0].rx_gain_calib_table = calib_table_iris; - iris_state_t *s = (iris_state_t *) malloc(sizeof(iris_state_t)); - memset(s, 0, sizeof(iris_state_t)); + iris_state_t *s = (iris_state_t *) calloc(1, sizeof(*s)); std::string devFE("DEV"); std::string cbrsFE("CBRS"); @@ -576,7 +566,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { exit(-1); } - for (r = 0; r < s->device_num; r++) { + for (int r = 0; r < s->device_num; r++) { //this is unnecessary -- it will set the correct master clock based on sample rate /*switch ((int) openair0_cfg[0].sample_rate) { case 1920000: @@ -600,7 +590,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { break; }*/ - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + for (int i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { if (i < s->rx_num_channels) { s->iris[r]->setSampleRate(SOAPY_SDR_RX, i, openair0_cfg[0].sample_rate / SAMPLE_RATE_DOWN); #ifdef MOVE_DC @@ -633,7 +623,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { s->iris[r]->setDCOffsetMode(SOAPY_SDR_RX, i, true); // move somewhere else } } - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + for (int i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { if (i < s->tx_num_channels) { s->iris[r]->setSampleRate(SOAPY_SDR_TX, i, openair0_cfg[0].sample_rate / SAMPLE_RATE_DOWN); #ifdef MOVE_DC @@ -682,24 +672,24 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { rx_filt_bw *= 3; #endif /* Setting TX/RX BW */ - for (i = 0; i < s->tx_num_channels; i++) { - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { + for (int i = 0; i < s->tx_num_channels; i++) { + if (i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, tx_filt_bw); - printf("Setting tx bandwidth on channel %zu/%lu: BW %f (readback %f)\n", i, + printf("Setting tx bandwidth on channel %d/%lu: BW %f (readback %f)\n", i, s->iris[r]->getNumChannels(SOAPY_SDR_TX), tx_filt_bw / 1e6, s->iris[r]->getBandwidth(SOAPY_SDR_TX, i) / 1e6); } } - for (i = 0; i < s->rx_num_channels; i++) { - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { + for (int i = 0; i < s->rx_num_channels; i++) { + if (i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { s->iris[r]->setBandwidth(SOAPY_SDR_RX, i, rx_filt_bw); - printf("Setting rx bandwidth on channel %zu/%lu : BW %f (readback %f)\n", i, + printf("Setting rx bandwidth on channel %d/%lu : BW %f (readback %f)\n", i, s->iris[r]->getNumChannels(SOAPY_SDR_RX), rx_filt_bw / 1e6, s->iris[r]->getBandwidth(SOAPY_SDR_RX, i) / 1e6); } } - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { + for (int i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_TX); i++) { if (i < s->tx_num_channels) { printf("\nUsing SKLK calibration...\n"); s->iris[r]->writeSetting(SOAPY_SDR_TX, i, "CALIBRATE", "SKLK"); @@ -708,7 +698,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { } - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + for (int i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { if (i < s->rx_num_channels) { printf("\nUsing SKLK calibration...\n"); s->iris[r]->writeSetting(SOAPY_SDR_RX, i, "CALIBRATE", "SKLK"); @@ -718,7 +708,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { } if (s->iris[r]->getHardwareInfo()["frontend"].compare(devFE) == 0) { - for (i = 0; i < s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { + for (int i = 0; i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX); i++) { if (openair0_cfg[0].duplex_mode == 0) { printf("\nFDD: Setting receive antenna to %s\n", s->iris[r]->listAntennas(SOAPY_SDR_RX, i)[1].c_str()); if (i < s->rx_num_channels) @@ -741,22 +731,22 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { rxStreamArgs["WIRE"] = SOAPY_SDR_CS16; std::vector channels; - for (i = 0; i < s->rx_num_channels; i++) - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) + for (int i = 0; i < s->rx_num_channels; i++) + if (i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX)) channels.push_back(i); s->rxStream.push_back(s->iris[r]->setupStream(SOAPY_SDR_RX, SOAPY_SDR_CS16, channels));//, rxStreamArgs)); std::vector tx_channels = {}; - for (i = 0; i < s->tx_num_channels; i++) - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) + for (int i = 0; i < s->tx_num_channels; i++) + if (i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_TX)) tx_channels.push_back(i); s->txStream.push_back(s->iris[r]->setupStream(SOAPY_SDR_TX, SOAPY_SDR_CS16, tx_channels)); //, arg)); //s->iris[r]->setHardwareTime(0, ""); std::cout << "Front end detected: " << s->iris[r]->getHardwareInfo()["frontend"] << "\n"; - for (i = 0; i < s->rx_num_channels; i++) { - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { - printf("RX Channel %zu\n", i); + for (int i = 0; i < s->rx_num_channels; i++) { + if (i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { + printf("RX Channel %d\n", i); printf("Actual RX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_RX, i) / 1e6)); printf("Actual RX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_RX, i) / 1e9)); printf("Actual RX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i))); @@ -772,9 +762,9 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { } } - for (i = 0; i < s->tx_num_channels; i++) { - if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { - printf("TX Channel %zu\n", i); + for (int i = 0; i < s->tx_num_channels; i++) { + if (i < (int) s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { + printf("TX Channel %d\n", i); printf("Actual TX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_TX, i) / 1e6)); printf("Actual TX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_TX, i) / 1e9)); printf("Actual TX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i))); @@ -791,10 +781,10 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { } } s->iris[0]->writeSetting("SYNC_DELAYS", ""); - for (r = 0; r < s->device_num; r++) + for (int r = 0; r < s->device_num; r++) s->iris[r]->setHardwareTime(0, "TRIGGER"); s->iris[0]->writeSetting("TRIGGER_GEN", ""); - for (r = 0; r < s->device_num; r++) + for (int r = 0; r < s->device_num; r++) printf("Device timestamp: %f...\n", (s->iris[r]->getHardwareTime("TRIGGER") / 1e9)); device->priv = s; From 06ccfdfc518c8afc5cc3aa683be13918928c4e0c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Oct 2022 16:33:37 +0200 Subject: [PATCH 46/48] Remove ADRV9371_ZC706 driver leftovers --- cmake_targets/build_oai | 20 +-- .../SYRTEM_IQ_QuickStart.readme | 136 ------------------ .../SYRTEM_IQ_uninstall_previous_SW.sh | 28 ---- sdr/COMMON/common_lib.c | 1 - sdr/COMMON/common_lib.h | 2 - 5 files changed, 2 insertions(+), 185 deletions(-) delete mode 100755 sdr/ADRV9371_ZC706/SYRTEM_IQ_QuickStart.readme delete mode 100755 sdr/ADRV9371_ZC706/SYRTEM_IQ_uninstall_previous_SW.sh diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 0537a93aea..ea74b87bb0 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -109,7 +109,7 @@ Options: --UE-gen-nvram [output path] Specify gen_nvram_path (default \"$gen_nvram_path\") -w | --hardware - USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default) + USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, None (Default) Adds this RF board support (in external packages installation and in compilation) -t | --transport Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g @@ -286,7 +286,7 @@ function main() { -w | --hardware) # Use OAI_USRP as the key word USRP is used inside UHD driver case "$2" in - "USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "ADRV9371_ZC706" | "SIMU" | "AW2SORI") + "USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "SIMU" | "AW2SORI") HW="OAI_"$2 ;; "None") @@ -499,10 +499,6 @@ function main() { install_usrp_uhd_driver $UHD_IMAGES_DIR fi fi -# if [ "$HW" == "OAI_ADRV9371_ZC706" ] ; then -# echo_info "\nInstalling packages for ADRV9371_ZC706 support" -# check_install_libiio_driver -# fi if [ "$HW" == "OAI_BLADERF" ] ; then echo_info "installing packages for BLADERF support" check_install_bladerf_driver @@ -706,18 +702,6 @@ function main() { ln -s liboai_irisdevif.so liboai_device.so echo_info "liboai_device.so is linked to IRIS device library" - elif [ "$HW" == "OAI_ADRV9371_ZC706" ] ; then - SYRIQ_KVER=$(uname -r) - SYRIQ_KMAJ=$(echo $SYRIQ_KVER | sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/') - SYRIQ_KMIN=$(echo $SYRIQ_KVER | sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/') -# echo $SYRIQ_KMAJ$SYRIQ_KMIN - if [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "319" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "410" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "415" ] ; then -# echo "Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN detected" - ln -sf /usr/local/lib/syriq/libadrv9371zc706.so liboai_device.so - else - echo_error "== FAILED == Unexpected Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN" - fi - echo_info "liboai_device.so is linked to ADRV9371_ZC706 device library for Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN" elif [ "$HW" == "OAI_AW2SORI" ] ; then compilations $BUILD_DIR aw2sori_transpro diff --git a/sdr/ADRV9371_ZC706/SYRTEM_IQ_QuickStart.readme b/sdr/ADRV9371_ZC706/SYRTEM_IQ_QuickStart.readme deleted file mode 100755 index 5467c398e4..0000000000 --- a/sdr/ADRV9371_ZC706/SYRTEM_IQ_QuickStart.readme +++ /dev/null @@ -1,136 +0,0 @@ -/* ********** ********** ********** ********** ********** ********** ********** */ -Requirements: -------------- -- Previous kernel module/libraries shall be uninstalled !!! - - cf. command line below "SYRTEM_IQ_uninstall_previous_SW.sh" -./SYRTEM_IQ_unload_previous_SW.sh -- You shall have SYRIQ1.4.6nr.tar.gz -- Ubuntu kernel version is restricted to: - - Kernel 4.15.0-20-lowlatency (Ubuntu 18.04) - - Kernel 4.10.0-42-lowlatency (Ubuntu 17.04) - - Kernel 3.19.0-61-lowlatency (Ubuntu 14.04) -- ADRV9371+ZC706 PCIe board shall be switched on -- PC shall be reboot once ADRV9371+ZC706 PCIe board is switched on - -mkdir eur_oai_develop-nr -cd eur_oai_develop-nr - -git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git -cd openairinterface5g - -git checkout 375-syrtem-sdr-platform -or -git checkout develop-nr (after merge request accepted) - -./sdr/ADRV9371_ZC706/SYRTEM_IQ_uninstall_previous_SW.sh --> Reading package lists... Done --> Building dependency tree --> Reading state information... Done --> linux-headers-4.15.0-20-lowlatency is already the newest version (4.15.0-20.21). --> 0 upgraded, 0 newly installed, 0 to remove and 327 not upgraded. --> Previous SYRIQ is loaded! - -> previous SYRIQ is unloaded! - -> previous SYRIQ is uninstall! --> Previous SYRIQ uninstallation is done - - - - -/* ********** ********** ********** ********** ********** ********** ********** */ -UE: ---- -configuration: --------------- -sudo apt update -sudo apt-get update - -tar -xvzf SYRIQ1.4.6nr.tar.gz -./SYRIQplatformR1.4.6nr_install.sh -sudo reboot - -sudo lspci -vv | grep Xilinx -sudo lspci -vv -s 02:00.0 | grep LnkSta -sudo lspci -vv -s 03:00.0 | grep LnkSta -sudo lspci -vv -s 02:00.0 | grep Interr -sudo lspci -vv -s 03:00.0 | grep Interr - -sudo gedit /usr/local/etc/syriq/cpu-irq.sh -echo '1' > /proc/irq/49/smp_affinity_list -echo '5' > /proc/irq/48/smp_affinity_list - -gedit oaienv -export IIOD_REMOTE=192.168.1.11 - - - -compilation: ------------- -sudo cset shield --reset -cd eur_oai_develop-nr/openairinterface5g/ -source oaienv - -sudo -E ./cmake_targets/build_oai -c --nrUE -w ADRV9371_ZC706 -I -sudo -E ./cmake_targets/build_oai -c --nrUE -w ADRV9371_ZC706 - - - -run: ----- -source oaienv -sudo -E /usr/local/etc/syriq/cpu-irq.sh - -sudo -E cset shield -e ./cmake_targets/ran_build/nr-uesoftmodem -- --numerology 1 -r 106 -C 3510000000 --loop-memory --rf-config-file /usr/local/etc/syriq/ue.band22.tm1.PRB100.NR40.dat - - - - - -/* ********** ********** ********** ********** ********** ********** ********** */ -gNB: ----- -configuration: --------------- -sudo apt update -sudo apt-get update - -tar -xvzf SYRIQ1.4.6nr.tar.gz -./SYRIQplatformR1.4.6nr_install.sh -sudo reboot - -sudo lspci -vv | grep Xilinx -sudo lspci -vv -s 02:00.0 | grep LnkSta -sudo lspci -vv -s 02:00.0 | grep Interr - -sudo gedit /usr/local/etc/syriq/cpu-irq.sh -echo '1' > /proc/irq/46/smp_affinity_list - -gedit oaienv -export IIOD_REMOTE=192.168.1.21 - - - -compilation: ------------- -sudo cset shield --reset -cd eur_oai_develop-nr/openairinterface5g/ -source oaienv - -sudo -E ./cmake_targets/build_oai -c --gNB -w ADRV9371_ZC706 -I --enable-cpu-affinity - -/* CPU available shall be mapped on CPU2 to get_nprocs() number with hyperthreading disabled */ -/* because : */ -/* - cset shield leave CPU0 for system */ -/* - CPU1 is reserved for HwRxTx thread for I/Q acquisition ! */ -/* Note: "/usr/local/etc/syriq/cpu-irq.sh" shall be changed if more than 8 cores are used */ -/* ie. "cset shield --force --kthread on -c 1-7" where "-c 1-7" reserves CPU1 to CPU7 for application (CPU0 is for system) */ - -sudo -E ./cmake_targets/build_oai -c --gNB -w ADRV9371_ZC706 --enable-cpu-affinity - - - -run: ----- -source oaienv -sudo -E /usr/local/etc/syriq/cpu-irq.sh - -sudo -E cset shield -e ./cmake_targets/ran_build/build/nr-softmodem -- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band22.tm1.106PRB.adrv9371zc706.conf --rf-config-file /usr/local/etc/syriq/gnb.band22.tm1.PRB100.NR40_hwgain15.dat diff --git a/sdr/ADRV9371_ZC706/SYRTEM_IQ_uninstall_previous_SW.sh b/sdr/ADRV9371_ZC706/SYRTEM_IQ_uninstall_previous_SW.sh deleted file mode 100755 index e0d5289f00..0000000000 --- a/sdr/ADRV9371_ZC706/SYRTEM_IQ_uninstall_previous_SW.sh +++ /dev/null @@ -1,28 +0,0 @@ -# Previous SYRIQ uninstall -#!/bin/sh -MODULE="riffa" -KERNEL_VERSION=$(uname -r) -RHR=/etc/redhat-release - -sudo apt-get install -y linux-headers-`uname -r` - -if lsmod | grep "$MODULE" &> /dev/null ; then - echo "Previous SYRIQ is loaded!" - sudo rmmod $MODULE - echo " -> previous SYRIQ is unloaded!" - sudo rm -f /usr/local/lib/libriffa.so* - sudo rm -f /usr/local/include/riffa.h - sudo rm -f /usr/local/include/riffa_driver.h - sudo rm -f /etc/ld.so.conf.d/riffa.conf - sudo rm -rf /lib/modules/$KERNEL_VERSION/kernel/drivers/riffa - sudo rm -f /etc/udev/rules.d/99-riffa.rules - sudo sed -i '/riffa/d' /etc/modules - sudo ldconfig - sudo depmod - echo " -> previous SYRIQ is uninstall!" - echo "Previous SYRIQ uninstallation is done" - exit 0 -else - echo "Previous SYRIQ is not loaded!" - exit 1 -fi diff --git a/sdr/COMMON/common_lib.c b/sdr/COMMON/common_lib.c index a17fcb85c8..b5d90d3621 100644 --- a/sdr/COMMON/common_lib.c +++ b/sdr/COMMON/common_lib.c @@ -53,7 +53,6 @@ const char* devtype_names[MAX_RF_DEV_TYPE] = { "LMSSDR", "IRIS", "No HW", - "ADRV9371_ZC706", "UEDv2", "RFSIMULATOR" }; diff --git a/sdr/COMMON/common_lib.h b/sdr/COMMON/common_lib.h index ab8f4ef85c..368e8e9ac5 100644 --- a/sdr/COMMON/common_lib.h +++ b/sdr/COMMON/common_lib.h @@ -99,8 +99,6 @@ typedef enum { IRIS_DEV, /*!\brief device is NONE*/ NONE_DEV, - /*!\brief device is ADRV9371_ZC706 */ - ADRV9371_ZC706_DEV, /*!\brief device is UEDv2 */ UEDv2_DEV, RFSIMULATOR, From 39fe287cf001d15241fd19e6b1520f815cdb941e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Soares=20da=20Silva?= Date: Fri, 14 Oct 2022 13:57:02 +0100 Subject: [PATCH 47/48] Use value for pMAX in the configuration file, instead of a hardcoded value --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 85a50710ec..82ecf18812 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -549,7 +549,7 @@ uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, configuration->scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[i]); } - asn1cCallocOne(UL->frequencyInfoUL.p_Max, 23); + asn1cCallocOne(UL->frequencyInfoUL.p_Max, *configuration->scc->uplinkConfigCommon->frequencyInfoUL->p_Max); UL->initialUplinkBWP.genericParameters = configuration->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; UL->initialUplinkBWP.rach_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon; From 5c86590c17102d331cd2ab7d5ca156010e89ddfe Mon Sep 17 00:00:00 2001 From: mir Date: Fri, 14 Oct 2022 14:59:54 +0200 Subject: [PATCH 48/48] Dependencies for lte-uesoftmodem removed --- targets/RT/USER/lte-softmodem.h | 9 --------- targets/RT/USER/lte-ue.c | 7 ------- targets/RT/USER/lte-uesoftmodem.c | 2 -- 3 files changed, 18 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index ca15c7ed31..b466bf7f80 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -116,15 +116,6 @@ /*-----------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters specific to UE threads */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ -/*-----------------------------------------------------------------------------------------------------------------------------*/ -#define CMDLINE_UETHREADSPARAMS_DESC { \ - {"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \ - {"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \ - {"threadThreeSubframe", NULL, 0, iptr:&(threads.three), defintval:1, TYPE_INT, 0}, \ - {"threadSlot1ProcOne", NULL, 0, iptr:&(threads.slot1_proc_one), defintval:1, TYPE_INT, 0}, \ - {"threadSlot1ProcTwo", NULL, 0, iptr:&(threads.slot1_proc_two), defintval:1, TYPE_INT, 0}, \ - } -// {"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, #define DEFAULT_DLF 2680000000 diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 5b59e91f43..07ef048232 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -155,13 +155,6 @@ pthread_t main_ue_thread; pthread_attr_t attr_UE_thread; struct sched_param sched_param_UE_thread; - -void get_uethreads_params(void) { - paramdef_t cmdline_threadsparams[] =CMDLINE_UETHREADSPARAMS_DESC; - config_process_cmdline( cmdline_threadsparams,sizeof(cmdline_threadsparams)/sizeof(paramdef_t),NULL); -} - - void phy_init_lte_ue_transport(PHY_VARS_UE *ue,int absraction_flag); PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 24d444751f..7b49e50922 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -155,7 +155,6 @@ uint64_t num_missed_slots=0; // counter for the number of missed slots // prototypes from function implemented in lte-ue.c, probably should be elsewhere in a include file. extern void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_iface); extern PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag); -extern void get_uethreads_params(void); int transmission_mode=1; @@ -284,7 +283,6 @@ static void get_options(void) { /* unknown parameters on command line will be checked in main after all init have been performed */ get_common_options(SOFTMODEM_4GUE_BIT ); - get_uethreads_params(); paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);