A name service gives the same address to servers in 30 cities. Routing sends each user's query to the nearest of them.
IPv6, and four ways to address a message
IPv4 has about 4.3 billion addresses, far fewer than the devices that now want one. Internet Protocol version 6 (IPv6) replaces it with addresses so long that every device can have its own. It also changes how devices find each other and set themselves up. No background is assumed beyond IPv4. Most networks now run both versions side by side, and an IPv6 path that nobody manages is a way round controls built for IPv4.
By the end of this unit you will be able to:
- Read an IPv6 address and shorten it correctly with the two compression rules
- Name the IPv6 address kinds by prefix: loopback, link-local, unique local, global unicast and multicast
- Explain what IPv6 changes from IPv4: autoconfiguration, Neighbor Discovery, hop limit, fragmentation and IPsec
- Tell apart unicast, broadcast, multicast and anycast, with a security use of each
- Explain how dual stack, tunnels and translation let unmanaged IPv6 bypass IPv4 controls
The firewall rule that only covered half the traffic
An illustrative example
A college blocks a file-sharing website at its firewall by listing the site's addresses. A month later the network team finds students still reaching the site from college laptops, with no warning and no record in the firewall's log.
The laptops and the site both support two versions of the internet's addressing. The block named only the older kind of address. The laptops simply used the newer kind, and the firewall had been set up to pass that traffic without checking it.
What should the college have checked before trusting that one block would stop the traffic?
An IPv6 address is 128 bits, written in eight groups
An is 32 bits long, which allows about 4.3 billion addresses. An Internet Protocol version 6 (IPv6) address is 128 bits long, which allows about 340 undecillion: a number with 39 digits. Private ranges and address translation were invented to stretch IPv4. makes them unnecessary.
IPv6 addresses are written in hexadecimal, which counts with the digits 0 to 9 and the letters a to f. Each hexadecimal digit stands for 4 bits. An address is eight groups of four digits, separated by colons: 2001:0db8:0000:0000:0000:0000:0000:0001.
Two rules shorten it. First, leading zeros in any group may be dropped, so 0db8 becomes db8 and 0001 becomes 1. Second, one run of groups that are all zero may be replaced by a double colon, ::. The address above becomes 2001:db8::1.
The double colon may appear only once in an address. Used twice, nobody could tell how many zero groups each one stood for.
The first part of an address names the network and is called the prefix, written with a slash as in IPv4: 2001:db8:5:7::/64. On an ordinary network the last 64 bits name the device. That part is the interface identifier. Older systems built it from the hardware address, with ff:fe placed in the middle. This is the EUI-64 format, and it reveals the hardware address to every site visited. The address made of all zeros, ::, is the unspecified address, used by a device that has no address yet.
Five kinds of IPv6 address, told apart by their first digits
| Kind | Prefix | Reaches | Nearest in IPv4 |
|---|---|---|---|
| Loopback | ::1 | The device itself | 127.0.0.1 |
| Link-local | fe80::/10 | Only the local link; never routed | 169.254.0.0/16 |
| Unique local | fc00::/7, in practice fd00::/8 | Inside one organisation; not routed on the internet | Private ranges such as 10.0.0.0/8 |
| Global unicast | 2000::/3 | Anywhere on the internet | A public address |
| Multicast | ff00::/8 | Every device that joined the group | 224.0.0.0 to 239.255.255.255 |
Every IPv6 interface gives itself a link-local address as soon as it starts, whether anyone planned IPv6 or not. A device usually holds several addresses at once: a link-local one and one or more global or unique local ones.
Common misconception
“Unique local addresses are the IPv6 version of private addresses behind NAT, so they hide devices.”
They are for traffic inside a site and are not routed on the internet. IPv6 is designed for each device to hold its own global address, so protection comes from a firewall, not from translation.
What IPv6 changes: setup, neighbours, hops and fragments
- Stateless address autoconfiguration (SLAAC)
- A device builds its own address. A router announces the network's prefix, and the device adds its interface identifier. No server hands out addresses, though DHCP for IPv6 can still be used where records are wanted.
- Neighbor Discovery
- A set of for IPv6 messages that replaces , router discovery and redirects. Router solicitations and advertisements find routers. Neighbour solicitations and advertisements find hardware addresses.
- Hop limit
- The IPv6 name for the time to live. Each router lowers it by one and discards the at zero.
- Fragmentation
- Only the sending device may split a packet. Routers never fragment. Every link must carry at least 1,280 bytes.
- IPsec
- Once required in every IPv6 device, now recommended. IPv4 can use it equally.
Two of these carry old weaknesses forward. Neighbor Discovery trusts whatever answers, just as ARP does, so a device on the link can pose as the router with a forged router advertisement. Switches block forged ones with RA Guard, which drops router advertisements arriving on ports where no router sits.
raised a problem. An interface identifier that never changes lets websites follow one laptop from network to network. Modern systems use temporary addresses with identifiers that change over time.
| Point | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Written as | Four decimal numbers with dots | Eight hexadecimal groups with colons |
| Finding a neighbour's hardware address | ARP | Neighbor Discovery |
| Getting an address | DHCP or set by hand | SLAAC, DHCP for IPv6 or set by hand |
| Hop counter | Time to live | Hop limit |
| Who may fragment | Sender and routers | Sender only |
| Broadcast | Yes | None: multicast does the job |
Unicast, broadcast, multicast and anycast
An address can name one device or several. There are four ways to deliver a message, and each has a security side.
| Type | Delivered to | Everyday comparison | Security point |
|---|---|---|---|
| Unicast | One interface | A letter to one house | Normal traffic; filtered by its single address |
| Broadcast | Every device on the local network. IPv4 only | A tannoy announcement in one building | Abused to multiply a flood, so routers block broadcasts sent from other networks |
| Multicast | Every device that joined a group | A mailing list | Any member receives everything, so sensitive streams need |
| Anycast | The nearest of several devices that share one address | A national helpline answered at the nearest centre | Spreads a denial-of-service flood across many sites |
Broadcast is how ARP and DHCP reach everyone on a subnet. A directed broadcast is one sent from another network to every device on a target subnet. Attackers used it to make whole networks answer a forged sender at once, so routers now refuse it by default.
Multicast sends one stream to many listeners, such as a video feed or routing updates between routers. Devices join groups with in IPv4. Anycast gives the same address to servers in many places, and routing sends each user to the nearest. The internet's root name servers use it, and a flood aimed at them is absorbed region by region.
Common misconception
“Anycast, like multicast, delivers one message to several devices.”
Anycast delivers each message to exactly one device, the nearest that holds the address. Multicast copies it to every member of a group.
Running both versions, and the controls IPv6 can bypass
IPv4 and IPv6 cannot talk to each other directly. Three families of method let them coexist.
- Dual stack
- A device runs both versions at once and uses IPv6 where the other end supports it. The most common approach.
- Tunnelling
- IPv6 packets travel inside IPv4 packets across a network that has only IPv4. 6to4 and similar tunnels mark the IPv4 packet with protocol number 41. Teredo wraps IPv6 inside on port 3544 so it can cross .
- Translation
- A gateway rewrites packets between the versions. NAT64 lets an IPv6-only device reach an IPv4-only server.
Each method can open a path that IPv4 controls never see. A with careful IPv4 rules may pass IPv6 unchecked. A tunnel can carry IPv6 straight through an IPv4 firewall, which sees only an outer IPv4 packet. Teredo was built to pass through NAT, so it can expose an inside device to the internet.
The fixes follow from the cause. Apply the same to IPv6 as to IPv4, on firewalls and on monitoring. Block tunnel traffic that is not wanted: protocol 41 and UDP port 3544. Disable IPv6 features that are not used on each device, rather than assuming they are off.
Worked example: Shortening an IPv6 address and naming its kind
A firewall log shows three addresses in full: fe80:0000:0000:0000:0a1b:00ff:fe00:0025, 2001:0db8:0005:0000:0000:0000:0000:0020 and 0000:0000:0000:0000:0000:0000:0000:0001.
- First address: drop leading zeros to get fe80:0:0:0:a1b:ff:fe00:25. Replace the run of three zero groups with :: to get fe80::a1b:ff:fe00:25.
- It starts fe80, so it is link-local. It came from the local link and no router forwarded it.
- Second address: drop leading zeros to get 2001:db8:5:0:0:0:0:20, then compress the four zero groups: 2001:db8:5::20.
- It starts 2, inside 2000::/3, so it has the form of a global unicast address, one that can be reached across the internet. The range 2001:db8::/32 is set aside for examples in documents and is never routed, so this one is an example. A real global address has the same form.
- Third address: seven zero groups and a final 1 become ::1, the loopback. That traffic never left the device.
Read the first digits before anything else. fe80 is local to the link, fc or fd is internal to the site, and 2 or 3 is global. ff is multicast, and ::1 is the device itself.
A question, worked through
A hospital's network was designed for IPv4 only. Its firewall has strict IPv4 rules and no IPv6 rules at all, and passes IPv6 unchecked. A penetration tester reports that a laptop reached an outside server over IPv6 through a Teredo tunnel. The security manager must choose the first response.
What should the security manager do FIRST?
Decide on your answer, then open the reasoning
- The finding is a path that the security controls do not see: IPv6, including tunnelled IPv6, passes the firewall unchecked.
- Rule out b: moving everything to IPv6 is a large project and does not by itself put any rule on the traffic.
- Rule out c: unique local addresses and NAT are about addressing. They do not stop a Teredo tunnel that the laptop starts itself.
- Between a and d: disabling IPv6 on one laptop removes the symptom found by the tester, and every other device keeps the same path.
- Applying the same policy to IPv6 and blocking unwanted tunnels, such as UDP port 3544, closes the gap for every device. The answer is a.
Answer: A. Extend the firewall policy and monitoring to IPv6 and block unwanted tunnels
Choosing between good answers
- A question asks how IPv6 finds a neighbour's hardware address
- choose Neighbor Discovery, not ARP, which IPv6 does not use.
- A question says IPv6 has broadcast
- reject it: IPv6 uses multicast for every job broadcast did in IPv4.
- A network is managed as IPv4-only
- assume IPv6 is present anyway, on by default and possibly tunnelled, and look for the controls it bypasses.
- A question pairs one shared address with the nearest server
- the answer is anycast. One address, every member of a group, is multicast.
- An option says IPsec is built into IPv6
- accept it as the long-taught position: IPsec support was mandatory in IPv6 until 2011 and is now recommended. Reject any option that says IPv4 cannot use IPsec.
Check your understanding
5 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 5
What to remember
- IPv6 addresses are 128 bits, written as eight hexadecimal groups; leading zeros may be dropped and one run of zero groups written as ::.
- Key prefixes: ::1 loopback, fe80::/10 link-local, fc00::/7 unique local, 2000::/3 global unicast and ff00::/8 multicast.
- IPv6 replaces ARP with Neighbor Discovery, lets devices configure themselves with SLAAC, calls the time to live the hop limit, and lets only the sender fragment.
- Unicast reaches one device, broadcast every device on the subnet, multicast every member of a group and anycast the nearest of several. IPv6 has no broadcast.
- Dual stack, tunnels such as 6to4 and Teredo, and translation such as NAT64 can each carry traffic past controls built only for IPv4.
Say it from memory
Compare IPv4 and IPv6 addresses, then define unicast, broadcast, multicast and anycast.
IPv4 uses 32-bit addresses in dotted decimal; IPv6 uses 128-bit addresses in eight hexadecimal groups, has no broadcast and replaces ARP with Neighbor Discovery. Unicast goes to one interface, broadcast to every device on the local network, multicast to every member of a group and anycast to the nearest of several devices sharing one address.
What two rules shorten an IPv6 address, and why may the double colon appear only once?
Leading zeros in any group may be dropped. One run of groups that are all zero may be replaced by a double colon, so 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. Used twice, nobody could tell how many zero groups each double colon stood for.
What do the IPv6 prefixes fe80::/10, fc00::/7 and 2000::/3 mark, and what is the loopback address?
fe80::/10 is link-local: only the local link, never routed. fc00::/7, in practice fd00::/8, is unique local: inside one organisation and not routed on the internet. 2000::/3 is global unicast, reachable anywhere on the internet. The loopback address is ::1.
What does Neighbor Discovery replace, which weakness does it carry from ARP, and what blocks forged router advertisements?
Neighbor Discovery is a set of ICMP for IPv6 messages that replaces ARP, router discovery and redirects. It trusts whatever answers, just as ARP does, so a device on the link can pose as the router with a forged router advertisement. RA Guard on switches drops router advertisements arriving on ports where no router sits.
What are the three ways to run IPv4 and IPv6 together, and which tunnel traffic should be blocked if unwanted?
Dual stack runs both versions on a device at once. Tunnelling carries IPv6 inside IPv4, and translation, such as NAT64, rewrites packets between the versions. Unwanted tunnels are blocked by blocking protocol 41, used by 6to4, and UDP port 3544, used by Teredo.
Sources
- RFC 4291: IP Version 6 Addressing Architecture, IETFIPv6 addresses are 128 bits; :: as the unspecified address; interface identifiers built from a hardware address in modified EUI-64 form with FFFE inserted; the preferred text form and the :: compression, which may appear once; leading zeros may be dropped; ::1 loopback; fe80::/10 link-local; ff00::/8 multicast; 64-bit interface identifiers; unicast, anycast and multicast, and no broadcast.
- RFC 4193: Unique Local IPv6 Unicast Addresses, IETFUnique local unicast addresses use fc00::/7 and are not expected to be routable on the global internet.
- Internet Protocol Version 6 Address Space, IANA2000::/3 is designated global unicast.
- RFC 8200: Internet Protocol, Version 6 Specification, IETFThe hop limit is lowered by one by each forwarding node; fragmentation is done only by the source; every link must carry at least 1,280 octets.
- RFC 4862: IPv6 Stateless Address Autoconfiguration, IETFHosts generate a link-local address and build global addresses through stateless address autoconfiguration.
- Neighbor Discovery for IP version 6 (IPv6), IETFNeighbor Discovery replaces ARP, ICMP router discovery and ICMP redirect, with router solicitation, router advertisement, neighbour solicitation, neighbour advertisement and redirect messages.
- RFC 8504: IPv6 Node Requirements, IETFIPsec was once mandatory for IPv6 and is now a SHOULD for all IPv6 nodes; RFC 6434, published December 2011, made that change.
- RFC 8981: Temporary Address Extensions for Stateless Address Autoconfiguration in IPv6, IETFA stable interface identifier lets a host's activity be correlated, and temporary addresses with identifiers that vary over time address this.
- RFC 2644: Changing the Default for Directed Broadcasts in Routers, IETFRouters must by default block directed broadcasts, because outside attackers used them to turn networks into smurf amplifiers.
- RFC 4786: Operation of Anycast Services, IETFDNS root servers are distributed with anycast, and an anycast node absorbs attack traffic from its region.
- RFC 4213: Basic Transition Mechanisms for IPv6 Hosts and Routers, IETFDual stack hosts and routers implement both IPv4 and IPv6; IPv6 tunnelled in IPv4 uses protocol number 41.
- RFC 4380: Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs), IETFTeredo tunnels IPv6 over UDP through NAT on UDP port 3544.
- RFC 7526: Deprecating the Anycast Prefix for 6to4 Relay Routers, IETF6to4 is automatic tunnelling of IPv6 over IPv4 between IPv6 islands.
- RFC 6146: Stateful NAT64, IETFStateful NAT64 lets IPv6-only clients contact IPv4 servers.
- RFC 7123: Security Implications of IPv6 on IPv4 Networks, IETFIPv6 on networks managed as IPv4-only can bypass IPv4 controls; apply the same policy to IPv6, block protocol 41 and UDP port 3544, and use Router Advertisement Guard.
- RFC 6105: IPv6 Router Advertisement Guard, IETFRA Guard filters router advertisements in the switch, so that ports not set up for a router block them.
- RFC 3849: IPv6 Address Prefix Reserved for Documentation, Internet Engineering Task Force2001:db8::/32 is reserved for documentation and is to be treated as non-routable.