a python based User Plane Service Function (UPSF) gRPC server implementation. The server is lightweight by design and contains not much logic, as the i.e. 'decision logic where a session would be assigned to' should be done by a operator. Only trivial operations like checks if a item already exists before i.e creating/updating. Items are uniquely identified by its name which is mandatory on creation. Only session contexts don't need a name on creation as the name is a hash generated by the provided 5-tuple (s-tag, c-tag, source-mac-address, remode-id, circuit-id).
- redis
- python3
- pip
- virtualenv (optional)
- python packages from requirements.txt
pip install -r requirements.txt
python3 setup.py build install
in order to run the server start the redis server and point to the host / port where the redis server is running. This can be done by setting ENV vars or using cmd line options, please refer to the section below.
upsf-server [flags]
where flags
are:
flags
: Specifies optional flags. For example, you can use the--redis-host
flag to specify the address of the redis server.
option | flag | description | default |
---|---|---|---|
NAME | --name | the name of the server | upsf-server |
GRPC_MAX_WORKERS | --max-workers, --grpc-max-workers | the maximum count of active gRPC worker threads | 16 |
GRPC_BIND_ADDR | --bind-addr, --grpc-bind-addr | the bind address of the gRPC host | [::] |
GRPC_BIND_PORT | --bind-port, --grpc-bind-port | the bound port of the gRPC port | 50051 |
REDIS_HOST | --redis-host | the host address of the redis backend | 127.0.0.1 |
REDIS_PORT | --redis-port | the host port of the redis backend | 6379 |
REDIS_PASSWORD | --redis-password | the password of the redis backend | None |
REDIS_HEALTH_CHECK_INTERVAL | --redis-health-check-interval | the redis health check interval | 30 |
DEFAULT_SHARD_NAME | --default-shard | default subscriber group (shard) to assign to new session context on failed sss lookups | default-shard |
UPSF_CMD_QUEUE | --upsf-cmd-queue | the Redis cmd queue to listen to | UpdatesIngress |
UPSF_CMD_QUEUE_AUTO_PROCESS | --upsf-cmd-queue-auto-process | bool to enable or disable the command queue | True |
LOGLEVEL | -l, --loglevel | the level of information printed. Available options: info, warning, critical, error, debug | info |
Note: the UPSF cmd queue can be invoked to process each item by a special operator which may have individual logic for each item type.
for a list of available message contents please refer to the .proto
files
located in the protos directory.
RPC | item | return | description |
---|---|---|---|
CreateV1 |
wt474_messages.v1.Item |
wt474_messages.v1.Item |
creates a new item |
UpdateV1 |
UpdateReq |
wt474_messages.v1.Item |
updates an item |
DeleteV1 |
google.protobuf.StringValue |
google.protobuf.StringValue |
deletes an item |
LookupV1 |
wt474_messages.v1.SessionContext.Spec |
wt474_messages.v1.SessionContext |
looks up a session context by the provided 5-tuple (mentioned above) or creates one on the fly |
ReadV1 |
ReadReq |
stream wt474_messages.v1.Item |
ReadReq allows one or more items to be retrieved |
ReadV1 Notes:
All items of one type can be retrieved by omitting the parent A single item of itemtype can be retrieved by specifying the itemname as parentname. Otherwise, all items of a defined type recursively 'under' the parent will be returned. This includes where an item is 'under' the parent through a desired or current field. When the 'watch' flag is not set, the stream will close after all current items matching the request have been sent. When the 'watch' flag is set, the stream will remain open to send any further changes to any items matching the request.