为什么IPv6使用冒号作为分隔符而不是点?

时间:2011-03-25 09:54:28

标签: ipv6

我找不到IPv6使用冒号作为分隔符而不是点的原因 当地址用端口号描述时,对我来说似乎很笨拙。

[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443

使用冒号的理由是什么?

1 个答案:

答案 0 :(得分:34)

我浏览了older IPv6 RFCs以找到关于历史的线索,但我认为答案在于RFC 4291 section 2.2.3

3. An alternative form that is sometimes more convenient when dealing
   with a mixed environment of IPv4 and IPv6 nodes is
   x:x:x:x:x:x:d.d.d.d, where the 'x's are the hexadecimal values of
   the six high-order 16-bit pieces of the address, and the 'd's are
   the decimal values of the four low-order 8-bit pieces of the
   address (standard IPv4 representation).  Examples:

      0:0:0:0:0:0:13.1.68.3

      0:0:0:0:0:FFFF:129.144.52.38

   or in compressed form:

      ::13.1.68.3

也就是说,如果IPv6地址以点分隔,您将无法“嵌入”与IPv4兼容的地址。

为了解释您对冒号与网址中的端口号冲突的含义,我认为答案是IPv6 was being designed in the early 1990shypertextURL were being designed同时时间。由于端口号与IP地址是分开的,因此没有标准来指定(端口,地址)元组。 (例如,命令行telnet客户端使用空格将IP地址与端口分开。)