当前位置: 首页 > news >正文

RFC 4862 IPv6 Stateless Address Autoconfiguration 翻译

RFC 4862 IPv6 Stateless Address Autoconfiguration

主要讲了哪些内容:

  • 生成链路本地地址(link-local address)

  • 通过无状态地址自动配置(stateless address autoconfiguration)生成全局地址

  • 通过重复地址检测(Duplicate Address Detection,DAD)程序验证地址在链路上的唯一性

Introduction

This document specifies the steps a host takes in deciding how to autoconfigure its interfaces in IP version 6 (IPv6). The autoconfiguration process includes generating a link-local address, generating global addresses via stateless address autoconfiguration, and the Duplicate Address Detection procedure to verify the uniqueness of the addresses on a link.

翻译:
本文档规定了主机在决定如何自动配置其 IPv6 接口时所遵循的步骤。自动配置过程包括生成链路本地地址、通过无状态地址自动配置生成全局地址,以及使用重复地址检测(DAD)程序验证地址在链路上的唯一性。


The IPv6 stateless autoconfiguration mechanism requires no manual configuration of hosts, minimal (if any) configuration of routers, and no additional servers. The stateless mechanism allows a host to generate its own addresses using a combination of locally available information and information advertised by routers. Routers advertise prefixes that identify the subnet(s) associated with a link, while hosts generate an “interface identifier” that uniquely identifies an interface on a subnet. An address is formed by combining the two. In the absence of routers, a host can only generate link-local addresses. However, link-local addresses are sufficient for allowing communication among nodes attached to the same link.

翻译:
IPv6 的无状态自动配置机制无需对主机进行手动配置,对路由器的配置需求也很少(甚至不需要),且不依赖额外服务器。无状态机制允许主机通过结合本地已有的信息和路由器广播的信息,自动生成自己的地址。路由器广播标识链路关联子网的前缀,主机则生成一个“接口标识符”(interface identifier),用于唯一标识子网中的接口。地址由这两部分组合而成。如果没有路由器,主机只能生成链路本地地址,但链路本地地址足以实现同一链路上节点之间的通信。


The stateless approach is used when a site is not particularly concerned with the exact addresses hosts use, so long as they are unique and properly routable. On the other hand, Dynamic Host Configuration Protocol for IPv6 (DHCPv6) [RFC3315] is used when a site requires tighter control over exact address assignments. Both stateless address autoconfiguration and DHCPv6 may be used simultaneously.

翻译:
当网络不太关心主机使用的具体地址,只要地址唯一且路由正常时,会采用无状态自动配置方式。相反,如果网络需要对地址分配有更严格的控制,则使用 IPv6 的动态主机配置协议(DHCPv6)。这两种机制可以同时使用。


IPv6 addresses are leased to an interface for a fixed (possibly infinite) length of time. Each address has an associated lifetime that indicates how long the address is bound to an interface. When a lifetime expires, the binding (and address) become invalid and the address may be reassigned to another interface elsewhere in the Internet. To handle the expiration of address bindings gracefully, an address goes through two distinct phases while assigned to an interface. Initially, an address is “preferred”, meaning that its use in arbitrary communication is unrestricted. Later, an address becomes “deprecated” in anticipation that its current interface binding will become invalid. While an address is in a deprecated state, its use is discouraged, but not strictly forbidden. New communication (e.g., the opening of a new TCP connection) should use a preferred address when possible. A deprecated address should be used only by applications that have been using it and would have difficulty switching to another address without a service disruption.

翻译:
IPv6 地址会分配给接口一个固定(也可能是无限)的租用期。每个地址有一个对应的生命周期,表示地址绑定在接口上的有效时间。生命周期结束后,该绑定及地址即失效,地址可被重新分配给互联网中其它接口。为了平滑处理地址生命周期的结束,地址在接口上使用时会经历两个阶段:

初始阶段为“首选”(preferred),表示该地址可自由用于所有通信;

随后进入“弃用”(deprecated)阶段,预示该地址绑定即将失效。弃用状态下,地址的使用虽不被推荐,但也未被严格禁止。

新的通信(如新建 TCP 连接)应尽量使用首选地址;弃用地址应仅由已在使用它且难以切换的应用继续使用,以避免服务中断。

原文:
To ensure that all configured addresses are likely to be unique on a
given link, nodes run a “duplicate address detection” algorithm on
addresses before assigning them to an interface. The Duplicate
Address Detection algorithm is performed on all addresses,
independently of whether they are obtained via stateless
autoconfiguration or DHCPv6. This document defines the Duplicate
Address Detection algorithm.

翻译:
为了确保在给定链路上所有配置的地址都很可能是唯一的,节点在将地址分配给接口之前,会对地址运行“重复地址检测”算法。无论这些地址是通过无状态自动配置还是 DHCPv6 获得,重复地址检测算法都会对所有地址独立执行。本文档定义了重复地址检测算法的具体内容。


原文:
The autoconfiguration process specified in this document applies only
to hosts and not routers. Since host autoconfiguration uses
information advertised by routers, routers will need to be configured
by some other means. However, it is expected that routers will
generate link-local addresses using the mechanism described in this
document. In addition, routers are expected to successfully pass the
Duplicate Address Detection procedure described in this document on
all addresses prior to assigning them to an interface.

翻译:
本文档中规定的自动配置过程仅适用于主机,不适用于路由器。由于主机自动配置依赖于路由器广播的信息,因此路由器需要通过其他方式进行配置。不过,期望路由器能使用本文档描述的机制生成链路本地地址。此外,期望路由器在将地址分配给接口之前,能成功完成本文档中描述的重复地址检测程序。


原文:
Section 2 provides definitions for terminology used throughout this
document. Section 3 describes the design goals that lead to the
current autoconfiguration procedure. Section 4 provides an overview
of the protocol, while Section 5 describes the protocol in detail.

翻译:
第2节定义了本文档中使用的相关术语。第3节介绍了促成当前自动配置过程的设计目标。第4节提供了协议的总体概述,第5节详细描述了协议的具体内容。

Terminology


IP - Internet Protocol Version 6. The terms IPv4 and IPv6 are used only in contexts where necessary to avoid ambiguity.
IP — 互联网协议第6版。术语 IPv4 和 IPv6 仅在避免歧义时使用。


node - a device that implements IP.
节点 — 实现 IP 的设备。


router - a node that forwards IP packets not explicitly addressed to itself.
路由器 — 转发未明确发给自己的 IP 包的节点。


host - any node that is not a router.
主机 — 任何不是路由器的节点。


upper layer - a protocol layer immediately above IP. Examples are transport protocols such as TCP and UDP, control protocols such as ICMP, routing protocols such as OSPF, and Internet or lower-layer protocols being “tunneled” over (i.e., encapsulated in) IP such as IPX, AppleTalk, or IP itself.
上层 — 紧邻 IP 之上的协议层。示例包括传输协议(如 TCP 和 UDP)、控制协议(如 ICMP)、路由协议(如 OSPF)以及通过 IP “隧道”传输(即封装在 IP 内)的互联网或更低层协议(如 IPX、AppleTalk 或 IP 本身)。


link - a communication facility or medium over which nodes can communicate at the link layer, i.e., the layer immediately below IP. Examples are Ethernets (simple or bridged); PPP links; X.25, Frame Relay, or ATM networks; and Internet (or higher) layer “tunnels”, such as tunnels over IPv4 or IPv6 itself. The protocol described in this document will be used on all types of links unless specified otherwise in the link-type-specific document describing how to operate IP on the link in line with [RFC4861].
链路 — 节点可以在链路层(即 IP 之下的层)上通信的通信设施或介质。示例包括以太网(简单或桥接)、PPP 链路、X.25、帧中继或 ATM 网络,以及互联网(或更高层)“隧道”,如基于 IPv4 或 IPv6 的隧道。除非链路类型特定文档另有说明,本文档描述的协议将在所有类型链路上使用,符合 [RFC4861] 规定。


interface - a node’s attachment to a link.
接口 — 节点与链路的连接点。


packet - an IP header plus payload.
数据包 — IP 头部加负载。


address - an IP-layer identifier for an interface or a set of interfaces.
地址 — 接口或接口集合的 IP 层标识符。


unicast address - an identifier for a single interface. A packet sent to a unicast address is delivered to the interface identified by that address.
单播地址 — 用于单个接口的标识符。发送到单播地址的数据包会被投递到由该地址标识的接口。


multicast address - an identifier for a set of interfaces (typically belonging to different nodes). A packet sent to a multicast address is delivered to all interfaces identified by that address.
组播地址 — 用于一组接口(通常属于不同节点)的标识符。发送到组播地址的数据包会被投递到所有由该地址标识的接口。


anycast address - an identifier for a set of interfaces (typically belonging to different nodes). A packet sent to an anycast address is delivered to one of the interfaces identified by that address (the “nearest” one, according to the routing protocol’s measure of distance). See [RFC4291].
任播地址 — 用于一组接口(通常属于不同节点)的标识符。发送到任播地址的数据包会被投递到由该地址标识的某一个接口(根据路由协议的距离度量选择“最近”的一个)。详见 [RFC4291]。


solicited-node multicast address - a multicast address to which Neighbor Solicitation messages are sent. The algorithm for computing the address is given in [RFC4291].
请求节点组播地址 — 邻居请求消息(Neighbor Solicitation)发送的组播地址。地址计算算法详见 [RFC4291]。


link-layer address - a link-layer identifier for an interface. Examples include IEEE 802 addresses for Ethernet links and E.164 addresses for Integrated Services Digital Network (ISDN) links.
链路层地址 — 接口的链路层标识符。示例包括以太网的 IEEE 802 地址和综合业务数字网(ISDN)的 E.164 地址。


link-local address - an address having link-only scope that can be used to reach neighboring nodes attached to the same link. All interfaces have a link-local unicast address.
链路本地地址 — 仅在链路范围内有效的地址,用于访问连接到同一链路的邻居节点。所有接口都有链路本地单播地址。


global address - an address with unlimited scope.
全局地址 — 具有无限范围的地址。


communication - any packet exchange among nodes that requires that the address of each node used in the exchange remain the same for the duration of the packet exchange. Examples are a TCP connection or a UDP request-response.
通信 — 节点之间任何要求在整个数据包交换期间保持所用地址不变的数据包交换。示例包括 TCP 连接或 UDP 请求-响应。


tentative address - an address whose uniqueness on a link is being verified, prior to its assignment to an interface. A tentative address is not considered assigned to an interface in the usual sense. An interface discards received packets addressed to a tentative address, but accepts Neighbor Discovery packets related to Duplicate Address Detection for the tentative address.
临时地址 — 在分配给接口前,正在验证其链路唯一性的地址。临时地址在通常意义上不被视为已分配给接口。接口会丢弃发往临时地址的接收数据包,但会接受与临时地址重复地址检测相关的邻居发现数据包。


preferred address - an address assigned to an interface whose use by upper-layer protocols is unrestricted. Preferred addresses may be used as the source (or destination) address of packets sent from (or to) the interface.
首选地址 — 分配给接口、上层协议可无限制使用的地址。首选地址可用作接口发送或接收数据包的源地址或目的地址。


deprecated address - An address assigned to an interface whose use is discouraged, but not forbidden. A deprecated address should no longer be used as a source address in new communications, but packets sent from or to deprecated addresses are delivered as expected. A deprecated address may continue to be used as a source address in communications where switching to a preferred address causes hardship to a specific upper-layer activity (e.g., an existing TCP connection).
弃用地址 — 分配给接口但使用被劝阻的地址。弃用地址不应作为新通信的源地址,但发送至或来自弃用地址的数据包仍能正常传递。在切换到首选地址会对某些上层活动(如现有 TCP 连接)造成困难的通信中,弃用地址仍可继续作为源地址使用。


valid address - a preferred or deprecated address. A valid address may appear as the source or destination address of a packet, and the Internet routing system is expected to deliver packets sent to a valid address to their intended recipients.
有效地址 — 包括首选地址和弃用地址。有效地址可作为数据包的源地址或目的地址,互联网路由系统应将发送到有效地址的数据包送达预期接收方。


invalid address - an address that is not assigned to any interface. A valid address becomes invalid when its valid lifetime expires. Invalid addresses should not appear as the destination or source address of a packet. In the former case, the Internet routing system will be unable to deliver the packet; in the latter case, the recipient of the packet will be unable to respond to it.
无效地址 — 未分配给任何接口的地址。有效地址在其有效期满后变为无效地址。无效地址不应作为数据包的源地址或目的地址。作为目的地址时,互联网路由系统无法送达该包;作为源地址时,接收方无法回应。


preferred lifetime - the length of time that a valid address is preferred (i.e., the time until deprecation). When the preferred lifetime expires, the address becomes deprecated.
首选生存期 — 有效地址被视为首选状态的时间长度(即直到弃用)。首选生存期结束后,地址变为弃用。


valid lifetime - the length of time an address remains in the valid state (i.e., the time until invalidation). The valid lifetime must be greater than or equal to the preferred lifetime. When the valid lifetime expires, the address becomes invalid.
有效生存期 — 地址保持有效状态的时间长度(即直到失效)。有效生存期必须大于或等于首选生存期。有效生存期结束后,地址变为无效。


interface identifier - a link-dependent identifier for an interface that is (at least) unique per link [RFC4291]. Stateless address autoconfiguration combines an interface identifier with a prefix to form an address. From address autoconfiguration’s perspective, an interface identifier is a bit string of known length. The exact length of an interface identifier and the way it is created is defined in a separate link-type specific document that covers issues related to the transmission of IP over a particular link type (e.g., [RFC2464]). Note that the address architecture [RFC4291] also defines the length of the interface identifiers for some set of addresses, but the two sets of definitions must be consistent. In many cases, the identifier will be derived from the interface’s link-layer address.
接口标识符 — 一种链路相关的接口标识符,至少在链路范围内唯一 [RFC4291]。无状态地址自动配置通过将接口标识符与前缀组合形成地址。从自动配置的角度看,接口标识符是已知长度的位串。接口标识符的具体长度及生成方式由针对特定链路类型的文档定义(如 [RFC2464]),涉及 IP 在该链路类型上的传输问题。地址架构 [RFC4291] 也定义了某些地址集合的接口标识符长度,两者定义需保持一致。很多情况下,接口标识符源自接口的链路层地址。


2.1. Requirements

The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this document, are to be interpreted as described in [RFC2119].
当本文档中出现 MUST(必须)、MUST NOT(不得)、REQUIRED(要求)、SHALL(应当)、SHALL NOT(不应)、SHOULD(建议)、SHOULD NOT(不建议)、RECOMMENDED(推荐)、MAY(可选)和 OPTIONAL(可选)这些关键词时,应按照[RFC2119]中的定义进行理解。

Design Goals

3. 设计目标


Stateless autoconfiguration is designed with the following goals in mind:
无状态自动配置的设计目标包括以下几点:


o Manual configuration of individual machines before connecting them to the network should not be required. Consequently, a mechanism is needed that allows a host to obtain or create unique addresses for each of its interfaces. Address autoconfiguration assumes that each interface can provide a unique identifier for that interface (i.e., an “interface identifier”). In the simplest case, an interface identifier consists of the interface’s link-layer address. An interface identifier can be combined with a prefix to form an address.
  • 不应要求在将单个机器连接到网络之前进行手动配置。因此,需要一种机制,使主机能够为其每个接口获取或创建唯一地址。地址自动配置假设每个接口都能提供该接口的唯一标识符(即“接口标识符”)。最简单的情况是,接口标识符由接口的链路层地址组成。接口标识符可以与前缀结合形成地址。

o Small sites consisting of a set of machines attached to a single link should not require the presence of a DHCPv6 server or router as a prerequisite for communicating. Plug-and-play communication is achieved through the use of link-local addresses. Link-local addresses have a well-known prefix that identifies the (single) shared link to which a set of nodes attach. A host forms a link-local address by appending an interface identifier to the link-local prefix.

  • 由连接到单一链路的一组机器组成的小型站点,不应要求存在 DHCPv6 服务器或路由器作为通信的前提条件。即插即用通信通过使用链路本地地址实现。链路本地地址有一个众所周知的前缀,用于标识一组节点所连接的(单一)共享链路。主机通过将接口标识符附加到链路本地前缀上形成链路本地地址。

o A large site with multiple networks and routers should not require the presence of a DHCPv6 server for address configuration. In order to generate global addresses, hosts must determine the prefixes that identify the subnets to which they attach. Routers generate periodic Router Advertisements that include options listing the set of active prefixes on a link.

  • 具有多个网络和路由器的大型站点,不应要求存在 DHCPv6 服务器来进行地址配置。为了生成全局地址,主机必须确定标识其所连接子网的前缀。路由器定期生成路由器通告,其中包含列出链路上活动前缀集的选项。

o Address configuration should facilitate the graceful renumbering of a site’s machines. For example, a site may wish to renumber all of its nodes when it switches to a new network service provider. Renumbering is achieved through the leasing of addresses to interfaces and the assignment of multiple addresses to the same interface. Lease lifetimes provide the mechanism through which a site phases out old prefixes. The assignment of multiple addresses to an interface provides for a transition period during which both a new address and the one being phased out work simultaneously.

  • 地址配置应支持对站点机器的平滑重新编号。例如,当站点切换到新的网络服务提供商时,可能希望重新编号其所有节点。重新编号是通过将地址租赁给接口以及将多个地址分配给同一接口来实现的。租赁生命周期提供了站点逐步淘汰旧前缀的机制。向接口分配多个地址则提供了一个过渡期,在此期间,新地址和即将淘汰的地址可同时使用。

Protocol Overview

协议概述


This section provides an overview of the typical steps that take place when an interface autoconfigures itself. Autoconfiguration is performed only on multicast-capable links and begins when a multicast-capable interface is enabled, e.g., during system startup. Nodes (both hosts and routers) begin the autoconfiguration process by generating a link-local address for the interface. A link-local address is formed by appending an identifier of the interface to the well-known link-local prefix [RFC4291].

本节概述了接口进行自动配置时的典型步骤。自动配置仅在支持多播(multicast-capable)的链路上执行,并且当一个支持多播的接口被启用时开始,例如系统启动期间。节点(包括主机和路由器)通过为接口生成一个链路本地地址(link-local address)来启动自动配置过程。链路本地地址是通过将接口的标识符附加到众所周知的链路本地前缀(link-local prefix)[RFC4291]来形成的。


Before the link-local address can be assigned to an interface and used, however, a node must attempt to verify that this “tentative” address is not already in use by another node on the link. Specifically, it sends a Neighbor Solicitation message containing the tentative address as the target. If another node is already using that address, it will return a Neighbor Advertisement saying so. If another node is also attempting to use the same address, it will send a Neighbor Solicitation for the target as well. The exact number of times the Neighbor Solicitation is (re)transmitted and the delay time between consecutive solicitations is link-specific and may be set by system management.

然而,在链路本地地址被分配给接口并使用之前,节点必须尝试验证该“暂定”(tentative)地址未被链路上其他节点使用。具体来说,节点会发送一条邻居请求(Neighbor Solicitation)消息,其中包含该暂定地址作为目标。如果有其他节点已经在使用该地址,它会返回一个邻居通告(Neighbor Advertisement)表示该地址已被使用。如果有其他节点也在尝试使用相同地址,它也会发送相应的邻居请求。邻居请求消息的具体重传次数及连续请求之间的延迟时间依赖于链路类型,并可能由系统管理进行配置。


If a node determines that its tentative link-local address is not unique, autoconfiguration stops and manual configuration of the interface is required. To simplify recovery in this case, it should be possible for an administrator to supply an alternate interface identifier that overrides the default identifier in such a way that the autoconfiguration mechanism can then be applied using the new (presumably unique) interface identifier. Alternatively, link-local and other addresses will need to be configured manually.

如果节点确定其暂定链路本地地址不是唯一的,则自动配置过程停止,需要手动配置该接口。为简化故障恢复,管理员应能够提供一个备用的接口标识符以覆盖默认标识符,使得自动配置机制能够基于新的(推测是唯一的)接口标识符继续执行。否则,链路本地地址和其他地址都需要手动配置。


Once a node ascertains that its tentative link-local address is unique, it assigns the address to the interface. At this point, the node has IP-level connectivity with neighboring nodes. The remaining autoconfiguration steps are performed only by hosts; the (auto)configuration of routers is beyond the scope of this document.

一旦节点确认其暂定链路本地地址唯一,即将该地址分配给接口。此时,节点已具备与邻居节点的 IP 层连通性。剩余的自动配置步骤仅由主机执行;路由器的(自动)配置不在本文档的讨论范围内。


The next phase of autoconfiguration involves obtaining a Router Advertisement or determining that no routers are present. If routers are present, they will send Router Advertisements that specify what sort of autoconfiguration a host can do. Note that the DHCPv6 service for address configuration may still be available even if no routers are present.

自动配置的下一阶段是获取路由器通告(Router Advertisement)或判断没有路由器存在。如果存在路由器,路由器会发送路由器通告,指明主机可以执行何种自动配置。需要注意的是,即使没有路由器,地址配置的 DHCPv6 服务仍可能可用。


Routers send Router Advertisements periodically, but the delay between successive advertisements will generally be longer than a host performing autoconfiguration will want to wait [RFC4861]. To obtain an advertisement quickly, a host sends one or more Router Solicitations to the all-routers multicast group.

路由器会定期发送路由器通告,但通告间的时间间隔通常比主机希望等待的时间长 [RFC4861]。为了快速获取通告,主机会向所有路由器多播组发送一个或多个路由器请求(Router Solicitations)。


Router Advertisements also contain zero or more Prefix Information options that contain information used by stateless address autoconfiguration to generate global addresses. It should be noted that a host may use both stateless address autoconfiguration and DHCPv6 simultaneously. One Prefix Information option field, the “autonomous address-configuration flag”, indicates whether or not the option even applies to stateless autoconfiguration. If it does, additional option fields contain a subnet prefix, together with lifetime values, indicating how long addresses created from the prefix remain preferred and valid.

路由器通告还包含零个或多个前缀信息(Prefix Information)选项,这些选项包含无状态地址自动配置使用的信息,用以生成全局地址。应注意,主机可以同时使用无状态地址自动配置和 DHCPv6。其中一个前缀信息选项字段——“自主地址配置标志(autonomous address-configuration flag)”——指示该选项是否适用于无状态自动配置。如果适用,附加的选项字段将包含子网前缀和生命周期值,表明由该前缀生成的地址保持优选(preferred)和有效(valid)的时间。


Because routers generate Router Advertisements periodically, hosts will continually receive new advertisements. Hosts process the information contained in each advertisement as described above, adding to and refreshing information received in previous advertisements.

由于路由器定期生成路由器通告,主机会持续接收新的通告。主机按照上述方式处理每次通告中的信息,新增和刷新之前通告中接收到的信息。


By default, all addresses should be tested for uniqueness prior to their assignment to an interface for safety. The test should individually be performed on all addresses obtained manually, via stateless address autoconfiguration, or via DHCPv6. To accommodate sites that believe the overhead of performing Duplicate Address Detection outweighs its benefits, the use of Duplicate Address Detection can be disabled through the administrative setting of a per-interface configuration flag.

默认情况下,为确保安全,所有地址在分配给接口前都应进行唯一性测试。此测试应分别针对所有手动获得的地址、通过无状态地址自动配置获得的地址或通过 DHCPv6 获得的地址执行。为了适应认为重复地址检测(Duplicate Address Detection)开销大于收益的站点,可以通过对每个接口配置标志的管理设置来禁用重复地址检测。


To speed the autoconfiguration process, a host may generate its link-local address (and verify its uniqueness) in parallel with waiting for a Router Advertisement. Because a router may delay responding to a Router Solicitation for a few seconds, the total time needed to complete autoconfiguration can be significantly longer if the two steps are done serially.

为了加快自动配置过程,主机可以在等待路由器通告的同时生成链路本地地址(并验证其唯一性)。由于路由器对路由器请求的响应可能会延迟几秒钟,如果这两个步骤顺序执行,完成自动配置所需的总时间会显著增加。

Protocol Specification

协议规范


Autoconfiguration is performed on a per-interface basis on multicast-capable interfaces. For multihomed hosts, autoconfiguration is performed independently on each interface. Autoconfiguration applies primarily to hosts, with two exceptions. Routers are expected to generate a link-local address using the procedure outlined below. In addition, routers perform Duplicate Address Detection on all addresses prior to assigning them to an interface.

自动配置(Autoconfiguration)是在每个支持多播(multicast-capable)的接口上分别执行的。对于多宿主(multihomed)主机,每个接口都独立进行自动配置。自动配置主要适用于主机,但有两个例外:

  • 路由器应按照下面描述的过程生成链路本地地址(link-local address);
  • 此外,路由器在将地址分配给接口之前,必须对所有地址执行重复地址检测(Duplicate Address Detection)。

5.1. Node Configuration Variables

A node MUST allow the following autoconfiguration-related variable to be configured by system management for each multicast-capable interface:

节点**必须(MUST)**允许系统管理为每个支持多播的接口配置以下与自动配置相关的变量:


DupAddrDetectTransmits
重复地址检测发送次数:指定在对一个暂定地址(tentative address)执行重复地址检测时,连续发送的邻居请求(Neighbor Solicitation)消息的数量。

  • 如果该值为 0,表示对暂定地址不执行重复地址检测。
  • 如果该值为 1,表示仅发送一次请求,不进行后续重传。

默认值:1,但可被针对特定链路类型的文档中所定义的值覆盖,例如 RFC 2464 中对在特定链路上传输 IP 的相关问题的描述。


Autoconfiguration also assumes the presence of the variable RetransTimer as defined in [RFC4861].
自动配置还依赖于 [RFC4861] 中定义的变量 RetransTimer(重传定时器)。

For autoconfiguration purposes, RetransTimer specifies:
对于自动配置而言,RetransTimer 用于指定以下内容:

  • 在重复地址检测过程中,如果 DupAddrDetectTransmits > 1,则表示每次连续发送邻居请求之间的延迟时间;
  • 以及节点在发送最后一条邻居请求消息后,结束重复地址检测前等待的时间。

5.2. Autoconfiguration-Related Structures

Beyond the formation of a link-local address and use of Duplicate Address Detection, how routers (auto)configure their interfaces is beyond the scope of this document.
除了链路本地地址的生成和重复地址检测的使用之外,路由器如何(自动)配置其接口超出了本文件的范围。

A host maintains a list of addresses together with their corresponding lifetimes. The address list contains both autoconfigured addresses and those configured manually.
主机维护一个地址列表以及对应的地址生命周期。该地址列表既包含自动配置的地址,也包含手动配置的地址。

5.3. Creation of Link-Local Addresses

A node forms a link-local address whenever an interface becomes enabled. An interface may become enabled after any of the following events:
节点在接口启用时会生成一个链路本地地址。接口在以下任一事件后可能被启用:

  • The interface is initialized at system startup time.
    接口在系统启动时初始化。
  • The interface is reinitialized after a temporary interface failure or after being temporarily disabled by system management.
    接口在经历临时故障恢复或被系统管理临时禁用后重新初始化。
  • The interface attaches to a link for the first time. This includes the case where the attached link is dynamically changed due to a change of the access point of wireless networks.
    接口首次连接到链路,包括由于无线网络接入点变化导致链路动态变更的情况。
  • The interface becomes enabled by system management after having been administratively disabled.
    接口在被系统管理启用,此前曾被管理层禁用。

A link-local address is formed by combining the well-known link-local prefix FE80::0 [RFC4291] (of appropriate length) with an interface identifier as follows:
链路本地地址通过将著名的链路本地前缀 FE80::0 [RFC4291](长度适当)与接口标识符组合形成,步骤如下:

  1. The left-most ‘prefix length’ bits of the address are those of the link-local prefix.
    地址最左侧“前缀长度”位为链路本地前缀的对应位。
  2. The bits in the address to the right of the link-local prefix are set to all zeroes.
    链路本地前缀右侧的位全部置零。
  3. If the length of the interface identifier is N bits, the right-most N bits of the address are replaced by the interface identifier.
    如果接口标识符的长度是 N 位,地址最右侧的 N 位替换为接口标识符。

If the sum of the link-local prefix length and N is larger than 128, autoconfiguration fails and manual configuration is required.
如果链路本地前缀长度与接口标识符长度之和超过128位,自动配置失败,需要手动配置。

The length of the interface identifier is defined in a separate link-type-specific document, which should also be consistent with the address architecture [RFC4291] (see Section 2). These documents will carefully define the length so that link-local addresses can be autoconfigured on the link.
接口标识符的长度由单独的链路类型相关文档定义,该定义应与地址架构 [RFC4291](见第2节)保持一致。这些文档会详细定义长度,以确保链路本地地址可以在该链路上自动配置。

A link-local address has an infinite preferred and valid lifetime; it is never timed out.
链路本地地址拥有无限的首选寿命和有效寿命;它永不过期。

5.4. Duplicate Address Detection

Duplicate Address Detection MUST be performed on all unicast addresses prior to assigning them to an interface, regardless of whether they are obtained through stateless autoconfiguration, DHCPv6, or manual configuration, with the following exceptions:
在将所有单播地址分配给接口之前,必须执行重复地址检测(Duplicate Address Detection),无论这些地址是通过无状态自动配置(stateless autoconfiguration)、DHCPv6还是手动配置获得,以下情况除外:

  • An interface whose DupAddrDetectTransmits variable is set to zero does not perform Duplicate Address Detection.
    如果接口的 DupAddrDetectTransmits 变量被设置为零,则不执行重复地址检测。
  • Duplicate Address Detection MUST NOT be performed on anycast addresses (note that anycast addresses cannot syntactically be distinguished from unicast addresses).
    不得对任播地址(anycast addresses)执行重复地址检测(注意,任播地址在语法上无法与单播地址区分)。
  • Each individual unicast address SHOULD be tested for uniqueness. Note that there are implementations deployed that only perform Duplicate Address Detection for the link-local address and skip the test for the global address that uses the same interface identifier as that of the link-local address. Whereas this document does not invalidate such implementations, this kind of “optimization” is NOT RECOMMENDED, and new implementations MUST NOT do that optimization. This optimization came from the assumption that all of an interface’s addresses are generated from the same identifier. However, the assumption does actually not stand; new types of addresses have been introduced where the interface identifiers are not necessarily the same for all unicast addresses on a single interface [RFC4941] [RFC3972]. Requiring that Duplicate Address Detection be performed for all unicast addresses will make the algorithm robust for the current and future special interface identifiers.
    应该对每个单播地址分别进行唯一性测试。注意,目前已有一些实现仅对链路本地地址执行重复地址检测,而跳过了对使用与链路本地地址相同接口标识符的全局地址的检测。虽然本文件并不否定这种实现,但这种“优化”不推荐,新的实现必须禁止这种优化。该优化基于所有接口地址均由相同接口标识符生成的假设,但这一假设并不成立;现已引入新的地址类型,其中单个接口上的所有单播地址的接口标识符可能不同 [RFC4941] [RFC3972]。要求对所有单播地址执行重复地址检测将增强算法对当前和未来特殊接口标识符的适应性。

The procedure for detecting duplicate addresses uses Neighbor Solicitation and Advertisement messages as described below. If a duplicate address is discovered during the procedure, the address cannot be assigned to the interface. If the address is derived from an interface identifier, a new identifier will need to be assigned to the interface, or all IP addresses for the interface will need to be manually configured. Note that the method for detecting duplicates is not completely reliable, and it is possible that duplicate addresses will still exist (e.g., if the link was partitioned while Duplicate Address Detection was performed).
检测重复地址的过程使用邻居请求(Neighbor Solicitation)和邻居通告(Neighbor Advertisement)消息,如下文所述。如果过程中发现地址重复,则不能将该地址分配给接口。如果该地址是由接口标识符派生的,则需要为接口分配新的标识符,或者必须手动配置该接口的所有IP地址。需要注意的是,检测重复的方式并非完全可靠,仍有可能存在重复地址(例如,在执行重复地址检测时链路发生分割的情况)。

An address on which the Duplicate Address Detection procedure is applied is said to be tentative until the procedure has completed successfully. A tentative address is not considered “assigned to an interface” in the traditional sense. That is, the interface must accept Neighbor Solicitation and Advertisement messages containing the tentative address in the Target Address field, but processes such packets differently from those whose Target Address matches an address assigned to the interface. Other packets addressed to the tentative address should be silently discarded. Note that the “other packets” include Neighbor Solicitation and Advertisement messages that have the tentative (i.e., unicast) address as the IP destination address and contain the tentative address in the Target Address field. Such a case should not happen in normal operation, though, since these messages are multicasted in the Duplicate Address Detection procedure.
执行重复地址检测程序的地址在检测成功之前被称为“试探性地址(tentative)”。试探性地址不被认为是传统意义上的“分配给接口”。接口必须接受包含该试探性地址作为目标地址字段的邻居请求和邻居通告消息,但处理方式不同于目标地址已分配给接口的包。其他发往试探性地址的数据包应被静默丢弃。这里的“其他包”包括那些目标地址为该试探性单播地址且在目标地址字段包含该试探性地址的邻居请求和邻居通告消息。不过在正常操作中,这种情况不应该发生,因为这些消息在重复地址检测过程中是多播的。

It should also be noted that Duplicate Address Detection must be performed prior to assigning an address to an interface in order to prevent multiple nodes from using the same address simultaneously. If a node begins using an address in parallel with Duplicate Address Detection, and another node is already using the address, the node performing Duplicate Address Detection will erroneously process traffic intended for the other node, resulting in such possible negative consequences as the resetting of open TCP connections.
还应注意,必须在地址分配给接口之前执行重复地址检测,以防止多个节点同时使用相同地址。如果节点在重复地址检测过程中已开始使用该地址,而另一个节点也在使用该地址,则执行检测的节点可能会错误处理发往另一个节点的流量,可能导致诸如TCP连接被重置等负面后果。


The following subsections describe specific tests a node performs to verify an address’s uniqueness. An address is considered unique if none of the tests indicate the presence of a duplicate address within RetransTimer milliseconds after having sent DupAddrDetectTransmits Neighbor Solicitations. Once an address is determined to be unique, it may be assigned to an interface.
下面的小节描述节点验证地址唯一性的具体测试。如果在发送了 DupAddrDetectTransmits 次邻居请求消息,并且在 RetransTimer 毫秒内没有检测到重复地址,则该地址被认为是唯一的。一旦地址被确定为唯一,即可将其分配给接口。

5.4.1. Message Validation

消息验证

A node MUST silently discard any Neighbor Solicitation or Advertisement message that does not pass the validity checks specified in [RFC4861]. A Neighbor Solicitation or Advertisement message that passes these validity checks is called a valid solicitation or valid advertisement, respectively.

一个节点必须静默丢弃所有未通过 [RFC4861] 中规定的有效性检查的邻居请求(Neighbor Solicitation)或邻居通告(Neighbor Advertisement)消息。
通过这些有效性检查的邻居请求或通告消息分别被称为“有效的请求(valid solicitation)”或“有效的通告(valid advertisement)”。


5.4.2. Sending Neighbor Solicitation Messages

发送邻居请求消息

Before sending a Neighbor Solicitation, an interface MUST join the all-nodes multicast address and the solicited-node multicast address of the tentative address. The former ensures that the node receives Neighbor Advertisements from other nodes already using the address; the latter ensures that two nodes attempting to use the same address simultaneously should detect each other’s presence.

在发送邻居请求(Neighbor Solicitation)之前,接口必须加入两个多播地址:

  • 所有节点多播地址(all-nodes multicast address);
  • 待检测地址对应的请求节点多播地址(solicited-node multicast address)。
    前者确保该节点能接收到其他节点对该地址发送的邻居通告消息;后者确保两个尝试同时使用相同地址的节点能够互相检测到对方的存在。

To check an address, a node sends DupAddrDetectTransmits Neighbor Solicitations, each separated by RetransTimer milliseconds. The solicitation’s Target Address is set to the address being checked, the IP source is set to the unspecified address, and the IP destination is set to the solicited-node multicast address of the target address.

为了检测地址的唯一性,节点会发送 DupAddrDetectTransmits 次邻居请求消息,每次间隔 RetransTimer 毫秒。

  • 请求消息中的目标地址(Target Address)被设置为正在检测的地址;
  • 源地址设置为未指定地址 ::
  • 目的地址设置为该目标地址对应的请求节点多播地址(solicited-node multicast address)。

If the Neighbor Solicitation is going to be the first message sent from an interface after interface (re)initialization, the node SHOULD delay joining the solicited-node multicast address by a random delay between 0 and MAX_RTR_SOLICITATION_DELAY as specified in [RFC4861]. This serves to alleviate congestion when many nodes start up on the link at the same time, such as after a power failure, and may help to avoid race conditions when more than one node is trying to solicit for the same address at the same time.

如果这是接口在(重新)初始化后发送的第一条消息,节点应该延迟加入请求节点多播地址(solicited-node multicast address),
延迟时间为 0MAX_RTR_SOLICITATION_DELAY 之间的一个随机值(定义见 RFC4861)。
这个延迟的目的是在很多节点同时上电(比如断电恢复)时减轻网络拥塞,并尽量避免多个节点同时探测同一地址时产生竞争情况。


Even if the Neighbor Solicitation is not going to be the first message sent, the node SHOULD delay joining the solicited-node multicast address by a random delay between 0 and MAX_RTR_SOLICITATION_DELAY if the address being checked is configured by a router advertisement message sent to a multicast address. The delay will avoid similar congestion when multiple nodes are going to configure addresses by receiving the same single multicast router advertisement.

即使邻居请求消息不是接口初始化后的第一条消息,
如果该地址是通过多播的路由通告(Router Advertisement)**获取配置的,节点仍然**应该延迟加入请求节点多播地址,
延迟时间为 0MAX_RTR_SOLICITATION_DELAY 之间的随机值。
这个延迟可以避免多个节点因同时响应同一条 RA 消息而导致的拥塞。


Note that when a node joins a multicast address, it typically sends a Multicast Listener Discovery (MLD) report message [RFC2710] [RFC3810] for the multicast address. In the case of Duplicate Address Detection, the MLD report message is required in order to inform MLD-snooping switches, rather than routers, to forward multicast packets.

注意,当节点加入某个多播地址时,通常会发送一个 MLD(Multicast Listener Discovery)报告消息(参见 RFC2710 和 RFC3810)以声明加入。
在执行重复地址检测时,必须发送此类 MLD 报文,用于通知支持 MLD-snooping 的交换机(而非路由器)转发该多播流量。


In the above description, the delay for joining the multicast address thus means delaying transmission of the corresponding MLD report message. Since the MLD specifications do not request a random delay to avoid race conditions, just delaying Neighbor Solicitation would cause congestion by the MLD report messages. The congestion would then prevent the MLD-snooping switches from working correctly and, as a result, prevent Duplicate Address Detection from working. The requirement to include the delay for the MLD report in this case avoids this scenario.

上述描述中的“延迟加入多播地址”本质上是指延迟发送对应的 MLD 报告消息
因为 MLD 协议本身没有定义随机延迟机制,如果只延迟 NS 消息而不延迟 MLD 报告消息,会导致 MLD 报文在短时间内集中发送,从而产生网络拥塞。
这种拥塞会导致 MLD-snooping 交换机无法正常转发多播包,进而使得重复地址检测失败。
因此,在本场景下也必须对 MLD 报告施加相同的延迟,以避免这种问题。


[RFC3590] also talks about some interaction issues between Duplicate Address Detection and MLD, and specifies which source address should be used for the MLD report in this case.

RFC3590 中也讨论了重复地址检测与 MLD 之间的交互问题,并明确指出在这种情况下,MLD 报告应使用哪个源地址。


In order to improve the robustness of the Duplicate Address Detection algorithm, an interface MUST receive and process datagrams sent to the all-nodes multicast address or solicited-node multicast address of the tentative address during the delay period. This does not necessarily conflict with the requirement that joining the multicast group be delayed. In fact, in some cases it is possible for a node to start listening to the group during the delay period before MLD report transmission.

为了提高重复地址检测算法的健壮性,接口在延迟期内必须能够接收并处理发往 all-nodes 多播地址或试探性地址对应的 solicited-node 多播地址的数据包。
这一要求与“延迟加入多播组”的规定并不冲突 —— 在某些情况下,节点在发送 MLD 报告之前,就已经可以监听该多播组的流量。


It should be noted, however, that in some link-layer environments, particularly with MLD-snooping switches, no multicast reception will be available until the MLD report is sent.

但需要注意的是,在某些链路层环境中(特别是使用 MLD-snooping 的交换网络中),
在发送 MLD 报告消息之前节点无法接收到任何多播流量

5.4.3. Receiving Neighbor Solicitation Messages

接收邻居请求消息

On receipt of a valid Neighbor Solicitation message on an interface, node behavior depends on whether or not the target address is tentative. If the target address is not tentative (i.e., it is assigned to the receiving interface), the solicitation is processed as described in [RFC4861]. If the target address is tentative, and the source address is a unicast address, the solicitation’s sender is performing address resolution on the target; the solicitation should be silently ignored. Otherwise, processing takes place as described below. In all cases, a node MUST NOT respond to a Neighbor Solicitation for a tentative address.

当接口接收到一条有效的邻居请求(Neighbor Solicitation)**消息时,节点的行为依赖于目标地址是否为**试探性地址(tentative address)

  • 如果目标地址不是试探性的(即已分配给接收接口),该请求将按照 [RFC4861] 的规则处理;
  • 如果目标地址是试探性的,且源地址是单播地址,说明该消息是发送方在进行地址解析,应静默忽略此消息;
  • 其他情况则按以下描述处理。

无论何种情况,节点绝不能对一个试探性地址的邻居请求作出响应


If the source address of the Neighbor Solicitation is the unspecified address, the solicitation is from a node performing Duplicate Address Detection. If the solicitation is from another node, the tentative address is a duplicate and should not be used (by either node). If the solicitation is from the node itself (because the node loops back multicast packets), the solicitation does not indicate the presence of a duplicate address.

如果邻居请求的源地址是未指定地址 ::,则该请求是由节点执行**重复地址检测(DAD)**发出的。

  • 如果该请求来自另一个节点,则说明这个试探性地址存在冲突(duplicate),不应被使用(两个节点都不应使用)。
  • 如果该请求是节点自身环回的多播包,则不表示有重复地址存在

Implementer’s Note: many interfaces provide a way for upper layers to selectively enable and disable the looping back of multicast packets. The details of how such a facility is implemented may prevent Duplicate Address Detection from working correctly. See Appendix A for further discussion.

**实现者注意(Implementer’s Note):*许多接口提供了是否允许多播包环回的设置。
该功能的具体实现方式*可能会影响 DAD(重复地址检测)的正确运行
,详见附录 A 的进一步讨论。


The following tests identify conditions under which a tentative address is not unique:

以下测试用于识别试探性地址不唯一(即存在重复)的条件:

  • If a Neighbor Solicitation for a tentative address is received before one is sent, the tentative address is a duplicate.
    如果在本节点发送请求前就收到针对某个试探性地址的 NS 消息,则该地址是重复的。
    这种情况通常发生在两个节点同时进行 DAD,但因选取的随机延迟不同,发送时间略有差异。
  • If the actual number of Neighbor Solicitations received exceeds the number expected based on the loopback semantics, the tentative address is a duplicate.
    如果收到的 NS 消息数量超过根据环回语义预期的数量,则说明地址冲突。
    比如接口并不支持环回,但却收到了 1 条或多条 NS 消息,这就表明网络中还有其他节点在检测相同地址。

5.4.4. Receiving Neighbor Advertisement Messages

接收邻居通告消息

On receipt of a valid Neighbor Advertisement message on an interface, node behavior depends on whether the target address is tentative or matches a unicast or anycast address assigned to the interface:

当接口接收到一条**有效的邻居通告(Neighbor Advertisement)**消息时,节点的行为取决于通告中目标地址的状态:

  1. If the target address is tentative, the tentative address is not unique.
    如果目标地址是试探性的,说明该地址是重复的。
  2. If the target address matches a unicast address assigned to the receiving interface,
    it would possibly indicate that the address is a duplicate but it has not been detected by the Duplicate Address Detection procedure
    (recall that Duplicate Address Detection is not completely reliable).
    How to handle such a case is beyond the scope of this document.
    如果目标地址与本接口分配的某个单播地址匹配,可能意味着该地址存在冲突,但尚未被 DAD 检测出来。
    (需要注意,DAD 机制并不是完全可靠的。)
    这种情况的处理方式超出本文件的讨论范围
  3. Otherwise, the advertisement is processed as described in [RFC4861].
    否则,按照 [RFC4861] 的处理逻辑处理该通告消息。

5.4.5. When Duplicate Address Detection Fails

当重复地址检测失败时

A tentative address that is determined to be a duplicate as described above MUST NOT be assigned to an interface, and the node SHOULD log a system management error.

被检测为冲突的试探性地址,绝不能分配到接口上使用,节点应记录一条系统管理错误日志。


If the address is a link-local address formed from an interface identifier based on the hardware address, which is supposed to be uniquely assigned (e.g., EUI-64 for an Ethernet interface), IP operation on the interface SHOULD be disabled.

如果该地址是根据硬件地址(如 Ethernet 的 EUI-64)派生出的链路本地地址(link-local address),而硬件地址本应具有全局唯一性,
那么该接口的 IP 协议栈应被禁用


By disabling IP operation, the node will then:

禁用 IP 协议栈后,节点将执行以下操作:

  • not send any IP packets from the interface,
    不再从该接口发送任何 IP 数据包
  • silently drop any IP packets received on the interface,
    静默丢弃从该接口接收到的所有 IP 数据包
  • not forward any IP packets to the interface (when acting as a router or processing a packet with a Routing header).
    不会将任何 IP 数据包转发到该接口(无论作为路由器还是处理带路由扩展头的数据包时)。

In this case, the IP address duplication probably means duplicate hardware addresses are in use, and trying to recover from it by configuring another IP address will not result in a usable network.

在这种情况下,IP 地址冲突很可能意味着硬件地址重复使用
此时尝试通过重新配置另一个 IP 地址来恢复网络并不会产生可用的结果。


In fact, it probably makes things worse by creating problems that are harder to diagnose than just disabling network operation on the interface; the user will see a partially working network where some things work, and other things do not.

实际上,这样做(分配新地址)反而会使问题更难排查 —— 用户可能会看到“部分可用”的网络,有些服务能用,有些服务失效,
比起直接禁用接口的网络功能更容易造成混乱。


On the other hand, if the duplicate link-local address is not formed from an interface identifier based on the hardware address, which is supposed to be uniquely assigned, IP operation on the interface MAY be continued.

另一方面,如果冲突的链路本地地址并非由应唯一的硬件地址派生而来,则可以继续启用接口上的 IP 协议栈


Note: as specified in Section 2, “IP” means “IPv6” in the above description. While the background rationale about hardware address is independent of particular network protocols, its effect on other protocols is beyond the scope of this document.

**注意:**如第 2 节所述,此处提到的 “IP” 指的是 “IPv6”。
虽然背景中涉及的硬件地址问题与特定网络协议无关,但其对其他协议的影响超出本文档的范围。

5.5. Creation of Global Addresses

全局地址的生成

Global addresses are formed by appending an interface identifier to a prefix of appropriate length. Prefixes are obtained from Prefix Information options contained in Router Advertisements. Creation of global addresses as described in this section SHOULD be locally configurable. However, the processing described below MUST be enabled by default.

全局地址(Global Address)**是通过将**接口标识符(Interface Identifier)**追加到一个**适当长度的前缀(Prefix)**后生成的。
该前缀来自**路由通告(Router Advertisement, RA)消息
中的前缀信息选项(Prefix Information Option)

按照本节所述方式生成全局地址,应当允许本地配置(SHOULD)。
但无论如何,以下描述的处理逻辑必须默认启用(MUST)。


5.5.1. Soliciting Router Advertisements

请求路由通告

Router Advertisements are sent periodically to the all-nodes multicast address. To obtain an advertisement quickly, a host sends out Router Solicitations as described in [RFC4861].

路由通告(RA)**会周期性地发送到**全节点多播地址(all-nodes multicast address)(即 ff02::1)。

为了尽快获取 RA 信息,主机可以主动发送路由请求(Router Solicitation, RS),方式详见 [RFC4861]。

5.5.2. Absence of Router Advertisements

缺少路由通告(RA)

Even if a link has no routers, the DHCPv6 service to obtain addresses may still be available, and hosts may want to use the service. From the perspective of autoconfiguration, a link has no routers if no Router Advertisements are received after having sent a small number of Router Solicitations as described in [RFC4861].

即使链路上没有路由器,获取地址的 DHCPv6 服务仍可能可用,主机也可能希望使用该服务。
从**自动配置(autoconfiguration)**的角度看,若在发送少量路由请求(Router Solicitation, RS)之后未接收到任何路由通告(RA),则认为链路上无路由器(如 [RFC4861] 所述)。

Note that it is possible that there is no router on the link in this sense, but there is a node that has the ability to forward packets. In this case, the forwarding node’s address must be manually configured in hosts to be able to send packets off-link, since the only mechanism to configure the default router’s address automatically is the one using Router Advertisements.

注意,这种“没有路由器”的情形并不排除存在具有转发能力的节点
此时,由于默认网关地址的自动配置机制仅依赖于 RA,主机必须手动配置该转发节点的地址以实现链路外通信。


5.5.3. Router Advertisement Processing

路由通告的处理流程

当收到 RA 包中的 Prefix Information(前缀信息选项)时,按以下步骤处理每个前缀:

a)

If the Autonomous flag is not set, silently ignore the Prefix Information option.

若未设置Autonomous 标志位,则忽略该前缀信息选项

b)

If the prefix is the link-local prefix, silently ignore the Prefix Information option.

若前缀为链路本地前缀(link-local prefix),则忽略该前缀信息选项

c)

If the preferred lifetime is greater than the valid lifetime, silently ignore the Prefix Information option. A node MAY wish to log a system management error in this case.

Preferred Lifetime(首选生命周期)大于 Valid Lifetime(有效生命周期),也应忽略该前缀信息。实现可以记录系统错误日志以便诊断。

d)

If the prefix advertised is not equal to the prefix of an address configured by stateless autoconfiguration already in the list…

如果通告的前缀与接口上已由无状态自动配置分配的地址的前缀不同,且该前缀的 Valid Lifetime ≠ 0:

则应根据以下格式组合地址

mathematica复制编辑|     128-N bits      |     N bits     |
+---------------------+----------------+
|     Prefix          | Interface ID   |
+--------------------------------------+
  • 若前缀长度与接口 ID 长度之和 ≠ 128 bits,应忽略该前缀信息选项并可记录系统日志。
  • 接口标识符的长度由链路类型特定文档定义,应与 [RFC4291] 一致。
  • 系统管理员应确保 RA 中的前缀长度与接口 ID 长度匹配
  • 若成功生成新地址且地址不在现有地址列表中,则应将其添加,并初始化其首选和有效生命周期。

⚠️ 注意:该步骤开头的前缀检查无法保证检测所有地址冲突。例如,手动配置或 DHCPv6 获取的地址也可能恰好和新地址冲突(尽管不常见)。

e)

If the advertised prefix equals the prefix of an existing autoconfigured address…

如果通告的前缀与接口上已存在的无状态自动配置地址的前缀相同:

  • 更新该地址的 Preferred Lifetime 为新通告中的值。
  • Valid Lifetime 的更新规则如下(RemainingLifetime 表示该地址剩余有效时间):

If received Valid Lifetime > 2 小时 或 > RemainingLifetime:
将该地址的 Valid Lifetime 设为收到的值。

If RemainingLifetime ≤ 2 小时,忽略通告中的 Valid Lifetime,除非该 RA 被认证(如通过 Secure ND)

否则,将 Valid Lifetime 重置为 2 小时。

该机制用于防止拒绝服务(DoS)攻击,例如恶意节点发送短生命周期的前缀,使地址过早失效。

⚠️ 无论是否忽略 Valid Lifetime,Preferred Lifetime 总是会被更新。
因为人为设短 Preferred Lifetime 用于弃用地址是合理行为。


5.5.4. Address Lifetime Expiry

地址生命周期到期处理

A preferred address becomes deprecated when its preferred lifetime expires.

当地址的 Preferred Lifetime 到期,该地址将进入弃用状态(deprecated)

A deprecated address SHOULD continue to be used as a source address in existing communications…

弃用地址应继续用于现有连接中的源地址,但不应在新连接中使用,如果可选用非弃用地址则应优先使用。

… this may be an application-specific decision…

新连接是否改用非弃用地址,也取决于具体应用逻辑。某些应用可能仍要求继续使用原 IP(例如为维持会话绑定)。

Protocol stack MUST accept packets destined to a deprecated address…

协议栈(包括 IP 层及上层如 TCP/UDP)必须继续正常处理发送至弃用地址的包
例如,TCP 的 SYN 请求仍应返回 SYN-ACK。

An implementation MAY prevent any new communication from using a deprecated address…

实现可以阻止新通信使用弃用地址,但必须允许系统管理员关闭该行为,且默认应关闭。

… address selection … is described in [RFC3484]…

地址选择的细节(如在小作用域弃用地址 vs. 非弃用全局地址之间选择)属于 [RFC3484] 的范畴。

An address becomes invalid when its valid lifetime expires…

当地址的 Valid Lifetime 到期后,它变为无效地址(invalid address),此时:

  • 不得再用作源地址
  • 不得作为目标地址被接受
5.6 Configuration Consistency 配置一致性

It is possible for hosts to obtain address information using both stateless autoconfiguration and DHCPv6 since both may be enabled at the same time.

由于**无状态自动配置(stateless autoconfiguration)**和 DHCPv6 可以同时启用,主机可能会同时通过两种方式获取地址信息。

It is also possible that the values of other configuration parameters, such as MTU size and hop limit, will be learned from both Router Advertisements and DHCPv6.

其他配置参数(例如 MTU 大小跳数限制(hop limit))也可能同时来自 路由器通告(RA)DHCPv6

If the same configuration information is provided by multiple sources, the value of this information should be consistent.

如果多个来源提供相同的配置信息,则这些信息的取值应该保持一致。

However, it is not considered a fatal error if information received from multiple sources is inconsistent.

但如果这些信息之间存在不一致,也不会被认为是致命错误

Hosts accept the union of all information received via Neighbor Discovery and DHCPv6.

主机会接受通过 邻居发现协议(Neighbor Discovery)DHCPv6 获得的所有信息的并集


If inconsistent information is learned from different sources, an implementation may want to give information learned securely precedence over information learned without protection.

如果从不同来源获取到了不一致的信息,实现可以选择优先使用通过安全机制获得的信息,而不是未受保护的信息。

For instance, Section 8 of [RFC3971] discusses how to deal with information learned through Secure Neighbor Discovery conflicting with information learned through plain Neighbor Discovery.

例如,[RFC3971] 第 8 节讨论了当通过安全邻居发现(Secure ND)**获得的信息与**普通邻居发现产生冲突时的处理方式。

The same discussion can apply to the preference between information learned through plain Neighbor Discovery and information learned via secured DHCPv6, and so on.

同样的原则也可以应用于:普通 ND 与安全 DHCPv6 所获取信息之间的优先级选择等情形。


In any case, if there is no security difference, the most recently obtained values SHOULD have precedence over information learned earlier.

无论如何,如果没有安全性上的区别,则最近获得的值应当优先于早先获得的信息


5.7 Retaining Configured Addresses for Stability 为稳定性保留已配置地址

An implementation that has stable storage may want to retain addresses in the storage when the addresses were acquired using stateless address autoconfiguration.

具有**稳定存储(stable storage)**能力的实现可以在通过无状态地址自动配置获取地址时,将这些地址保存在存储中。

Assuming the lifetimes used are reasonable, this technique implies that a temporary outage (less than the valid lifetime) of a router will never result in losing a global address of the node even if the node were to reboot.

在使用了**合理的生命周期(Lifetime)**的前提下,即使**路由器短暂离线(小于有效期)*或节点*重启,这种机制也可保证节点不会丢失其全局地址。

When this technique is used, it should also be noted that the expiration times of the preferred and valid lifetimes must be retained, in order to prevent the use of an address after it has become deprecated or invalid.

采用此机制时,必须保留**首选有效期(Preferred Lifetime)有效期(Valid Lifetime)**的到期时间,以防止主机在地址已被弃用或失效后继续使用该地址。

Further details on this kind of extension are beyond the scope of this document.

这类扩展机制的更多细节超出本文档的范围


6 Security Considerations 安全性考量

Stateless address autoconfiguration allows a host to connect to a network, configure an address, and start communicating with other nodes without ever registering or authenticating itself with the local site.

无状态地址自动配置允许主机在无需注册或认证本地网络的情况下连接网络、配置地址并与其他节点通信。

Although this allows unauthorized users to connect to and use a network, the threat is inherently present in the Internet architecture.

尽管这种机制也可能使未授权用户接入并使用网络,但这种威胁在互联网架构中是固有存在的。

Any node with a physical attachment to a network can generate an address (using a variety of ad hoc techniques) that provides connectivity.

任何物理连接到网络的节点都可以通过多种临时手段生成地址并建立连接。


The use of stateless address autoconfiguration and Duplicate Address Detection opens up the possibility of several denial-of-service attacks.

使用无状态地址自动配置和**重复地址检测(DAD)**可能导致多种 拒绝服务攻击(DoS)

For example, any node can respond to Neighbor Solicitations for a tentative address, causing the other node to reject the address as a duplicate.

例如,任意节点都可以响应另一个节点的邻居请求(Neighbor Solicitation),使对方误以为地址已被占用,从而拒绝使用该地址。

A separate document [RFC3756] discusses details about these attacks, which can be addressed with the Secure Neighbor Discovery protocol [RFC3971].

另一份文档 [RFC3756] 对这些攻击进行了详细讨论,并指出可以通过 安全邻居发现协议(Secure ND, RFC3971) 来缓解这些问题。

It should also be noted that [RFC3756] points out that the use of IP security is not always feasible depending on network environments.

还应注意,[RFC3756] 指出,根据网络环境不同,使用 IPsec(IP 安全协议)并不总是可行

Appendix A. Loopback Suppression and Duplicate Address Detection

附录 A. 回环抑制(Loopback Suppression)与重复地址检测(Duplicate Address Detection, DAD)

Determining whether a received multicast solicitation was looped back to the sender or actually came from another node is implementation-dependent.

判定接收到的多播请求是否是从本机回环返回,还是来自其他节点,取决于具体实现

A problematic case occurs when two interfaces attached to the same link happen to have the same identifier and link-layer address, and they both send out packets with identical contents at roughly the same time (e.g., Neighbor Solicitations for a tentative address as part of Duplicate Address Detection messages).

一种较为棘手的情况是:连接到同一链路的两个接口,碰巧具有相同的标识符(identifier)**和**链路层地址(link-layer address),并且它们几乎在同一时间发送出内容完全相同的数据包(例如,在重复地址检测中发送的邻居请求报文)。

Although a receiver will receive both packets, it cannot determine which packet was looped back and which packet came from the other node simply by comparing packet contents (i.e., the contents are identical).

尽管接收方会接收到这两个数据包,但仅凭内容比较(因为内容完全一样)无法判断哪个是回环的数据包、哪个来自其他节点。

In this particular case, it is not necessary to know precisely which packet was looped back and which was sent by another node; if one receives more solicitations than were sent, the tentative address is a duplicate.

在这种特定情况下,不需要准确区分哪个数据包是回环的,哪个是外部的;只要接收到的邻居请求数量大于自身发送的数量,则说明这个试验地址是重复的。

However, the situation may not always be this straightforward.

但实际情况并不总是如此简单


The IPv4 multicast specification [RFC1112] recommends that the service interface provide a way for an upper-layer protocol to inhibit local delivery of packets sent to a multicast group that the sending host is a member of.

IPv4 多播规范 [RFC1112] 建议,服务接口应提供一种机制,使得上层协议可以抑制对本地主机自己作为成员的多播组所发送数据包的本地递送(loopback)。

Some applications know that there will be no other group members on the same host, and suppressing loopback prevents them from having to receive (and discard) the packets they themselves send out.

一些应用程序知道在同一主机上没有其他组成员,因此抑制回环可以避免它们收到并丢弃自己发出的数据包。

A straightforward way to implement this facility is to disable loopback at the hardware level (if supported by the hardware), with packets looped back (if requested) by software.

一种直接的实现方式是:在硬件层面禁用回环(如果硬件支持),并由软件决定是否回环。

On interfaces in which the hardware itself suppresses loopbacks, a node running Duplicate Address Detection simply counts the number of Neighbor Solicitations received for a tentative address and compares them with the number expected.

在硬件自身能抑制回环的接口上,运行重复地址检测的节点只需统计收到的针对试验地址的邻居请求数量,并与期望数量进行比较。

If there is a mismatch, the tentative address is a duplicate.

如果数量不匹配,则该试验地址为重复地址


In those cases where the hardware cannot suppress loopbacks, however, one possible software heuristic to filter out unwanted loopbacks is to discard any received packet whose link-layer source address is the same as the receiving interface’s.

但如果硬件无法抑制回环,一种可能的软件启发式方法是:丢弃那些源链路层地址与接收接口相同的数据包

There is even a link-layer specification that requires that any such packets be discarded [IEEE802.11].

甚至有链路层规范(如 [IEEE802.11])要求必须丢弃此类数据包


Unfortunately, use of that criteria also results in the discarding of all packets sent by another node using the same link-layer address.

不幸的是,采用这种标准也会导致丢弃来自其他使用相同链路层地址节点发送的所有数据包

Duplicate Address Detection will fail on interfaces that filter received packets in this manner:

如果接口采用这种方式过滤接收包,重复地址检测将失败


o If a node performing Duplicate Address Detection discards received packets that have the same source link-layer address as the receiving interface, it will also discard packets from other nodes that also use the same link-layer address, including Neighbor Advertisement and Neighbor Solicitation messages required to make Duplicate Address Detection work correctly.

  • 如果一个节点在执行 DAD 时丢弃那些源链路层地址与本接口相同的包,那么它也会丢弃其他节点使用相同链路层地址发送的包,包括重复地址检测所必需的邻居通告(NA)和邻居请求(NS)报文

This particular problem can be avoided by temporarily disabling the software suppression of loopbacks while a node performs Duplicate Address Detection, if it is possible to disable the suppression.

  • 如果可以临时禁用回环抑制,则在节点执行 DAD 时暂时关闭回环抑制机制可以避免此类问题。

o If a node that is already using a particular IP address discards received packets that have the same link-layer source address as the interface, it will also discard Duplicate Address Detection-related Neighbor Solicitation messages sent by another node that also use the same link-layer address.

  • 如果某个节点已在使用某个 IP 地址,并丢弃所有源链路层地址与本接口相同的包,那么它也会丢弃其他使用相同链路层地址的节点发送的 DAD 相关 NS 报文

Consequently, Duplicate Address Detection will fail, and the other node will configure a non-unique address.

  • 结果就是,重复地址检测失败,另一个节点可能会配置一个非唯一地址

Since it is generally impossible to know when another node is performing Duplicate Address Detection, this scenario can be avoided only if software suppression of loopback is permanently disabled.

  • 因为无法预知其他节点何时进行 DAD,所以只能通过永久禁用软件回环抑制来避免这种情况

Thus, to perform Duplicate Address Detection correctly in the case where two interfaces are using the same link-layer address, an implementation must have a good understanding of the interface’s multicast loopback semantics, and the interface cannot discard received packets simply because the source link-layer address is the same as the interface’s.

因此,若两个接口使用相同的链路层地址,为了正确执行 DAD,实现方必须充分理解该接口的多播回环语义不能仅仅因为源链路层地址与本接口相同就丢弃接收到的包

It should also be noted that a link-layer specification can conflict with the condition necessary to make Duplicate Address Detection work.

还应注意,某些链路层规范可能与 DAD 的正确工作条件存在冲突

http://www.xdnf.cn/news/774595.html

相关文章:

  • [蓝桥杯]交换次数
  • 《汇编语言》第13章 int指令——实验13 编写、应用中断例程
  • Redis持久化机制详解:RDB与AOF的深度剖析
  • 麒麟信安安装谷歌浏览器
  • 计算机视觉---深度学习框架(Backbone、Neck、Head)
  • webpack和vite的区别
  • 技术博客:线程池的暗礁——Executors工厂类为何成为Java高并发系统的禁忌
  • 探秘Transformer系列之(35)--- 大模型量化基础
  • node-sass 报错
  • 第二章 AI大模型接入
  • jquery复习
  • MySQL指令个人笔记
  • 【笔记】在 MSYS2 MINGW64 环境中降级 NumPy 2.2.6 到 2.2.4
  • RocketMQ介绍与部署
  • 动中通天线跟踪性能指标的测试
  • 显示即战略:铁电液晶如何成为 “数字中国” 的 “像素基石”?
  • Python训练营打卡 Day43
  • 【数据集】不同情景下全球城市扩张(2050年)
  • 嵌入式开发之STM32学习笔记day16
  • 初识Linux指令(笔记2)
  • Python_day43
  • 408考研逐题详解:2009年第28题
  • MCP调研
  • 揭秘 CompletedFuture 的设计精髓(基础)
  • 打卡day43
  • 第12次09:展示收货地址和新增地址
  • 基于vue3-elemenyui的动态列案例
  • 【C语言入门级教学】assert断⾔和指针的使用
  • linux学习第18天(fork函数)
  • 代码随想录算法训练营第六天| 242.有效的字母异位词 、 349. 两个数组的交集 、 202. 快乐数 、1. 两数之和