For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

You are reading Travelping Open Subscriber Server 6.14, an older release. The newest release is 6.20. Read this page in 6.20

High availability

For high availability (HA) in a production deployment, it is recommended to setup at least three TPOSS replicas to handle all incoming requests and maintain sessions status during the upgrade procedure. It could be configured using this configuration option:

yaml

The additional configuration options to maintain TPOSS for high availability (HA) are:

yaml
  • podIP enables special naming for TPOSS nodes so each TPOSS node knows how to do service discovery for other TPOSS nodes and all of the deployed TPOSS instances know how to build a cluster.
  • probes enables liveness and readiness probes, which can be useful for graceful termination during TPOSS cluster upgrade. For more information about probes, see the official Kubernetes documentationOpens in a new tab.
  • terminationGracePeriodSeconds specifies the number of seconds for a termination grace period. As TPOSS node receives the SIGTERM signal, the TPOSS node is marked as not ready and it waits the specified period of time to finish handling of all requests.

Note

The value of terminationGracePeriodSeconds should be at least DNS TTL configured within cluster + 5 seconds.

After all TPOSS instances are up and running, run the Tposs.Utils.get_nodes command to make sure that each TPOSS instance is connected to the cluster. This command returns the list of all known nodes, so in the case of 3 replicas it looks like this:

text

For more information on how to execute commands within TPOSS and get into TPOSS remote console, read the Troubleshooting guide.

The upgrade procedure is executed using the helm upgrade command. For more information see the Installation guide.

Note

It is worth to upgrade TPOSS cluster only when there is minimal number of active users.

Database configuration

TPOSS should have the ability to connect to MySQL service from the start-up. The main TPOSS configuration related to the database connection is:

yaml

In addition, new versions of TPOSS may need database migrations. It should be enabled using this command:

yaml

TPOSS may store PCS sessions in different databases. The currently supported databases are:

  • Mnesia
  • MySQL

The MySQL database is preferred for TPOSS HA as it leads to much easier and stable upgrades. The backend for the PCS sessions can be configured using this configuration option:

yaml

Sessions behaviour configuration

TPOSS provides a couple of configurable parameters that may control different aspects of behavior of PCS sessions.

TPOSS uses a global lock across all the TPOSS instances within the cluster to avoid potential race conditions. In the new version of TPOSS we provide following new configuration option to disable the lock:

yaml

Note

This configuration option is experimental and should be used with caution. Although the disabled lock may bring significant improvements in resource consumption, it also might be a reason for unexpected behavior if TPOSS receives two RADIUS or Diameter requests with the same identifier (IMSI or Session-Id).

All the PCS sessions (network and service sessions) are stored in MySQL database. There is an experimental feature that may allow to store PCS sessions in the in memory caches during session creation time. This behavior can be controlled with the following configuration options:

yaml

If the sessions.cache is enabled, TPOSS start to store intermediate representation of sessions in the in memory cache. Only when the session is fully established it is inserted in the database. The type of the in-memory cache depends on the value of the sessions.cache_backend configuration option. For this moment two following values are supported:

  • ets
  • redis

If the cache backend is set to redis all the other redis related configuration options should be configured with the respective values.

Besides caching of the PCS sessions, TPOSS provides support for caching of charging data like charging accounts and balances. To enable this feature you may use the following configuration option:

yaml

Note

Both of these features are experimental and must be used with caution. If the sessions.cache_backend is set to ets, it can be used only with the Diameter Proxy v1.1.0 version and the sticky sessions feature enabled.

Idle session configuration

Each network and service session is usually stored in the database during the whole session lifetime. However, if TPOSS does not receive any updates for a given session from PGW or SCG, it may terminate the sessions as idle sessions.

This functionality is configured with the keepalive_timeout parameter. The following configuration options may control this behaviour:

yaml

If the keepalive_timeout value is 0 or the idle_timer_enabled is false, the session's idle timer is disabled. If the idle timer functionality is enabled, TPOSS starts the idle timer process. The process checks the idle time of sessions every five seconds. If there is an idle service session, TPOSS terminates it without any notification and deletes it from the database. If there is an idle network session with an idle time higher than the keepalive_timeout value, TPOSS starts the process of terminating this session by sending the RADIUS Disconnect request to PGW. The further behaviour depends on the response:

  • Disconnect-ACK - TPOSS expects a RADIUS Accounting-Stop request for the network session
  • Disconnect-NAK - TPOSS immediately terminates the network session and deletes it from the database
  • If there is no answer, the next try for a session termination is postponed for ten seconds.

After the session is terminated on the TPOSS side, the idle process keeps checking for idle sessions every five seconds.

The following diagram depicts the described procedures:

RADIUS configuration

TPOSS receives RADIUS requests from PGW to authorize sessions and maintain their state based on RADIUS accounting requests. For this case, specify RADIUS listeners. For example:

yaml

Only RADIUS requests from the known source addresses are accepted by the TPOSS RADIUS servers. This behaviour can be configured via:

yaml
  • ggsn specifies source addresses for RADIUS requests from PGW
  • scg specifies source addresses for RADIUS requests from SCG

Caution

Most RADIUS metrics have labels that specify the NAS name and source IP of the incoming request. Setting wide IP ranges in the configuration of the accepted source addresses may lead to high resource consumption and performance degradation.

Both authorization and accounting listeners may track time of incoming requests handling. For this purpose, you can configure the histogram buckets using this option:

yaml

As TPOSS does not only receive RADIUS requests but also may send RADIUS Disconnect requests towards PGWs, provide the addresses of PGWs or RADIUS agents that are able to forward requests towards PGW.

yaml

Diameter configuration

To receive incoming Diameter requests from LGW/SCG, specify Diameter listener along with other Diameter options within configuration.

The Diameter listener should be enabled via these configuration options:

yaml

To identify TPOSS as a Diameter agent, it should have own Origin-Realm:

yaml

Here are the additional Diameter configuration options that may control Diameter connections, timeouts and behavior of other aspects of Diameter:

yaml

For more information, see the TPOSS configuration document in the TPOSS component documentation.

Charging rules configuration

You should specify the list of rating groups for TPOSS with respective names to allocate charging rules and handle charging reports:

yaml

To disable the unlimited_streaming charging rule, use this configuration option:

yaml

To configure the traffic quota that is allocated for the sessions with the B2BInternet charging rule, use this configuration option:

yaml

IP pools configuration

To allocate Framed-IP-Address, TPOSS uses IP pools. They are specified via these configuration options:

yaml
  • wan_ip_range - a name of the pool which defines certain IP range where IPs are allocated from.
  • blocks - the number of sub-blocks into which the IP pool is split. The IP blocks are distributed over TPOSS instances within cluster.
  • allow_to_decrease_number_of_blocks - the boolean value that provides the ability to decrease the number of blocks. TPOSS ignores the new number of blocks if the value of allow_to_decrease_number_of_blocks is set to false and the new number of blocks is lower than the previous one. In such a case, the original number of blocks is used.
  • mark_inactive - the percentage of block usage after which the block is marked as inactive. After the block is marked as inactive, TPOSS does not allocate IPs from this block anymore but only populates it back when IPs are released.
  • packed - the percentage of used IPs from a given block after which TPOSS tries to pre-fetch a new block of IP addresses.
  • reactivate - the percentage of busy IPs within the inactive block after which the IP block that previously was marked as inactive is marked as active again and TPOSS continues to use it.
  • ippools_selectors - the mapping between pool names and their selectors based on the RADIUS attribute and its value.
  • initial_active_blocks - the number of blocks to activate initially per instance (use this to spread ip-usage over the range).

If TPOSS allocates IP addresses, set this configuration option to false to handle RADIUS Access-Request requests from PGW properly:

yaml

By default, allocated Framed IP addresses are stored in the MySQL ip table. To reduce the number of database queries needed for allocation of the Framed IP address, the following configuration option can be used:

yaml

If the value of this option is set to true, the separate ip table is not used anymore and allocated IP addresses are stored only in the network session table.

Note

The sessions.store_ip_within_network_sessions feature is experimental. The new behavior is disabled by default to preserve backward compatibility with the previous versions of TPOSS.

Change IP pools block size and count

Caution

Change the IP pool block count only when the system is not under heavy load as it may affect the production environment. The ability to decrease the number of blocks is disabled by default as it may lead to ineffective usage of blocks when TPOSS is under load. You can change this behaviour by setting the ippools.{range-name}.allow_to_decrease_number_of_blocks to true, although it is not recommended.

You can change the IP pool block count, for example, to have new blocks activated more frequently and spread the IP usage better over the range. You can also increase the block count to avoid bottlenecks that occur due to heavy usage.

There are two ways to change the IP pool block count. The first one is to adjust the TPOSS cluster configuration followed by a restart. To change the block count, adjust the ippools.{range-name}.blocks configuration option. As a result, the next starting TPOSS instance will migrate the existing blocks to the desired size and count.

The second way is to adjust the number of blocks for the given IP pool at runtime without TPOSS restart. To do so, use the following command in the TPOSS remote console:

elixir
  • range-name is an Elixir atom defined in the TPOSS values file at the path ippools.{range-name}.
  • block-count is an integer with a static value set in the TPOSS values file at the path ippools.{range-name}.blocks.

Note

If you change the number of blocks at runtime, adjust this IP pool configuration also in the values.yaml file. Otherwise, TPOSS will continue to use the original number of blocks after the restart.

Service profiles configuration

To allocate Framed-IP-Address(es), TPOSS must know which IP pool to use. For this case, TPOSS must check a service profile of a given subscriber. Service profiles are provisioned by TPOSS during startup. You can specify them with the following configuration:

yaml

Each service profile may contain a set of IP pools separated by a comma. In such a case, the IP pool selector is used to find a proper pool. If there is no match, a random pool is used.

In the example above, DE specifies homecountry for the given service profile. These configuration keys must be unique across all service profiles. If you need to specify multiple service profiles with the same homecountry, provide the name of the homecountry in the name parameter:

yaml

In this case, the service profiles are identified by DE-1 and DE-2 parameters.

When TPOSS receives a RADIUS Access-Request request, it goes over all pre-configured service profiles and tries to find one to apply for the given user. The service profile selector is an optional configuration parameter that is represented by the profiles.{NAME}.selector field. The selector represents a set of key-value pairs split by a comma. Each key-value pair should be split by a colon :. The key represents the name of RADIUS AVP. The value is a regular expression that represents a value of this RADIUS AVP. TPOSS checks the selector of each service profile. If it is matched and the name of the home country is matched with the home country associated with the user, the service profile is applied.

The user may not have a provisioned subscriber or associated service profile in the TPOSS database. You may specify service profiles that are not required to have subscribers for users with the profiles.{NAME}.subscriber_required configuration parameter. Such service profiles should not specify IP pool configuration.

Note

If the service profile do not specify an IP pool range, TPOSS will accept such users anyway but an IP address will not be allocated.

The profiles.{NAME}.precedence configuration parameter specifies the precedence of the service profile. If TPOSS finds two or more service profiles that can be applied for a user, the service profile with the highest precedence is selected and applied. You can change the precedence at runtime using the following API:

elixir
  • profile_id is the {NAME} of the service profile. The data type of profile_id is atom, so if the profile ID is DE, it should be passed as :'DE'.
  • precedence is an integer number that represents the new value precedence for the given service profile

Note

Don't set precedence to value other than 0. It should be used only in the maintenance mode. If you change this value at runtime, TPOSS does not preserve it after a restart and uses the original value instead. To preserve this value, adjust the values.yaml configuration file.

Tariffs configuration

The set of tariffs is provisioned by TPOSS during start-up of the TPOSS instance. For each tariff, a tenant should be configured via:

yaml

To reprovision new tariffs, the following API exists:

yaml

After running this command, the following new tariffs are reprovisioned into the database:

  • online@tariff.new-tenant - TPOSS allocates a quota from a valid balance if such exists. The balance is selected based on the carrier and IMSI.
  • blocked@tariff.new-tenant - The RADIUS Access-Request request is rejected for a subscriber with this tariff.
  • home-country-change@tariff.new-tenant - Only the Portal rating group is allocated for a subscriber with this tariff.
  • operator-swap@tariff.new-tenant - Only the Portal rating group is allocated for a subscriber with this tariff.
  • default@tariff.new-tenant - Only the Portal rating group is allocated for a subscriber with this tariff. TPOSS allocates a quota from a valid balance if such exists. The balance is selected based on the IMSI.
  • b2binternet@tariff.new-tenant - The pre-configured quota is allocated at each update request. The amount of quota is taken from the value of the scg.b2b_internet_quota configuration option.

To get more information on how to execute TPOSS commands, see the Troubleshooting guide.

CDRs configuration

When SCG sessions is terminated or a balance is exhausted by validity time or by quota, TPOSS creates a CDR record. TPOSS may write CDRs to multiple destinations. The regular targets are the file-based backend and the database backend.

The following configuration is supported by TPOSS:

yaml
  • partitions_duration - how long partition is considered as active
  • new_partitions_amount - how many partitions create when the currently active partition is last one
  • cdr_cleanup_period - how long preserve CDR partitions

It is recommended to enable CDR table partitioning using the cdr.controller.database.partitions_enabled option.

The partitions_duration and cdr_cleanup_period accept different time units:

  • 14-days
  • month
  • 2-minutes

The supported amount part consists of a positive integer and time unit. The support time units are:

  • second(s)
  • minute(s)
  • hour(s)
  • day(s)
  • week(s)
  • month(s)
  • year(s)

The clean_up_partitions_at is optional configuration option that may contain a string value in "HH:MM" format. If the configuration value is not empty - TPOSS provisions event for deletion of outdated CDR partitions that should be triggered once per-day in the given time. That could be useful to run deletion of partitions in less busy time to not bring impact of operations related to partitions on other database queries. If this configuration option is set to empty string - "" the event to delete outdated partitions is triggered each 7 minutes. The time zone of the given time depends on the time zone configured at the database server.

If deletion of partitions is triggered once per-day and it is failed by some reasons or it should be triggered during maintenance time - the missed deletion of partitions could be triggered manually with mysql client via calling this procedure:

sql

with suitable arguments where the second argument specifies unit of time and the first argument specifies amount of such units after which a partition could be considered as outdated.

If partitions are disabled, the special process watches for CDR table and deleted outdated CDR records. The following options control the behaviour of this process:

  • watcher_timeout - timeout in milliseconds that specifies how often to check CDR table
  • cdr_cleanup_limit - limit of how many CDRs should be removed at once. The supported values are any positive integer values or the string all.

To write CDRs on a disk, a PersistentVolume must be provided:

yaml

In addition, you can enable an SFTP container so that CDRs can be fetched from an external system for further CDR processing:

yaml

The sftpConfig must contain a password that was hashed using the crypt algorithm. For the example the configuration above has: sftpConfig.password = "$1$RsBlW1hk$/ISHFEK0yrEX8M7x9.lbB1" which is the value that was obtained by the result of the following command:

text

The username of the sftp user is sftp and can not be changed.

Hooks configuration

TPOSS supports a set of events. Each of them can be enabled or disabled. If an event is enabled, provide a pre-configured endpoint to TPOSS for sending events.

The following events are supported:

  • hook.balance.volume.threshold - event is triggered on a volume threshold by the configurable level of consumption
  • hook.mccmnc.changed - event is triggered on the change of Mobile Country Code and Mobile Network Code (MCCMNC)
  • hook.visited_country.changed - event is triggered on the change of a visited country
  • hook.network_attachment.first - event is triggered on the first attachment to the network
  • hook.charging_rules.changed - event is triggered on the change of charging rules of a subscriber

The events can be configured via the following configuration options:

yaml

For more information, see the TPOSS configuration document in the TPOSS component documentation.

HTTP API and TPOSS API gateway

To configure TPOSS HTTP API, adjust the following options:

yaml

In addition, TPOSS HTTP API is usually accessed via TPOSS API Gateway.

See the example of TPOSS API Gateway configuration:

yaml

In HA mode, it is usually enough to have a single TPOSS API Gateway even with multiple TPOSS instances, because it does not handle requests constantly and rarely upgraded part.

Logging configuration

TPOSS writes log messages into stdout. Use the following configuration options to control TPOSS logging:

yaml

These are the available RPR log levels:

  • emergency
  • alert
  • critical
  • error
  • warning
  • notice
  • info
  • debug

The supported formats are:

  • default
  • JSON

IMEISV whitelist configuration

The whitelist feature allows you to apply the specific service profile for users with unknown IMEISV. The feature is disabled by default. You can enable it using the following configuration:

yaml

When TPOSS receives RADIUS Access-Request with the unknown IMEISV that does not exist in the TPOSS database, the pre-configured whitelist.imei.default.service_profile service profile is applied for this user. Besides the selected service profile, the service sessions of such users always have the pre-configured whitelist.imei.default.access_class charging rule.

Note

The whitelist.imei.default.service_profile parameter must reference the existing service profile. The profiles.{NAME}.name (if multiple service profiles with the same home countries are configured) or profile.{NAME} of such profile must be unique across all configured profiles.