Lesson map
Lesson 07. Map, example, EX053.
flowchart TD
N["192.0.2.0/25"] --> S["128 addresses"]
S --> H[".0 through .127"]
H --> X[".128 starts the next block"]
X --> M[".130 is not a member"]
Prefix 25 leaves seven bits. Seven bits count 128 addresses, and the block stops at .127.
Logical drawing
192.0.2.0/25
first address 192.0.2.0
last address 192.0.2.127
count 128
192.0.2.130
not a member
Learning outcomes
After this chapter, you should be able to:
- Name the first and last addresses of
192.0.2.0/25. - Place
192.0.2.130in the following block. - Refuse the idea that "130 is close, so the lab should have allowed it."
7.1 Prefix length is a count of bits, not a guess about nearby hosts.
ip_network("192.0.2.0/25") builds one network. A prefix of 25 means the first 25 bits are fixed and the last 7 bits vary. Two to the power 7 is 128, so the object covers 192.0.2.0 through 192.0.2.127 inclusive. The next address, 192.0.2.128, is the start of 192.0.2.128/25. 192.0.2.130 is that later block plus two. Membership is false.
The script never prints .127 or .128. Those two addresses are how you check the object, not extra rows in the output. .5 and .10 fall inside the 128. .130 does not. Closeness of the decimal is not the test ip in n uses.
Lesson table; scroll horizontally to read all columns →
| Address | Inside this object? | Why |
|---|---|---|
192.0.2.0 |
Yes | First address of the object |
192.0.2.127 |
Yes | Last address of the object |
192.0.2.128 |
No | First address of the next /25 |
192.0.2.130 |
No | Two past that boundary |
7.2 Worked example
Lesson table; scroll horizontally to read all columns →
| Offered claim | Check | Decision |
|---|---|---|
".130 is outside because 130 is greater than 127." |
The last address is .127 |
Keep |
"The script printed a boundary row for .127." |
No such line exists | Refuse |
"A /24 was what the file stored." |
The literal is /25 |
Refuse |
Synthetic case. The boundary is a property of the network object. It is not a fifth printed line.
Errors and limits
Do not widen the literal to a /24 so .130 becomes a member.
Apply
- EX053 — Block edge. Where does
192.0.2.0/25stop, and why is192.0.2.130outside it?Show marking criteria
Rubric: 3 = the object holds 128 addresses,.0through.127;.128starts the next block;.130is past that edge; the script does not print the edge;; 2 =.127is the last member and.130is not;; 1 = one address;; 0 = none.