Network Bytes · Episode 19 · CCNA 1.6

Binary in 60 seconds

To read an IP address like a router, you only need to count to 255 in binary. Here's how eight bits make one byte, and why every part of an IP address is between 0 and 255.

Posted · About a 1 minute watch, 2 minute read · Take the quiz

Bits and bytes

Computers store everything as ones and zeros. Each one or zero is a bit, like a light switch that's either off (0) or on (1).

An IPv4 address such as 192.168.1.25 has four parts, and each part is eight bits. Eight bits together are called a byte (network people also call each part an octet). So a whole IPv4 address is 4 × 8 = 32 bits.

Each switch has a value

Line up the eight switches. Starting from the right, each one is worth double the one before it:

128 64 32 16 8 4 2 1

That doubling is the whole trick of binary. In everyday decimal, each place is worth ten times the last (1, 10, 100). In binary, each place is worth two times the last.

Making a number

To write a number, turn on the switches that add up to it and leave the rest off.

Take 25. The biggest value that fits is 16, leaving 9. Then 8, leaving 1. Then 1. So 25 = 16 + 8 + 1, and the switches read 00011001.

Turn all eight on and you get 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 (11111111). All off is 0 (00000000). Eight bits can't go any higher, which is why every part of an IP address is between 0 and 255. An address like 192.168.1.300 simply can't exist.

Try it yourself

Convert 192 to binary: start with 128 (64 left), then 64 (0 left). That's 11000000. Now try 168 (hint: 128 + 32 + 8).

To check your answers, open the Calculator app on Windows or a Mac, switch it to Programmer mode, type a number in decimal and read the binary (BIN) line.

Good to know

  • This is how IPv4 works: four 8-bit parts, 32 bits in total.
  • IPv6 addresses are 128 bits long and are written in hexadecimal instead. They get their own lesson later.

For CCNA learners

This lines up with CCNA 200-301 exam topic 1.6, configure and verify IPv4 addressing and subnetting: converting each octet between decimal and binary with the 128-64-32-16-8-4-2-1 place values is the skill every subnetting question builds on.

Test your knowledge

Quick quiz: Binary in 60 seconds

4 multiple-choice questions. Pick one answer for each, then check how you did.

1How many bits are in each part of an IPv4 address?
2What is 25 in binary?
3Going from right to left, what happens to the value of each bit?
4Why can't a part of an IP address be 300?

Sources

Video transcript

To read an IP address like a router, you only need to count to 255. In binary.

Computers store everything as ones and zeros, called bits. Each part of an IP address is eight bits, a byte.

Each switch has a value. From the right: 1, 2, 4, 8, 16, 32, 64, 128. Each one doubles.

To make a number, flip on the switches that add up to it. 25 is 16 plus 8 plus 1. All eight on? 255, the biggest number one byte can hold.

That's why every part of an IP address is between 0 and 255.

That's your bite. Next: what a subnet mask does.

More from Network Bytes

All Network Bytes lessons