How ionorg/ion-sfu works
Main Components
a. Client Layer:
• WebRTC Clients (Browsers/Applications)
• Multiple client connections to represent the N:M relationship
b. Signaling Layer (show both options):
• JSON-RPC Signaling Server (Port 7000)
• gRPC Signaling Server (Port 50051)
c. Core SFU Components:
• Session Management
• Peer Management
• Router Component
• Publisher/Subscriber Management
• Media Processing Pipeline
d. Network/Protocol Layer:
• WebRTC Media Ports (UDP 5000-5200)
• TWCC (Transport Wide Congestion Control)
• RTCP Statistics
Component Relationships
• Client → Signaling Server (Control Plane)
• Client ←→ SFU (Media Plane)
• Internal Components:
• Session → Peers → Publishers/Subscribers
• Router → Tracks
• Buffer Management System
Specific Implementation Details
Key architectural elements:
Media Pipeline:
[Publisher] → [Router] → [Buffer System] → [Subscribers]
Session Management:
[Session Controller] → [Peer Management] → [Track Management]
Signal Flow:
[Client] → [JSON-RPC/gRPC Server] → [SFU Core] → [WebRTC Stack]
Important Subsystems to Highlight
From the pkg/ directory structure, emphasize:
• Buffer Management (/pkg/buffer)
• SFU Core Logic (/pkg/sfu)
• Data Channel Middleware (/pkg/middlewares/datachannel)
• Statistics Collection (/pkg/stats)
• TWCC Implementation (/pkg/twcc)
[Clients Layer]
• ↓
[Signaling Layer]
• ↓
[SFU Core Layer]
• ↓
[Media Processing Layer]
• ↓
[Network Protocol Layer]
Additional Notes
• Port numbers for all network interfaces
• Monitoring/statistics collection points
• Security boundaries