IPv6 is almost exactly the same as IP version 4.
The main changes in IP version 6 are simplification of the packet header, provision for the possibility of extension headers, and most significantly, expansion of the address to 128 bits long.
In this tutorial, we'll examine how IPv6 addresses are allocated; in other words, which bits of the 128-bit address are used for what and by whom.
First, a few definitions:
• IPv6 addresses identify interfaces. An interface is typically an integrated circuit on a device implementing the physical connection to a wired or wireless LAN.
• Each interface has a 48-bit number called its Media Access Control or MAC address permanently assigned by the manufacturer.
• A broadcast domain is a set of machines that can communicate directly with each other over a wired or wireless LAN. All of the devices plugged into a regular LAN switch would be in the same broadcast domain. In more sophisticated implementations, the members of a broadcast domain can be defined in software using VLAN technology (but that's a whole other lesson...).
• A subnet is a contiguous block of IP addresses. This means that in the diagram below, the subnet would occupy an uninterrupted block of bits that includes the rightmost bit, the least significant bit.
and some technical background:
Typically, subnets are assigned to broadcast domains. In other words, all of the machines in a given broadcast domain will be assigned IP addresses from a unique subnet. This allows machines to determine if they can send a packet directly to a desired destination machine, or if they have to send the packet to a router to be forwarded to reach the destination (that's another lesson...).
The notation /n is used to mean the first n bits in the address. This would also tell us the size of a subnet.
and some bureaucracy:
Blocks of IP addresses are handed out by the Internet Assigned Numbers Authority (IANA). They do not hand out blocks of addresses to users, but rather to one of seven Regional Internet Registries (RIRs), who are responsible for parceling out blocks of addresses in specific geographical areas of the word.
The RIR for North America is ARIN, the American Registry for Internet Numbers.
The RIRs do not hand out blocks of addresses to anyone who asks; they have a minimum size of block of addresses they will hand out, and require that applicants prove that they need at least that number of addresses. Such applicants are sometimes called Local Internet Registries and would typically be Internet Service Providers (ISPs). Applicants who need a smaller number of addresses must get them from an ISP.
and finally we can discuss how the 128-bit address space is partitioned and who gets what:
The first 12 bits of the IPv6 address identifies the Regional Internet Registry.
In North America, ARIN's policy is that the next 20 bits of the address identifies a block allocated to a Local Internet Registry, most of the time a big ISP. This means that the first 32 bits of the IPv6 address typically identifies an ISP.
The next 16 bits identifies a physical site. This means that most of the time, the first 48 bits of the IPv6 address will identify a site, typically an ISP's data center, though it might be a university campus or large organization's building.
The first 48 bits of the address is called the Global Routing Prefix, identifying a site.
The last 64 bits of the address is called the Interface ID, and could be the updated version of a MAC address called EUI-64, or a random number for privacy reasons. It identifies the integrated circuit running a LAN connection – wired or wireless – on a device. For consumer equipment with one LAN connection like a PC or smartphone, it effectively identifies the device.
Between the 48-bit Global Routing Prefix, which essentially identifies buildings or campuses, and the 64-bit Interface ID, which essentially identifies machines' LAN connections is 16 bits called the Subnet ID. The Subnet ID is used to assign one or more subnets, that is, one or more /64 blocks of IPv6 addresses to end-users. The first 64 bits of the address are called the Subnet Prefix.
Residential users generally do not have multiple broadcast domains, and so would be assigned one /64 subnet. In this case, all IP addresses at the residence (the end-site) would have the same first 64 bits, and the last 64 bits would be IDs of interfaces at the residence.
That's 2 to the 64th power or 18 billion billion IPv6 addresses per residence. Every light switch, light bulb, every electrical socket, your doorbell, your fridge, each slot in your toaster … everything will have an IP address in the future.
Large government and corporate end-sites would normally have more devices and multiple broadcast domains, compartmentalizing devices for both performance and network security reasons. These entities would be assigned multiple subnets.
For example, a college could be assigned a /56 block from an ISP's site. In this case, the college's IT department would have the lower 8 bits of the subnet field to identify up to 256 subnets at their end-site, and assign one subnet to each of their broadcast domains. The first 64 bits of the IP address would be the same for all devices in a particular broadcast domain, and the last 64 bits identify the device. The ISP could service up to 256 of this kind of customer from one /48 site block at the ISP's data center.
Customers of an ISP in this category also include… smaller ISPs. For this type of customer, a /48 block would allow the downstream ISP to resell /64 block residential and /56 block corporate / government scenarios.
For this tutorial, we've had to introduce quite a number of supporting concepts like LAN, LAN interface, broadcast domain, MAC address, subnets and ISPs to be able to explain IPv6 address allocation.
Trying to master all of this in one short tutorial can be difficult.
If you would like to take this more slowly, and build up the knowledge layers properly, consider taking these courses:
• Instructor-led Course 101: Telecom, Datacom and Networking for Non-Engineers (our most popular course, also part of the very popular BOOT CAMPs)
• Online Courses 2211 Ethernet, LANs and VLANs and 2213 IP Networks, Routers and Addresses (get them individually or together in packages including the Certified Telecommunications Network Specialist Certification Package)