Binary numbers may sound complex, but they're the fundamental language of computers and play a crucial role in understanding networks, like TCP/IP subnet masks. Don't worry; we'll keep it super simple!
Date: 2007-08-12
Author: Simon Jackson
At the heart of binary are just two digits: 0 and 1. Think of them as a computer's way of saying "off" (0) and "on" (1). Computers use these on/off signals to represent everything, from numbers and text to images and videos.
Counting in binary is like counting on your fingers, but you only have two fingers: your thumb and index finger. With 5x digits, you can feasibly count from 0 to 31.
Start with your thumb down (0).
Raise your thumb (1).
Raise your index finger while keeping your thumb up (10).
Raise both your thumb and index finger (11).
... and keep going.
all five fingers in the air (11111 = 32)
See the table to the right, showing the Binary vs Decimal comparisons.
Now, let's talk about TCP/IP networking, explicitly subnet masks. These masks help network routers figure out which part of an IP address belongs to the network and which part identifies a specific device (host) on that network. It's all about mathematics. Simply BINARY ADD together the IP-ADDRESS and SUBNET-MASK, to reveal the NETWORK NUMBER.
Deduct the NETWORK NUMBER from the Binary IP Address, and you have the HOST ID.
By changing the number of 1s in the subnet mask, you can define different-sized networks. If you have more 1s in the mask, you get a smaller network with fewer devices. Fewer 1s mean a larger network.
The traditional Class C network has a 255.255.255.0 subnet mask (24-bits turned to one (in binary: 11111111.11111111.11111111.00000000).. Which gives us 8x bits for the host-IDs.. and we are talking 2^8 = 256 addresses.
Now lets change from 24-bit to 25-bit, a subnet mask of 255.255.255.128 (in binary: 11111111.11111111.11111111.10000000); this effectively creates two smaller subnets, each with half the available host-IDs inside.
So is that why some ISPs give you a 30-bit subnet mask? Well, yes. 30-bit is a subnet of 4x Host IDs (in binary: 11111111.11111111.11111111.11111100). Which means they can divvy out many millions of them, and each customer has:
- a network address
- a default gateway address
- a router WAN ip-address
- a broadcast address
Which of course means 2x usable IP- addresses in a 30-bit subnet mask.
Binary numbers are the foundation of computer communication and networking. They help us understand how devices on a network are organised, including the boundaries of different subnets. By mastering binary basics, you can gain insights into how data flows across networks, making it an essential skill for anyone delving into the world of IT and networking.