← All chapters
Chapter 2· 6 min read · illustrated

The Structure of an IP Address

Octets, dotted-quad notation, and why IPv4 is exactly 32 bits

Before we can talk about networks, subnets, or routing, we need to really understand the thing every device carries: its IP address. This is a short but foundational chapter — get the structure clear here and subnetting later becomes easy.

We will look at the IP you have almost certainly seen — 127.0.0.1 — and take apart exactly what its pieces are, how it looks in binary, and where the famous "32 bits" comes from.

01

What is an IP address?

IP stands for Internet Protocol, one of the most important protocols on the internet. An IP address is the identifier a device uses to be found on a network — every device that wants to communicate gets one.

Familiar example: 127.0.0.1 (localhost / loopback) is an IP address you have seen many times — it points back to your own machine.

Tap to enlarge
02

Dotted-quad notation

An IPv4 address is written as four non-negative integers separated by dots — the form A.B.C.D. This is called dotted-quad (or dotted-decimal) notation.

For example: 192.168.1.4. Four numbers, three dots.

Tap to enlarge
03

Each part is an octet

Each dot-separated number is called an octet. So 192.168.1.4 has four octets. You will often hear people talk about the "first three octets" versus the "last octet" — a distinction that becomes very important when we split an IP into a network part and a host part.

Why "octet"?: Each of these numbers is stored in 8 bits — and "octet" literally means a group of eight.

Tap to enlarge
04

An octet in binary

Decimal (192.168.1.4) is how humans read IPs, but the machine sees binary. Each octet is an 8-bit binary number. For example, 192 in binary is 11000000 — eight bits.

Getting comfortable seeing an octet as 8 bits is the single prerequisite for understanding subnet masks in a couple of chapters.

Tap to enlarge
05

Why IPv4 is 32 bits

Now the headline fact. There are 4 octets, and each octet is 8 bits. So the whole address is 8 × 4 = 32 bits, which is 4 bytes.

Remember: IPv4 = 32 bits = 4 bytes = 4 octets. This is why there are only about 4.3 billion (2³²) possible IPv4 addresses.

Tap to enlarge
06

IPv4 vs IPv6 (a quick note)

Because 32 bits ran out of room for the modern internet, IPv6 was introduced — a 128-bit address written in hexadecimal groups (like 2001:db8::1). It provides an astronomically larger address space.

For now: This course focuses on IPv4 to build intuition; IPv6 gets its own chapter later. The concepts (network vs host, routing) carry over.

Tap to enlarge