Gangmax Blog

IPv6 basic concepts

Refer here and here.

  1. IPv6 addresses are 128 bits long;

  2. IPv6 chose a hexadecimal format with a colon as separator after each block of 16 bits(2 bytes). That means an IPv6 address is devided into 8 blocks and each block has 16 bits(2 bytes):

1
2
3
2^128-1: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
# A usable address:
2001:0db8:0100:f101:0210:a4ff:fee3:9566
  1. For simplifications, leading zeros of each 16 bit block can be omitted:
1
2
2001:0db8:0100:f101:0210:a4ff:fee3:9566  -> 
¬ 2001:db8:100:f101:210:a4ff:fee3:9566
  1. One sequence of 16 bit blocks containing only zeroes can be replaced with “::“. But not more than one at a time, otherwise it is no longer a unique representation.
1
2001:0db8:100:f101:0:0:0:1  ->  2001:db8:100:f101::1
  1. The biggest reduction is seen by the IPv6 localhost address:
1
0000:0000:0000:0000:0000:0000:0000:0001  ->  ::1
  1. The “Base85 coded” IPv6 presentation:
1
2
# ipv6calc --addr_to_base85 2001:0db8:0100:f101:0210:a4ff:fee3:9566 
9R}vSQZ1W=9A_Q74Lz&R
  1. Netmask and subnetting of IPv6:

The host bits in IPv6 take up at least the lower 64 bits (and maybe more), so the netmask is always <= 64 bits. The only exception is the loopback address ::1 which has a netmask of /128. For a LAN, usually just use /64 as the netmask. The ISP may assign a /64, /56 or /48 address block to a site.

That means the netmask number is bigger, the maximum hosts number in the subnet is lesser, and vise versa.

  1. Why there is no IPv5? Here is the answer.

  2. Some commands with using IPv6:

1
2
ping6 -I eth0 fe80::250:56ff:fe9b:3d4e
ssh -6 root@fe80::250:56ff:fe9b:3d4e%eth0

Comments