Giter Club home page Giter Club logo

free5gran's Introduction

free5GRAN

free5GRAN is an open-source 5G RAN stack. The current version includes a receiver which decodes MIB & SIB1 data. It also acts as a cell scanner. free5GRAN works in SA mode.

free5GRAN includes a library which can be reused for further developments. Documentation is available https://free5g.github.io/free5GRAN-documentation/.

free5GRAN is under active developments. A full 5G SA PHY layer should be released in Q1 2022.

LGTM scores

Total alerts

Language grade: C/C++

Codacy score

Codacy Badge

Installation & Running

Requirements

Before compiling, make sure that the following libraries are installed:

  • cmake
  • libfftw3
  • libconfig++
  • boost
  • cpufrequtils

On ubuntu, those libraries can be installed via:

sudo apt-get install cmake libfftw3-dev libconfig++-dev libboost-program-options-dev libboost-log-dev cpufrequtils

Radio frontend

We currently support USRP B210, N210 and X310 natively. libuhd-dev is required. It can be installed on Ubuntu via:

sudo apt-get install libuhd-dev

USRP N210 is partially supported (it can be unstable) and free5GRAN requires Liquid SDR library for sampling rate resampling : https://liquidsdr.org/doc/installation/. To build free5GRAN with USRP N210 support, just run the cmake command with option -DINCLUDE_N210=ON.

Compiling

free5GRAN executable can be compiled from sources with the following commands:

git clone https://github.com/free5G/free5GRAN.git
cd free5GRAN
mkdir build
cd build
cmake ..
make
sudo make install

Configuration and running

Two functions are supported by free5GRAN.

Cell search

Searching a cell with pre-defined parameters. Example config file is provided (free5GRAN/config/search_cell.cfg).

Band scanning

Scanning one or more 5G NR bands. Example config file is provided (free5GRAN/config/scan_band.cfg).

USRP configuration

Pre-defined USRP device

If you want to use a pre-defined RF device, USRP device has to be configured:

  • Run uhd_find_devices
  • Find the device you want to use
  • Copy the serial field of the device and paste it in the config file.
USRP network configuration

To run free5GRAN with USRP X310, set mtu size to 8000: ifconfig ETHERNET_INTERFACE mtu 8000.

To run free5GRAN with USRP N210, set mtu size to 1500: ifconfig ETHERNET_INTERFACE mtu 1500.

Running

free5GRAN should be available globally after installation. Configuration files are located in /root/.config/free5GRAN/config. There is two possible options for running free5GRAN:

  • Run sudo free5GRAN to run free5GRAN with default config file /root/.config/free5GRAN/config/free5GRAN.cfg.
  • Run sudo free5GRAN RELATIVE_CONFIG_FILE_PATH to run free5GRAN with a specific configuration file.

Debugging

free5GRAN writes logs in /var/log/free5GRAN/free5GRAN.log. It can be used for debugging. Foremost, free5RGAN writes some data files in /root/.files/free5GRAN/execution_raw_files/ directory (if it exists). For plotting those files, run python analyse.py in /root/.files/free5GRAN/. This python script generates files that are stored in /root/.files/visualization_files/ directory.

Testing note

free5GRAN has been successfully tested on Ubuntu 18.04 with USRP B210. It is currently under active development, which means that it might not be fully stable.

Issues

All the issues have to be reported in the issues page of this repository. Some known issues about the current version are already detailed in issues section.

5G NSA support

As 5G NSA uses 4G cell for attachment, SIB are transmitted on a 4G cell and this receiver won't be able to decode SIB1 data from 5G NSA mode. However, this receiver should be able to detect 5G NSA cell and decode MIB data.

Supported bands

A number of bands are already supported by free5GRAN. New bands can be added in free5GRAN/lib/variables/common_structures

free5gran's People

Contributors

adejavel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

free5gran's Issues

Adding Bands to common_structures not working

Describe the bug

I added bands n41 and n25 to /lib/variables/common_structures/common_structures.cpp and to /lib/variables/common_structures/common_structures.h

I then created the build directory, ran cmake .., make, and sudo make install

I changed the config of /root/.config/free5GRAN/config/free5GRAN.cfg

then ran free5GRAN

nuradio# free5GRAN
C++ Version: 201703
Using configuration file /root/.config/free5GRAN/config/free5GRAN.cfg
CELL SEARCH 
BAND not supported

To Reproduce

Error happen during execution

Screenshots

image image image

System:

  • OS: Ubuntu
  • Version 22.04.4
  • Libuhd version 4.1.0

make error

Describe the bug
I installed cmake 3.10 in my computer, but when I run make , there's something wrong

[100%] Building CXX object CMakeFiles/free5GRAN.dir/src/phy/phy.cpp.o
/home/ubuntu/free5GRAN/src/phy/phy.cpp: In member function ‘int phy::init(free5GRAN::synchronization_object&, std::condition_variable&)’:
/home/ubuntu/free5GRAN/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
.shiftIndex = pci}};
^
/home/ubuntu/free5GRAN/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
/home/ubuntu/free5GRAN/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
/home/ubuntu/free5GRAN/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
/home/ubuntu/free5GRAN/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
CMakeFiles/free5GRAN.dir/build.make:86: recipe for target 'CMakeFiles/free5GRAN.dir/src/phy/phy.cpp.o' failed
make[2]: *** [CMakeFiles/free5GRAN.dir/src/phy/phy.cpp.o] Error 1
CMakeFiles/Makefile2:142: recipe for target 'CMakeFiles/free5GRAN.dir/all' failed
make[1]: *** [CMakeFiles/free5GRAN.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

System:

  • OS: [ Ubuntu]
  • Version [18.04]

Unsupported RF device

Describe the bug
Fastpath logging disabled at runtime.
Using USRP n3xx device
Unsupported RF device

Error happen during execution.

System:

  • Ubuntu 20.04
  • Libuhd version 4.0

SIB-1 message not passing

Is your feature request related to a problem? Please describe.
I am running free5GRan code base from vectors generated through matlab. USRP interface has been tweaked a bit to read IQ samples from a vector file continuously but unfortunately SIB-1 CRC is not getting through however the decoding is successful in matlab.

Describe the solution you'd like
Please provide a vector file collected through USRP device at 30.72Msps so that same can be tested.

Describe alternatives you've considered
A clear description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

B200 mini work bad

Describe the bug
A clear and concise description of what the bug is.
hello brother,
i want use usrp b200mini to test cell search and band scan,
but it don't work,just tip "MIB decoding failed, trying again in 2 sec".
it make me depressed.
so, how can i do for it,maybe it need gps synchronization?
if u have some suggestion,please tell me.
I would appreciate it.

To Reproduce

  • Error happen during build or installation
  • Error happen during execution (If so, please provide the configuration file)

Screenshots
Add screenshots to help explain your problem.

System:

  • OS: [e.g. Ubuntu]
  • Version [e.g. 20.04]
  • Libuhd version

Additional context
Add any other context about the problem here.

Segmentation fault (core dumped) when try to execute free5GRAN

The error message is :

[INFO] [B200] Initialize Radio control...
[INFO] [B200] Performing register loopback test...
[INFO] [B200] Register loopback test passed
[INFO] [B200] Performing register loopback test...
[INFO] [B200] Register loopback test passed
[INFO] [B200] Asking for clock rate 30.720000 MHz...
[INFO] [B200] Actually got clock rate 30.720000 MHz.
Segmentation fault (core dumped)

It seems the application crashed just after initialized USRP B210.
I want to give you some logs , but the free5GRAN writes logs in /var/log/free5GRAN/free5GRAN.log is empty file, no content at all.

Cell not found

Context

In the current version, receiver detects cells based on PSS sequence correlation peak. This may vary depending on radio conditions, frequency and environment.

Fix 1

Thus, if receiver cannot detect existing cell, you can try to reduce threshold.
You can adjust threshold in lib/variables/common_structures/common_structures.cpp by modifying different pre-defined bands. Parameter to be modified is pss_threshold.

Fix 2

One other not-related point that could make the receiver not to detect cell is SSB periodicity. If it is too short compared to the transmitter, receiver won't detect cell. SSB periodicity can be changed in config file. Maximum value is 0.16 (=160 ms).

Some files are missed

Hi
Some files are missed by "cmake .."
lib/rf/rf.cpp
lib/phy/bwp/bwp.cpp
lib/phy/bwp/bwp.h

UHD thread error while compiling

Error trace

free5GRAN/src/main.cc:17:10: fatal error: uhd/utils/thread.hpp: No such file or directory
#include <uhd/utils/thread.hpp>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/free5GRAN.dir/build.make:62: recipe for target 'CMakeFiles/free5GRAN.dir/src/main.cc.o' failed
make[2]: *** [CMakeFiles/free5GRAN.dir/src/main.cc.o] Error 1
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/free5GRAN.dir/all' failed
make[1]: *** [CMakeFiles/free5GRAN.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Explanation

Wrong version of libuhd is installed on the host device.

Fixing

sudo add-apt-repository ppa:ettusresearch/uhd
sudo apt-get update
sudo apt-get install libuhd-dev libuhd003 uhd-host

suggest add GSCN step variable for each band

Is your feature request related to a problem? Please describe.
A clear description of what the problem is.
GSCN step in most nr bands are 1, but still some bands , such as n41 the step is 3, n79 the step is 16. add step variable to control the search procedure in these bands , the search performance can be greatly improved.
Describe the solution you'd like
A clear description of what you want to happen.
Add GSCN step variable for each band.
Describe alternatives you've considered
A clear description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Handover in free5GRAN

Hi,

Thanks for developing free5GRAN! I understand the functions that free5GRAN supports are cell search and band scanning. I would like to know if there is any way to do handover the latest free5GRAN.

Thanks a lot in advance!

feature request: SSB-RSRP,RSRQ,SINR measurement result

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
No, just a new feature request
Describe the solution you'd like
A clear and concise description of what you want to happen.
may use DMRS or PSS, SSS REs energy to estimate , the three measurement value can help me to evaluate the cell quality.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
No
Additional context
Add any other context or screenshots about the feature request here.
No

Build fail, sorry, unimplemented: non-trivial designated initializers not supported

Describe the bug
A clear and concise description of what the bug is.
Build failure
To Reproduce
Just try to use make command, the following failure occurs:

Scanning dependencies of target free5GRAN
[ 99%] Building CXX object CMakeFiles/free5GRAN.dir/src/main.cc.o
[100%] Building CXX object CMakeFiles/free5GRAN.dir/src/phy/phy.cpp.o
/home/nano/free5GRAN-master-B210/src/phy/phy.cpp: In member function ‘int phy::init(free5GRAN::synchronization_object&, std::condition_variable&)’:
/home/nano/free5GRAN-master-B210/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
.shiftIndex = pci}};
^
/home/nano/free5GRAN-master-B210/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
/home/nano/free5GRAN-master-B210/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
/home/nano/free5GRAN-master-B210/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
/home/nano/free5GRAN-master-B210/src/phy/phy.cpp:373:49: sorry, unimplemented: non-trivial designated initializers not supported
CMakeFiles/free5GRAN.dir/build.make:86: recipe for target 'CMakeFiles/free5GRAN.dir/src/phy/phy.cpp.o' failed
make[2]: *** [CMakeFiles/free5GRAN.dir/src/phy/phy.cpp.o] Error 1
CMakeFiles/Makefile2:142: recipe for target 'CMakeFiles/free5GRAN.dir/all' failed
make[1]: *** [CMakeFiles/free5GRAN.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Screenshots

System:

  • OS: [Ubuntu]
  • Version [18.03]
  • Libuhd version

Additional context
Add any other context about the problem here.

PBCH SCS may not be always 15KHz on live network

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

  • Error happen during build or installation
  • Error happen during execution (If so, please provide the configuration file)
    In you code, I found you hard code PBCH SCS to 15KHz. I think this may cause some problem when detect some NR cell with PBCH SCS =30 kHz. May be we should use blind detection of PBCH SCS during cell search procedure.

Screenshots
Add screenshots to help explain your problem.

System:

  • OS: [e.g. Ubuntu]
  • Version [e.g. 20.04]
  • Libuhd version

Additional context
Add any other context about the problem here.

make fail

Describe the bug
A syntax error has occurred In lib\asn1c\nr_rrc\INTEGER.c

To Reproduce
image

Screenshots
image

System:

  • OS: [e.g. Ubuntu]
  • Version [e.g. 20.04]
  • Libuhd version

Additional context
Add any other context about the problem here.

running problem

ubuntu 20.04
uhd 4.3.0.0
usrp b210

I tried the commond in the Readme.md . sudo free5GRAN

and I can not run the program.

The print below:

C++ Version: 201703
Segmentation fault
Segmentation fault
Segmentation fault
Segmentation fault
terminate called after throwing an instance of 'libconfig::ParseException'
what(): ParseException

Can you help me see what's wrong?

Redundancy version 1 and 2 not supported

Redundancy version (RV )1 and 2 are not supported for LDPC decoding.
This means that when RV 1 or 2 is detected in DCI, receiver does not try to decode PDSCH.
When having found a cell with cells scanner, if RV is 1 or 2, you should run free5GRAN with cell search function with the found cell parameters and run free5GRAN until RV is 0 or 3 for decoding PDSCH and SIB1.

make error

I get an error when I do make as below:

ubuntu18@ubuntu:~/free5GRAN/build$ sudo make
[ 97%] Built target asn1c_lib
[ 99%] Built target free5GRAN_lib
[ 99%] Linking CXX executable free5GRAN
libfree5GRAN_lib.a(usrp_b200.cpp.o): In function free5GRAN::usrp_b200::setSampleRate(double)': usrp_b200.cpp:(.text+0x2f): undefined reference to uhd::usrp::multi_usrp::ALL_CHANS'
libfree5GRAN_lib.a(usrp_b200.cpp.o): In function free5GRAN::usrp_b200::usrp_b200(double, double, double, double, free5GRAN::rf_device_, free5GRAN::rf_buffer_*)': usrp_b200.cpp:(.text+0x6bb): undefined reference to uhd::usrp::multi_usrp::ALL_MBOARDS'
usrp_b200.cpp:(.text+0x76a): undefined reference to uhd::usrp::multi_usrp::ALL_CHANS' libfree5GRAN_lib.a(usrp_x300.cpp.o): In function free5GRAN::usrp_x300::setSampleRate(double)':
usrp_x300.cpp:(.text+0x2f): undefined reference to uhd::usrp::multi_usrp::ALL_CHANS' libfree5GRAN_lib.a(usrp_x300.cpp.o): In function free5GRAN::usrp_x300::usrp_x300(double, double, double, double, free5GRAN::rf_device_, free5GRAN::rf_buffer_*)':
usrp_x300.cpp:(.text+0x6eb): undefined reference to uhd::usrp::multi_usrp::ALL_MBOARDS' usrp_x300.cpp:(.text+0x79a): undefined reference to uhd::usrp::multi_usrp::ALL_CHANS'
collect2: error: ld returned 1 exit status
CMakeFiles/free5GRAN.dir/build.make:123: recipe for target 'free5GRAN' failed
make[2]: *** [free5GRAN] Error 1
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/free5GRAN.dir/all' failed
make[1]: *** [CMakeFiles/free5GRAN.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

System:

  • OS: Ubuntu
  • Version 18.04
  • gcc and g++ version 9.4.0
  • uhd installed

[Help wanted] BCCH DL-SCH decoding failure using asn1c

Describe the bug
The current version of the code extracts the bits value of the SIB1 object but the library used to parse the bit sequence, which is https://github.com/vlm/asn1c is failing to parse the sequence. We are investigating to understand where is it coming from (misuse of the lib or library bug), and any contribution for solving this issue is welcomed. However, https://asn1.io/asn1playground/ can decode the bits sequence using the asn file NR-RRC-Definitions.txt so the ASN model and extracted bits sequence seems to be correct. The code part related to SIB1 parsing is from this line to this line

To Reproduce
SIB1 decoding. The output SIB1 object is not correct.

Segfault at the beginning of execution

Error

free5GRAN might raise segfault when receiving buffer is too big.

Context

This might occur when subcarrier spacing and SSB period are high.

Fix

There is no fix today, try to reduce SSB period.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.