17 · Introducing Basic IPv6IPv6 基礎介紹

IPv6 Addresses and Address TypesIPv6 位址與位址類型

IPv6 addresses consist of 128 bits and are represented as a series of eight 16-bit hexadecimal fields separated by colons. Although the upper and lowercase is permitted, it is best practice to use lowercase for IPv6 representation:

IPv6 位址由 128 位元組成,以八組 16 位元十六進位欄位並以冒號分隔的方式表示。雖然大小寫都允許,但最佳做法是在 IPv6 表示法中使用小寫:

Address representation

位址表示法

  • Format is x:x:x:x:x:x:x:x, where x is a 16-bit hexadecimal field.格式為 x:x:x:x:x:x:x:x,其中 x 為 16 位元十六進位欄位。
    • Example: 2001:0db8:010f:0001:0000:0000:0000:0acd範例:2001:0db8:010f:0001:0000:0000:0000:0acd
  • Leading zeros in a field can be omitted.欄位中的前導零可以省略。
    • Example: 2001:db8:10f:1:0:0:0:acd範例:2001:db8:10f:1:0:0:0:acd
  • Successive fields of 0 are represented as "::" but only once in an address.連續為 0 的欄位可以用「::」表示,但一個位址中只能出現一次。
    • Example: 2001:db8:10f:1::acd範例:2001:db8:10f:1::acd

Here are two ways to shorten the writing of IPv6 addresses:

以下是縮寫 IPv6 位址的兩種方式:

  • The leading zeros in a field can be omitted, so that 010f can be written as 10f. A field that contains all zeros (0000) can be written as 0.欄位中的前導零可以省略,因此 010f 可以寫成 10f。全部為零的欄位(0000)可以寫成 0。
  • Successive fields of zeros can be represented as a double colon (::) but only once in an address. An address parser can identify the number of missing zeros by separating the two parts and filling in zeros until the 128 bits are completed. However, if two double colons are placed in the address, there is no way to identify the size of each block of zeros. Therefore, only one double colon is possible in a valid IPv6 address.連續為零的欄位可以用雙冒號(::)表示,但一個位址中只能出現一次。位址解析器可以透過分隔兩個部分並填入零,直到湊滿 128 位元,來判斷缺少的零的數量。然而,如果位址中放置了兩個雙冒號,就無法判斷各段零的大小。因此,一個有效的 IPv6 位址中只能有一個雙冒號。

The use of the double-colon technique makes many addresses very small; for example, ff01:0:0:0:0:0:0:1 becomes ff01::1. The all-zeros address is written as a double colon; this type of address representation is known as the unspecified address.

使用雙冒號技巧可以讓許多位址變得非常短;例如,ff01:0:0:0:0:0:0:1 會變成 ff01::1。全零位址寫成雙冒號;這種位址表示法稱為未指定位址。

IPv6 Address Types

IPv6 位址類型

IPv6 supports three basic types of addresses. Each address type has specific rules regarding its construction and use. These types of addresses are:

IPv6 支援三種基本位址類型。每種位址類型在建構與使用上都有特定規則。這些位址類型為:

  • Unicast: Unicast addresses are used in a one-to-one context.單播(Unicast):單播位址用於一對一的情境。
  • Multicast: A multicast address identifies a group of interfaces. Traffic that is sent to a multicast address is sent to multiple destinations at the same time. An interface may belong to any number of multicast groups.群播(Multicast):群播位址識別一組介面。傳送到群播位址的流量會同時傳送到多個目的地。一個介面可以屬於任意數量的群播群組。
  • Anycast: An IPv6 anycast address is assigned to an interface on more than one node. When a packet is sent to an anycast address, it is routed to the nearest interface that has this address. The nearest interface is found according to the measure of metric of the particular routing protocol that is running. All nodes that share the same address should behave the same way so that the service is offered similarly, regardless of the node that services the request.任播(Anycast):IPv6 任播位址會指派給多個節點上的介面。當封包傳送到任播位址時,會被路由到擁有此位址的最近介面。最近的介面是依據所執行路由協定的度量值來判斷。共用同一位址的所有節點行為都應相同,讓服務不論由哪個節點來處理請求都保持一致。

IPv6 does not support broadcast addresses in the way that they are used in IPv4. Instead, specific multicast addresses (such as the all-nodes multicast address) are used.

IPv6 不支援 IPv4 那種廣播位址的用法,而是使用特定的群播位址(例如全節點群播位址)。

IPv6 unicast addresses are assigned to each node (interface). Their uses are discussed in RFC 4291. The unicast addresses are listed below.

IPv6 單播位址會指派給每個節點(介面)。其用法於 RFC 4291 中討論。以下列出單播位址。

Address
位址
Value
Description
說明
Global Unicast
全球單播(Global Unicast)
2000::/3
2000::/3
Assigned by Internet Assigned Numbers Authority (IANA) and used on public networks. They are equivalent to IPv4 global (public) addresses. ISPs summarize these to provide scalability on the internet.
由網際網路號碼分配機構(IANA)指派,用於公共網路。相當於 IPv4 的全球(公開)位址。ISP 會將這些位址彙總,以在網際網路上提供可擴充性。
Link-local
鏈路本地(Link-local)
fe80::/10
fe80::/10
An automatically configured IPv6 address on an interface, the scope is only on the physical link, and is required.
在介面上自動設定的 IPv6 位址,範圍僅限於實體鏈路,且為必要位址。
Unique-Local
唯一本地(Unique-Local)
fc00::/7
fc00::/7
Unique local unicast addresses are analogous to private IPv4 addresses in that they are used for local communications. The scope is the entire site or organization.
唯一本地單播位址類似於 IPv4 的私有位址,用於本地通訊。其範圍為整個站台或組織。
Address
位址
Value
Description
說明
Loopback
回送(Loopback)
::1
::1
Like the 127.0.0.1 address in IPv4, 0:0:0:0:0:0:0:1, or ::1, is used for local testing functions. Unlike IPv4, which dedicates a complete A class block of addresses for local testing, IPv6 uses only one.
如同 IPv4 中的 127.0.0.1,0:0:0:0:0:0:0:1 或 ::1 用於本地測試功能。與 IPv4 為本地測試保留整個 A 級位址區塊不同,IPv6 只使用一個位址。
Unspecified
未指定(Unspecified)
::
::
0.0.0.0 in IPv4 means "unknown" address. In IPv6, this address is represented by 0:0:0:0:0:0:0:0 or ::, and it is typically used in the source address field of the packet when an interface does not have an address and is trying to acquire one dynamically.
IPv4 中的 0.0.0.0 代表「未知」位址。在 IPv6 中,此位址以 0:0:0:0:0:0:0:0 或 :: 表示,通常用於封包的來源位址欄位,在介面尚未取得位址且正嘗試動態取得位址時使用。

IPv6 Address Scopes and Prefixes

IPv6 位址範圍與前綴

To fully understand IPv6 addressing, it is important to have a solid understanding of IPv6 scopes and prefixes. An IPv6 address scope specifies the region of the network in which the address is valid. For example, the link-local address has a scope that is called "link-local," which means that it is valid and should be used on a directly attached network (link). Scopes can apply to both unicast and multicast addresses. There are several different scopes or regions: the link scope, organization scope, and global network scope.

要充分理解 IPv6 定址,必須紮實掌握 IPv6 範圍(scope)與前綴的概念。IPv6 位址範圍指出該位址在網路中有效的區域。例如,鏈路本地位址的範圍稱為「鏈路本地」,代表它僅在直接相連的網路(鏈路)上有效並使用。範圍可套用於單播與群播位址。範圍或區域有數種:鏈路範圍、組織範圍與全球網路範圍。

Addresses in the link scope are called link-local addresses, and routers will not forward these addresses to other links or networks. Addresses intended to span multiple sites belonging to one organization are called organization-local addresses, and addresses in the global network scope are called global unicast addresses.

鏈路範圍內的位址稱為鏈路本地位址,路由器不會將這些位址轉發到其他鏈路或網路。跨越屬於同一組織之多個站台的位址稱為組織本地位址,而全球網路範圍內的位址則稱為全球單播位址。

Multiple IPv6 Addresses on an Interface

介面上的多個 IPv6 位址

As with IPv4, IPv6 addresses are assigned to interfaces; however, unlike IPv4, an IPv6 interface is expected to have multiple addresses. The IPv6 addresses that are assigned to an interface can be any of the basic types: unicast, multicast, or anycast.

與 IPv4 相同,IPv6 位址也會指派給介面;但與 IPv4 不同的是,一個 IPv6 介面通常會有多個位址。指派給介面的 IPv6 位址可以是任一種基本類型:單播、群播或任播。

IPv6 Unicast Addresses

IPv6 單播位址

An IPv6 unicast address generally uses 64 bits for the network ID and 64 bits for the interface ID. The network ID is administratively assigned, and the interface ID can be configured manually or autoconfigured.

IPv6 單播位址通常使用 64 位元作為網路 ID、64 位元作為介面 ID。網路 ID 由管理者指派,介面 ID 可手動設定或自動設定。

Use of EUI-64 Format Interface ID in IPv6 Addresses

在 IPv6 位址中使用 EUI-64 格式的介面 ID

The interface ID in an IPv6 address is analogous to the host portion of an IPv4 address; it uniquely identifies an interface on a link. A 64-bit interface ID is not required but is highly recommended. However, a 64-bit interface ID is required when an IPv6 address is autoconfigured. One way to guarantee that the interface ID is unique is to base it on the MAC address of the interface.

IPv6 位址中的介面 ID 類似於 IPv4 位址中的主機部分;它唯一識別鏈路上的某個介面。64 位元介面 ID 並非必要,但強烈建議使用。然而,當 IPv6 位址是自動設定時,就必須使用 64 位元介面 ID。確保介面 ID 唯一的一種方式,是根據介面的 MAC 位址來產生它。

The Extended Universal Identifier 64-bit format (EUI-64) defines the method to create an interface identifier from an IEEE 48-bit MAC address. Since the EUI-64 format is based on unique MAC addresses, using this format, a device can automatically assign itself a unique 64-bit IPv6 interface ID without the need for manual configuration or DHCP. The following figure illustrates this process:

延伸通用識別碼 64 位元格式(EUI-64)定義了如何從 IEEE 48 位元 MAC 位址建立介面識別碼的方法。由於 EUI-64 格式是基於唯一的 MAC 位址,使用此格式,裝置可以自動指派自己唯一的 64 位元 IPv6 介面 ID,而不需要手動設定或 DHCP。下圖說明了這個過程:

The EUI-64 format interface ID is derived from the 48-bit MAC address by inserting the hexadecimal number fffe between the upper 3 bytes (OUI field) and the lower 3 vendor assigned bytes of the MAC address. Then, the seventh bit from the left of the first octet, or the universal/local (U/L) bit, is inverted. This bit defines whether this interface identifier is universally or locally administered. If after inverting the seventh bit is 0, the address is locally administered and if it's 1, the address is globally unique. It is worth noticing that in the OUI portion, the globally unique addresses assigned by the IEEE have always been set to 0 whereas the locally created addresses have 1 configured. Therefore, when the bit is inverted, it maintains its original scope (global unique address is still global unique and vice versa).

EUI-64 格式的介面 ID 是由 48 位元 MAC 位址推導而來,作法是在 MAC 位址的高 3 個位元組(OUI 欄位)與低 3 個廠商指派位元組之間插入十六進位數字 fffe。接著,將第一個八位元組從左數來的第七個位元,即通用/本地(U/L)位元反轉。此位元定義此介面識別碼是全域管理還是本地管理。若反轉第七個位元後為 0,則此位址為本地管理;若為 1,則此位址為全域唯一。值得注意的是,在 OUI 部分中,由 IEEE 指派的全域唯一位址一律將此位元設為 0,而本地建立的位址則設為 1。因此,當該位元反轉後,仍會維持其原本的範圍(全域唯一位址仍為全域唯一,反之亦然)。

IPv6 Global Unicast Address

IPv6 全球單播位址

Both IPv4 and IPv6 addresses are generally assigned in a hierarchical manner. ISPs assign users IP addresses. ISPs obtain allocations of IP addresses from a local internet registry (LIR) or National Internet Registry (NIR) or their appropriate RIR. The RIR, in turn, obtains IP addresses from The Internet Corporation for Assigned Names and Numbers (ICANN), the operator for IANA.

IPv4 與 IPv6 位址通常以階層方式指派。ISP 會將 IP 位址指派給使用者。ISP 則從本地網際網路註冊機構(LIR)或國家網際網路註冊機構(NIR),或其對應的區域網際網路註冊機構(RIR)取得 IP 位址配額。RIR 則從網際網路名稱與號碼分配機構(ICANN,IANA 的運作機構)取得 IP 位址。

RFC 4291 specifies the 2000::/3 prefix as the global unicast address space that the IANA may allocate to the RIRs. A global unicast address (GUA) is an IPv6 address created from the global unicast prefix. The structure of global unicast addresses enables the aggregation of routing prefixes, limiting the number of routing table entries in the global routing table. Global unicast addresses that are used on links are aggregated upward through organizations and eventually to the ISPs.

RFC 4291 將 2000::/3 前綴指定為全球單播位址空間,供 IANA 分配給各 RIR。全球單播位址(GUA)是由全球單播前綴建立的 IPv6 位址。全球單播位址的結構可讓路由前綴彙總,藉此限制全球路由表中的項目數量。用於鏈路上的全球單播位址會向上彙總,經由組織,最終到達 ISP。

The figure shows how address space can be allocated to the RIR and ISP. These values are minimum allocations, which means that an RIR will get a /23 or shorter, an ISP will get a /32 or shorter, and a site will get a /48 or shorter. A shorter prefix length allows more available address space. For example, a site could get a /40 instead of a /48, giving it more addresses to justify it to its ISP. The figure shows an aggregatable provider model where the end customer obtains its IPv6 address from the ISP. The end customer can also choose a provider-independent address space by going straight to the RIR. In this case, it is not uncommon for an end customer to justify a /32 prefix. The example in the figure uses the common and recommended size of the network with 64 bits used as interface ID.

下圖顯示位址空間如何分配給 RIR 與 ISP。這些數值為最低分配量,也就是說,一個 RIR 會取得 /23 或更短的前綴,一個 ISP 會取得 /32 或更短的前綴,一個站台則會取得 /48 或更短的前綴。前綴長度越短,可用位址空間就越多。例如,一個站台可以取得 /40 而非 /48,讓它有更多位址向 ISP 提出申請理由。圖中顯示一個可彙總的服務提供者模型,終端客戶從 ISP 取得其 IPv6 位址。終端客戶也可以選擇直接向 RIR 取得與提供者無關的位址空間。在此情況下,終端客戶要求 /32 前綴並不罕見。圖中的範例使用常見且建議的網路大小,以 64 位元作為介面 ID。

Global unicast addresses are routable and reachable across the internet. They are intended for widespread generic use. A global unicast address is structured hierarchically to allow address aggregation. In the 2000::/3 prefix, the /3 prefix length states that only the first 3 bits are significant in matching the prefix 2000. The first 3 bits of the first hexadecimal value, 2, are 001. The fourth bit is insignificant and can be either a 0 or a 1. Therefore, the first hex digit is either 2 (0010) or 3 (0011). The remaining 12 bits in the hextet (16-bit segment) can be a 0 or a 1. This results in a range of global unicast addresses from 2000:: through 3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff.

全球單播位址在網際網路上可路由且可到達,適用於廣泛的一般用途。全球單播位址採階層式結構,以利位址彙總。在 2000::/3 前綴中,/3 前綴長度表示只有前 3 個位元在比對前綴 2000 時有意義。第一個十六進位值 2 的前 3 個位元是 001。第四個位元無關緊要,可以是 0 或 1。因此,第一個十六進位數字可以是 2(0010)或 3(0011)。十六位元組(hextet,16 位元區段)中其餘 12 個位元可以是 0 或 1。這使得全球單播位址範圍為 2000:: 到 3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff。

A global routing prefix is assigned to a service provider by IANA. The fixed first three bits plus the following 45 bits identify the organizations site within the public domain.

全球路由前綴由 IANA 指派給服務提供者。固定的前 3 個位元加上後續 45 個位元,識別出組織在公有網域中的站台。

An individual organization can use a subnet ID to create its own local addressing hierarchy and identify subnets. A subnet ID is similar to a subnet in IPv4, except that an organization with an IPv6 subnet ID can support many more individual subnets (the actual number depends on the global routing prefix). An organization with a 16-bit IPv6 subnet ID can support up to 65,535 individual subnets.

個別組織可以使用子網路 ID 建立自己的本地定址階層並識別子網路。子網路 ID 類似於 IPv4 中的子網路,但擁有 IPv6 子網路 ID 的組織可以支援更多個別子網路(實際數量取決於全球路由前綴)。擁有 16 位元 IPv6 子網路 ID 的組織最多可支援 65,535 個個別子網路。

The interface ID has the same meaning for all unicast addresses. It is used to identify the interfaces on a link and must be unique to the link. The interface ID is 64 bits long and, depending on the device operating system, can be created using the EUI-64 format or by using a randomly generated number. An example of a global unicast address is 2001:0db8:bbbb:cccc:0987:65ff:fe01:2345.

介面 ID 對所有單播位址而言意義相同。它用來識別鏈路上的介面,且在該鏈路上必須是唯一的。介面 ID 長度為 64 位元,依裝置作業系統的不同,可以使用 EUI-64 格式產生,或使用隨機產生的數字。全球單播位址的範例為 2001:0db8:bbbb:cccc:0987:65ff:fe01:2345。

IPv6 Link-Local Unicast Address

IPv6 鏈路本地單播位址

Link-local addresses (LLAs) refer only to a particular physical link (physical network). The concept of the link-local scope is not new. RFC 3927 defined 169.254.x.x block as link-local for IPv4. Routers do not forward packets using link-local addresses, not even within the organization; they are only for local communication on a particular physical network segment.

鏈路本地位址(LLA)僅適用於特定的實體鏈路(實體網路)。鏈路本地範圍的概念並不新穎。RFC 3927 定義了 169.254.x.x 區塊作為 IPv4 的鏈路本地位址。路由器不會轉發使用鏈路本地位址的封包,即使在組織內部也不會;這些位址僅用於特定實體網路區段上的本地通訊。

A link-local address is an IPv6 unicast address that is automatically configured on any interface. This address is the first IPv6 address that will be enabled on the interface. A device does not have to have any other address but must have a link-local address. A link-local address consists of the link-local prefix fe80::/10 (1111 1110 10) and the interface identifier that can be modified in EUI-64 format or randomly generated value depending on the operating system installed on the networking device.

鏈路本地位址是一種會自動設定在任何介面上的 IPv6 單播位址。此位址是介面上將啟用的第一個 IPv6 位址。裝置不一定要有其他位址,但必須擁有鏈路本地位址。鏈路本地位址由鏈路本地前綴 fe80::/10(1111 1110 10)與介面識別碼組成,介面識別碼可依裝置所安裝的作業系統,以 EUI-64 格式修改或隨機產生。

It is common practice to statically configure link-local addresses on the router interfaces to make troubleshooting easier. Nodes on a local link can use link-local addresses to communicate; the nodes do not need globally unique addresses to communicate.

常見做法是在路由器介面上靜態設定鏈路本地位址,以方便疑難排解。同一本地鏈路上的節點可以使用鏈路本地位址通訊;這些節點不需要全球唯一位址即可通訊。

Link-local addresses are used for link communications such as automatic address configuration, neighbor discovery, and router discovery. Many IPv6 routing protocols also use link-local addresses. For static routing, the address of the next-hop device should be specified using the link-local address of the device; for dynamic routing, all IPv6 routing protocols must exchange the link-local addresses of neighboring devices.

鏈路本地位址用於鏈路通訊,例如自動位址設定、鄰居探索與路由器探索。許多 IPv6 路由協定也會使用鏈路本地位址。就靜態路由而言,下一跳裝置的位址應使用該裝置的鏈路本地位址指定;就動態路由而言,所有 IPv6 路由協定都必須交換相鄰裝置的鏈路本地位址。

An example of a link-local unicast address is fe80:0000:0000:0000:0987:65ff: fe01:2345, which would generally represent shorthand notation fe80::987:65ff:fe01:2345.

鏈路本地單播位址的範例為 fe80:0000:0000:0000:0987:65ff: fe01:2345,通常以簡寫表示為 fe80::987:65ff:fe01:2345。

IPv6 Unique Local Unicast Address

IPv6 唯一本地單播位址

Unique local unicast addresses are analogous to private IPv4 addresses in that they are used for local communications, intersite VPNs, and so on, except for one important difference—these addresses are not intended to be translated to a global unicast address. They are not routable on the internet without IPv6 NAT, but they are routable inside a limited area, such as a site. They may also be routed between a limited set of sites. A unique local unicast address has these characteristics:

唯一本地單播位址類似於 IPv4 的私有位址,用於本地通訊、站台間 VPN 等,唯一重要的差異是——這些位址並不打算轉換為全球單播位址。若不使用 IPv6 NAT,它們無法在網際網路上路由,但可以在有限區域(例如某個站台)內路由,也可能在有限的一組站台之間路由。唯一本地單播位址具有以下特性:

  • It has a globally unique prefix—it has a high probability of uniqueness.擁有全球唯一前綴——具有高機率的唯一性。
  • It has a well-known prefix to enable easy filtering at site boundaries.擁有廣為人知的前綴,便於在站台邊界進行過濾。
  • It allows combining or privately interconnecting sites without creating any address conflicts or requiring a renumbering of interfaces that use these prefixes.可讓站台合併或私下互連,而不會產生位址衝突,也不需要重新編號使用這些前綴的介面。
  • It is ISP-independent and can be used for communications inside a site without having any permanent or intermittent internet connectivity.不依賴 ISP,可用於站台內部通訊,不需要永久或間歇性的網際網路連線。
  • If it is accidentally leaked outside of a site via routing or the Domain Name System, there is no conflict with any other addresses.若因路由或網域名稱系統而意外洩漏到站台外,也不會與其他位址發生衝突。
  • Applications may treat unique local addresses like globally scoped addresses.應用程式可以將唯一本地位址視為全球範圍位址處理。

In unique local unicast addresses, global IDs are defined by the administrator of the local domain. Subnet IDs are also defined by the administrator of the local domain. Subnet IDs are typically defined using a hierarchical addressing plan, allowing routes to be summarized and, therefore, reducing the size of routing updates and routing tables. An example of a unique local unicast address is fc00:aaaa:bbbb:cccc:0987:65ff:fe01:2345.

在唯一本地單播位址中,全域 ID 由本地網域的管理者定義。子網路 ID 也由本地網域的管理者定義。子網路 ID 通常依階層式定址方案定義,讓路由可以彙總,進而縮小路由更新與路由表的規模。唯一本地單播位址的範例為 fc00:aaaa:bbbb:cccc:0987:65ff:fe01:2345。

Loopback Addresses

回送位址

Just as with IPv4, a provision has been made for a special loopback IPv6 address for testing. Packets that are sent to this address "loop back" to the sending device. However, in IPv6, there is just one address, not a whole block, for this function. The loopback address is 0:0:0:0:0:0:0:1, which is normally expressed as "::1."

與 IPv4 相同,IPv6 也提供了一個特殊的回送位址供測試使用。傳送到此位址的封包會「回送」到傳送裝置。然而,在 IPv6 中,此功能只有一個位址,而非整個區塊。回送位址為 0:0:0:0:0:0:0:1,通常以「::1」表示。

Unspecified Addresses

未指定位址

In IPv4, an IPv4 address containing all zeroes has a special meaning—it refers to the host itself and is used as a source address to indicate the absence of an address. In IPv6, this concept has been formalized, and the all-zeros address is named the unspecified address. It is typically used in the source field of a packet sent by a device requesting to have its IPv6 address configured. You can apply address compression to this address. Because the address is all zeroes, the address is simply expressed by two colons (::).

在 IPv4 中,全部為零的 IPv4 位址具有特殊意義——代表主機本身,用作來源位址以表示沒有位址。在 IPv6 中,這個概念已被正式化,全零位址被命名為未指定位址。它通常用於裝置請求設定其 IPv6 位址時所送出封包的來源欄位。你可以對此位址套用位址壓縮。因為此位址全為零,所以可以簡單地以雙冒號(::)表示。

IPv6 Multicast Addresses

IPv6 群播位址

The following figure illustrates the format of an IPv6 multicast address. An IPv6 multicast address defines a group of devices known as a multicast group. IPv6 multicast addresses use the prefix ff00::/8, which is equivalent to the IPv4 multicast address 224.0.0.0/4. A packet sent to a multicast group always has a unicast source address. A multicast address can never be the source address. Unlike IPv4, there is no broadcast address in IPv6. Instead, IPv6 uses multicast, including an all-IPv6 devices well-known multicast address and a solicited-node multicast address.

下圖說明 IPv6 群播位址的格式。IPv6 群播位址定義一組稱為群播群組的裝置。IPv6 群播位址使用前綴 ff00::/8,相當於 IPv4 群播位址 224.0.0.0/4。傳送到群播群組的封包一律使用單播來源位址。群播位址不能作為來源位址。與 IPv4 不同,IPv6 中沒有廣播位址,而是使用群播,包括一個全體 IPv6 裝置的公認群播位址,以及一個請求節點群播位址。

The first 8 bits are ff, followed by 4 bits allocated for flags and a 4-bit Scope field. The Scope field defines the range to which routers can forward the multicast packet. The next 112 bits represent the group ID.

前 8 個位元為 ff,接著是 4 個位元的旗標欄位,以及一個 4 位元的範圍(Scope)欄位。範圍欄位定義路由器可轉發此群播封包的範圍。接下來的 112 個位元代表群組 ID。

The first three flags bits are 0 (reserved), R (rendezvous point), and P (network prefix), which are beyond the scope of this course. The fourth flag bit, the least significant bit (LSB), or the last bit, is the transient flag (T flag). The T flag denotes the two types of multicast addresses:

前三個旗標位元分別為 0(保留)、R(會合點,rendezvous point)與 P(網路前綴),這些超出本課程範圍。第四個旗標位元,即最低有效位元(LSB),也就是最後一個位元,是暫時旗標(T 旗標)。T 旗標表示兩種群播位址類型:

  • Permanent (0): These addresses, known as predefined multicast addresses, are assigned by IANA and include both well-known and solicited multicast.永久(0):這些位址稱為預先定義的群播位址,由 IANA 指派,包括公認群播位址與請求節點群播位址。
  • Nonpermanent (1):These are "transient" or "dynamically" assigned multicast addresses. Multicast applications assign them.非永久(1):這些是「暫時」或「動態」指派的群播位址,由群播應用程式指派。

The scope bits define the scope of the multicast group. For example, a scope value 1 means interface-local scope or node-local scope, which spans only a single interface on a node. It is used for loopback transmission of multicast. The link-local scope is defined with the value 2. It spans the topology area of a single link. The admin-local scope is not automatically defined from the physical topology or another non-multicast-related configuration and should be defined by an administrator. The admin-local scope is the smallest administratively defined multicast scope. A site-local scope spans a single site, whereas organization-local scope spans several sites in one organization.

範圍位元定義群播群組的範圍。例如,範圍值為 1 表示介面本地範圍或節點本地範圍,僅涵蓋節點上的單一介面,用於群播的回送傳輸。鏈路本地範圍以值 2 定義,涵蓋單一鏈路的拓樸區域。管理本地範圍不會自動由實體拓樸或其他非群播相關設定定義,而應由管理者定義。管理本地範圍是最小的、由管理者定義的群播範圍。站台本地範圍涵蓋單一站台,而組織本地範圍則涵蓋一個組織內的多個站台。

The following table shows a few examples of well-known IPv6 multicast addresses that have different scopes:

下表列出幾個具有不同範圍的公認 IPv6 群播位址範例:

IPv6 Multicast Address
IPv6 群播位址
Description
說明
Scope
範圍
ff01::1
ff01::1
All nodes address
全節點位址
Node-local scope
節點本地範圍
ff01::2
ff01::2
All routers address
全路由器位址
Node-local scope
節點本地範圍
ff02::1
ff02::1
All nodes address
全節點位址
Link-local scope
鏈路本地範圍
ff02::1:2
ff02::1:2
All DHCP servers
全 DHCP 伺服器
Link-local scope
鏈路本地範圍
ff02::2
ff02::2
All routers address
全路由器位址
Link-local scope
鏈路本地範圍
ff02::5
ff02::5
Open Shortest Path First (OSPF) routers
開放最短路徑優先(OSPF)路由器
Link-local scope
鏈路本地範圍
ff02::6
ff02::6
OSPF designated routers
OSPF 指定路由器
Link-local scope
鏈路本地範圍
ff02::9
ff02::9
Routing Information Protocol (RIP) routers
路由資訊協定(RIP)路由器
Link-local scope
鏈路本地範圍
ff02::A
ff02::A
Enhanced Interior Gateway Routing Protocol (EIGRP) routers
增強型內部閘道路由協定(EIGRP)路由器
Link-local scope
鏈路本地範圍
ff05::2
ff05::2
All routers address
全路由器位址
Site-local scope
站台本地範圍
ff05::1:3
ff05::1:3
All DHCP servers
全 DHCP 伺服器
Site-local scope
站台本地範圍

IPv6 Anycast Addresses

IPv6 任播位址

An IPv6 anycast address is an address that can be assigned to more than one interface (typically on different devices). In other words, multiple devices can have the same anycast address. According to the router's routing table, a packet sent to an anycast address is routed to the "nearest" interface having that address.

IPv6 任播位址是可以指派給多個介面(通常在不同裝置上)的位址。換句話說,多個裝置可以擁有相同的任播位址。根據路由器的路由表,傳送到任播位址的封包會被路由到擁有該位址的「最近」介面。

In the following example, multiple servers (Server A, Server B, Server C, and Server D) share the same anycast IPv6 address 2001:7ac::43db. Host X wants to send a packet to the destination server with IPv6 address 2001:7ac::43db. Because there are multiple servers with the same IPv6 address, the packet is sent only to the "nearest" device that has this IPv6 address.

在以下範例中,多台伺服器(伺服器 A、伺服器 B、伺服器 C 與伺服器 D)共用相同的任播 IPv6 位址 2001:7ac::43db。主機 X 想要將封包傳送到目的地伺服器,其 IPv6 位址為 2001:7ac::43db。由於有多台伺服器擁有相同的 IPv6 位址,封包只會傳送到擁有此 IPv6 位址的「最近」裝置。

In this example, "nearest" is presented by the "cost" from source to destination. The lowest calculated cost value is 8 (Host X to Server C), meaning that the packet arrives at Server C.

在此範例中,「最近」是以來源到目的地的「成本」來表示。計算出的最低成本值為 8(主機 X 到伺服器 C),表示封包會抵達伺服器 C。

Anycast addresses are available for both IPv4 and IPv6, initially defined in RFC 1546, Host Anycasting Service. Anycast was meant to be used for Domain Name System (DNS) and HTTP services but was never really implemented as designed.

任播位址同時適用於 IPv4 與 IPv6,最初於 RFC 1546《Host Anycasting Service》中定義。任播原本是為了網域名稱系統(DNS)與 HTTP 服務而設計,但實際上從未依照原設計實作。

Anycast addresses are syntactically indistinguishable from unicast addresses because anycast addresses are allocated from the unicast address space. Assigning a unicast address to more than one interface makes a unicast address an anycast address. The nodes to which the anycast address is assigned must be explicitly configured to recognize that the address is an anycast address.

任播位址在語法上與單播位址無法區分,因為任播位址是從單播位址空間中分配的。將單播位址指派給多個介面,即使該單播位址成為任播位址。被指派任播位址的節點必須明確設定,以識別該位址為任播位址。

Some reserved anycast address formats, such as the subnet-router anycast address, are defined in RFC 4291 and RFC 2526. Such anycast address has the following format:

部分保留的任播位址格式,例如子網路路由器任播位址,定義於 RFC 4291 與 RFC 2526 中。此類任播位址具有以下格式:

The subnet-router anycast address has a prefix followed by a series of zeros (as the interface ID). For example, if the prefix for the subnet is 2001:db8:10f:1::/64 then the subnet router anycast address for that subnet is 2001:db8:10f:1::. If you send a packet to the subnet-router anycast address, it will be delivered to one router with an interface in that subnet. All routers must have subnet-router anycast addresses for the subnets that are configured on their interfaces.

子網路路由器任播位址由前綴加上一連串的零(作為介面 ID)組成。例如,若子網路的前綴為 2001:db8:10f:1::/64,則該子網路的子網路路由器任播位址為 2001:db8:10f:1::。若傳送封包到子網路路由器任播位址,封包會被送到該子網路中某台擁有介面的路由器。所有路由器都必須為其介面上所設定的子網路設有子網路路由器任播位址。

Reserved Addresses

保留位址

The IETF reserved a portion of the IPv6 address space for various uses, both present, and future. Reserved addresses represent 1/256th of the total IPv6 address space. The lowest address within each subnet prefix (the interface identifier set to all zeroes) is reserved as the subnet-router anycast address. The 128 highest addresses within each /64 subnet prefix are reserved for use as anycast addresses.

IETF 保留了一部分 IPv6 位址空間供現在與未來的各種用途使用。保留位址佔整個 IPv6 位址空間的 1/256。每個子網路前綴中最低的位址(介面識別碼全部設為零)保留作為子網路路由器任播位址。每個 /64 子網路前綴中最高的 128 個位址則保留作為任播位址使用。

In which type of IPv6 address does the sender send the traffic to the nearest of multiple nodes, all of which behave in the same way as other nodes that are identified by the same destination address?在哪一種 IPv6 位址類型中,傳送端會將流量傳送到多個節點中最近的一個,而所有這些節點的行為都與以相同目的地位址識別的其他節點相同?
You want to ping the loopback address of your IPv6 local host. Which command will you enter?你想要 ping 你的 IPv6 本地主機的回送位址。你會輸入哪個指令?
Which two statements describe the characteristics of IPv6 unicast addressing? (Choose two.)以下哪兩項描述了 IPv6 單播定址的特性?(選擇兩項。)
Which address bits uniquely identify a group ID in the IPv6 multicast address?在 IPv6 群播位址中,哪些位址位元唯一識別群組 ID?