Skip to content

Dotted-decimal addresses

Module
Understanding IPv4 Addresses
Difficulty
Easy
Updated
Tested on
Ubuntu 24.04.5 LTS, netlab 1.0, GNU Bash 5.2.21, tcpdump 4.99.4
On this page

You found inet 10.77.10.10/24 in Reading a machine’s network settings. The address has four numbers and three dots. Why four, and why does each number stop at 255? Here you will read that shape and reject strings that cannot fit it.

Seven questions from laptop to web A horizontal line joins laptop to web through seven numbered circles. Station 1 is the focus: what settings laptop has. No station is fully answered yet. laptop web 1 2 3 4 5 6 7
Seven questions from laptop to web A horizontal line joins laptop to web through seven numbered circles. Station 1 is the focus: what settings laptop has. No station is fully answered yet. laptop web 1 2 3 4 5 6 7
Station 1: what settings laptop has. This module explains what the address numbers mean; who gave them comes later. The other questions remain open.

Finish Practice: Ethernet and Local Delivery. Have the lab running in its starting state, with modes off. Begin at learner@rootvolt:~$, outside any machine shell. These reads change no settings, so you do not need a reset between them.

An IPv4 address is a 32-bit address used by the internet layer to name an interface. A bit is a single 0 or 1. The familiar written form groups those bits into four sets of eight. An octet is one group of eight bits.

The decimal form writes each octet as an ordinary base-ten number. Dots separate the four numbers. They are separators for people reading the address; they do not add bits to it. Four groups of eight give 32 bits altogether. Read the whole address, including repeated numbers. Two equal octets still occupy two different positions.

Four octets make one IPv4 address Each decimal number represents eight bits. Together the four octets contain 32 bits. octet 1 10 00001010 8 bits . octet 2 77 01001101 8 bits . octet 3 10 00001010 8 bits . octet 4 10 00001010 8 bits 32 bits: one IPv4 address
Four octets make one IPv4 address Each decimal number represents eight bits. Together the four octets contain 32 bits. 10.77.10.10 10 00001010 8 bits 77 01001101 8 bits 10 00001010 8 bits 10 00001010 8 bits 32 bits in all
Laptop's address has four octets. Each number stands for eight bits, making 32 bits altogether.

The figure shows the same address in two forms. You do not need to convert the bit strings yet. Count eight positions under each decimal number. Each position has two possible values. That gives 256 possible patterns in an octet. Counting from zero, those patterns represent values from 0 through 255: 00000000 is 0 and 11111111 is 255. There is no 257th pattern for 256.

Check the shape before asking what it means

Section titled “Check the shape before asking what it means”

Predict which of these five strings cannot have IPv4 address format: 192.0.2.7, 192.0.2.256, 198.51.100.7.1, 203.0.113.0, 10.77.10.10. Write a reason beside each rejection, then use the figure above to check your count.

Check your answer

192.0.2.256 fails because 256 exceeds one octet’s limit. 198.51.100.7.1 has five numbers. The other three have the right format. That judgment does not say whether you may assign them to an ordinary interface.

A format check asks only about the written numbers. It does not establish that somebody uses the address, that it can receive a message, or that it has a particular purpose. Keep those questions separate. A zero in one position does not by itself make the written format invalid.

Repeat the replay’s commands. As in the previous module, netlab shell <machine> -- <command> runs one command there and returns to the VM. Answer the password question if it appears.

Read laptop and router IPv4 addresses
learner@rootvolt:~$ netlab shell laptop -- ip -br address[sudo] password for learner: lo               UNKNOWN        127.0.0.1/8 ::1/128 
eth0@if3         UP             10.77.10.10/24 fe80::77:10ff:fe00:10/64 learner@rootvolt:~$ netlab shell router -- ip -br addresslo               UNKNOWN        127.0.0.1/8 ::1/128 
eth0@if7         UP             10.77.10.1/24 fe80::77:10ff:fe00:1/64 
eth1@if9         UP             10.77.20.1/24 fe80::77:20ff:fe00:1/64 learner@rootvolt:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.0), GNU Bash 5.2.21. Read the brief address lists on laptop and router from the VM terminal.
Steps (9)
  1. Type netlab shell laptop -- ip -br address
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter
  6. Output: lo UNKNOWN 127.0.0.1/8 ::1/128 eth0@if3 UP 10.77.10.10/24 fe80::77:10ff:fe00:10/64
  7. Type netlab shell router -- ip -br address
  8. Press Enter
  9. Output: lo UNKNOWN 127.0.0.1/8 ::1/128 eth0@if7 UP 10.77.10.1/24 fe80::77:10ff:fe00:1/64 eth1@if9 UP 10.77.20.1/24 fe80::77:20ff:fe00:1/64

Laptop’s eth0@if3 has 10.77.10.10/24. Reading a machine’s network settings explained the @if3 suffix. The fe80:: value is an IPv6 address, which this module does not use; IPv6 Foundations explains it. Leave the slash and number for the next lesson.

Router has two non-loopback interface rows: eth0@if7 has 10.77.10.1/24, and eth1@if9 has 10.77.20.1/24. These are two IPv4 addresses on one machine. Match an address to its row before describing where it belongs.

“The dots separate network, sub-network, floor and device.” They only separate octets. No octet means a building floor. The next lesson shows what decides the network part.

“A machine has one address.” Router’s two interface rows disprove that rule. An address belongs to an interface; one machine can have several.

Write each octet without leading zeros: 10.77.10.10, not 010.077.010.010. Some programs read a number with a leading zero in another number system, so it can become a different address.

Mark these ten strings valid in format or invalid. Write the failed rule for each invalid string: 192.0.2.9, 198.51.100.25, 203.0.113.255, 10.77.20.80, 192.168.0.0, 192.0.2.300, 198.51.100, 203.0.113.1.2, 192.0.-2.9, 192..2.9. Then run netlab shell phone -- ip -br address and netlab shell web -- ip -br address. Write each IPv4 address’s four octets and compare them with your format rules.

Solution

The first five pass the format check. The last five fail: too large, too few numbers, too many numbers, a negative number, and a missing number. Phone has 10.77.10.11/24; web has 10.77.20.80/24. Their four octets are 10, 77, 10, 11 and 10, 77, 20, 80. Both pass. The next lesson reads the /24. Passing this check alone does not make a string suitable for use on your network.

Binary where it helps in Subnetting Foundations explains converting between binary and decimal.

  • An IPv4 address contains four eight-bit octets.
  • Each decimal octet ranges from 0 to 255.
  • Read the interface row before assigning meaning to an address.

Next, Networks, hosts, and prefixes reads the slash after the address.