Addressing
An IPv4 address is made of four numbers that identify a device so data can be delivered to it across a network. It is always written as four numbers separated by dots, such as 203.17.88.142.
Each of the four numbers is stored in 8 bits, so each one must be a whole number from 0 to 255. Eight bits can take 256 different patterns, and because counting starts at 0 the largest value you can store is 255. Four numbers of 8 bits each make a full address 32 bits long.
| Address | Number of parts | Bits per part | Total bits |
|---|---|---|---|
| 203.17.88.142 | 4 | 8 | 4 × 8 = 32 |
Take the last number, 142. Written in binary it is 10001110, which is exactly 8 bits: 128 + 8 + 4 + 2. The largest an 8-bit group can be is 11111111, which is 255, so a number like 300 could never fit and is not a valid part of an IPv4 address.
This is why the four numbers matter: a valid IPv4 address has exactly four parts, and every part sits between 0 and 255. Something like 192.168.4 or 10.0.512.3 is not a valid IPv4 address, because the first has only three numbers and the second contains a value that is too big to store in 8 bits.
Edexcel GCSE Computer Science · Addressing