Convert IP addresses to binary, understand network calculations, and master bit manipulation
Click any IP address to see its binary representation
Perform bitwise operations for networking calculations
Analyze IP addresses using binary operations
Understand subnet masks in binary form
Binary is a number system that uses only two digits: 0 and 1. Computers use binary because electronic circuits can easily represent these two states - off (0) and on (1).
Although we write IP addresses in decimal notation like 192.168.1.1
, computers actually work with them in binary. Understanding this helps explain:
Each part of an IP address (called an octet) is 8 bits long. Each bit position represents a power of 2:
Bit Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
Decimal Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Your home router typically uses 192.168.1.1
:
Full binary: 11000000.10101000.00000001.00000001
Understanding binary is crucial for subnetting. Subnet masks use binary to determine which part of an IP address represents the network and which part represents the host.
A subnet mask like 255.255.255.0
in binary is 11111111.11111111.11111111.00000000
:
Variable Length Subnet Masking (VLSM) works by borrowing bits from the host portion. Each borrowed bit doubles the number of subnets but halves the number of hosts per subnet.
CIDR | Decimal Mask | Binary (Last Octet) | Hosts |
---|---|---|---|
/24 | 255.255.255.0 | 00000000 | 254 |
/25 | 255.255.255.128 | 10000000 | 126 |
/26 | 255.255.255.192 | 11000000 | 62 |
/27 | 255.255.255.224 | 11100000 | 30 |
Access Control Lists (ACLs) use wildcard masks, which are the inverse of subnet masks. Where subnet masks use 1s for network bits, wildcard masks use 0s.
Routers perform millions of binary operations per second when making forwarding decisions. Understanding these operations is crucial for network optimization and troubleshooting.
Routers use binary comparisons to find the most specific route. They compare the destination IP address bit-by-bit with routing table entries, selecting the entry with the longest matching prefix.
Modern routers use specialized hardware (ASICs and TCAMs) that can perform binary comparisons at line speed. These chips can compare thousands of routes simultaneously using parallel binary operations.
IPv4 provides 2³² = 4,294,967,296 total addresses. However, many are reserved:
CIDR allows multiple networks to be summarized into a single route advertisement. This is done by finding common binary prefixes:
Binary operations affect network performance: