IPv6 Address Types

(Rene Molenaar) #9

Hi Itai,

This is how RFC 4193 describes it…40 bits for the global ID and 16 bits for the subnets.

Rene

(Ananth Maruti M) #10

Hi Rene,

Can you pls explain how link local address is determined? How actually it is important in IPv6 compared to IPV4?

(Andrew P) #11

Ananth,
There really isn’t a concept of a link-local address in IPv4, but it is critical for IPv6 operation. As the name implies, link-local addresses are significant only on a particular link, and they are the primary vehicle of communication between IPv6 hosts over a shared link. As an illustration of its importance, OSPFv3 will not even function without link-local addresses being present.

Link Local addresses are all within the FE80::/10 range. They can be manually set (which is the Cisco recommended practice), or they can be created automatically based on the node’s MAC address for that link. The problem with using a MAC, however, is that it is only 48 bits, while an IPv6 address is 128 bits. To solve this problem, extra padding is used. The rule is that you cut the MAC address in half, and insert “fffe” where you made the cut. For example, if you had the MAC address of 1111.2222.3333, the padding would work like this:

FE80::1111.22FF.FE22.3333

As if that isn’t complicated enough, one additional change has to be made called the EUI-64 bit flip. I won’t go through explaining it because there is a lesson on it. The final result using the bit flip would be:

FE80::1311:22FF:FE22:3333

1 Like
(Brian C) #12

Great post!

I only had one question and its not really that important of a question but I was curious.

If you have to change the L bit to a 1 making it FD then why do they say FC in the first place? why not just call all Unique Local FD which is what it really is anyway because of the rule.

(Lazaros Agapides) #13

Hello Brian

MAC addresses when configured have the U/L bit which is the 7th bit of the 48 bit address. This bit, when set to 0 when this address is locally administered and 1 if the address is globally unique. An example is the virtual MAC address that is created by HSRP. This MAC address will always have 0 in the seventh bit, while a hardwired MAC address on a switch or a PC will have the 7th bit 1.

Now because there is a mechanism of EUI-64 which is used to assign an IPv6 address that is derived from a MAC addresses, this L bit seems to have migrated into the IPv6 format. According to most sources, (and @ReneMolenaar can correct me if I’m wrong), this bit isn’t actually taken into account in most IPv6 applications. Both the FC00 and FD00 blocks are considered unique local addresses.

The reason why the L should be changed to 1 is because the block FC00 has not been defined yet. It has been proposed to be managed by an allocation authority, but this has not gained acceptance in the IETF.

I hope this has been helpful!

Laz

1 Like
(Nadav B) #14

Hi Rene,
I have a silly question running over my head. I see that we have Global unicast address, somewhere i read that the range for global unicast is from 2000::/16 to 3fff::/16.
My question:

  1. is this correct?
  2. why such a small range of global unicast addresses from a massive IPv6 address? Your introduction to IPv6 course mentioned that there is no real requirement of NAT in IPv6. With this small range we might require NAT in future (please correct me if i am wrong)
  3. can’t we assign other addresses like 7000::/16 as global unicast ?
    I know that IANA does the address allocation, but as i said it’s just a silly question troubling me in this course.
    Br,
(Rene Molenaar) #15

Hi Nadav,

The global IPv6 unicast address space must start with 001 (binary) so that’s correct yes:

0010 (2000)
0011 (3000)

In other words, it has to start with 2000::/3. That covers everything in this range:

2000:0000:0000:0000:0000:0000:0000:0000-
3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

That’s 42535295865117307932921825928971026432 addresses in total.

For each person on the planet we get:

42535295865117307932921825928971026432 / 7615097670 (world population) = 5.5856534e+27

So, that’s a crazy number of IPv6 addresses only from the 2000::/3 range :smile:

Here you can find the complete IPv6 allocation from IANA:

https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml

And here’s the IANA global unicast address space:

https://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.xhtml

In RFC7249 we can read something about the allocation:

The vast bulk of the IPv6 address space (approximately 7/8ths of the
whole address space) is reserved by the IETF [RFC4291], with the
expectation that further assignment of globally unique unicast
address space will be made from this reserved space in accordance
with future needs.

0000::/8 and 0100::/8 are reserved for other purposes so that’s why we start with 2000:: for global addresses. It still feels like a waste to reserve an entire /8 that is probably never used but with this address space, we probably never run out.

Here’s a funny website I ran into when I was looking some stuff up:

https://samsclass.info/ipv6/exhaustion-2016.htm

Rene

1 Like
(Nadav B) #16

Hi Rene,
Does Anycast also provide a kind of redundancy?
Also you mentioned that in Anycast the host will be routed to the closest router/server. Closest in terms of routing decision?
Is there any chance that the host packets are received by two anycast routers and both reply to the packet ?

Br,

(Lazaros Agapides) #17

Hello Nadav

Anycast can indeed provide redundancy. With the growth of the Internet, many network services are using Anycast for high-availability requirements, such as DNS and content delivery networks. Anycast has grown in popularity for this purpose.

Closest could mean multiple things. It could be on the basis of number of hops, physical distance, lowest cost based on a metric, latency, or based on the least congested route. Content delivery systems like Netflix may use it in order to have users obtain content from the closest possible (and thus fastest and least costly) server. This essentially brings the content closer to the end user.

Only if there is a fault in configuration. IPv6 routers on the path of an Anycast packet through the network will not distinguish it from a unicast packet, but special handling is required from the routers near the destination (that is, within the scope of the Anycast address) as they are required to route an Anycast packet to the “nearest” interface within that scope. This is determined in much the same way that a routing protocol determines the path to a specific destination, based on whatever measure of distance (hops, cost, etc.) is being used.

I hope this has been helpful!

Laz

(sumant S) #18

Hi

Can you please tell me how many subjects are possible with 16 bits in IPv6 subnet part?

Thanks

(sumant S) #19

And also i havee read in some tutorials you cant assign anycast addresses to hosts…can you please explain the difference between host and node in a networked environment…

Thanks

(Lazaros Agapides) #20

Hello Sumant

If you have a /16 prefix on an IPv6 address, then you can theoretically have up to 2^16=65536 subnets each having the capability of containing 2^112 hosts since out of the 128 bits of an IPv6 address, 112 would be available for hosts.

However such a configuration is not advisable due to the fact that 1) you are creating an extremely large subnet of hosts without any reason for it (i.e. the whole of today’s Internet could fit inside one of these subnets many many times over!!) and 2) you would have strict limitations on what addresses you can actually use due to various subnets and prefixes being reserved for specific purposes.

I hope this has been helpful!

Laz

(Lazaros Agapides) #21

Hello Sumant

First of all, hosts and nodes refer to the same entity. They are devices on a network that have one or more addresses assigned to them. Now as for an anycast address, Cisco states the following from this Cisco Documentation.

An anycast address is an address that is assigned to a set of interfaces that typically belong to different nodes. A packet sent to an anycast address is delivered to the closest interface (as defined by the routing protocols in use) identified by the anycast address. 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. Nodes to which the anycast address is assigned must be explicitly configured to recognize that the address is an anycast address.

So an anycast address does not belong to a specific range of addresses. An address becomes an anycast address when you assign the same address to two or more nodes/hosts. Once that’s done, the routing protocol in use will choose which anycast address is closest and send all addressed packets there.

I hope this has been helpful!

Laz

(Eugene K) #22

Have a question re: anycast as well. If an anycast address is the same address assigned to multiple devices, how do routers account for routing this traffic? Meaning, isn’t a basic rule of network routing to not have duplicate subnets within the network? For two hosts in different subnets sharing the same anycast address, it would seem to me the routers wouldn’t know where to route the traffic or have a routing loop occur.

I’m assuming I’m missing something here with the concept of anycast still.

Thanks.

(Lazaros Agapides) #23

Hello Eugene

You are absolutely correct when you say that the basic rule of routing is that each address is unique. This has been true of IPv4, however, IPv6 tends to bend the rules a little bit.

First of all, let’s look again and see what an IPv6 anycast address is. Cisco describes it very well in this documentation. It states:

An anycast address is an address that is assigned to a set of interfaces that typically belong to different nodes. A packet sent to an anycast address is delivered to the closest interface (as defined by the routing protocols in use) identified by the anycast address. 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. Nodes to which the anycast address is assigned must be explicitly configured to recognize that the address is an anycast address.

So by simply assigning the same IPv6 address to two or more nodes, the address becomes an anycast address. Note the following:

  • if you configure a device with an anycast address, you must explicitly configure that device to KNOW that that address is an anycast address, in other words, it must KNOW that the same address is given to another node
  • routers that are close to the destinations sharing this address learn about this and keep a record of which of the destinations is closest
  • when this is done correctly, routers that are routing a packet destined for an IPv6 anycast address will know about it and will send it to the “closest” node that has that address
  • “closest” is defined using a particular measure of distance, such as hops, cost etc

I hope this has been helpful!

Laz

(Hugues R) #24

Hello Laz,
I have three questions :

  1. about vocabulary : Is there a historical reason for using in Cisco IPV6 documentation the same term “prefix” in two different ways: “hex prefix” to speak about “2 or 3”, “FC or FD”, “FE80”; and “cidr prefix” to speak about “/48” or “/64” ?

2 about the use of the term “global ID” : I understand, reading your site, that the global ID of, for example, fd99:abcd:f83d:4079::/64 is 99abcdf83d
can I write it “99:abcd:f83d:” or is the usage to omit all the semicolon ?
and what about the /3 for global unicast ID like “2001:3452:4952:2837::/64” do you think that global ID is “001:3452:4952:” ? Or, without semicolon “00134524952” ?
then, if “2001:3452:4952::/48” is not the global id of a subnetable ipv6 address, how do you prononce it ? “prefixed global id” ?

  1. Since the ULAs are “free”, like private ipv4, do you confirm that a local administrator can decide that the subnet zone of all its ULA ip space will be /72 or /80, instead of /48 ?
(Lazaros Agapides) #25

Hello Hugues

When we use the word prefix, it can refer to several related things depending on the context. When we talk about a prefix used for link local addresses for example, we are usually referring to the FE80 bits that are used to start off all such addresses. But remember that this value has no meaning unless accompanied by the /XX format prefix that indicates how many bits are actually included in that prefix. So as you can see, the word prefix is used to refer to both the beginning bits as well as the number of those bits in the slash format. Now I haven’t seen the terms “hex prefix” or “CIDR prefix” in documentation, but I know what you mean by them. I believe that the context of the term is the most reliable thing to use to understand what the word prefix is referring to.

I believe that the best place to go to for this is the related RFC. Here you will see that the global ID is typically 40 bits long, so it will always be composed of 10 hex digits. There is no absolute standard as to how to represent a global ID alone, but it is usually displayed as “99:abcd:f83d" with the semicolons, but this requires additional explanation in the text. The clearest way to represent it is “2001:3452:4952::/48” which includes all of the relevant information including the prefix bits and the /48 indicating where the subnet and interface IDs begin. Even thought this strictly does not include only the Global ID, it can be inferred.

The conventions used for ULAs are specific, as described in the lesson. However, because the address space is indeed private and does not affect, and is not affected by other networks, you are free to change the /XX lengths to whatever you like. Keep in mind that by doing so you don’t gain anything because the number of addresses available are more than enough for any of today’s private networks. It is a good idea to keep the standard lengths so that in the future, if you have to interconnect with another private network, you will be immediately compatible without the need to readdress the whole network.

I hope this has been helpful!

Laz

(Hugues R) #26

well received, thanks for these answers

1 Like
(Muhammad Rasoul A) #27

Hi Lazaros,
As we have global unicast address that we use it for the internet. So what is the Global ID which is 40 bit in Unique Local?
As Rene has said; The Global ID (40 bits) is something you can make up. Normally an ISP would choose prefix.
If possible please explain it to me.

(Lazaros Agapides) #28

Hello Muhammad

IPv4 is designed to have a specific structure. This means that an IPv4 address has a network portion and a host portion. The size of each portion of the address depends on the subnet mask.

IPv6 works similarly in the fact that we have a prefix which separates the address into two sections as well: The Prefix and the Interface ID. Their names are different than IPv4 but they’re essentially the same thing.

Now for the purposes of organization, the Prefix is often separated into two sections: The Global Routing Prefix (sometimes called the Site Prefix) and the Subnet ID. This structure is useful because a single global prefix can be given to an ISP, and the ISP can use the subnet IDs to allocate whole blocks of IPv6 addresses. For example, I can have 2001:D88:ACAD as the Global Routing Prefix assigned to an ISP. This ISP can then use the next 16 bits to identify each of their customers. So the IPv6 allocation can be done like so:

  • 2001:D88:ACAD:0001::/64 goes to customer A
  • 2001:D88:ACAD:0002::/64 goes to customer A
  • 2001:D88:ACAD:0003::/64 goes to customer A
  • 2001:D88:ACAD:0004::/64 goes to customer A
  • 2001:D88:ACAD:0005::/64 goes to customer A
  • etc…

The bold numbers are the 16 bit subnet ID

Now the way these various portions of the IPv6 address are defined depends on who you ask. Because all unicast addresses start with 001 in the first three bits, some people separate the Prefix into three sections: 3 bits for this bit sequence, 45 bits for the Global prefix and 16 bits for the subnet ID. But then again, you can always redefine the number of bits the global prefix and the subnet ID can have. So you can have 3 for the first bit sequence, 53 for the global prefix and 8 for the subnet ID. This allocation can occur however it is needed. You can even redefine the Interface ID range as well and make that /48 allowing for more subnet IDs and global prefixes.

I think the best representation of how this works is the following:
image

I hope this has been helpful!

Laz