Skip to content

First draft of stage 0 document - #1

Closed
JoTurk wants to merge 8 commits into
masterfrom
stage-0-document
Closed

JoTurk wants to merge 8 commits into
masterfrom
stage-0-document

Conversation

@JoTurk

@JoTurk JoTurk commented Jul 6, 2025

Copy link
Copy Markdown
Member

Description

please read the document and feel free to add any thoughts you have or edit the document in any way.

@JoTurk
JoTurk requested review from 3DRX, Sean-Der, jech and sideDesert July 6, 2025 11:26
@jech

jech commented Jul 6, 2025 •

Copy link
Copy Markdown
Member

I see with pleasure that you've more or less described the feature set of Galene :-)

For example: First-class support for SVC, simulcast, and multicast.

There's no multicast in WebRTC, so I think this deserves clarification.

Supply an SDK for embedded devices.

Please clarify. Do you mean a client library? What's an embedded device, an AVR with 8kB RAM, or an ARM64 device with 8GB?

Include WHIP/WHEP support from day one.

WHEP is not finished yet, so I suggest restricting this to WHIP for now.

Transport state is tightly coupled to in-memory stateful objects, preventing seamless migration of streams between SFU instances

Please remove this item, or at least rewrite it. Exposing TLS state is a bad idea from a security standpoint, as it allows leaking session keys, thus potentially breaking forward secrecy. Migration must involve renegotiation, so that session keys are regenerated and never leaked.

@JoTurk

JoTurk commented Jul 6, 2025 •

Copy link
Copy Markdown
Member Author

@jech Thank you for your thoughts.

I see with pleasure that you've more or less described the feature set of Galene :-)

Tbh, I think if we don't get a lot of contributions, I think we should direct the energy towards contributing to pion itself, or other projects in the community like Galene, but we'll see by the end of this stage :)

There's no multicast in WebRTC, so I think this deserves clarification.

I meant multicasting a single source to multiple rooms, it's a nieche feature but it will force us to think of a clean architecture to handle ingest streams, I think, this is why I added it.

Please clarify. Do you mean a client library? What's an embedded device, an AVR with 8kB RAM, or an ARM64 device with 8GB?

I meant finishing the TinyGo support in Pion, and make a simple Pion-based client, and maybe adding hardware acceleration for some devices (not sure if it will help), maybe target media devices for HW encoding / decoding too, I'm not sure what devices will support this yet, but this sound like something we can test in the future.

WHEP is not finished yet, so I suggest restricting this to WHIP for now.

I think it's safe to add it as an experimental protocol, well, it's better than making a custom protocol.

Please remove this item, or at least rewrite it. Exposing TLS state is a bad idea from a security standpoint, as it allows leaking session keys, thus potentially breaking forward secrecy. Migration must involve renegotiation, so that session keys are regenerated and never leaked.

You're right, I added a clarification, TLS state should be handled with DTLS restart, and the client should be notified with the edge change, I lost track of the DTLS restart project, I should continue it.

Comment thread README.md
3. Offer a modern, layered API.
* High-level plugin/extension API that hides WebRTC details.
* Low-level API for advanced use-cases, users should be able to re-implement the same features in the high-level API and provide their own interfaces, This should be abstracted away from non power users.
4. Provide a clean, typed Web SDK.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For use cases other than video conferencing, for example cloud gaming and realtime voice ai, it would be nice to have a server sdk/plugin that handles codec and can read or modify content. Though this might not be high priority enough for us to implement it in early stage, should we consider this when making architectural decisions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are exactly right @3DRX. I think we will find a lot of passion/joy solving the problems of tomorrow :)

  • Self-hosted home security systems
  • Cloud Gaming (run heavy process remotely like CAD)
  • Voice AI
  • Broadcasting (would love to replace broadcast box with ion)
  • ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious...is there an interest in Video AI? I can think of some use cases where video can be a better way to convey information, e.g. dance teaching 🤔

Comment thread README.md
2. Transport state is tightly coupled to in-memory stateful objects, preventing seamless migration of streams between SFU instances (UDP, DTLS, SRTP, SCTP etc), For security reasons, this will not include the TLS state, Will require finishing the DTLS restart (which should be even simpler with DTLS 1.3).
3. Limited support for modern codecs features.
4. Incomplete statistics and congestion-control APIs.
5. Security hardening (DTLS/SRTP cipher suites, DTLS 1.3, rate limiting, quota management) is missing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have end to end encryption implemented using js encoded transform api (it shouldn’t be hard to implement, but offers great value).

Comment thread README.md Outdated
2. **Draft design proposals (RFCs)** - Contributors submit markdown documents in describing architecture ideas, APIs, and migration strategies.
3. **Community voting** - RFCs will be discussed on Discord and in GitHub Discussions. We will use 👍/👎 reactions to measure support and move proposals forward.
4. **Define the MVP** - Based on accepted RFCs, we will lock a minimal feature set for the first public milestone.
5. **Decide on the name** - We will decide on the name of the project, if we'll keep the name "Ion" and pick a new major version or pick a new name to avoid confusion with the original Ion project.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m voting for ion :)

@jech

jech commented Jul 6, 2025

Copy link
Copy Markdown
Member

There's no multicast in WebRTC, so I think this deserves clarification.

I meant multicasting a single source to multiple rooms

I recommend avoiding the word "multicast", in order to prevent confusion. What about "sending a given stream to multiple rooms"?

I meant finishing the TinyGo support in Pion

Then say that, and avoid the term "embedded", which has been diluted so it means nothing.

You also should define "SDK". Why not say "client library"?

WHEP is not finished yet, so I suggest restricting this to WHIP for now.

I think it's safe to add it as an experimental protocol, well, it's better than making a custom protocol.

I respectfully disagree, since I'm not very optimistic about WHEP. (I've been following the WISH WG, and it doesn't look good.)

I added a clarification

I agree with what you're saying, but I think your syntax is slightly off, some word-smithing is necessary.

@JoTurk
JoTurk force-pushed the stage-0-document branch from f45405f to 154cfc2 Compare July 7, 2025 02:41
@JoTurk

JoTurk commented Jul 7, 2025 •

Copy link
Copy Markdown
Member Author

I recommend avoiding the word "multicast", in order to prevent confusion. What about "sending a given stream to multiple rooms"?

I think we'll pick a single word term for this feature, when we start implementing it.

Then say that, and avoid the term "embedded", which has been diluted so it means nothing.

I agree, I added a clarification. but we get people asking for "embedded" client, I don't like the term, It's not clear what the people say, but in most of the time they mean a consumer grade microcontroller like ESP32, or even a capable single board computer which isn't even "embedded", We'll just finish the tinygo support and try to ship the smallest client we can ship. I cleared it more.

You also should define "SDK". Why not say "client library"?

I agree that an "sdk" is also a diluted term, but we meant programmatically controlling the SFU itself and not just consuming / publishing streams.

I respectfully disagree, since I'm not very optimistic about WHEP. (I've been following the WISH WG, and it doesn't look good.)

Not a WHEP fan anyway, I think I'll leave it for the people to vote, I'm natural on this.

I agree with what you're saying, but I think your syntax is slightly off, some word-smithing is necessary.

I rewrote this line.

Thank you a lot.

@LacavaDev

LacavaDev commented Jul 8, 2025 •

Copy link
Copy Markdown

I recommend avoiding the word "multicast", in order to prevent confusion. What about "sending a given stream to multiple rooms"?

I think we'll pick a single word term for this feature, when we start implementing it.

Then say that, and avoid the term "embedded", which has been diluted so it means nothing.

I agree, I added a clarification. but we get people asking for "embedded" client, I don't like the term, It's not clear what the people say, but in most of the time they mean a consumer grade microcontroller like ESP32, or even a capable single board computer which isn't even "embedded", We'll just finish the tinygo support and try to ship the smallest client we can ship. I cleared it more.

Hi everyone! I'll focus on the terminology and use case for Ion in this answer:

I believe that discussing the correct terminology for things like "embedded" should be a priority in the early stages of Ion development.

First, understanding how many "client" types Ion can take in an MVP version is very useful and creates proper ways of working. Therefore, we can use as a reference the concepts of WebRTC Devices and WebRTC Endpoints from RFC 8825.

In other words:

Without much difficulty, a first-stage ION SFU server can support 2 main "clients": common media senders/receivers (generic users in videoconferences, for example) or applications whose purpose is just to send media with some application logic involved.

Therefore, I suggest a correct terminology when thinking about embedded devices (using Section 2.2 of RFC 8825):

  1. WebRTC Endpoints or Ion WebRTC Clients (IWC) -> Generic clients that need most of the features of a WebRTC implementation.

  2. "WebRTC devices or Ion Media Producers (IMP) -> Embedded clients" such as single-board PCs or Raspberry Pis that convert RTSP streams into WebRTC-optimized RTP streams (in my experience, I noticied that some devices does not need most of the WebRTC features)

In the case of IMPs, the Ion SFU should support simple RTP packet reading under UDP listening with security guarantees... unlike the classic IWC use case.

I believe discussing this now can direct our efforts towards a first RFC (as mentioned in the archive) as "Ion SFU Client Use Cases".

Comment thread README.md Outdated
* Low-level API for advanced use-cases, users should be able to re-implement the same features in the high-level API and provide their own interfaces, This should be abstracted away from non power users.
4. Provide a clean, typed Web SDK.
5. Ship a reference web application with a modern UI.
6. Create an SDK for low-power platforms (like: embedded/IoT devices and single-board computers) by compiling Pion with TinyGo. This first requires finishing TinyGo support in Pion; minimum hardware specs and potential hardware acceleration will be assessed later.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of TinyGo I have been using libpeer

It would be exciting if you could offer Ion as an answer to

  • Running your own security systems
  • Voice AI

My experience is that we would need to keep Ion's signaling really simple (or have a back door of sorts). We can't do a Websocket + PeerConnection on a ESP32S3. You can do bi-directional audio, and you are pretty much maxed out CPU wise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was really trying to use this as an excuse to optimize pion for tinygo, and to be able to be stripped down, and finish that project, but libpeer will make most sense :)

Comment thread README.md
Because many applications need programmable access to the SFU, not just a "play/pause" client. An SDK lets developers embed, extend, and automate SFU specific features from their own code-base.

What the SDK should let you do:
1. Control permissions & scopes, issue, refresh, and introspect tokens for every room, user, or stream.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if users could use their existing authentication systems. I should be able to send my cookie for my existing app to ion and then it should get authenticated that way.

Why do I have to hit the ion API to generate a ion session? Then I have to manage/handle all this extra state.

The latency of this extra API call to 'go generate a token' is one of the reasons users leave SFUs and build their own thing with Pion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly agree, I think the control over auth via the SFU should be an opt-in feature. The developer should have the flexibility in terms of providing their own validation

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a controlled and a non-controlled mode for auth? and multiple auth strategies, btw feel free to edit any part :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sean-Der i added this section to the project goals

  1. Design a modular, multi-strategy authentication system.
  • Enable multiple strategies such as centralized authentication through OIDC, with: cookie-based sessions, JWT bearer tokens, mTLS for internal services, and OAuth2 client credentials for automation and service-to-service access.
  • Provide a clear interface for custom auth plugins, so that developers can add support for enterprise SSO, API keys, federated identity, or anonymous access.
  • The SFU and APIs should remain agnostic to the auth backend and rely on validated identity claims (e.g., user ID, roles, scopes) passed through a secure context. This is important for the SDK to be able to use the same authentication strategy as the SFU, and to able to control the SFU's behavior based on auth claims (if needed).
  • Make it easy to deploy and switch between strategies using configuration, and for people to add their own auth strategies.

I think the SDK being able to control the auth is unrelated to the auth strategies, I would like something like auth using Google workspace to be possible in the same time being able to refuse or control claims using the SDK as another layer, if needed, asynchronous and synchronous!

@sideDesert Please feel free to correct anything or change anything in the document.

@JoTurk JoTurk closed this Oct 10, 2025
@JoTurk

JoTurk commented Oct 10, 2025

Copy link
Copy Markdown
Member Author

Draft stage is done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants