Lecture 7: Real-time and Interactive Applications
Lecture 7 discusses real-time and interactive applications. It talks
about the requirements and constraints for running real-time traffic
on the Internet, and discusses how interactive video conferencing and
streaming video applications are implemented.
Part 1: Real-time and Interactive Applications
This first part of the lecture discusses real-time media running over
the Internet. It outlines what is real-time traffic, and what are the
requirements and constraints when running real-time applications over
the Internet. It discuses the implication of non-elastic traffic, the
effects of packet loss, and the differences between quality of service
and quality of experience.
00:00:00.000
In this lecture I want to move
00:00:02.604
on from talking about congestion control,
00:00:04.835
and talk instead about real-time and interactive
00:00:07.439
applications.
00:00:08.911
In this first part, I’ll start by
00:00:11.051
talking about real-time applications in the Internet.
00:00:13.290
I’ll talk about what is real-time traffic,
00:00:15.718
some of the requirements and constraints of
00:00:18.146
that traffic, and how we go about
00:00:20.575
ensuring a good quality of experience,
00:00:22.656
a good quality of service, for these
00:00:25.084
applications.
00:00:25.531
In the later parts, I'll talk about
00:00:28.424
interactive applications, I’ll talk about the conferencing
00:00:31.318
architecture, how we go about building a
00:00:34.211
signalling system to
00:00:35.551
locate the person you wish to have
00:00:37.897
a call with, how we describe conferencing
00:00:40.244
sessions, and how we go about transmitting
00:00:42.590
real-time multimedia traffic over the network.
00:00:44.701
And then, in the final part,
00:00:46.864
I'll move on and talk about streaming
00:00:49.388
applications, and talk about the HTTP adaptive
00:00:51.912
streaming protocols that are used for video
00:00:54.436
on demand applications, such as the iPlayer
00:00:56.960
or Netflix.
00:00:59.701
To start with, though, I want to
00:01:01.527
talk about real-time media over the Internet.
00:01:03.353
I’ll say a little bit about what
00:01:05.178
is real-time traffic,
00:01:06.061
what are the requirements and constraints in
00:01:08.569
order to successfully run real-time traffic,
00:01:10.718
real-time applications over the Internet, and some
00:01:13.225
of the issues around quality of service
00:01:15.733
and user experience, and how to make
00:01:18.241
sure we get a good experience for
00:01:20.748
users of these applications.
00:01:25.441
So, there's actually a long history of
00:01:28.844
running real-time traffic over the Internet.
00:01:31.861
And this includes applications like telephony and
00:01:35.606
voice over IP. It includes Internet radio
00:01:39.351
and streaming audio applications. It includes video
00:01:43.096
conferencing applications such as Zoom.
00:01:45.871
It includes streaming TV, streaming video applications,
00:01:49.773
such as the iPlayer and Netflix.
00:01:53.117
But it also includes gaming, and sensor
00:01:57.019
network applications, and various industrial control systems.
00:02:01.021
And these experiments go back a surprisingly
00:02:03.837
long way.
00:02:04.741
The earliest RFC on the subject of
00:02:07.866
real-time media on the Internet is RFC741,
00:02:10.990
which dates back to the early 1970s
00:02:14.115
and describe the network voice protocol.
00:02:16.793
And this was an attempt at running
00:02:19.917
packet voice over the ARPANET, the precursor
00:02:23.042
to the Internet.
00:02:24.481
And there’s been a continual thread of
00:02:27.364
standards developments and experimentation and research in
00:02:30.247
this area.
00:02:31.171
The current set of standards, which we
00:02:34.788
use for telephony applications, for video conferencing
00:02:38.404
applications, dates back to the mid 1990s.
00:02:42.121
It led to a set of protocols,
00:02:45.109
such as SIP, the Session Initiation Protocol,
00:02:48.096
the Session Description Protocol, the Real-time Transport
00:02:51.084
Protocol, and so on.
00:02:52.891
And then there was another burst of
00:02:55.642
developments, in perhaps the mid-2000s or so,
00:02:58.393
with HTTP adaptive streaming, and that led
00:03:01.143
to standards such as the MPEG DASH
00:03:03.894
standards, an applications is like Netflix and
00:03:06.645
the iPlayer.
00:03:07.531
I think what's important, though, is to
00:03:10.370
realise that this is not new for
00:03:13.210
the network. We've seen everyone in the
00:03:16.049
world switch to using video conferencing,
00:03:18.483
and everyone in the world
00:03:20.611
switch to using Webex, and Teams,
00:03:23.106
and Zoom, and the like. But these
00:03:26.017
applications actually existed for many years,
00:03:28.513
and these applications have developed, and the
00:03:31.424
network has developed along with these applications,
00:03:34.335
and there's a long history of support
00:03:37.246
for real-time media in the Internet.
00:03:39.841
And you, occasionally, hear people saying that
00:03:42.383
the Internet was not designed for real-time
00:03:44.924
media, and we need to re-architect the
00:03:47.466
Internet to support real-time applications,
00:03:49.381
and to support future multimedia applications.
00:03:52.514
I think that's being somewhat disingenuous with
00:03:56.169
history.
00:03:56.791
The Internet has developed and grown-up with
00:03:59.790
multimedia applications, right from the beginning.
00:04:02.461
And while they've perhaps not been as
00:04:05.121
popular, as some of the non real-time
00:04:07.781
applications, they've been a continual strand of
00:04:10.441
development, and people have been using these
00:04:13.101
applications and architecting the network to support
00:04:15.761
this type of traffic, for many,
00:04:18.041
many years now.
00:04:21.541
So what is real-time traffic? What do
00:04:24.206
we mean by real-time traffic, real-time applications?
00:04:26.971
Well, the defining characteristic is that the
00:04:29.607
traffic has deadlines. The system fails if
00:04:32.242
the data is not delivered by a
00:04:34.878
certain time.
00:04:35.731
And, depending on the type of application,
00:04:38.164
depending on the type of real-time traffic,
00:04:40.597
those can be what's known as hard
00:04:43.031
deadlines or soft deadlines.
00:04:44.521
Now, an example of a hard deadline
00:04:47.372
might be a control system, such as
00:04:50.223
a railway signalling system, where the data
00:04:53.075
that's controlling the signals has to arrive
00:04:55.926
at signal before the train does,
00:04:58.370
in order to change the signal appropriately.
00:05:01.321
Real-time multimedia applications, on the other hand,
00:05:04.129
very much in the in the realm
00:05:06.937
of soft real-time applications,
00:05:08.641
where you have to deliver the data
00:05:11.352
by a certain deadline in order to
00:05:14.063
get smooth playback of the media.
00:05:16.387
In order to get a glitch-free playback
00:05:19.098
of the audio, in order to get
00:05:21.809
smooth video playback.
00:05:23.071
And these applications tend to have to
00:05:26.104
deliver data, perhaps every 50th of a
00:05:29.136
second for audio, maybe every 30 times
00:05:32.169
a second, 60 times a second,
00:05:34.768
to get smooth video.
00:05:36.601
And it's important to realise that no
00:05:39.392
system is ever 100% reliable at meeting
00:05:42.183
its deadlines.
00:05:43.081
It's impossible to engineer system that never
00:05:46.054
misses a deadline. So always think about
00:05:49.026
how can we arrange these systems,
00:05:51.574
such that some appropriate portion of the
00:05:54.547
deadline are met.
00:05:55.921
And what that proportion is, depends on
00:05:59.103
what system we're building.
00:06:01.021
If it's a railway signalling system,
00:06:03.166
we want the probability that the network
00:06:05.668
fails to deliver the message to be
00:06:08.170
low enough that it's more likely that
00:06:10.672
the train will fail, or the actual
00:06:13.174
physical signal will fail, then the probability
00:06:15.676
of the network failing to deliver the
00:06:18.179
message in time.
00:06:19.351
If it's a video conferencing application,
00:06:21.562
or video streaming application, the risks are
00:06:24.142
obviously a lot lower, and so you
00:06:26.721
can accept a higher probability of failure.
00:06:29.401
Although again, it depends on what the
00:06:32.547
application’s being used for. A video conferencing
00:06:35.693
system being used
00:06:37.141
for a group of friends, just chatting,
00:06:40.731
obviously has different reliability constraints, different degrees
00:06:44.322
of strictness of its deadlines, than one
00:06:47.912
being used for remote control of a
00:06:51.502
drone, or one being used for remote
00:06:55.092
surgery, for example.
00:06:56.731
And the different systems can have different
00:07:00.147
types of deadline.
00:07:01.711
It may be that various types of
00:07:04.082
data have to be delivered before a
00:07:06.454
certain time.
00:07:07.231
You have to deliver the control information
00:07:10.034
to the railway signal before the train
00:07:12.837
gets there. So you've got an absolute
00:07:15.639
deadline on the data.
00:07:17.341
Or it maybe that the data has
00:07:19.989
to be delivered periodically, relative to the
00:07:22.636
previous deadline. The video frames have to
00:07:25.284
be delivered every 30th of a second,
00:07:27.932
or every 60th of a second.
00:07:30.301
And different applications have different constraints.
00:07:32.985
Different bounds on the latency, on the
00:07:36.117
absolute deadline. But also on the relative
00:07:39.249
deadline, on the predictability of the timing.
00:07:42.481
It’s important to remember that we're not
00:07:45.701
necessarily talking high performance for these applications.
00:07:49.021
If we're building a phone system that
00:07:51.367
runs over the Internet, for example,
00:07:53.378
the amount of data we're sending is
00:07:55.725
probably only a few kilobits per second.
00:07:58.171
But it requires predictable timing.
00:08:01.141
This packets containing the speech data have
00:08:04.456
to be delivered with
00:08:06.451
at least approximately predictable, approximately equal,
00:08:09.013
spacing, in order that we can correct
00:08:12.002
the timing and play out the speech
00:08:15.091
smoothly.
00:08:17.371
And yes, some types of applications are
00:08:20.068
quite high bandwidth. If we're trying to
00:08:22.766
deliver
00:08:23.251
studio quality movies, or if we're trying
00:08:25.662
to deliver holographic conferencing, then we need
00:08:28.074
tens, or possibly hundreds, of megabits.
00:08:30.241
But they're not necessarily high performance.
00:08:32.270
The key thing is predictability.
00:08:38.161
So what are the requirements for these
00:08:41.460
applications?
00:08:42.031
Well, in the large extent, it depends
00:08:44.967
on whether you're building a streaming application
00:08:47.903
or an interactive application.
00:08:49.681
For video-on-demand applications, like Netflix or YouTube
00:08:53.038
or the iPlayer, for example, there's not
00:08:56.394
really any absolute deadline, in most cases.
00:08:59.851
If you're watching a movie, it's okay
00:09:02.414
if it takes 5, 10, 20 seconds
00:09:04.976
to start playing, after you click the
00:09:07.539
play button,
00:09:08.371
provided the playback is smooth once it
00:09:11.817
has started.
00:09:12.901
And maybe if it's a short-thing,
00:09:14.429
maybe it's a YouTube video that's only
00:09:16.211
a couple of minutes, then you want
00:09:17.993
it to start quicker.
00:09:19.111
But again, it doesn't have to start
00:09:21.967
within milliseconds of you pressing the play
00:09:24.824
button. A second or two of latency
00:09:27.680
is acceptable, provided the playback is smooth
00:09:30.537
once it starts.
00:09:31.861
Now, obviously live applications, the deadlines may
00:09:35.183
be different. Clearly if you're watching
00:09:38.131
a live sporting event on YouTube or
00:09:40.431
on the iPlayer, for example, you don't
00:09:42.730
want it to be too far behind
00:09:45.030
the same event being watched on
00:09:47.101
broadcast TV. But, for these applications,
00:09:49.979
typically it's the relative deadlines, and smooth
00:09:53.336
playback once the application has started,
00:09:56.214
rather than the absolute deadline that matters.
00:09:59.671
The amount of bits per second it
00:10:02.331
needs depends to a large extent on
00:10:04.991
the quality.
00:10:05.851
And, obviously, higher quality is better,
00:10:07.856
a higher bit rate is better.
00:10:09.961
But, to some extent, there's a limit
00:10:12.032
on this. And it's a limit depending
00:10:14.104
on the camera, on the resolution of
00:10:16.175
the camera, and the frame rate of
00:10:18.246
the camera, and the size of the
00:10:20.317
display, and so on.
00:10:21.601
And you don't necessarily need many tens
00:10:24.928
or hundreds of megabits. You can get
00:10:28.256
very good quality video on single digit
00:10:31.583
numbers of megabits per second. And even
00:10:35.011
production quality, studio quality, is only hundreds
00:10:37.913
of megabits per second. So there’s an
00:10:40.815
upper bound on that the rate at
00:10:43.717
which these applications
00:10:45.061
can typically send, when you hit the
00:10:47.630
limits of the capture device, you hit
00:10:50.199
the limits of the display device.
00:10:52.501
And, quite often, for a lot of
00:10:55.520
these applications, predictability matters more than absolute
00:10:58.540
quality.
00:10:59.071
It's often the less annoying to have
00:11:02.015
a movie, which is a consistent quality,
00:11:04.959
than a movie which is occasionally very
00:11:07.902
good quality, but keeps dropping down to
00:11:10.846
a lower resolution. So predictability is often
00:11:13.790
what's critical.
00:11:14.731
And, for a given bit rate,
00:11:16.870
you're also trading off between frame rate
00:11:19.365
and quality. Do you want smooth motion,
00:11:21.961
or do you want very fine detail?
00:11:24.571
And, if you want both smooth motion
00:11:26.786
and fine detail, you have to increase
00:11:29.001
the rate. But you can trade-off between
00:11:31.216
them, at a given bit rate,
00:11:33.115
a different quality level.
00:11:38.161
For interactive applications, the requirements are a
00:11:40.881
bit different. They depend very much on
00:11:43.600
human perception, and the requirements to be
00:11:46.320
able to have a smooth conversation.
00:11:48.751
For phone calls, for video conferencing applications,
00:11:51.888
people have been doing studies of this
00:11:55.024
sort of thing for quite a while.
00:11:58.261
The typical bounds you hear expressed are
00:12:02.181
one-way mouth-to-ear delay, so the delay from
00:12:06.101
me talking, to it going
00:12:09.001
through the air to the microphone,
00:12:11.273
being captured, compressed, transmitted over the network,
00:12:13.923
decompressed, played-out, back from the speakers to
00:12:16.574
your ear,
00:12:17.431
should be no more than about 150
00:12:19.683
milliseconds. And, if it gets more than
00:12:21.935
that, it starts getting a bit awkward
00:12:24.187
for the conversations. People start talking over
00:12:26.439
each other, and it gets to be
00:12:28.691
a bit difficult for a conversation.
00:12:30.721
And the ITU-T Recommendation G.114 talks about
00:12:34.369
this, and about the constraints there,
00:12:37.495
in a lot of detail.
00:12:40.201
And, in terms of lip sync,
00:12:43.381
people start noticing if the audio is
00:12:45.694
more than about 15 milliseconds ahead,
00:12:47.677
or more than about 45 milliseconds behind
00:12:49.990
the video. And it seems that people
00:12:52.303
notice more often if the audio is
00:12:54.616
ahead of the video, than if it's
00:12:56.930
behind the video.
00:12:58.021
So this gives quite strict bounds for
00:13:01.378
overall latency across the network, and for
00:13:04.735
the variation in latency between audio and
00:13:08.092
video streams.
00:13:09.151
And, obviously, this depends what you're doing.
00:13:11.851
If you're having an interactive conversation,
00:13:14.374
the bounds of tighter than if it's
00:13:17.318
more of a lecture style, where it's
00:13:20.262
mostly unidirectional, with more structured pauses and
00:13:23.205
more structured questioning. That type of application
00:13:26.149
can tolerate higher latency.
00:13:27.931
Equally, if you're trying to do,
00:13:30.776
for example, a distributed music performance,
00:13:33.620
then you need much lower,
00:13:36.091
much lower latency.
00:13:38.311
And, if you think about something like
00:13:40.312
an orchestra, and you measure the size
00:13:42.312
of the orchestra, and you think about
00:13:44.313
the speed of sound, you get about
00:13:46.314
15 milliseconds for the sound to go
00:13:48.314
from one side of the orchestra to
00:13:50.315
another.
00:13:50.701
So, that sort of level of latency
00:13:53.711
is clearly acceptable, but once it gets
00:13:56.721
more than 20 or 30 milliseconds,
00:13:59.301
it gets very difficult for people to
00:14:02.311
play in a synchronised way.
00:14:04.561
And if you've seen, if you’ve ever
00:14:07.296
tried to play music over a Zoom
00:14:10.031
call, you'll realise it just doesn't work,
00:14:12.765
because the latency is too high for
00:14:15.500
that,
00:14:15.991
If you're trying to
00:14:18.301
play music collaboratively on a video conference.
00:14:25.501
So that gives you some bounds for
00:14:29.141
latency.
00:14:29.761
What we saw in some of the
00:14:31.834
previous lectures, is that the network is
00:14:33.907
very much a best effort network,
00:14:35.684
and it doesn't guarantee the timing.
00:14:37.561
The amount of latency for data to
00:14:41.141
traverse the network very much depends on
00:14:44.821
the propagation delay of the path,
00:14:47.183
and the amount of queuing, and on
00:14:49.938
the path taken, and it's not predictable
00:14:52.694
at all.
00:14:53.581
If we look at the figure on
00:14:55.957
the left, here, it's showing the variation
00:14:58.333
in round trip time for a particular
00:15:00.709
path. And we see that most of
00:15:03.085
it is bundled up, and there’s a
00:15:05.461
fairly consistent bound, but there are occasional
00:15:07.837
spikes where the packets take a much
00:15:10.213
longer time to arrive.
00:15:11.671
And in some networks these effects can
00:15:14.408
be quite significant, they can take quite
00:15:17.144
a long time for data to arrive.
00:15:19.981
The consequence of all this, is that
00:15:22.526
real-time application needs to be loss tolerant.
00:15:25.171
If you're building an application to be
00:15:27.479
reliable, it has to retransmit data,
00:15:29.458
and that may or may not arrive
00:15:31.766
in time. So you want to build
00:15:34.074
it to be unreliable, and not to
00:15:36.382
necessarily retransmit the data.
00:15:37.801
You also want it to be able
00:15:39.549
to cope with the fact that some
00:15:41.296
packets may be delayed, and be able
00:15:43.044
to proceed even if those packets arrive
00:15:44.792
too late.
00:15:45.391
So it needs to be able to
00:15:47.776
compensate for, to tolerate, loss, whether that's
00:15:50.160
just data which is never going to
00:15:52.545
arrive, or data that's just going to
00:15:54.930
arrive late.
00:15:55.711
And, obviously, there's a bound on how
00:15:58.255
much loss you can conceal, how much
00:16:00.800
loss you can tolerate before the quality
00:16:03.344
goes down.
00:16:04.171
And, the challenge in building these applications
00:16:08.223
is to,
00:16:09.481
partially, engineer the network such that it
00:16:11.773
doesn't lose many packets, such the loss
00:16:14.065
rate, the timing variation, is low enough
00:16:16.357
that the application is going to work.
00:16:18.650
But, also, it’s in building the application
00:16:20.942
to be tolerant to the loss,
00:16:22.906
in being able to conceal the effects
00:16:25.199
of lost packets.
00:16:31.171
The real-time nature of the traffic also
00:16:34.071
affects the way congestion control works,
00:16:36.558
it affects the way data is delivered
00:16:39.458
across the network.
00:16:40.801
As we saw in some of the
00:16:43.132
previous lectures, when we were talking about
00:16:45.462
TCP congestion control,
00:16:46.561
congestion control adapts the speed of transmission
00:16:49.468
to match the available capacity over the
00:16:52.376
network.
00:16:52.891
If the network has more capacity,
00:16:55.291
it sounds faster. If the network gets
00:16:58.091
overloaded, it since slower.
00:16:59.791
And the transfers are elastic. If you're
00:17:02.441
downloading a web page, if you're downloading
00:17:05.091
a large file, faster is better,
00:17:07.362
but it doesn't really matter what rate
00:17:10.012
the congestion control can pick. You want
00:17:12.661
it to come down as fast as
00:17:15.311
it can, and the application can adapt.
00:17:18.061
Real-time traffic is much less elastic.
00:17:21.991
It’s got a minimum rate, there’s a
00:17:24.418
certain quality level, a certain bit rate,
00:17:26.844
below which the media is just unintelligible.
00:17:29.371
If you're transmitting speech, you need a
00:17:31.926
certain number of kilobits per second.
00:17:34.116
Otherwise, what comes out is just not
00:17:36.671
intelligible speech.
00:17:37.501
If you're sending video, you need a
00:17:39.730
certain bit rate, otherwise you can't get
00:17:41.958
full motion video over it; the quality
00:17:44.187
is just too low, the frame rate
00:17:46.416
is just too low, and it's ino
00:17:48.644
longer video.
00:17:49.381
Similarly, though, these applications have a maximum
00:17:53.310
rates.
00:17:53.971
If you're sending speech data, if you're
00:17:56.627
sending music, it depends on the capture
00:17:59.283
rate, the sampling rate.
00:18:00.901
And, even for the highest quality
00:18:03.691
audio, you're probably not looking at more
00:18:06.743
than a megabit, a couple of megabits,
00:18:09.795
for CD quality, surround sound, media.
00:18:12.511
And again, for video, it depends on
00:18:15.436
the type of camera, the frame rates,
00:18:18.361
the resolution, and so on. Again,
00:18:20.868
a small number of megabits, tens of
00:18:23.792
megabits, in the most extreme cases hundreds
00:18:26.717
of megabits, and you get an upper
00:18:29.642
bound on the sending rate.
00:18:31.831
So, real-time applications can't use infinite amounts
00:18:36.000
of traffic,
00:18:37.291
unlike TCP. They're constrained by the rate
00:18:40.469
at which the media is captured.
00:18:43.193
But also, they can't go arbitrarily slowly,
00:18:46.471
This affects the way we have to
00:18:48.428
send that data, because we have less
00:18:50.385
flexibility in the rate at which these
00:18:52.342
applications can send.
00:18:56.881
And we need to think to what
00:18:59.576
extent
00:19:00.061
it's possible, or desirable, to reserve capacity
00:19:05.682
for these applications.
00:19:08.191
There are certainly ways one can engineer
00:19:11.212
a network, such that it guarantees that
00:19:14.232
a certain amount of data is available.
00:19:17.253
Such that it guarantees that, for example,
00:19:20.273
a five megabit per second
00:19:22.531
channel is available to deliver video.
00:19:26.761
And, if the application is very critical,
00:19:29.389
maybe that makes sense.
00:19:30.991
If you're doing remote surgery, you probably
00:19:33.974
do want to guarantee the capacity is
00:19:36.957
there for the video.
00:19:38.761
But, for a lot of applications,
00:19:40.834
it's not clear it’s needed.
00:19:42.661
So we have protocols, such as the
00:19:47.026
Resource Reservation Protocol, RSVP,
00:19:49.621
such as the Multi-Protocol Label Switching protocol
00:19:53.654
for orchestrating link-layer networks, such as the
00:19:57.686
idea of network slicing in 5G networks,
00:20:01.719
so we can set up resource reservations.
00:20:05.851
But.
00:20:08.971
This adds complexity. It adds signalling.
00:20:11.377
You need to somehow signal to the
00:20:14.184
network that you need to set up
00:20:16.992
this reservation, tell it what resources the
00:20:19.799
traffic requires.
00:20:20.701
And, somehow, demonstrate to the network that
00:20:22.938
the sender is allowed to use those
00:20:25.176
resources, and is allowed to reserve that
00:20:27.413
capacity, and can pay for it.
00:20:29.431
So you need authentication, authorisation, and accounting
00:20:32.316
mechanisms, to make sure that the people
00:20:35.201
reserving those resources are actually allowed to
00:20:38.086
do so, and have paid for them.
00:20:41.071
And in the end, if the network
00:20:43.676
has capacity, this doesn't actually help you.
00:20:46.381
If the operators designed the network so
00:20:49.358
it has enough capacity for all the
00:20:52.334
traffic it's delivering, the reservation doesn't help.
00:20:55.411
The reservations only help when the network
00:20:58.192
doesn't have the capacity.
00:20:59.881
They’re a way of allowing the operator,
00:21:02.367
who hasn't invested in sufficient network resources,
00:21:04.854
to discriminate in favour of the customers
00:21:07.340
who are willing to pay extra.
00:21:09.571
To discriminate so that those customers who
00:21:12.277
are willing to pay can get good
00:21:14.983
quality, whereas those who don't pay extra,
00:21:17.689
just get a system which doesn't work
00:21:20.394
well.
00:21:20.881
So, it’s not clear that resource reservations
00:21:24.948
necessarily add benefit.
00:21:26.791
There are certainly applications where they do.
00:21:29.708
But, for many applications, the cost of
00:21:32.624
reserving the resources to get guaranteed quality,
00:21:35.641
the cost of building the accounting system,
00:21:38.225
the complexity of building the resource reservation
00:21:40.809
system, it's often easier, and cheaper,
00:21:43.024
just to buy more capacity, such that
00:21:45.608
everything works and there's no need for
00:21:48.192
reservations.
00:21:48.661
And this is one of those areas
00:21:50.899
where the Internet, perhaps, does things differently
00:21:53.137
to a to a lot of other
00:21:55.375
networks. Where the Internet is very much
00:21:57.613
best efforts and unreserved capacity.
00:21:59.311
And it's an area of tension,
00:22:01.479
because a lot of the network operators
00:22:04.008
would like to be able to sell
00:22:06.537
resource reservations, would like to be able
00:22:09.066
to charge you extra to guarantee that
00:22:11.595
your Zoom calls will work.
00:22:13.501
It’s a different model. It's not clear,
00:22:17.102
to me, whether we want a network
00:22:20.703
that provides those guarantees,
00:22:22.861
but requires charging, and authentication, and authorisation,
00:22:25.579
and knowing who's sending what traffic,
00:22:27.909
so you can tell if they've paid
00:22:30.628
for the appropriate quality.
00:22:32.281
Or, whether it's better just for everyone
00:22:35.153
to be sending, and we just architect
00:22:38.026
the networks so that it's good enough
00:22:40.898
for most things, and accept occasional quality
00:22:43.771
lapses.
00:22:47.191
And, ultimately, it comes down to what's
00:22:49.880
known as quality of experience.
00:22:51.901
Does the application actually meet the users
00:22:54.838
needs? Does it allow them to communicate
00:22:57.776
effectively? Does it provide compelling entertainment? Does
00:23:00.713
it provide good enough video quality?
00:23:03.331
It’s very much not a one dimensional
00:23:09.229
metric.
00:23:10.171
When you ask the user
00:23:12.631
“Does it sound good?”, you get a
00:23:16.219
different
00:23:16.831
view on the quality of the music,
00:23:20.058
or the quality of the speech,
00:23:22.823
than if you ask “can you understand
00:23:26.050
it?”
00:23:26.611
The question you ask matters. It depends
00:23:29.659
what aspect of user experience are you
00:23:32.707
evaluating. And it depends on the task
00:23:35.756
people are doing. The quality people need
00:23:38.804
for remote surgery is different to the
00:23:41.852
quality people need for a remote lecture,
00:23:44.900
for example.
00:23:45.871
And some aspects of this user experience
00:23:48.428
you can estimate from looking at technical
00:23:50.984
metrics such as packet loss and latency.
00:23:53.641
And the ITU has something called the
00:23:56.123
E-model, which is a really good subjective
00:23:58.605
measure of speech quality, based on looking
00:24:01.087
at the latency, and the timing variation,
00:24:03.569
and the packet loss of speech data.
00:24:06.151
But, especially when you start talking about
00:24:08.876
video, and especially when you start talking
00:24:11.602
about
00:24:12.091
particular applications, it's often very subjective,
00:24:14.009
and very task dependent. And you need
00:24:16.247
to actually build the system, try it
00:24:18.484
out, and ask people “So how well
00:24:20.722
did it work?”
00:24:21.781
“Does it sound good?” “Can you understand
00:24:24.381
it?” “Did you like it?” You need
00:24:26.981
to do user trials to understand the
00:24:29.581
quality of the experience of the users.
00:24:34.951
So that concludes the first part.
00:24:36.909
I’ve spoken a bit about what is
00:24:39.194
real-time traffic, some of the requirements and
00:24:41.478
constraints to be able to run real-time
00:24:43.763
applications over the network, and some of
00:24:46.047
the issues around quality of service and
00:24:48.332
the user experience.
00:24:49.411
In the next part, we’ll move on
00:24:49.995
to start talking about how you build
00:24:50.580
interactive applications running over the Internet.
Part 2: Interactive Applications - Media
The second part discusses interactive applications. It briefly reviews
the history of real-time applications running over the Internet, and
the requirements on timing, data transfer rate, and reliability to be
able to successfully run audio/visual conferencing applications over
the network. It outlines the structure of multimedia conferencing
applications, and the protocol stack used to support such applications.
RTP media transport, media timing recovery, application-level framing,
and forward error correction are discussed, outlining how multimedia
applications are implemented.
00:00:00.000
In this part I'd like to talk
00:00:02.131
about interactive conferencing applications. I’ll talk a
00:00:04.262
little bit about what is the structure
00:00:06.392
of video conferencing systems,
00:00:07.710
some of the protocols for multimedia conferencing,
00:00:10.151
for video conferencing, and talk a bit
00:00:12.592
about how we do multimedia transport over
00:00:15.033
the Internet.
00:00:17.460
So what do we mean by interactive
00:00:20.416
conferencing applications?
00:00:21.360
Well I'm talking about applications such as
00:00:24.541
telephony, such as voice over IP,
00:00:27.268
and such as video conferencing.
00:00:29.640
These are applications like the university's telephone
00:00:32.772
system, like Skype, like Zoom or Webex
00:00:35.905
or Microsoft teams, that we're all spending
00:00:39.037
far too much time on these days.
00:00:42.270
And this is an area which has
00:00:44.777
actually been developing in the Internet community
00:00:47.283
for a surprisingly long amount of time.
00:00:49.890
As we discussed in the first part
00:00:52.873
of the lecture, the early standards,
00:00:55.429
the early work here, date back to
00:00:58.412
the early 1970s.
00:00:59.790
And the first Internet RFC on this
00:01:03.461
subject, the Network Voice Protocol, was actually
00:01:07.131
published in 1976. The standards we use
00:01:10.802
today for video conferencing applications, for telephony,
00:01:14.472
for voice over IP, date from the
00:01:18.143
early- and mid-1990s initially.
00:01:20.340
There were a set of applications,
00:01:22.650
such as CE-SeeMe, which you see at
00:01:25.345
the bottom right at the slide here,
00:01:28.140
a set of applications called the Mbone
00:01:30.831
conferencing tools, and the picture on the
00:01:33.522
top right of the slide is an
00:01:36.213
application I was involved in developing in
00:01:38.904
the late 1990s in this space,
00:01:41.310
which prototyped a lot of these standard
00:01:44.545
protocols. They led to the development of
00:01:47.780
a set of standards, such as the
00:01:51.016
Session Description Protocol, SDP, the Session Initiation
00:01:54.251
Protocol, SIP, and the Real-time Transport Protocol,
00:01:57.486
RTP, which formed the basis of these
00:02:00.721
modern video conferencing applications.
00:02:02.670
These got pretty widely adopted. The ITU
00:02:06.084
adopted them as the basis for it
00:02:09.498
H.323 series of recommendations for video conferencing
00:02:12.912
systems.
00:02:13.500
A lot of commercial telephony products are
00:02:16.264
built using them. And the Third Generation
00:02:19.028
Partnership Project, 3GPP, adopted them as the
00:02:21.792
basis for the current set of mobile
00:02:24.556
telephone standards. So, if you make a
00:02:27.420
phone call, a mobile phone call,
00:02:30.988
you’re using the descendants of these standards.
00:02:35.250
And also, more recently, the WebRTC browser-based
00:02:38.497
conferencing system again incorporated these protocols into
00:02:41.743
the browser, building on SDP, and RTP,
00:02:44.990
and the same set of conferencing standards
00:02:48.237
which were prototyped in the tools you
00:02:51.483
see on the right of the slide.
00:02:58.530
Again, as we discussed in the previous
00:03:02.106
part of lecture, if you're building interactive
00:03:05.682
conferencing applications, you've got fairly tight bounds
00:03:09.258
on latency.
00:03:10.380
The one-way delay, from mouth to ear,
00:03:13.886
if you want a sensible interactive conversation,
00:03:17.392
has to be no more than somewhere
00:03:20.897
around 150 milliseconds.
00:03:22.500
And if you're building a video conference,
00:03:24.748
you want reasonably tight lip sync between
00:03:26.996
the audio and video,
00:03:28.380
with the audio no more than around
00:03:31.477
15 milliseconds ahead of the video,
00:03:34.131
and no more than about 45 milliseconds
00:03:37.228
behind.
00:03:37.770
Now, the good thing is that these
00:03:41.792
applications tend to degrade relatively gracefully.
00:03:45.240
The bounds, 150 milliseconds end-to-end latency;
00:03:48.687
the 15 milliseconds ahead, 45 milliseconds behind,
00:03:52.709
for lip sync, are not strict bounds.
00:03:56.732
Shorter is better, but
00:03:59.130
If the latency, if the offset,
00:04:01.821
exceeds those values, it gets to gradually
00:04:04.960
become less-and-less usable, people start talking over
00:04:08.099
each other, people start noticing the
00:04:10.890
that the lack of lip-sync, but nothing
00:04:14.295
fails catastrophically. But that's the sort of
00:04:17.699
values we're looking at: end-to-end delay in
00:04:21.104
the hundred 150 millisecond range, and audio-video
00:04:24.509
synchronised to within a few 10s of
00:04:27.914
milliseconds.
00:04:28.500
The data rates we’re sending depend,
00:04:30.963
very much, on what type of media
00:04:33.836
you're sending, and what codec, what compression
00:04:36.709
scheme you use.
00:04:38.040
For sending speech, the speech compression typically
00:04:41.281
takes portions of speech data that are
00:04:44.523
around 20 milliseconds in duration, about 1/50th
00:04:47.764
of a second in duration, and every
00:04:51.006
20 milliseconds, every 1/50th second, it grabs
00:04:54.247
the
00:04:54.810
next chunk of audio that's been received,
00:04:57.465
compresses it, and transmits it across the
00:05:00.121
network.
00:05:00.600
And this is decoded at the receiver,
00:05:03.746
decompressed, and played out on the same
00:05:06.892
sort of timeframe.
00:05:08.340
The data rates depends on the quality
00:05:11.544
level you want. It's possible to send
00:05:14.749
speech with something on the order of
00:05:17.953
10-15 kilobits per second of speech data,
00:05:21.157
although it's typically sent at a some
00:05:24.361
somewhat higher quality, maybe a couple of
00:05:27.566
hundred kilobits, to get high quality speech
00:05:30.870
that sounds pleasant, but it can go
00:05:34.685
to very low
00:05:36.420
bit rates if necessary.
00:05:39.960
And a lot of these applications very
00:05:42.323
the quality a little, based on what's
00:05:44.687
going on. They encode higher quality when
00:05:47.050
it's clear that the person is talking,
00:05:49.413
and they send packets less often,
00:05:51.439
and encoded with lower bit rates,
00:05:53.464
when it's clear there's background noise.
00:05:55.590
If you're sending good quality music,
00:05:57.821
you need more bits per second than
00:06:00.423
if you're sending speech.
00:06:02.010
For video, the frame rates, the resolution,
00:06:05.063
very much depend on the camera,
00:06:07.679
on the amount of processor time you
00:06:10.732
have available to do the compression,
00:06:13.348
whether you've got hardware accelerated video compression
00:06:16.401
or not. And on the video compression
00:06:19.453
algorithm, the video codec you're using.
00:06:22.170
Frame rates somewhere in the order of
00:06:25.007
25 to 60 frames per second are
00:06:27.845
common.
00:06:28.350
Video resolution varies from postage stamp sized,
00:06:32.685
up to full screen, HD, or 4k
00:06:37.021
video.
00:06:37.740
You can get good quality video with
00:06:40.613
codecs like H.264, at around the two
00:06:43.487
to four megabits per second range.
00:06:46.050
Obviously, if you're going up to
00:06:48.600
full-motion, 4k, movie encoding, you'll need higher
00:06:52.498
rates than that. But, even then,
00:06:55.840
you’re probably not looking at more than
00:06:59.738
four, eight, ten megabits per second.
00:07:03.180
So, what you see is that these
00:07:06.375
applications have reasonably demanding latency bounds,
00:07:09.113
and reasonably high, but not excessively high,
00:07:12.308
bit-rate bounds. Two to four megabits,
00:07:15.046
even eight megabits, is generally achievable on
00:07:18.241
most residential, home
00:07:19.710
network, connections. And 150 milliseconds end-to-end latency
00:07:25.690
is generally achievable without too much difficulty
00:07:31.770
as long as you're not trying to
00:07:34.608
go transatlantic or transpacific.
00:07:39.570
In terms of reliability requirements,
00:07:42.750
speech data is actually surprising me loss
00:07:46.272
tolerant. It's relatively straightforward to build systems
00:07:49.795
which can conceal 10-20% random packet loss,
00:07:53.317
without any noticeable reduction in speech quality.
00:07:56.940
And, with the addition of forward error
00:07:59.683
correction, with error correcting codes, it’s quite
00:08:02.425
possible to build systems that work with
00:08:05.168
maybe 50% of the packets being lost.
00:08:08.010
Bursts of packet loss are harder to
00:08:11.222
conceal, and tend to result in inaudible
00:08:14.434
glitches in the speech playback, but they're
00:08:17.646
relatively uncommon in the network.
00:08:20.040
Video packet loss is somewhat harder to
00:08:23.522
conceal.
00:08:24.120
With streaming video applications, if you're sending
00:08:26.490
a movie, for example, you can rely
00:08:28.859
on that the occasional scene changes to
00:08:31.229
reset the decoder state, and to recover
00:08:33.599
from the effects of any loss.
00:08:35.730
With video conferencing, there aren’t typically scene
00:08:38.206
changes, so you have to do a
00:08:40.683
rolling repair,
00:08:41.490
a rolling retransmission, or some form of
00:08:43.760
forward error correction to detect the losses.
00:08:46.030
So video tends to be more sensitive
00:08:48.299
to packet loss than the audio.
00:08:50.245
Equally, though, people are less sensitive to
00:08:52.515
disruptions in video quality than they are
00:08:54.784
to disruptions in the audio quality.
00:08:59.670
So how has one of these interactive
00:09:02.897
conferencing application structured?
00:09:04.380
What does the media transmission path look
00:09:07.548
like?
00:09:08.100
Well, you start with some sort of
00:09:10.516
capture device. Maybe that's a microphone,
00:09:12.587
or maybe it's a camera, depending whether
00:09:15.004
it's an audio or a video application.
00:09:17.520
The media data is captured from that
00:09:19.877
device, and goes into some sort of
00:09:22.233
input buffer, frame at a time.
00:09:24.253
If it's video, it's each video frame
00:09:26.610
at a time. If it's audio,
00:09:28.630
it's frames of, typically, 20 milliseconds worth
00:09:30.987
of speech or music data at a
00:09:33.343
time.
00:09:33.780
Each frame is taken from that input
00:09:36.408
buffer, and passed to the codec.
00:09:38.760
The codec compresses the frames of media,
00:09:41.441
one by one. And, if they’re too
00:09:44.121
large to fit into an individual packet,
00:09:46.802
it fragments them into multiple packets.
00:09:49.200
Each of those fragments of a media
00:09:52.156
frame is transmitted by putting it inside
00:09:55.112
an RTP packets, a Real-time Transport Protocol
00:09:58.068
packet, which is put inside a UDP
00:10:01.024
packet, and sent on to the network.
00:10:04.080
The RTP packet header adds a sequence
00:10:06.552
number, so the packets can be put
00:10:09.024
back into the right order.
00:10:10.890
It adds timing information, so the receiver
00:10:13.561
can reconstruct the timing accurately. And it
00:10:16.232
adds some source identification, so it knows
00:10:18.903
who's sending the media, and some payload
00:10:21.575
identification information, so it knows which compression
00:10:24.246
algorithm, which codec, was used to encode
00:10:26.917
the media.
00:10:27.780
So the media is captured, compressed,
00:10:30.988
fragmented, packetised, and transmitted over the network.
00:10:37.170
On the receiving side, the UDP packets
00:10:41.889
containing the RTP data arrive.
00:10:45.360
And the receiving application extracts the RTP
00:10:48.094
data from the UDP packets, and looks
00:10:50.828
at the source identification information in there.
00:10:53.563
And then it separates the packets out
00:10:56.297
according to who sent them.
00:10:58.350
For each sender,
00:11:01.290
the data goes through a channel coder,
00:11:04.671
which repairs any loss, using a forward
00:11:08.051
error correction scheme
00:11:09.600
If one was used. And we'll talk
00:11:11.726
about that later, but that's where additional
00:11:13.851
packets are sent along with the media,
00:11:15.977
to allow some sort of repair without
00:11:18.103
needing retransmission.
00:11:18.810
Then it goes into what's called a
00:11:21.276
play-out buffer.
00:11:22.080
The play-out buffer is enough buffering to
00:11:25.459
allow the timing, and the variation in
00:11:28.839
timing, to be reconstructed,
00:11:30.870
such that the packets are put back
00:11:33.778
into the right order, and such that
00:11:36.686
they're delivered to the codec, to the
00:11:39.595
decoder,
00:11:40.110
at the right time, and with
00:11:42.390
the correct timing behaviour.
00:11:44.970
The decoder then decompresses the media,
00:11:48.747
conceals any remaining packet loss, corrects any
00:11:53.153
clock skew, corrects any timing problems,
00:11:57.030
mixes it together if there's more than
00:11:59.233
one person talking, and renders it out
00:12:01.436
to the user. It plays the speech
00:12:03.639
or the music out, or it puts
00:12:05.842
the video frames onto the screen.
00:12:12.630
So that's conceptually how these applications work.
00:12:15.651
What does the set of protocol standards
00:12:18.672
which are used to transport multimedia over
00:12:21.694
the Internet, look like?
00:12:23.520
Well, there’s a fairly complex protocol stack.
00:12:27.360
At its core, we have the Internet
00:12:31.253
protocols, IPv4 and IPv6, and UDP and
00:12:35.146
TCP layered above them.
00:12:37.470
Layering above the UDP traffic, is the
00:12:41.710
media transport traffic and the associated data.
00:12:46.050
And what you have there is the
00:12:49.283
UDP packets, which deliver the data;
00:12:52.054
a datagram TLS layer, which negotiate the
00:12:55.286
encryption parameters;
00:12:56.310
and, above that, sit the secure RTP
00:12:59.573
packets, with the audio and video data
00:13:02.836
in them, for transmitting the speech and
00:13:06.099
the pictures. And you have a protocol,
00:13:09.362
known as SCTP,
00:13:10.860
lead on top of DTLS, to provide
00:13:15.283
a peer-to-peer data channel.
00:13:17.910
In addition to the media transport,
00:13:20.620
with RTP and SCTP sitting above DTLS,
00:13:23.781
you also have NAT traversal and path
00:13:26.943
discovery mechanisms. We spoke about these a
00:13:30.104
few lectures ago, with protocols like STUN
00:13:33.266
and TURN and ICE to help set
00:13:36.427
up peer-to-peer connections, to help discover NAT
00:13:39.588
bindings.
00:13:40.140
You have what’s known as a session
00:13:42.695
description protocol, to describe the call being
00:13:45.250
set up.
00:13:46.080
And this identifies the person who's trying
00:13:48.950
to establish the multimedia call, who's trying
00:13:51.820
to establish the video conference.
00:13:53.970
It identifies the person they want to
00:13:56.672
talk to. It describes which audio and
00:13:59.373
video compression algorithms they want to use,
00:14:02.075
which error correction mechanisms they want to
00:14:04.776
use, and so on.
00:14:06.420
And this is used, along with one
00:14:08.864
or more of a set of signalling
00:14:11.308
protocols, depending how the call is being
00:14:13.752
set up.
00:14:14.550
It may be an announcement of a
00:14:17.663
broadcast session, using a protocol called the
00:14:20.776
Session Announcement Protocol, for example.
00:14:23.100
It might be a telephone call,
00:14:25.855
using the Session Initiation Protocol, SIP,
00:14:28.609
which is how the University's phone system
00:14:31.823
works, for example.
00:14:33.300
It might be a streaming video session,
00:14:36.580
using a protocol called RTSP. OR it
00:14:39.860
might be a web based video conferencing
00:14:43.141
application, such as Zoom call, or a
00:14:46.421
Webex call, or a Microsoft Teams call,
00:14:49.701
whether negotiation runs over HTTP using a
00:14:52.981
protocol called JSEP, the Javascript Session Establishment
00:14:56.261
Protocol.
00:15:00.780
So let's talk a little bit about
00:15:02.936
the media transport.
00:15:03.960
How do we actually get the audio
00:15:06.567
and video data from the sender to
00:15:09.175
the receiver, once we've captured and compressed
00:15:11.782
data, and got it ready to transmit?
00:15:14.490
Well it's sent within a protocol called
00:15:17.967
the Real-time Transport Protocol, RTP.
00:15:20.550
RTP comprises two parts. There's a
00:15:25.050
data transfer protocol, and there's a control
00:15:29.478
protocol.
00:15:30.210
The data transfer protocol is usually called
00:15:33.533
just RTP, the RTP data protocol,
00:15:36.382
and it carries the media data.
00:15:39.330
It’s structured in the form of a
00:15:41.853
set of payload formats. The payload formats
00:15:44.377
describe how you take the output of
00:15:46.900
each particular video compression algorithm, each particular
00:15:49.423
audio compression algorithm, and map it onto
00:15:51.947
a set of packets to be transmitted.
00:15:54.570
And it describes how
00:15:57.660
to split up a frame of video,
00:16:00.747
how to split up a sequence of
00:16:03.833
audio packets, such that each RTP packet,
00:16:07.020
each UDP packet, which arrives can be
00:16:09.780
independently decoded, even if some of the
00:16:12.539
packets have been lost. It makes sure
00:16:15.299
there's no dependencies between packets, a concept
00:16:18.059
known as application level framing.
00:16:20.130
And this runs over a datagram TLS
00:16:23.260
layer, which negotiates the encryption keys and
00:16:26.391
the security parameters to allow us to
00:16:29.521
encrypt those RTP packets.
00:16:31.410
The control protocol runs in parallel,
00:16:34.941
and provides things like Caller-ID, reception quality
00:16:39.061
statistics,
00:16:39.750
retransmission requests, and so one, in case
00:16:43.712
data gets lost.
00:16:45.510
And there are various extensions that go
00:16:47.920
along with this, that provide things like
00:16:50.430
detailed user experience and reception quality reporting,
00:16:53.408
provide codec control and feedback mechanisms to
00:16:56.385
detect and correct packet loss, and that
00:16:59.363
provide congestion control and perform circuit breaker
00:17:02.341
functions to stop the transmission if the
00:17:05.318
quality is too bad.
00:17:11.580
The RTP packets are sent inside UDP
00:17:15.089
packets.
00:17:15.690
The diagram we see here shows the
00:17:18.294
format of the RTP packets. This is
00:17:20.899
the format of the media data,
00:17:23.131
which sits within the payload section of
00:17:25.736
UDP packets.
00:17:26.580
And we see it that's actually a
00:17:28.820
reasonably sophisticated protocol. If we look at
00:17:31.060
the format of the packet, we see
00:17:33.300
there’s a sequence number and a timestamp
00:17:35.540
to allow the
00:17:36.600
receiver to reconstruct the ordering, and reconstruct
00:17:39.448
the timing. There’s a source identifier to
00:17:42.297
identify who sent the packet, if you
00:17:45.145
have a multi-party video conference.
00:17:47.280
And there's some payload format identifiers,
00:17:50.157
that describe whether it contains audio or
00:17:53.514
video, what compression algorithm, is used,
00:17:56.391
on so on
00:17:57.930
And there’s space for extension headers,
00:17:59.880
and space of padding, and the space
00:18:02.155
for payload data where the actual audio
00:18:04.430
or video data goes.
00:18:09.270
And these packets, these RTP packets,
00:18:12.107
are sent within UDP packets. And the
00:18:15.418
sender will typically send these with pretty
00:18:18.728
regular timing. If it’s audio, it generates
00:18:22.038
50 packets per second;
00:18:24.030
if it's video, it might be 25
00:18:26.671
or 30 or 60 frames per second,
00:18:29.312
but the timing tends to be quite
00:18:31.953
predictable.
00:18:32.430
As the data traverses the network,
00:18:34.636
though, the timing is often disrupted by
00:18:37.209
the other types of traffic, the cross-traffic
00:18:39.782
within the network. If we look at
00:18:42.355
the bottom of the slide, we see
00:18:44.928
the packets arriving at the receiver,
00:18:47.134
and we see that the timing is
00:18:49.707
no longer predictable.
00:18:50.910
Because of the other traffic in the
00:18:53.570
network, because it's a best effort network,
00:18:56.230
because it's a shared network,
00:18:58.230
the media data is sharing the network
00:19:00.855
with TCP traffic, with all the other
00:19:03.480
flows on the network, and so the
00:19:06.105
packets don't necessarily arrived with predictable timing.
00:19:11.400
One of the things the receiver has
00:19:14.419
to do, is try to reconstruct the
00:19:17.439
timing.
00:19:17.970
And what we see on this slide,
00:19:20.321
at the top, we see the timing
00:19:22.671
of the data as it was transmitted.
00:19:25.022
And the example is showing audio data,
00:19:27.372
and it’s labelling talk-spurts, and a talk-spurt
00:19:29.723
will be a sentence, or a fragment
00:19:32.074
of a sentence, with a pause between
00:19:34.424
it.
00:19:34.860
We see that the packets comprising the
00:19:37.615
speech data are transmitted with regular spacing.
00:19:40.470
And they pass across the network,
00:19:42.514
and at some point later they arrive
00:19:44.898
at the receiver.
00:19:46.020
There's obviously some delay, it’s labeled as
00:19:48.453
network transit delay on the slide,
00:19:50.539
which is the time it takes the
00:19:52.972
packets to traverse the network.
00:19:54.810
And there will be a minimum amount
00:19:56.875
of time it takes, just based on
00:19:58.940
the propagation delay, how long it takes
00:20:01.005
the signals to work their way down
00:20:03.070
the network from the sender to the
00:20:05.135
receiver. And, on top of that,
00:20:06.905
there will be varying amounts of queuing
00:20:08.970
delay, depending on how busy the network
00:20:11.035
is.
00:20:11.430
And the result of that, is that
00:20:14.218
the timing is no longer regular.
00:20:16.608
Packets which were sent with regular spacing,
00:20:19.397
arrive bunched together with occasional gaps between
00:20:22.185
them. And, occasionally, they may arrive out-of-order,
00:20:24.973
or occasionally the packets may get lost
00:20:27.762
entirely
00:20:28.260
And what the receiver does, is to
00:20:30.788
add what’s labeled as “playout buffering delay”
00:20:33.316
on this slide, to compensate for this
00:20:35.844
timing variation. To compensate for what's known
00:20:38.372
as jitter, the variation in the time
00:20:40.900
it takes the packets to transit across
00:20:43.428
the network.
00:20:44.250
By adding a bit of buffering delay,
00:20:46.803
the receiver can allow itself time to
00:20:49.357
put all the packets back into the
00:20:51.910
right order,
00:20:52.740
and to regularise the spacing. It just
00:20:55.497
adds enough delay to allow it to
00:20:58.254
compensate for this variation. So, by adding
00:21:01.012
a little extra delay at the receiver,
00:21:03.769
the receiver correct for the variations in
00:21:06.526
timing.
00:21:07.020
And, if packets are lost, it obviously
00:21:09.280
has to try and conceal that loss,
00:21:11.541
or it can try to do a
00:21:13.801
retransmission if it thinks the retransmission will
00:21:16.061
arrive in time.
00:21:17.130
Of, if packets arrive, and we see
00:21:19.271
the very last packet here, if the
00:21:21.412
packets arrive too late, if they're delayed
00:21:23.554
too much, then they may arrive too
00:21:25.695
late to be played out. In which
00:21:27.836
case they’re just discarded, and the gap
00:21:29.977
has to be concealed as-if the packet
00:21:32.118
were lost.
00:21:36.060
And, essentially, you can see, that if
00:21:38.598
the packets are played-out immediately they arrive,
00:21:41.136
this variation and timing would lead to
00:21:43.674
gaps, because the packets are not arriving
00:21:46.212
with consistent spacing.
00:21:47.400
If you delay the play-out by more
00:21:49.613
than the typical variation between the inter-arrival
00:21:51.826
time of the packets,
00:21:53.190
you can add enough buffering that once
00:21:55.564
you actually start playing out the packets,
00:21:57.939
when you start playing out the data,
00:22:00.313
you can allow smooth playback. You trade
00:22:02.688
off a little bit of extra latency
00:22:05.062
for very smooth,
00:22:06.180
consistent, playback.
00:22:09.390
And that delay between the packets arriving,
00:22:13.055
and the media starting to play back,
00:22:16.719
that buffering delay,
00:22:18.390
partly allows you to reconstruct the timing,
00:22:22.034
and it partly gives time to decompress
00:22:25.678
the audio, decompress the video, run a
00:22:29.322
loss concealment algorithm, and potentially retransmit any
00:22:32.966
lost packets, depending on the network round-trip
00:22:36.609
time.
00:22:37.230
And then you can schedule the packets
00:22:38.888
to be played out, and you can
00:22:40.546
play the data out smoothly.
00:22:46.890
What's critical, though, is that loss is
00:22:50.393
very much possible. The receiver has to
00:22:53.896
make the best of the packets which
00:22:57.399
do arrive.
00:22:58.500
And a lot of effort, when building
00:23:02.140
video conferencing applications, goes into defining how
00:23:05.780
the compressed audio-visual data is formatted into
00:23:09.420
the packets.
00:23:10.560
And the goal is that each packet
00:23:13.150
should be independently usable.
00:23:14.730
It's easy to take the output of
00:23:17.686
a video compression scheme, a video codec,
00:23:20.642
and just arbitrarily put the data into
00:23:23.598
packets.
00:23:24.120
But, if you do that, the different
00:23:26.697
packets end up depending on each other.
00:23:29.275
You can't decode a particular packet if
00:23:31.852
an earlier one was lost, because it
00:23:34.430
depends on some of the data was
00:23:37.007
in the earlier packet.
00:23:38.580
So a lot of the skill in
00:23:40.924
building a video conferencing application goes into
00:23:43.268
what's known as the payload format.
00:23:45.277
It goes into the structure of how
00:23:47.621
you format the output of the video
00:23:49.965
compression,
00:23:50.400
and how you format the output of
00:23:52.855
the audio compression, so that for each
00:23:55.310
packet that arrives, it doesn't depend on
00:23:57.765
any data that was in a previous
00:24:00.220
packet, to the extent possible, so that
00:24:02.674
every packet that arrives can be decoded
00:24:05.129
completely.
00:24:05.580
And there are obviously limits to this.
00:24:08.319
Most video compression schemes work by sending
00:24:11.057
a full image, and then encoding differences
00:24:13.796
to that, and that obviously means that
00:24:16.534
you depend on that previous full image,
00:24:19.273
what's known as the index frame.
00:24:21.720
And a lot of these systems build
00:24:24.821
in retransmission schemes if the index frame
00:24:27.923
gets lost, but apart from that the
00:24:31.024
packets for the predicted frames, that are
00:24:34.126
transmitted after that, should all be independently
00:24:37.227
decodable.
00:24:37.770
The paper shown on the right of
00:24:40.532
the slide here, “Architectural Considerations for a
00:24:43.294
New Generation of Protocols”, by David Clark
00:24:46.056
and David Tennenhouse,
00:24:47.340
talks about this approach, and talks about
00:24:49.495
this philosophy of how to include that
00:24:51.650
data such as the packets are independently
00:24:53.805
decodable, and how to structure these types
00:24:55.959
of applications, and it's very much worth
00:24:58.114
a read.
00:25:02.940
Obviously the packets can get lost,
00:25:05.457
and the way networks applications typically deal
00:25:08.394
with lost packets is by asking for
00:25:11.331
a retransmission.
00:25:12.270
And you can clearly do this with
00:25:15.013
a video conferencing application.
00:25:16.680
The problem is that retransmission takes time.
00:25:19.217
It takes a round-trip time for the
00:25:21.754
retransmission requests to get back from the
00:25:24.291
receiver to the sender, and for the
00:25:26.828
sender to transmit the data.
00:25:28.740
But for video conferencing applications, for interactive
00:25:31.213
applications, you've got quite a strictly delay
00:25:33.687
bound.
00:25:34.140
The delay bound is somewhere on the
00:25:37.117
order of 100-150 milliseconds, mouth to ear
00:25:40.095
delay.
00:25:40.620
And that comprises the time it takes
00:25:43.192
to capture a frame of audio,
00:25:45.396
and audio frames are typically 20 milliseconds,
00:25:47.968
so you've got a 20 millisecond frame
00:25:50.540
of audio being captured.
00:25:52.110
And then it takes some time to
00:25:53.788
compress that frame. And then it has
00:25:55.465
to be sent across the networks,
00:25:56.903
so you've got the time to transit
00:25:58.580
network.
00:25:58.920
And then the time to decompress the
00:26:01.472
frame, and the time to play that
00:26:04.023
frame of audio out. And that typically
00:26:06.575
ends up being four framing durations,
00:26:08.762
plus the network time.
00:26:10.320
So you have 20 milliseconds of frame
00:26:12.959
data being captured. And while that's being
00:26:15.598
captured, the previous frame is being compressed,
00:26:18.236
and transmitted. And, on the receiver side,
00:26:20.875
you have one frame being
00:26:22.860
decoded, errors being concealed, and timing being
00:26:26.002
reconstructed. And then another frame being played
00:26:29.144
out. So you've got 4 frames,
00:26:31.837
80 milliseconds, plus the network time.
00:26:34.530
It doesn't leave much time to do
00:26:37.672
a retransmission.
00:26:38.670
So retransmissions tend not to be particularly
00:26:41.953
useful in video conferencing applications, unless they're
00:26:45.235
on quite short duration network paths,
00:26:48.049
because they arrive too late to be
00:26:51.331
played-out.
00:26:51.900
So what these applications tend to do,
00:26:55.237
is use forward error correction.
00:26:57.720
And the basic idea of forward error
00:27:00.337
correction is that you send additional error
00:27:02.953
correcting packets, along with the original data.
00:27:05.670
So, in the example on the slide,
00:27:08.177
we're sending four packets of original speech
00:27:10.684
data, original media data. And for each
00:27:13.191
of those four packets, you then send
00:27:15.698
a fifth packet, which is the forward
00:27:18.206
error correction packet.
00:27:19.380
So the group of four packets gets
00:27:22.557
turned into five packets for transmission.
00:27:25.380
And, in this example, the third of
00:27:28.352
those packets gets lost.
00:27:30.150
And at the receiver, you take the
00:27:33.477
four of those five packets which did
00:27:36.805
arrive,
00:27:37.380
and you use the error correcting data
00:27:41.183
to recover that loss without retransmitting the
00:27:44.987
packet.
00:27:45.630
And there are lots of different ways
00:27:47.991
in which these error correcting codes can
00:27:50.353
work.
00:27:50.790
In the simplest case, the forward error
00:27:53.295
correction packet is just the result of
00:27:55.800
running the exclusive-or, the XOR operation,
00:27:57.947
on the previous packets. So the forward
00:28:00.451
error correction packets on the slides could
00:28:02.956
be, for example, the XOR of packets
00:28:05.461
1, 2, 3, and 4.
00:28:07.350
In this case, on the receiver,
00:28:09.619
when it notices that packet 3 has
00:28:12.266
been lost, if it calculates the XOR
00:28:14.913
of the received packets, so if you
00:28:17.560
XOR packets 1, 2, and 4,
00:28:19.829
and the FEC packet together, what will
00:28:22.477
come out will be the original packet,
00:28:25.124
missing packet.
00:28:25.980
And that's obviously a simple approach.
00:28:28.292
There are a lot of much more
00:28:30.990
sophisticated forward error correction schemes, which trade
00:28:33.687
off different amounts of complexity for different
00:28:36.385
overheads.
00:28:36.870
But the idea is that you send
00:28:39.642
occasional packets, which error correcting packets,
00:28:42.018
and that allows you to recover from
00:28:44.790
some types of loss without retransmitting the
00:28:47.562
packets, so you can recover losses more
00:28:50.334
quickly.
00:28:55.500
And that's the summary of how we
00:28:59.134
transmit media over the Internet.
00:29:01.830
That data is captured, compressed, framed into
00:29:05.606
RTP packets, each which includes sequence number
00:29:09.382
and timing recovery information.
00:29:11.640
And then, when they arrive at the
00:29:14.421
receiver, it’s decompressed, it’s buffered, the timing
00:29:17.201
is reconstructed, and the buffering is chosen
00:29:19.982
to receiver to reconstruct the timing,
00:29:22.365
and then the media is played-out to
00:29:25.146
the user.
00:29:26.040
And that comprises the media transport parts.
00:29:29.550
As we saw, there's also signalling protocols
00:29:32.455
and NAT traversal protocols. What I'll talk
00:29:35.360
about in the next part is,
00:29:37.850
briefly, how the signalling protocols work to
00:29:40.755
set up multimedia conferencing calls.
Part 3: Interactive Applications - Signalling
This part moves on from discussion real-time data transfer to discuss
the control plane supporting interactive conferencing applications. It
discusses the WebRTC data channel, and the supporting signalling
protocols, including the SDP offer/answer exchange, SIP, and WebRTC
signalling via JSEP.
00:00:00.000
In the previous part of the lecture,
00:00:02.450
I introduced interactive conferencing applications. I spoke
00:00:04.900
a bit about the architecture of those
00:00:07.350
applications, about the latency requirements, and the
00:00:09.900
structure of those applications, and began to
00:00:12.880
introduce the standard set of conferencing protocols.
00:00:15.859
I spoke in detail about the Real-time
00:00:18.839
Transport Protocol, and the way media data
00:00:21.819
is transferred.
00:00:22.770
In this part of the lecture,
00:00:25.132
I want to talk briefly about two
00:00:27.888
other aspects of interactive video conferencing applications,
00:00:30.644
the data channel, and the signalling protocols.
00:00:35.160
In addition to sending audio visual media,
00:00:40.020
most video conferencing applications also provide some
00:00:44.144
sort of peer-to-peer data channel.
00:00:47.190
This is part of the WebRTC standards,
00:00:50.812
and it's also part of most of
00:00:54.433
the other systems as well.
00:00:57.120
The goal is to provide
00:00:59.520
for applications like peer-to-peer file transfer as
00:01:02.273
part of the video conferencing tool,
00:01:04.633
to support a chat session along with
00:01:07.387
the audio and video, and to support
00:01:10.140
features like reaction emoji, the ability to
00:01:12.893
raise your hand, request to the speaker
00:01:15.647
talks faster or slower, and so on.
00:01:20.910
The way this is implemented in WebRTC,
00:01:24.432
is using a protocol called SCTP running
00:01:27.954
inside a secure UDP tunnel.
00:01:30.570
I’m not going to talk much about
00:01:33.396
SCTP.
00:01:33.900
SCTP is the Stream Control Transport Protocol,
00:01:37.229
and it was a previous attempt at
00:01:40.559
replacing TCP.
00:01:41.610
The original version of SCTP ran directly
00:01:45.015
over IP, and was pitched as a
00:01:48.420
direct replacement for TCP, running as a
00:01:51.825
peer for TCP or UDP directly on
00:01:55.231
the IP layer.
00:01:56.790
And it turned out this was too
00:01:59.728
difficult to deploy, so it didn't get
00:02:02.665
tremendous amounts of take-up. But, at the
00:02:05.603
point when the WebRTC standards were being
00:02:08.541
developed, it was
00:02:09.900
available, and specified, and it was deemed
00:02:12.695
relatively straightforward to move it to run
00:02:15.490
on top of UDP, to run on
00:02:18.285
top of Datagram TLS, to provide security,
00:02:21.180
as a deployable way of providing a
00:02:26.195
reliable peer-to-peer data channel.
00:02:29.160
And it would perhaps have been possible
00:02:32.182
to use TCP to do this,
00:02:34.772
but the belief at the time was
00:02:37.793
that NAT traversal for TCP wasn't very
00:02:40.815
reliable, and that something running over UDP
00:02:43.837
would work better for NAT traversal.
00:02:46.427
And I think that was the right
00:02:49.448
decision.
00:02:49.980
And SCTP, the WebRTC data channel using
00:02:54.559
SCTP over DTLS over UDP,
00:02:57.930
provides a transparent data channel. It provides
00:03:01.708
the ability to deliver framed messages,
00:03:04.946
it supports delivering multiple sub-streams of data
00:03:08.724
over a single connection, and it supports
00:03:12.502
congestion control, retransmissions, reliability and so on.
00:03:16.380
And it makes it straightforward to build
00:03:19.638
peer-to-peer applications using WebRTC.
00:03:21.600
And gains all the deployments advantages that
00:03:25.053
we gained with QUIC, by running over
00:03:28.507
UDP.
00:03:29.100
You might ask why WebRTC uses SCTP
00:03:37.080
to build its data channel, rather than
00:03:40.082
using QUIC?
00:03:41.040
And, fundamentally, that's because WebRTC predates the
00:03:45.128
development of QUIC.
00:03:46.980
It seems likely, now that the QUIC
00:03:49.869
standard is finished, that future versions of
00:03:52.757
WebRTC will migrate, and switch to using
00:03:55.646
QUIC, and gradually phase out the SCTP-based
00:03:58.535
data channel.
00:03:59.460
And QUIC learned, I think, from this
00:04:02.782
experience, and is more flexible and more
00:04:06.104
highly optimised than the SCTP, DTLS,
00:04:08.951
UDP stack.
00:04:13.650
In addition to the media transport and
00:04:17.281
data, you need some form of signalling,
00:04:20.911
and some sort of session description,
00:04:24.023
to specify how to set up a
00:04:27.654
video conferencing call.
00:04:29.310
Video conferencing calls run peer-to-peer. The goal
00:04:32.240
of a system like Zoom, or Skype,
00:04:35.169
or any of these systems, is to
00:04:38.099
set up peer-to-peer data, where possible,
00:04:40.710
so that they can achieve the lowest
00:04:44.016
possible latency.
00:04:45.060
They need some sort of signalling protocol
00:04:47.416
to do that. They need some sort
00:04:49.771
of protocol to convey the details of
00:04:52.127
what transport connections are to be set
00:04:54.483
up, to exchange the set of candidate
00:04:56.839
IP addresses on which they can be
00:04:59.194
reached, to set up the peer-to-peer connection.
00:05:01.650
They need to specify the media formats
00:05:04.348
they want to use. Is it just
00:05:07.046
audio? Or is it audio and video?
00:05:09.744
And which compression algorithms are to be
00:05:12.442
used? And they want to specify the
00:05:15.140
timing of the session, and the security
00:05:17.838
parameters, and all the other parameters.
00:05:20.250
A standardised way of doing that is
00:05:23.633
using a protocol called the Session Description
00:05:27.017
Protocol.
00:05:27.600
The example on the right at the
00:05:31.298
slide is an example of an SDP,
00:05:34.997
a Session Description Protocol, description of a
00:05:38.695
simple multimedia conference.
00:05:40.380
The format of SDP is unpleasant.
00:05:42.981
It’s essentially a set of key-value pairs,
00:05:46.015
where the keys are all single letters,
00:05:49.049
and the values are more complex,
00:05:51.750
one key-value pair per line, with the
00:05:54.797
key and the value separated by equals
00:05:57.845
signs.
00:05:58.380
And, as we see in the example,
00:06:01.738
it starts with a version number,
00:06:04.616
v=0. There’s an originator line, and it
00:06:07.973
was originated by Jane Doe, who had
00:06:11.331
IP address 10.47.16.5.
00:06:12.870
It's a seminar about session description protocol.
00:06:15.672
It's got the email address of Jane
00:06:18.475
Doe, who set up the call,
00:06:20.876
it's got their IP address, the times
00:06:23.679
that session is active,
00:06:25.380
it's receive only, it’s broadcast so that
00:06:28.814
the listener just receives the data,
00:06:31.757
it’s sending using audio and video media,
00:06:35.191
and it specifies the ports and some
00:06:38.625
details of the video compression scheme,
00:06:41.568
and so on.
00:06:43.140
The details of the format aren't particularly
00:06:46.495
important. It’s clear that it's sending
00:06:49.470
what the session is about, the IP
00:06:52.036
addresses, the times, the details of the
00:06:54.602
audio compression, the details of the video
00:06:57.168
compression, the port numbers to use,
00:06:59.368
and so on. And how this is
00:07:01.934
encoded isn't really important.
00:07:07.140
In order to set up an interactive
00:07:08.885
call, you need some sort of a
00:07:10.631
negotiation.
00:07:10.980
You need some sort of offer to
00:07:13.351
communicate, which says this is the set
00:07:15.721
of video compression schemes, this is the
00:07:18.092
set of audio compression schemes, that the
00:07:20.463
sender supports.
00:07:21.240
This is who is trying to call
00:07:23.720
you. This is the IP address that
00:07:26.199
they're calling you from. These are the
00:07:28.679
public key for trying to negotiate the
00:07:31.159
security parameters. And so on.
00:07:33.030
And that comprises an offer.
00:07:35.910
And the offer gets sent via a
00:07:39.709
signalling channel, via some out of bounds
00:07:43.509
signalling server, to the
00:07:45.780
responder, to the person you're trying to
00:07:49.105
call.
00:07:49.680
The responder generates an answer, which looks
00:07:52.674
at that set of codecs the offer
00:07:55.668
specified, and picks the subset it also
00:07:58.662
understands.
00:07:59.190
It provides the IP addresses it can
00:08:02.259
be reached at, it provides its public
00:08:05.327
keys, confirms its willingness to communicate,
00:08:07.958
and so on. And the answer flows
00:08:11.026
back to the original sender, the initiator
00:08:14.095
of the call.
00:08:15.510
And this allows the offering party and
00:08:17.975
the answering party, the initiator and responder,
00:08:20.439
to exchange the details they need to
00:08:22.904
establish the call.
00:08:24.060
The offer contains all the IP address
00:08:26.647
candidates that can be used with the
00:08:29.233
ICE algorithm to probe the NAT bindings.
00:08:31.920
The answer coming back contains the candidates
00:08:34.368
for the receiver, that allows them to
00:08:36.816
do the STUN exchange, the STUN packets,
00:08:39.264
to run the ICE algorithms that actually
00:08:41.712
sets up the peer-to-peer connection.
00:08:43.560
And it's also got the details of
00:08:46.535
the compression algorithms, the video codec,
00:08:49.085
the audio formats, the security parameters,
00:08:51.635
and so on/
00:08:53.010
Unfortunately SDP, which we have ended up
00:08:56.015
using as the negotiation format, really wasn't
00:08:59.020
designed to do this. It was originally
00:09:02.025
designed as a one way announcement format
00:09:05.130
to describe video on demand sessions,
00:09:07.783
rather than as a format for negotiating
00:09:10.878
parameters. So the syntax is pretty unpleasant,
00:09:13.973
and the semantics are pretty unpleasant,
00:09:16.626
and it's
00:09:17.610
somewhat complex to use in practice.
00:09:20.436
And this complexity wasn't really visible when
00:09:23.734
we started developing the these systems,
00:09:26.560
these tools, but unfortunately it turned out
00:09:29.857
that SDP wasn't a great format here,
00:09:33.155
but it's now too entrenched
00:09:35.610
for alternatives to take off. So we’re
00:09:38.351
left with this quite unpleasant, not particularly
00:09:41.092
well-designed format. But, we use it,
00:09:43.442
and we negotiate the parameters.
00:09:47.670
Exactly how this is used depends on
00:09:50.855
the system you're using, There’s two widely
00:09:54.040
used models.
00:09:55.050
One is a system known as the
00:09:57.962
Session Initiation Protocol.
00:09:59.310
And the Session Initiation Protocol, SIP,
00:10:02.753
is very widely used for telephony,
00:10:06.196
and it's widely used for stand-alone video
00:10:10.212
conferencing systems.
00:10:11.460
If you make a phone call using
00:10:14.404
a mobile phone, this is how the
00:10:17.349
phone locates the person you wish to
00:10:20.293
call, and sets up the call,
00:10:22.817
is using SIP, for example.
00:10:25.020
And SIP relies on a set of
00:10:28.090
conferencing servers, one representing the person making
00:10:31.161
the call, and one representing person being
00:10:34.231
called.
00:10:34.770
And the two devices, typically mobile phones
00:10:37.497
or telephones these days, have a direct
00:10:40.224
connection to those servers, which they maintain
00:10:42.951
at all times.
00:10:44.220
On the sending side, when you try
00:10:46.865
to make a call, the message goes
00:10:49.511
out to the server, and that allows,
00:10:52.156
at that point there's a set of
00:10:54.802
STUN packets exchanged, and a set of
00:10:57.447
signalling messages exchanged, that allow the initiator
00:11:00.092
to find its public NAT bindings/
00:11:02.460
And then the message goes out to
00:11:05.369
the server, and that locates the server
00:11:08.278
for the person being called, and passes
00:11:11.187
the message back over the connection to
00:11:14.096
their server, and it eventually reaches the
00:11:17.004
responder.
00:11:17.520
And that gives the responder the candidates
00:11:20.091
addresses, and all the connection details,
00:11:22.294
and the codec parameters, and so on,
00:11:24.865
needed for it to decide whether it
00:11:27.436
wishes to accept the call, and to
00:11:30.006
start setting up the NAT bindings.
00:11:32.310
And it responds, and the message goes
00:11:34.550
back through the multiple servers to the
00:11:36.790
initiator, and that completes the offer answer
00:11:39.030
exchange.
00:11:39.450
At that point, they can start running
00:11:41.824
the ICE algorithm, discovering the NAT bindings.
00:11:44.198
And they've already agreed the parameters at
00:11:46.571
this point, which codecs they using,
00:11:48.606
what public keys that are using,
00:11:50.641
and so on. And that lets them
00:11:53.014
set up a peer-to-peer connection
00:11:54.810
using the ICE algorithm, and using STUN,
00:11:58.019
to set up a peer-to-peer connection over
00:12:01.229
which the media data can flow.
00:12:04.080
And it's an indirect connection set up.
00:12:06.880
The data flows from initiator, to their
00:12:09.680
server, to the responder’s server, to the
00:12:12.480
responder, and then back via the server
00:12:15.280
path.
00:12:15.780
And that indirect signalling setup allows the
00:12:18.575
direct peer-to-peer connection to be created.
00:12:25.440
In more modern systems, systems using the
00:12:31.145
WebRTC browser-based approach,
00:12:33.690
the trapezoid that we have in the
00:12:36.824
SIP world, with the servers representing each
00:12:39.957
of the two parties, tends to get
00:12:43.091
collapsed into a single server representing the
00:12:46.225
conferencing service.
00:12:47.220
And the server, in this case,
00:12:49.598
is something such as the Zoom servers,
00:12:52.373
or the Webex servers, or the Microsoft
00:12:55.147
Teams servers.
00:12:56.040
And, it's essentially following the same pattern.
00:12:59.276
It’s just that there's a now a
00:13:02.512
single conferencing server that initiates the call,
00:13:05.747
rather than being a cross-provider, with server
00:13:08.983
for each party.
00:13:10.470
And this is how web-based conferencing systems
00:13:13.846
such as
00:13:14.910
Zoom, and Webex, and Teams, and the
00:13:18.682
like, work.
00:13:19.860
You get your Javascript application, your web-based
00:13:23.281
application, sitting on top. This talks to
00:13:26.702
the WebRTC API in the browsers,
00:13:29.634
and that provides access to the session
00:13:33.056
descriptions which you can exchange with the
00:13:36.477
server over HTTP GET and POST requests
00:13:39.898
to figure out the details of
00:13:42.930
how the communication should be set up.
00:13:45.650
And, once you've done that, you can
00:13:48.370
fire off the data channel, and the
00:13:51.090
media transport, and establish the peer-to-peer connections.
00:13:53.910
So the initial signalling is exchanged via
00:13:56.688
HTTP to the web server, that controls
00:13:59.467
that call. The offer-answer exchange in SDP
00:14:02.245
is exchanged with the server, and that
00:14:05.023
exchanges it with the responder, and then,
00:14:07.802
when all the parties agree to communicate,
00:14:10.680
the server sends back the session description
00:14:13.803
containing the details which the browsers need
00:14:16.926
to set up the call. And they
00:14:20.049
then established a peer-to-peer connection.
00:14:22.380
And the goal is to integrate the
00:14:24.887
video conferencing features into the browsers,
00:14:27.036
and allows the server to control the
00:14:29.544
call setup.
00:14:30.360
And, as we've seen over the course
00:14:34.110
of, I guess, the last year or
00:14:37.432
so, it actually works reasonably well.
00:14:40.380
Video conferencing applications work reasonably well in
00:14:42.847
practice.
00:14:47.610
So what's happening with interactive applications? Where
00:14:51.824
are things going?
00:14:53.730
I think there’s two ways these types
00:14:57.084
of applications are evolving.
00:14:59.100
One is supporting better quality, and supporting
00:15:02.191
new types of media. Obviously, over time,
00:15:05.281
the audio and the video quality,
00:15:07.930
and the frame rate, and the resolution,
00:15:11.021
has gradually been increasing, and I expect
00:15:14.111
that will continue for a while.
00:15:16.860
There's also people talking about running various
00:15:20.932
types of augmented reality, virtual reality,
00:15:24.423
holographic 3D conferencing, and
00:15:26.850
tactile conferencing where you transmit a sense
00:15:29.671
of touch over the network. And some
00:15:32.492
of these have perhaps stricter requirements on
00:15:35.313
latency, and stricter requirements on quality but,
00:15:38.135
as far as I can tell,
00:15:40.553
they all fit within the basic framework
00:15:43.374
we've described.
00:15:44.280
They can all be transmitted over UDP
00:15:48.891
using
00:15:49.650
RTP, or the data channel, or something
00:15:52.775
very like it. And they all fit
00:15:55.899
within the same basic framework, of add
00:15:59.024
a little bit of buffering to reconstruct
00:16:02.149
the timing, graceful degradation for the media
00:16:05.274
transport.
00:16:05.820
Currently, we have a mix of RTP
00:16:09.374
for the audio and video data,
00:16:12.421
and the SCTP-based data channel.
00:16:15.060
it's pretty clear, I think, that the
00:16:17.623
data channel is going to transition to
00:16:20.186
using QUIC relatively soon.
00:16:21.750
And there's a fair amount of active
00:16:24.318
research, and standardisation, and discussion, about whether
00:16:26.887
it makes sense to also move the
00:16:29.455
audio and video data to run over
00:16:32.023
QUIC.
00:16:32.490
And people are building unreliable datagram extensions
00:16:34.693
to QUIC to support this, so I
00:16:36.896
think it's reasonably likely that we’ll end
00:16:39.099
up running both the audio and the
00:16:41.302
video and the data channel over
00:16:43.290
peer-to-peer QUIC connections, although the details of
00:16:46.636
how that will work are still being
00:16:49.982
discussed.
00:16:53.700
And that's what I would say about
00:16:56.430
interactive applications. In the next part I
00:16:59.160
will move on talk about video on
00:17:01.890
demand, and streaming applications.
Part 4: Streaming Video
The final part of the lecture discusses streaming video. It talks about
HTTP Adaptive Streaming and MPEG DASH, content delivery networks, and
some reasons why streaming media is delivered over HTTP. The operation
of HTTP adaptive streaming protocols is discussed, and their strengths
and limitations are highlighted.
00:00:00.000
In this last part of the lecture,
00:00:02.018
I want to talk about streaming video
00:00:04.037
and HTTP adaptive streaming.
00:00:08.099
So how do streaming video applications,
00:00:10.663
such as Netflix, the iPlayer, and YouTube,
00:00:13.654
actually work?
00:00:14.609
Well, what you might expect them to
00:00:17.174
do, is use RTP, the same as
00:00:19.740
the video conferencing applications, to stream the
00:00:22.305
video over the network in a low-latency
00:00:24.871
and loss-tolerant way.
00:00:26.070
And, indeed, this is how streaming video,
00:00:28.852
streaming audio, applications used to work.
00:00:31.237
Back in the late 1990s, the most
00:00:34.019
popular application in this space was RealAudio,
00:00:36.801
and later RealPlayer when it incorporated video
00:00:39.583
support.
00:00:40.080
This did exactly as you would expect.
00:00:42.896
It streamed the audio and the video
00:00:45.712
over RTP, and had a separate control
00:00:48.527
protocol, the Real Time Streaming Protocol,
00:00:50.941
to control the playback.
00:00:52.650
These days, though, most applications actually deliver
00:00:56.442
the video over HTTPS instead.
00:00:59.250
And as a result, they have significantly
00:01:02.772
worse performance. They have significantly higher latency,
00:01:06.294
and significantly higher startup latency.
00:01:08.910
The reason they do this, though,
00:01:11.147
is that by streaming video over HTTPS,
00:01:13.757
they can integrate better with content distribution
00:01:16.367
networks.
00:01:19.890
So what is a content distribution network?
00:01:22.980
A content distribution network is a service
00:01:25.961
that provides a global set of web
00:01:28.943
caches, and proxies, that you can use
00:01:31.924
to distribute your application, that you can
00:01:34.905
use to distribute the web data,
00:01:37.461
the web content, that comprises your application
00:01:40.442
or your website.
00:01:41.820
They're run by companies such as Akamai,
00:01:44.615
and CloudFlare, and Fastly. And these companies
00:01:47.410
run massive global sets of web proxies,
00:01:50.205
web caches. And they take over the
00:01:53.100
delivery of particular sets of content from
00:01:56.005
websites. As a website operator, you give
00:01:58.910
the files, the images, the videos,
00:02:01.400
that you wish to be hosted on
00:02:04.305
the CDN, to the CDN operator.
00:02:06.795
And they ensure that they’re cached throughout
00:02:09.700
the network, at locations close to where
00:02:12.605
your customers are.
00:02:13.950
And each of those files, or images,
00:02:16.525
or videos, is given a unique URL.
00:02:19.200
And the CDN manages the DNS resolution
00:02:21.577
for that URL, so that when you
00:02:23.953
look up the name, it returns you
00:02:26.329
an IP address that corresponds to a
00:02:28.706
proxy, or a cache, which is located
00:02:31.082
near physically near to you.
00:02:32.880
And that server has the data on
00:02:35.576
it such that the response comes quickly,
00:02:38.273
and such that the load is balanced
00:02:40.969
around these servers, around the world.
00:02:43.380
And these CDNs, these content distribution networks,
00:02:46.841
are extremely effective at delivering and caching
00:02:50.301
HTTP content.
00:02:51.390
They support some extremely high volume applications:
00:02:55.843
game delivery services such as Steam,
00:02:59.659
applications like the Apple software update,
00:03:03.475
or the Windows software update, and massively
00:03:07.928
popular websites.
00:03:09.300
And they have global deployments, and they
00:03:12.243
have agreement with the overwhelming majority of
00:03:15.186
ISPs to host these caches, these proxy
00:03:18.129
servers, at the edge of the network.
00:03:21.072
So, no matter where you are in
00:03:24.016
the network, you're very near to a
00:03:26.959
content distribution node.
00:03:28.320
A limitation of CDNs, though, is that
00:03:31.337
they only work with HTTP-based content.
00:03:33.923
They’re for delivering web content. And the
00:03:36.940
entire infrastructure is based around delivering web
00:03:39.956
content over HTTP, or more typically these
00:03:42.973
HTTPS. They don't support RTP based streaming.
00:03:49.260
The way streaming video is delivered,
00:03:52.580
these days, is to make use of
00:03:56.453
content distribution networks. It's delivered using HTTPS
00:04:00.327
from a CDN node.
00:04:02.640
The contents of a video, in a
00:04:06.077
system such as Netflix, is encoded in
00:04:09.514
multiple chunks, where each chunk comprises,
00:04:12.461
typically, around 10 seconds worth of the
00:04:15.898
video data.
00:04:16.980
Each of the chunks is designed to
00:04:19.941
be independently decodable, and each is made
00:04:22.901
available in many different versions, at many
00:04:25.862
different quality rates, many different bandwidths.
00:04:28.500
A manifest file provides an index for
00:04:31.175
what chunks are available. It's an index,
00:04:33.849
which says, for the first 10 seconds
00:04:36.524
of the movie
00:04:37.770
there are these six different versions available,
00:04:39.766
and this is the size of each
00:04:41.762
one, and the quality level for each
00:04:43.758
one, and this is a URL where
00:04:45.754
it can be retrieved from.
00:04:47.280
And the same for the next 10
00:04:49.691
seconds, and the next 10 seconds,
00:04:51.757
and so on.
00:04:52.890
And the way the video streaming works,
00:04:56.020
is that the client fetches the manifest,
00:04:59.250
looks at the set of chunks,
00:05:02.776
and starts downloading the chunks in turn.
00:05:06.990
And it uses standard HTTPS downloads to
00:05:09.607
download each of the chunks. But,
00:05:11.851
as it's doing so, it monitors how
00:05:14.468
quickly it’s successfully downloading. And. based on
00:05:17.085
that, it chooses what encoding rate to
00:05:19.702
fetch next.
00:05:20.550
So, it starts out by fetching a
00:05:23.104
relatively low rate chunk, and measures how
00:05:25.658
quickly it downloads. Maybe it's fetching a
00:05:28.211
chunk that's encoded at 500 kilobits per
00:05:30.765
second,
00:05:31.230
and it measures how fast it actually
00:05:33.994
downloads. And it sees if it's actually
00:05:36.758
managing to download the 500 kilobits per
00:05:39.521
second video faster, or slower, than 500
00:05:42.285
kilobits.
00:05:42.780
If it's downloading slower than real-time,
00:05:45.088
it will pick a lower quality,
00:05:47.397
a smaller chunk, for the next time.
00:05:50.190
And, if it's downloading faster than real-time,
00:05:52.392
then it will try and pick a
00:05:54.593
higher quality, a higher rate, chunk the
00:05:56.795
next time. So it can adapt the
00:05:58.997
rate at which it downloads the video
00:06:01.198
by picking a different quality setting for
00:06:03.400
each of the chunks, each of the
00:06:05.602
pieces of the video.
00:06:06.960
And as it downloads the chunks,
00:06:08.495
it plays each one out, in turn,
00:06:10.285
while it's downloading the next chunk.
00:06:15.150
And each of the chunks of video
00:06:17.573
is typically five or ten seconds,
00:06:19.649
or thereabouts, worth of video
00:06:21.480
content. And each one is compressed multiple
00:06:24.745
different times, and it's available at multiple
00:06:28.010
different rates, and it’s available at multiple
00:06:31.274
different sizes, for example.
00:06:33.240
And the chart on the graph,
00:06:35.520
on the right, gives an example of
00:06:38.180
how Netflix recommend videos are encoded,
00:06:40.560
starting at a rate of 235 kilobits
00:06:44.258
per second, for a 320x240 very low
00:06:47.955
resolution video, and moving up to 5800
00:06:51.653
kilobits per second, 5.8 megabits per second,
00:06:55.351
for a full HD quality video.
00:06:58.620
You can see the each 10 second
00:07:01.441
piece of content is available at 10
00:07:04.262
different quality levels, 10 different sizes.
00:07:06.780
And the receiver fetches the manifest to
00:07:09.598
start off with, which gives it the
00:07:12.416
index of all of the different chunks,
00:07:15.234
and all of the different sizes,
00:07:17.649
and which URL each one is available
00:07:20.467
at.
00:07:20.970
And, as it fetches the chunk,
00:07:23.359
it tries to retrieve the URL for
00:07:26.145
that chunk, which involves a DNS request,
00:07:28.932
which involves the CDN redirecting it to
00:07:31.718
a local cache. And for that local
00:07:34.505
cache, as it downloads that chunk of
00:07:37.291
video, it measures the download rate.
00:07:39.780
If the download rate is slower than
00:07:41.737
the encoding rate, it switches to a
00:07:43.694
lower rate for the next chunk.
00:07:45.372
If the download rate
00:07:46.590
is faster than the encoding rate,
00:07:48.493
it can consider switching up to a
00:07:50.713
higher quality, a higher rate, for the
00:07:52.933
next chunk. It chooses the encoding rate
00:07:55.153
to fetch based on the TCP download
00:07:57.373
rate.
00:08:00.540
And we see what's happening is that
00:08:03.240
we've got two levels of adaptation going
00:08:06.618
on.
00:08:07.200
On one level, we've got the dynamic
00:08:10.914
adaptive streaming, the DASH clients, fetching the
00:08:14.628
content over HTTP.
00:08:16.320
They’re fetching ten seconds worth of video
00:08:18.825
at a time, measuring the total time
00:08:21.331
it takes to download that ten seconds
00:08:23.836
worth of video. And they’re dividing the
00:08:26.342
time taken by the number of bytes
00:08:28.847
in each chunk, and that gives them
00:08:31.353
an average download rate for chuck.
00:08:33.600
They're also doing this, though, over a
00:08:36.343
TCP connection. And, as we saw in
00:08:39.086
some of the previous lectures, TCP adapts
00:08:41.829
its congestion window every round-trip time.
00:08:44.280
And it's following a Reno or a
00:08:46.844
Cubic algorithm, and it's following the AIMD
00:08:49.408
approach. And, as you see at the
00:08:51.972
top of the slide, the sending rate’s
00:08:54.537
bouncing around following the sawtooth pattern,
00:08:56.734
and following the slow start and the
00:08:59.298
congestion avoidance phases of TCP.
00:09:01.230
So we've got quite a lot of
00:09:04.050
variation, on very short time scales,
00:09:06.467
as TCP does its thing. And then
00:09:09.286
that averages out, to give an overall
00:09:12.106
download rate for the chunk.
00:09:14.220
And, depending on the overall download rate
00:09:16.966
that TCP manages to get, averaged over
00:09:19.712
the ten seconds worth of video for
00:09:22.458
chunk,
00:09:22.950
that selects the size of the next
00:09:26.253
chunk to download. The idea is that
00:09:29.556
each chunk can be downloaded, at least
00:09:32.859
at real-time speed, and ideally a bit
00:09:36.162
faster than real-time, so the download gets
00:09:39.464
ahead of itself.
00:09:40.980
And, when you start watching a movie
00:09:43.498
on Netflix, or watching a program on
00:09:46.017
the iPlayer, for example, you often see
00:09:48.535
it starts out relatively poor quality,
00:09:50.694
for the first few seconds, and then
00:09:53.212
the quality jumps up after 10 or
00:09:55.731
20 seconds or so.
00:09:57.270
And what's happening here, is that the
00:10:00.487
receiver’s picking a conservative download rate for
00:10:03.705
the initial chunk, it’s picking one of
00:10:06.922
the relatively low quality, relatively small,
00:10:09.780
chunks, and downloading that first, and measuring
00:10:12.306
how long it takes. And, typically,
00:10:14.471
that's a conservative choice, and it realises
00:10:16.997
it can actually download,
00:10:18.540
it realises that the chunks are actually
00:10:20.634
downloading faster, so it switches up the
00:10:22.729
quality level fairly quickly. And, after the
00:10:24.823
first 10, 20, seconds, after a couple
00:10:26.918
of chunks have gone, the quality level
00:10:29.012
has picked up.
00:10:34.950
A consequence of all of this,
00:10:37.368
is that it takes quite a long
00:10:40.188
time for streaming video to get started.
00:10:43.008
It’s quite common that when you start
00:10:45.829
playing a movie on Netflix, or a
00:10:48.649
program on the iPlayer, that it takes
00:10:51.470
a few seconds before it gets going.
00:10:54.390
And the reason for this, is some
00:10:57.570
combination of the chunk duration, and the
00:11:00.749
playout buffering, and the encoding delays if
00:11:03.929
the video’s being encoded live.
00:11:06.300
Fetching chunks, which are typically 10 seconds
00:11:08.883
long, you need to have one chunk
00:11:11.466
being played out at any one time.
00:11:14.049
You need to have 10 seconds worth
00:11:16.631
of video buffered up in the receiver,
00:11:19.214
so you can be playing that chunk
00:11:21.797
out while you're fetching the next one.
00:11:24.480
So you've got one trunk being played
00:11:26.345
out, and one being fetched, so you’ve
00:11:28.210
immediately got two chunks worth of buffering.
00:11:30.075
So that's 20 seconds worth of buffering.
00:11:32.040
Plus the time it takes to fetch
00:11:33.960
over the network, plus, if it's being
00:11:35.879
encoded live, the time it takes to
00:11:37.799
encode the chunk which will be at
00:11:39.719
least a, it needs to
00:11:41.190
pull in the entire chunk before it
00:11:43.479
can encode it, so you've got at
00:11:45.767
least another chunk, so that'd be another
00:11:48.056
10 seconds.
00:11:48.810
So you get a significant amount of
00:11:52.361
latency because of the ten second chunk
00:11:55.912
duration. You also need enough chunks of
00:11:59.463
video buffered up, such that
00:12:02.100
if the TCP download rate changes,
00:12:04.158
and it turns out that the available
00:12:06.560
capacity changes, so a chunk downloads much
00:12:08.961
slower than you would expect, that you
00:12:11.362
don't want to run out of video
00:12:13.764
to play.
00:12:14.550
You want enough video but buffered up,
00:12:17.050
that if something takes a long time,
00:12:19.650
you have time to drop down to
00:12:21.935
a lower rate for the next chunk,
00:12:24.219
and keep the video coming, even at
00:12:26.504
a reduced level, without it stalling.
00:12:28.462
Without you running out of video to
00:12:30.747
play out.
00:12:31.500
So you’ve got to download a complete
00:12:33.977
chunk before you start playing out.
00:12:36.100
So you download and decompress a particular
00:12:38.577
chunk, and while you're doing that you're
00:12:41.054
playing the previous chunk, and everything stacks
00:12:43.531
up, the latency stacks up.
00:12:49.950
In addition to the fact that you're
00:12:52.259
just buffering up the different chunks of
00:12:54.567
video, and you need to have a
00:12:56.876
complete chunk being played while the next
00:12:59.185
one is downloading, you get the sources
00:13:01.493
of latency because of the network,
00:13:03.472
because of the way the data is
00:13:05.781
transmitted over the network.
00:13:07.200
As we saw when we spoke about
00:13:11.297
TCP, the usual way TCP retransmits lost
00:13:15.393
packets, is following a triple duplicate ACK.
00:13:19.590
What we see on the slide here,
00:13:22.096
is that the data, on the sending
00:13:24.603
side, we have the user space,
00:13:26.751
where the blocks of data, the chunks
00:13:29.257
of video, are being written into a
00:13:31.764
TCP connection.
00:13:32.580
And these get buffered up in the
00:13:34.839
kernel, in the operating system kernel on
00:13:37.098
the sender side, and transmitted over the
00:13:39.357
network.
00:13:39.780
At some point later they arrive in
00:13:42.584
the operating system kernel on the receiver
00:13:45.388
side, and that generates the acknowledgments as
00:13:48.193
those chunks, as the TCP packets,
00:13:50.596
the chunks of video, are received.
00:13:53.100
And, if a packet gets lost,
00:13:55.985
it starts generating duplicate acknowledgments. And,
00:13:58.870
eventually, after the triple duplicate acknowledgement,
00:14:01.756
the packet will be transmitted.
00:14:04.260
And we see that this takes time.
00:14:07.260
And if this is video, and the
00:14:09.642
packets are being sent at a constant
00:14:12.024
rate, we see that it takes time
00:14:14.406
to send four packets, the lost packet
00:14:16.788
plus the three following that generate the
00:14:19.169
duplicate ACKS,
00:14:19.950
before the sender notices that a packet
00:14:23.079
loss has happened. Plus, it takes one
00:14:26.208
round trip time for the acknowledgements to
00:14:29.336
get back to the sender, and for
00:14:32.465
it to retransmit the packet.
00:14:34.800
So the time before, if a packet
00:14:37.269
has been lost, it takes four times
00:14:39.738
the packet transmission time, plus one round-trip
00:14:42.207
time, before the packet gets
00:14:44.070
retransmitted, and arrived back at the receiver.
00:14:47.270
And that adds some latency. It’s got
00:14:50.471
to add at least four packets,
00:14:53.214
plus one round-trip time, extra latency to
00:14:56.414
cope with a single retransmission.
00:14:58.800
And, if the network's unreliable, such that
00:15:01.046
more than one packet is likely to
00:15:03.292
be lost, you need to add in
00:15:05.538
more buffering time, add in additional latency,
00:15:07.784
to allow the packets to arrive,
00:15:09.709
such that they can be given to
00:15:11.955
the receiver without disrupting the timing.
00:15:13.980
So you need to add some latency
00:15:16.541
to compensate for the retransmissions that TCP
00:15:19.101
might be causing, so that you can
00:15:21.662
keep receiving data smoothly while accounting for
00:15:24.223
the retransmission times.
00:15:30.810
In addition, there’s some latency due to
00:15:33.789
the size of the chunks of video.
00:15:36.768
Each chunk has to be independently decodable,
00:15:39.748
because you're changing the
00:15:41.550
compression, potentially changing the compression level,
00:15:44.105
at each chunk. So each one can't
00:15:47.085
be based on the previous one.
00:15:49.639
They all have to start from scratch
00:15:52.619
at the beginning of each chunk,
00:15:55.174
because you don't know what version came
00:15:58.154
before.
00:15:58.680
And, if you look at how video
00:16:00.838
compression works, it's all based on predicting.
00:16:02.997
You send initial frames, what are called
00:16:05.155
I-frames, index frames,
00:16:06.180
which give you a complete frame of
00:16:08.649
video. And then they predict, based on
00:16:11.117
that, the next few frames based on
00:16:13.586
that. So, at the start of a
00:16:16.054
scene, you’ll send an index frame,
00:16:18.270
and then, for the rest of the
00:16:21.270
scene, each of the successive frames will
00:16:24.269
just include the difference from the previous
00:16:27.269
frame, from the previous index frame.
00:16:29.940
And how often you send index frames
00:16:33.378
affects that the encoding rates, because the
00:16:36.816
index frames are big.
00:16:38.880
They're sending a complete frame of video,
00:16:41.279
whereas the predicted frames, in between,
00:16:43.335
are much smaller. The index frames are
00:16:45.733
often, maybe, 20 times the size of
00:16:48.132
the predicted frames.
00:16:49.260
And depending how you encode the chunks,
00:16:51.707
if the smaller chunks are, because each
00:16:54.155
chunk of video has to start with
00:16:56.602
an index frame, it has to start
00:16:59.050
with a complete frame, the shorter each
00:17:01.497
chunk is, the fewer P-frames that can
00:17:03.945
be sent before the start of the
00:17:06.392
next chunk and the next index free.
00:17:08.940
So you have this trade-off. You can
00:17:11.866
make the chunks of video small,
00:17:14.375
and that reduces the latency in the
00:17:17.301
system, but it means you have more
00:17:20.227
frequent index frames. And the more frequent
00:17:23.154
index frames
00:17:24.090
need more data, because the index frames
00:17:27.195
are large compared to the predicted frames,
00:17:30.300
so the encoding efficiency goes down,
00:17:32.962
and the overheads go up.
00:17:35.280
And this tends to enforce a lower
00:17:37.716
bound of around two seconds before the
00:17:40.153
overhead of sending the frequent index frames
00:17:42.589
gets to be too much, it gets
00:17:45.026
to be excessive.
00:17:46.170
So chunk sizes tend to be more
00:17:48.863
than that, tend to be 5,
00:17:51.171
10, seconds just keep the overheads down,
00:17:53.863
to keep the compression efficiency, the video
00:17:56.556
compression efficiency, reasonable.
00:17:57.810
And that's the main source of latency
00:18:00.183
in these applications.
00:18:06.390
So, this clearly works. Applications like Netflix,
00:18:11.319
like the iPlayer, clearly work.
00:18:14.940
But they have relatively high latency.
00:18:17.605
Because you're fetching video chunk-by-chunk, and each
00:18:20.713
chunk is five or ten seconds worth
00:18:23.822
of video,
00:18:24.810
you have five or ten seconds wait
00:18:28.724
when you start the video playing,
00:18:32.079
before it actually starts playing. And it's
00:18:35.992
difficult to reduce that latency, because of
00:18:39.906
the compression efficiency, because of the overheads.
00:18:43.920
And it would be desirable, though,
00:18:47.568
to reduce that latency.
00:18:50.100
It will be desirable for people who
00:18:52.906
watch sport, because the latency for the
00:18:55.712
streaming applications is higher than it is
00:18:58.517
for broadcast TV,
00:18:59.820
so, if you're watching live sports,
00:19:03.099
you tend to see the action 5,
00:19:06.925
or 10, or 20, seconds behind broadcast
00:19:10.751
TV, and that can be problematic.
00:19:14.130
It’s also a problem for people trying
00:19:16.906
to offer interactive applications, and augmented reality,
00:19:19.682
where they'd like the latency to be
00:19:22.458
low enough that you can interact with
00:19:25.235
the content, and maybe dynamically change the
00:19:28.011
view point, or interact with parts of
00:19:30.787
the video.
00:19:31.680
So people are looking to build lower-latency
00:19:36.036
streaming video.
00:19:37.380
I think there's two ways in which
00:19:40.542
this is likely to happen.
00:19:42.900
The first is that we might go
00:19:45.566
back to using RTP.
00:19:47.190
We might go back to using something
00:19:50.525
like WebRTC to control the setup,
00:19:53.384
and build streaming video using essentially the
00:19:56.719
same platform we use for interactive video
00:20:00.054
conferencing,
00:20:00.630
but sending in one direction only.
00:20:04.800
And this is this is possible today.
00:20:07.817
The browsers support
00:20:09.210
WebRTC, and there's nothing that says you
00:20:12.089
have to transmit as well as receiving
00:20:14.968
in a WebRTC session. So you could
00:20:17.846
build an application uses WebRTC to stream
00:20:20.725
video to the browser.
00:20:22.470
It would have much lower latency than
00:20:25.179
the DASH-based, dynamic adaptive streaming over HTTP
00:20:27.889
based, approach that people use today.
00:20:30.211
But it's not clear that it would
00:20:32.920
play well with the content distribution networks.
00:20:35.630
It’s not clear that the CDNs would
00:20:38.339
support RTP streaming.
00:20:39.600
But if they did, if the CDNS
00:20:42.190
could be persuaded to support RTP,
00:20:44.410
this would be a good way of
00:20:47.000
getting lower latency.
00:20:48.210
I think what's perhaps more likely,
00:20:50.782
though, is that we will start to
00:20:53.783
see the CDNs switching to support QUIC,
00:20:56.783
because it gives better performance for web
00:20:59.784
traffic in general,
00:21:01.170
and then people start to switch to
00:21:04.331
delivering the streaming video over QUIC.
00:21:07.140
And, because QUIC is a user space
00:21:09.874
stack, it's easier to deploy interesting transport
00:21:12.607
protocol innovations. Because they're done by just
00:21:15.341
deploying a new application, you don't have
00:21:18.074
to change the operating system kernel,
00:21:20.417
you don't have to change,
00:21:22.470
if you want to change how TCP
00:21:24.159
works, you have to change the operating
00:21:25.848
system. Whereas if you want to change
00:21:27.538
the way QUIC works, you just have
00:21:29.227
to change the application or the library
00:21:30.916
that's providing QUIC.
00:21:31.740
So I think it's likely that we
00:21:34.793
will see CDNs switching to use HTTP/3,
00:21:37.846
and HTTP over QUIC,
00:21:39.690
and I think it's likely that they'll
00:21:42.004
also switch to delivering video over QUIC.
00:21:44.318
And I think that gives much more
00:21:46.632
flexibility to change the way QUIC works,
00:21:48.946
to optimise it to support low-latency video.
00:21:51.360
And we’re already, I think, starting to
00:21:54.296
see that happening. YouTube is already delivering
00:21:57.232
video over QUIC.
00:21:58.590
There are people talking about datagram extensions
00:22:01.056
to QUIC in the IETF to get
00:22:03.523
low latency, so I think we’re likely
00:22:05.989
to see the video switching to be
00:22:08.455
delivered by the CDNs using QUIC,
00:22:10.569
but with some QUIC extension to provide
00:22:13.035
lower latency.
00:22:18.120
So that's all I want to say
00:22:22.017
about real-time and interactive applications.
00:22:24.900
The real-time applications have latency bounds.
00:22:28.890
They may be strict latency bounds,
00:22:31.849
150 milliseconds for an interactive application or
00:22:35.302
a video conference, or they may be
00:22:38.755
quite relaxed latency bounds, 10s of seconds
00:22:42.207
for streaming video currently.
00:22:44.280
The interactive applications run over WebRTP,
00:22:47.055
which is the Real-time Transport Protocol,
00:22:49.831
RTP, for the media transport, with a
00:22:53.069
web-based signalling protocol put on top of
00:22:56.307
it. Of they use older standards,
00:22:59.082
such as SIP,
00:23:00.570
the way mobile phones or
00:23:03.390
the telephone network works, these days,
00:23:06.190
to set up the RTP flows.
00:23:09.090
Streaming applications, because they want to fit
00:23:12.027
with the content distribution network infrastructure,
00:23:14.545
because the amount of video traffic is
00:23:17.482
so great that they need the
00:23:20.100
scaling advantages that comes with distribution networks,
00:23:23.328
use an approach known as DASH,
00:23:26.094
Dynamic Adaptive Streaming over HTTP,
00:23:28.500
and deliver the video over HTTP as
00:23:31.185
a series of chunks, with a manifest,
00:23:33.869
and they let the browser choose which
00:23:36.554
chunk sizes to fetch, and use that
00:23:39.239
as a coarse-grained method of adaptation.
00:23:41.640
And this is very scalable, and it
00:23:45.107
makes very good use of the CDN
00:23:48.573
infrastructure to scale out, but it's relatively
00:23:52.040
high latency,
00:23:53.130
and relatively high overhead. And I think
00:23:55.533
the interesting challenge, in the future,
00:23:57.592
is to be combining these two approaches,
00:23:59.995
to try and get the scaling benefits
00:24:02.397
of content distribution networks,
00:24:03.870
and the low-latency benefits of protocols like
00:24:06.486
RTP, and to try and bring this
00:24:09.102
into the video streaming world.
Discussion
Lecture 7 discussed real-time and interactive applications. It discussed
the definition of real-time traffic, and the differing deadlines and
latency requirements for streaming and interactive applications, the
differences in elasticity of traffic demand in real-time and
non-real-time applications, quality of service, and quality of
experience.
Considering interactive conferencing applications, the lecture reviewed
the structure of such applications and briefly described the standard
Internet multimedia conferencing protocol stack. It outlined the
features RTP provides for secure delivery of real-time media, and
highlighted the importance of timing recovery, application level framing,
loss concealment, and forward error correction. It briefly mentioned the
WebRTC peer-to-peer data channel. And it discussed the need for
signalling protocols to setup interactive calls, and briefly outlined how
SIP and WebRTC use SDP to negotiate calls.
Considering streaming applications, the lecture highlighted the role of
content distribution networks to explain why media is delivered over
HTTP. It explained chunked media delivery and the Dynamic Adaptive
Streaming over HTTP (DASH) standard for streaming video, showing how this
adapts the sending rate and how it relates to TCP congestion control. The
lecture also mentioned some sources of latency for DASH-style systems.
Discussion will focus on the essential differences between real-time and
non-real-time applications, timing recovery, and media transport in both
interactive and streaming applications.