← IGCSE Computer Science Paper 1

Shortening an IPv6 address

Replaces one run of all-zero groups in an IPv6 address, and can be used only once. Leading zeros in each group can also be dropped, e.g. 0db8 becomes db8.

Understanding Shortening an IPv6 address in IGCSE Computer Science Paper 1

What it does: The six all-zero groups in a row are replaced by a single ::, giving fe80::1. ::1 has only one written group, so :: stands for seven all-zero groups to reach eight. Only leading zeros can be dropped. The zeros at the end of the group are part of the value, so 0A00 becomes A00. The second address uses :: twice, which is not allowed. 0d80 should become d80, because only the leading 0 is removed.

Common mistakes: Both leading zeros must be dropped, so 00a4 becomes a4. Dropping only one zero leaves 0a4. A group of all zeros shortens to a single 0, not to nothing. Only :: can stand in for whole zero groups.

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 342–354) 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
An IPv6 group is 0A00. Which is its shortened form with leading zeros dropped?
AA00
Matches
2001::db8::1
↓
The :: is used twice. It can only appear once, otherwise nobody can tell how many zero groups each one replaces.
Applying
Meanings
Term
::
Meaning
Replaces one run of all-zero groups in an IPv6 address, and can be used only once. Leading zeros in each group can also be dropped, e.g. 0db8 becomes db8.
Practice
2001:0db8:0000:0000:0000:0000:0000:0001
Testing
Gaps
Short: 2001:db81
Check Answer
Spots
3drop all leading zeros
4short = 0a4

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

The 'Rhinoceros' badge — Thick-Skinned Coder, 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. An IPv6 group is 0A00. Which is its shortened form with leading zeros dropped?
A. A00 ✓
B. A
Only leading zeros can be dropped. The zeros at the end of the group are part of the value, so 0A00 becomes A00.
2. How many times can :: appear in one IPv6 address?
A. Once for every run of zero groups
B. Only once ✓
Using :: twice would make it impossible to tell how many zero groups each one replaced, so it is allowed only once per address.
3. Which is a valid shortened IPv6 address?
A. 2001::db8::1
B. 2001:db8::1 ✓
The second address uses :: twice, which is not allowed.
4. The address 2001:db8::1 is expanded back to eight groups. What does :: stand for?
A. Five groups of 0000 ✓
B. Three groups of 0000
The address shows 3 groups (2001, db8 and 1). Eight groups are needed, so :: replaces 8 - 3 = 5 all-zero groups.
5. What can be replaced with :: in an IPv6 address?
A. A run of groups that are all zeros ✓
B. Any group that contains a zero
Only groups made entirely of zeros (0000) can be replaced. A group such as 0db8 still holds data, so it can only lose its leading zero.

Match the Pairs

0db8 -> db8 → Drops the leading zero from a group, so the group is written with fewer digits
2001:db8::1 → Expands to 2001:0db8:0000:0000:0000:0000:0000:0001, with :: standing for five all-zero groups
Replace one run of all-zero groups with :: to shorten the address → fe80:0:0:0:0:0:0:1 -> fe80::1
Expand a shortened address back to eight groups by filling :: with zero groups → ::1 = 0000:0000:0000:0000:0000:0000:0000:0001
2001::db8::1 → The :: is used twice. It can only appear once, otherwise nobody can tell how many zero groups each one replaces.
0d80 -> d8 → Only leading zeros can be dropped. The zero at the end of the group is part of the value, so d8 is a different number.

Key Term

::
Replaces one run of all-zero groups in an IPv6 address, and can be used only once. Leading zeros in each group can also be dropped, e.g. 0db8 becomes db8.

Fill in the Blanks

1. Full: 2001:0db8:0000:0000:0000:0000:0000:0001 Short: 2001:db8::1
Hint: Type the symbol that replaces one run of all-zero groups.
2. Full: fe80:0000:0000:0000:0202:b3ff:fe1e:8329 Short: fe80::202:b3ff:fe1e:8329
Hint: Type the group that is left after the leading zero is dropped from the fourth-from-last group.
3. Short: 2001:db8::ff00:42:8329 Full: 2001:0db8:0000:0000:0000:ff00:0042:8329
Hint: Type the group that has had its leading zeros put back, so it has four digits.
4. Rule: :: can be used only once per address
Hint: Type how many times :: may appear in one IPv6 address.
5. Address: fe80::1 Groups written out: 2 of 8 :: replaces 6 groups of 0000
Hint: Type the number of groups missing from the full eight.

Spot the Error

Question 1
A group = 00a4
B leading zeros = 2
C drop all leading zeros
D short = 0a4
Line D — Both leading zeros must be dropped, so 00a4 becomes a4. Dropping only one zero leaves 0a4.
Question 2
A group = 0000
B short = nothing
C a group is never left empty
Line B — A group of all zeros shortens to a single 0, not to nothing. Only :: can stand in for whole zero groups.
Question 3
A group = 0d00
B short = d
C trailing zeros must stay
Line B — Only leading zeros can be dropped. The two zeros after the d are trailing zeros, so 0d00 becomes d00.
Question 4
A addr = 2001:db8:0:0:1:0:0:2
B zero runs: 0:0 and 0:0
C use :: on both runs
D short = 2001:db8::1:0:0:2
Line C — The :: can be used only once in an address. If it were used twice, nobody could tell how many zero groups each one hides. It should say to use :: on only one run.
Question 5
A short = fe80::1
B groups shown = 2
C zero groups hidden = 5
D full has 8 groups
Line C — A full address has 8 groups and 2 are shown (fe80 and 1), so :: hides 8 - 2 = 6 zero groups, not 5.

Student with a class code? Join your class →