IPv6 tutorial 4 IPv6 address syntax
https://4sysops.com/archives/ipv6-tutorial-part-4-ipv6-address-syntax/
Now that you know about the new features of IPv6, it is time to have a closer look at the practical details.
In this post, I will give a short summary about the IPv6 address syntax.
It is essentially a condensed version of the corresponding part in Microsoft’s white paper “Introduction to IP Version 6.”
colon冒号
Colon-hexadecimal representation
An IPv6 address consists of 128 bits and is presented in eight 16-bit blocks. Each 16-bit block is converted to a four-digit hexadecimal number. Blocks are separated by colons.
Example: 2001:0DB8:0000:2F3B:02AA:00FF:FE28:9C5A
一共是32个字节,分为8组,每组2个字节 ;2个字节用十六进制表示,0x2001 第一个字节是0x20 第二个字节是0x01
Leading zero suppression
Because IPv6 addresses are quite long, the leading zeroes within a 16-bit block can be removed, but each block must have at least a single digit.
Example: 2001:DB8:0:2F3B:2AA:FF:FE28:9C5A
Zero compression
A contiguous sequence of 16-bit blocks set to 0 can be replaced with the so-called double colon (::). Zero compression can only be applied once in an IP address.
To determine how many blocks have been omitted, you just have to count the remaining blocks and subtract this number from 8.
Example: FE80:0:0:0:2AA:FF:FE9A:4CA2 can be zero compressed to FE80::2AA:FF:FE9A:4CA2.
只有5组数据,中间有一个双冒号表示压缩了0,8-5=3;说明有3组0000被压缩了
IPv6 prefix
IPv6 prefixes are used to express IPv6 subnets, routes, and address ranges.
The syntax of IPv6 prefixes looks like this: address/prefix-length.
It is comparable to the Classless Inter-Domain Routing (CIDR) notation for IPv4 (for instance, 192.168.0.0/16 represents a Class B subnet): Subnet masks(子网掩码) are no longer used in IPv6.
Example: 21DA:D3:0:2F3B::/64 represents a subnet of 264 addresses, where the first 64 bits are fixed and the last 64 bits are variable.
Admittedly, IPv6 addresses look somewhat complicated compared to the relatively simple IPv4 addresses.
Rest assured that typos in IPv6 addresses will knock down quite a few systems once IPv6 starts replacing IPv4.
But this is the price of the large address space. I guess, we will get used to it.
In my next post, I will discuss the different types of IPv6 addresses.
I promise that things won’t get easier.
In the next post of this tutorial I will say some general words about the IPv6 address types and I will introduce the most address type, the global IPv6 unicast address.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2014-09-25 封装TeeChart控件