OpenCyber Academy
Rapid course · Lesson 7 · English
Course code: OCA-019Lesson 07: OCA-019-A007

The /25 ends at .127

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

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:

  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.

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/25 stop, and why is 192.0.2.130 outside it?
    Show marking criteria
    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.
Worked answers

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.