Streaming is available in most browsers,
and in the WWDC app.
Improve global streaming availability with HLS Content Steering
Discover how you can use HLS playlist tags and the Steering Manifest format with your content to help dynamically update CDN redundancy policies tuned for each viewer. Learn how to load balance, set failover, and more.
- Have a question? Ask with tag wwdc21-10141
- HLS Content Steering Specification
- HTTP Live Streaming - Overview
- Search the forums for tag wwdc21-10141
♪ Bass music playing ♪ ♪ Naiwei Zheng: Hello. Welcome to WWDC.
My name is Zheng Naiwei.
I'm from Apple's HLS Streaming Team.
Today I'm going to talk about a new feature in HLS called Content Steering, and how it can improve global streaming availability.
Today's network connectivity is at global scale.
Streaming media providers deliver their contents all around the world.
However, delivering contents at the global scale comes with enormous amount of challenges the industry has to solve.
We, HLS Streaming Team at Apple, also recognize these challenging problems and are constantly working to provide solutions.
Today, we will be focusing on the problem of availability.
Specifically, network congestion mitigation and error recovery.
To help us understand these problems, let's take a look at an example.
Let's assume a popular streaming provider in Asia deploys its CDN infrastructures in the following three countries: China, Japan, and Singapore.
In this graph, we are showing a state where everything is working in perfect condition.
We have users in China streaming from Chinese CDN and users from Japan streaming from Japanese CDN, and both CDN networks are performing at capable level.
Now, let's introduce some change.
Let's say a while later, users in China streaming from the Chinese CDN has greatly increased, to a degree that CDN network is becoming overloading.
With the HLS technologies we had, it's difficult to fully address this issue of network congestion.
Even though we could assign new users to different CDN, it's, however, difficult to instruct existing clients to use a different CDN, and existing traffic will continuously overload the current CDN.
With our new HLS Content Steering feature, content providers can solve this problem by hosting their own steering server.
It establishes a side channel with all latest HLS clients to update them with the latest CDN policy.
For example, it can send a policy update to 30 percent of the existing clients in China to switch to Japanese CDN.
And the clients receiving the policy update will honor the change and redirect their network traffics to the Japanese CDN.
Now the network congestion in the Chinese CDN is mitigated.
But network congestion is only one of the many availability problems.
What happens when there's a network outage? Let's take another example.
Say the network path from users in Japan to the Japanese CDN has experienced a regional outage.
With HLS technologies we had, content providers can list our fallback variant streams in master playlist, so clients can try to walk through the list until it reaches a working CDN.
But this approach is preliminary in the sense that content provider is unable to change the ordering or priorities of the CDNs listed in the master playlist in real time.
However, with the help of the steering server, clients will be updated with the latest CDN priorities at near real time.
Let's rewind a bit to see how it can facilitate the client with more efficient error recovery.
Before the network outage, clients in Japan periodically pull for CDN priority list updates from the steering server.
Let's say in the latest update, clients in Japan received the following CDN priority list where the Japanese CDN being most preferred, following Singapore and then China.
Currently, users in Japan are streaming from the Japanese CDN.
Now when the network outage happens, the Japanese CDN will be marked as penalized from the priority list.
The client will move on to the next CDN in the priority list, which in this case, the CDN in Singapore, and redirect their network traffics.
Now the users in Japan will be able to continue watching their shows without interrupt.
What our example showed you is just a high-level overview of our new HLS feature, Content Steering.
Now let's dive deeper to show you how to integrate this amazing feature into your streams.
It's just a simple listing of different CDN URLs duplicating all available variants.
As explained before, a playlist like this has a constant and final ordering of CDN priorities.
Content providers cannot change it later during the playback.
Now let's see how to add Content Steering support to this playlist.
You may be surprised how little the change introduced.
In fact, the changes are backward-compatible with current HLS clients.
Let's walk through the additions.
Most notably, we now group variant streams into different pathways by the PATHWAY-ID attributes on each variant stream, where each pathway typically corresponds to one CDN.
In this example, we group the variant streams into pathway CN, JP, and SG, representing CDNs in China, Japan, and Singapore, respectively.
However, a pathway may contain variant streams from different CDNs to enable more advanced use case.
When the client selects a pathway, only the variant streams from that pathway is eligible for variant selection.
The PATHWAY-ID attribute on the new CONTENT-STEERING tag specifies the initial pathway to use at playback startup.
So, in this case, the client will only choose from variant streams belonging to the CN pathway at the initial playback.
The SERVER-URI attribute specifies where is the Content Steering server.
Clients will pull for Content Steering updates from this URI.
But what if your playlist contains media groups? No problem.
It's still very simple to enable Content Steering.
All you have to do is to duplicate the media groups for each pathway and assign them with unique GROUP-IDs.
For example, the audio group in this playlist is being duplicated for each pathway, with the GROUP-ID set to CN-audio for the CN pathway and et cetera.
When an HLS client loaded a master playlist with Content Steering tag, it triggers a slightly different startup routine.
First, when it performs initial variant stream selection, it will only use variant streams from the initial pathway.
Then it will load and start playing the selected variant stream and its media segments as usual.
But in parallel to the normal playback routine, the client will start making periodic Steering Manifest requests in background.
Let's take a look of what a Steering Manifest request looks like.
It's just a simple HTTP GET request sent to this resolved URI from the SERVER-URI attribute based on the master playlist URL.
The steering server will respond with a Steering Manifest.
Let's dissect its format with an example.
The Steering Manifest is a JSON document.
The steering server can craft customized Steering Manifests for each client.
This gives steering server great potential in shaping its managed network traffic.
The most important property in this Steering Manifest is the PATHWAY-PRIORITY field.
It's a list of pathway IDs ordered by their priorities, with the first being the most preferred.
Here in this example, we have a priority of CN pathway being most preferred, followed by JP and then SG.
Upon receiving the Steering Manifest from the steering server, the client will perform Content Steering evaluation to determine whether to switch to a different pathway.
First, the client will exclude variant streams ineligible for selection.
This includes penalized variant streams due to network errors.
And also, variant streams with unsupported codecs, just like usual variant selection would do.
It will select a pathway that has at least one eligible variant streams and has highest pathway priority among all eligible pathways.
If the chosen pathway is different from the currently using pathway, the client will immediately switch to the new pathway.
If no suitable pathway is chosen or is already using the chosen pathway, client will do nothing and keep playing using the current pathway.
Finally, the client will schedule for the next Steering Manifest request to pull for latest updates from the steering server.
So how does this scheduling work? Let's review the Steering Manifest.
Notice that there's a TTL field which specify the number of seconds the client should wait until sending the next Steering Manifest request.
In this example, after the client performed the Content Steering evaluation using this Steering Manifest's pathway priority list, it will schedule the next Steering Manifest request in 300 seconds, which is five minutes.
It's also worth noting that steering server is able to change this TTL value in each Steering Manifest response, affecting how long the client should schedule the next request.
It's also useful for steering server to inject some randomness to each client's TTL value to distribute server load.
In addition, the optional RELOAD-URI field tells the clients where to request the next Steering Manifest.
Steering server can leverage this field to inject client-specific state or session data in the URL to be echoed back in the next request.
Now you have seen the major technical details of Content Steering.
Let's go back to one of our early examples to see how it works under the hood.
Let's say in this case, all users in China have received a Steering Manifest with the CN pathway being most preferred, and the corresponding Chinese CDN is being overloaded because of the increasing number of users.
So the steering server came into action, and sending out a different Steering Manifest to 30 percent of the users in China, with the most preferred pathway changed to JP.
After performing a Content Steering evaluation, those 30 percent clients in China will switch to the JP pathway, redirecting their network traffics to the CDN in Japan, resolving the network congestion situation in Chinese CDN.
To wrap up, we introduced the new HLS feature of Content Steering, explained how it works, and how to integrate it in your streams.
With this amazing feature, you will be able to fine-tune your global streaming availability.
For more technical details, follow the link below this video for "HLS Content Steering Specification".
I'd also like to tell you that playlists and Steering Manifest validation is also supported in our latest HTTP Live Streaming Tools.
I'd also like to acknowledge feedbacks and helps we received from industry members in the HLS Interest IETF forum.
Future feedbacks and suggestions are also welcomed.
And with all these in place, the HLS Content Steering will be available to developers and users in this year's WWDC Seed builds.
So, if you want a better global streaming delivery with more availability, act now to integrate HLS Content Steering in your streams and bring your customers a better streaming experience.
Thank you very much.
Looking for something specific? Enter a topic above and jump straight to the good stuff.
An error occurred when submitting your query. Please check your Internet connection and try again.