Glimesh / janus-ftl-orchestrator

A service used to manage multiple instances of janus-ftl-plugin for use at scale.
GNU Affero General Public License v3.0
15 stars 3 forks source link

🤔 Protocol spec changes to streamline relay connections #6

Closed haydenmc closed 3 years ago

haydenmc commented 3 years ago

Updating the spec with a slightly different flow, allowing ingest nodes to relay streams to edge and relay nodes as if they were plain old FTL connections. A generated stream key is now included with channel subscriptions, and that stream key is used by ingest nodes to open FTL relay connections to any subscribed edge nodes.

This should simplify the relay process by relying on existing FTL protocol mechanisms for relaying video data between nodes.

This change also updates messages to allow nodes to identify themselves as relay nodes used only to forward stream video data between other nodes. Nodes can also provide a region string, used to help Orchestrator prioritize routes in the same region. Nodes can also indicate their current load, so Orchestrator can avoid routing bottlenecks.

For the diagrams in PROTOCOL.md, see below - the in-line images won't work until this is merged to main.

Diagrams

Video Routing Diagram uml/stream-routing-use-case.plantuml: This diagram visualizes the high-level flow of video traffic from streamers through relay servers to edge nodes that viewers connect to.

Video Routing Diagram

Routing Strategy Activity Diagram uml/routing-strategy-activity.plantuml: This diagram visualizes the routing strategy that the Orchestrator will use to route streams from ingest nodes to edge nodes.

Routing Strategy Activity Diagram

FTL Orchestration Sequence Diagram, No Relays uml/sequence-diagram-no-relays.plantuml: This diagram shows the expected sequence of calls to route a stream in a service graph without any relay nodes.

FTL Orchestration Sequence Diagram, No Relays

FTL Orchestration Sequence Diagram, Relays uml/sequence-diagram-with-relays.plantuml: This diagram shows the expected sequence of calls to route a stream in a service graph with relay nodes between ingests and edges.

FTL Orchestration Sequence Diagram, Relays