100-150 CCST ยท IP addressing and subnetting
IPv6 address format
128-bit hexadecimal notation, shortening rules for leading zeros and the double colon, and prefix length.
Key points
- An IPv6 address is 128 bits written as eight groups of up to four hex digits separated by colons.
- Shorten it by dropping leading zeros in each group (0db8 -> db8) and by replacing one run of all-zero groups with :: (only once per address).
- Trailing zeros inside a group stay: 2000 is not 2.
- A prefix is written address/length, for example 2001:db8:acad:1::/64.
Source: https://www.rfc-editor.org/rfc/rfc5952
Practice questions
What is the shortest valid form of 2001:0db8:0000:0000:0000:ff00:0042:8329?
- 2001:db8::ff00:42:8329
- 2001:db8:0:0:0:ff:42:8329
- 2001:db8::ff::42:8329
- 2001:8::ff00:42:8329
Show answer
Answer: A. 2001:db8::ff00:42:8329
Drop leading zeros in every group, then replace the run of three zero groups with ::. That gives 2001:db8::ff00:42:8329.
Which of these are valid IPv6 address notations?
- 2001:db8::1
- fe80::1
- ::1
- 2001::db8::1
- 2001:db8:g::1
Show answer
Answer: A. 2001:db8::1, B. fe80::1, C. ::1
2001:db8::1, fe80::1 and ::1 are valid. 2001::db8::1 uses :: twice and 2001:db8:g::1 contains g, which is not a hex digit.
True or false: because zeros can be dropped, the group 2000 may be shortened to 2.
Show answer
Answer: False
False. Only leading zeros in a group can be removed. In 2000 the zeros are trailing, so dropping them would change the value.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
