packetbroker / api

Packet Broker API
Apache License 2.0
7 stars 0 forks source link

Packet Broker API

Packet Broker is a packet-based traffic exchange for LoRaWAN networks.

This repository contains the API for interacting with the Packet Broker Router and Key Exchanges. The API is based on gRPC for high performance and portability to any environment.

Terminology

Term Meaning
Router Routes message from Forwarders to Home Networks according to the Forwarder's Policy and Home Network's Filters
Key Exchange Mechanism to transfer encryption Keys from Forwarders to Home Networks
KEK Key encryption key. Can expire on a time and/or on a number of usages. Has a price per key or per use. Key expiration is enforced by Key Exchange
DEK Data encryption key. These are sent encrypted with the key encryption key
Member Authority of Home Networks and Forwarders. Manages its Home Networks with their DevAddr prefixes and its Forwarders. It must have a LoRa Alliance NetID
Forwarder Network that forwards traffic from its gateways to and from Packet Broker. Has an ID within the Member scope
Home Network Network where the device is registered and which manages the MAC state. Has an ID within the Member scope
Tenant Tenant of a Forwarder or Home Network. Has an ID within the Forwarder or Home Network scope and a set of DevAddr prefixes
Routing Policy Routing policy of Forwarder (Tenant) and Home Network (Tenant). Contains whether routing is enabled, Uplink Routing Policy and Downlink Routing Policy
Uplink Routing Policy Flags to indicate what uplink messages and metadata get forwarded and if downlink is allowed. Can be a combination of join-request, MAC data, application data, signal quality (gateway antenna RSSI and SNR), localization (gateway antenna location, RSSI, SNR and fine timestamp if available), and whether downlink is allowed
Downlink Routing Policy Flags to indicate what downlink messages can be forwarded. Can be a combination of join-accept, MAC data and application data
Routing Filter Filter uplink messages optionally by Member, Forwarder ID, join-request EUI prefixes, confirmed yes/no, DevAddr prefix, FOpts yes/no, FPort ranges and whether or not gateway metadata is present. There can be multiple filters; any filter that passes has the message forwarded to the Home Network

Concept

High level concept

On uplink:

On downlink:

Downlink is similar to Stateless Passive Roaming as defined in LoRaWAN Backend Interfaces. The API is compatible with the XmitDataReq message, except that Packet Broker downlink can be used for join-accept messages.

Components

Types of Key Exchanges

All Key Exchanges keep track of the usage of KEKs to decrypt DEKs on request by a Home Network. Forwarders and Home Networks can be the same Member if they play both roles.

  1. Marketplace Members have one billing relationship with the Marketplace for debit and credit invoices

  2. Balancer Members can offset the balance with a mutation that they both agree on, typically from an out-of-band monetary transaction

Operations

Packet Broker Router exposes the routing services API. Clients can use gRPC directly, or use the Packet Broker command-line interface (CLI).

Packet Broker Router services are exposed on the following default ports:

Service Component Port
org.packetbroker.iam.v1.NetworkRegistry IAM 443
org.packetbroker.iam.v1.TenantRegistry IAM 443
org.packetbroker.iam.v1.APIKeyVault IAM 443
org.packetbroker.routing.v1.PolicyManager Control Plane 443
org.packetbroker.routing.v1.Routes Control Plane 443
org.packetbroker.routing.v1.ForwarderData Data Plane 443
org.packetbroker.routing.v1.HomeNetworkData Data Plane 443
org.packetbroker.routing.v1.RouterData Data Plane 443

Packet Broker Router uses token-based HTTP authentication and TLS mutual authentication. Learn how to obtain a TLS client certificate.

License

The API is distributed under Apache License, Version 2.0. See LICENSE for more information.