【问题标题】:Why don't we have zone id (like in IPv6 addresses after % character) in IPv4 addresses?为什么我们在 IPv4 地址中没有区域 ID(例如在 % 字符之后的 IPv6 地址)?
【发布时间】:2020-12-19 04:33:09
【问题描述】:

在 IPv6 地址中,我们可以看到一个区域 id 附加了百分位 % 字符(例如 fe80::1ff:fe23:4567:890a%3),用于标识接口。但是为什么我们不在 IPv4 地址中使用它们呢?

【问题讨论】:

  • 因为每个 IPv6 接口具有相同的网络,所以您需要区域 ID 来确定发送到该网络时所指的接口。

标签: networking ipv6 ipv4


【解决方案1】:

但是我检查了ipv4 netconf,ipv4-address的描述提到了zone id。 http://www.netconfcentral.org/modules/ietf-inet-types

  typedef ipv4-address {
  type string {
    pattern
      '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
        + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
        + '(%[\p{N}\p{L}]+)?';
  }
  description
    "The ipv4-address type represents an IPv4 address in
   dotted-quad notation.  The IPv4 address may include a zone
   index, separated by a % sign.

   The zone index is used to disambiguate identical address
   values.  For link-local addresses, the zone index will
   typically be the interface index number or the name of an
   interface.  If the zone index is not present, the default
   zone of the device will be used.

   The canonical format for the zone index is the numerical
   format";
}

【讨论】:

    猜你喜欢
    • 2011-02-16
    • 1970-01-01
    • 2012-12-25
    • 1970-01-01
    • 2011-06-24
    • 2013-09-18
    • 2018-01-23
    • 1970-01-01
    • 2015-11-10
    相关资源
    最近更新 更多