<a id="ch-07"></a>

## Chapter 7 — The /25 ends at .127

### Learning outcomes

After this chapter, you should be able to:

1. Name the first and last addresses of `192.0.2.0/25`.
2. Place `192.0.2.130` in the following block.
3. 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.

| 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

| 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/25` stop, and why is `192.0.2.130` outside it? *Rubric:* 3 = the object holds 128 addresses, `.0` through `.127`; `.128` starts the next block; `.130` is past that edge; the script does not print the edge;; 2 = `.127` is the last member and `.130` is not;; 1 = one address;; 0 = none.

<!-- open-cyber-academy:chapter-navigation:start ch-07 -->
### Continue studying — lesson 07 (chapter 07 of 20)

[← Chapter 06](#ch-06) · [Course chapter index](../SUBJECTS.md) · [Chapter 08 →](#ch-08)

Continue to the next authored lesson.
<!-- open-cyber-academy:chapter-navigation:end -->

## Worked answers

<a id="answer-ex053"></a>
**EX053.** The object holds 128 addresses, from `192.0.2.0` through `192.0.2.127`. `192.0.2.128` starts the next block, and `.130` is past that edge. The script does not print the edge.
