Вы находитесь на странице: 1из 2

Getting started

Get started with 5G-LENA in matter of minutes.

The first thing to do is take some confidence with the ns-3 environment. We cannot really help you here, but you can find on the Web a lot of information and tutorials. So, we will download and build the 5G-LENA project, but then we will point out some ns-3 tutorials before entering the NR domain.


Many of these instructions are copied from the README file. If you find an inconsistency, please open a support ticket!

We try to keep in sync with the latest advancements in ns-3-dev. However, in between our upstreamed patched are submitted and accepted, there will be a time in which it will be necessary to use patches "on top of" of ns- 3-dev. Technically, these patches are maintained as a "branch" of the ns-3-dev development, and are hosted internally at CTTC.


If you don't have the permission to see the repository, it is probably due to the fact that you did not requested it. Even though 5G LENA is GPLv2-licensed, the access to the code is restricted.

To download a working copy of the ns-3-dev repository with the latest changes to support the NR module, you can do the following:

$ git clone git@gitlab.com:cttc-lena/ns-3-dev.git

$ cd ns-3-dev

$ git checkout nr

Provide your username and password when asked.

In case you are already using the git mirror of ns-3-dev, hosted at GitHub or GitLab, add the branch that make ns-3-dev supporting the NR module is easy as doing:

$ cd your-local-ns-3-dev-git

$ git remote add mirror-gitlab-cttc git@gitlab.com:cttc-lena/ns-3-dev.git

$ git fetch -p --all

$ git checkout nr

# fetch all the branches and update the refs

# checkout a local "nr" branch that points to mirror-gitlab-cttc/nr

To test the installation, after following one of the previous point, you can do a simple configuration and compile test (more options for that later):

$ ./waf configure --enable-examples --enable-tests

$ ./waf

A success for both previous commands indicates an overall success.

As a precondition to the following steps, you must have a working local git repository. If that is the case, then, your local git repo is ready to include our nr module:

cd src

git clone git@gitlab.com:cttc-lena/nr.git


Please note that the src/nr directory will be listed as "Untracked files" every time you do a git status command. Ignore it, as the directory lives as an independent module. As a result, we have now two parallel repository, but one lives inside the other. We are working to be able to put nr inside the contrib/ directory, as per standard ns-3 rules.

To test the resulting repository, let's configure the project again:

examples --enable-tests





If the NR module is recognized correctly, you should see "nr" in the list of built modules. If that is not the case, then most probably the previous point failed. Otherwise, you could compile it:

$ ./waf

If that command returns successfully, Welcome to the NR world !

We assume that your work lives in a separate branch, and that the 'master' branch of the NR repository is left untouched as the first time you downloaded it. If it is not the case, then please move all your work in a separate branch.

A vanilla 'master' branch can be updated by simply running:

$ cd ns-3-dev/src/nr

$ git checkout master

$ git pull

At each release, we will incorporate into the master branch all the work that is meant to be released.

For what regards ns-3-dev (the main directory in which, under src/ or contrib/, you saved the NR module) the story is a bit different. Since we often rewrite its history to keep pace with ns-3-dev plus our patches to LTE

it will not upgrade

correctly. What we suggest is, if the

repository, following the instructions at the beginning of this file (the repository is gitlab.com:cttc-lena/ns-


strategy leads to conflicts, to download again our ns-3-dev

that have not been accepted in the mainline, it is possible that with a simple

git pull
git pull
git pull
git pull

If it is the first time you work with the ns-3 environment, we recommend to take things slowly (but steady) and going forward through simple steps. The ns-3 documentation https://www.nsnam.org/documentation/is divided into two categories: the reference manual for the ns-3 core, and a separate model library. We suggest to read the following: