> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/tposs/latest/architecture/tposs-hss.md).

# TPOSS HSS architecture

When TPOSS is configured and deployed as an HSS, it serves a Mobility Management Entity (MME) over the Diameter S6a interface.

It consists of the following components:

- Home Subscriber Server (HSS, 3GPP HSS) answers the authentication, location update, and purge requests of an MME. It stores the 4G subscription data of a subscriber and passes it to the serving MME.
- Authentication Centre (AuC, 3GPP AuC) stores the secret key of a subscriber and computes the authentication vectors that the HSS sends to an MME.

TPOSS HSS creates neither network nor service sessions, and it does not use RADIUS. The HSS runs its own Diameter service which provides support for the Diameter S6a interface. For more information about this Diameter interface, read the [HSS S6a message flow](https://docs.cennso.com/components/tposs/latest/architecture/s6a.md) document.

To handle incoming requests from an MME, TPOSS HSS needs to have the following information:

- the subscription data of a subscriber
- the key material to authenticate it
- the record of the MME that serves it

In the sections below, you can find more information about each of them.

## Subscriber data

TPOSS HSS keeps the following information about a subscriber in the MySQL database:

- The subscription that holds the subscriber data, such as the IMSI, the MSISDN, and the subscriber status.
- The APN profile that holds an APN and information related to it. Several subscriptions can share one APN profile.
- The registration that holds the MME that currently serves a subscriber.

Subscribers, their APNs, and their key material are provisioned over the HTTP endpoints under `/hss`. These endpoints are not a part of the JSON-RPC API and do not go through TPOSS API Gateway. For more information, see the [REST API](https://docs.cennso.com/components/tposs/latest/api-reference/rest/api.md) document.

## Authentication Centre

> [!TIP]
> You can find more information in the [Authentication Centre key management](https://docs.cennso.com/components/tposs/latest/configuration/auc-key-handling.md) document.

The AuC holds the long-term key [`Ki`](https://docs.cennso.com/components/tposs/latest/glossary.md#hss-related-authentication-terms) of a subscriber and computes the authentication vectors with it.

`Ki` is stored encrypted in the database. The encryption key comes from a Kubernetes Secret, which TPOSS reads before it opens the S6a listener, so a missing Secret stops the TPOSS instance at start-up instead of failing the first authentication.

## Serving MME

Every successful [Diameter S6a Update-Location](https://docs.cennso.com/components/tposs/latest/architecture/s6a.md#authentication-and-location-update) request records the MME that serves the subscriber:

- MME host
- MME realm
- Radio access type
- Visited PLMN

TPOSS uses these records in two procedures. When an `Update-Location` replaces a different MME, TPOSS cancels the location of the subscriber on the MME that served it before. A Purge-UE request marks the subscriber as purged, and TPOSS accepts it only from the MME that currently serves the subscriber.
