WEBVTT

00:00:00.000 --> 00:00:03.440
Welcome to CSE 316 — Data Communication and Networking.

00:00:03.490 --> 00:00:06.740
This is the detailed video version of Session 1.

00:00:06.790 --> 00:00:15.740
This presentation is divided in seven sections, and it is meant to be watched the way you would use a textbook chapter — in pieces, with the pause button.

00:00:17.670 --> 00:00:26.620
There is a checkpoint at the end of each section so you can tell whether to go on or go back.

00:00:27.233 --> 00:00:31.843
Before I start, I want you to picture something completely ordinary.

00:00:31.893 --> 00:00:36.853
Suppose you send a WhatsApp message to the person sitting right next to you.

00:00:36.903 --> 00:00:45.123
How many machines do you think touch that message before it arrives to its destination, which is realistically not more than a meter away?

00:00:45.173 --> 00:00:53.323
Pause the video and commit to a number, better write it down somewhere.

00:00:53.373 --> 00:01:00.593
I will re-visit this question at the end of this lecture and will provide the answer so that you can verify your answer.

00:01:00.643 --> 00:01:03.983
Understand this, whatever the device number that may be —

00:01:04.033 --> 00:01:12.983
each and every one of those devices had to agree with its neighboring devices about what to send, when to send it, and what to do when something is broken.

00:01:14.023 --> 00:01:18.463
In this course our objective is to study and understand these agreements,

00:01:18.513 --> 00:01:19.823
layer by layer,

00:01:19.873 --> 00:01:21.233
for twelve weeks.

00:01:21.283 --> 00:01:26.073
Everything else is detail.

00:01:26.123 --> 00:01:27.483
Section one.

00:01:27.533 --> 00:01:36.483
In this section, I would precisely define three words that we often use loosely —-- because for the next twelve weeks I am going to use them exactly, and so will the exam.

00:01:41.857 --> 00:01:46.057
So let us start with the vocabulary, and let us be careful with it.

00:01:46.107 --> 00:01:52.307
There are three terms here, and in ordinary conversation people use them almost interchangeably.

00:01:52.357 --> 00:01:58.977
In this course they mean three different things, and in an examination you will lose marks for blurring them.

00:01:59.027 --> 00:02:01.257
Telecommunication.

00:02:01.307 --> 00:02:03.727
Communication at a distance.

00:02:03.777 --> 00:02:05.347
Data.

00:02:05.397 --> 00:02:09.807
Information in whatever form the two parties have agreed on.

00:02:09.857 --> 00:02:10.447
And

00:02:10.497 --> 00:02:12.827
data communication.

00:02:12.877 --> 00:02:17.327
The exchange of data between two devices through a transmission medium.

00:02:17.377 --> 00:02:20.547
When you read these ---- they sound almost bland.

00:02:20.597 --> 00:02:21.217
But

00:02:21.267 --> 00:02:22.377
They are not.

00:02:22.427 --> 00:02:26.757
Each one has a word inside it doing far more work than it appears to.

00:02:26.807 --> 00:02:32.533
So I am going to talk about each of them a little bit more.

00:02:32.583 --> 00:02:34.693
Telecommunication first.

00:02:34.743 --> 00:02:36.833
'Tele' in Greek means far.

00:02:36.883 --> 00:02:38.433
That is all it means.

00:02:38.483 --> 00:02:42.843
Put it in front of anything and you get that thing, at a distance.

00:02:42.893 --> 00:02:43.913
Telephone.

00:02:43.963 --> 00:02:45.783
Sound, at a distance.

00:02:45.833 --> 00:02:46.843
Television.

00:02:46.893 --> 00:02:48.783
Sight, at a distance.

00:02:48.833 --> 00:02:49.943
Telegraph.

00:02:49.993 --> 00:02:51.893
Writing, at a distance.

00:02:51.943 --> 00:02:56.053
So telecommunication is simply communication at a distance.

00:02:56.103 --> 00:02:58.823
Now notice what the definition does not say.

00:02:58.873 --> 00:03:04.163
It says nothing about electricity, nothing about computers, nothing about bits.

00:03:04.213 --> 00:03:07.623
Which means the test is distance, not technology.

00:03:07.673 --> 00:03:10.383
A smoke signal is telecommunication.

00:03:10.433 --> 00:03:13.473
A ship's signal flags are telecommunication.

00:03:13.523 --> 00:03:22.473
A chain of signal fires along the Great Wall of China, three thousand years ago, was telecommunication.

00:03:23.683 --> 00:03:25.433
Look at the timeline on the right.

00:03:25.483 --> 00:03:31.533
Chappe's  optical telegraph carried messages from Paris to Lille in 1794.

00:03:31.583 --> 00:03:34.903
Morse's  electric telegraph in 1844.

00:03:34.953 --> 00:03:37.123
The telephone by Bell in 1876.

00:03:37.173 --> 00:03:42.063
ARPANET, the first packet network and the direct ancestor of the internet, in 1969.

00:03:42.113 --> 00:03:48.463
And today, you sending whatsapp message to the person sitting beside you.

00:03:48.513 --> 00:03:54.913
Understand this, telecommunication is the umbrella — it is enormous and it is ancient.

00:03:54.963 --> 00:04:01.373
Data communication is one branch of it: the branch where the things at each end are machines.

00:04:01.423 --> 00:04:09.286
This branch is barely eighty years old, and it is the one this course will cover.

00:04:09.336 --> 00:04:10.866
Now the second word.

00:04:10.916 --> 00:04:11.756
Data.

00:04:11.806 --> 00:04:16.726
Data ---- is information in whatever form the two parties have agreed on.

00:04:16.776 --> 00:04:23.316
Students often read this and disregard the part where it says ---- "the two parties have agreed on".

00:04:23.366 --> 00:04:24.666
Do not do that.

00:04:24.716 --> 00:04:26.876
This is of utmost importance.

00:04:26.926 --> 00:04:29.256
Checkout this demonstration.

00:04:29.306 --> 00:04:35.406
On the left, there are eight bits: zero, one, zero, zero, zero, zero, zero, one.

00:04:35.456 --> 00:04:44.176
That is what is physically on the wire ----— eight voltage levels, or eight pulses of light.

00:04:44.226 --> 00:04:45.726
Nothing more.

00:04:45.776 --> 00:04:50.866
If you and I agreed in advance to use ASCII, those eight bits are the letter "A".

00:04:50.916 --> 00:04:56.306
Open the file in a text editor and you see a letter.

00:04:56.356 --> 00:05:04.796
If we agreed instead that this is an "eight"-bit integer, the very same bits are the number "sixty-five".

00:05:04.846 --> 00:05:06.836
Now arithmetic works on it.

00:05:06.886 --> 00:05:09.836
Add one and you get "sixty-six".

00:05:09.886 --> 00:05:13.546
And if we agreed it is one pixel of a greyscale image,

00:05:13.596 --> 00:05:21.766
the same bits are a dark -- grey -- dot --— "sixty-five" out of a possible "two hundred and fifty-five".

00:05:21.816 --> 00:05:25.336
Nothing on the wire changed between those three readings.

00:05:25.386 --> 00:05:26.876
Not one voltage.

00:05:26.926 --> 00:05:29.196
What changed was the agreement.

00:05:29.246 --> 00:05:32.326
And now the case that matters most.

00:05:32.376 --> 00:05:35.856
If we agreed on nothing at all, then it is not data.

00:05:35.906 --> 00:05:42.116
Then it is just noise —--- eight bits nobody can read, sitting in a file no program will open.

00:05:42.166 --> 00:05:51.116
That is why the word to underline here is 'agreed', and it is your first glimpse of something you will see again and again in this course.

00:05:53.369 --> 00:05:56.719
Now the third definition --- Data communication

00:05:56.769 --> 00:06:02.789
Data communication is the exchange of data between two devices through a transmission medium.

00:06:02.839 --> 00:06:09.829
Four words are carrying all the weight here, and all of them are of great importance for data communication.

00:06:09.879 --> 00:06:12.999
The First word --- "Exchange".

00:06:13.049 --> 00:06:16.729
Data passes or gets transferred between two parties.

00:06:16.779 --> 00:06:20.399
Data exchange can be both uni and bi-directional.

00:06:20.449 --> 00:06:25.509
An example of uni-directional exchange of data is through ---- television.

00:06:25.559 --> 00:06:30.779
An example of bi-directional exchange of data is through ---- telephone.

00:06:30.829 --> 00:06:33.979
The Second word is --- "Data".

00:06:34.029 --> 00:06:35.299
Agreed form.

00:06:35.349 --> 00:06:37.699
Exactly as we just established.

00:06:37.749 --> 00:06:41.339
Without the agreement there is nothing to exchange.

00:06:41.389 --> 00:06:44.499
The Third word --- "Devices".

00:06:44.549 --> 00:06:53.499
Communicating devices must be a part of a communication system ---- made up of a combination of "hardware", like, physical equipment and "software", like programs.

00:06:56.379 --> 00:06:59.849
And the fourth word is --- "medium".

00:06:59.899 --> 00:07:07.099
Transmission medium such as a wire --like copper cable, optical fiber or wireless-- like wi-fi, bluetooth etc.

00:07:07.149 --> 00:07:15.959
After going through the presentation  till now, do you think ---- this lecture is data communication?

00:07:16.009 --> 00:07:17.309
Yes, it is.

00:07:17.359 --> 00:07:25.539
However, if the recording is taken away it is not — no devices, no medium carrying an agreed representation.

00:07:25.589 --> 00:07:33.279
Now, again, add a camera and a network in between us ---- This will again be considered as data communication.

00:07:33.329 --> 00:07:38.439
Remember, definitions in this course are tools you pick up and use on a case.

00:07:38.489 --> 00:07:44.231
No need to memorize and recite them back to me.

00:07:44.281 --> 00:07:46.521
We have reached our first checkpoint.

00:07:46.571 --> 00:07:51.651
Pause the video and answer these three on paper, without scrolling back.

00:07:51.701 --> 00:07:53.281
One.

00:07:53.331 --> 00:07:55.831
Is a smoke signal telecommunication?

00:07:55.881 --> 00:07:56.481
And

00:07:56.531 --> 00:07:58.671
Is it data communication?

00:07:58.721 --> 00:08:00.271
Two.

00:08:00.321 --> 00:08:03.231
The same eight bits meant three different things.

00:08:03.281 --> 00:08:05.121
What decides which?

00:08:05.171 --> 00:08:06.731
Three.

00:08:06.781 --> 00:08:12.281
A keyboard sends characters to a computer, and the computer never sends anything back.

00:08:12.331 --> 00:08:16.771
Is that data communication?

00:08:16.821 --> 00:08:21.981
Pause now.

00:08:22.031 --> 00:08:29.281
Answers to the first question ---- yes to telecommunication ----— But no to data communication.

00:08:29.331 --> 00:08:38.281
Smoke signal is telecommunication because it is communication at a distance, and the definition of telecommunication says nothing about technology.

00:08:38.491 --> 00:08:47.441
On the other hand, data communication requires communicating devices, data exchange, transmission medium and agreed form of data ---—

00:08:47.651 --> 00:08:53.871
in this case there are no devices, and nothing is exchanged in an agreed machine-readable form.

00:08:53.921 --> 00:08:59.351
Answer to the second question ----  the agreement between the two ends, and nothing else.

00:08:59.401 --> 00:09:05.681
The bits on the wire were identical in all three readings, agreement makes all the difference

00:09:05.731 --> 00:09:11.531
And answer to the third question is: yes. This is data communication.

00:09:11.581 --> 00:09:20.531
'Exchange' means the data passes between two devices through a medium; it does not have to be both directions.

00:09:21.021 --> 00:09:22.411
Section two.

00:09:22.461 --> 00:09:25.391
So we now know what a data communication is.

00:09:25.441 --> 00:09:28.211
Now the question is — what makes it good?

00:09:28.261 --> 00:09:31.151
There are four fundamental characteristics.

00:09:31.201 --> 00:09:35.121
Three of them most of you could probably figure out by yourselves.

00:09:35.171 --> 00:09:41.760
However the fourth one would be a new term for most of you.

00:09:41.810 --> 00:09:47.780
The effectiveness of a data communications system depends on four fundamental characteristics:

00:09:47.830 --> 00:09:48.720
delivery,

00:09:48.770 --> 00:09:49.790
accuracy,

00:09:49.840 --> 00:09:50.810
timeliness,

00:09:50.860 --> 00:09:52.250
and jitter.

00:09:52.300 --> 00:09:57.080
Delivery --- Data must reach the right destination.

00:09:57.130 --> 00:10:01.520
Accuracy --- Data must arrive unaltered.

00:10:01.570 --> 00:10:07.190
Timeliness --- Data must be delivered in a timely manner.

00:10:07.240 --> 00:10:16.190
Jitter --- Jitter refers to the variation in the data packet arrival time. Variation in the data packet arrival time must be low — that means low jitter.

00:10:18.320 --> 00:10:22.800
Note that, all four characteristics are examinable.

00:10:22.850 --> 00:10:30.990
Although the last two characteristics, timeliness and jitter, both deal with data delivery time, they are quite different from each other.

00:10:31.040 --> 00:10:36.456
The next couple of slides will make that clear.

00:10:36.506 --> 00:10:40.256
Delivery must satisfy its two-fold requirement.

00:10:40.306 --> 00:10:46.136
The obvious requirement is that the data must reach its intended destination.

00:10:46.186 --> 00:10:49.806
Data that never reaches the destination has failed.

00:10:49.856 --> 00:10:53.936
There is another requirement which students often forget.

00:10:53.986 --> 00:11:00.676
Delivery means the data reaches the intended destination — and only the intended destination.

00:11:00.726 --> 00:11:06.116
Arriving somewhere extra is also a failure — a major security breach.

00:11:06.166 --> 00:11:10.166
Suppose, your bank sends a one-time password.

00:11:10.216 --> 00:11:15.326
It arrives in under a second, every digit intact, at your neighbor's phone.

00:11:15.376 --> 00:11:21.976
Grade that delivery: it was fast, it was accurate, it was on time — and it was a catastrophe.

00:11:22.026 --> 00:11:30.734
Delivery is about the destination, and the destination is part of the correctness of the system.

00:11:30.784 --> 00:11:32.004
Accuracy.

00:11:32.054 --> 00:11:37.894
Data that was changed on the way and left uncorrected is worse than data that never arrived.

00:11:37.944 --> 00:11:40.354
It is worse because you will act on it.

00:11:40.404 --> 00:11:42.754
Missing data announces itself.

00:11:42.804 --> 00:11:44.744
Wrong data does not.

00:11:44.794 --> 00:11:47.534
Look at the example on the left.

00:11:47.584 --> 00:11:53.094
We send the byte zero-zero-one-one-zero-one-one-zero, which is fifty-four.

00:11:53.144 --> 00:12:02.094
One single bit flips in transit — the fourth from the left — and what arrives is zero-zero-one-one-one-one-one-zero, which is sixty-two.

00:12:02.774 --> 00:12:04.564
One bit.

00:12:04.614 --> 00:12:06.734
Not one digit — one bit.

00:12:06.784 --> 00:12:10.034
And the result is still a perfectly valid number.

00:12:10.084 --> 00:12:18.774
If that were part of an account number, it is now a different account that genuinely exists, and every check a human would make still passes.

00:12:18.824 --> 00:12:23.684
This is why 'ninety percent correct' is a meaningless phrase here.

00:12:23.734 --> 00:12:26.964
A file that is 99.99 percent correct is not 99.99 percent useful.

00:12:27.014 --> 00:12:30.334
One flipped bit in an executable is a crash.

00:12:30.384 --> 00:12:33.784
In a bank record it is somebody else's money.

00:12:33.834 --> 00:12:36.544
In a medical dosage it is a different dose.

00:12:36.594 --> 00:12:40.644
Understand this, accuracy is not a percentage you tolerate.

00:12:40.694 --> 00:12:44.474
It is a property you either guarantee, or detect the loss of.

00:12:44.524 --> 00:12:48.364
So what does a real network actually promise?

00:12:48.414 --> 00:12:53.614
Not that bits never flip — they do, constantly, on every real medium.

00:12:53.664 --> 00:12:59.774
The promise is that flips are detected, and then either corrected or reported.

00:12:59.824 --> 00:13:08.774
That machinery is called error detection and correction - which is out of the scope of this course. You will learn it if you go for higher studies in Communications Network.

00:13:12.714 --> 00:13:17.064
Note the shape of that answer: the network does not prevent the problem.

00:13:17.114 --> 00:13:21.150
It manages it.

00:13:21.200 --> 00:13:22.430
Timeliness.

00:13:22.480 --> 00:13:28.740
Late data can be dead data — and whether it is depends entirely on what kind of data it is.

00:13:28.790 --> 00:13:35.190
For a file, an email, a photograph, arriving a minute later costs you nothing.

00:13:35.240 --> 00:13:40.380
You wait, and then you have it, whole and correct.

00:13:40.430 --> 00:13:46.490
For a voice, a video call, live audio — arriving a minute later is not late data.

00:13:46.540 --> 00:13:47.860
It is no data.

00:13:47.910 --> 00:13:56.600
The moment it belonged to is gone, and a flawless recording of a conversation that reaches you an hour afterwards is not a conversation at all.

00:13:56.650 --> 00:14:01.620
That second category is what we mean by real time, and note this carefully.

00:14:01.670 --> 00:14:03.830
Real time does not mean fast.

00:14:03.880 --> 00:14:12.830
It means arriving in the order it was sent, with no significant delay — where 'significant' is defined by the application, not by the network.

00:14:13.820 --> 00:14:15.830
Look at the numbers underneath.

00:14:15.880 --> 00:14:24.470
For one-way voice, about one hundred and fifty milliseconds is the point below which a conversation still feels natural.

00:14:24.520 --> 00:14:32.290
Four hundred milliseconds is the ceiling — beyond that people start talking over each other, and you have all experienced that call.

00:14:32.340 --> 00:14:36.630
For a web interface, under one hundred milliseconds feels instant.

00:14:36.680 --> 00:14:43.270
For industrial control — a robot arm on a production line — the budget is around ten milliseconds.

00:14:43.320 --> 00:14:52.270
These are real engineering budgets, and they are why the same network cannot be designed once and used for everything.

00:14:53.382 --> 00:14:54.882
And now the fourth one.

00:14:54.932 --> 00:14:59.962
This is the term most of you have not heard before, so it gets a picture.

00:15:00.012 --> 00:15:03.822
Look at the two rows of numbers on the left.

00:15:03.872 --> 00:15:09.102
In the first row, eight video packets arrive evenly — one every thirty milliseconds.

00:15:09.152 --> 00:15:12.702
Thirty, thirty, thirty, all the way across.

00:15:12.752 --> 00:15:14.922
That plays back perfectly smoothly.

00:15:14.972 --> 00:15:23.922
In the second row, exactly the same eight packets arrive over exactly the same journey, but unevenly: thirty, thirty, thirty-nine, twenty-one, twenty-one, thirty-nine, thirty.

00:15:26.572 --> 00:15:32.072
So here is a fair question, and I want you to answer it before I do.

00:15:32.122 --> 00:15:33.902
Is the second network slower?

00:15:33.952 --> 00:15:35.122
Add the gaps up.

00:15:35.172 --> 00:15:38.562
The first row spans two hundred and ten milliseconds.

00:15:38.612 --> 00:15:42.572
The second row also spans two hundred and ten milliseconds.

00:15:42.622 --> 00:15:49.282
Identical totals — and therefore an identical average delay.

00:15:49.332 --> 00:15:58.282
Gap three ran nine milliseconds long, so packet four arrived nine milliseconds late; gap four ran nine milliseconds short and put packet five back on time; gap five ran short again, so packet six arrived nine milliseconds early; and gap six ran long, putting packet seven back on time.

00:16:07.092 --> 00:16:07.922
So no.

00:16:07.972 --> 00:16:10.252
The second network is not slower.

00:16:10.302 --> 00:16:11.442
It is uneven.

00:16:11.492 --> 00:16:16.872
And that unevenness has a name of its own — jitter — and its own kind of failure.

00:16:16.922 --> 00:16:21.492
Now watch the animation to see the same thing in motion.

00:16:21.542 --> 00:16:28.022
For video, jitter looks like this: the picture freezes, and then sprints to catch up.

00:16:28.072 --> 00:16:31.132
Your eye will forgive a video that starts a second late.

00:16:31.182 --> 00:16:33.442
It will not forgive one that stutters.

00:16:33.492 --> 00:16:42.442
Same average delay, completely different experience — which is exactly why jitter needs a separate name from delay, and why it is on the exam.

00:17:12.239 --> 00:17:18.469
Before we leave jitter, here is the whole idea on one screen, with one slider.

00:17:18.519 --> 00:17:20.739
Three rows, one clock.

00:17:20.789 --> 00:17:27.809
The top row is what the sender did: eight frames, one every thirty milliseconds, perfectly even.

00:17:27.859 --> 00:17:30.429
The middle row is what the network delivered.

00:17:30.479 --> 00:17:33.819
And the bottom row is what the viewer actually sees.

00:17:33.869 --> 00:17:42.419
Right now the network is quiet, so the middle row is as even as the top row, and the bottom row is smooth without my doing anything.

00:17:42.469 --> 00:17:50.289
Now a normal network. Same eight frames, same average delay — only the evenness has changed.

00:17:50.339 --> 00:17:54.399
Look at the middle row: some frames dawdle, some catch up.

00:17:54.449 --> 00:18:02.489
And look what that does to the bottom row. Five times, the moment to show a frame arrives and the frame is not there yet.

00:18:02.539 --> 00:18:08.449
The player has nothing to put on the screen, so it holds the last picture. That is the freeze.

00:18:08.499 --> 00:18:14.969
Nothing was lost. Nothing was slow on average. The frames simply arrived unevenly.

00:18:15.019 --> 00:18:19.829
So here is the fix, and I want you to watch exactly what it does.

00:18:19.879 --> 00:18:25.399
I am going to wait before I show the first frame. Just wait. Eighteen milliseconds.

00:18:25.449 --> 00:18:29.359
Watch the bottom row slide to the right — and then even out.

00:18:29.409 --> 00:18:33.039
Every gap is now exactly thirty milliseconds. Zero freezes.

00:18:33.089 --> 00:18:41.399
Nothing about the network changed. The middle row is identical. I only moved the starting line.

00:18:41.449 --> 00:18:44.769
And this is the sentence I want you to leave with.

00:18:44.819 --> 00:18:52.039
By delaying the whole stream once, at the beginning, I bought perfectly even playback for every frame after it.

00:18:52.089 --> 00:19:00.879
The bill is on the left: eighteen milliseconds of extra delay, on everything the viewer sees, including the frames that were never late.

00:19:00.929 --> 00:19:09.879
Read the rule on the right, because it is the whole subject in one line: the buffer works when it is at least as long as the worst lateness in the stream.

00:19:10.769 --> 00:19:18.749
And more is not better. Push the buffer to thirty-eight and the playback is exactly as smooth as it was at eighteen.

00:19:18.799 --> 00:19:24.899
You did not buy anything with that extra twenty milliseconds. You just made the viewer wait longer.

00:19:24.949 --> 00:19:32.919
Switch to a congested network, where frames arrive in clumps, and the worst lateness goes up to thirty.

00:19:32.969 --> 00:19:39.869
So the buffer has to go up to thirty too — and the viewer pays thirty milliseconds instead of eighteen.

00:19:39.919 --> 00:19:48.869
Worse jitter, bigger buffer, more delay. There is no setting in this tool, and none on any real network, where you get even playback for free.

00:19:49.189 --> 00:19:58.043
Open it after the lecture and try to find one. You will not, and understanding why is the point.

00:19:58.093 --> 00:19:59.653
Second checkpoint.

00:19:59.703 --> 00:20:04.253
Same rule — pause, paper, no scrolling back.

00:20:04.303 --> 00:20:05.893
One.

00:20:05.943 --> 00:20:08.633
A file arrives with two bits flipped.

00:20:08.683 --> 00:20:14.003
Which characteristic failed — and, just as important, which two did not?

00:20:14.053 --> 00:20:15.583
Two.

00:20:15.633 --> 00:20:21.663
A video call is perfectly smooth, but every word lands two seconds after it was spoken.

00:20:21.713 --> 00:20:23.933
Which characteristic failed?

00:20:23.983 --> 00:20:25.543
Three.

00:20:25.593 --> 00:20:30.263
Your OTP arrives instantly, intact, on your neighbor's phone.

00:20:30.313 --> 00:20:34.753
Which characteristic failed?

00:20:34.803 --> 00:20:39.963
Pause now.

00:20:40.013 --> 00:20:41.823
Answers.

00:20:41.873 --> 00:20:45.373
The first is accuracy — and notice what did not fail.

00:20:45.423 --> 00:20:47.863
It was delivered, and it was on time.

00:20:47.913 --> 00:20:49.853
Only accuracy went wrong.

00:20:49.903 --> 00:20:51.853
The second is timeliness.

00:20:51.903 --> 00:21:00.783
Perfectly steady, so jitter is fine — but two seconds is far outside the four-hundred-millisecond ceiling, and the conversation collapses.

00:21:00.833 --> 00:21:02.863
And the third is delivery.

00:21:02.913 --> 00:21:11.345
Every other characteristic was met perfectly, which is exactly what makes it dangerous.

00:21:11.395 --> 00:21:12.855
Section three.

00:21:12.905 --> 00:21:21.855
Every data communication ever built has exactly five parts — and the fifth one is what this course is really about.

00:21:23.428 --> 00:21:29.178
Here is the whole thing in one diagram, and I am going to build it piece by piece.

00:21:29.228 --> 00:21:31.668
First, the sender.

00:21:31.718 --> 00:21:34.058
The device that transmits.

00:21:34.108 --> 00:21:36.068
The receiver.

00:21:36.118 --> 00:21:38.538
The device that takes delivery.

00:21:38.588 --> 00:21:45.048
Between them, the transmission medium — the physical path the data travels on.

00:21:45.098 --> 00:21:47.128
And the message.

00:21:47.178 --> 00:21:52.138
The information itself — text, numbers, an image, audio, video.

00:21:52.188 --> 00:22:00.378
Sections four and five of this session are entirely about how each of those becomes something a wire can carry.

00:22:00.428 --> 00:22:06.048
Four parts so far, and you could have written all four down yourself before this video started.

00:22:06.098 --> 00:22:08.408
And now the fifth, "Protocols"

00:22:08.458 --> 00:22:14.918
Now, look carefully at where I have put it. Not in the middle.

00:22:14.968 --> 00:22:15.628
At both ends.

00:22:15.678 --> 00:22:24.628
The protocol is the set of rules that both devices have agreed to follow, and it has to be held identically at each end — the same rules on both sides.

00:22:25.738 --> 00:22:29.058
That placement is the entire slide.

00:22:29.108 --> 00:22:32.918
A protocol held by one side only is not a protocol.

00:22:32.968 --> 00:22:37.145
It is a monologue.

00:22:37.195 --> 00:22:39.915
Let me take the first three quickly.

00:22:39.965 --> 00:22:48.915
The message is the information itself, and it comes in exactly five forms: text, numbers, images, audio and video.

00:22:49.735 --> 00:22:52.355
You will see all five again shortly.

00:22:52.405 --> 00:22:56.855
The sender is the device that transmits — a computer, a phone, a camera, a sensor.

00:22:56.905 --> 00:22:59.685
Note the word device.

00:22:59.735 --> 00:23:01.355
You are not the sender.

00:23:01.405 --> 00:23:02.895
Your phone is.

00:23:02.945 --> 00:23:11.305
That distinction sounds pedantic until something goes wrong and you have to say precisely which component failed.

00:23:11.355 --> 00:23:15.065
The receiver is the device that takes delivery.

00:23:15.115 --> 00:23:19.775
Almost same list as transmitter --— and it has to be ready to receive.

00:23:19.825 --> 00:23:27.335
A receiver that is switched off is not a receiver; it is a reason your message failed the very first characteristic.

00:23:27.385 --> 00:23:30.505
One thing to note before we move on.

00:23:30.555 --> 00:23:34.105
Sender and receiver are roles, not devices.

00:23:34.155 --> 00:23:41.555
In almost every real communication both ends do both jobs, swapping roles thousands of times a second.

00:23:41.605 --> 00:23:50.555
When I say 'the sender' I mean whichever end is transmitting this particular message — a habit worth forming now, because in section six the entire question becomes which end is allowed to be the sender, and when.

00:23:58.061 --> 00:24:01.201
The fourth component: the transmission medium.

00:24:01.251 --> 00:24:06.371
Something physical has to carry the signal, and media come in two families.

00:24:06.421 --> 00:24:10.371
Guided media confine the signal to a path.

00:24:10.421 --> 00:24:14.791
Twisted pair — the cable behind every wall network socket.

00:24:14.841 --> 00:24:19.611
Coaxial cable — older cable television and some backbone links.

00:24:19.661 --> 00:24:26.401
And optical fiber — glass carrying light, which is what makes intercontinental traffic possible.

00:24:26.451 --> 00:24:30.971
Unguided media broadcast the signal into space.

00:24:31.021 --> 00:24:35.431
Radio — which covers Wi-Fi, mobile data and Bluetooth.

00:24:35.481 --> 00:24:39.481
Microwave — for point-to-point links and satellite hops.

00:24:39.531 --> 00:24:42.821
And infrared — your television remote.

00:24:42.871 --> 00:24:47.641
Now, why does this matter more than a list of cables suggests?

00:24:47.691 --> 00:24:53.631
Because the medium is where physics enters this subject, and physics does not negotiate.

00:24:53.681 --> 00:24:58.351
Every medium attenuates the signal — it gets weaker with distance.

00:24:58.401 --> 00:25:00.541
Every medium adds noise.

00:25:00.591 --> 00:25:08.841
And every medium imposes a hard ceiling on how many bits per second it can carry, no matter how clever your engineering is.

00:25:08.891 --> 00:25:17.841
We will spend real time putting numbers on exactly that in the coming weeks, and the answer — Shannon's limit — is one of the very few genuinely unbreakable results in engineering.

00:25:19.921 --> 00:25:21.451
Not 'hard to beat'.

00:25:21.501 --> 00:25:25.700
Cannot be beaten.

00:25:25.750 --> 00:25:29.060
And now the fifth component, which is the strange one.

00:25:29.110 --> 00:25:31.130
A protocol is an agreement.

00:25:31.180 --> 00:25:36.160
Not a program, not a piece of software, not a device on the diagram.

00:25:36.210 --> 00:25:37.440
An agreement.

00:25:37.490 --> 00:25:39.740
Here is the demonstration.

00:25:39.790 --> 00:25:44.640
Suppose a French speaker and a Japanese speaker alone in a room.

00:25:44.690 --> 00:25:49.750
Now grade the communication against the four characteristics we just studied.

00:25:49.800 --> 00:25:50.840
Delivery?

00:25:50.890 --> 00:25:55.160
Perfect — the sound reaches the right person and nobody else.

00:25:55.210 --> 00:25:56.370
Accuracy?

00:25:56.420 --> 00:26:00.530
Perfect — every syllable arrives exactly as it was produced.

00:26:00.580 --> 00:26:01.770
Timeliness?

00:26:01.820 --> 00:26:02.910
Immediate.

00:26:02.960 --> 00:26:03.830
Jitter?

00:26:03.880 --> 00:26:04.890
None at all.

00:26:04.940 --> 00:26:10.980
All four characteristics are met flawlessly, and nothing whatsoever is communicated.

00:26:11.030 --> 00:26:13.060
So what is missing?

00:26:13.110 --> 00:26:16.930
What is missing is a shared set of rules about what the sounds mean.

00:26:16.980 --> 00:26:24.040
That is what a protocol is, and that is why it counts as a component of the system rather than an optional extra.

00:26:24.090 --> 00:26:28.960
Hold on to this, because it generalizes further than it looks.

00:26:29.010 --> 00:26:35.340
Almost every hard problem in the rest of this course is an agreement problem wearing a technical costume.

00:26:35.390 --> 00:26:40.570
When something does not work, the useful first question is rarely 'is the cable bad?'.

00:26:40.620 --> 00:26:46.493
It is 'do both ends believe the same thing?'

00:26:46.543 --> 00:26:51.483
So if a protocol is an agreement, what exactly does it have to agree about?

00:26:51.533 --> 00:26:56.983
There are three things, and every protocol you will ever meet settles all three.

00:26:57.033 --> 00:27:00.133
Syntax — what the bits look like.

00:27:00.183 --> 00:27:02.073
The format and the order.

00:27:02.123 --> 00:27:06.923
Which bits are the address, which are the payload, how long each field is.

00:27:06.973 --> 00:27:15.883
Get this wrong and the receiver reads the right bits in the wrong places, which produces confident nonsense rather than an obvious error.

00:27:15.933 --> 00:27:18.923
Semantics — what the bits mean.

00:27:18.973 --> 00:27:23.793
What each field is for, and what action to take when you see it.

00:27:23.843 --> 00:27:30.543
Remember the eight bits from earlier: the letter A or the number sixty-five, depending on nothing but this.

00:27:30.593 --> 00:27:34.653
And timing — when to send, and how fast.

00:27:34.703 --> 00:27:38.403
When a device is allowed to transmit, and at what rate.

00:27:38.453 --> 00:27:47.403
A sender that transmits at one gigabit per second to a receiver that can absorb one megabit has obeyed syntax and semantics perfectly, and lost almost everything.

00:27:49.263 --> 00:27:56.483
Learn these three as a checklist you can apply to any protocol, in this course or long after it.

00:27:56.533 --> 00:28:05.483
When we study Ethernet, IP, TCP and HTTP in the coming weeks, every one of them is nothing more than a specific set of answers to these same three questions.

00:28:11.489 --> 00:28:16.179
Let me prove that claim with two protocols seventy years apart.

00:28:16.229 --> 00:28:22.799
First, the walkie-talkie, and the question: why does everyone using one say 'over'?

00:28:22.849 --> 00:28:26.459
Syntax: speech, followed by one agreed word.

00:28:26.509 --> 00:28:32.589
Semantics: 'over' means I have stopped transmitting, the channel is now yours.

00:28:32.639 --> 00:28:36.839
Timing: exactly one of us transmits at a time, and the other waits.

00:28:36.889 --> 00:28:40.669
That word is not decoration and it is not film dialogue.

00:28:40.719 --> 00:28:42.649
It is the entire protocol.

00:28:42.699 --> 00:28:49.839
Remove it and the channel collapses into two people talking over each other, and nobody receives anything.

00:28:49.889 --> 00:28:55.319
Now a web request — the thing your browser does hundreds of times a minute.

00:28:55.369 --> 00:29:02.719
Syntax: a method, a path, a version, then headers, then a blank line, then the body.

00:29:02.769 --> 00:29:04.679
In that order, always.

00:29:04.729 --> 00:29:09.039
Semantics: 'GET' means send me this and change nothing.

00:29:09.089 --> 00:29:11.549
'404' means I do not have it.

00:29:11.599 --> 00:29:15.689
Every code and every header has an agreed meaning.

00:29:15.739 --> 00:29:23.199
Timing: the client asks first, the server answers, and the connection either stays open or closes — by agreement.

00:29:23.249 --> 00:29:29.759
Seventy years apart, entirely different technology, and the shape of the answer has not changed at all.

00:29:29.809 --> 00:29:38.527
That is the pattern to carry through this whole course: new protocol, same three questions.

00:29:39.057 --> 00:29:45.427
I have just claimed that a protocol settles three things, and that all three have to hold.

00:29:45.477 --> 00:29:48.287
Here is that claim, made breakable.

00:29:48.337 --> 00:29:54.957
Device A on the left, device B on the right, and between them a perfect copper pair.

00:29:55.007 --> 00:29:57.007
Perfect is the important word.

00:29:57.057 --> 00:30:05.967
This wire never loses a bit, never flips one, and never delays one — which is more than any real medium will ever give you.

00:30:06.017 --> 00:30:13.067
Each side has three settings: the character code, the frame delimiter, and the bit rate.

00:30:13.117 --> 00:30:19.707
Right now they match, and the panel on the right shows three green ticks.

00:30:19.757 --> 00:30:27.097
Send, and B prints exactly what A meant: HELLO IUB, CSE 316 ভালো, in English and in Bangla.

00:30:27.147 --> 00:30:35.607
Thirty-one bytes, two hundred and forty-eight bits, twenty-five point eight milliseconds on the line, and zero bits lost.

00:30:35.657 --> 00:30:42.457
Now I break exactly one thing — the character code — and send the identical message again.

00:30:42.507 --> 00:30:43.987
Look at what B printed.

00:30:44.037 --> 00:30:45.947
The wire still lost nothing.

00:30:45.997 --> 00:30:51.077
Every one of those two hundred and forty-eight bits arrived, in order, on time.

00:30:51.127 --> 00:30:57.207
B simply read them against the wrong agreement, and produced confident nonsense rather than an error.

00:30:57.257 --> 00:30:59.757
That is syntax, failing.

00:30:59.807 --> 00:31:03.807
Put the code back and break the delimiter instead.

00:31:03.857 --> 00:31:08.187
Now B cannot tell where one message ends and the next begins.

00:31:08.237 --> 00:31:13.917
The bits are perfect and the boundaries are gone, so the frames run into each other.

00:31:13.967 --> 00:31:17.247
And finally, break only the rate.

00:31:17.297 --> 00:31:25.647
A transmits at one speed and B samples at another, so B reads the line at the wrong instants and gets bits that were never sent.

00:31:25.697 --> 00:31:32.347
That is timing, failing — and notice that neither side did anything wrong except disagree.

00:31:32.397 --> 00:31:38.257
Three failures, three completely different symptoms, and one thing in common.

00:31:38.307 --> 00:31:44.597
In every single case the wire delivered every bit perfectly, and the communication still died.

00:31:44.647 --> 00:31:52.637
That is the difference between being connected and communicating, and it is why a protocol is not an optional extra on top of a network.

00:31:52.687 --> 00:31:59.009
It is the thing that makes the network mean anything at all.

00:31:59.059 --> 00:32:00.549
Third checkpoint.

00:32:00.599 --> 00:32:02.779
Pause and answer on paper.

00:32:02.829 --> 00:32:04.419
One.

00:32:04.469 --> 00:32:08.039
Name the five components of a data communication.

00:32:08.089 --> 00:32:09.619
Two.

00:32:09.669 --> 00:32:13.839
A sender transmits far faster than the receiver can absorb.

00:32:13.889 --> 00:32:17.769
Which of syntax, semantics and timing was broken?

00:32:17.819 --> 00:32:19.379
Three.

00:32:19.429 --> 00:32:24.139
Two devices are connected by a perfect cable and nothing is communicated.

00:32:24.189 --> 00:32:29.959
Give one reason that has nothing to do with the cable.

00:32:30.009 --> 00:32:35.169
Pause now.

00:32:35.219 --> 00:32:37.029
Answers.

00:32:37.079 --> 00:32:41.629
One — message, sender, receiver, transmission medium, protocol.

00:32:41.679 --> 00:32:48.839
If you missed one, it was almost certainly the protocol, which rather proves the point of this section.

00:32:48.889 --> 00:32:50.249
Two — timing.

00:32:50.299 --> 00:32:57.489
The bits were formatted correctly and they meant the right things; they simply arrived faster than they could be taken in.

00:32:57.539 --> 00:33:00.659
Three — the two ends do not share a protocol.

00:33:00.709 --> 00:33:05.849
No agreement on the code, or the format, or on when each of them may speak.

00:33:05.899 --> 00:33:13.143
The French speaker and the Japanese speaker, in whatever form you prefer.

00:33:13.193 --> 00:33:14.923
Section four.

00:33:14.973 --> 00:33:16.573
Bits are bits.

00:33:16.623 --> 00:33:21.163
This is the basic principle this whole course is based on.

00:33:21.213 --> 00:33:30.163
Text, numbers and images all end up in the same place — and I am going to walk each of them there, one route at a time.

00:33:33.326 --> 00:33:35.706
Here is the claim.

00:33:35.756 --> 00:33:39.536
Text — a letter, a word, a page.

00:33:39.586 --> 00:33:44.706
Numbers — quantities you will actually compute with.

00:33:44.756 --> 00:33:48.786
Images — photographs, diagrams, scans.

00:33:48.836 --> 00:33:53.646
Audio — speech, music, any sound at all.

00:33:53.696 --> 00:33:56.796
And video — moving pictures.

00:33:56.846 --> 00:33:59.766
Five completely different kinds of information.

00:33:59.816 --> 00:34:03.146
And exactly one representation between them.

00:34:03.196 --> 00:34:07.706
All five become bit patterns, and nothing else.

00:34:07.756 --> 00:34:12.506
Now, the network never knows which of the five it is carrying.

00:34:12.556 --> 00:34:16.376
That sounds like a weakness, and it is precisely the opposite.

00:34:16.426 --> 00:34:23.906
It is why one network can carry your voice, your photographs and your bank balance without being redesigned for each of them.

00:34:23.956 --> 00:34:32.906
And it is why anything invented tomorrow — some kind of information nobody has thought of yet — will travel over exactly the same wires, provided somebody agrees how to turn it into bits.

00:34:35.706 --> 00:34:42.627
The next few slides show you the route each of the five takes.

00:34:42.677 --> 00:34:43.717
Text.

00:34:43.767 --> 00:34:45.967
A wire cannot carry a letter.

00:34:46.017 --> 00:34:47.527
It can carry a number.

00:34:47.577 --> 00:34:53.427
So the two ends agree on a table that maps one to the other, and that is the whole idea.

00:34:53.477 --> 00:35:02.427
In 1963 that agreement was written down as ASCII - that is, American Standard Code for Information Interchange.

00:35:02.777 --> 00:35:07.577
It fixed a number for every English letter, digit and punctuation mark.

00:35:07.627 --> 00:35:08.067
A is 65.

00:35:08.117 --> 00:35:09.197
B is 66.

00:35:09.247 --> 00:35:11.047
The digit character '0' is 48.

00:35:11.097 --> 00:35:11.877
Space is 32.

00:35:11.927 --> 00:35:17.937
One hundred and twenty-eight characters, which fits in seven bits, stored in eight.

00:35:17.987 --> 00:35:24.427
That is where the byte as the unit of text comes from, and why file sizes have been measured that way ever since.

00:35:24.477 --> 00:35:28.407
But there is a problem, and you live inside it.

00:35:28.457 --> 00:35:33.867
One hundred and twenty-eight slots cannot hold Bangla.

00:35:33.917 --> 00:35:38.357
They cannot hold Arabic, or Chinese, or even French accents.

00:35:38.407 --> 00:35:46.637
So for about thirty years every language invented its own incompatible table, and a document that moved between two of them came out as garbage.

00:35:46.687 --> 00:35:55.637
You have seen the result — a page that renders as meaningless symbols is exactly this failure, and it is an agreement failure, not a transmission failure.

00:35:58.117 --> 00:36:00.017
Nothing was corrupted.

00:36:00.067 --> 00:36:02.017
The bits arrived perfectly.

00:36:02.067 --> 00:36:09.394
The two ends simply disagreed about what they meant.

00:36:09.444 --> 00:36:16.754
Let me do the conversion once, slowly -- so that you understand it properly --- without repeating myself.

00:36:16.804 --> 00:36:20.354
Here is the letter "A".

00:36:20.404 --> 00:36:23.284
Step one: look up the agreement.

00:36:23.334 --> 00:36:25.804
ASCII says "A" is 65.

00:36:25.854 --> 00:36:28.054
Step two: write 65 in binary.

00:36:28.104 --> 00:36:31.804
Zero, one, zero, zero, zero, zero, zero, one.

00:36:31.854 --> 00:36:32.594
One byte.

00:36:32.644 --> 00:36:41.064
And if you want to see why 65 is that particular row, look at the column weights underneath.

00:36:41.114 --> 00:36:50.064
Each column is worth twice the one to its right — one hundred and twenty-eight, sixty-four, thirty-two, sixteen, eight, four, two, one.

00:36:53.034 --> 00:37:01.984
Switch on the sixty-four column and the one column, leave every other column off, and you have sixty-four plus one, which is sixty-five.

00:37:03.384 --> 00:37:05.674
That is the whole of binary.

00:37:05.724 --> 00:37:09.324
So what does 'text becomes bits' actually mean?

00:37:09.374 --> 00:37:12.314
Two steps, and neither is mysterious.

00:37:12.364 --> 00:37:13.884
Look up the agreement.

00:37:13.934 --> 00:37:15.994
Write down the number in binary.

00:37:16.044 --> 00:37:24.492
Everything else in this section is those same two steps applied to something less familiar.

00:37:26.142 --> 00:37:33.472
Before I show you real characters, watch the machine itself.

00:37:33.522 --> 00:37:42.472
UTF-8 is nothing more than four byte templates — and which template a character uses depends only on how big its code point is.

00:37:45.752 --> 00:37:48.872
A one-byte sequence starts with a zero.

00:37:48.922 --> 00:37:52.202
A zero, followed by a maximum of seven payload bits.

00:37:52.252 --> 00:38:00.452
A one-byte sequence is used for code points U+0000 to U+007F — which is exactly the ASCII codes.

00:38:00.502 --> 00:38:06.592
A two-byte sequence: the first octet starts with one, one, zero.

00:38:06.642 --> 00:38:10.292
And the second octet starts with one, zero.

00:38:10.342 --> 00:38:17.822
Following the one, one, zero — a maximum of five payload bits can be inserted in the first octet.

00:38:17.872 --> 00:38:24.882
And following the one, zero — a maximum of six payload bits can be inserted in the second octet.

00:38:24.932 --> 00:38:31.072
So, in total a maximum of eleven payload bits can be inserted in a two-byte sequence.

00:38:31.122 --> 00:38:39.812
A two-byte sequence is used for code points U+0080 to U+07FF.

00:38:39.862 --> 00:38:46.692
A three-byte sequence: the first octet starts with one, one, one, zero.

00:38:46.742 --> 00:38:51.172
And the second and third octets each start with one, zero.

00:38:51.222 --> 00:39:00.172
Four payload bits in the first octet and six payload bits each in the second and third octet — that makes a total of maximum sixteen payload bits that can be inserted in a three-byte sequence.

00:39:03.682 --> 00:39:07.452
A three-byte sequence is used for code points U+0800 to U+FFFF.

00:39:07.502 --> 00:39:10.432
Bangla letter: অ lives in this range.

00:39:10.482 --> 00:39:18.572
Lastly, a four-byte sequence: the first octet starts with one, one, one, one, zero.

00:39:18.622 --> 00:39:24.282
Followed by three octets each starting with one, zero.

00:39:24.332 --> 00:39:31.722
Three plus six plus six plus six — that is twenty-one payload bits that can be inserted in a four-byte sequence.

00:39:31.772 --> 00:39:36.412
A four-byte sequence is used for code points U+10000 to U+10FFFF.

00:39:36.462 --> 00:39:38.602
Note the design carefully before using it.

00:39:38.652 --> 00:39:44.182
The number of leading ones in the first octet is the byte count.

00:39:44.232 --> 00:39:50.322
Zero leading ones in the first octet means it's a one-byte sequence.

00:39:50.372 --> 00:39:56.852
Two leading ones in the first octet means it's a two-byte sequence.

00:39:56.902 --> 00:40:01.612
Three leading ones in the first octet means it's a three-byte sequence.

00:40:01.662 --> 00:40:06.462
And four leading ones in the first octet means it's a four-byte sequence.

00:40:06.512 --> 00:40:13.922
Understand that after the first octet, every continuation octet announces itself with leading bits one, zero.

00:40:13.972 --> 00:40:16.852
Now, let us watch the machine run once.

00:40:16.902 --> 00:40:24.582
The character e with an acute accent has code point U+00E9.

00:40:24.632 --> 00:40:30.212
00E9 is the hexadecimal value that is assigned for the character e with an acute accent.

00:40:30.262 --> 00:40:37.402
So, the decimal value would be two hundred and thirty-three, which is eight significant bits.

00:40:37.452 --> 00:40:46.402
Eight does not fit the one-byte template's seven slots, so the character e with an acute accent takes the two-byte template.

00:40:47.102 --> 00:40:53.902
Pad the code point to eleven bits, weave those bits into the payload bit areas of the two-byte sequence.

00:40:53.952 --> 00:40:55.962
And out come two bytes: C3 A9.

00:40:56.012 --> 00:40:58.452
Look at what just happened.

00:40:58.502 --> 00:41:00.072
The code point was E9.

00:41:00.122 --> 00:41:05.662
The bytes on the wire are C3 A9.

00:41:05.712 --> 00:41:07.592
Neither of them is E9.

00:41:07.642 --> 00:41:11.362
The template bits are woven in with the payload.

00:41:11.412 --> 00:41:20.362
That is the difference between a code point and its encoding, and the next slide shows it for four real characters.

00:41:26.432 --> 00:41:30.972
Now we know how exactly the 128-slot problem was fixed.

00:41:31.022 --> 00:41:35.412
By two moves — and note carefully that they are two separate moves.

00:41:35.462 --> 00:41:42.052
Unicode gave every character in every writing system in the world its own number, called a code point.

00:41:42.102 --> 00:41:49.752
UTF-8 then agreed how to write those numbers as bytes on the wire — using the four templates you just watched.

00:41:49.802 --> 00:41:51.802
The code point is the number.

00:41:51.852 --> 00:41:55.582
UTF-8 is the encoding of that number.

00:41:55.632 --> 00:42:04.582
They are not always the same, and the rows on this slide show both, for four real characters.

00:42:04.962 --> 00:42:07.092
Let us start with the character A.

00:42:07.142 --> 00:42:13.452
The Unicode code point for A is U+0041 — in decimal sixty-five, in hexadecimal forty-one.

00:42:13.502 --> 00:42:22.452
Sixty-five is inside the one-byte range, so it uses the zero-x template, and the encoding comes out as exactly the code point itself: hexadecimal value forty-one, one byte.

00:42:26.102 --> 00:42:34.602
For the first one hundred and twenty-eight characters (0 to 127), the encoding and the code point are identical.

00:42:34.652 --> 00:42:41.492
The character e with an acute accent is the row you already watched being built.

00:42:41.542 --> 00:42:44.302
Its code point is U+00E9.

00:42:44.352 --> 00:42:49.992
The decimal value is two hundred and thirty-three — the two-byte template —

00:42:50.042 --> 00:42:58.992
and the encoding, in hexadecimal, is C3 A9, where neither byte is E9, because the template bits are woven in with the payload.

00:42:59.242 --> 00:43:08.192
For the Bangla letter অ, the code point is U+0985 — the decimal value would then be two thousand four hundred and thirty-seven.

00:43:10.442 --> 00:43:12.852
That means twelve significant bits.

00:43:12.902 --> 00:43:21.852
The two-byte template has space for eleven payload bits, which is lower than the twelve slots required for the twelve significant bits.

00:43:22.322 --> 00:43:31.272
So অ, the Bangla letter, requires the three-byte template — with fixed leading bits one-one-one-zero in the first octet, followed by two continuation octets each with one, zero as leading bits.

00:43:35.692 --> 00:43:38.752
The twelve bits spread across three bytes.

00:43:38.802 --> 00:43:40.562
The encoding is E0 A6 85.

00:43:40.612 --> 00:43:43.822
Lastly, an emoji with code point U+1F600.

00:43:43.872 --> 00:43:52.822
The decimal value is one hundred twenty-eight thousand five hundred and twelve.

00:43:53.152 --> 00:43:59.682
Seventeen significant bits, which is more than the sixteen slots available in the three-byte template.

00:43:59.732 --> 00:44:07.432
So it takes the four-byte template, and the encoding, in hexadecimal, is F0 9F 98 80.

00:44:07.482 --> 00:44:10.972
Which has a consequence worth stating plainly.

00:44:11.022 --> 00:44:15.482
A Bangla character costs three times what an English one does —

00:44:15.532 --> 00:44:17.842
in storage, and on the wire.

00:44:17.892 --> 00:44:24.702
The agreement is not free, and choosing it well is an engineering decision rather than a formality.

00:44:24.752 --> 00:44:27.632
There is one beautiful detail in the design.

00:44:27.682 --> 00:44:29.942
ASCII survives inside UTF-8.

00:44:29.992 --> 00:44:36.562
The first one hundred and twenty-eight code points encode to exactly their own single byte.

00:44:36.612 --> 00:44:45.562
Every English document written before 1990 is still a valid UTF-8 document today, without anybody converting anything.

00:44:45.962 --> 00:44:51.544
That is what a well-designed agreement looks like.

00:44:52.074 --> 00:44:57.184
Everything on the last three slides I did by hand, on paper.

00:44:57.234 --> 00:45:04.124
Here is the same arithmetic, done by the browser's own encoder, live, on whatever you type.

00:45:04.174 --> 00:45:11.774
The box already contains আমি A — three Bangla letters, a space, and one English letter.

00:45:11.824 --> 00:45:14.294
Read the four numbers across the top.

00:45:14.344 --> 00:45:15.764
Five characters.

00:45:15.814 --> 00:45:17.174
Eleven bytes.

00:45:17.224 --> 00:45:18.604
Eighty-eight bits.

00:45:18.654 --> 00:45:20.954
Two point two bytes per character.

00:45:21.004 --> 00:45:29.114
Five characters and eleven bytes — and if that gap does not bother you yet, look underneath.

00:45:29.164 --> 00:45:35.554
Each Bangla letter is three bytes: E0 A6, and then one byte that changes.

00:45:35.604 --> 00:45:39.204
The space is one byte, twenty in hexadecimal.

00:45:39.254 --> 00:45:47.184
The letter A is one byte, forty-one — which is exactly the code point, exactly as I claimed two slides ago.

00:45:47.234 --> 00:45:50.954
Now watch what happens when I type Hello instead.

00:45:51.004 --> 00:45:54.544
Five characters again — and this time five bytes.

00:45:54.594 --> 00:46:01.684
The same number of characters, less than half the traffic, purely because of which alphabet they were written in.

00:46:01.734 --> 00:46:10.684
And here are all four UTF-8 templates in a single line: A takes one byte, the Bangla letter takes three, the euro sign takes three, and the emoji takes four.

00:46:14.714 --> 00:46:17.884
You watched that machine run in the video a moment ago.

00:46:17.934 --> 00:46:21.294
This is the same machine, with your hands on it.

00:46:21.344 --> 00:46:26.704
The second tab is numbers, and numbers skip the lookup entirely.

00:46:26.754 --> 00:46:35.704
There is no table to consult — two thousand and twenty-six is written straight into binary, and the only question is how many bits you allow it.

00:46:36.464 --> 00:46:39.154
And the third tab is colour.

00:46:39.204 --> 00:46:43.624
One pixel is three numbers; a photograph is a grid of them.

00:46:43.674 --> 00:46:52.624
Four thousand by three thousand, twenty-four bits each, gives two hundred and eighty-eight million bits for one photograph — which is the slide you saw earlier, recomputed in front of you.

00:46:55.684 --> 00:47:01.404
Three tabs, three kinds of information, and one answer underneath all of them.

00:47:01.454 --> 00:47:07.142
Bits, and an agreement about how to read them.

00:47:07.192 --> 00:47:08.322
Numbers.

00:47:08.372 --> 00:47:12.352
This one is short, because a number is already a number.

00:47:12.402 --> 00:47:14.022
There is nothing to look up.

00:47:14.072 --> 00:47:19.312
But be careful here, because 'skip the lookup' sounds like a shortcut and it is not.

00:47:19.362 --> 00:47:21.702
It is a different thing entirely.

00:47:21.752 --> 00:47:25.422
Suppose I send you the digit nine as text.

00:47:25.472 --> 00:47:31.262
It goes through the table like any other character, and you get zero-zero-one-one-one-zero-zero-one.

00:47:31.312 --> 00:47:35.842
Eight bits — and they mean 'the ninth digit character in a table'.

00:47:35.892 --> 00:47:38.772
Add one to them and you get the character colon.

00:47:38.822 --> 00:47:42.892
Which is arithmetically correct, and completely useless.

00:47:42.942 --> 00:47:47.162
Now suppose I send you the quantity nine as a number.

00:47:47.212 --> 00:47:48.882
One-zero-zero-one.

00:47:48.932 --> 00:47:52.292
Four bits, and arithmetic works on them directly.

00:47:52.342 --> 00:47:56.772
Add one and you get ten, which is what you wanted.

00:47:56.822 --> 00:47:57.482
Scale that up.

00:47:57.532 --> 00:48:00.942
The year 2026 as text costs four characters — thirty-two bits.

00:48:00.992 --> 00:48:09.942
As a number it fits in eleven bits, and the same sixteen-bit slot would hold any number up to sixty-five thousand five hundred and thirty-five.

00:48:12.052 --> 00:48:17.212
So here is the exam question: why do numbers not go through ASCII?

00:48:17.262 --> 00:48:25.882
Because you would have to convert them back before you could compute with them — so the detour costs space and buys nothing.

00:48:25.932 --> 00:48:27.542
Keep that distinction sharp.

00:48:27.592 --> 00:48:35.641
The character '9' and the quantity 9 are different data, even though they look identical on this page.

00:48:35.691 --> 00:48:36.021
Images.

00:48:36.071 --> 00:48:41.031
For this one I want you to watch rather than listen.

00:48:41.081 --> 00:48:45.331
Here is a photograph.

00:48:45.381 --> 00:48:51.851
Now we zoom in — and keep zooming, past the point where it looks like a picture at all.

00:48:51.901 --> 00:48:57.101
Eventually a single dot fills the screen.

00:48:57.151 --> 00:49:02.701
That dot is a pixel, and it is one flat color.

00:49:02.751 --> 00:49:05.771
And that color is three numbers.

00:49:05.821 --> 00:49:09.811
How much red, how much green, how much blue.

00:49:09.861 --> 00:49:18.811
Two hundred and thirty-two, one hundred and thirty, fifteen — each one between zero and two hundred and fifty-five.

00:49:19.831 --> 00:49:24.621
Three numbers, eight bits each.

00:49:24.671 --> 00:49:28.251
Twenty-four bits, for one dot.

00:49:28.301 --> 00:49:33.071
A photograph is a grid of those, and nothing else at all.

00:49:33.121 --> 00:49:42.071
There is no picture in there — there is a very long list of numbers, and an agreement about how to lay them out.

00:49:43.372 --> 00:49:49.072
Let me put numbers on that, because the arithmetic is more striking than the idea.

00:49:49.122 --> 00:49:54.552
One pixel is three numbers — red, green and blue.

00:49:54.602 --> 00:50:02.832
Each number needs eight bits, because two hundred and fifty-five is the largest value eight bits can hold.

00:50:02.882 --> 00:50:06.442
So one pixel costs twenty-four bits.

00:50:06.492 --> 00:50:15.152
That, incidentally, is what '24-bit color' means when you see it in a display setting — it is not marketing, it is this.

00:50:15.202 --> 00:50:21.312
And a twelve-megapixel photo from your phone is four thousand by three thousand pixels.

00:50:21.362 --> 00:50:23.182
Twelve million of them.

00:50:23.232 --> 00:50:29.212
Twelve million times twenty-four is two hundred and eighty-eight million bits.

00:50:29.262 --> 00:50:31.022
Thirty-six megabytes.

00:50:31.072 --> 00:50:33.582
For one photograph.

00:50:33.632 --> 00:50:42.582
Now, your phone does not store thirty-six megabytes per photo — it stores two or three, because JPEG throws away detail your eye was never going to notice.

00:50:44.702 --> 00:50:48.062
That is compression, and it gets a proper treatment later.

00:50:48.112 --> 00:50:55.072
But I want you to see the raw number first, because the raw number is what tells you why compression had to be invented at all.

00:50:55.122 --> 00:51:02.488
Every figure in this course is a raw figure unless I say otherwise.

00:51:02.538 --> 00:51:03.958
Fourth checkpoint.

00:51:04.008 --> 00:51:07.388
Pause, paper, no scrolling back.

00:51:07.438 --> 00:51:09.028
One.

00:51:09.078 --> 00:51:11.978
Write the letter B as eight bits.

00:51:12.028 --> 00:51:13.708
A is 65.

00:51:13.758 --> 00:51:15.298
Two.

00:51:15.348 --> 00:51:19.008
Why does the number nine not go through the ASCII table?

00:51:19.058 --> 00:51:20.608
Three.

00:51:20.658 --> 00:51:29.608
A two-thousand by one-thousand image at twenty-four bits per pixel — how many bits, uncompressed?

00:51:29.778 --> 00:51:34.938
Pause now.

00:51:34.988 --> 00:51:36.808
Answers.

00:51:36.858 --> 00:51:41.588
One — B is 66, which is 64 plus 2, so zero-one-zero-zero-zero-zero-one-zero.

00:51:41.638 --> 00:51:44.528
Two — because it is already a number.

00:51:44.578 --> 00:51:53.438
Sending it as text costs more bits, and you would have to convert it back before you could compute with it.

00:51:53.488 --> 00:52:02.438
Three — two million pixels times twenty-four is forty-eight million bits, which is six megabytes.

00:52:03.076 --> 00:52:04.486
Section five.

00:52:04.536 --> 00:52:07.256
Sound and video are not made of symbols.

00:52:07.306 --> 00:52:16.256
They are continuous — and that takes one extra idea, which happens to be one of the most important ideas in this entire course.

00:52:18.536 --> 00:52:23.156
Text had an obvious route: look up the agreement, write the number.

00:52:23.206 --> 00:52:25.386
Sound has no symbols to look up.

00:52:25.436 --> 00:52:29.236
Sound is a smooth, continuous change in air pressure.

00:52:29.286 --> 00:52:36.136
It has a value at every instant — and between any two instants there are infinitely many more.

00:52:36.186 --> 00:52:39.716
So here is the problem, stated honestly.

00:52:39.766 --> 00:52:43.226
A wire carries a finite number of bits per second.

00:52:43.276 --> 00:52:50.976
A continuous wave has a value at infinitely many instants, and each of those values could take infinitely many levels.

00:52:51.026 --> 00:52:55.436
Something has to give — and in fact something has to give twice.

00:52:55.486 --> 00:52:57.756
And here is the answer.

00:52:57.806 --> 00:52:59.966
Stop trying to record the wave.

00:53:00.016 --> 00:53:08.036
Record measurements of it instead — taken at regular instants, each one rounded to the nearest of a fixed set of levels.

00:53:08.086 --> 00:53:10.526
Three steps, always in this order:

00:53:10.576 --> 00:53:11.616
"sample".

00:53:11.666 --> 00:53:12.866
"quantize".

00:53:12.916 --> 00:53:14.396
"encode".

00:53:14.446 --> 00:53:18.686
Understand how big this idea is before we do it.

00:53:18.736 --> 00:53:27.686
Sampling and quantizing are how every analog quantity in the world becomes something a computer can hold — sound, light, temperature, pressure, a heartbeat on a hospital monitor.

00:53:31.316 --> 00:53:40.266
Session four takes that factor of two as given; the sampling theorem that makes it exact is outside this course.

00:53:43.463 --> 00:53:49.673
Watch the wave stop being a wave and become a list of numbers.

00:53:49.723 --> 00:53:57.563
There is the original signal — smooth, continuous, no bits anywhere in it.

00:53:57.613 --> 00:54:00.573
Now the sample instants appear.

00:54:00.623 --> 00:54:07.433
We read the height of the wave at each one, and between them we record nothing at all.

00:54:07.483 --> 00:54:10.993
Then the levels.

00:54:11.043 --> 00:54:19.893
Each reading is snapped to the nearest one — and you can see the little gaps where the reading did not land exactly on a level.

00:54:19.943 --> 00:54:24.993
Those gaps are thrown away, permanently.

00:54:25.043 --> 00:54:33.993
And finally each level becomes a number, and each number becomes binary.

00:54:34.343 --> 00:54:41.606
That is the list of bits at the bottom, and that is your sound.

00:54:41.656 --> 00:54:47.106
Let me say the same three steps in words, because you will be asked to write them.

00:54:47.156 --> 00:54:48.856
Sample.

00:54:48.906 --> 00:54:54.206
Read the height of the wave at regular instants — say eight thousand times a second.

00:54:54.256 --> 00:55:01.426
Between the samples you record nothing, and you simply trust that the wave did not do anything interesting in between.

00:55:01.476 --> 00:55:07.386
Whether that trust is justified is exactly what Nyquist's theorem answers.

00:55:07.436 --> 00:55:09.316
Quantize.

00:55:09.366 --> 00:55:13.006
Snap each reading to one of a fixed set of levels.

00:55:13.056 --> 00:55:17.766
With eight levels available, a reading of 4.7 becomes 5.

00:55:17.816 --> 00:55:24.246
The 0.7 you threw away has a name — quantization error — and it never comes back.

00:55:24.296 --> 00:55:26.056
Encode.

00:55:26.106 --> 00:55:27.986
Write the level as binary.

00:55:28.036 --> 00:55:30.766
Level 5 becomes one-zero-one.

00:55:30.816 --> 00:55:35.336
That is all encoding means here: the level number, in binary.

00:55:35.386 --> 00:55:40.276
With eight levels you need three bits, because three bits count to eight.

00:55:40.326 --> 00:55:45.486
Note where the loss happens, because this is worth being precise about.

00:55:45.536 --> 00:55:48.886
Sampling loses what happened between the instants.

00:55:48.936 --> 00:55:52.326
Quantizing loses the fraction between the levels.

00:55:52.376 --> 00:55:53.746
Both are permanent.

00:55:53.796 --> 00:55:57.066
So digital audio is not a perfect copy of a sound and never was.

00:55:57.116 --> 00:56:06.066
What it is, is a copy whose errors you can make as small as you are willing to pay for — which is a far more useful property than perfection, and it is why the digital approach won.

00:56:11.790 --> 00:56:18.740
Now we can put a number on the cost of sound, and the formula is as simple as it looks.

00:56:18.790 --> 00:56:26.060
Bit rate equals sampling rate, times bits per sample, times the number of channels.

00:56:26.110 --> 00:56:27.480
Telephone quality.

00:56:27.530 --> 00:56:32.120
Eight thousand samples a second, eight bits each, one channel.

00:56:32.170 --> 00:56:38.650
Eight thousand times eight is sixty-four thousand bits per second — sixty-four kilobits per second.

00:56:38.700 --> 00:56:40.080
Remember that number.

00:56:40.130 --> 00:56:48.300
Sixty-four kbps is the size of one voice channel, and it is the brick the entire telephone network was built out of.

00:56:48.350 --> 00:56:52.000
You will meet it again, repeatedly.

00:56:52.050 --> 00:56:53.980
Compact disc quality.

00:56:54.030 --> 00:57:00.640
Forty-four thousand one hundred samples a second, sixteen bits each, two channels for stereo.

00:57:00.690 --> 00:57:09.640
Forty-four thousand one hundred, times sixteen, times two, is one million four hundred and eleven thousand two hundred bits per second — 1.4112 megabits per second.

00:57:13.220 --> 00:57:22.080
Twenty-two times a telephone call, for the same length of time — which tells you exactly what the extra fidelity costs.

00:57:22.130 --> 00:57:25.510
Note that the point is not to memorize either figure.

00:57:25.560 --> 00:57:32.440
It is that given any two of sampling rate, bits per sample and bit rate, you can produce the third.

00:57:32.490 --> 00:57:39.506
That is exactly the shape of the question in Online Quiz A1.

00:57:40.736 --> 00:57:46.586
Sample, quantize, encode — you have watched it once and written it out once.

00:57:46.636 --> 00:57:51.346
Now put your hands on the two knobs that decide everything.

00:57:51.396 --> 00:57:58.276
This is the telephone preset: eight thousand samples a second, eight bits each, one channel.

00:57:58.326 --> 00:58:03.606
Bit rate, sixty-four kilobits per second — the number I asked you to remember.

00:58:03.656 --> 00:58:10.876
And on the right, what that costs for one minute of speech: four hundred and eighty kilobytes.

00:58:10.926 --> 00:58:15.746
Now I take the sampling rate down, and I want you to watch the green banner at the bottom.

00:58:15.796 --> 00:58:24.746
At eight thousand samples a second for a one-kilohertz tone, Nyquist is satisfied — eight thousand is comfortably more than twice one thousand.

00:58:26.046 --> 00:58:30.706
Keep dragging, and at some point that banner turns.

00:58:30.756 --> 00:58:31.706
There it is.

00:58:31.756 --> 00:58:37.836
Below twice the tone frequency, the rebuilt signal is no longer the signal I started with.

00:58:37.886 --> 00:58:44.506
It is a different, lower tone, and it is wrong in a way no amount of extra care downstream can undo.

00:58:44.556 --> 00:58:53.046
That is aliasing, and Nyquist's theorem is the rule that tells you where the cliff is before you walk off it.

00:58:53.096 --> 00:58:57.836
Put the rate back, and now take the other knob — the number of levels.

00:58:57.886 --> 00:59:06.836
Watch the staircase get coarser, watch the pink error band underneath get thicker, and watch the measured signal-to-noise figure fall.

00:59:07.586 --> 00:59:13.016
Every one of those pink slivers is a fraction that was thrown away and will never come back.

00:59:13.066 --> 00:59:17.296
Add one bit per sample and you buy about six decibels back.

00:59:17.346 --> 00:59:24.076
That is not a rule of thumb I am asking you to trust — the demo measures it while you drag.

00:59:24.126 --> 00:59:31.776
And now the compact-disc preset: forty-four thousand one hundred samples, sixteen bits, two channels.

00:59:31.826 --> 00:59:37.976
One point four megabits per second, and the one-minute cost jumps accordingly.

00:59:38.026 --> 00:59:42.246
Two knobs — how often you look, and how finely you measure.

00:59:42.296 --> 00:59:45.936
Multiply them, and you have the bit rate you must pay for.

00:59:45.986 --> 00:59:54.936
Everything in Online Quiz A1 is that one sentence, asked in different directions.

00:59:55.012 --> 00:59:55.352
Video.

00:59:55.402 --> 01:00:01.612
This is the cheapest trick in the session, because nothing new is invented at all.

01:00:01.662 --> 01:00:04.252
A frame is an image.

01:00:04.302 --> 01:00:10.642
And you already know what an image is — pixels, then three numbers each, then bits.

01:00:10.692 --> 01:00:13.762
Video is frames on a clock.

01:00:13.812 --> 01:00:19.812
Thirty of them every second, shown fast enough that your eye fuses them into motion.

01:00:19.862 --> 01:00:27.872
So the cost is images times frame rate, and the arithmetic is the arithmetic you did two slides ago.

01:00:27.922 --> 01:00:34.542
Nineteen-twenty by ten-eighty, twenty-four bits per pixel, thirty frames per second.

01:00:34.592 --> 01:00:37.642
That is about one and a half gigabits per second.

01:00:37.692 --> 01:00:44.352
Raw HD video is more than most home connections can carry — which is why nothing is ever sent raw.

01:00:44.402 --> 01:00:53.352
Compression closes that gap by a factor of a hundred or more, and it does it mostly by noticing something obvious once you say it out loud: consecutive frames are almost identical, so send the difference rather than the picture.

01:01:01.228 --> 01:01:05.758
Let me put the whole of sections four and five on one slide.

01:01:05.808 --> 01:01:12.288
Text — look up the agreement, get a number, write it in binary.

01:01:12.338 --> 01:01:17.138
Numbers — already a number, straight to binary.

01:01:17.188 --> 01:01:22.388
Images — pixels, three numbers each, then binary.

01:01:22.438 --> 01:01:27.598
Audio — sample, quantize, encode, then binary.

01:01:27.648 --> 01:01:32.538
Video — frames of images on a clock, then binary.

01:01:32.588 --> 01:01:35.588
Five completely different starting points.

01:01:35.638 --> 01:01:37.828
One destination.

01:01:37.878 --> 01:01:42.518
The network carries bits, and it will never once ask what they meant.

01:01:42.568 --> 01:01:51.518
Bits are bits — and from here on, whenever we discuss a link, a frame, an address or a router, this is the thing being moved.

01:01:55.514 --> 01:01:56.854
Fifth checkpoint.

01:01:56.904 --> 01:01:58.604
Pause and answer.

01:01:58.654 --> 01:02:00.234
One.

01:02:00.284 --> 01:02:06.194
A signal is sampled sixteen thousand times a second with two hundred and fifty-six levels.

01:02:06.244 --> 01:02:08.004
What is the bit rate?

01:02:08.054 --> 01:02:09.594
Two.

01:02:09.644 --> 01:02:15.704
Name the two places where information is permanently lost when a wave is digitized.

01:02:15.754 --> 01:02:17.324
Three.

01:02:17.374 --> 01:02:23.034
Why is video not a new idea after images?

01:02:23.084 --> 01:02:28.244
Pause now.

01:02:28.294 --> 01:02:30.114
Answers.

01:02:30.164 --> 01:02:39.114
One — two hundred and fifty-six levels needs eight bits, so sixteen thousand times eight is one hundred and twenty-eight thousand bits per second.

01:02:39.314 --> 01:02:41.734
One hundred and twenty-eight kbps.

01:02:41.784 --> 01:02:49.634
Two — sampling loses what happened between the instants; quantizing loses the fraction between the levels.

01:02:49.684 --> 01:02:54.574
Three — because a frame is just an image, and video is images on a clock.

01:02:54.624 --> 01:03:00.008
The only thing added is the frame rate.

01:03:00.058 --> 01:03:01.528
Section six.

01:03:01.578 --> 01:03:02.628
Bits move.

01:03:02.678 --> 01:03:11.628
Which raises the next question — once two devices share one link, who is allowed to talk, and when?

01:03:12.191 --> 01:03:16.561
There are three answers, and you have used all three of them today.

01:03:16.611 --> 01:03:20.141
Simplex — one direction, always.

01:03:20.191 --> 01:03:24.561
Your keyboard sends to the computer; your monitor receives from it.

01:03:24.611 --> 01:03:28.491
The keyboard has never once been interested in the monitor's opinion.

01:03:28.541 --> 01:03:32.871
And the whole capacity of the link serves that single direction.

01:03:32.921 --> 01:03:37.771
Half-duplex — both directions, but only one at a time.

01:03:37.821 --> 01:03:39.241
A walkie-talkie.

01:03:39.291 --> 01:03:43.091
While A transmits, B listens, and then they swap.

01:03:43.141 --> 01:03:47.621
The whole capacity serves whichever direction currently has it.

01:03:47.671 --> 01:03:51.391
Full-duplex — both directions at once.

01:03:51.441 --> 01:03:58.801
The telephone, where both people talk and hear simultaneously, and neither has to wait for the other to finish.

01:03:58.851 --> 01:04:05.331
One vocabulary note that saves confusion later: 'duplex' just means two-way.

01:04:05.381 --> 01:04:13.611
So half-duplex is two-way taking turns, full-duplex is two-way simultaneously, and simplex is not two-way at all.

01:04:13.661 --> 01:04:22.611
Every device you own is one of these three on every link it has — and knowing which one tells you immediately what its capacity is doing.

01:04:25.304 --> 01:04:30.054
Half-duplex is the interesting one, so let me spend a moment on it.

01:04:30.104 --> 01:04:34.054
Its protocol is a single word: 'over'.

01:04:34.104 --> 01:04:40.604
And I said earlier that it is not decoration and it is not film dialogue, so here is the precise claim.

01:04:40.654 --> 01:04:46.734
'Over' is the agreed signal meaning: I have stopped transmitting; the channel is now yours.

01:04:46.784 --> 01:04:49.334
Remove it and the channel collapses.

01:04:49.384 --> 01:04:54.814
Two people transmit at once, the signals collide, and neither is received.

01:04:54.864 --> 01:04:59.334
One word is the difference between a working link and a useless one.

01:04:59.384 --> 01:05:04.034
But there is a hidden cost, and it is the part students miss.

01:05:04.084 --> 01:05:07.334
Reversing direction is not instantaneous.

01:05:07.384 --> 01:05:13.124
The transmitter must stop, the line must settle, and the other end must switch on.

01:05:13.174 --> 01:05:17.074
That interval is called turnaround time.

01:05:17.124 --> 01:05:18.644
Put a number on it.

01:05:18.694 --> 01:05:23.714
On a ten-megabit link, a fifteen-hundred-byte frame takes about 1.2 milliseconds to send.

01:05:23.764 --> 01:05:26.724
A turnaround can cost half a millisecond.

01:05:26.774 --> 01:05:34.674
So if you swap direction after every frame, you are spending nearly a third of your capacity just changing your mind.

01:05:34.724 --> 01:05:37.774
And you have met this without noticing.

01:05:37.824 --> 01:05:46.774
Old Ethernet on a shared cable was half-duplex, and collisions were a normal part of its day — the protocol that handled them, CSMA/CD - which is out of the scope of this course. You will learn it if you go for higher studies in Communications Network.

01:05:54.584 --> 01:06:03.534
Wi-Fi is half-duplex to this day: your access point and your laptop cannot both transmit on the same channel at the same instant, which is a large part of why a crowded room feels slow even when the signal bar is full.

01:06:10.994 --> 01:06:16.514
Full-duplex lets both ends talk at once — and there are only two ways to arrange that.

01:06:16.564 --> 01:06:21.254
They are not the same deal, and the difference is the point of this slide.

01:06:21.304 --> 01:06:24.854
Option A: pay for two channels.

01:06:24.904 --> 01:06:29.394
Two separate physical paths, or two frequency bands on one path.

01:06:29.444 --> 01:06:31.604
Each direction gets the full rate.

01:06:31.654 --> 01:06:37.944
A ten-megabit link becomes ten megabits each way — twenty megabits of total traffic.

01:06:37.994 --> 01:06:41.114
You bought that capacity; it was not conjured.

01:06:41.164 --> 01:06:44.614
This is what the four-pair cable in your wall is doing.

01:06:44.664 --> 01:06:48.834
Option B: share the capacity you already have.

01:06:48.884 --> 01:06:52.274
One path, divided between the two directions.

01:06:52.324 --> 01:06:56.124
A ten-megabit link becomes five megabits each way.

01:06:56.174 --> 01:07:00.284
Both ends can talk at once, and each of them talks at half speed.

01:07:00.334 --> 01:07:01.834
Nothing was created.

01:07:01.884 --> 01:07:06.734
The link is doing exactly the same amount of work, sliced differently.

01:07:06.784 --> 01:07:09.984
And that is the general shape of the trade.

01:07:10.034 --> 01:07:12.064
Capacity is conserved.

01:07:12.114 --> 01:07:15.104
Simplex gives one direction everything.

01:07:15.154 --> 01:07:19.334
Half-duplex gives everything to whichever direction is speaking.

01:07:19.384 --> 01:07:26.401
Full-duplex either buys a second channel or halves the one it has.

01:07:27.001 --> 01:07:33.601
Three modes, three costs — and I would rather you saw the costs than took my word for them.

01:07:33.651 --> 01:07:37.051
One link, ten megabits per second.

01:07:37.101 --> 01:07:45.001
One frame is fifteen hundred bytes, which is twelve thousand bits, which takes one point two milliseconds to put on the wire.

01:07:45.051 --> 01:07:53.731
Remember that the meter at the bottom runs to twenty, not to ten — there is a reason for that, and we will get to it.

01:07:53.781 --> 01:08:01.211
Simplex first, and I will do the unfair thing immediately: I will ask B to talk.

01:08:01.261 --> 01:08:01.711
Refused.

01:08:01.761 --> 01:08:04.631
Not delayed, not collided — refused.

01:08:04.681 --> 01:08:09.721
There is no return path in simplex, so B has nothing to transmit into.

01:08:09.771 --> 01:08:15.671
That is the whole mode: one direction, all the capacity, no argument.

01:08:15.721 --> 01:08:21.051
Half-duplex now, and both ends try to talk at the same instant.

01:08:21.101 --> 01:08:25.691
There is the collision, and there is the turnaround that follows it.

01:08:25.741 --> 01:08:31.301
Every turnaround costs half a millisecond in which the wire is carrying nothing at all.

01:08:31.351 --> 01:08:38.991
Watch the 'time lost' counter, because that counter is the price of taking turns, and it is a real number rather than a feeling.

01:08:39.041 --> 01:08:45.691
And notice the aggregate: it never passes ten megabits, no matter how hard both ends try.

01:08:45.741 --> 01:08:49.681
Full-duplex, option A: two channels.

01:08:49.731 --> 01:08:55.531
Both talk at once, both get the full ten megabits, and the aggregate reads twenty.

01:08:55.581 --> 01:08:58.371
That is what the meter running to twenty was for.

01:08:58.421 --> 01:09:02.941
But look at what I did to get it — I bought a second channel.

01:09:02.991 --> 01:09:05.621
Option B: one channel, shared.

01:09:05.671 --> 01:09:09.431
Both ends still talk at once — and each of them gets five.

01:09:09.481 --> 01:09:13.331
The aggregate is ten, exactly what it was before.

01:09:13.381 --> 01:09:17.441
Nothing was created between those last two screens.

01:09:17.491 --> 01:09:23.781
The link is doing the same amount of work, sliced differently, and the meter refuses to be flattered.

01:09:23.831 --> 01:09:31.445
Capacity is conserved — and now, four cases to classify.

01:09:31.495 --> 01:09:36.425
Four cases, and this time the answers come with them.

01:09:36.475 --> 01:09:37.855
So do the work first.

01:09:37.905 --> 01:09:46.855
Pause the video here, before I click anything, and write down four answers — simplex, half-duplex or full-duplex — for a fire alarm, a video call, a CB radio, and a boss dictating to a typist.

01:09:53.745 --> 01:09:58.895
Pause now.

01:09:58.945 --> 01:10:03.335
A fire alarm sounding through a building: simplex.

01:10:03.385 --> 01:10:08.395
Nothing answers it — there is no return path, and none was ever wanted.

01:10:08.445 --> 01:10:11.145
Two lecturers arguing on a video call: full-duplex.

01:10:11.195 --> 01:10:20.045
Both directions are live at the same instant, as anyone who has ever talked over a colleague can confirm.

01:10:20.095 --> 01:10:23.035
Two truckers on CB radio saying 'over': half-duplex.

01:10:23.085 --> 01:10:32.035
That word 'over' again — one at a time, by agreement, exactly the turnaround you just watched cost half a millisecond.

01:10:33.945 --> 01:10:39.225
And the fourth — a boss dictating to a typist who never interrupts.

01:10:39.275 --> 01:10:41.435
That one does not get an answer from me.

01:10:41.485 --> 01:10:49.020
It gets its own slide, because I want you to argue with yourself about it first.

01:10:49.070 --> 01:10:50.760
A boss dictates.

01:10:50.810 --> 01:10:52.880
The typist never says a word.

01:10:52.930 --> 01:10:56.600
That looks like simplex — content flows one way only.

01:10:56.650 --> 01:10:58.710
Except the typist nods.

01:10:58.760 --> 01:11:00.850
And that nod travels back.

01:11:00.900 --> 01:11:02.970
So: is a nod a channel?

01:11:03.020 --> 01:11:08.720
Let me put both cases properly, because this is a real argument and not a trick.

01:11:08.770 --> 01:11:11.270
The case for simplex.

01:11:11.320 --> 01:11:13.420
The nod carries no dictation.

01:11:13.470 --> 01:11:15.790
No content flows backwards.

01:11:15.840 --> 01:11:22.920
The channel — the air between them, considered as a carrier of words — is used in one direction only.

01:11:22.970 --> 01:11:26.490
By the definition we gave, that is simplex.

01:11:26.540 --> 01:11:28.690
The case against.

01:11:28.740 --> 01:11:33.320
The nod told the boss something specific: I am keeping up, continue.

01:11:33.370 --> 01:11:37.590
Remove it and the boss must either guess, or stop and ask.

01:11:37.640 --> 01:11:43.320
It is a return path, it carries information, and it changes what the sender does next.

01:11:43.370 --> 01:11:46.640
By any functional test, that is a channel.

01:11:46.690 --> 01:11:53.280
I am not going to resolve it, and I want you to note why the question is worth asking rather than annoying.

01:11:53.330 --> 01:11:59.400
You have just invented acknowledgement and flow control, which are Sessions twenty-one and twenty-two.

01:11:59.450 --> 01:12:08.400
A tiny backward signal that carries no payload, but changes the sender's behavior — every reliable protocol in existence is built on exactly this idea, and Sessions twenty-one and twenty-two are where you build it.

01:12:13.630 --> 01:12:22.580
So the reason 'is a nod a channel?' has no tidy answer is that the tidy answer would have to throw away the most useful thing in the room.

01:12:24.308 --> 01:12:26.118
Section seven.

01:12:26.168 --> 01:12:34.442
Back to the question I asked in the first minute — and this time we count.

01:12:34.712 --> 01:12:39.702
Follow the message from your hand to the hand beside you.

01:12:39.752 --> 01:12:43.692
Watch the whole path once without me talking over it.

01:12:43.742 --> 01:12:52.692
Notice the counter in the corner.

01:13:17.882 --> 01:13:20.842
Now again, one hop at a time.

01:13:20.892 --> 01:13:25.672
Your phone turns the message into bits and hands them to its radio.

01:13:25.722 --> 01:13:30.672
The Wi-Fi access point on the ceiling takes them off the air.

01:13:30.722 --> 01:13:35.742
The campus router decides this traffic leaves the university.

01:13:35.792 --> 01:13:42.992
Your internet service provider's edge, then its core, each one choosing where to send it next.

01:13:43.042 --> 01:13:48.932
An internet exchange, where separate networks hand traffic to one another.

01:13:48.982 --> 01:13:57.152
Then the data center — load balancers, then a server, quite possibly in Singapore.

01:13:57.202 --> 01:14:06.152
And then all the way back down a parallel chain, to a phone one meter away from you.

01:14:10.502 --> 01:14:14.372
So here is the answer to the question from the beginning of this lecture.

01:14:14.422 --> 01:14:17.902
Somewhere between fifteen and twenty-five devices.

01:14:17.952 --> 01:14:21.772
Now compare that with the number you wrote down.

01:14:21.822 --> 01:14:26.852
Your phone — it turns the message into bits and hands them to the radio.

01:14:26.902 --> 01:14:31.842
The Wi-Fi access point — the first hop off your device.

01:14:31.892 --> 01:14:37.392
The campus router — it decides this traffic leaves the university.

01:14:37.442 --> 01:14:43.902
The ISP edge and core — several devices, each choosing the next one.

01:14:43.952 --> 01:14:49.882
The internet exchange — where separate networks hand traffic to one another.

01:14:49.932 --> 01:14:56.622
The data center — load balancers, then a server, quite possibly in Singapore.

01:14:56.672 --> 01:15:02.102
And the entire mirrored chain coming back — to a phone one meter away.

01:15:02.152 --> 01:15:04.652
For a message that traveled one meter.

01:15:04.702 --> 01:15:09.712
Your guess was almost certainly too low, and now you know exactly why.

01:15:09.762 --> 01:15:14.362
And two things were true at every single one of those hops.

01:15:14.412 --> 01:15:17.462
The first: every hop obeyed agreements.

01:15:17.512 --> 01:15:22.402
What to say, when to say it, and what to do when something broke.

01:15:22.452 --> 01:15:28.792
Syntax, semantics, timing — the same three questions, answered differently at every level.

01:15:28.842 --> 01:15:33.002
The second: every hop carried the same thing.

01:15:33.052 --> 01:15:33.272
Bits.

01:15:33.322 --> 01:15:37.122
The very same bits the message became back in section four.

01:15:37.172 --> 01:15:43.752
Not one of those devices knew or cared what it was carrying.

01:15:43.802 --> 01:15:45.442
So where does this go?

01:15:45.492 --> 01:15:48.222
Here is the whole course on one slide.

01:15:48.272 --> 01:15:51.952
Weeks two to three — the physical layer.

01:15:52.002 --> 01:15:58.102
Signals, bandwidth, noise, and the hard ceiling on how many bits a medium can carry.

01:15:58.152 --> 01:16:04.082
Nyquist and Shannon, which we have now referenced several times without proving.

01:16:04.132 --> 01:16:08.052
Week four — the data link layer.

01:16:08.102 --> 01:16:11.182
Framing, MAC addresses, and ARP Protocol.

01:16:11.232 --> 01:16:15.492
Everything half-duplex made you wonder about gets answered here.

01:16:15.542 --> 01:16:22.892
Weeks five to ten — the network layer, and the largest single block of this course.

01:16:22.942 --> 01:16:30.802
IP addressing, masks, subnetting, aggregation and forwarding: how a packet finds exactly one device among billions.

01:16:30.852 --> 01:16:35.402
That is the delivery characteristic, taken completely seriously.

01:16:35.452 --> 01:16:43.862
Weeks eleven and twelve — IPv6, the address space we are moving to, and then transport: ports, multiplexing and sliding windows.

01:16:43.912 --> 01:16:50.692
Now look back at those four blocks with what you learned today.

01:16:50.742 --> 01:16:55.032
The physical layer agrees how a bit is represented as a signal.

01:16:55.082 --> 01:16:59.322
The data link layer agrees where a frame starts and who may speak.

01:16:59.372 --> 01:17:02.372
The network layer agrees how a device is named.

01:17:02.422 --> 01:17:05.832
Transport agrees how a conversation is kept in order.

01:17:05.882 --> 01:17:08.282
Same idea, four altitudes.

01:17:08.332 --> 01:17:13.479
It is agreements all the way down.

01:17:13.529 --> 01:17:17.789
Let me close by naming exactly what you should be able to do now.

01:17:17.839 --> 01:17:22.799
Define telecommunication, data and data communication

01:17:22.849 --> 01:17:31.799
Grade any delivery against the four characteristics- Delivery, accuracy, timeliness and jitter.  And also explain why jitter is not delay.

01:17:34.289 --> 01:17:43.239
Name the five components, and state the three things every protocol settles - Message, Sender, Receiver, transmission medium and protocol.

01:17:45.449 --> 01:17:54.399
Convert text, a number, a pixel and a sample into bits — and compute what an image or a second of audio actually costs.

01:17:55.269 --> 01:18:03.929
And classify any link as simplex, half-duplex or full-duplex, and say what that choice does to its capacity.

01:18:03.979 --> 01:18:08.199
If any of those feel shaky, the section that covers it is still there.

01:18:08.249 --> 01:18:13.579
This is a video — use it as one.

01:18:13.629 --> 01:18:15.369
Five last questions.

01:18:15.419 --> 01:18:17.749
Pause and answer them on paper.

01:18:17.799 --> 01:18:19.399
One.

01:18:19.449 --> 01:18:26.179
Which characteristic fails when an OTP arrives, intact and instantly, at the wrong phone?

01:18:26.229 --> 01:18:27.759
Two.

01:18:27.809 --> 01:18:32.999
Name the three things every protocol settles.

01:18:33.049 --> 01:18:33.469
Three.

01:18:33.519 --> 01:18:36.059
Write the letter C as eight bits.

01:18:36.109 --> 01:18:37.729
A is 65.

01:18:37.779 --> 01:18:39.379
Four.

01:18:39.429 --> 01:18:45.419
A signal sampled eight thousand times a second with sixteen levels — what bit rate?

01:18:45.469 --> 01:18:47.119
Five.

01:18:47.169 --> 01:18:51.789
A ten-megabit link is made full-duplex by sharing its capacity.

01:18:51.839 --> 01:18:56.639
How fast can each direction go?

01:18:56.689 --> 01:19:01.489
Pause now.

01:19:01.539 --> 01:19:03.509
Take your time on these.

01:19:03.559 --> 01:19:05.679
One — delivery.

01:19:05.729 --> 01:19:09.099
Two — syntax, semantics, timing.

01:19:09.149 --> 01:19:17.679
Three — C is 67, which is 64 plus 2 plus 1, so zero-one-zero-zero-zero-zero-one-one.

01:19:17.729 --> 01:19:24.749
Four — sixteen levels needs four bits, so eight thousand times four is thirty-two kilobits per second.

01:19:24.799 --> 01:19:27.289
Five — five megabits each way.

01:19:27.339 --> 01:19:34.033
If you got all five, you have had a very good first session.

01:19:34.083 --> 01:19:35.593
So take this with you.

01:19:35.643 --> 01:19:36.933
Bits are bits.

01:19:36.983 --> 01:19:40.513
The network moves them; protocols give them meaning.

01:19:40.563 --> 01:19:44.983
Everything else in this course is detail attached to that sentence.

01:19:45.033 --> 01:19:52.263
Before the next session, read Forouzan sections one point three to one point five — topologies are in there.

01:19:52.313 --> 01:19:56.963
Then find out what topology the GPL lab uses, and bring me an answer.

01:19:57.013 --> 01:19:59.893
You will not need a calculator until week three.

01:19:59.943 --> 01:20:02.573
A pen and a couple of loose sheets will do.

01:20:02.623 --> 01:20:07.126
See you in Session 2.
