Subnet – How to calculate the Subnet address

ipv6subnet

I have an ipv6 address FC00::50, and the subnet mask length is 64. How to calculate an subnet address? I want address FC00::50 in the scope of this calculated subnet address.

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.

Best Answer

Since there are 128 bits in an IPv6 network address, it is easy. IPv6 addresses, with a few exceptions, have a 64-bit network portion and a 64-bit interface (host) portion. Basically, you are taking the first half (high-order bits) of the address for the network portion, and the second half (low-order bits) of the address for the interface portion.

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 Version 6 Addressing Architecture will give you the basics, and RFC 5952, A Recommendation for IPv6 Address Text Representation will give you the canonical representation.

FYI, the IPv6 address 0000:0000:0000:0000:0000:0000:0000:0000 is canonically represented as :: and is called the Unspecified address. Also, the address you list, FC00::50 is in the part of the Unique Local address range that is currently undefined; FD00::50 would be in the part of the Unique Local address range that is defined, but it would be missing the required Global ID.