Spotting an invalid IPv4 address

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Spotting an invalid IPv4 address

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which of these is a valid IPv4 address?
A 192.168.0.1
B 192.168.0.256
2. Why is 192.168.1 an invalid IPv4 address?
A It has only three groups instead of four
B The numbers are too small
3. Which address is invalid?
A 10.0.0.5
B 10.0.0.0.5
4. Is 255.255.255.255 a valid IPv4 address?
A No, because 255 is too big
B Yes, because 255 is the highest allowed group value
5. Which address is invalid because of a letter?
A 172.16.a.4
B 172.16.10.4

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1256.10.4.7 AThe second group is a letter. Groups must be numbers from 0 to 255, so the address is invalid.
2192.168.1 BInvalid: it has only three groups instead of exactly four
3An IPv4 address with more than four groups is invalid C10.0.0.1.5
4Every group in a valid IPv4 address must be a whole number from 0 to 255 D172.16.254.1
510.-5.2.1 EThe second group is a negative number. Groups cannot be below 0, so the address is invalid.
610.a.2.1 FInvalid: the first group is 256, which is above the maximum of 255

Definitions

invalid IPv4 address

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
256.1.1.1 is invalid: 256 is above ___
2.
192.168.1 is invalid: 3 groups, need _
3.
10.-5.2.1 is invalid: -5 is below _
4.
10.a.2.1 is invalid: a group must be a ______
5.
IF group < 0 __ group > 255 THEN OUTPUT "Invalid" ENDIF

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Router: 192.168.0.1
B Laptop: 192.168.0.12
C Printer: 192.168.0.256
D Phone: 192.168.0.31
Question 2
A Server: 10.0.0
B PC1: 10.0.0.6
C PC2: 10.0.0.7
Question 3
A Lab network
B PC1: 172.16.4.10
C PC2: 172.16.4.11
D PC3: 172.16.4.12.5
Question 4
A Switch: 192.168.5.1
B Camera: 192.168.B.40
C Tablet: 192.168.5.41
Question 5
A Gateway: 10.1.1.1
B Guest1: 10.1.1.8
C Guest2: 10.-1.1.9

Answer Key

Spotting an invalid IPv4 address
Section A: Quick Questions
Q1
A — 192.168.0.1
Q2
A — It has only three groups instead of four
Q3
B — 10.0.0.0.5
Q4
B — Yes, because 255 is the highest allowed group value
Q5
A — 172.16.a.4
Section B: Match the Pairs
Q1
256.10.4.7 → Invalid: the first group is 256, which is above the maximum of 255
Q2
192.168.1 → Invalid: it has only three groups instead of exactly four
Q3
An IPv4 address with more than four groups is invalid → 10.0.0.1.5
Q4
Every group in a valid IPv4 address must be a whole number from 0 to 255 → 172.16.254.1
Q5
10.-5.2.1 → The second group is a negative number. Groups cannot be below 0, so the address is invalid.
Q6
10.a.2.1 → The second group is a letter. Groups must be numbers from 0 to 255, so the address is invalid.
Section C: Definitions
Q1
invalid IPv4 address — An address without exactly four groups, or with a group outside 0 to 255. Examples: 256.1.1.1 (too big), 192.168.1 (too few groups), 10.-5.2.1 (negative) and 10.a.2.1 (letter).
Section D: Fill in the Blanks
Q1
256.1.1.1 is invalid: 256 is above 255
Q2
192.168.1 is invalid: 3 groups, need 4
Q3
10.-5.2.1 is invalid: -5 is below 0
Q4
10.a.2.1 is invalid: a group must be a number
Q5
IF group < 0 OR group > 255 THEN OUTPUT "Invalid" ENDIF
Section E: Spot the Error
Q1
C — Each group in an IPv4 address must be from 0 to 255. 256 is too big, so the address is invalid. It should be a value such as 192.168.0.20.
Q2
A — An IPv4 address needs exactly four groups. 10.0.0 only has three, so it is invalid. It should be 10.0.0.5.
Q3
D — This address has five groups. IPv4 allows exactly four, so it is invalid. It should be 172.16.4.12.
Q4
B — Each IPv4 group must be a number from 0 to 255. A letter such as B is not allowed. It should be 192.168.5.40.
Q5
C — A group cannot be negative because the range starts at 0. 10.-1.1.9 is invalid. It should be 10.1.1.9.