IPv6 addresses are 128 bits long as opposed to the 32 bits used by the current IPv4 addresses. The main benefit of this is that it provides LOTS more addresses.
Some common prefixes:
An IPv6 address prefix is represented by the notation ipv6-address/prefix-length where
ipv6-address is an IPv6 address in any of the notations listed above prefix-length is a decimal value specifying how many of the leftmost contiguous bits of the address comprise the prefix.
There are several different types of IPv6 address defined by the standads. The type is specified by the leading bits of an address, this field is variable-length and is called the FormatPrefix (FP). Refer to RFC2373 for the currently defined FP's some of the more common ones are.
001 - Aggregatable Global Unicast Addresses (1/8 of the address space) 1111 1110 10 - Link-Local Unicast Addresses (1/2024 of the address space) 1111 1110 11 - Site-Local Unicast Addresses (1/2024 of the address space) 1111 1111 - Multicast Addresses (1/256 of the address space)
This is probably going to be the most widely used of the IPv6 address formats and is what is currently being allocated by the RIRs and is in use on the 6Bone. The format of a Aggregatable Global Unicast Addresses (AGUA) address looks like this.
| 3| 13 | 8 | 24 | 16 | 64 bits |
- --+-----+---+--------+--------+--------------------------------+
|FP| TLA |RES| NLA | SLA | Interface ID | | | ID | | ID | ID | |
- --+-----+---+--------+--------+--------------------------------+
Where
FP Format Prefix (001) TLA ID Top-Level Aggregation Identifier RES Reserved for future use NLA ID Next-Level Aggregation Identifier SLA ID Site-Level Aggregation Identifier INTERFACE ID Interface Identifier
An important concept to grasp is that these fields in the address are used only for allocation, they are not directly used for routing. Routing of IPv6 addresses is based on prefix length, although sometimes the prefix length will be based on one of the fields above this does not always need to be the case. To explain how each field is used imagine an IPv6 internet which consists of a tight mesh of directly connected backbone nodes in the centre, moving out from this you reach transit nodes which have a connection to a subset of the backbone nodes (usually between 1 - 4) each of these transit nodes is then connected to a number of edge nodes. This structure is almost identical to the structure of the 6Bone and possibly today's IPv4 internet.
Both the NLA ID and SLA ID fields can be nested multiple times.
Link-Local addresses are designed to be used for addressing on a single link for purposes such as auto-address configuration, neighbor discovery, or when no routers are present. Their format is as follows. Routers must not forward packets with link-local addresses to other links.
| 10 | | bits | 54 bits | 64 bits |
- ----------+-------------------------+----------------------------+
|1111111010| 0 | interface ID |
- ----------+-------------------------+----------------------------+
In hex, this would be fe80:0:0:0:0:0:0:(ID), or fe80::(ID) if collapsing zeroes.
eth0 Link encap:Ethernet HWaddr 00:E0:4C:39:43:BB
inet addr:10.21.1.2 Bcast:10.21.1.255 Mask:255.255.255.0 inet6 addr: fe80::2e0:4cff:fe39:43bb/64 Scope:Link
Anyone know where the extra bits (02, ff:fe) in the interface ID came from (they aren't in the MAC address)?
The 2 in 02 is from the universally unique bit being flipped in IPv6 addresses so you can easily type addresses like fe80::1 (the 2 bit is clear meaning that this is a non universally unique suffix)
ff:fe is inserted and means "Ethernet MAC" I think.
Site-Local addresses are designed to be used for addressing inside of a site without the need for a global prefix. Routers must not forward any packets with site-local source or destination addresses outside of the site. These addresses are analogous to the RFC:1918 IPv4 addresses in use by many organisations today.
| 10 | | bits | 38 bits | 16 bits | 64 bits |
- ----------+-------------+-----------+----------------------------+
|1111111011| 0 | subnet ID | interface ID |
- ----------+-------------+-----------+----------------------------+
In hex, this is fec0:0:0:0:0:(ID) or fec0::(ID).
Site local addresses are currently deprecated and are likely to be replaced by some other similar mechanism which isn't so prone to address usage collisions.
| 8 | 4 | 4 | 112 bits |
|11111111|flgs|scop| group ID |
The flgs field contains information about whether the group id is a well defined group (Assigned by IANA) or a temporary group. The scop field contains information about the scope of the address, it can be used to define groups of machines such as
Anycast addresses have the same format at AGUA addresses and are used to send a packet to only one of a group of machines. This group might be spread around the internet. IT can be used to route a packet to the closest of a server. (eg: the nearest nameserver).
Just like IPv4 has special addresses for thinks like loopback, network and broadcast so does IPv6.
::1
::
There is no broadcast addresses as these have been replaced by multicast ones.
RFC:2471 - IPv6 Testing Address Allocation
RFC:2373 - IP Version 6 Addressing Architecture
RFC:2374 - An IPv6 Aggregatable Global Unicast Address Format
6 pages link to IPv6Addressing: