NewAI Content Creation is now live in Early Access
Turning Point Academyby Training Center
Skip to content
0%
IP Networks: Addressing and SubnettingLesson 1 of 8
15 min readBeginner
Downloads & resources
Download this lesson's materials, ready to use.

Binary: The Language of Addresses

Example prompt

Where you are: Module 4, "IP Networks: Addressing and Subnetting" — lesson 1 of 8. Module 2 gave you the layer map and showed IP addresses and MAC addresses riding in their envelopes; Module 3 ended inside the switch, watching it learn MAC addresses. This module makes addressing precise — and precision starts with the numbers themselves. You need no math beyond addition and subtraction, and everything in the next seven lessons leans on the skill this one builds.

What you'll learn

  • Convert any 8-bit binary number to decimal, and any decimal 0–255 to binary, by hand
  • Read hexadecimal and translate it to and from binary in your head
  • Explain why every network address is really a bit pattern wearing a human-friendly costume
  • Recognize the nine octet values (0, 128, 192, 224, 240, 248, 252, 254, 255) that dominate subnet masks
  • Say why IPv4 is written in decimal but MAC addresses and IPv6 are written in hex

This lesson builds on Chapter 6 of Dr. Tahseen Al-Doori's Network Essentials, which opens its addressing chapter exactly this way: with a short number-systems mini-lesson before a single address appears. The order is deliberate, and this course keeps it.

Why bother? The mechanic's answer

Every command a computer executes, every pixel it lights, every address it compares — underneath, all of it is patterns of 1s and 0s. An IPv4 address is not "really" 192.168.1.23; it is really a row of 32 bits. The dotted decimal form exists only because human eyes glaze over at 11000000101010000000000100010111. Decimal is the costume; binary is the body.

So why should you, personally, learn to undress the number? Chapter 6 answers with a classic analogy from Dr. Al-Doori's course: think of a car mechanic. Plenty of people drive perfectly well knowing nothing about engines — but when the car breaks, the person who can actually fix it is the one who knows what's happening under the hood. You can use a network while seeing only dotted decimal. To troubleshoot one — to explain why two machines that look numerically similar cannot talk, or to carve a network into subnets that don't collide — you have to see the bits underneath.

There is also a shortcut hiding in this promise: the amount of binary a network technician needs is tiny. You will never convert million-digit numbers. You need exactly one trick — reading 8 bits as a number from 0 to 255 — plus a nodding acquaintance with hexadecimal. Both fit in this single lesson, and after the drills below, both fit in your head.

Three ways to write one quantity

A number system is just an agreed set of symbols and a rule for combining them. Three systems matter in networking:

  • Decimal (base 10) uses ten symbols, 0–9. It is the system humans grew up with — ten symbols for ten fingers.
  • Binary (base 2) uses two symbols, 0 and 1. It is the system computers are built from, because electronic circuits distinguish two states — on and off — cheaply and reliably.
  • Hexadecimal (base 16) uses sixteen symbols: 0–9, then A, B, C, D, E, F for the values ten through fifteen. It exists as a compact costume for binary, for reasons you will see shortly.

All three are positional systems: a digit's value depends on the column it stands in. In decimal, columns are worth 1, 10, 100, 1,000 — each column ten times the last. The number 347 means 3×100 + 4×10 + 7×1. Binary works identically, except each column is worth two times the last: 1, 2, 4, 8, 16, 32, 64, 128... The same quantity, different column weights.

Two vocabulary words before the arithmetic. A bit is a single binary digit — one 1 or 0. An octet is a group of eight bits (in most contexts you can treat "octet" and "byte" as synonyms; networking documents prefer octet because it is unambiguous). An IPv4 address is 32 bits, written as four octets separated by dots — which is why every piece of an IPv4 address is a number from 0 to 255, and why this lesson obsesses over exactly eight bits at a time.

Binary to decimal: the value row

Write down this row of column values, largest first. It is the single most useful line of numbers in this course:

code
128   64   32   16   8   4   2   1

Each value is double its right-hand neighbor — these are the worths of the eight columns in one octet. To convert binary to decimal: write the eight bits under the row, then add up the values that have a 1 under them. That's the entire method.

Three worked examples:

code
128  64  32  16   8   4   2   1
  0   0   0   0   1   0   1   0     →  8 + 2            = 10
  1   1   0   0   0   0   0   0     →  128 + 64         = 192
  1   0   1   0   1   1   0   0     →  128 + 32 + 8 + 4 = 172

Two boundary cases complete the picture. All zeros (00000000) adds nothing: 0. All ones (11111111) adds everything: 128+64+32+16+8+4+2+1 = 255. That is why no octet of an IPv4 address, a subnet mask, or anything else built from single octets can ever exceed 255 — there is no ninth bit to add. The moment you see 192.168.300.5 in a config file, you know it's a typo without checking anything else.

Decimal to binary: subtract the largest that fits

The reverse direction uses the same row, walked left to right with a running remainder. For each column value, ask: does it fit in what's left? If yes, write a 1 and subtract. If no, write a 0 and move on.

Convert 201:

  • 128 fits in 201 → write 1, remainder 73
  • 64 fits in 73 → write 1, remainder 9
  • 32 doesn't fit in 9 → write 0
  • 16 doesn't fit → write 0
  • 8 fits in 9 → write 1, remainder 1
  • 4 doesn't fit → write 0
  • 2 doesn't fit → write 0
  • 1 fits exactly → write 1, remainder 0

Result: 11001001. Check it by adding back: 128+64+8+1 = 201 — it checks out.

Convert 87: 128 no (0), 64 yes — remainder 23 (1), 32 no (0), 16 yes — remainder 7 (1), 8 no (0), 4 yes — remainder 3 (1), 2 yes — remainder 1 (1), 1 yes — remainder 0 (1). Result: 01010111. Check: 64+16+4+2+1 = 87 — it checks out.

Always finish with the add-back check. It takes five seconds and catches nearly every slip.

The nine numbers you will meet everywhere

One family of octets deserves special attention, because the next three lessons are built on it: octets whose 1s fill in from the left, with no gaps. There are exactly nine of them:

BinaryDecimalBinaryDecimal
00000000011111000248
1000000012811111100252
1100000019211111110254
1110000022411111111255
11110000240

Read the decimal column aloud a few times — 0, 128, 192, 224, 240, 248, 252, 254, 255 — because these are the only values that ever appear in a subnet mask, for a reason the next lesson makes clear. When you can glance at 224 and see 11100000 (three ones, five zeros), the subnetting lessons will feel like arithmetic instead of magic.

Notice the pattern that generates them: start from zero and add the value row's numbers left to right — 128, then +64 = 192, then +32 = 224, and so on. Each step turns on one more bit from the left.

Hexadecimal: binary's shorthand

Look again at a MAC address as Wireshark or ipconfig shows it — something like 3C-52-82-1A-BC-0D. Those pairs of symbols are hexadecimal, and hex earns its place through one beautiful coincidence of arithmetic: one hex digit represents exactly four bits — no more, no less. Sixteen symbols, sixteen possible four-bit patterns, a perfect one-to-one match:

HexBinaryDecimalHexBinaryDecimal
000000810008
100011910019
200102A101010
300113B101111
401004C110012
501015D110113
601106E111014
701117F111115

Because of that match, converting between hex and binary is pure substitution — no arithmetic at all. One octet is always exactly two hex digits: split the eight bits into two groups of four (each group is called a nibble — half a byte, and yes, that is the official joke) and look each group up. 3C is 0011 + 1100 = 00111100. Going to decimal, the first hex digit counts sixteens and the second counts ones: 3×16 + 12 = 60.

Decimal offers no such shortcut — converting decimal to binary always needs the subtraction walk — which is exactly why programmers and hardware designers prefer hex whenever the bits themselves matter.

Now the convention snaps into focus:

  • IPv4 addresses are 32 bits = four octets. Four small decimal numbers are comfortable for humans, so IPv4 wears decimal: 192.168.1.23.
  • MAC addresses are 48 bits = six octets. Six decimal numbers would be clumsy, and MAC addresses are hardware identifiers where the bit pattern matters, so they wear hex: six two-digit pairs, 3C-52-82-1A-BC-0D (the next-but-one lesson dissects them).
  • IPv6 addresses are 128 bits — hopeless in decimal. They wear hex in eight groups of four hex digits (16 bits per group), like 2001:0db8:0000:0000:0000:0000:0000:0001 (Module 4's final lesson).

One notation note for later modules: outside of addresses, technical documents often mark a hex number with the prefix 0x0xFF means "FF in hex," that is, 255.

Worksheet: Binary Drill

Instructions. Convert the ten items below by hand — value row on paper, no calculator, no phone. This is muscle memory training: the goal is not merely correct answers but fast ones, because in the subnetting lessons these conversions become sub-steps of bigger problems. Do all ten before checking the answers.

Part 1 — binary to decimal:

  1. 00001010
  2. 11000000
  3. 10101100
  4. 01111111
  5. 11111110

Part 2 — decimal to binary:

  1. 168
  2. 224
  3. 63
  4. 240
  5. 201

Deliverable. Ten conversions with your working shown (the value row with bits beneath it, or the subtraction walk).

Self-check (answers).

  1. 00001010 → 8+2 = 10 — the first octet of the private 10.0.0.0 range you'll meet later this module.
  2. 11000000 → 128+64 = 192 — the first octet of every 192.168.x.x home address.
  3. 10101100 → 128+32+8+4 = 172 — the first octet of the 172.16–31 private range.
  4. 01111111 → 64+32+16+8+4+2+1 = 127 — the loopback octet, next lesson.
  5. 11111110 → everything except the final 1 = 255−1 = 254.
  6. 168 → 128 yes (40), 64 no, 32 yes (8), 16 no, 8 yes (0) → 10101000.
  7. 224 → 128 yes (96), 64 yes (32), 32 yes (0) → 11100000 — one of the nine mask values.
  8. 63 → 128 no, 64 no, 32 yes (31), 16 yes (15), 8 yes (7), 4 yes (3), 2 yes (1), 1 yes (0) → 00111111.
  9. 240 → 128+64+32+16 → 11110000 — another mask value.
  10. 201 → 11001001 — the lesson's worked example; if you peeked, redo 217 cold (answer: 11011001).

Nine or ten correct: move on. Fewer: this skill compounds through four more lessons, so drill before proceeding — Download: Binary Practice Workbook (120 further conversions in graded sets with a full answer key; drill until an 8-bit conversion takes you about fifteen seconds).

Check yourself

  1. A subnet mask reads 255.255.224.0. Write the third octet in binary, and count the total number of 1-bits in the whole mask.
  2. A junior tech documents a printer at 192.168.300.7. Without any network knowledge beyond this lesson, how do you know the record is wrong?
  3. ipconfig /all shows a Physical Address beginning 90-2E-.... What is the first octet's value in decimal, and how many bits does the pair 90 represent?
  4. Which is larger: the binary number 10000000 or the decimal number 100? Answer without converting fully.
  5. In the IPv6 address group 00ff, how many bits does the group represent, and what is ff in decimal?
  6. Your study partner asks why IPv4 uses decimal but MAC and IPv6 use hex, since "it's all bits anyway." Give a two-sentence answer.

Answers

  1. 224 = 11100000. The mask is 11111111.11111111.11100000.00000000 — 8 + 8 + 3 = 19 one-bits. (Next lesson: those 19 bits are the network part; the subnetting lesson writes this mask as /19.)
  2. An octet is eight bits, and eight bits max out at 11111111 = 255. 300 cannot fit in an octet, so the address is impossible — a typo, not a network mystery.
  3. 9 counts sixteens and 0 counts ones: 9×16 + 0 = 144. Two hex digits always represent eight bits — one octet.
  4. 10000000 has its leftmost bit set, which alone is worth 128 — already more than 100. The binary number is larger.
  5. Each hex digit is 4 bits, so a four-digit group is 16 bits. ff = 15×16 + 15 = 255 (all eight bits on).
  6. IPv4's 32 bits split into just four octets, so four small decimal numbers stay readable. MAC (48 bits) and IPv6 (128 bits) are too long for comfortable decimal, and hex maps to bits by pure substitution — every hex digit is exactly four bits — so it stays compact and transparent to the underlying pattern.

Key terms

  • Bit — a single binary digit, 1 or 0; the atom of all data and all addresses.
  • Binary (base 2) — the two-symbol positional number system computers are built from.
  • Decimal (base 10) — the everyday ten-symbol system; IPv4's display costume.
  • Hexadecimal (base 16) — the sixteen-symbol system (0–9, A–F) where one digit equals exactly four bits; MAC and IPv6's display costume.
  • Octet — eight bits; networking's preferred word for a byte. Every dotted-decimal number is one octet: 0–255.
  • Nibble — four bits, half an octet; exactly one hex digit.
  • Value row — the octet column weights 128, 64, 32, 16, 8, 4, 2, 1; the tool behind every conversion in this module.
  • Dotted-decimal notation — writing 32 bits as four octet values separated by dots, e.g. 192.168.1.23.

Summary

  • Every address is a bit pattern; decimal and hex are human-friendly costumes over binary.
  • The book's motivation stands: like a mechanic who knows the engine, you can only fix what you can see underneath — and troubleshooting addresses means seeing bits.
  • Binary → decimal: add the value-row numbers (128 64 32 16 8 4 2 1) wherever there's a 1. Decimal → binary: subtract the largest value that fits, left to right. Always add back to check.
  • An octet holds 0–255, full stop — anything above 255 in a dotted address is an error on sight.
  • Nine left-filled octets — 0, 128, 192, 224, 240, 248, 252, 254, 255 — are the only values subnet masks ever use.
  • One hex digit = four bits; two hex digits = one octet; conversion between hex and binary is substitution, not arithmetic.
  • IPv4 (32 bits) wears decimal; MAC (48 bits) and IPv6 (128 bits) wear hex.

Next lesson

You can now read the bits inside any octet. Next, those bits get their jobs: one part of an IPv4 address names the network, the other names the host — and a filter called the subnet mask decides where one part ends and the other begins.

Sources and further study

  • Al-Doori, T., Network Essentials, Chapter 6 — the number-systems mini-lesson and the mechanic's motivation, the backbone of this lesson.
  • RFC 791, "Internet Protocol" — https://www.rfc-editor.org/rfc/rfc791.html — where the 32-bit address and its octet structure are defined.
  • TCP/IP Fundamentals for Microsoft Windows, Microsoft Learn — https://learn.microsoft.com/en-us/previous-versions/tn-archive/bb962073(v=technet.10) — chapter-length background on addressing and conversions in the Windows context.
  • Download: Binary Practice Workbook (graded drill sets with answer key — the fluency you build here pays off in every remaining Module 4 lesson).