Connectivity and Protocols

IPv6 and Addressing for Billions of Devices

Why address space matters when every sensor wants a network identity: how IPv4 runs short, what IPv6 changes, and how small devices cope with it.

On this page
  1. What an address is for
  2. The limit of IPv4
  3. What IPv6 changes
  4. Fitting IPv6 onto tiny devices
  5. Common misunderstandings
  6. Living with both
  7. Practical points

What an address is for

For one device to send data to another across a network, each needs an address, a number that says where to deliver the packets. The Internet Protocol defines these addresses. A device with a public address can in principle be reached from anywhere, and a device with only a local address is reachable inside its own network.

When the number of connected things was small, addresses were not a concern. As every thermostat, meter, light and sensor joins a network, the supply of addresses becomes a real design issue.

The limit of IPv4

IPv4 addresses are 32 bits long. That allows 2 to the power of 32 combinations, which is about 4.3 billion. That sounded like plenty when the scheme was designed, but it has been exhausted in practice for years: regional registries have run low on new blocks, and many networks now work around the shortage.

The usual workaround is network address translation, or NAT. A home router, for instance, has one public address and gives every device inside a private address. Outgoing traffic is rewritten to use the public address, and replies are mapped back. This works well for ordinary browsing, where devices initiate connections. It is less friendly to devices that need to be reached from outside, and it adds state that the router must keep track of. Large deployments sometimes stack several layers of translation, which makes direct connections even harder.

What IPv6 changes

IPv6 uses 128-bit addresses. The number of combinations is 2 to the power of 128, roughly 3.4 followed by 38 zeros. That is not simply “more”: it is large enough that giving every device its own globally unique address is no longer a concern.

Addresses are written in hexadecimal, in groups separated by colons, with long runs of zeros shortened. They look unfamiliar, but the structure is regular. Typically a site receives a large block and the lower part of each address identifies the individual device.

Beyond size, IPv6 includes features that suit device networks:

  • Self-configuration. A device can build its own address from the network prefix announced by a router, without a central server handing out each one.
  • Multiple addresses. A device can hold a local address for neighbors and a separate global one.
  • Multicast. One message can reach a group of devices, such as all lights in a room, efficiently.
  • No need for NAT. Devices can in principle be reached directly, which simplifies some designs.

Fitting IPv6 onto tiny devices

IPv6 requires links to carry packets of at least 1280 bytes, and its headers are larger than IPv4’s. Some low-power radios send frames of only about 127 bytes. A technique called 6LoWPAN solves this by compressing headers and splitting larger packets across several frames, so that even small microcontrollers on constrained radio links can be full participants in an IP network. This allows a sensor to be addressed directly from elsewhere on the network without a translator, instead of relying on a vendor-specific local protocol and a gateway that converts it.

Not every low-power technology uses this. Some long-range radios carry only small payloads, and the IP address is assigned to the gateway or the server, not to each sensor. The question is then whether the sensor needs an identity on the network at all, or only a unique identifier within one application.

Common misunderstandings

“A public address means the device is exposed.” A public address makes a device reachable in principle. Whether traffic is allowed depends on firewall rules. Many home routers block unsolicited incoming connections by default, which is a sound baseline. NAT incidentally provided that effect with IPv4, but it was never a security feature; a firewall is. Devices should still be hardened, with no default passwords and regular firmware updates.

“Bigger addresses mean automatic privacy.” A stable address that follows a device could be used to track it. IPv6 includes temporary addresses that change over time, mainly for phones and computers. For fixed sensors the concern is different, but it is worth knowing that an address can be an identifier.

“IPv6 makes everything faster.” Not by itself. It removes some translation overhead, but speed depends mostly on the underlying links.

Living with both

The transition is gradual. Many networks run both IPv4 and IPv6 together, called dual stack, and some translate between them at the edge. A device that supports only IPv4 may fail to work on an IPv6-only network, and the reverse is also possible. For a product that will be deployed widely, supporting IPv6 is a sensible long-term choice, though real-world support still differs between networks, routers and providers.

Practical points

  • Check whether a product supports IPv6 and whether it works properly on a network that offers both.
  • Keep firewall defaults strict, and allow only the connections a device needs. Placing devices on a separate segment of the home or office network limits harm if one is compromised.
  • Do not rely on the obscurity of a large address space. Scanning tools are efficient, and attackers can learn addresses from other sources.
  • For fleets, plan how addresses are assigned and recorded. Even with abundant addresses, you need to know which belongs to which device.

Address space solves a scarcity problem, but it does not decide how devices are discovered, authenticated or managed. Those depend on the layers above, which is why addressing is one part of the larger picture of how devices connect.

The complete guide to connectivity and protocols

How Connected Devices Talk: A Guide to IoT Communication Layers
Read the guide

Keep exploring

Guides from other topics

All topics →