2011年9月13日 星期二

IPv6 IP addresses

IPv6 IP addresses


IPv6 IP addresses are 128 bits long, compared to IPv4's 32-bit addresses. This gives room for many, many, many, many more addresses.
The number of IPv4 IPs available is 232, or 4,294,967,296. For IPv6, however, the number is 2128, or 340,282,366,920,938,463,463,374,607,431,768,211,456. That's a lot of IPs!
Now that we know the number of IPv6 addresses there are, we can get to the anatomy of the IPv6 address

The anatomy of IPv6 addresses


IPv4 addresses are generally in quad-dot notation, e.g. 192.168.73.200. IPv6 addresses use colons instead of dots and are larger that IPv4 addresses.
A fully qualified IPv6 address takes the format of XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX. An example fully-qualified address is FE80:0000:0000:0000:903A:1C1A:E802:11E4.
Do you see the long string of zeros? With IPv6 addresses, you can compress zeros to shorten the IP address.
You can compress zeros like this: FE80:0:0:0:903A:1C1A:E802:11E4, or like this: FE80::903A:1C1A:E802:11E4. Take note that you can only compress one set of zeros to ::.
Like in this IP: FE80:0000:0000:0000:903A:0000:0000:11E4, there are 2 sets of zeros. You could write it like this: FE80::903A:0:0:11E4, or like this: FE80:0:0:0:903A::11E4, but not like this: FE80::903A::11E4.

IPv6 subnetting


Just knowing how an IP address looks won't help you much when working with IPv6, you also need to know subnetting. You probably know how subnetting works in IPv4, and to make IPv6 subnetting easier, you should understand CIDR.
IPv6 does away with netmasks like 255.255.255.0 and goes to complete classless subnetting.

The smallest subnet available is a /64, which contains 18.4 quintillion IP addresses.
The way a /64 IP address is broken up is the first 64 bits of the IP is the subnet prefix, and the last 64 bits is the interface ID.
The following tables show how the subnet divides the IP address.

Breakout for fully qualified IP

/64

Subnet prefix

Interface ID

0000

1111

2222

3333

4444

5555

6666

7777

 

Breakout for fully qualified IP

/48

Subnet prefix

Interface ID

0000

1111

2222

3333

4444

5555

6666

7777

 

Breakout for fully qualified IP

/32

Subnet

Interface ID

0000

1111

2222

3333

4444

5555

6666

7777

Private IPv6 addresses


With the number of IPv6 addresses available, you might think that private IPs are no longer needed. But IPv6 has a few private IP ranges that are not globally routable.

Link-local addresses


Link-local addresses are designed to only be used on a local physical link. They are like IPv4's 169.254.0.0/16 subnet.
In IPv6, the link-local address block is FE80::/10, this means that the subnet prefixes from FE80 to FEB0 are valid for link-local addressing
Link-local addresses are generated by either by converting the network interface's MAC address into a EUI-64 ID, or by generating a random ID.
An example link-local address with a random ID is FE80::903A:1C1A:E802:11E4. This one was generated by Windows 7 with default IPv6 settings.

Site-local addresses - DEPRECATED


Site-local addresses were designed to be used at a site, but they were deprecated in 2004 by RFC3879.
The site-local address block is/was FEC0::/10, spanning from FEC0 to FEF0

Private IP addresses


These addresses are for use in a private network, like IPv4's 10.0.0.0/8172.16.0.0/12, and 192.168.0.0/16 IP ranges.
The private IP subnet is FD00::/7 with the eighth bit set to 1, so it's effectively FD00::/8. The subnet ranges from FD00 to FDFF.

These addresses have a specific format that you should generally be followed. The format is listed below.

Using the example IP FDC8:BF8B:E62C:ABCD:1111:2222:3333:4444, the breakout is as follows.

Prefix

Global ID

Subnet ID

Interface ID

FD

C8BF8BE62C

ABCD

1111:2222:3333:4444


An example of simple IPv6 private addresses is our network.
We use the IPv4 subnet 192.168.4.0/23, so and example IP is 192.168.4.120.
For IPv6, we just use FD00::4:120. It's easy to remember because it's derived from the IPv4 address.

This is the breakout of the Private IP:

Prefix

Global ID

Subnet ID

Interface ID

FD

0000000000

0000

0000:0000:0004:0120


So obviously the address isn't unique, and the IPv6 task force probably doesn't endorse the use of IPs like this, but for easier IPv4-IPv6 private network conversion, I say it's OK.
It's not like the IP is going to used on the Internet anyway. :)

 

 

沒有留言:

張貼留言