ubuntu 16.04系统LimeSDR V1.4使用最新版本的OpenAirInterface5g代码搭建LTE实验环境

注意,最新开发版本的代码不稳定,存在问题,以下的仅仅是记录自己的操作过程,代码并不能正常工作。正常使用的话,请不要使用如下的版本操作。

参考ubuntu 16.04系统LimeSDR V1.4使用OpenAirInterface搭建LTE实验环境,并参考 解决ubuntu 16.04系统上2017.06版本之后的LimeSDR V1.4驱动不能正常运行OpenAirInterface搭建的LTE实验环境的问题使用最新的LimeSDR驱动能正常进行LTE实验之后,我们开始尝试把OpenAirInterface的代码更新到最新版本(2018_w15),新版本的代码结构更加清晰,但是不可用

$ cd ~

$ cd openairinterface5g

$ rm -rf *

$ git checkout develop

$ git pull

#对于国内的用户来说,国外的几个代码地址需要修改一下,否则会出现无法下载或者下载非常慢的情况
$ sed -i "s/git clone https:\/\/gist.github.com\/2190472.git \/opt\/ssh/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/ssh.tar.gz \&\& sudo tar -zxvf ssh.tar.gz -C \/opt/g" cmake_targets/tools/build_helper
 
$ sed -i "s/git clone https:\/\/gitlab.eurecom.fr\/oai\/asn1c.git \/tmp\/asn1c/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/asn1c.tar.gz \&\& tar -zxvf asn1c.tar.gz -C \/tmp/g" cmake_targets/tools/build_helper
 
$ sed -i "s/https:\/\/pypi.python.org\/packages\/18\/fa\/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00\/netifaces-0.10.4.tar.gz/https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/netifaces-0.10.4.tar.gz/g" cmake_targets/tools/build_helper
 
$ sed -i "s/https:\/\/github.com\/google\/protobuf\/releases\/download\/v3.3.0\/protobuf-cpp-3.3.0.tar.gz/https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/04\/protobuf-cpp-3.3.0.tar.gz/g" cmake_targets/tools/build_helper
 
$ sed -i "s/git clone https:\/\/github.com\/protobuf-c\/protobuf-c.git/wget https:\/\/www.mobibrw.com\/wp-content\/uploads\/2018\/03\/protobuf-c.tar.gz \&\& tar -zxvf protobuf-c.tar.gz/g" cmake_targets/tools/build_helper
 
#修正兼容问题,更高版本的protobuf-c跟我们上面安装的版本不匹配,会导致编译错误
$ sed -i "s/cd protobuf-c/cd protobuf-c \&\& git checkout 2a46af42784abf86804d536f6e0122d47cfeea45/g" cmake_targets/tools/build_helper

# 如果使用最新版本的limesdr驱动已经修正了数据读取的BUG,不需要丢弃第一次的报文,我们需要
# 阻止第一个报文的丢弃,否则数据读取是错误的
$ sed -r -i "s/first_rx[ \t]*=[ \t]*1;/first_rx = 0;/g" targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp

#执行编译
$ source oaienv  
 
$ ./cmake_targets/build_oai -I       # install SW packages from internet
 
# ./cmake_targets/build_oai  -w USRP --eNB -t ETHERNET# compile eNB
# 注意如果后续重新编译过limesdr的驱动,这部分也需要重新编译
 
$ ./cmake_targets/build_oai -c -w LMSSDR --eNB -x

接下来就是创建LimeSDR的启动配置文件(从enb.band7.tm1.50PRB.usrpb210.conf修改而来):

$ vim targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf

里面的内容如下:

Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";

eNBs =
(
 {
    ////////// Identification parameters:
    eNB_ID    =  0xe00;

    cell_type =  "CELL_MACRO_ENB";

    eNB_name  =  "eNB-Eurecom-LTEBox";

    // Tracking area code, 0x0000 and 0xfffe are reserved values
    tracking_area_code  =  "1";

    mobile_country_code =  "208";

    mobile_network_code =  "92";

    tr_s_preference     = "local_mac"

    ////////// Physical parameters:

    component_carriers = (
      {
      node_function             = "3GPP_eNODEB";
      node_timing               = "synch_to_ext_device";
      node_synch_ref            = 0;
      frame_type					      = "FDD";
      tdd_config 					      = 3;
      tdd_config_s            			      = 0;
      prefix_type             			      = "NORMAL";
      eutra_band              			      = 7;
      downlink_frequency      			      = 2685000000L;
      uplink_frequency_offset 			      = -120000000;
      Nid_cell					      = 0;
      N_RB_DL                 			      = 25;
      Nid_cell_mbsfn          			      = 0;
      nb_antenna_ports                                = 1;
      nb_antennas_tx          			      = 1;
      nb_antennas_rx          			      = 1;
      tx_gain                                            = 90;
      rx_gain                                            = 125;
      pbch_repetition                                 = "FALSE";
      prach_root              			      = 0;
      prach_config_index      			      = 0;
      prach_high_speed        			      = "DISABLE";
      prach_zero_correlation  			      = 1;
      prach_freq_offset       			      = 2;
      pucch_delta_shift       			      = 1;
      pucch_nRB_CQI           			      = 0;
      pucch_nCS_AN            			      = 0;
      pucch_n1_AN             			      = 32;
      pdsch_referenceSignalPower 			      = -27;
      pdsch_p_b                  			      = 0;
      pusch_n_SB                 			      = 1;
      pusch_enable64QAM          			      = "DISABLE";
      pusch_hoppingMode                                  = "interSubFrame";
      pusch_hoppingOffset                                = 0;
      pusch_groupHoppingEnabled  			      = "ENABLE";
      pusch_groupAssignment      			      = 0;
      pusch_sequenceHoppingEnabled		   	      = "DISABLE";
      pusch_nDMRS1                                       = 1;
      phich_duration                                     = "NORMAL";
      phich_resource                                     = "ONESIXTH";
      srs_enable                                         = "DISABLE";
      /*  srs_BandwidthConfig                                =;
      srs_SubframeConfig                                 =;
      srs_ackNackST                                      =;
      srs_MaxUpPts                                       =;*/

      pusch_p0_Nominal                                   = -96;
      pusch_alpha                                        = "AL1";
      pucch_p0_Nominal                                   = -104;
      msg3_delta_Preamble                                = 6;
      pucch_deltaF_Format1                               = "deltaF2";
      pucch_deltaF_Format1b                              = "deltaF3";
      pucch_deltaF_Format2                               = "deltaF0";
      pucch_deltaF_Format2a                              = "deltaF0";
      pucch_deltaF_Format2b		    	      = "deltaF0";

      rach_numberOfRA_Preambles                          = 64;
      rach_preamblesGroupAConfig                         = "DISABLE";
      /*
      rach_sizeOfRA_PreamblesGroupA                      = ;
      rach_messageSizeGroupA                             = ;
      rach_messagePowerOffsetGroupB                      = ;
      */
      rach_powerRampingStep                              = 4;
      rach_preambleInitialReceivedTargetPower            = -108;
      rach_preambleTransMax                              = 10;
      rach_raResponseWindowSize                          = 10;
      rach_macContentionResolutionTimer                  = 48;
      rach_maxHARQ_Msg3Tx                                = 4;

      pcch_default_PagingCycle                           = 128;
      pcch_nB                                            = "oneT";
      bcch_modificationPeriodCoeff			      = 2;
      ue_TimersAndConstants_t300			      = 1000;
      ue_TimersAndConstants_t301			      = 1000;
      ue_TimersAndConstants_t310			      = 1000;
      ue_TimersAndConstants_t311			      = 10000;
      ue_TimersAndConstants_n310			      = 20;
      ue_TimersAndConstants_n311			      = 1;
      ue_TransmissionMode                                    = 1;
      }
    );


    srb1_parameters :
    {
        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
        timer_poll_retransmit    = 80;

        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
        timer_reordering         = 35;

        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
        timer_status_prohibit    = 0;

        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
        poll_pdu                 =  4;

        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
        poll_byte                =  99999;

        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
        max_retx_threshold       =  4;
    }

    # ------- SCTP definitions
    SCTP :
    {
        # Number of streams to use in input/output
        SCTP_INSTREAMS  = 2;
        SCTP_OUTSTREAMS = 2;
    };


    ////////// MME parameters:
    mme_ip_address      = ( { ipv4       = "127.0.0.20";
                              ipv6       = "192:168:30::17";
                              active     = "yes";
                              preference = "ipv4";
                            }
                          );

    NETWORK_INTERFACES :
    {

        ENB_INTERFACE_NAME_FOR_S1_MME            = "lo";
        ENB_IPV4_ADDRESS_FOR_S1_MME              = "127.0.0.10/8";
        ENB_INTERFACE_NAME_FOR_S1U               = "lo";
        ENB_IPV4_ADDRESS_FOR_S1U                 = "127.0.0.10/8";
        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
    };
  }
);

MACRLCs = (
	{
	num_cc = 1;
	tr_s_preference = "local_L1";
	tr_n_preference = "local_RRC";
	phy_test_mode = 1;
        }  
);

L1s = (
    	{
	num_cc = 1;
	tr_n_preference = "local_mac";
        }  
);

RUs = (
    {		  
       local_rf       = "yes"
         nb_tx          = 1
         nb_rx          = 1
         att_tx         = 0
         att_rx         = 0;
         bands          = [7];
         max_pdschReferenceSignalPower = -27;
         max_rxgain                    = 125;
         eNB_instances  = [0];

    }
);  

NETWORK_CONTROLLER :
{
    FLEXRAN_ENABLED        = "no";
    FLEXRAN_INTERFACE_NAME = "lo";
    FLEXRAN_IPV4_ADDRESS   = "127.0.0.1";
    FLEXRAN_PORT           = 2210;
    FLEXRAN_CACHE          = "/mnt/oai_agent_cache";
    FLEXRAN_AWAIT_RECONF   = "no";
};

     log_config :
     {
       global_log_level                      ="info";
       global_log_verbosity                  ="medium";
       hw_log_level                          ="info";
       hw_log_verbosity                      ="medium";
       phy_log_level                         ="info";
       phy_log_verbosity                     ="medium";
       mac_log_level                         ="info";
       mac_log_verbosity                     ="high";
       rlc_log_level                         ="info";
       rlc_log_verbosity                     ="medium";
       pdcp_log_level                        ="info";
       pdcp_log_verbosity                    ="medium";
       rrc_log_level                         ="info";
       rrc_log_verbosity                     ="medium";
    };

另外,最新版本运行的时候如果增加-d参数,启动图形界面,程序会崩溃。目前这个版本可以运行,但是貌似会导致LimeSDR驱动数据发送异常,目前已知,这个版本的驱动没有正确的读取配置文件,导致给硬件的配置信息是错误的,暂时这个版本还不可用。

OpenAirInterface使用LimeSDR代码分析PHY层流程

参考ubuntu 16.04系统LimeSDR V1.4使用OpenAirInterface搭建LTE实验环境建立完成的环境。

代码为当时的代码,不是最新的代码。

数据接收流向


RF处理线程
targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int antenna_id)-> targets/RT/USER/lte-enb.c
void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) (eNB->rfdevice.trx_read_func

->

targets/RT/USER/lte-enb.c
static void* eNB_thread_FH( void* param ) (eNB->rx_fh

接收完成后,触发信号,通知后续线程,也就是后面的发送接收线程。

eNB收发处理线程

targets/RT/USER/lte-enb.c
static void* eNB_thread_rxtx( void* param )

->

targets/RT/USER/lte-enb.c
static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) (eNB->proc_uespec_rx(eNB, proc, no_relay ))

->

openair1/SCHED/phy_procedures_lte_eNb.c
void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type)

->

openair1/SCHED/phy_procedures_lte_eNb.c
void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid,uint8_t do_srs)

->

此处实际的解码,涉及到相位信息,这部分是PUCCH部分的数据,主要是通信控制数据,比如信噪比等,不包含实际的通信数据,比如TCP,UDP协议等等

openair1/PHY/LTE_TRANSPORT/pucch.c
uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
PUCCH_FMT_t fmt,
uint8_t UE_id,
uint16_t n1_pucch,
uint16_t n2_pucch,
uint8_t shortened_format,
uint8_t *payload,
int frame,
uint8_t subframe,
uint8_t pucch1_thres)

->
此处实际的解码,涉及到相位信息,实际的通信数据,比如TCP,UDP协议等等

openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
uint8_t UE_id,
uint8_t control_only_flag,
uint8_t Nbundled,
uint8_t llr8_flag) ( eNB->td

->

此处解析数据段,TCP,IP相关部分了

openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)

解码后的数据通过rx_sdu函数上报到MAC层。

IQ信号

当前的数字射频芯片,无一例外的用到了I/Q信号,就算是RFID芯片,内部也用到了I/Q信号,然而绝大部分射频人员,对于IQ的了解除了名字之外,基本上一无所知。I/Q信号一般是模拟的。也有数字的比如方波。基带内处理的一般是数字信号,在出口处都要进行D/A(数—>模)转换,每个基带的结构图里都有,可以仔细看。

网上有大量关于IQ信号的资料,但都是公式一大堆,什么四相图,八相图之类的,最后还是不明白,除了知道这两个名次解释:

I:in-phase 表示同相
Q:quadrature 表示正交,与I相位差90度。

继续阅读IQ信号

解决ubuntu 16.04系统上2017.06版本之后的LimeSDR V1.4驱动不能正常运行OpenAirInterface搭建的LTE实验环境的问题

参考ubuntu 16.04系统LimeSDR V1.4使用OpenAirInterface搭建LTE实验环境搭建实验环境的时候,只能使用LimeSDR v17.06.0的驱动,更新版本的的驱动,运行之后,手机设备不能正确的连接到建立的基站。

继续阅读解决ubuntu 16.04系统上2017.06版本之后的LimeSDR V1.4驱动不能正常运行OpenAirInterface搭建的LTE实验环境的问题

5G通信技术解读|大规模天线阵列技术

这是最好的时代,也是最坏的时代。

生活在科技大爆发的时代里,你是否感觉到一丝庆幸? 虚拟现实、自动驾驶,无数令人血脉偾张的新型应用正在井喷式地爆发,模糊了虚拟和现实的边界,并深刻地改变着我们触碰和认知世界的方式。

而这,对于通信人而言却是一场艰苦卓绝的战斗。
继续阅读5G通信技术解读|大规模天线阵列技术

5G通信技术解读|波束成形如何为5G添翼?

在之前的文章(《如何实现比4G快十倍?毫米波技术是5G的关键》)中我们介绍了如何利用毫米波技术获得更多的频谱资源,接下来的问题是如何充分利用这些频谱资源——如何让多个用户通讯但又互不干扰,专业术语叫做频谱复用。

继续阅读5G通信技术解读|波束成形如何为5G添翼?

ubuntu 16.04获取当前安装的gnuradio的版本

使用如下命令获取

$ gnuradio-companion --version
GNU Radio Companion 3.7.9

This program is part of GNU Radio
GRC comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it.

或者如下命令也可

$ gnuradio-config-info --version
3.7.9

参考链接


GNU Radio version