Introduction to IPv6: why IPv6, the header, address format and shortening rules
This lesson is open to everyone. The other lessons open with a package: sign in or sign up, then choose a package.
Key points
- IPv4: 32 bits = 4,294,967,296 addresses. IPv6: 128 bits: about 3.4 × 10³⁸ addresses. VLSM and NAT/PAT extended IPv4's life, but they were not enough.
- IPv4 and IPv6 are not compatible: OSPFv2 → OSPFv3, ICMP → ICMPv6, ARP → NDP. Running both at the same time is called dual stack.
- The IPv6 header is simpler: the checksum and fragmentation fields were removed, TTL → Hop Limit, Protocol → Next Header, and Flow Label is new.
- Format: 8 groups × 4 hex characters, separated by colons (:). Each hex character is 4 bits (0–9, A=10 ... F=15).
- Shortening: (1) drop the leading zeros in each group,
0000→0; (2) replace a run of zero groups with::only once. Example: 2001:0DB8:0000:00A1:0000:0000:0000:0B07 → 2001:DB8:0:A1::B07.
Why IPv6?
For as long as the Internet has existed, IPv4 has been used for addressing and routing. The problem with IPv4 is that we are running out of addresses.
IPv4 has 32 bits, which means 2³² = 4,294,967,296 IP addresses. Remember the class A, B and C system from earlier in the course: in the early days of the Internet, companies received a whole class A, B or C network.
| Class | Number of addresses |
|---|---|
| C | 256 |
| B | 65,536 |
| A | 16,777,216 |
Large companies got one or more class A networks, but did they really need 16 million addresses? Many addresses were wasted.
Then we started using VLSM (Variable Length Subnet Mask): we could use any subnet mask and create smaller subnets. With NAT and PAT we also started placing many private addresses behind a single public address.
Even so, the Internet grew in a way nobody expected. Despite tricks like VLSM and NAT/PAT, more addresses were needed, and IPv6 was born.
What happened to IPv5? IP version 5 was used for an experimental project called the "Internet Stream Protocol" (RFC 1819).
IPv6 addresses are 128 bits long. Every extra bit doubles the number of addresses. This is 2¹²⁸:
340,282,366,920,938,463,463,374,607,431,768,211,456
That is about 3.4 × 10³⁸ addresses: enough for everyone and every device. IPv6 addresses are written in hexadecimal.
Exam note: IPv6 is in the Network Fundamentals section of the CCNA 200-301 exam: you need to configure and verify IPv6 addressing and prefixes and describe the IPv6 address types.
IPv4 and IPv6 are not compatible
IPv4 and IPv6 are not compatible with each other, so many protocols have been updated or replaced for IPv6:
| IPv4 | IPv6 |
|---|---|
| OSPF version 2 | OSPFv3 |
| ICMP | ICMPv6 |
| ARP | NDP (Neighbor Discovery Protocol) |
The future is a migration from IPv4 to IPv6. This means that for a while both protocols will run on the network. Perhaps one day, when the whole Internet is configured for IPv6, we can switch IPv4 off completely. Running IPv4 and IPv6 at the same time is called dual stack.
The IPv6 header
An IPv6 packet header also contains the source and destination addresses, but compared to IPv4 it has become much simpler:
| Change | Fields |
|---|---|
| Removed | IHL, Identification, Flags, Fragment Offset, Header Checksum, Options/Padding |
| Renamed | ToS → Traffic Class, Total Length → Payload Length, TTL → Hop Limit, Protocol → Next Header |
| New | Flow Label |
| Kept | Version, Source Address, Destination Address (now 128 bits) |
Instead of putting every field in the header up front, IPv6 uses the Next Header field, which points to additional (optional) headers. Because the header is simpler, routers have less work to do.
IPv6 routing
What changes in routing? The routing options for IPv6:
| Method | Note |
|---|---|
| Static routing | Just like IPv4, nothing new |
| RIPng | The updated version of RIP (RIP next generation) |
| OSPFv3 | OSPF for IPv4 is version 2; for IPv6 it is version 3. It is a separate protocol that only runs IPv6 |
| EIGRP | Supports IPv6 |
| MP-BGP | Multi-Protocol BGP: the protocol that glues the Internet together can also route IPv6 (not a CCNA topic) |
Keep in mind: OSPF and EIGRP support IPv6, but these are separate processes. In a network with both IPv4 and IPv6, you run one routing protocol process for IPv4 and another for IPv6.
The hexadecimal system
An IPv6 address is hexadecimal. If you are not sure how hexadecimal works, look at this table:
| Hex | Binary | Hex | Binary |
|---|---|---|---|
| 0 | 0000 | 8 | 1000 |
| 1 | 0001 | 9 | 1001 |
| 2 | 0010 | A | 1010 |
| 3 | 0011 | B | 1011 |
| 4 | 0100 | C | 1100 |
| 5 | 0101 | D | 1101 |
| 6 | 0110 | E | 1110 |
| 7 | 0111 | F | 1111 |
In hexadecimal we count from 0 to F, just like 0 to 15 in decimal: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. Each hex character is exactly 4 bits.
The IPv6 address format
An example address:
2001:0DB8:0000:00A1:0000:0000:0000:0B07
- It is hexadecimal and much longer than an IPv4 address.
- There are eight groups, each with four hex characters (16 bits).
- 128 bits = 32 hex characters.
In these lessons we use the 2001:DB8::/32 range for examples. This range is reserved for documentation and examples (RFC 3849) and is never assigned on a real network.
Shortening rules
Hexadecimal makes the address shorter, but typing an IPv6 address is still a lot of work. Imagine calling a friend and saying: "please ping 2001:0DB8:0000:00A1:0000:0000:0000:0B07". That's why IPv6 addresses can be shortened.
Rule 1: drop the leading zeros in each group.
Full: 2001:0DB8:0000:00A1:0000:0000:0000:0B07 Short: 2001:DB8:0:A1:0:0:0:B07
0DB8→DB8,00A1→A1,0B07→B07: the zeros at the start of a group are dropped.0000→0: a group of four zeros keeps a single zero.- Zeros at the end are not dropped:
A100is notA1!
Another example:
Full: 2001:0DB8:0001:0002:0003:0004:0005:0006 Short: 2001:DB8:1:2:3:4:5:6
Rule 2: replace a run of zero groups with :: once.
Short: 2001:DB8:0:A1:0:0:0:B07 Shorter: 2001:DB8:0:A1::B07
The three consecutive zero groups (0:0:0) were replaced by ::.
:: may only be used once. This address has two separate places with zeros (the 3rd group and groups 5–7). If we replaced both with ::, we would get 2001:DB8::A1::B07. That is wrong: a device could not tell how many groups each :: replaces, and could not expand the address back to 128 bits. So :: goes on the longest run of zeros.
| Rule | Example |
|---|---|
| Leading zeros are dropped | 0DB8 → DB8, 0000 → 0 |
A run of zero groups → :: | 0:0:0 → :: |
:: only once | 2001:DB8::A1::B07 is wrong |
Check yourself
5 questions · answers are shown instantly · 3 correct answers complete the lesson
1How many bits is an IPv6 address?
2Which protocol does the job of IPv4's ARP in IPv6?
3Which IPv6 header field corresponds to IPv4's TTL?
4What is the correct short form of 2001:0DB8:0000:00A1:0000:0000:0000:0B07?
5Why can :: be used only once?
Comments
Sign in to comment.