IPv6 Fundamentals
Format and address types
An IPv6 address is 128 bits written as eight 16-bit hexadecimal groups. Compression rules: drop leading zeros inside a group, and replace exactly one contiguous run of all-zero groups with :: (used only once). Prefixes are written in CIDR form, typically /64 for a LAN. Know the families: global unicast 2000::/3, link-local fe80::/10 (auto-generated on every interface), unique local fc00::/7 (in practice fd00::/8), multicast ff00::/8, loopback ::1, unspecified ::. There is no broadcast address; multicast replaces it, and every node also joins the solicited-node multicast ff02::1:ff00:0/104 for its own address.
Neighbour Discovery and address configuration
ND replaces ARP, ICMPv6, and router discovery. Router Solicitation and Router Advertisement discover the prefix and default gateway; Neighbour Solicitation/Advertisement do address resolution and duplicate address detection; Redirect informs of a better next hop. SLAAC builds the interface ID from the MAC using EUI-64: split the MAC, insert FFFE in the middle, and flip the seventh bit (the universal/local bit). DHCPv6 uses UDP 546 (client) and 547 (server); the RA's M flag tells hosts to use DHCPv6 for addresses, the O flag for other parameters only.
ICMPv6 and dynamic routing
Stateless versus stateful is a favourite distinction: SLAAC is stateless, DHCPv6 stateful. IPv6 dynamic routing (OSPFv3) runs on link-local next hops and needs no global address to form adjacencies.
Worked example
Condense 2001:0db8:0000:0000:0000:0000:0000:0001. Remove leading zeros → 2001:db8:0:0:0:0:0:1; collapse the single zero run → 2001:db8::1. MAC 00:1A:2B:3C:4D:5E under EUI-64 becomes 021A:2BFF:FE3C:4D5E (the 0x00 first byte becomes 0x02).