WHSNP Overview
WebRTC HTTP-based Session Negotiation Protocol (WHSNP) is a new protocol that:
- Defines a transport mechanism for WebRTC negotiation signaling
- Reduces the number of round trips needed to establish a connection and can avoid triggering CORS in browsers, resulting in a faster time to first frame (TTFF)
- Is symmetrical for both ingest (publishing) and egress (subscribing/viewing)
- Implicitly ensures secure transport of media as encryption is mandatory in WebRTC
- Is extensible to allow simple suport of signaling for DRM, manifests for recorded content, and more
WebRTC Challenges
WebRTC establishes mechanisms for controlling multimedia sessions, but does not standardize a signaling mechanism. The signaling in WebRTC has been left to implementers, who frequently choose to use WebSockets. This introduces challenges such as the need to keep the WebSocket open until all sessions have ended.
WHSNP provides a signaling mechanism based on HTTP, which is more web-friendly and performant than WebSockets, which is important for scale, allowing sessions to remain consistent across network connections dropping and reconnecting.
Benefits of WHSNP
WHSNP covers all core requirements of WebRTC session negotiation using only one round trip to establish a session. This reduces the number of requests before each session is established, so so viewers experience a faster Time To First Frame (TTFF) and more sessions can be managed with the same infrastructure.
Because WHSNP uses JSON data as the payload format, it provides the ability to support new features while maintaining backward compatibility.
Using WHSNP
Phenix has used WHSNP in our SDKs since 2022. The Phenix SDKs provide additional features such as:
- Discovery: Performance-based Point of Presence (PoP) selection in addition to geolocation based PoP selection
- Traffic management: Connection selection includes cross-PoP load balancing
- High Availability: Built-in logic for automatic client failover
For the above reasons, Phenix recommends the use of Phenix SDKs in almost all situations. Direct use of WHSNP with the Phenix platform is recommended in a limited set of use cases including third-party encoders and publishers, and automated consumption and analysis such as by AI analyzers.
Read the draft specification.
Examples of how to use WHSNP are available in our GitHub repository.