Skip to content

Changes

Summary

  1. per-HNB GTP-U traffic counters via nft (details)
Commit 64a2debb9a1b92ce19b2acc5f90117ed23d9178c by nhofmeyr
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
The file was modified configure.ac
The file was modified src/osmo-hnbgw/tdefs.c
The file was modified tests/osmo-hnbgw.vty
The file was modified debian/rules
The file was modified include/osmocom/hnbgw/Makefile.am
The file was modified contrib/jenkins.sh
The file was modified src/osmo-hnbgw/osmo_hnbgw_main.c
The file was modified include/osmocom/hnbgw/hnbgw.h
The file was modified src/osmo-hnbgw/hnbgw_hnbap.c
The file was addedsrc/osmo-hnbgw/nft_kpi.c
The file was modified debian/control
The file was modified src/osmo-hnbgw/hnbgw.c
The file was modified src/osmo-hnbgw/Makefile.am
The file was addedinclude/osmocom/hnbgw/nft_kpi.h
The file was modified src/osmo-hnbgw/hnbgw_vty.c