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.16, an older release. The newest release is 6.20. Read this page in 6.20

IP pools and service profiles

This document describes how you can configure IP pools and service profiles in TPOSS.

IP pools configuration

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

yaml
  • wan_ip_range - the name of a pool which defines an IP range from where IPs are allocated.
  • range - the range of IP addresses.
  • blocks - the number of sub-blocks into which the IP pool is split. The IP blocks are distributed over TPOSS instances within a 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.
  • initial_active_blocks - the number of blocks to activate initially per instance. You can use this option to spread IP usage over the range.

The ippools_selectors parameter contains the mapping between pool names and their selectors based on the RADIUS attribute and its value.

If TPOSS allocates IP addresses, set this configuration option to false to handle RADIUS Access-Request 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 the allocation of a Framed IP address, use this configuration option:

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 behaviour is disabled by default to preserve backward compatibility with the previous versions of TPOSS.

Change IP pools block size and count

Caution

You may 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 find a suitable IP pool, assign a DNS server, and a NAT pool, TPOSS must know what service profile to use for a given subscriber. Service profiles are provisioned by TPOSS during startup. You can specify them with the following configuration:

yaml

Note

The DE parameter specifies a home country name but it is recommended to switch to the new configuration format.

Multiple profiles with same home country

In the previous paragraph, DE specifies a homecountry name 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 name, provide the name of the homecountry in the name parameter. In this case, a selector is needed for TPOSS to know which profile to choose. That's why, specify the service profiles the same way as the DE-1 and DE-2 parameters in this example:

yaml

Note

Since the name values for different profiles may be the same, the keys like DE-1 and DE-2 must be unique.

Profiles selector

The service profile selector is an optional configuration parameter that is represented by the profiles.{NAME}.selector field. When selecting a service profile, TPOSS looks through all profiles and defines a set of profile candidates to choose from. The set of profile candidates contains:

  • Profiles matching the selector
  • Profiles with no selector defined

The selector represents a set of key-value pairs split by a comma. The items of the set are interpreted as logical AND conditions. Each key must be split from its value with a colon :. The key represents the name of RADIUS AVP. The value is a regular expression that represents a value of this RADIUS AVP. See the example:

yaml

Profile selection

As described above, TPOSS must find a service profile to apply for a given subscriber at each RADIUS Access-Request. This process looks as follows:

  1. TPOSS receives a RADIUS Access-Request from PGW.
  2. TPOSS tries to fetch a subscriber and all the user data based on IMSI.
  3. TPOSS checks all the provisioned service profiles and selects those for which the selector is matched or not configured.
  4. TPOSS checks all the provisioned service profiles and selects those for which a home country name is matched with the subscriber's home country name (if the subscriber is provisioned and has the associated service profile) and subscriber_required is set to true.
  5. If the list of profiles from step 4 is not empty, TPOSS looks through the list built in step 3 and tries to find a service profile with:
    • subscriber_require set to true
    • home country name of the service profile matched with the homecountry name of the subscriber
  6. If the list of profiles from step 5 is empty, the following steps depend on the subscriber:
    • If the subscriber is not provisioned, TPOSS looks for a service profile that is matched by the selector and subscriber_required is set to false.
    • If the subscriber is provisioned but does not have an associated service profile, TPOSS looks for a service profile that is matched by the selector and subscriber_required is set to true
  7. If a service profile is not found, the request is rejected.

Note

To prevent ambiguity during selection, do not specify two or more service profiles with the same selector, the same home country name, and the same values of subscriber_required. In such a case, TPOSS may not know which profile to choose. The behaviour in such cases is unpredictable and the first random service profile is used.

Profiles without a subscriber

The user may not have a provisioned subscriber or associated service profile in the TPOSS database. You can 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 an IP pool, NAT IP pool, and DNS configuration.

Profiles precedence

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, it selects and applies a service profile with the highest precedence. 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, pass it 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 by default. 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.

IP pools

Each service profile may contain a set of IP pools separated by a comma or no IP pool at all. When there are more than one IP pool specified, the IP pool selector is used to find a proper pool. If there is no match, a random pool is used. If a service profile does not specify an IP pool range, TPOSS accepts such users anyway but an IP address is not allocated.