Validate an IP Address to check if its IPV6
Internet Protocol version 6 (IPv6) is the newest version of the Internet Protocol (IP), Similar to IPv4. IPV6 was introduced to remediate the problems and limitations of IPv4. IPv6 is also referred to as IPnext generation or IPng. IPv6 uses 128 bits to identify a host instead of IPv4’s 32 bits. The 128 bits that IPv6 uses allows the address space up to 2128 which equates to over 340 undecillion numbers of IP available addresses. The address space of IPv6 is a staggering number compared to ipv4s address space. The number of connected devices to the internet has long outgrown the addressing capacity of IPv4. The adoption of IPv6 has been slow from a technological standpoint. Most Internet Service Providers (ISP) still use IPv4 so version four will still be around for some time. Despite computers supporting IPv6 from the Windows XP era.
The number of addresses are - 340,282,366,920,938,463,463,374,607,431,768,211,456
The format of an IPv6 address consists of a string of hexadecimal values; the hexadecimal values represent four bits. There are a total of 32 hexadecimal values in an IPv6 address. The structure of an IPv6 is 0:0:0:0:0:0:0:0, with each zero representing four hexadecimal values. The four hexadecimal values are called Hextets. Similar to an IPv4 eight bit octet but with 16 bits or four hexadecimal values. The term Hextet is used to describe a section of an IPv6 address similar to an IPv4. Each Hextet is separated by a ‘:’. The range of hexadecimal starts at zero all the way up to F. The range of a Hextet starts at 0000 up to FFFF.
IPv6 addresses are long and can be difficult to read compared to IPv4. But there are rules in which you can use it to shorten IPv6 and make it easier to manage them. Despite a Shortened IPv6 being more manabale than the shortened address can become more error prone. The rules for shortening an IPv6 are:
Compressor or Shorten an IPv6 Address
Check if an IPV4 Address is vaild
Convert IPv6 to Hex
Check the class of an IP address