IPv6, and four ways to address a message

8 min 5 sections 5 practice questions 17 sources citedISC2 objective 4.1

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

IPv6 address kinds, with the nearest IPv4 equivalent
KindPrefixReachesNearest in IPv4
Loopback::1The device itself127.0.0.1
Link-localfe80::/10Only the local link; never routed169.254.0.0/16
Unique localfc00::/7, in practice fd00::/8Inside one organisation; not routed on the internetPrivate ranges such as 10.0.0.0/8
Global unicast2000::/3Anywhere on the internetA public address
Multicastff00::/8Every device that joined the group224.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.

IPv4 and IPv6 side by side
PointIPv4IPv6
Address length32 bits128 bits
Written asFour decimal numbers with dotsEight hexadecimal groups with colons
Finding a neighbour's hardware addressARPNeighbor Discovery
Getting an addressDHCP or set by handSLAAC, DHCP for IPv6 or set by hand
Hop counterTime to liveHop limit
Who may fragmentSender and routersSender only
BroadcastYesNone: 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.

The four delivery types, with a security point for each
TypeDelivered toEveryday comparisonSecurity point
UnicastOne interfaceA letter to one houseNormal traffic; filtered by its single address
BroadcastEvery device on the local network. IPv4 onlyA tannoy announcement in one buildingAbused to multiply a flood, so routers block broadcasts sent from other networks
MulticastEvery device that joined a groupA mailing listAny member receives everything, so sensitive streams need
AnycastThe nearest of several devices that share one addressA national helpline answered at the nearest centreSpreads 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.

  1. 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.
  2. It starts fe80, so it is link-local. It came from the local link and no router forwarded it.
  3. 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.
  4. 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.
  5. 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?

  1. Extend the firewall policy and monitoring to IPv6 and block unwanted tunnels
  2. Replace all IPv4 addresses with IPv6 addresses across the whole network
  3. Move every internal device onto unique local IPv6 addresses behind NAT
  4. Disable IPv6 on the one laptop named in the penetration test report
Decide on your answer, then open the reasoning
  1. The finding is a path that the security controls do not see: IPv6, including tunnelled IPv6, passes the firewall unchecked.
  2. Rule out b: moving everything to IPv6 is a large project and does not by itself put any rule on the traffic.
  3. Rule out c: unique local addresses and NAT are about addressing. They do not stop a Teredo tunnel that the laptop starts itself.
  4. Between a and d: disabling IPv6 on one laptop removes the symptom found by the tester, and every other device keeps the same path.
  5. 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

A name service gives the same address to servers in 30 cities. Routing sends each user's query to the nearest of them.

Which kind of delivery is this?

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

  1. 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.

    Read this part again

  2. 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.

    Read this part again

  3. 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.

    Read this part again

  4. 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.

    Read this part again

  5. 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.

    Read this part again

Sources