Commit Graph

20 Commits

Author SHA1 Message Date
Neels Hofmeyr 64a2debb9a per-HNB GTP-U traffic counters via nft
Add optional feature: retrieve GTP-U traffic counters per hNodeB (not
per individual subscriber!) using nftables, to provide new rate_ctr
stats.

This is a "workaround" to get performance indicators per hNodeB, without
needing a UPF that supports URR.

When an hNodeB registers, set up nftables rules to count GTP-U packets
(UDP port 2152) to and from that hNodeB's address -- we are assuming
that it is the same address that Iuh is connecting from.

From the per-hNodeB packet and byte counters from nftables, also derive
a "UE bytes" counter, which is counting only the GTP-U payload. Assume
IP header of 20 bytes; UDP and GTP-U headers are 8 bytes each:

  ue_bytes = total_bytes - packets * (20 + 8 + 8)

Query these periodically, as configurable by new timer X34. Default is
one second of wait time between querying counters (excluding the time it
takes to retrieve and update the counters).

Add compile-time switch --enable-nftables, to build with/without
external dependency libnftables. Default is without, as before.

Add jenkins axis NFTABLES to switch --enable-nftables.

Add cfg file option 'hnbgw' / 'nft-kpi' to enable use of nftables.
This requires osmo-hnbgw to be run with cap_net_admin.

The VTY config commands are always visible -- simplifies VTY testing.
Refuse to start osmo-hnbgw when the user is requesting nft-kpi in the
config but when built without --enable-nftables.

Do nft commands in 2 separate threads. Run the same request queue
implementation twice, with two thread workers to handle them:
- one thread receives all requests to init the nft table, add and remove
  hNodeB counters, and start and stop counting for a specific hNodeB.
- Another thread handles all retrieval and parsing of counters from nft.

The main() thread hence never blocks for nftables commands, and services
the responses from nft when they are ready, via an osmo_it_q registered
in the main() select loop.

Persistently keep an nftables named counter for each seen hNodeB cell id
in the nftables ruleset, for the lifetime of a hnb_persistent instance
that holds the target rate_ctrs.

Add the rules to feed into these persistent counters to the ruleset when
the particular cell attaches and detaches via HNBAP HNB (De-)Register.

On hnb_persistent_free(), remove all items relating to this cell id from
nftables, including the persistent named counters.

Loosely related: upcoming patches will implement
- a hashtable for faster cell id lookup (important for updating
  counters)
  Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
- proper MNC-3-digit support in cell ids (better have a 100% correct
  primary key).
  Id9a91c80cd2745424a916aef4736993bb7cd8ba0
- idle timeout for disconnected hnbp, so we are sure stale state does
  not build up for eternity.
  Ic819d7cbc03fb39e98c204b70d016c5170dc6307

Related: SYS#6773
Related: OS#6425
Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
2024-05-23 17:07:08 +02:00
Oliver Smith eccff1abe8 contrib/jenkins: set --enable-werror
Fixes: OS#6460
Change-Id: I6d85b077f57a86b0bad29cb868f1f4f848506f46
2024-05-22 08:44:06 +02:00
Oliver Smith de99af3aaa contrib: remove rpm spec file
Related: https://osmocom.org/news/255
Related: OS#6446
Change-Id: Idd67d52ca736c4e145387ea8d4030f9cf4b9596d
2024-05-08 14:40:59 +02:00
Oliver Smith ba81785b71 .deb/.rpm: various fixes related to non-root
* Explicitly chown /var/lib/osmocom to osmocom:osmocom, instead of
  relying on systemd to do it when the service starts up. This does not
  work with the systemd versions in debian 10 and almalinux 8.
* deb: Use "useradd" instead of the interactive "adduser" perl script
  from Debian. This makes it consistent with how we do it in rpm, and
  avoids the dependency on "adduser".
* deb: Consistently use tabs through the file, instead of mixing tabs
  and spaces.
* deb: Remove support for the "dpkg-statoverride --list" logic. This
  seems to be a rather obscure feature to override permissions for
  certain files or directories, for which it does not seem to be a good
  idea to make the postinst script less maintainable. Something similar
  can be achieved by using your own Osmocom config file in a different
  path with different permissions.

Related: OS#4107
Change-Id: I6dd0205fb65d4ad5a79821c111865e67fb293a73
2024-05-08 12:03:05 +00:00
Max 7449635520 .deb/.rpm: add osmocom user during package install
Create osmocom user & group during package installation.
Fix the configuration dir/files permission to match.

Related: OS#4107
Tweaked-By: Oliver Smith <osmith@sysmocom.de>
Change-Id: Ife9433291ae03392ae114ebda418bce8cc93fe3b
2024-04-24 11:52:19 +02:00
Neels Hofmeyr 90928fb246 systemd,manual: set LimitNOFILE=65536
A typical OS imposed limit is 1024 open FD, which is too low when there
are thousands of HNB.

In systemd service file, set a super high limit of 65536.

In osmo-hnbgw's user manual, add section 'Configure limits' describing
this in detail.

Related: OS#6256
Related: osmo-bsc I26c4058484b11ff1d035a919bf88824c3af14e71
Change-Id: I5333765199cf9e3e5a570f85b85d2b7423d34a4d
2023-12-03 02:21:00 +00:00
Pau Espin 92340d2131 Bump version: 1.4.0.109-89fe-dirty → 1.5.0
Change-Id: I7816b6554ce733207302c373d745b52146e0a995
2023-09-12 17:18:44 +02:00
Neels Hofmeyr 6563e11731 doc/examples/osmo-hnbgw/osmo-hnbgw-cnpool.cfg
Change-Id: I932eca7489f29eab23d180cd6d1216d26c62dd30
2023-06-16 04:07:24 +02:00
Neels Hofmeyr ab9d5364cb add doc/examples/osmo-hnbgw/osmo-hnbgw-cs7.cfg
We have not a single example yet showing point code and SCCP address
configuration. Add this example, which will also show how the config
file syntax changes while introducing CN pooling in upcoming patches.

Related: SYS#6412
Change-Id: I42c3b434a7339cc3efb27b43c893cfb734de9ca4
2023-05-26 23:23:21 +02:00
Oliver Smith 725c588f1a systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: I29e547242b2ed1cfc4750c7d7e5f8636c2e8f3dc
2023-05-26 15:31:30 +00:00
Oliver Smith 8cd268ef8a contrib/jenkins.sh: add PFCP variable
Related: OS#6013
Change-Id: Iacc6a0267d4896d0149f5e00d77951cdfc281e4e
2023-05-10 08:47:05 +00:00
Pau Espin a3c7f750a2 Bump version: 1.3.0.59-d4111-dirty → 1.4.0
Change-Id: I0e45a9ba7437f800da6115da135cc80fb9e97bfe
2023-02-07 18:05:47 +01:00
Max 0c5878fa9d Set working directory in systemd service file
By default systemd will execute service with root directory (or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it to 'osmocom' subdir of state directory (/var/lib for system instance) instead.

Related: OS#4821
Change-Id: I3133dc7a687550901841755461db6020ee96d6b1
2022-08-30 19:48:37 +07:00
Neels Hofmeyr b08b19c990 debian,RPM: package with PFCP support
- depend on libosmo-pfcp
- configure --enable-pfcp

Related: SYS#5895
Change-Id: I54dfe600d45541fecbb4c05bf75f147934c230f0
2022-08-27 16:02:51 +00:00
Oliver Smith 0a5e2b3643 rpm spec: add osmo-hnbgw-pfcp.cfg
Fix for:
  Installed (but unpackaged) file(s) found:
  /usr/share/doc/osmo-hnbgw/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg

Related: OS#5654
Change-Id: Ia05323a627719a7fff7c232aa3e5cc8766f9a8e1
2022-08-22 12:04:11 +02:00
Neels Hofmeyr 1496498713 add ps_rab_ass FSM to map GTP via UPF
Related: SYS#5895
Depends: If80c35c6a942bf9593781b5a6bc28ba37323ce5e (libosmo-pfcp)
Change-Id: Ic9bc30f322c4c6c6e82462d1da50cb15b336c63a
2022-08-08 20:20:34 +00:00
Pau Espin 44dfe698fa Bump version: 1.2.1.25-7893-dirty → 1.3.0
Change-Id: I5283bfcdcee218d2db25cd10b9a17ffe2129efb6
2022-06-29 12:42:35 +02:00
Philipp Maier 81f1751896 mgw_fsm: add MGW support to osmo-hnbgw
osmo-hnbgw lacks support for an co-located media gateway. This makes it
virtually impossible to isolate the HNB from the core network properly.

Lets add MGCP support to osmo-hnbgw so that it can control a co-located
media gateway to relay the RTP streams between HNB and core network.

Change-Id: Ib9b62e0145184b91c56ce5d8870760bfa49cc5a4
Related: OS#5152
2022-02-24 10:51:30 +01:00
Pau Espin 6d8e37f610 Do not turn some compiler warnings into errors by default
We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

This patch also effectively removes dependency on autoconf-archive.

Related: OS#5289
Related: SYS#5789
Change-Id: I7512a4230a5bbba6c67172c2572c98b9ab20c923
2022-01-11 18:30:13 +01:00
Pau Espin dce3870429 Initial structure + import code from osmo-iuh.git
Imported from osmo-iuh.git 9b4de3f401c890fc2c0dfae9e827daaaadd80db0.

Change-Id: I569d221aeb83d352c1621c44c013a0e4c82fc8a8
2022-01-04 19:48:52 +01:00