Streaming is available in most browsers,
and in the WWDC app.
Optimize for 5G networks
5G enables new opportunities for your app or game through better performance for data transfer, higher bandwidth, lower latency, and much more. Discover how you can take advantage of the latest networking technology and Apple hardware to create adaptive experiences for your content that best suit someone's data connection and optimize network traffic.
- Have a question? Ask with tag wwdc21-10103
- Optimize your app for 5G
- Search the forums for tag wwdc21-10103
- URLSession Programming Guide
♪ Bass music playing ♪ ♪ Rajesh Ambati: Hi, I am Raj Ambati.
I lead 5G software development at Apple and I’m excited to talk to you about 5G, so let’s dig in.
Over the course of this short presentation, I will cover on three main areas, beginning with a bit of background on the path to 5G and why we think it’s a big deal.
I will share how iPadOS and iOS balance network performance and battery life all while preserving a great user experience, and leave you with some practical guidance you can use to ensure your app is optimized for 5G.
So let me begin with the path to 5G.
For me, one of the best ways to convey the potential of modern 5G networks is to take a step back.
Now, I’m guessing not many of you owned one of these sweet portable phones.
But, I think it’s important to understand that they were a big deal in their day.
With this handy device, you could actually make a telephone call while on the go.
And while, of course, our modern iPhone still lets you make calls, so much of the other amazing things you can do with your iPhone is the result of advances in networking technology.
Each step in network evolution has brought dramatically new capabilities to mobile devices.
2G networks, for example, were the first networks to provide data services for mobile.
So not only could you make a phone call, but you could do dramatically new things such as having a voice-free conversation by sending SMS text messages; capture pictures and immediately send them to your friends; or deliver a variety of media, including up to multiple images, video, and audio, all at the blistering speed of up to 384 kilobits per second.
And while this is probably considered slow, the fact you could do these amazing new things with a mobile device meant the performance of the network didn’t really matter as much.
But of course, once we developers have access to a network, our goal is to push it to its limits.
So 2G networks really were only the beginning of a continuous strive to deliver more data, faster.
3G came along with primary focus on data connectivity and unlocked new capabilities such as video calls, mobile TV, and even internet access.
Imagine what a breakthrough 3G was at the time! Having a web browser on your phone was amazing; it put the entire internet in your pocket! 4G -- or what’s more commonly called LTE -- came next, and with it, data rates improved even more.
LTE enabled reliable mobile voice over IP communication, support for streaming high-quality video, and many other data-intensive user experiences we’ve come to love like communicating with your family using FaceTime video or exploring shared augmented reality experiences or real-time multiplayer games and more.
Those fantastic new experiences that we’ve come to rely on were made possible by the dramatic increase in network performance over the previous generation.
But again, we are always looking to push the envelope; to deliver more services and breakthrough experiences, and of course, deliver them at faster speeds.
And that brings us to the latest technology in networking, 5G.
5G continues the evolution of our ever-increasing need for speed.
And if you step back and take a look at network performance over these generations, you can see each new generation delivered a remarkable increase in speed at which the data can be delivered.
Each jump in speed leads to a leap in the possibilities for you to provide richer -- or in many cases, previously impossible -- experiences in your app.
But while 5G is an incredible jump in performance from a network bandwidth perspective, 5G provides other advances beyond just more data at a faster rate.
So not only can you exchange data faster, but you’ll have faster round-trip times between your app and your server.
And faster round trips mean faster and more synchronized transactions.
5G’s ability to handle more devices concurrently means you can continue to deliver data-related services in your app, even in congested public environments such as sports stadiums, convention arenas, and other crowded public venues -- remember those? And given that 5G’s performance is 10 times better than a typical public Wi-Fi, this means your customers won’t have to hop on potentially insecure Wi-Fi hotspots just to quickly exchange larger files.
So that was a brief review of the network generations leading to 5G, each leap in performance resulting in increased opportunities for app developers like you to push the envelope and deliver previously unheard-of experiences in your app.
Now, I’d like to transition from a focus on performance of the network to describe the services we’ve built into iOS that ensure your app will perform optimally, regardless of the network environment.
Looking back at the major milestones of networking, it is easy to think that as each new network came into being, the previous network disappeared into the dustbin of history.
But like any evolutionary process, there are always portions of the past in the next generation.
So the reality is that today’s modern 5G cellular networks can be a bit of an amalgam, but come primarily in two varieties, commonly referred to as Non-Standalone and Standalone -- or even more commonly referred to as NSA and SA.
Non-Standalone is built on the existing LTE core and can use both LTE and 5G links to schedule traffic, operates at frequencies below seven gigahertz, and includes support for millimeter wave.
Standalone is built entirely on the new 5G core, also operates at frequencies below seven gigahertz, and includes support for millimeter wave, and delivers improved latency performance over LTE.
These unique characteristics of 5G deployments play a critical role in determining the network performance of your app.
And the upside is huge, especially with ideal theoretical speeds of up to 4 gigabits per second.
And this real-world test I recently ran at Apple Park shows me getting close, clocking in at a wicked fast 3 gigabits per second! That’s 20 times faster than LTE.
And with a ping latency of seven milliseconds, it’s pretty obvious there’s a lot you can do with 5G.
However, while 5G deployments provide lower latency and faster data speeds, they are inherently more power hungry.
Sure, the people using your app want a superfast experience, but not necessarily at the expense of battery life.
So we’ve taken this desire for a balance between power and performance into consideration and made optimizations at the system level so you can focus on user experience.
If we go back to look at our 5G deployments and toss public Wi-Fi networks into the mix, you can see there’s a range of network types with varied performance characteristics that we can pick from to provide the best connection speed for a given task in your app.
And we pick the best network using two techniques called "Automatic Switch to 5G" and "Smart Data Mode." Both technologies look at a combination of performance, security, and power characteristics to enable the best wireless connection for your app, be it Wi-Fi, LTE, or 5G.
In addition to constantly evaluating the relative performance of LTE, 5G, and Wi-Fi, Smart Data Mode can detect network congestion on any network and move your connection to the wireless interface with the least resistance.
They also look at the security of the available Wi-Fi connection with the assumption that public Wi-Fi at airports, coffee shops, et cetera are usually less secure than cellular and typically provide very low data speeds.
And battery considerations also take into account the most power-efficient network for a given task within your app, such as switching to 5G knowing it’s more efficient for large file use cases like movie downloads, or switching to LTE for low data-intensive tasks, like those typically run in the background.
So with all the built-in services managing the network interface on your behalf, it’s easy to ignore the type of network altogether.
And with that review of the built-in features, I have a perfect segue to provide some practical guidance for ensuring your app is optimized for 5G.
And I’ve already hinted at the first best practice in the previous section.
With the system choosing the best network on your behalf, you should stop even considering the network type.
Using network type to drive behavior is just about guaranteed to prevent your app from accessing the potential 5G benefits.
Also, don’t assume if Wi-Fi is available, cellular isn’t because we support multiple network paths.
My next best practice is to use our frameworks to take full advantage of 5G.
For example, you should be using AVFoundation, like we do on Apple TV and in Apple Music, to stream high-quality audio and video; or CallKit to take advantage of the noticeable enhancements we’ve added for VOIP apps on 5G.
Using high-level network APIs such as URLSession and the Network framework, we’ve been able to tune many of our apps to take full advantage of 5G.
Apple News will cache articles over 5G for offline reading.
Now your favorite photos get synced to iCloud over the inexpensive 5G link.
And we’ve enabled automatic backup and restore over 5G when Wi-Fi isn’t available.
My third best practice is to tune your application for constrained and expensive paths.
In most cases, expensive and constrained are automatically derived by the system based on the active cellular plan.
However, the user can also affect these by altering the Data Mode settings on their device.
There are three options: Allow More Data on 5G, indicating an inexpensive path, similar to Wi-Fi; Standard mode, which is usually considered as expensive; and Low Data Mode, which is considered constrained.
The concept of expensive and constrained are surfaced as properties in all our high-level networking frameworks.
And the value of these properties should be your only consideration when determining the type of network services available for your app.
For example, URLSession allows you to take advantage of these properties to manage networking requests.
In order to benefit from inexpensive networking over 5G, we recommend you use allowsExpensiveNetworkAccess instead of relying on network type checks.
In addition, if your application implements policy based on expensive, provide a way for users to influence that policy.
In Network.framework, you have another option to check for constrained, expensive, and inexpensive path.
And finally, if your app uses AVFoundation, there are similar case indicating constrained and expensive here as well.
So those are my best practices for ensuring your app is ready to take advantage of 5G.
The key takeaway ideally is to let the operating system and iOS frameworks do the heavy lifting.
We’ve covered a fair amount in this session, from a bit of a history lesson to a deep dive on how the system works, to some tips to make sure you are getting the most out of the network.
But before I sign off, let me leave you with a few key takeaways.
First, 5G is here.
While you may not have it available in your neighborhood, a good percentage of your customers do -- or it’s just around the corner -- so you want to be ready.
Remember that we are continually working on ways to leverage our unique combination of hardware and software to ensure a high-performance user experience while maintaining the longest possible battery life.
And by using our high-level frameworks, your app can benefit with minimal effort.
And finally, we’re always looking for ways to engage with you.
So please give us feedback on how our networking tools are or are not fitting your needs.
And if you have 5G use cases you find particularly interesting, we would love to hear about that as well.
Thank you! ♪
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.