Which shortened forms of the IPv6 address 2001:0db8:0f3c:00d7:7dab:03d0:0000:00ff are valid? 1. 2001:db8:f3c:d7:7dab:3d:0:ff · 2. 2001:db8:f3c:d7:7dab:3d0:0:ff · 3. 2001:db8:f3c:d7:7dab:3d0::ff · 4. 2001:0db8:0f3c:00d7:7dab:03d::00ff
Answer
1. Not valid – 03d0 was shortened to “3d”; the trailing zero was removed. Only leading zeros may be dropped (correct: 3d0).
2. Valid – all leading zeros removed correctly; the zero block is written as 0.
3. Valid – like 2, but the single zero block is replaced by ::.
4. Not valid – “03d” again removes a trailing zero from 03d0. (Keeping leading zeros like 0db8 or 00ff would be allowed.)
Rules: remove only leading zeros in a block; replace one run of zero blocks with ::, only once per address.
Diagram
Key vocabulary
Term
Meaning
Example
valid / invalid
allowed / not allowed by the rules
Option 1 is invalid.
short form
a shortened way of writing
Use the short form in the documentation.
leading zero
a zero at the start of a number
You may drop leading zeros.
trailing zero
a zero at the end of a number
Never drop trailing zeros.
zero block
a block that contains only zeros
The seventh block is a zero block.
to expand
to write a short form in full again
Expand the address to check your answer.
Useful phrases
to break a ruleOption 4 breaks the rule about trailing zeros.
to double-checkDouble-check by expanding the address.
it is allowed to …It is allowed to keep leading zeros.
to be equivalentOptions 2 and 3 are equivalent.
Talk about it
Explain to a classmate why option 1 is wrong. Expand it back to the full form.
Write two more valid short forms of the same address.
Why do you think IPv6 allows short forms at all?
IHK hint
German: Gültige Kurzschreibweisen: 2 und 3 erlaubt; 1 und 4 nicht erlaubt (aus 03d0 wurde 3d bzw. 03d – nur führende Nullen dürfen entfallen).