4.3.8 · D1Computer Networks

Foundations — IPv4 — address format, classes, subnetting, CIDR notation

3,008 words14 min readBack to topic

Before you can read the parent note, you must own every piece of notation it throws at you. This page builds each one from absolute zero, in an order where each idea leans only on the ones before it.


1. A "bit" — the single switch

The picture: imagine a light switch. Down = , up = . That is a bit.

Why the topic needs it: a network address must be stored inside a computer, and computers physically hold information as huge rows of these off/on switches. So the "address" is literally a pattern of switches.

Figure — IPv4 — address format, classes, subnetting, CIDR notation

2. Positional value — WHY appears everywhere

Once you have several switches in a row, you need a rule that turns a pattern of switches into an ordinary number. That rule is positional notation, and it is exactly how our normal decimal numbers work — we just swap for .

What it looks like: each switch that is on drops its column-value onto a pile; switches that are off drop nothing. The size of the pile is your number.

Figure — IPv4 — address format, classes, subnetting, CIDR notation

Everything about powers of two here is developed further in Binary and Positional Number Systems.


3. The octet — a bundle of 8 switches

The picture: take 8 switches from §1 and draw a box around them. That box is one octet.

Why the topic needs it: raw switches in a row are unreadable to a human. We chop the row into four octet-boxes and write each box as a single decimal number . That packaging is the "dotted-decimal" address.


4. The dotted-decimal address a.b.c.d

So 192.168.0.1 is really the -switch row 11000000 . 10101000 . 00000000 . 00000001, just written in friendlier chunks. The dots are pure decoration for human eyes — the machine only ever sees switches in a line.

Why the topic needs it: every address you will ever type or subnet is in this form. The whole game of the parent note is deciding how to split these switches.

Figure — IPv4 — address format, classes, subnetting, CIDR notation

5. Exponent notation and counting combinations


6. Network part vs host part — WHERE the line is drawn

The picture: the switches with a single amber divider bar. Slide the bar right → more street switches, fewer house switches → smaller streets, more of them.

Why the topic needs it: classes, subnetting, and CIDR are only three different rules for choosing where this one line goes. Get this picture and the rest is bookkeeping.

Figure — IPv4 — address format, classes, subnetting, CIDR notation

7. Three rules for placing the line — classes, subnetting, CIDR

Now that the line of §6 exists, here are the three named rules the parent note uses, each with a tiny example so the words are not just labels.

Why the topic needs it: /n is just a compact name for where §6's line sits. Bigger = line further right = fewer house switches = smaller network. (Keep this: bigger means smaller network — the parent note's Trap 2.)


8. The mask — the same line, drawn as switches

Example: /24 mask = 11111111.11111111.11111111.00000000 = 255.255.255.0.


9. The host-bit count and the two forbidden houses — WHY ""

That is the entire reason the parent's usable-host counts are and never : two of the host patterns are pre-booked.


Prerequisite map

The list below is a top-down dependency map: read it downward, and each indented item means "you need the thing above it before the thing below makes sense." (A machine-readable Mermaid version is tucked inside the collapsible box after it, for readers whose viewer renders diagrams.)

  • bit (§1) — the on/off switch
    • positional value (§2) — turns switches into a number
      • octet, max 255 (§3)
        • dotted decimal a.b.c.d (§4)
          • network vs host line (§6) — also needs below
            • /n prefix + mask (§7–8)
              • hosts (§9) — also needs below
                • PARENT: classes, subnetting, CIDR
      • counts patterns (§5) — feeds the network/host line, the host formula, and:
        • total addresses

The parent topic (parent topic) sits at the very bottom: it assumes all of §1–§9. This page built them.

Recall Mermaid version of the same map (only shows if your viewer renders diagrams)

bit = one on off switch

positional value 2 to the i

octet = 8 bits max 255

dotted decimal a.b.c.d

2 to the n counts patterns

2 to the 32 total addresses

network vs host line

slash-n prefix and mask

hosts = 2 to the h minus 2

Parent classes subnetting CIDR


Equipment checklist

Cover the right side and test yourself. If any answer surprises you, re-read that section before opening the parent note.

What is a bit?
One thing with exactly two states, written (off) or (on).
What does the sign § mean on this page?
Just "section" — a cross-reference to a numbered heading, never maths.
What is a subscript, e.g. the in ?
A small label that names which switch; not a power and not a multiply.
What does compute?
The decimal value of 8 switches; each on-switch adds its column value .
Maximum value of one octet, and how many patterns?
Max ; number of patterns .
What does a.b.c.d really stand for?
A row of 32 bits split into four octets, each written in decimal .
Why do switches give patterns?
Each extra switch doubles the count (off-version + on-version of every old pattern).
Total number of IPv4 addresses?
billion.
What splits an address into network vs host?
A single line across the 32 bits; left = network part, right = host part.
In one line each: classes, subnetting, CIDR?
Classes = line only at fixed spots; subnetting = slide line right to make smaller nets; CIDR = line anywhere.
What does /n mean, and what does CIDR stand for?
Leftmost bits = network part; CIDR = Classless Inter-Domain Routing (line can go anywhere).
What is a subnet mask made of, and what operation uses it?
ones then zeros; a router applies bitwise AND to keep the network bits.
What is , and what is the usable-host formula?
= host bits; usable hosts .
What is a host route?
A routing entry for one single exact machine (a /32), not a whole network.
When does fail?
At (/32, a single host) and (/31, which gives 2 endpoints, not 0).
Why subtract 2 from host counts?
All-zeros host = network address, all-ones host = broadcast; neither is assignable.
Recall Where each symbol reappears in the parent
  • → parent §1 "Bits ↔ decimal"
  • → parent §1 total-combinations line
  • network/host line → parent §2
  • /n and mask → parent §5 (CIDR)
  • and → parent §4 and every host-count example

Once every checklist line is automatic, you are equipped for the full IPv4 topic, and downstream for IPv6 — addressing and notation and Routing Tables and Longest Prefix Match.