← IGCSE Computer Science Paper 1

Spotting an 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).

Understanding Spotting an invalid IPv4 address in IGCSE Computer Science Paper 1

What it does: This address has five groups. IPv4 allows exactly four, so it is invalid even though every number is between 0 and 255. Every group must be from 0 to 255. 256 is one too high, so 192.168.0.256 is invalid. Each group can be 0 to 255, so 255 is allowed. 256 is the first number that is too big. A group is an 8-bit number from 0 to 255, so it cannot be negative. 300 is higher than 255, so 300.10.10.10 is invalid. 30 is within the range. Repeated values are fine, for example 8.8.8.8. The problem here is that there are only three groups.

Common mistakes: 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. An IPv4 address needs exactly four groups. 10.0.0 only has three, so it is invalid. It should be 10.0.0.5.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 325–341) and word search (Modules 325–354).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which of these is a valid IPv4 address?
192.168.0.1192.168.0.256
Matches
10.-5.2.1
↓
The second group is a negative number. Groups cannot be below 0, so the address is invalid.
Applying
Meanings
Term
invalid IPv4 address
Meaning
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).
Practice
address ← "256.1.1.1"
Testing
Gaps
256.1.1.1 is invalid: 256 is above
Check Answer
Spots
2Laptop: 192.168.0.12
3Printer: 192.168.0.256

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Woolly Mammoth' badge — Tundra Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which of these is a valid IPv4 address?
A. 192.168.0.1 ✓
B. 192.168.0.256
Every group must be from 0 to 255. 256 is one too high, so 192.168.0.256 is invalid.
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
An IPv4 address needs exactly four groups. Small numbers such as 1 are fine, because 0 is allowed.
3. Which address is invalid?
A. 10.0.0.5
B. 10.0.0.0.5 ✓
10.0.0.0.5 has five groups. A valid IPv4 address has exactly four.
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 ✓
Each group can be 0 to 255, so 255 is allowed. 256 is the first number that is too big.
5. Which address is invalid because of a letter?
A. 172.16.a.4 ✓
B. 172.16.10.4
IPv4 groups are made only of the digits 0 to 9. A letter such as a makes the address invalid.

Match the Pairs

256.10.4.7 → Invalid: the first group is 256, which is above the maximum of 255
192.168.1 → Invalid: it has only three groups instead of exactly four
An IPv4 address with more than four groups is invalid → 10.0.0.1.5
Every group in a valid IPv4 address must be a whole number from 0 to 255 → 172.16.254.1
10.-5.2.1 → The second group is a negative number. Groups cannot be below 0, so the address is invalid.
10.a.2.1 → The second group is a letter. Groups must be numbers from 0 to 255, so the address is invalid.

Key Term

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).

Fill in the Blanks

1. 256.1.1.1 is invalid: 256 is above 255
Hint: Type the highest value allowed in one IPv4 group.
2. 192.168.1 is invalid: 3 groups, need 4
Hint: Type the exact number of groups an IPv4 address must have.
3. 10.-5.2.1 is invalid: -5 is below 0
Hint: Type the lowest value allowed in one IPv4 group.
4. 10.a.2.1 is invalid: a group must be a number
Hint: Type the kind of value each group must be, instead of a letter.
5. IF group < 0 OR group > 255 THEN OUTPUT "Invalid" ENDIF
Hint: Type the logic keyword that is true when either test is true.

Spot the 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
Line 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.
Question 2
A Server: 10.0.0
B PC1: 10.0.0.6
C PC2: 10.0.0.7
Line 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.
Question 3
A Lab network
B PC1: 172.16.4.10
C PC2: 172.16.4.11
D PC3: 172.16.4.12.5
Line D — This address has five groups. IPv4 allows exactly four, so it is invalid. It should be 172.16.4.12.
Question 4
A Switch: 192.168.5.1
B Camera: 192.168.B.40
C Tablet: 192.168.5.41
Line 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.
Question 5
A Gateway: 10.1.1.1
B Guest1: 10.1.1.8
C Guest2: 10.-1.1.9
Line 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.

Student with a class code? Join your class →