WEBVTT

00:00:00.000 --> 00:00:05.740
Welcome back to CSE 316 — Data Communication and Networking, and welcome back after the midterm.

00:00:05.790 --> 00:00:12.860
This is the detailed video version of Session fourteen, and it is the bridge session.

00:00:12.910 --> 00:00:20.630
Equal subnetting from Session twelve becomes the full allocation discipline that next week's ISP problem needs.

00:00:20.680 --> 00:00:27.620
There is exactly one new idea: blocks of different sizes can share one parent, if you round up, sort, and align.

00:00:27.670 --> 00:00:36.620
Everything else is drill — and the drill is what makes it worth twelve marks in a fortnight.

00:00:37.325 --> 00:00:40.295
New week, new customer.

00:00:40.345 --> 00:00:45.795
One slash twenty-four — two hundred and fifty-six addresses. And three departments.

00:00:45.845 --> 00:00:51.095
Engineering wants a hundred and twenty. Accounts wants sixty. Reception wants ten.

00:00:51.145 --> 00:00:59.005
Before the midterm you knew exactly one move: equal pieces. So cut quarters — sixty-four each.

00:00:59.055 --> 00:01:05.455
And I claim you have just failed all three departments. Not one. All three, in three different ways.

00:01:05.505 --> 00:01:14.265
Write down what you think those three failures are. One of them is obvious; the other two are the ones equal cutting hides.

00:01:14.315 --> 00:01:23.265
The session is one idea and three rules: a slash twenty-five, a slash twenty-six and a slash twenty-eight can live peacefully inside one slash twenty-four.

00:01:24.735 --> 00:01:33.685
Write a hundred and twenty, sixty and ten in the corner of your page. They stay there all session, and they are answered in the last five minutes.

00:01:36.436 --> 00:01:39.686
Section one. The freedom, and its price.

00:01:39.736 --> 00:01:41.856
Unequal pieces, one parent.

00:01:41.906 --> 00:01:50.856
The freedom is real, and it is not free. The price is three rules, and the whole lecture is those three rules.

00:01:52.027 --> 00:01:58.497
Equal cutting has genuinely run out of moves, rather than merely being inelegant.

00:01:58.547 --> 00:02:04.367
Quarters of sixty-four. A hundred and twenty machines will not go into sixty-four addresses.

00:02:04.417 --> 00:02:09.467
Refused outright, before anything else is even considered.

00:02:09.517 --> 00:02:14.067
Fine — halves of a hundred and twenty-eight, then. Now Engineering fits.

00:02:14.117 --> 00:02:20.297
But you own two pieces and you have three departments. There is nowhere to put the third.

00:02:20.347 --> 00:02:26.267
Equal cutting has exactly one dial: how many pieces. Two, four, eight, sixteen.

00:02:26.317 --> 00:02:32.687
That is the entire range of the tool, and none of the settings solves this.

00:02:32.737 --> 00:02:38.547
So the request list is unequal, and the design has to be allowed to be unequal too.

00:02:38.597 --> 00:02:47.547
Notice that this is a fit problem, not an arithmetic problem. The arithmetic has not changed at all since Session eleven.

00:02:48.970 --> 00:02:52.370
So here is the object we are building today.

00:02:52.420 --> 00:02:59.380
A slash twenty-five, a slash twenty-six and a slash twenty-eight, all inside one slash twenty-four.

00:02:59.430 --> 00:03:06.830
Three blocks of three different sizes, sharing one parent, with no gaps and no overlaps.

00:03:06.880 --> 00:03:15.410
And every piece is still a block. So every piece still obeys the Session eleven ritual: N, mask, first address, last address.

00:03:15.460 --> 00:03:20.080
Nothing you have learned is being replaced.

00:03:20.130 --> 00:03:25.860
And every piece is still a subnet, so "usable" is still N minus two.

00:03:25.910 --> 00:03:31.030
The only new thing is that the pieces are allowed to be different sizes from each other.

00:03:31.080 --> 00:03:40.030
If that feels like a small change, that is the right reaction. One freed constraint — and three rules to keep it legal.

00:03:41.289 --> 00:03:44.069
Rule one. Round up.

00:03:44.119 --> 00:03:53.069
Sizes are powers of two, with no exceptions. So Engineering's hundred and twenty becomes a hundred and twenty-eight — a slash twenty-five, with eight seats spare.

00:03:55.529 --> 00:03:59.289
And that spare is not waste. It is the cost of legality.

00:03:59.339 --> 00:04:07.319
Allocating exactly a hundred and twenty addresses makes the whole design wrong from the first line.

00:04:07.369 --> 00:04:14.129
Accounts: sixty rounds to sixty-four. A slash twenty-six — snug, with four to spare.

00:04:14.179 --> 00:04:19.039
And Reception: ten rounds up to sixteen. A slash twenty-eight.

00:04:19.089 --> 00:04:23.039
Up, always up. Ten machines do not fit in eight addresses.

00:04:23.089 --> 00:04:31.629
Add them: a hundred and twenty-eight, plus sixty-four, plus sixteen, is two hundred and eight of the two hundred and fifty-six demanded.

00:04:31.679 --> 00:04:38.972
So it should fit. Whether it does fit is rules two and three.

00:04:39.022 --> 00:04:45.712
All three rules on one slide, and then we spend the rest of the session on them.

00:04:45.762 --> 00:04:51.872
Rule one: round up. Every request becomes the next power of two, upward, never downward.

00:04:51.922 --> 00:04:59.772
Because no other block size exists — a "block of a hundred and twenty" cannot be written as a prefix at all.

00:04:59.822 --> 00:05:06.032
Rule two: sort descending. Place the largest block first, then the next, and so on.

00:05:06.082 --> 00:05:13.312
Because the largest block has the fewest legal starting positions, so it should choose while it still can.

00:05:13.362 --> 00:05:18.452
Rule three: align. Every block starts on a multiple of its own size.

00:05:18.502 --> 00:05:25.782
That is Session eleven's divisibility rule, promoted to law. A block that fails it is not a block.

00:05:25.832 --> 00:05:30.862
And then audit: allocated plus free equals total. Write the line out.

00:05:30.912 --> 00:05:37.252
It catches your own errors before a grader does, and it is the cheapest mark on the paper.

00:05:37.302 --> 00:05:46.252
That is the whole lecture. Five moves, in that order, and the design falls out — in ninety seconds, with no legal alternative.

00:05:46.312 --> 00:05:55.262
Rule three is the one with teeth. Rules one and two exist mostly to make rule three pass without a fight.

00:05:56.889 --> 00:06:02.619
Now rule three properly, because it is the one that decides everything.

00:06:02.669 --> 00:06:10.169
A one-twenty-eight-block has two legal doors inside a slash twenty-four: offset zero, and offset one twenty-eight.

00:06:10.219 --> 00:06:14.559
There is no third option and no argument to be had.

00:06:14.609 --> 00:06:20.919
A sixty-four-block has four. A thirty-two-block has eight. A sixteen-block has sixteen.

00:06:20.969 --> 00:06:26.089
Multiples of its own size, every time, all the way down.

00:06:26.139 --> 00:06:35.089
So the largest tenant is the fussiest. It has the least freedom, and it is the one most likely to be refused if it arrives late.

00:06:35.709 --> 00:06:44.659
Which is exactly why rule two says largest first: place the fussiest tenant while the building is empty, and every other tenant still finds a door behind it.

00:06:45.419 --> 00:06:53.872
And say this in your head every time you place a block: next FREE is not next LEGAL.

00:06:54.962 --> 00:07:01.272
Forty-two seconds, and the whole argument for why the order is not a matter of taste.

00:07:01.322 --> 00:07:06.472
There are the three requests, and the two failures of equal cutting side by side.

00:07:06.522 --> 00:07:15.472
Quarters refuse Engineering. Halves give you two rooms for three departments. One dial, and neither setting works.

00:07:15.532 --> 00:07:22.962
Round up. A hundred and twenty becomes a hundred and twenty-eight, sixty becomes sixty-four, ten becomes sixteen.

00:07:23.012 --> 00:07:31.702
And underneath: two hundred and eight of two hundred and fifty-six. It should fit — which is a different claim from "it does".

00:07:31.752 --> 00:07:37.252
Rule three, with a legal case and an illegal one. One twenty-eight over sixty-four is two — legal.

00:07:37.302 --> 00:07:46.252
Sixteen over sixty-four is nought point two five — and worse: run that block's own mask over its own first address and the AND says it starts at zero.

00:07:48.482 --> 00:07:54.402
Now the lattice. A slash twenty-five has two doors. A slash twenty-six has four.

00:07:54.452 --> 00:08:01.122
Those tick marks are not decoration — they are every legal starting position that exists.

00:08:01.172 --> 00:08:05.342
Eight for a slash twenty-seven, sixteen for a slash twenty-eight.

00:08:05.392 --> 00:08:13.302
Two, four, eight, sixteen. The bigger the piece, the fewer places it is allowed to stand.

00:08:13.352 --> 00:08:21.122
So the largest goes first, while both of its doors are still open. Then the slash twenty-six, then the slash twenty-eight.

00:08:21.172 --> 00:08:27.642
Sorting descending does not merely avoid trouble. It manufactures the alignment.

00:08:27.692 --> 00:08:31.732
And the five moves, with the audit line underneath.

00:08:31.782 --> 00:08:40.732
Round up, sort, largest first, align, audit. Run them in order and today's design takes ninety seconds.

00:08:41.908 --> 00:08:49.908
Now the mechanism, because "largest first" is easy to remember and easy to forget the reason for.

00:08:49.958 --> 00:08:58.708
A big block placed first lands on offset zero. And zero is a multiple of absolutely everything, so the check passes trivially.

00:08:58.758 --> 00:09:03.598
And it leaves the next start at a multiple of the big block's size.

00:09:03.648 --> 00:09:07.808
Which is automatically a multiple of every smaller power of two.

00:09:07.858 --> 00:09:16.808
A hundred and twenty-eight is a multiple of sixty-four, of thirty-two, of sixteen. So the next tenant, being smaller, finds its door already open.

00:09:19.058 --> 00:09:26.608
So rule three passes for free. That is not a coincidence and it is not luck — it is what sorting descending is FOR.

00:09:26.658 --> 00:09:35.608
And the converse is the whole of section three: place a small block first and the next boundary is at a multiple of the small size, which the big block cannot use.

00:09:40.288 --> 00:09:44.388
Checkpoint one. Stop the video.

00:09:44.438 --> 00:09:52.718
One. Round up these requests and give each prefix: two hundred, thirty-three, five, sixty-five.

00:09:52.768 --> 00:10:01.718
Two. How many legal starting offsets does a slash twenty-seven have inside a slash twenty-four, and what are the first three?

00:10:02.378 --> 00:10:09.248
Three. Why is "allocate exactly the number of addresses requested" wrong, in one sentence?

00:10:09.298 --> 00:10:10.228
Answers.

00:10:10.278 --> 00:10:19.228
One. Two hundred goes to two fifty-six, a slash twenty-four. Thirty-three to sixty-four, a slash twenty-six. Five to eight, a slash twenty-nine. And sixty-five to a hundred and twenty-eight, a slash twenty-five — because sixty-five does not fit in sixty-four.

00:10:23.728 --> 00:10:32.678
Two. A slash twenty-seven is thirty-two addresses, so eight legal offsets — the multiples of thirty-two. The first three are nought, thirty-two and sixty-four.

00:10:40.068 --> 00:10:49.018
Three. Because block sizes are powers of two, so a block of exactly that many addresses cannot be expressed as a prefix, and no mask can find it.

00:10:53.166 --> 00:10:55.636
Section two. The worked design.

00:10:55.686 --> 00:11:01.936
Fourteen dot twenty-four dot seventy-four dot zero, slash twenty-four, largest first.

00:11:01.986 --> 00:11:10.936
This is Forouzan's own Example eighteen point five, in this session's story. The textbook and this design agree number for number.

00:11:14.616 --> 00:11:20.476
Engineering: a hundred and twenty rounds to a hundred and twenty-eight addresses, a slash twenty-five.

00:11:20.526 --> 00:11:25.666
And it goes first, because it is the fussiest tenant in the queue.

00:11:25.716 --> 00:11:31.256
It starts at offset zero. Fourteen dot twenty-four dot seventy-four dot zero.

00:11:31.306 --> 00:11:40.256
And I still say the alignment check out loud, even here: zero divided by a hundred and twenty-eight is zero. Whole. Legal.

00:11:40.756 --> 00:11:48.116
Last address: nought plus a hundred and twenty-eight minus one — dot one twenty-seven.

00:11:48.166 --> 00:11:53.096
Name: fourteen dot twenty-four dot seventy-four dot zero, slash twenty-five.

00:11:53.146 --> 00:11:58.406
That is Session eleven's ritual, unchanged, run for the first of three times.

00:11:58.456 --> 00:12:06.536
The arithmetic here is unchanged; only the fitting problem around it is new.

00:12:07.546 --> 00:12:12.356
Accounts starts where Engineering stopped: offset one twenty-eight.

00:12:12.406 --> 00:12:21.356
Check: one twenty-eight divided by sixty-four is two. Whole, legal. Name: dot one twenty-eight slash twenty-six, last address dot one ninety-one.

00:12:23.156 --> 00:12:27.446
Reception starts where Accounts stopped: offset one ninety-two.

00:12:27.496 --> 00:12:36.446
Check: one ninety-two divided by sixteen is twelve. Whole, legal. Name: dot one ninety-two slash twenty-eight, last address dot two zero seven.

00:12:39.296 --> 00:12:45.536
And the block did not run out. Dot two zero eight through dot two fifty-five sit unused.

00:12:45.586 --> 00:12:52.256
Forty-eight addresses the organisation keeps for the future — contiguous, and at the end.

00:12:52.306 --> 00:13:01.256
Now audit it like a professional. Every start is a multiple of its own size: nought, one twenty-eight, one ninety-two — divisible by a hundred and twenty-eight, sixty-four and sixteen.

00:13:06.046 --> 00:13:11.926
And the last piece is flush: the design ends exactly where the block does. No gap, no overlap.

00:13:11.976 --> 00:13:20.926
Three tenants, flush against each other, every boundary on a line the arithmetic allows. That is what a full-marks answer looks like.

00:13:25.613 --> 00:13:33.433
A hundred and twenty-eight, plus sixty-four, plus sixteen, plus forty-eight, is two hundred and fifty-six.

00:13:33.483 --> 00:13:40.853
Write it out. Every time, on every design question, as the last line of the answer.

00:13:40.903 --> 00:13:49.853
It catches your own errors before the grader does. A design that fails the sum has a gap, an overlap, or a piece of the wrong size —

00:13:50.153 --> 00:13:55.223
and you will find out in ten seconds rather than in a returned script.

00:13:55.273 --> 00:14:03.213
And it is the cheapest mark on the paper. One line of addition, and the examiner can see that you know what a complete design is.

00:14:03.263 --> 00:14:12.213
If the sum fails, the design is lying to you somewhere. Do not argue with it — go back and find the piece in the wrong place.

00:14:15.707 --> 00:14:22.357
Forty-two seconds, one tenant at a time, with the alignment check on every start.

00:14:22.407 --> 00:14:28.067
An empty bar, two hundred and fifty-six addresses wide, and three requests above it.

00:14:28.117 --> 00:14:34.457
Nothing has been placed. This is what you have at the start of a twelve-mark question.

00:14:34.507 --> 00:14:40.477
Rounded, and the spare seats named on each card: twenty-eight spare, four spare, six spare.

00:14:40.527 --> 00:14:45.387
And the sum: two hundred and eight of two hundred and fifty-six.

00:14:45.437 --> 00:14:54.117
Engineering takes the front door, and watch the check on the block itself: zero divided by a hundred and twenty-eight is zero. Whole, legal.

00:14:54.167 --> 00:14:57.147
Half the bar, in one move.

00:14:57.197 --> 00:15:02.187
Accounts starts where Engineering stopped. One twenty-eight over sixty-four is two.

00:15:02.237 --> 00:15:08.617
Largest-first did not avoid an illegal placement. It manufactured a legal one.

00:15:08.667 --> 00:15:13.577
Reception at one ninety-two. One ninety-two over sixteen is twelve.

00:15:13.627 --> 00:15:20.797
Three tenants, flush against each other, and every boundary on a line the arithmetic allows.

00:15:20.847 --> 00:15:28.717
And the tail: dot two zero eight through dot two fifty-five. Forty-eight addresses, contiguous, at the end.

00:15:28.767 --> 00:15:35.757
It has no prefix yet — it is just a range, and it becomes blocks the day somebody asks.

00:15:35.807 --> 00:15:39.907
And the audit line. Allocated plus free equals total.

00:15:39.957 --> 00:15:47.275
That is the last line of the answer, and it is the cheapest mark on the paper.

00:15:47.325 --> 00:15:54.565
A correct design can still lose marks by being incomplete, so here is exactly what to write down.

00:15:54.615 --> 00:16:01.955
A table with five columns: department, requested, rounded, name with prefix, and last address.

00:16:02.005 --> 00:16:07.525
Anything less is an incomplete answer, however right the numbers are.

00:16:07.575 --> 00:16:16.525
An alignment check beside every start. "One twenty-eight over sixty-four is two" costs you four characters and earns method marks.

00:16:17.505 --> 00:16:24.295
A named leftover: "dot two zero eight to dot two fifty-five unused, forty-eight addresses".

00:16:24.345 --> 00:16:31.645
Say it explicitly. A design that silently ignores the tail looks like a design that lost count.

00:16:31.695 --> 00:16:36.025
And the audit line underneath. One line, and the answer is closed.

00:16:36.075 --> 00:16:45.025
Draw the bar as well if you have time. A to-scale picture takes thirty seconds and makes an overlap visible instantly.

00:16:47.422 --> 00:16:56.372
The leftover is a range, not a block. Dot two zero eight to dot two fifty-five is forty-eight addresses, and forty-eight is not a power of two.

00:16:57.562 --> 00:17:01.442
So it cannot be written as a single prefix.

00:17:01.492 --> 00:17:10.442
It becomes blocks when someone asks. Cut it as needed: a slash twenty-eight at dot two zero eight, a slash twenty-seven at dot two twenty-four.

00:17:11.172 --> 00:17:18.852
And those are legal, because two zero eight divides by sixteen and two twenty-four divides by thirty-two.

00:17:18.902 --> 00:17:24.292
So the organisation has kept its options — which is the practical point of largest-first.

00:17:24.342 --> 00:17:32.579
The unspent addresses end up together, at the end, and still usable.

00:17:32.629 --> 00:17:35.999
Checkpoint two. Stop the video.

00:17:36.049 --> 00:17:43.829
One. In the worked design, why is dot one ninety-two a legal start for a slash twenty-eight?

00:17:43.879 --> 00:17:52.829
Two. Give two legal blocks that together use the forty-eight-address tail from dot two zero eight to dot two fifty-five.

00:17:52.909 --> 00:18:01.859
Three. Write the audit line for a slash twenty-four allocated as sixty-four plus thirty-two plus thirty-two plus sixteen, and say whether it closes.

00:18:03.539 --> 00:18:04.469
Answers.

00:18:04.519 --> 00:18:13.469
One. Because one ninety-two divided by sixteen is twelve — whole. Every start must be a multiple of its own block's size, and one ninety-two is.

00:18:14.919 --> 00:18:23.869
Two. A slash twenty-eight at dot two zero eight, since two zero eight over sixteen is thirteen. And a slash twenty-seven at dot two twenty-four, since two twenty-four over thirty-two is seven. Sixteen plus thirty-two is forty-eight.

00:18:31.229 --> 00:18:40.179
Three. Sixty-four plus thirty-two plus thirty-two plus sixteen is a hundred and forty-four allocated, so a hundred and twelve free — and a hundred and forty-four plus a hundred and twelve is two hundred and fifty-six. It closes, provided every start is aligned.

00:18:51.018 --> 00:18:54.068
Section three. Order is not tidiness.

00:18:54.118 --> 00:19:01.778
Everything so far worked on the first try, and that can breed a dangerous thought: that sorting is merely neat.

00:19:01.828 --> 00:19:10.778
So let us allocate the same three customers smallest first, and watch the arithmetic push back.

00:19:12.376 --> 00:19:19.346
Reception first. Sixteen addresses at offset zero. Zero over sixteen is zero, legal.

00:19:19.396 --> 00:19:24.056
So far nothing has gone wrong — which is exactly the problem.

00:19:24.106 --> 00:19:29.156
Accounts next. The next free address is offset sixteen, so try it.

00:19:29.206 --> 00:19:36.896
Sixteen divided by sixty-four is nought point two five. Not whole. The placement is refused.

00:19:36.946 --> 00:19:45.866
And writing it anyway would be wrong. "Fourteen dot twenty-four dot seventy-four dot sixteen slash twenty-six" is not merely untidy. It is a lie.

00:19:45.916 --> 00:19:52.666
Run its own mask over its own first address and the AND says the block starts at zero — on top of Reception.

00:19:52.716 --> 00:19:57.236
A block that fails its own ritual is not a block.

00:19:57.286 --> 00:20:06.236
That is the sharpest way to state rule three, and it is the sentence worth writing in your notes.

00:20:08.065 --> 00:20:13.305
The only legal door is offset sixty-four. Sixty-four over sixty-four is one, whole.

00:20:13.355 --> 00:20:20.015
So Accounts goes there: dot sixty-four slash twenty-six, running dot sixty-four to dot one twenty-seven.

00:20:20.065 --> 00:20:26.145
And addresses sixteen through sixty-three drop dead. Forty-eight of them.

00:20:26.195 --> 00:20:32.655
Not at the end where they could be sold — in the middle, where they cannot.

00:20:32.705 --> 00:20:40.735
Engineering then takes offset one twenty-eight. One twenty-eight over a hundred and twenty-eight is one, legal. It still fits.

00:20:40.785 --> 00:20:48.805
This time. With six customers and a tighter block, it will not — and that is next session.

00:20:48.855 --> 00:20:56.795
And the warning: the audit still passes. Sixteen plus forty-eight plus sixty-four plus one twenty-eight is two hundred and fifty-six.

00:20:56.845 --> 00:21:03.725
A design can audit correctly and still be bad. The sum checks completeness, not quality.

00:21:03.775 --> 00:21:10.975
Same customers, same total, worse outcome. Largest-first left a future slash twenty-six ready to sell.

00:21:11.025 --> 00:21:19.018
Smallest-first left the same forty-eight addresses trapped between two tenants.

00:21:20.028 --> 00:21:26.478
Both orders, side by side, on the same two hundred and fifty-six addresses.

00:21:26.528 --> 00:21:35.478
Two empty bars, and the three rounded requests above them. The only difference between the top and the bottom is the order.

00:21:35.658 --> 00:21:44.608
Top bar, largest first. Engineering at offset zero, and the check written inside the block: zero over a hundred and twenty-eight is zero.

00:21:45.628 --> 00:21:54.578
Accounts at one twenty-eight. One twenty-eight over sixty-four is two — and notice the door was already open because of what went before it.

00:21:54.758 --> 00:22:03.608
Reception at one ninety-two, and the free tail in grey at the end. Forty-eight addresses, contiguous, with no prefix yet.

00:22:03.658 --> 00:22:09.858
That is the finished design, and the audit line underneath closes at two fifty-six.

00:22:09.908 --> 00:22:17.418
Now the bottom bar. Reception first, at offset zero. Perfectly legal, and completely wrong.

00:22:17.468 --> 00:22:24.318
And there is the refusal, in red: sixteen over sixty-four is nought point two five. Not whole.

00:22:24.368 --> 00:22:31.218
Read the second half of that panel — the reason the name would be false, not merely untidy.

00:22:31.268 --> 00:22:39.578
Skip to sixty-four, and forty-eight addresses are stranded — drawn in red, in the middle of the block, between two tenants.

00:22:39.628 --> 00:22:48.578
Same total, same audit, and a design a professional would redo. Open it and step through both orders yourself.

00:22:51.008 --> 00:22:54.268
The same forty-eight addresses, in a different place.

00:22:54.318 --> 00:23:03.268
At the end of the block they are a contiguous range you can cut into legal blocks the day a customer appears. Between two tenants they are forty-eight addresses nobody can grow into.

00:23:06.348 --> 00:23:12.468
And the organisation cannot rearrange. Once Reception has an address, it has an address.

00:23:12.518 --> 00:23:17.418
Moving a live subnet means renumbering every machine on it.

00:23:17.468 --> 00:23:21.868
And next session, wrong order does not scar. It overflows.

00:23:21.918 --> 00:23:30.868
Six organisations, in two waves, and nobody in wave one may move when wave two lands. A customer who cannot be placed at all is a different kind of failure.

00:23:35.706 --> 00:23:39.176
Checkpoint three. Stop the video.

00:23:39.226 --> 00:23:48.176
One. A slash twenty-four is allocated smallest-first: a slash twenty-eight, then a slash twenty-seven, then a slash twenty-five. Where does each land, and what is stranded?

00:23:52.976 --> 00:24:01.676
Two. Why can fourteen dot twenty-four dot seventy-four dot sixteen never name a slash twenty-six, whatever the designer intended?

00:24:01.726 --> 00:24:10.026
Three. A design audits correctly but wastes forty-eight addresses in the middle. Is it wrong? One sentence.

00:24:10.076 --> 00:24:11.006
Answers.

00:24:11.056 --> 00:24:20.006
One. The slash twenty-eight at dot zero, sixteen addresses. The slash twenty-seven must start on a multiple of thirty-two, so dot thirty-two — stranding sixteen to thirty-one. The slash twenty-five must start on a multiple of a hundred and twenty-eight, so dot one twenty-eight — stranding sixty-four to one twenty-seven. Eighty addresses stranded in total.

00:24:27.766 --> 00:24:36.716
Two. Because sixteen over sixty-four is not whole. Run the slash twenty-six mask over that address and the AND returns dot zero, so the block it belongs to starts at dot zero. The name is simply false.

00:24:46.796 --> 00:24:55.746
Three. It is not incorrect, but it is poor: the audit proves the design is complete, not that the leftovers are usable. Marks for correctness — and a professional would redo it.

00:25:03.082 --> 00:25:06.912
Section four. Drill it until the audit is reflex.

00:25:06.962 --> 00:25:09.072
Two designs, and four ticks.

00:25:09.122 --> 00:25:18.072
The method is five moves long. What makes it worth marks under time pressure is that you can run it without deciding anything.

00:25:20.285 --> 00:25:29.105
One nine two dot one six eight dot seven dot zero, slash twenty-four. Requests: a hundred and twenty, twenty-five, and six.

00:25:29.155 --> 00:25:38.105
Round up all three before you place anything, and write the rounded sizes in a column, largest at the top. That column is your placement order.

00:25:40.555 --> 00:25:48.835
Then place, checking each start against its own size. Offset divided by size, and it must come out whole.

00:25:48.885 --> 00:25:56.855
Stop the video. Three minutes. Four answers: three names with prefixes, and the free range at the end.

00:25:56.905 --> 00:26:04.415
And finish with the audit line: allocated plus free equals two fifty-six, or the design is not finished.

00:26:04.465 --> 00:26:13.415
Three minutes is generous once the five moves are automatic. If it took longer, the thing to drill is the rounding, not the placement.

00:26:17.035 --> 00:26:25.985
Rounded: a hundred and twenty goes to a hundred and twenty-eight, a slash twenty-five. Twenty-five goes to thirty-two, a slash twenty-seven. Six goes to eight, a slash twenty-nine.

00:26:28.975 --> 00:26:37.925
Note the two traps: twenty-five rounds to thirty-two, not sixteen. And six rounds to eight, not four. Upward, always.

00:26:39.635 --> 00:26:47.905
A: one nine two dot one six eight dot seven dot zero, slash twenty-five. Last address dot one twenty-seven.

00:26:47.955 --> 00:26:54.195
Check: zero over a hundred and twenty-eight is zero. Whole, legal.

00:26:54.245 --> 00:26:59.845
B: dot one twenty-eight, slash twenty-seven. Last address dot one fifty-nine.

00:26:59.895 --> 00:27:08.845
Check: one twenty-eight over thirty-two is four. Whole — and it is legal only because the slash twenty-five ate exactly a hundred and twenty-eight first.

00:27:11.825 --> 00:27:17.425
C: dot one sixty, slash twenty-nine. Last address dot one sixty-seven.

00:27:17.475 --> 00:27:22.555
Check: one sixty over eight is twenty. Whole, legal.

00:27:22.605 --> 00:27:28.475
And free: dot one sixty-eight through dot two fifty-five. Eighty-eight addresses.

00:27:28.525 --> 00:27:37.475
The audit: a hundred and twenty-eight, plus thirty-two, plus eight, plus eighty-eight — two hundred and fifty-six. Tick.

00:27:38.015 --> 00:27:46.965
Look at B again. Largest-first did not merely avoid waste; it manufactured the alignment that made B legal in the first place.

00:27:49.612 --> 00:27:57.482
One seventy-two dot sixteen dot four dot zero, slash twenty-three. Requests: two hundred, a hundred and twenty, sixty.

00:27:57.532 --> 00:28:06.482
Five hundred and twelve addresses this time, so the design will step over the dot four, dot five boundary in the third octet. Do not let that frighten you.

00:28:08.922 --> 00:28:14.702
Stop the video. Three minutes. Round up, sort, place, align, audit.

00:28:14.752 --> 00:28:21.482
Same five moves; the only difference is that the offsets are bigger than two fifty-six.

00:28:21.532 --> 00:28:30.482
And think in offsets, not in dots. The starts are at offsets nought, two fifty-six and three eighty-four — divisible by two fifty-six, a hundred and twenty-eight and sixty-four.

00:28:33.772 --> 00:28:36.712
The dots are just how the offsets get written down.

00:28:36.762 --> 00:28:45.712
This is your homework block from last session. If you did the four-way equal cut, you already know where one seventy-two dot sixteen dot five dot zero sits.

00:28:50.602 --> 00:28:59.552
Rounded: two hundred goes to two hundred and fifty-six, a slash twenty-four. A hundred and twenty goes to a hundred and twenty-eight, a slash twenty-five. Sixty goes to sixty-four, a slash twenty-six.

00:29:05.732 --> 00:29:14.682
Note that two hundred rounds all the way to a full slash twenty-four — there is no size between a hundred and twenty-eight and two fifty-six.

00:29:16.722 --> 00:29:25.672
A: one seventy-two dot sixteen dot four dot zero, slash twenty-four. Last address one seventy-two dot sixteen dot four dot two fifty-five.

00:29:25.732 --> 00:29:31.332
Check: offset zero over two fifty-six is zero. Whole, legal.

00:29:31.382 --> 00:29:40.062
B: one seventy-two dot sixteen dot five dot zero, slash twenty-five. Last address dot five dot one twenty-seven.

00:29:40.112 --> 00:29:47.332
Check: offset two fifty-six over a hundred and twenty-eight is two. Whole, legal.

00:29:47.382 --> 00:29:55.862
C: one seventy-two dot sixteen dot five dot one twenty-eight, slash twenty-six. Last address dot five dot one ninety-one.

00:29:55.912 --> 00:30:02.302
Check: offset three eighty-four over sixty-four is six. Whole, legal.

00:30:02.352 --> 00:30:09.552
And free: dot five dot one ninety-two through dot five dot two fifty-five. Sixty-four addresses.

00:30:09.602 --> 00:30:17.502
The audit: two fifty-six plus a hundred and twenty-eight plus sixty-four plus sixty-four — five hundred and twelve. Tick.

00:30:17.552 --> 00:30:26.502
The octet boundary changes nothing: the slash twenty-four ends at dot four dot two fifty-five and the slash twenty-five starts at dot five dot zero.

00:30:31.091 --> 00:30:39.061
The five moves, live, with the audit line computed for you — and the tool refuses everything illegal.

00:30:39.111 --> 00:30:47.551
It opens with the requests and nothing placed. The five move-cards along the top are all grey, and the bar is empty.

00:30:47.601 --> 00:30:55.451
Move one lights up: a hundred becomes a hundred and twenty-eight, sixty becomes sixty-four, ten becomes sixteen.

00:30:55.501 --> 00:31:04.251
And the note underneath names the spare seats — thirty-eight in total, and it calls them the cost of legality rather than waste.

00:31:04.301 --> 00:31:10.491
Move two. Sorted descending, and that column is now the placement order.

00:31:10.541 --> 00:31:18.461
Engineering placed, and look at the last column of the table: zero divided by a hundred and twenty-eight equals zero, tick.

00:31:18.511 --> 00:31:22.881
The alignment check is a column, not an afterthought.

00:31:22.931 --> 00:31:27.491
Accounts at one twenty-eight, with its own check beside it.

00:31:27.541 --> 00:31:36.491
Reception at one ninety-two, and the free row appears in grey — forty-eight addresses, "no prefix yet", and the note that it becomes blocks when someone asks.

00:31:38.181 --> 00:31:46.731
And the audit line closes: a hundred and twenty-eight plus sixty-four plus sixteen plus forty-eight is two fifty-six.

00:31:46.781 --> 00:31:55.731
And the drill preset, so you can check your own answer: dot zero slash twenty-five, dot one twenty-eight slash twenty-seven, dot one sixty slash twenty-nine, and eighty-eight free.

00:31:59.091 --> 00:32:08.041
Try the overflow preset too — a hundred and thirty, sixty and thirty on a slash twenty-four. Watch the audit turn red and tell you no ordering can fix it.

00:32:12.597 --> 00:32:21.547
Copy this board into your notes verbatim. Four ticks, and you run all four before an examiner ever sees the answer.

00:32:21.707 --> 00:32:26.307
Tick one: powers of two? Every allocated size is two to the n.

00:32:26.357 --> 00:32:34.007
A request of a hundred allocated as a hundred fails here immediately, before anything else is checked.

00:32:34.057 --> 00:32:37.057
Tick two: sorted? Largest placed first.

00:32:37.107 --> 00:32:42.927
If not, expect stranded addresses even when the sum still closes.

00:32:42.977 --> 00:32:47.857
Tick three: aligned? Every start divided by its own size is whole.

00:32:47.907 --> 00:32:55.607
This is the one an examiner checks first, and the one the hardware enforces whether or not anyone checks it.

00:32:55.657 --> 00:33:01.437
And the fourth tick: allocated plus free equals total. Four ticks, full marks.

00:33:01.487 --> 00:33:10.430
Any cross — redesign, because a design that fails one tick usually fails silently everywhere else.

00:33:11.440 --> 00:33:16.750
Next session, an ISP is granted eleven dot ten dot three dot ten, slash twenty-two.

00:33:16.800 --> 00:33:24.890
That is the same block you have been carrying since Session eleven. A thousand and twenty-four addresses.

00:33:24.940 --> 00:33:32.220
Six organisations arrive, in two waves. And nobody in wave one may move when wave two lands —

00:33:32.270 --> 00:33:36.640
because renumbering a live network is not an option.

00:33:36.690 --> 00:33:43.980
So the ordering stops being a preference. With six customers and a fixed parent, wrong order does not scar.

00:33:44.030 --> 00:33:48.720
It overflows — a customer who cannot be placed at all.

00:33:48.770 --> 00:33:57.140
Bring this session's ritual. Round up, sort, largest first, align, audit — six times, with a seating plan.

00:33:57.190 --> 00:34:06.140
Everything you need for twelve marks is in this session and Session eleven. What is added next week is only the scale, and the two-wave constraint.

00:34:09.356 --> 00:34:15.806
Checkpoint four, and this is the rehearsal for next week. Stop the video.

00:34:15.856 --> 00:34:24.806
One. Design two hundred dot one dot one dot zero slash twenty-four for requests of sixty, sixty and a hundred. Give names, prefixes and the free range.

00:34:30.056 --> 00:34:39.006
Two. Requests of a hundred and thirty, sixty and thirty arrive for a single slash twenty-four. What happens, and what do you tell the customer?

00:34:44.176 --> 00:34:47.716
Three. State the four audit ticks from memory.

00:34:47.766 --> 00:34:48.616
Answers.

00:34:48.666 --> 00:34:57.616
One. Rounded: a hundred and twenty-eight, sixty-four, sixty-four — and sorted, the hundred goes first. Two hundred dot one dot one dot zero slash twenty-five, then dot one twenty-eight slash twenty-six, then dot one ninety-two slash twenty-six. No free range. Audit: a hundred and twenty-eight plus sixty-four plus sixty-four is two fifty-six. Tick.

00:35:07.306 --> 00:35:16.256
Two. A hundred and thirty rounds to two fifty-six, sixty to sixty-four, thirty to thirty-two — a total of three hundred and fifty-two, which is more than two hundred and fifty-six. It overflows, and no ordering can fix it. The customer needs a slash twenty-three.

00:35:21.246 --> 00:35:30.196
Three. Powers of two. Sorted descending. Every start divisible by its own size. Allocated plus free equals total.

00:35:37.611 --> 00:35:41.291
Five ways to lose marks on a design question.

00:35:41.341 --> 00:35:46.791
Wrong: Engineering asked for a hundred, so allocate a hundred addresses.

00:35:46.841 --> 00:35:55.791
Right: a hundred and twenty-eight. Sizes are powers of two, so a block of exactly a hundred cannot be written as a prefix at all.

00:35:56.801 --> 00:36:02.481
Wrong: Reception needs ten, so give it a slash twenty-nine — eight addresses.

00:36:02.531 --> 00:36:11.481
Right: round up. A slash twenty-eight, sixteen addresses. Ten machines do not fit in eight — and "usable" makes it worse, because a slash twenty-nine seats six.

00:36:14.441 --> 00:36:18.431
Wrong: place them in the order the customer listed them.

00:36:18.481 --> 00:36:26.301
Right: sort descending first. Customer order is arbitrary; placement order is arithmetic.

00:36:26.351 --> 00:36:32.461
Wrong: the next free address is dot sixteen, so the slash twenty-six starts at dot sixteen.

00:36:32.511 --> 00:36:41.461
Right: next legal, not next free. Sixteen over sixty-four is not whole, so the next legal door is dot sixty-four.

00:36:41.821 --> 00:36:46.941
And wrong: the design is finished when every department has a block.

00:36:46.991 --> 00:36:55.941
Right: it is finished when the audit line closes — allocated plus free equals total, written out.

00:36:56.078 --> 00:37:01.148
Back to minute one. Why did equal quarters fail all three?

00:37:01.198 --> 00:37:10.148
Engineering: too small. Sixty-four addresses for a hundred machines. Refused outright, and the most obvious of the three.

00:37:11.918 --> 00:37:20.868
Accounts: lucky. Sixty fits inside sixty-four with four to spare — but only by accident, and one new hire breaks it.

00:37:21.058 --> 00:37:23.088
Luck is not a design.

00:37:23.138 --> 00:37:27.048
And Reception: wasteful. Fifty-four of its sixty-four addresses idle forever.

00:37:27.098 --> 00:37:32.988
Not a failure you notice on day one, and exactly the kind an ISP charges you for.

00:37:33.038 --> 00:37:41.988
Too small, too lucky, too wasteful. Three departments, three different failures, one cause: the cut ignored the requests.

00:37:46.040 --> 00:37:54.990
Round every request up to a power of two, on sight — and say why exact allocation is illegal rather than merely untidy.

00:37:55.740 --> 00:38:04.690
Sort descending and place largest first — and explain that sorting is what makes the alignment pass, not merely what makes it neat.

00:38:05.320 --> 00:38:13.660
Check every start against its own size. Offset over size, whole or refused, with no appeal.

00:38:13.710 --> 00:38:22.660
And close every design with the audit line: allocated plus free equals total, written out, every time.

00:38:25.063 --> 00:38:30.073
The fifty, fifty, one hundred redesign — with a proof about the ordering.

00:38:30.123 --> 00:38:38.903
The lesson there is subtle: request order might survive. You must demonstrate whether it does, not decide by feel.

00:38:38.953 --> 00:38:47.903
Example eighteen point five, re-run cold. No notes. Five moves, ninety seconds, and the audit line at the bottom.

00:38:48.773 --> 00:38:53.873
And keep eleven dot ten dot zero dot zero slash twenty-two in front of you.

00:38:53.923 --> 00:39:01.903
One line, six customers, two waves, twelve marks. It arrives next session and it does not wait.

00:39:01.953 --> 00:39:10.903
Reading: Forouzan eighteen point four on block allocation, plus the IP block allocation problem sheet, parts a to c.

00:39:14.169 --> 00:39:20.669
One: round up. Every request to the next power of two, upward only.

00:39:20.719 --> 00:39:28.519
Two: sort descending. The placement order is arithmetic, not the customer's email.

00:39:28.569 --> 00:39:37.519
Three and four: place largest first, and align each start. Offset over its own size, whole — or find the next legal door.

00:39:38.599 --> 00:39:43.689
Five: audit. Allocated plus free equals total, written as a line of the answer.

00:39:43.739 --> 00:39:51.842
Five moves, in that order, and a design that has no legal alternative.

00:39:51.892 --> 00:39:53.702
That is Session fourteen.

00:39:53.752 --> 00:39:58.302
Round up, sort, largest first, align — then audit.

00:39:58.352 --> 00:40:04.982
Blocks of different sizes share one parent, provided every start is a multiple of its own size.

00:40:05.032 --> 00:40:13.982
And order is not tidiness. Sorting descending is the thing that makes the alignment pass, and getting it wrong strands addresses in the middle of your block.

00:40:14.302 --> 00:40:21.382
If the sum check fails, the design is lying to you somewhere. Find the piece, do not argue with the arithmetic.

00:40:21.432 --> 00:40:30.382
Before the next session: the fifty-fifty-hundred redesign with a proof about ordering, Example eighteen point five re-run cold, and eleven dot ten dot zero dot zero slash twenty-two in your notes.

00:40:33.652 --> 00:40:39.282
Next: one line, six customers, two waves — and nobody in wave one may move.

00:40:39.332 --> 00:40:44.292
I will see you there.
