WHIP and WHEP: Creating Simpler and Faster WebRTC Connections

WHIP and WHEP grey image with red Devo hat.
SHARE

The WebRTC connection setup of yesteryear, and largely still today, is something that can drive a nuts and bolts networking-type crazy. It’s a signaling setup that involves multiple back-and-forth communications to put together offers and answers in an attempt to agree on the basics that are needed to set up a communications channel. Just about… Continue reading WHIP and WHEP: Creating Simpler and Faster WebRTC Connections

The WebRTC connection setup of yesteryear, and largely still today, is something that can drive a nuts and bolts networking-type crazy. It’s a signaling setup that involves multiple back-and-forth communications to put together offers and answers in an attempt to agree on the basics that are needed to set up a communications channel. Just about anything that can be done to simplify this process is an improvement. This is where WHIP and WHEP come into play.

What are WHIP and WHEP?

WHIP and WHEP are the WebRTC-HTTP ingest and egress Protocols. The idea? A single call to set up the communications made over HTTPS instead of multiple calls via a WebSocket. Instead of chatting back and forth with offers and answers, the initiating client packages its offer in the request and the response returns with both the answer and the Interactive Connection Exchange (ICE)candidates.

A client wishing to start a publishing session uses WHIP, with emphasis on the “I” for ingest. In the initial connection, the client specifies its Session Description Protocol (SDP) offer in an HTTP POST to the server with which it wants to connect. The server responds with the SDP answer and information about the ICE candidates. Previous to WHIP, this would have required several messages back and forth, adding latency to the connection establishment. Using the provided ICE candidates the publisher attempts to establish a connection with ICE helping this connection traverse Network Address Translation.

Similarly on WHEP, with emphasis on the “E” for egress, the initial exchange happens over a POST. Again the offer and answer SDPs being exchanged in a single call. ICE then helps complete the connection again, in this case for the subscriber.

Why switch to WHIP and WHEP?

Red5 is always interested in simplification and decreasing the amount of time it takes to establish a connection. By switching to WHIP and WHEP, connection establishment time is improved, and development is simplified by reducing the complexity of the signaling setup to a single call. Additionally, the calls to set up a connection in a Red5 Pro cluster are simplified, allowing for either a single call to the Stream Manager or, in other specialized cases, connection directly to the Origin or Edge without the Stream Manager being involved. The latter opens opportunities to use load balancers of the type typically found in Kubernetes deployments.

It’s not all roses out there in WHIP/WHEP land. This is a draft specification, and, as is often the case with draft and early specifications, no one is doing things exactly the same way. Red5 has been working to support the various encoders and players that offer WHIP and WHEP, and so far, this has required an individual approach for each offering. Once the specification is ratified and more development time has been put in, expectations are that these implementations will become easier.

If you’re interested in learning about how WHIP and WHEP are reducing connection times and what that might mean for your business needs, please let us know. You can reach us at info@red5.net or set up a call with us to discuss your ideas.

In addition to streamlining our product, we like to have a good time. To keep ourselves amused during the development, we’ve been listening to too much Devo and talking to ChatGPT far too often. To that end we encourage you to buy this hat and sing the following song the GPT wrote for your enjoyment:

WHEP it Good!Twist that WHEP,
Like a pretzel would
Spin it round and round,
WHEP it good!

When a pizza’s in the oven,
You must WHEP it
Before the cheese gets overdone,
You must WHEP it

When you’re stuck in traffic,
You must WHEP it
Make the other cars look tragic,
WHEP it good!

Goof off,
Jump ahead,
Act the clown,
Don’t forget it,
It’s all in fun,
So WHEP it,
WHEP it good!

When a fly lands on your nose,
You must WHEP it
Before it drives you insane,
You must WHEP it

No one will survive,
Unless they WHEP it
So come on, let’s WHEP it,
WHEP it good!

I say WHEP it,
WHEP it real good!
Let’s get silly and WHEP it,
WHEP it good!