Shortening an IPv6 address

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

Shortening an IPv6 address

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. An IPv6 group is 0A00. Which is its shortened form with leading zeros dropped?
A A00
B A
2. How many times can :: appear in one IPv6 address?
A Once for every run of zero groups
B Only once
3. Which is a valid shortened IPv6 address?
A 2001::db8::1
B 2001:db8::1
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
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

Match the Pairs

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

Left columnRight column
10db8 -> db8 ADrops the leading zero from a group, so the group is written with fewer digits
22001:db8::1 Bfe80:0:0:0:0:0:0:1 -> fe80::1
3Replace one run of all-zero groups with :: to shorten the address CExpands to 2001:0db8:0000:0000:0000:0000:0000:0001, with :: standing for five all-zero groups
4Expand a shortened address back to eight groups by filling :: with zero groups D::1 = 0000:0000:0000:0000:0000:0000:0000:0001
52001::db8::1 EOnly leading zeros can be dropped. The zero at the end of the group is part of the value, so d8 is a different number.
60d80 -> d8 FThe :: is used twice. It can only appear once, otherwise nobody can tell how many zero groups each one replaces.

Definitions

::

Fill in the Blanks

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

1.
Full: 2001:0db8:0000:0000:0000:0000:0000:0001 Short: 2001:db8__1
2.
Full: fe80:0000:0000:0000:0202:b3ff:fe1e:8329 Short: fe80::___:b3ff:fe1e:8329
3.
Short: 2001:db8::ff00:42:8329 Full: 2001:0db8:0000:0000:0000:ff00:____:8329
4.
Rule: :: can be used only ____ per address
5.
Address: fe80::1 Groups written out: 2 of 8 :: replaces _ groups of 0000

Spot the Error

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

Question 1
A group = 00a4
B leading zeros = 2
C drop all leading zeros
D short = 0a4
Question 2
A group = 0000
B short = nothing
C a group is never left empty
Question 3
A group = 0d00
B short = d
C trailing zeros must stay
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
Question 5
A short = fe80::1
B groups shown = 2
C zero groups hidden = 5
D full has 8 groups

Answer Key

Shortening an IPv6 address
Section A: Quick Questions
Q1
A — A00
Q2
B — Only once
Q3
B — 2001:db8::1
Q4
A — Five groups of 0000
Q5
A — A run of groups that are all zeros
Section B: Match the Pairs
Q1
0db8 -> db8 → Drops the leading zero from a group, so the group is written with fewer digits
Q2
2001:db8::1 → Expands to 2001:0db8:0000:0000:0000:0000:0000:0001, with :: standing for five all-zero groups
Q3
Replace one run of all-zero groups with :: to shorten the address → fe80:0:0:0:0:0:0:1 -> fe80::1
Q4
Expand a shortened address back to eight groups by filling :: with zero groups → ::1 = 0000:0000:0000:0000:0000:0000:0000:0001
Q5
2001::db8::1 → The :: is used twice. It can only appear once, otherwise nobody can tell how many zero groups each one replaces.
Q6
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.
Section C: Definitions
Q1
:: — 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.
Section D: Fill in the Blanks
Q1
Full: 2001:0db8:0000:0000:0000:0000:0000:0001 Short: 2001:db8::1
Q2
Full: fe80:0000:0000:0000:0202:b3ff:fe1e:8329 Short: fe80::202:b3ff:fe1e:8329
Q3
Short: 2001:db8::ff00:42:8329 Full: 2001:0db8:0000:0000:0000:ff00:0042:8329
Q4
Rule: :: can be used only once per address
Q5
Address: fe80::1 Groups written out: 2 of 8 :: replaces 6 groups of 0000
Section E: Spot the Error
Q1
D — Both leading zeros must be dropped, so 00a4 becomes a4. Dropping only one zero leaves 0a4.
Q2
B — A group of all zeros shortens to a single 0, not to nothing. Only :: can stand in for whole zero groups.
Q3
B — Only leading zeros can be dropped. The two zeros after the d are trailing zeros, so 0d00 becomes d00.
Q4
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.
Q5
C — A full address has 8 groups and 2 are shown (fe80 and 1), so :: hides 8 - 2 = 6 zero groups, not 5.