Coder Social home page Coder Social logo

ghislainadon / srsran-docker-emulated Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davwheat/srsran-docker-emulated

0.0 0.0 0.0 16 KB

Minimal end-to-end LTE using srsRAN. Dockerized and emulated radio over shared memory.

Shell 63.91% Dockerfile 36.09%

srsran-docker-emulated's Introduction

srsran-docker-emulated

This based on the repo created by pgorczak, updated to use the latest version of srsLTE, since renamed to srsRAN.

This is a minimal example of an end-to-end srsRAN system running with Docker and shared memory. Core network, base station and user device all run in separate containers. The air interface is emulated via radio samples in shared memory.

Usage

Clone the repository, and spin up the Docker containers with:

$ docker-compose up

The initial build can take several minutes. The make command will automatically run the srsRAN build with the optimal thread count using nproc.

Around 15 seconds after srsRAN begins running, you'll see the UE attach with a message similar to this:

virtual-srsue | Network attach successful. IP: 172.16.0.2
virtual-srsenb | User 0x46 connected

Now you can test the connection in a new terminal:

$ docker exec -i -t virtual-srsepc ping 172.16.0.2
PING 172.16.0.2 (172.16.0.2) 56(84) bytes of data.
64 bytes from 172.16.0.2: icmp_seq=1 ttl=64 time=25.3 ms
64 bytes from 172.16.0.2: icmp_seq=2 ttl=64 time=24.2 ms

Credits go to jgiovatto for implementing the shared memory radio interfaces and to FabianEckermann for figuring out how to integrate it with Docker's IPC functionality.

Custom configurations

During build, the example config files are copied into the workdir during the make job. These are the files you see used in the compose file with some option overrides. If you want to play around with the config yourself, it is much easier to place your custom files in this directory and ADD or COPY them in the Dockerfile. You can find the exact versions in [srsepc], [srsenb] and [srsue].

The config files should be added to the /etc/srsran directory.

Adding more UEs

The compose file contains an optional second UE. It uses the second IMSI from the default user_db.csv (inside srsEPC). To add more UEs, add IMSIs to the CSV and tell the UEs to use them.

Internet access for UEs

For automated setup, run the helper script in the repository root. This assumes no details of the setup have been changed. If you run multiple UEs, you may need to perform manual setup for UEs after the first.

./setup-internet-access
Manual instructions

By default, containers are attached to a Docker network with a default route. This means everyone has internet access through the virtualized Docker network. It takes two extra steps to make UEs access the internet through the EPC instead. First configure network address translation at the EPC

docker exec virtual-srsepc iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -o eth0 -j MASQUERADE

This will masquerade all forwarded traffic from UEs (matched by source IP address) leaving the EPC's eth0 (Docker) interface.

Second, tell the UE to route traffic via the EPC by default

docker exec virtual-srsue ip route replace default via 172.16.0.1

Now you have network access through the EPC

docker exec virtual-srsue ping google.com

You can verify that this ping is using the LTE connection by checking whether it has about 20 ms added latency due to uplink scheduling or by waiting until the UE enters "RRC IDLE" state, in which your ping command will trigger a random access and connection setup. The UE enters that state after one minute of not having sent or received any data through the LTE connection, so make sure no pings are running.

Shell access to containers

Helper scripts are provided for easy shell access to the Docker containers. These are ./enterEPC, ./enterENB and ./enterUE for the EPC, eNB and UE respectively. More demo on https://hub.docker.com/r/shubhamtatvamasi/srsran-demo

srsran-docker-emulated's People

Contributors

davwheat avatar pgorczak avatar ghislainadon avatar

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.