Osmocom S1 gateway/proxy. This is used on the S1 interface between eNB and MME/CN and acts as separation between the eNB-facing IP network and the CN-facing IP network, which may be separate without routing in between.
  • Erlang 91.3%
  • Python 7.3%
  • Shell 0.9%
  • Makefile 0.5%
Find a file
Vadim Yanitskiy 127c50c0ce doc/manuals: add a NOTE on ERL_FLAGS="-config ..."
Change-Id: I4052aed0bbb2fab1b0cf6bad6b8d513830183d56
Related: osmo-ttcn3-hacks.git Ibf4d0d068ca2f12f4d04dd696e6eaa46f67c2e0b
Related: OS#6671
2026-11-08 23:37:38 +05:00
asn1 Check-in S1AP ASN.1 definitions (3GPP TS 36.413 v17.6.0) 2024-06-05 15:02:49 +02:00
config config/sys.config: migrate from sctp_client to mme_pool 2026-11-06 00:40:06 +05:00
contrib contrib/openapi.yaml: bump version: 0.1.0 -> 0.2.0 2026-11-06 00:58:20 +05:00
debian Bump version: 0.4.0-72-g23e82b1 → 0.5.0 2026-11-06 00:59:33 +05:00
doc/manuals doc/manuals: add a NOTE on ERL_FLAGS="-config ..." 2026-11-08 23:37:38 +05:00
include pfcp_peer: implement periodic PFCP heartbeat 2026-03-27 00:45:12 +00:00
priv contrib/openapi.yaml: bump version: 0.1.0 -> 0.2.0 2026-11-06 00:58:20 +05:00
src pfcp_peer: implement periodic PFCP heartbeat 2026-03-27 00:45:12 +00:00
test s1ap_utils: add API for building S1 SETUP FAILURE PDU 2026-03-09 17:40:37 +07:00
.gitignore .gitignore: ignore generated S1AP code 2024-06-05 15:02:52 +02:00
.gitreview gitreview: update project path 2024-06-06 10:37:22 +02:00
COPYING Add COPYING and license headers to *.erl files 2024-06-06 01:44:51 +07:00
Makefile [REST] osmo-s1gw-cli.py skeleton 2025-09-19 02:12:43 +07:00
README.md doc/manuals: merge doc/osmo-s1gw-cli.md 2026-03-18 20:13:50 +07:00
rebar.config rebar.config: bump meck version: 0.9.2 -> v1.2.0 2026-06-30 16:10:50 +07:00
rebar.lock rebar.lock: bump exometer_report_statsd version 2026-03-18 20:13:55 +07:00

osmo-s1gw

This is an S1AP (S1 Application Protocol) Gateway implementation in Erlang for the 3GPP EPC (Evolved Packet Core) based (4G/LTE) networks. It is part of the Osmocom Open Source Mobile Communications project.

S1AP is a protocol "spoken" between the eNB and the MME. The S1GW is useful in scenarios when eNB(s) and the MME co-exist in separate networks and thus unable to access each other directly. This is basically a proxy, accepting incoming connections from eNB(s), establishing the associated outgoing connections to the MME, and forwarding S1AP PDUs back and forth.

          (network A) |
                      |
               +-------------+     +-------------+
               |  osmo-s1gw  |     |     MME     |
+--------+     +-------------+     +-------------+
| eNB(1) | --> |             | --> |             |
+--------+     |             |     |             |
               |             |     |             |
+--------+     |             |     |             |
| eNB(2) | --> |             | --> |             |
+--------+     |             |     |             |
               |             |     |             |
+--------+     |             |     |             |
| eNB(N) | --> |             | --> |             |
+--------+     +-------------+     +-------------+
                      |
                      | (network B)

Homepage

This project does not have its own homepage yet, unlike many other Osmocom projects.

GIT Repository

You can clone from the official osmo-s1gw.git repository using

$ git clone https://gitea.osmocom.org/erlang/osmo-s1gw

There is a web interface at https://gitea.osmocom.org/erlang/osmo-s1gw

Documentation

The user manual source is in doc/manuals/. It covers installation, configuration, metrics, the REST API, and the interactive CLI. A pre-built PDF is published on the Osmocom documentation server.

Contributing

Our coding standards are described at https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards.

We use a Gerrit based patch submission/review process for managing contributions. Please see https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details.

The current patch queue for osmo-s1gw can be seen at https://gerrit.osmocom.org/#/q/project:erlang/osmo-s1gw+status:open.

Building

Install erlang and rebar3 packages (not "rebar", that's version 2! You may need to compile it from source in some distros).

$ make

Testing

Unit tests can be run this way:

$ make check

Additionally, you can run the static analyser (Dialyzer):

$ make analyze

Running

Once OsmoS1GW is built, you can start it this way:

$ make run

Installation

Osmocom provides binary packages for common Debian and Ubuntu releases via the Osmocom binary package feed. Both a stable feed (tracking the latest release) and a nightly feed are available. If you are not doing development, using the binary packages is the recommended approach.

To build and install from source:

$ sudo make install

This will install the following:

  • /usr/lib/osmo-s1gw - complete OTP/ERTS release package
  • /usr/bin/osmo-s1gw - convenience script for running osmo-s1gw
  • /usr/bin/osmo-s1gw-cli - interactive CLI
  • /lib/systemd/system/osmo-s1gw.service - systemd unit file
  • /etc/osmocom/osmo-s1gw.config - configuration file

Installation paths can be adjusted with DESTDIR, LIBDIR, BINDIR, CONFDIR, and SYSTEMDUNITDIR. See the user manual for more details.

Configuration

The default configuration file is config/sys.config. For a full description of all available configuration parameters, see the Configuration chapter in the user manual (doc/manuals/chapters/configuration.adoc).

REST interface

OsmoS1GW implements a custom (non-standard) REST interface, primarily intended for state introspection. The interface is specified using OpenAPI, with the specification available in contrib/openapi.yaml.

You can explore the API and available endpoints interactively via the Swagger UI by opening http://localhost:8080/swagger in a browser.

The OpenAPI specification is provided in two formats:

  • YAML (contrib/openapi.yaml) is the primary specification document.
  • JSON (priv/openapi.json) is generated from the YAML using contrib/yaml2json.py and used as input by the ERF framework for automatic code generation and the request validation.

Note: Both files must be kept in sync. When making changes to the YAML document, make sure to update the JSON counterpart by invoking make openapi.

Interactive CLI

OsmoS1GW comes with osmo-s1gw-cli.py - an interactive shell based on Python's cmd2 library. This script serves as an alternative to the traditional telnet/VTY interface found in many other Osmocom projects. For full usage and command reference, see the CLI chapter in the user manual (doc/manuals/chapters/cli.adoc).