WEBVTT

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

00:00:03.750 --> 00:00:12.700
This is the detailed video version of Session fifteen, and it is the session the last four have been building towards.

00:00:13.070 --> 00:00:20.520
One line — eleven dot ten dot three dot ten slash twenty-two — and six customers, arriving in two waves.

00:00:20.570 --> 00:00:28.130
Twelve marks, three parts, and I promise you now: not one idea in it that you do not already own.

00:00:28.180 --> 00:00:35.630
Part (a) is Session eleven. Parts (b) and (c) are Session fourteen, run six times.

00:00:35.680 --> 00:00:44.145
The only genuinely new thing is a clause in the question, and we will spend a section on it.

00:00:44.195 --> 00:00:48.235
This is not "a" question on this course.

00:00:48.285 --> 00:00:57.235
It is the highest-value question of the addressing arc: twelve marks, three parts, and it recurs on the final in this form or a close variant.

00:00:57.665 --> 00:01:06.615
If you can produce this answer cold, on blank paper, in fifteen minutes, you have taken the addressing block of the paper off the table.

00:01:06.685 --> 00:01:15.635
So here is the promise. By the end of this session the complete answer is on the page, audited, and every hard step is derived rather than asserted.

00:01:16.035 --> 00:01:23.735
Not shown to you. Derived — so that when the numbers change, and they will, the method still runs.

00:01:23.785 --> 00:01:31.345
The session is a harvest, not a challenge. Nothing new is taught today, and every step uses a method you already have.

00:01:31.395 --> 00:01:40.345
One thing before we start. Read the whole problem before you write anything — the parent block, then three organisations, then three more, and the clause that says nobody in wave one may move.

00:01:46.624 --> 00:01:49.194
Section one. Dissect the question.

00:01:49.244 --> 00:01:58.194
Every part of this problem is a lecture you have already had. What is being tested is whether your ritual survives pressure.

00:01:59.224 --> 00:02:03.794
Take the question apart before you touch a single number.

00:02:03.844 --> 00:02:12.024
Part (a): first address, last address, and the number of addresses for eleven dot ten dot three dot ten slash twenty-two.

00:02:12.074 --> 00:02:17.814
That is the Session eleven ritual. Two free marks — with a stopwatch.

00:02:17.864 --> 00:02:24.134
Part (b): three organisations wanting thirty, two hundred and fifty, and fifteen addresses.

00:02:24.184 --> 00:02:31.404
Round, sort, align. That is Session fourteen's entire lecture, applied three times.

00:02:31.454 --> 00:02:40.404
Part (c): three more customers — five hundred, a hundred, fifty. This is the part where the alignment rule decides the answer.

00:02:40.834 --> 00:02:47.634
Because of that clause. Read it twice. Wave one is concrete. Wave two must fold itself around it.

00:02:47.684 --> 00:02:56.634
Nothing in the three parts is an idea you do not already own. This question does not test cleverness.

00:02:57.107 --> 00:03:01.567
That clause is the only new pressure in the whole question.

00:03:01.617 --> 00:03:08.977
The first three organisations are live networks. They have routers, printers, servers, and opinions.

00:03:09.027 --> 00:03:17.977
Renumbering a running network means touching every machine on it — so "just shift Org1 along a bit" is not an option available to anyone.

00:03:19.077 --> 00:03:23.597
Which means wave two does not inherit a block. It inherits a shape.

00:03:23.647 --> 00:03:32.167
Whatever wave one left behind — a clean tail, or a scarred middle — is the raw material wave two has to work with.

00:03:32.217 --> 00:03:36.127
And that is why last session's ordering rule stops being a preference.

00:03:36.177 --> 00:03:44.937
With six customers and a fixed parent, wrong order does not merely strand addresses. It can leave a customer with nowhere legal to go at all.

00:03:44.987 --> 00:03:53.937
Note the shape of the difficulty: it is a constraint, not a technique. The technique is unchanged.

00:03:54.703 --> 00:04:01.593
Part (a). Four facts, and the ritual is unchanged from Session eleven.

00:04:01.643 --> 00:04:07.513
N. Thirty-two minus twenty-two is ten, two to the ten is one thousand and twenty-four.

00:04:07.563 --> 00:04:12.643
You should have that before you have finished reading the address.

00:04:12.693 --> 00:04:21.643
Mask. Twenty-two over eight is two, remainder six. Two full octets of two fifty-five, then six ones — which is two fifty-two.

00:04:21.823 --> 00:04:30.773
Two five five, two five five, two five two, zero. One division and one ladder lookup, with no binary written down.

00:04:31.853 --> 00:04:38.963
Now the AND, and the fight is in the third octet. Three in binary is six zeros and then one-one.

00:04:39.013 --> 00:04:46.853
Two fifty-two keeps the top six bits and throws away the bottom two. So three AND two fifty-two is zero.

00:04:46.903 --> 00:04:55.853
First address: eleven dot ten dot zero dot zero. Not eleven dot ten dot three dot zero — and that is the trap on this part.

00:04:56.693 --> 00:05:05.643
Last. One thousand and twenty-four is four runs of two hundred and fifty-six, so the third octet walks zero, one, two, three.

00:05:06.013 --> 00:05:11.413
Last address: eleven dot ten dot three dot two fifty-five.

00:05:11.463 --> 00:05:20.413
And there is the answer row: one thousand and twenty-four, two five five two five five two five two zero, eleven dot ten dot zero dot zero, eleven dot ten dot three dot two fifty-five.

00:05:24.133 --> 00:05:33.083
Two marks, well under a minute, once the ritual is automatic. Ten marks to go — and every one of them is Session fourteen, run once per organisation.

00:05:37.726 --> 00:05:44.586
Part (b). Three organisations, and before you place anything, round and sort.

00:05:44.636 --> 00:05:53.106
Org1 wants thirty. Thirty does not fit in sixteen, so upward to thirty-two. That is a slash twenty-seven.

00:05:53.156 --> 00:06:02.106
Org2 wants two hundred and fifty. Up to two fifty-six — a slash twenty-four, and the largest of the three by a wide margin.

00:06:02.456 --> 00:06:11.406
Org3 wants fifteen. Up to sixteen — a slash twenty-eight. Snug, with one address to spare after the two overheads.

00:06:11.956 --> 00:06:18.556
And here is the move a marker looks for first: the placement order is Org2, then Org1, then Org3.

00:06:18.606 --> 00:06:26.486
The question numbers them one, two, three. That is their numbering. Ours is largest first.

00:06:26.536 --> 00:06:35.486
Largest first is not a preference. You proved it last session, and you are about to re-prove it on this block in about ten minutes.

00:06:37.559 --> 00:06:44.599
Before the first placement, fix the template, because you are about to run it six times.

00:06:44.649 --> 00:06:52.159
One: next free address. Where did the previous block stop? That is where this one starts looking.

00:06:52.209 --> 00:06:58.489
Two: alignment. Offset divided by this block's own size — is it whole? If not, move up to the next multiple.

00:06:58.539 --> 00:07:07.479
Say that division out loud even when the answer is obvious. It is the step people skip, and it is the step the marks live in.

00:07:07.529 --> 00:07:15.079
Three and four: first address, and last address — first plus N minus one. The Session eleven ritual, unchanged.

00:07:15.129 --> 00:07:24.079
Five: the name. First address, slash the new prefix. And write it down — a design without names is a picture, not an answer.

00:07:25.469 --> 00:07:34.419
Six organisations, five sentences each. Thirty sentences, most of them arithmetic you could do while annoyed — and that is the entire twelve-mark answer.

00:07:40.959 --> 00:07:48.259
Forty-two seconds, and the whole question in one bar. Wave one decides wave two's options.

00:07:48.309 --> 00:07:57.259
There is the parent: one thousand and twenty-four addresses, from eleven dot ten dot zero dot zero to eleven dot ten dot three dot two fifty-five.

00:07:58.299 --> 00:08:02.269
Empty, for the last time in this session.

00:08:02.319 --> 00:08:09.809
Wave one, rounded: two fifty-six, thirty-two, sixteen. And re-ordered — Org2, Org1, Org3.

00:08:09.859 --> 00:08:15.099
Their numbering is on the left; ours is the arrow.

00:08:15.149 --> 00:08:24.019
Org2 takes the front door and eats exactly two fifty-six. Org1 lands at two fifty-six, Org3 at two eighty-eight.

00:08:24.069 --> 00:08:33.019
Three tenants, flush, no gaps — and the grey tail is the ISP's remaining stock: seven hundred and twenty addresses.

00:08:33.749 --> 00:08:42.699
Six months later, three more customers. Five hundred, a hundred, fifty — rounding to five twelve, one twenty-eight, sixty-four.

00:08:43.239 --> 00:08:47.639
And the clause: nobody in wave one may move.

00:08:47.689 --> 00:08:56.639
Watch Org4. It does not take the next free address. It jumps to offset five hundred and twelve — eleven dot ten dot two dot zero.

00:08:56.769 --> 00:09:04.039
That is the only legal door it has left, and the next section is nothing but that one move.

00:09:04.089 --> 00:09:13.039
Then the strip fills itself. Org5's slash twenty-five at eleven dot ten dot one dot one twenty-eight, Org6's slash twenty-six at one dot sixty-four.

00:09:13.889 --> 00:09:18.109
Backfilled into the space Org4 stepped over.

00:09:18.159 --> 00:09:25.369
And the audit. One thousand and eight allocated, sixteen unused, one thousand and twenty-four total.

00:09:25.419 --> 00:09:34.369
Six tenants, one hole, and it balances. That is the finished answer — now we derive every step of it.

00:09:35.909 --> 00:09:43.529
Now run the template three times. Five sentences each, and I will say them all.

00:09:43.579 --> 00:09:51.569
Org2 first, because it is largest. Next free is offset zero. Zero over two fifty-six is zero — whole, legal.

00:09:51.619 --> 00:10:00.569
First address eleven dot ten dot zero dot zero. Last is that plus two fifty-five: eleven dot ten dot zero dot two fifty-five. Name: eleven dot ten dot zero dot zero slash twenty-four.

00:10:07.129 --> 00:10:14.659
Org1. Next free is offset two fifty-six. Two fifty-six over thirty-two is eight — whole.

00:10:14.709 --> 00:10:20.919
Eleven dot ten dot one dot zero slash twenty-seven, last address one dot thirty-one.

00:10:20.969 --> 00:10:29.919
And notice why that door was open: the slash twenty-four ate exactly two fifty-six, which is a multiple of everything smaller.

00:10:30.279 --> 00:10:37.259
Org3. Next free is two eighty-eight. Two eighty-eight over sixteen is eighteen — whole.

00:10:37.309 --> 00:10:46.259
Eleven dot ten dot one dot thirty-two slash twenty-eight, last address one dot forty-seven. Three tenants, flush, no gaps.

00:10:48.049 --> 00:10:53.629
Allocated: two fifty-six plus thirty-two plus sixteen is three hundred and four.

00:10:53.679 --> 00:11:02.629
So the ISP still holds eleven dot ten dot one dot forty-eight through eleven dot ten dot three dot two fifty-five — seven hundred and twenty addresses.

00:11:04.629 --> 00:11:13.409
Write that range out. It is the line students skip and examiners do not, and it is worth an actual mark for one sentence about leftovers.

00:11:13.459 --> 00:11:22.409
Part (b) done: four marks banked, and the shape wave two has to live inside is now fixed.

00:11:23.425 --> 00:11:30.385
Checkpoint one. Three questions, and I want them on paper before the answers appear.

00:11:30.435 --> 00:11:38.835
One. Give all four facts for eleven dot ten dot three dot ten slash twenty-two, and name the trap in part (a).

00:11:38.885 --> 00:11:47.615
Two. Round and sort requests of thirty, two hundred and fifty and fifteen, and say which is allocated first.

00:11:47.665 --> 00:11:56.205
Three. After wave one, what exactly does the ISP still hold? Give the range and the count.

00:11:56.255 --> 00:12:05.205
One. N is one thousand and twenty-four; mask two five five, two five five, two five two, zero; first eleven dot ten dot zero dot zero; last eleven dot ten dot three dot two fifty-five.

00:12:09.845 --> 00:12:18.795
The trap is writing eleven dot ten dot three dot zero as the first address — three AND two fifty-two is zero, so that octet is zero.

00:12:21.695 --> 00:12:30.645
Two. Thirty-two, two fifty-six and sixteen — a slash twenty-seven, a slash twenty-four and a slash twenty-eight. Sorted descending: Org2 first, then Org1, then Org3.

00:12:33.215 --> 00:12:42.165
Three. Eleven dot ten dot one dot forty-eight through eleven dot ten dot three dot two fifty-five, which is seven hundred and twenty addresses. Writing that sentence is worth a mark on its own.

00:12:49.886 --> 00:12:52.526
Section two. The counterfactual.

00:12:52.576 --> 00:13:01.526
Last session you were told that smallest-first leaves scars. Here is the invoice — in this block, with these customers, in real addresses.

00:13:04.820 --> 00:13:11.180
Suppose you had done the natural thing and allocated them in the order the question numbers them.

00:13:11.230 --> 00:13:17.910
Org1 takes offset zero. Legal — zero over thirty-two is zero — and completely wrong.

00:13:17.960 --> 00:13:26.040
A thirty-two-address tenant has just taken the front door of a two-hundred-and-fifty-six-address alley.

00:13:26.090 --> 00:13:35.040
Now Org2, which needs a multiple of two fifty-six. The next free address is offset thirty-two, and thirty-two over two fifty-six is not whole.

00:13:35.450 --> 00:13:44.400
Neither is sixty-four, or one twenty-eight. The first legal door is offset two fifty-six, so that is where Org2 is forced to go.

00:13:45.300 --> 00:13:53.160
And offsets thirty-two through two fifty-five drop dead. Two hundred and twenty-four addresses, stranded in the middle of the block,

00:13:53.210 --> 00:14:02.160
unreachable by anything larger than a slash twenty-six — because a slash twenty-six is the biggest thing that fits inside that gap on its own lattice.

00:14:03.970 --> 00:14:11.220
And wave two has not even arrived yet. It is about to need every scrap of contiguous space this block has.

00:14:11.270 --> 00:14:14.420
Request order would already have spent it — on nothing.

00:14:14.470 --> 00:14:23.420
Same customers, same total demand, and two hundred and twenty-four addresses of difference. Order is not tidiness.

00:14:24.720 --> 00:14:31.650
Now price those two hundred and twenty-four addresses, because "stranded" is too soft a word.

00:14:31.700 --> 00:14:40.650
As a clean tail at the end of a block, two hundred and twenty-four contiguous addresses can be cut into a slash twenty-six, a slash twenty-seven and a slash twenty-eight, and sold.

00:14:43.020 --> 00:14:47.160
That is real inventory. Three customers' worth.

00:14:47.210 --> 00:14:56.160
As a hole between two tenants, they are mostly dead. Offsets thirty-two to two fifty-five can only house blocks that are aligned inside that gap,

00:14:56.450 --> 00:15:05.400
and the largest of those is a slash twenty-six at offset sixty-four. Everything bigger is refused, however much space the count says you have.

00:15:06.900 --> 00:15:15.310
And nobody can be asked to move. That is the clause in part (c), and it is what makes this mistake permanent rather than embarrassing.

00:15:15.360 --> 00:15:24.310
In this problem the sort is not worth style marks. It is the difference between wave two fitting and wave two failing.

00:15:25.720 --> 00:15:31.580
Back to the correct design, and part (c). Three more customers.

00:15:31.630 --> 00:15:40.580
Org4 wants five hundred. Rounds to five hundred and twelve — a slash twenty-three. This is the block that decides the question.

00:15:40.650 --> 00:15:49.600
Org5 wants a hundred, rounding to one twenty-eight — a slash twenty-five. Org6 wants fifty, rounding to sixty-four — a slash twenty-six.

00:15:50.890 --> 00:15:56.650
Both comfortable sizes, and both easy to place once Org4 has chosen.

00:15:56.700 --> 00:16:00.050
Count the free space before promising any of it.

00:16:00.100 --> 00:16:09.050
Free: eleven dot ten dot one dot forty-eight to the end — seven hundred and twenty addresses. Demanded: five twelve plus one twenty-eight plus sixty-four, which is seven hundred and four.

00:16:13.700 --> 00:16:16.750
Sixteen addresses of slack. Sixteen.

00:16:16.800 --> 00:16:22.750
If even one block starts one notch off its lattice, something in wave two becomes homeless.

00:16:22.800 --> 00:16:31.750
That margin is the whole tension of part (c), and it is why the ordering rule stops being advice.

00:16:33.927 --> 00:16:40.687
Forty-two seconds on the two hardest marks of the question — and they are decided by one division.

00:16:40.737 --> 00:16:48.287
There is the block after wave one: Org2, Org1, Org3 at the front, and the free strip behind them.

00:16:48.337 --> 00:16:53.497
Org4 wants five hundred, which rounds to five hundred and twelve.

00:16:53.547 --> 00:17:00.487
Count the doors before you look for them. One thousand and twenty-four over five hundred and twelve is two.

00:17:00.537 --> 00:17:09.487
Two doors: offset zero and offset five hundred and twelve. That is every legal position a slash twenty-three can occupy in this block — there is no third.

00:17:11.117 --> 00:17:17.487
Candidate one: the next free address, offset three hundred and four. The intuitive answer.

00:17:17.537 --> 00:17:26.487
Three hundred and four over five hundred and twelve is nought point five nine. Not whole — and watch what its own mask says: it claims to start at eleven dot ten dot zero dot zero, on top of Org2.

00:17:30.987 --> 00:17:39.937
Candidate two: eleven dot ten dot one dot one twenty-eight. Beautifully round, and the single most popular wrong answer on this question.

00:17:40.537 --> 00:17:48.287
Three eighty-four over five twelve is nought point seven five. Same disease, prettier clothes.

00:17:48.337 --> 00:17:56.197
Candidate three: offset five hundred and twelve. Five twelve over five twelve is one — whole, legal.

00:17:56.247 --> 00:18:05.197
And free, because wave one never crossed eleven dot ten dot one dot forty-seven. Org4 is eleven dot ten dot two dot zero slash twenty-three.

00:18:06.967 --> 00:18:12.457
Eleven dot ten dot one dot one twenty-eight was never slash twenty-three territory.

00:18:12.507 --> 00:18:19.627
It was slash twenty-five territory all along — and that is exactly where Org5 lands.

00:18:19.677 --> 00:18:25.797
Count the doors. Do not feel them. Parent size over block size, and check which of them are free.

00:18:25.847 --> 00:18:32.411
A block that lies about its own front door is not a block.

00:18:32.461 --> 00:18:39.041
The inventory step is one subtraction, and it changes how carefully you have to work.

00:18:39.091 --> 00:18:45.921
Free: eleven dot ten dot one dot forty-eight through eleven dot ten dot three dot two fifty-five.

00:18:45.971 --> 00:18:52.531
One thousand and twenty-four minus three hundred and four — seven hundred and twenty addresses.

00:18:52.581 --> 00:19:01.531
Demanded, after rounding: five hundred and twelve plus one hundred and twenty-eight plus sixty-four. Seven hundred and four.

00:19:02.941 --> 00:19:10.041
Slack: sixteen. And sixteen is exactly one slash twenty-eight, which is the smallest useful unit left.

00:19:10.091 --> 00:19:16.291
So the design has almost no room to be wrong. One misaligned start and a customer is homeless.

00:19:16.341 --> 00:19:24.431
That is what the inventory buys you — it tells you, before you begin, how much care this problem requires.

00:19:24.481 --> 00:19:30.911
And the slack is not waste. It is what a full block looks like when every seam has been squeezed shut.

00:19:30.961 --> 00:19:39.333
The finished design leaves exactly those sixteen addresses, in one clean piece.

00:19:39.383 --> 00:19:43.373
That sixteen is a message from the examiner.

00:19:43.423 --> 00:19:50.483
If the parent block were twice this size, almost any placement would fit, and the alignment rule would look like pedantry.

00:19:50.533 --> 00:19:55.753
You could allocate carelessly and still finish with everyone housed.

00:19:55.803 --> 00:20:03.363
With sixteen addresses of slack, there is no room to absorb a mistake. Every block must land on its own lattice, first time.

00:20:03.413 --> 00:20:12.363
Which is exactly why these numbers were chosen. They are tuned so that the correct method fits, and a plausible wrong method does not.

00:20:13.363 --> 00:20:22.313
When an exam problem has a suspiciously tight margin, that margin IS the question. Notice it, and you know what is being tested.

00:20:24.549 --> 00:20:27.959
Checkpoint two. Paper first.

00:20:28.009 --> 00:20:33.529
One. Round wave two's three requests and give the total demand.

00:20:33.579 --> 00:20:40.919
Two. How much free space is there after wave one, and how much slack does that leave?

00:20:40.969 --> 00:20:49.919
Three. In the request-order counterfactual, exactly which offsets are stranded — and what is the largest block that could still be placed inside them?

00:20:51.079 --> 00:21:00.029
One. Five hundred rounds to five twelve, a slash twenty-three. A hundred to one twenty-eight, a slash twenty-five. Fifty to sixty-four, a slash twenty-six. Total demand seven hundred and four.

00:21:04.099 --> 00:21:13.049
Two. Free is one thousand and twenty-four minus three hundred and four — seven hundred and twenty, from eleven dot ten dot one dot forty-eight. Slack is sixteen.

00:21:15.579 --> 00:21:24.529
Three. Offsets thirty-two to two fifty-five. The largest block that fits is a slash twenty-six at offset sixty-four — sixty-four divides by sixty-four, and sixty-four plus sixty-four is one twenty-eight, still inside the gap.

00:21:33.449 --> 00:21:37.149
Section three. Org4's slash twenty-three.

00:21:37.199 --> 00:21:46.149
The two hardest marks on the final. They are decided by one division, and by refusing to trust the word "next".

00:21:47.416 --> 00:21:55.446
Three addresses are candidates. Two of them are wrong, and one of the two is wrong in a way that looks right.

00:21:55.496 --> 00:22:03.546
First, count. A five-hundred-and-twelve-address block inside a one-thousand-and-twenty-four-address parent has exactly two legal doors.

00:22:03.596 --> 00:22:12.546
One thousand and twenty-four over five hundred and twelve is two. Offset zero, and offset five hundred and twelve. Count them — do not feel for them.

00:22:13.966 --> 00:22:21.616
Candidate one: eleven dot ten dot one dot forty-eight, offset three hundred and four. The next free address.

00:22:21.666 --> 00:22:28.056
This is what the phrase "next free" produces, and it is the intuitive answer.

00:22:28.106 --> 00:22:37.056
Candidate two: eleven dot ten dot one dot one twenty-eight, offset three hundred and eighty-four. Round, tidy, and satisfying.

00:22:37.116 --> 00:22:41.736
This is the single most popular wrong answer on the question.

00:22:41.786 --> 00:22:50.736
Candidate three: eleven dot ten dot two dot zero, offset five hundred and twelve. Not adjacent to anything, and not obviously attractive.

00:22:51.426 --> 00:23:00.376
Before we go on, decide which one you would have written. The answer to that tells you which habit you are still carrying.

00:23:00.849 --> 00:23:05.109
Now execute each one. No judgement, no intuition — one division each.

00:23:05.159 --> 00:23:14.109
Three hundred and four over five hundred and twelve is nought point five nine. Not whole, so it is not a legal start.

00:23:14.839 --> 00:23:23.789
And it is worse than illegal, it is dishonest: run that block's own slash twenty-three mask over its own first address, and the block claims to start at eleven dot ten dot zero dot zero — on top of Org2.

00:23:26.739 --> 00:23:35.689
Three hundred and eighty-four over five hundred and twelve is nought point seven five. Not whole either — same disease, prettier clothes.

00:23:37.469 --> 00:23:46.419
Roundness in decimal is not alignment in binary. One twenty-eight looks round to you; five twelve is what the mask cares about.

00:23:46.959 --> 00:23:52.669
Five hundred and twelve over five hundred and twelve is one. Whole, legal.

00:23:52.719 --> 00:23:59.579
And free — wave one never crossed eleven dot ten dot one dot forty-seven, so there is nothing in the way.

00:23:59.629 --> 00:24:08.389
So Org4 is eleven dot ten dot two dot zero slash twenty-three, running to eleven dot ten dot three dot two fifty-five.

00:24:08.439 --> 00:24:13.519
In one stroke it owns the entire back half of the parent block.

00:24:13.569 --> 00:24:20.809
And there is the sharpest statement of the alignment rule I know: a block that lies about its own front door is not a block.

00:24:20.859 --> 00:24:23.929
Two marks, and they fall out of a single division.

00:24:23.979 --> 00:24:32.929
It does not take the next free address. It takes the only legal one — and "next free" is the habit that costs the marks.

00:24:35.116 --> 00:24:41.316
Underneath all of that is one division, and it is worth stating as a rule.

00:24:41.366 --> 00:24:50.316
Doors equals parent size over block size. A slash twenty-three has two doors in this block. A slash twenty-five has eight. A slash twenty-eight has sixty-four.

00:24:52.326 --> 00:25:00.876
One division tells you how much freedom a block has — and it confirms, again, that the biggest block has the least.

00:25:00.926 --> 00:25:09.876
So check the door count before you place the biggest block. If a block has two doors and one of them is occupied, there is exactly one answer and no judgement involved.

00:25:11.196 --> 00:25:16.226
That is a very comfortable position to be in under exam pressure.

00:25:16.276 --> 00:25:23.886
And if both are occupied, the customer cannot be served. That is not a design failure to argue with. It is arithmetic,

00:25:23.936 --> 00:25:28.136
and the honest answer is to ask the registry for a bigger parent block.

00:25:28.186 --> 00:25:37.136
Count the doors. Do not feel them. That sentence is worth writing at the top of any allocation question you meet.

00:25:39.429 --> 00:25:47.039
This is the whole question as a machine. Every part, and the wrong answers executed rather than described.

00:25:47.089 --> 00:25:56.039
State one is part (a): the parent, and its four facts. One thousand and twenty-four, two five five two five five two five two zero, and the two ends.

00:25:56.979 --> 00:26:02.999
Notice the third octet in the AND panel — three against two fifty-two, and nothing survives.

00:26:03.049 --> 00:26:11.999
State two: wave one's three requests, rounded, and then re-ordered. Their numbering is one, two, three; ours is two, one, three.

00:26:14.279 --> 00:26:23.229
State three places them. Each block carries its own division inside it — zero over two fifty-six, two fifty-six over thirty-two, two eighty-eight over sixteen.

00:26:27.449 --> 00:26:36.119
And the grey tail is named: eleven dot ten dot one dot forty-eight to three dot two fifty-five, seven hundred and twenty addresses.

00:26:36.169 --> 00:26:45.119
State four is the counterfactual. Same customers, allocated in request order, and there is the red band: offsets thirty-two to two fifty-five, two hundred and twenty-four addresses, dead.

00:26:49.979 --> 00:26:55.159
Same total demand. Different order. That is the entire difference.

00:26:55.209 --> 00:27:04.159
State five is the inventory panel: seven hundred and twenty free, seven hundred and four demanded, sixteen of slack. Before anything is placed.

00:27:05.989 --> 00:27:14.939
State six is the finished design. Org4 in the back half, Org5 and Org6 backfilled into the strip, and one hole of sixteen at eleven dot ten dot one dot forty-eight.

00:27:20.609 --> 00:27:24.809
The audit line closes at one thousand and twenty-four.

00:27:24.859 --> 00:27:33.759
And the last state is the wrong answer executed: Org4 placed at the next free address, with the machine refusing to pretend it is a block.

00:27:33.809 --> 00:27:42.759
Three hundred and four over five twelve, and the block's own mask putting it on top of Org2. Open it and try to break it — change the requests, and see which orders survive.

00:27:47.959 --> 00:27:53.769
Checkpoint three, and these are exam questions rather than recall.

00:27:53.819 --> 00:28:02.769
One. How many legal doors does a slash twenty-five have inside a slash twenty-two, and what are the first three offsets?

00:28:03.179 --> 00:28:12.129
Two. Show, in one line each, why eleven dot ten dot one dot forty-eight slash twenty-three and eleven dot ten dot one dot one twenty-eight slash twenty-three are both impossible.

00:28:15.029 --> 00:28:23.979
Three. Org4 is placed at eleven dot ten dot two dot zero slash twenty-three. Give its last address, and say how much of the parent block it owns.

00:28:25.519 --> 00:28:34.469
One. One thousand and twenty-four over one twenty-eight is eight doors. The first three offsets are zero, one twenty-eight and two fifty-six.

00:28:38.399 --> 00:28:47.349
Two. Three hundred and four over five twelve is nought point five nine, not whole; three eighty-four over five twelve is nought point seven five, not whole. Neither offset is a multiple of five hundred and twelve, so neither can be the first address of a slash twenty-three.

00:28:53.259 --> 00:29:02.209
Three. Last address eleven dot ten dot three dot two fifty-five. It owns five hundred and twelve of the one thousand and twenty-four addresses — exactly the back half.

00:29:07.393 --> 00:29:10.953
Section four. The leftovers, and the marks.

00:29:11.003 --> 00:29:19.953
Two organisations still to place, one audit line to write, and a mark scheme that rewards sentences about leftovers.

00:29:21.756 --> 00:29:29.536
With Org4 in the back half, the rest is easy — and that is a sign the hard decision was made correctly.

00:29:29.586 --> 00:29:38.536
Org5 wants one twenty-eight. The free strip runs from offset three hundred and four to five hundred and twelve. Multiples of one twenty-eight in there: three eighty-four.

00:29:39.956 --> 00:29:48.516
Three eighty-four is eleven dot ten dot one dot one twenty-eight — free, legal, and it fits with room behind it.

00:29:48.566 --> 00:29:54.736
The most popular wrong answer on the whole question turns out to be the right address for a different customer.

00:29:54.786 --> 00:30:03.736
Eleven dot ten dot one dot one twenty-eight was never slash twenty-three territory. It was slash twenty-five territory all along.

00:30:04.376 --> 00:30:11.926
Org6 wants sixty-four. Offset three hundred and twenty — three twenty over sixty-four is five, whole.

00:30:11.976 --> 00:30:19.376
Eleven dot ten dot one dot sixty-four slash twenty-six, through one dot one twenty-seven.

00:30:19.426 --> 00:30:28.376
And what is left is eleven dot ten dot one dot forty-eight through one dot sixty-three. Sixteen addresses — exactly the slack we counted before we started.

00:30:30.576 --> 00:30:39.526
Not luck. Sort-and-align squeezed every seam shut, so the leftovers ended up as one clean piece rather than three scraps.

00:30:41.156 --> 00:30:49.106
Here is the complete answer, and I am going to read it the way you should write it.

00:30:49.156 --> 00:30:58.106
Wave one. Org2: eleven dot ten dot zero dot zero slash twenty-four. Org1: eleven dot ten dot one dot zero slash twenty-seven. Org3: eleven dot ten dot one dot thirty-two slash twenty-eight.

00:31:02.516 --> 00:31:08.226
Two fifty-six plus thirty-two plus sixteen — three hundred and four.

00:31:08.276 --> 00:31:17.226
Wave two, backfilled into the old free strip. Org6: eleven dot ten dot one dot sixty-four slash twenty-six. Org5: eleven dot ten dot one dot one twenty-eight slash twenty-five.

00:31:22.236 --> 00:31:30.026
Sixty-four plus one twenty-eight — one hundred and ninety-two, all inside the space wave one left.

00:31:30.076 --> 00:31:39.026
And Org4: eleven dot ten dot two dot zero slash twenty-three, last address eleven dot ten dot three dot two fifty-five.

00:31:39.306 --> 00:31:44.886
Five hundred and twelve addresses, on the only legal door it had.

00:31:44.936 --> 00:31:53.886
Unused: eleven dot ten dot one dot forty-eight through one dot sixty-three. And name it with a prefix — eleven dot ten dot one dot forty-eight slash twenty-eight,

00:31:54.876 --> 00:32:01.526
because those sixteen happen to be aligned, which is what makes them sellable.

00:32:01.576 --> 00:32:10.526
And the audit. Two fifty-six plus thirty-two plus sixteen plus five twelve plus one twenty-eight plus sixty-four is one thousand and eight. Plus sixteen unused: one thousand and twenty-four.

00:32:13.836 --> 00:32:17.306
It balances, and that line is the last thing you write.

00:32:17.356 --> 00:32:26.306
When a written answer can be drawn with no gaps, no overlaps and one honest hole, it is finished.

00:32:26.789 --> 00:32:30.209
The picture is what checks the arithmetic.

00:32:30.259 --> 00:32:39.209
Org2 owns the first quarter. A single slash twenty-four at the front, and the only tenant large enough to be visible from across the room.

00:32:39.839 --> 00:32:48.789
The second quarter is crowded: Org1, Org3, Org6, Org5 — four tenants — and the only vacancy, sixteen addresses at eleven dot ten dot one dot forty-eight.

00:32:53.439 --> 00:33:02.389
And Org4 owns the entire back half. One block, five hundred and twelve addresses, sitting on the only legal door it could have used.

00:33:02.789 --> 00:33:11.739
Draw it. A to-scale bar takes thirty seconds and makes an overlap or a gap visible instantly — faster than any recheck of the arithmetic.

00:33:14.723 --> 00:33:21.573
Now let me show you where the twelve marks actually live, because it changes what you practise.

00:33:21.623 --> 00:33:30.573
Part (a): two marks. N, mask, first, last. Pure ritual — Session eleven, and it should take under a minute.

00:33:31.153 --> 00:33:40.103
Part (b): four marks. Three organisations rounded, sorted, placed and named. Pure ritual — Session fourteen, three times.

00:33:41.703 --> 00:33:50.653
Part (c), Org5 and Org6: two marks. Two more placements in the leftover strip. Session fourteen, twice more.

00:33:52.343 --> 00:34:01.293
Part (c), Org4's slash twenty-three: two marks. The only legal door. This is the separator — where a B becomes an A — and it is one division.

00:34:04.453 --> 00:34:10.673
And the unused range plus the audit line: two marks. Two sentences about leftovers.

00:34:10.723 --> 00:34:16.083
Those are the cheapest marks on the final, and the ones most often left blank.

00:34:16.133 --> 00:34:25.083
Add it up: seven of the twelve are ritual you already own. Two are one division. And two are sentences. Write the sentences.

00:34:27.672 --> 00:34:33.462
The design is finished. Now stand behind the counter and sell what is left.

00:34:33.512 --> 00:34:42.102
There is the finished block, and there is the stock: sixteen addresses at eleven dot ten dot one dot forty-eight. One slash twenty-eight.

00:34:42.152 --> 00:34:45.722
A seventh organisation is on the phone.

00:34:45.772 --> 00:34:53.502
They want twenty. Twenty rounds up to thirty-two, and the largest block in stock is a slash twenty-eight.

00:34:53.552 --> 00:35:02.502
Refused — and notice the reason panel: not "we are out of addresses", but "we have no thirty-two-shaped, thirty-two-aligned space".

00:35:04.282 --> 00:35:10.082
Twelve, though. Twelve rounds up to sixteen, and sixteen is exactly what is on the shelf.

00:35:10.132 --> 00:35:17.672
Served: eleven dot ten dot one dot forty-eight slash twenty-eight, and the stock goes to zero.

00:35:17.722 --> 00:35:22.122
Reset. A customer wanting five rounds up to eight — a slash twenty-nine.

00:35:22.172 --> 00:35:31.122
The shelf splits: one slash twenty-nine sold, one slash twenty-nine left. Watch the inventory line change shape rather than merely shrink.

00:35:32.912 --> 00:35:41.302
Now ten. Ten rounds to sixteen, and only a slash twenty-nine is left. Refused — with eight addresses sitting free.

00:35:41.352 --> 00:35:45.592
The total is not the constraint. The shape is.

00:35:45.642 --> 00:35:54.052
And the sneaky answer: give them eight here and eight from somewhere else. Still refused, and the panel says why —

00:35:54.102 --> 00:36:00.672
that is two blocks, two prefixes, two entries. The customer asked for one network.

00:36:00.722 --> 00:36:08.062
And the rule, which makes every one of these answers obvious before you calculate: quote your stock as prefixes, not as a count.

00:36:08.112 --> 00:36:17.062
"One slash twenty-eight" answers every question that "sixteen addresses" leaves open. Open it and serve a few customers yourself.

00:36:20.045 --> 00:36:26.565
Let me do that last exchange properly on paper, because it is a favourite follow-up part.

00:36:26.615 --> 00:36:32.715
Org7 wants twenty addresses. Twenty rounds up to thirty-two — a slash twenty-seven.

00:36:32.765 --> 00:36:41.175
And the ISP's entire remaining stock is sixteen addresses at eleven dot ten dot one dot forty-eight.

00:36:41.225 --> 00:36:50.175
So the answer is: refused. Not because the ISP is unhelpful, but because there is no slash-twenty-seven-shaped space anywhere in the block.

00:36:51.035 --> 00:36:59.235
Write that reason down. "No space" is worth nothing; "no aligned thirty-two-address space" is the mark.

00:36:59.285 --> 00:37:05.535
And the sneaky wrong answer: give them the sixteen, plus sixteen from somewhere else.

00:37:05.585 --> 00:37:12.015
No. A block is one range with one prefix, and that has been true since Session ten.

00:37:12.065 --> 00:37:18.765
Which is why the ISP's inventory is not "sixteen addresses". It is "one slash twenty-eight".

00:37:18.815 --> 00:37:27.765
Quote your stock as prefixes rather than as a count, and every refusal answers itself before you have to justify it.

00:37:29.378 --> 00:37:36.578
That refusal rests on a fact from Session ten, and it is worth restating from the sales side.

00:37:36.628 --> 00:37:45.578
A prefix names a contiguous, aligned range, and nothing else. That is what a mask does: one AND, one comparison, one answer.

00:37:46.438 --> 00:37:53.028
Two ranges would need two entries and two ANDs. That is two blocks by definition.

00:37:53.078 --> 00:37:59.928
So "sixteen here and sixteen there" is two blocks, not one. The customer asked for one network.

00:37:59.978 --> 00:38:06.908
Two networks is a different, and usually unwelcome, product — they would need a router between them.

00:38:06.958 --> 00:38:15.908
And it is why the hole is genuinely dead stock. Until a customer of sixteen or fewer appears, those addresses cannot be sold to anyone —

00:38:16.158 --> 00:38:19.008
however many addresses are technically "free".

00:38:19.058 --> 00:38:28.008
The mask has to be able to find the block in one instruction. That single sentence is the whole of contiguity, alignment and this refusal.

00:38:30.971 --> 00:38:35.461
Checkpoint four, and this is the last one.

00:38:35.511 --> 00:38:42.791
One. A customer wants twelve addresses. Can the ISP serve them from the finished design? Give the block.

00:38:42.841 --> 00:38:50.761
Two. A customer wants forty. What do you tell them, and why is the total free space irrelevant?

00:38:50.811 --> 00:38:55.951
Three. Write the audit line for the complete design.

00:38:56.001 --> 00:39:04.951
One. Yes. Twelve rounds to sixteen, and there is exactly one slash twenty-eight in stock: eleven dot ten dot one dot forty-eight slash twenty-eight, running to one dot sixty-three.

00:39:08.431 --> 00:39:17.381
Two. Refused. Forty rounds to sixty-four, and the largest block in stock is a slash twenty-eight. The total free space is sixteen — but even if it were larger, the question is whether a sixty-four-shaped, sixty-four-aligned space exists. It does not.

00:39:24.361 --> 00:39:33.311
Three. Two fifty-six plus thirty-two plus sixteen plus five twelve plus one twenty-eight plus sixty-four is one thousand and eight allocated, plus sixteen unused, equals one thousand and twenty-four. It balances.

00:39:42.818 --> 00:39:45.868
Five ways to lose these marks.

00:39:45.918 --> 00:39:50.338
Wrong: allocate them in the order the question numbers them.

00:39:50.388 --> 00:39:59.338
Right: sort descending first. Org2 before Org1, every time — and on this block it is worth two hundred and twenty-four addresses.

00:40:01.008 --> 00:40:06.408
Wrong: Org4 goes at eleven dot ten dot one dot forty-eight, the next free address.

00:40:06.458 --> 00:40:15.408
Right: eleven dot ten dot two dot zero. A slash twenty-three has two doors in a slash twenty-two — count them. Three hundred and four over five twelve is not whole.

00:40:18.808 --> 00:40:24.058
Wrong: eleven dot ten dot one dot one twenty-eight, which is nicely round.

00:40:24.108 --> 00:40:33.058
Right: still no. Three eighty-four over five twelve is nought point seven five. Roundness in decimal is not alignment in binary.

00:40:34.228 --> 00:40:37.718
Wrong: wave two can shuffle wave one along a little.

00:40:37.768 --> 00:40:46.718
Right: read the clause. Nobody moves — and renumbering a live network is not a thing an exam answer is allowed to do.

00:40:46.958 --> 00:40:52.318
Wrong: every organisation has a block, so the answer is complete.

00:40:52.368 --> 00:41:01.318
Right: not until the unused range is named and the audit line is written. Those are two marks of sentences, and they take fifteen seconds.

00:41:03.953 --> 00:41:12.793
I promised at the start that nothing here would be new. Let me collect the whole twelve-mark answer and show you it is true.

00:41:12.843 --> 00:41:21.793
Part (a): one Session eleven ritual. N, mask, AND, plus N minus one. Two marks, under a minute.

00:41:22.283 --> 00:41:30.513
Parts (b) and (c): six Session fourteen rituals. Round, sort, largest first, align — six times, five sentences each. Eight marks.

00:41:30.563 --> 00:41:39.513
Plus two sentences about leftovers: the unused range, and the audit line. Two marks, and the cheapest on the paper.

00:41:40.583 --> 00:41:49.533
Notice how it feels: routine. On the final this page is not a challenge — it is a harvest, and the only way to lose it is to skip the sort.

00:41:54.420 --> 00:41:58.310
Four things you should be able to do now.

00:41:58.360 --> 00:42:07.310
One: run the whole twelve-mark question from a blank page in about fifteen minutes. No notes, and no hesitation at the octet boundaries.

00:42:07.940 --> 00:42:16.890
Two: count a block's legal doors with one division — parent size over block size — and check whether any of them are free.

00:42:17.520 --> 00:42:26.470
Three: say what the ISP still holds, both ways. "Seven hundred and twenty addresses, eleven dot ten dot one dot forty-eight to three dot two fifty-five" — and later, "one slash twenty-eight".

00:42:30.660 --> 00:42:38.090
Four: close with the audit line. Allocated plus unused equals total, always the last thing written.

00:42:38.140 --> 00:42:47.090
Homework is the full sheet from a blank page, timed. Fifteen minutes is exam pace, and the variant sets prove the method transfers.

00:42:50.386 --> 00:42:53.566
Three things before the next session.

00:42:53.616 --> 00:43:00.786
One: the full sheet from blank paper, timed. Fifteen minutes. Not reading the solution — producing it.

00:43:00.836 --> 00:43:07.566
Time yourself honestly and write the number down, because the number is the diagnosis.

00:43:07.616 --> 00:43:15.656
Two: the variant request sets. Forty, two hundred, twenty — then four hundred, one twenty, sixty.

00:43:15.706 --> 00:43:24.656
Sorted and rounded those are two fifty-six, sixty-four, thirty-two, and then five twelve, one twenty-eight, sixty-four. Notice the shape is identical to today's. That is the point.

00:43:29.766 --> 00:43:34.316
Three: read the aggregation pages of section eighteen point four.

00:43:34.366 --> 00:43:43.316
Because we have spent three weeks cutting blocks apart. Next session we glue them back together — and it is the reason the Internet's routers have not drowned.

00:43:43.376 --> 00:43:52.326
If your fifteen-minute run comes in clean, this topic is finished for you. If it does not, the gap is drill, and drill is homework.

00:43:55.192 --> 00:44:01.062
One last thing, because this question does not always arrive in these clothes.

00:44:01.112 --> 00:44:08.182
Disguise one: a different parent. A slash twenty-one, or a slash twenty, instead of a slash twenty-two.

00:44:08.232 --> 00:44:14.702
The offsets get bigger; nothing else changes. Your divisions get one digit longer.

00:44:14.752 --> 00:44:21.322
Disguise two: a different customer count. Four customers, or eight, in one wave or three.

00:44:21.372 --> 00:44:26.872
More rituals, same ritual — and the sort still decides everything.

00:44:26.922 --> 00:44:33.792
Disguise three: a different forbidden clause. "Customer two has already been billed and cannot be moved."

00:44:33.842 --> 00:44:38.102
Same constraint, new wording: wave one is concrete.

00:44:38.152 --> 00:44:47.102
In every disguise the method is identical: round, sort, largest first, align, audit — and name the leftovers.

00:44:49.959 --> 00:44:51.739
That is Session fifteen.

00:44:51.789 --> 00:44:57.519
Round, sort, align, audit — six customers, and zero surprises.

00:44:57.569 --> 00:45:06.519
Part (a) is one Session eleven ritual. Parts (b) and (c) are six Session fourteen rituals. And two of the twelve marks are sentences about leftovers.

00:45:09.679 --> 00:45:18.629
Count the doors — parent size over block size — and never trust the word "next". "Next free" is the habit that costs the two hardest marks on the paper.

00:45:20.069 --> 00:45:27.499
And when the block is full, quote your stock as prefixes rather than as a count, and every refusal answers itself.

00:45:27.549 --> 00:45:34.459
Next session we go the other way: we glue blocks back together, and find out why the routing tables have not drowned.

00:45:34.509 --> 00:45:38.597
I will see you there.
