Notices
Copyright © 2014-2019 Metaswitch Networks. All rights reserved
This manual is issued on a controlled basis to a specific person on the understanding that no part of the Metaswitch Networks product code or documentation (including this manual) will be copied or distributed without prior agreement in writing from Metaswitch Networks.
Metaswitch Networks reserves the right to, without notice, modify or revise all or part of this document and/or change product features or specifications and shall not be responsible for any loss, cost, or damage, including consequential damage, caused by reliance on these materials.
Metaswitch and the Metaswitch logo are trademarks of Metaswitch Networks. Other brands and products referenced herein are the trademarks or registered trademarks of their respective holders.
Sh Cache Microservice Overview
Sh Cache Microservice
The Sh Cache Microservice is a network element that provides a caching layer in front of a Home Subscriber Server (HSS) for certain queries over Sh.
Network elements interface with the microservice via an Sh/HTTP API. The microservice provides responses to queries by consulting its internal cache and/or talking to the HSS via Sh.
The top level architecture of the Sh Cache Microservice is present in the following section.
Top Level Architecture
The major elements of the Sh Cache Microservice are shown in the following diagram.
The Sh Cache Service decodes the request to determine what operation is being performed. This is looked up in the Cassandra database. If not found, use the Diameter Sh RA and perform the appropriate operation against the HSS to find/update the information. When the HSS replies, update the DB accordingly.
Elements in green correspond to existing components and products in the Metaswitch portfolio. |
Sh Cache Service
The Sh Cache Service is a Rhino TAS based application that receives and processes Diameter Sh/HTTP requests from external network elements.
-
Sh Cache Service Overview — introduces the Sh Cache Service and its architecture
-
Sh Cache Microservice API — HTTP interface to the Sh protocol for accessing cached subscriber data from the HSS
Notification Service
The Notification Service processes Diameter Sh requests from the HSS.
-
Push Notification Handling — introduces the Notification Service and its architecture
-
Sh Cache Notification API — HTTP API that Sh Cache microservice clients use to receive notifications from the microservice
Cache (Cassandra)
Apache Cassandra is a distributed, highly available, NoSQL database management system designed to handle large amounts of data across many commodity servers.
For more details see: Apache Cassandra.
Sh Cache Service Overview
Sh Cache Service
There are three main components of the Sh Cache Service.
-
Decode HTTP Request — decode and validate Sh/HTTP requests.
-
Cache Facade — provide an interface to the Cassandra database so the service can query and update the cache.
-
HSS Facade — provide an interface for the service to query and update the external HSS.
The following sections outline the behaviour of the Sh Cache Service for two simple scenarios.
Cache Miss Scenario
-
Decode and validate a Sh/HTTP request. The request is valid so …
-
Query the cache to see if a result can be returned immediately.
-
In this case there is nothing in the cache so …
-
Send an Sh query to the external HSS
-
The HSS processes the query and sends a response
-
Receive the Sh response and …
-
Update the cache …
-
By updating the Cassandra database
-
Send an HTTP response to the the original Sh/HTTP request
Push Notification Handling
Notification Service
There are three main components of the Notification Service.
-
HTTP Notify — send notification requests to clients of the Sh Cache Microservice.
-
Cache Facade — provide an interface to the Cassandra database so the service can query and update the cache.
-
HSS Facade — provide an interface for the service to query and update the external HSS.
When receiving a Push Notification Request from the HSS, the Sh Cache Microservice has to determine which data reference the notification is for. As the Push Notification Request does not contain an AVP indicating the data reference, the service parses the user data to determine the data reference. The data reference is determined by using the first rule from the list below which applies.
The following section outlines the behaviour of the Sh Cache Service for the UE reachability scenario.
UE reachability scenario
-
Receive a PushNotificationRequest (PNR) from the HSS. Determine the data reference is
UE_REACHABILITY_FOR_IP
-
Query the cache for subscriber data
-
In this case there is data in the cache …
-
Send a PushNotificationAnswer (PNA) to the HSS
-
Build an HTTP request …
-
… and notify the microservice client
Sh Cache Microservice RA Overview
Sh Cache Microservice RA
The Sh Cache Microservice RA allows Rhino TAS based applications (such as Sentinel) to use the Sh Cache Microservice. It implements an existing RA type (Sh Cache RA type) and delegates to the Sh Cache Microservice using the Sh/HTTP api.
The following diagram shows the Sh Cache RA in context. The Sh Cache RA has an in process cache per node and interacts directly with the HSS. The API Rhino TAS based applications use is encapsulated in the Sh Cache RA type.
The following diagram shows how the same solution would be realised with the Sh Cache Microservice. The Sh Cache Microservice RA also implements Sh Cache RA type, so Rhino TAS based applications require no change to make use of the Sh Cache Microservice. In this scenario there is now one central cache (the microservice) that can also be used by other Rhino TAS based applications and other network elements via the Diameter Sh/HTTP api.
Sh Cache Microservice RA Implementation
The following diagram presents the architecture of the Sh Cache Microservice RA in more detail.
The Sh Cache Microservice is implemented using the Metaswitch RA framework. This framework simplifies the development of resource adaptors by providing components to simplify common tasks such as RA configuration and changes during the RA lifecycle. The implementation uses two libraries to support the development of the Diameter Sh/HTTP API: Swagger and Vert.x