Reading only the leading bits of an IPv6 address, how do you tell loopback, link-local, unique local and global unicast apart?
answer
- the high-order bits decide
- fe80 through febf
- fc or fd at the front
- first hex digit 2 or 3
- ::1 never leaves the node
basics
~20 sThe high-order bits identify the type: ::1 is loopback, fe80::/10 (fe80 to febf) is link-local, fc00::/7 (fc or fd, in practice fd00::/8) is unique local, and 2000::/3 (first digit 2 or 3) is where global unicast is allocated today.
solid answer
~40 sRFC 4291 says the type of an IPv6 address is identified by its high-order bits, so you read the prefix. `::1/128` is loopback and never leaves the node; `::/128` is the unspecified address. `fe80::/10` is **link-local**: every interface has one, and routers must not forward packets carrying it to another link. `fc00::/7` is **unique local** (RFC 4193): only `fd00::/8`, the half with the L bit set, is defined, and it routes inside a site but not on the internet. Global unicast is currently allocated from `2000::/3`, so it starts with 2 or 3. Two traps: `ff00::/8` is multicast, not a unicast scope, and `fec0::/10` was the old site-local block, deprecated by RFC 3879. A host usually holds several of these at once on one interface.
go deeper
Recognise the openers on sight: ::1 loopback, fe80 link-local, fd unique local, 2 or 3 global. Know that every interface has a link-local address.
Derive the ranges from the bits: why fe80::/10 runs to febf and why fc00::/7 means fc or fd. Explain what each scope allows a router to forward.
Spot the traps in real data: deprecated fec0 site-local, documentation 2001:db8, IPv4-mapped forms, and that one interface carries several scopes at once.
Decide where unique local addressing earns its place next to global addresses, given RFC 4193's site-limited routability and the cost of running two address plans.
## The rule: the prefix is the type RFC 4291 (the IPv6 addressing architecture) states that the type of an IPv6 address is identified by its **high-order bits**. There is no separate class field and no mask to consult: read the first hex digits, convert to binary when the boundary falls inside a digit, and you know what kind of address it is and how far it may travel. Each hex digit is 4 bits, which makes most boundaries easy to read by eye. ## The blocks to know | Block | Binary prefix | First hex digits | Meaning | |---|---|---|---| | `::/128` | all 128 bits zero | `::` | **Unspecified**: no address yet; never assigned, never a destination | | `::1/128` | 127 zeros then 1 | `::1` | **Loopback**: the node itself | | `fe80::/10` | `1111111010` | `fe80` to `febf` | **Link-local unicast** | | `fc00::/7` | `1111110` | `fc`, `fd` | **Unique local** (RFC 4193); `fd00::/8` is the defined half | | `2000::/3` | `001` | `2`, `3` | **Global unicast** as currently allocated | | `ff00::/8` | `11111111` | `ff` | Multicast (not a unicast scope) | | `::ffff:0:0/96` | 80 zeros, 16 ones | `::ffff:` | **IPv4-mapped**: an IPv4 address shown as IPv6 | | `2001:db8::/32` | 32 fixed bits | `2001:db8` | **Documentation** only (RFC 3849) | How the ranges come out of the bits: - `fe80::/10` fixes the first 10 bits as `1111111010`. The first byte is `fe`; the next two bits are `10`, so the second byte runs from `1000 0000` to `1011 1111`, which is `80` to `bf`. Any address from `fe80:` to `febf:` is link-local. In practice RFC 4291 sets the next 54 bits to zero, so link-local addresses look like `fe80::` plus a 64-bit interface ID. - `fc00::/7` fixes `1111110`; the eighth bit is the **L bit**. With L = 0 the address starts `fc`, with L = 1 it starts `fd`. RFC 4193 defines only L = 1 (locally assigned), so real unique local addresses start `fd`. - `2000::/3` fixes `001`, so the first hex digit is `2` (`0010`) or `3` (`0011`). ## What each scope means for forwarding 1. **Loopback** `::1` may only be used inside the node. RFC 4291 says a packet destined to it must never be sent outside the node or forwarded by a router, and a packet arriving on an interface with that destination must be dropped. RFC 4291 treats it as having link-local scope. 2. **Link-local** addresses are valid on one link only. RFC 4291 says routers must not forward packets with a link-local source or destination to other links. Every interface is required to have one, and Neighbor Discovery uses them; routers, for example, must send Router Advertisements from their link-local address. Because every interface has a `fe80::/64`, a link-local address alone does not say which interface to use; host software appends a zone index after `%`, as in `fe80::1%2`. 3. **Unique local** addresses (ULA) are routed inside a site like any unicast address. RFC 4193 calls their scope global, because the random Global ID makes them very probably unique, but their **routability** is limited: site border routers should not forward them out, and exterior routing should filter `fc00::/7` by default. 4. **Global unicast** addresses are reachable across the internet when routing and filtering allow. A detail worth knowing: RFC 4291 itself defines global unicast as "everything else" not listed in its type table; `2000::/3` is the block the IANA registry allocates from today, not a rule written into the architecture. ## Traps when reading prefixes - **Site-local** `fec0::/10` (`fec0` to `feff`) sits right next to link-local. RFC 3879 deprecated it in 2004 because addresses like `fec0::1` were ambiguous between sites. RFC 4291 says new implementations must treat it as global unicast. - **Multicast** `ff00::/8` is a delivery type, not a unicast scope; reading it is enough here. - An address in `2001:db8::/32` looks global but is reserved for documentation and is never routed. - **Several at once is normal.** One interface typically carries a link-local address, one or more global addresses and possibly a ULA. Asking "what is the host's IPv6 address" usually needs the follow-up "which scope?". ## A quick reading drill Classify by the first digits: - `fe80::a00:ff:fe00:1`: starts `fe80`, link-local. - `fd3a:9b1e:42c0:1::25`: starts `fd`, unique local, locally assigned. - `2001:db8:4:1::10`: first digit 2, global-unicast space, but the documentation prefix. - `febf::1`: still link-local, since `bf` is the top of the `80` to `bf` range. - `fec0::1`: deprecated site-local; new implementations must treat it as global unicast, though old networks may still number internal hosts from it. - `::ffff:192.0.2.7`: an IPv4 address in IPv4-mapped form.
- Why does an IPv6 interface keep a link-local address even after it receives a global address?RFC 4291 requires every interface to have a link-local address, and on-link protocols depend on it: Neighbor Discovery runs over it and routers must source their Router Advertisements from it, so hosts know their default router by its link-local address. Global addresses are added alongside it; they never replace it.
- Is an address in fd00::/8 reachable from the internet?Not by design. RFC 4193 makes unique local addresses routable inside a site and asks site border routers and firewalls not to forward packets with `fc00::/7` sources or destinations outside it, and exterior routing to filter the block by default. Reaching one from outside needs explicit routing agreements, not a default route.
- How is fec0::/10 different from fc00::/7?`fec0::/10` was site-local: one shared prefix that every site reused, so `fec0::1` meant something different everywhere. RFC 3879 deprecated it, and RFC 4291 says new implementations treat it as global unicast. `fc00::/7` (RFC 4193) replaced it with a per-site pseudo-random 40-bit Global ID, so prefixes are very probably unique.
saying these in an interview costs you the question
- Any address starting with fe is link-local.
- Unique local addresses cannot cross a router, just like link-local ones.
- fec0::/10 is the current private range in IPv6.
- A host has exactly one IPv6 address per interface.
- Link-local addresses appear only when no router or DHCPv6 server answers.