An extension to the nr V2X code to support 5G Proximity Services (ProSe) including Discovery and Layer-3 UE-to-Network Relay.
This is an ns-3 extension module for simulating 5G Proximity Services.
- A C++ 20 compliant compiler.
- A compatible version of ns-3 that has been patched for ProSe support.
- A compatible version of the CTTC NR module, V2X branch.
Clone the project into a directory called nr-prose in
the contrib directory of a supported version of ns-3
cdinto thecontribdirectory ofns-3
cd contrib/- Clone the project from one of the below URLs
# Pick one of the below
# HTTPS (Choose this one if you're uncertain)
git clone https://github.com/usnistgov/nr-prose-ns3-module nr-prose
# SSH
git clone git@github.com:usnistgov/nr-prose-ns3-module.git nr-prose- (Re)configure & (Re)build
ns-3
# --enable-examples is optional, see `Running the Examples`
# for how to run them
./ns3 configure --enable-examples
./ns3If, for whatever reason, git is not available, download the
project & unzip it into the contrib directory of ns-3.
Note that updates will have to be performed manually using this method
- Download the ZIP of the project from the url below:
https://github.com/usnistgov/nr-prose-ns3-module/archive/master.zip
- Unzip the file into the
ns-3contrib/directory
unzip nr-prose-ns3-module-master.zip- Rename the resulting directory to
nr-prose, as ns-3 will not accept a module named differently than its directory.
mv nr-prose-ns3-module-master nr-proseIf you are linking your module/program to the nr-prose module add the following to your CMakeLists.txt.
For CMake, add the module's target ${libnr-prose} to your libraries_to_link list
# Example
build_lib_example(
NAME your-example-name
SOURCE_FILES example.cc
LIBRARIES_TO_LINK
${libnr-prose}
# ...
)
# Module
build_lib(
LIBNAME your-module-name
SOURCE_FILES
# ...
HEADER_FILES
# ...
LIBRARIES_TO_LINK
${libnr-prose}
# ...
)You may now include & use the nr-prose module in code:
#include <ns3/nr-prose-module.h>
//...
int main ()
{
// ...
// ...
}To update the cloned module, move to the module's root directory and perform a git pull
# From the ns-3 root
cd contrib/nr-prose
git pullTo update a ZIP installation, remove the old module and replace it with the updated one.
# From the ns-3 root
cd contrib
rm -Rf nr-prose
#use this command, or download manually
wget https://github.com/usnistgov/nr-prose-ns3-module/archive/refs/heads/master.zip -O nr-prose-ns3-module-master.zip
unzip nr-prose-ns3-module-master.zip
# Make sure the directory in the ns-3 contrib/ directory is
# named `nr-prose`
mv nr-prose-ns3-module-master nr-prose
Sphinx is required to build the documentation.
To run Sphinx to build the documentation, cd into the doc directory in the module
and run make [type] for the type of documentation you wish to build.
# From the ns-3 root directory
cd contrib/nr-prose/doc
# HTML (Several Pages)
make html
# HTML (One Page)
make singlehtml
# PDF
make latexpdf
# To list other options, just run make
makeThe built documentation will now be found in doc/build/[type].