如何计算子网地址?

网络工程 子网 ipv6
2021-07-28 15:31:17

我有一个ipv6地址FC00::50,子网掩码长度为64,如何计算子网地址?我希望地址 FC00::50 在这个计算出的子网地址的范围内。

Here is the description:

Description: The subnet address is specified by the IP address together with the Subnet mask length. For user equipments in this subnet, the SGC uses the associated media site profile (see Section 4.10.1.1) to select a BGF for media.

Default IPv4 subnet address is 0.0.0.0.

Note:
The default subnet address can be used to catch all addresses not covered by the configured IP address mappings.

Default IPv6 subnet address is 0000:0000:0000:0000:0000:0000:0000:0000.
1个回答

由于 IPv6 网络地址中有 128 位,因此很容易。除了少数例外,IPv6 地址具有 64 位网络部分和 64 位接口(主机)部分。基本上,您取网络部分地址的前半部分(高位),以及接口部分地址的后半部分(低位)。

The general format for IPv6 Global Unicast addresses is as follows:

|         n bits         |   m bits  |       128-n-m bits         |
+------------------------+-----------+----------------------------+
| global routing prefix  | subnet ID |       interface ID         |
+------------------------+-----------+----------------------------+

RFC 4291,IP 第 6 版寻址架构将为您提供基础知识,而 RFC 5952,IPv6 地址文本表示建议将为您提供规范表示。

仅供参考,IPv6 地址0000:0000:0000:0000:0000:0000:0000:0000被规范地表示为::并称为未指定地址。此外,您列出的地址FC00::50在当前未定义的唯一本地地址范围内;FD00::50将在定义的唯一本地地址范围的一部分中,但会缺少所需的全局 ID。