Juniper JNCIA-Junos JN0-104 – Section 1: Networking Basics Part 5
April 16, 2023

13. Subnetting Example 4

All right, let’s look at one more example of subnetting, and this time again, we’re going to change it a bit.

The question is which subnet does 200.1.1.10/29 belong to? In the examples that we looked at earlier, we were given an IP address and we had to break it down into subnets. This time we were given an IP address that already belongs to a subnet and we need to find out which subnet it belongs to.

The steps will remain the same. So, step number one is to convert decimal mask into binary format. The decimal form of that subnet mask is /29, which can also be written as 255.255.255.248. In binary format, the first twenty-nine bits are going to be ones and the last three bits are going to be zeros.

Let’s go to step number – to determine the number of host bits to be borrowed. Now, in this case, the host bits have already been borrowed which is why we have a submitted IP address. So, we don’t need to do this part. As you can see, 200.1.1.10 is a Class C IP address. The default subnet mask of a class C IP address is /24, but we’ve been given a /29 subnet mask. This means the bits have already been borrowed. So, we don’t need to do step number two.

Let’s go to step number three – determine the increment. Now, in decimal format, we have /29. And if we wrote this thing in binary, this is how it would look like – 11111111.11111111.11111111.11111000. To determine the increment, we’ll line up the bits of the last octet against the power of two. And now we all know that the increment is the power of two corresponding to the least significant bit, which is the rightmost bit. And in this case, it is 8. That is going to be our increment.

Let’s now go to step number four. We need to add the increment to get the new subnets. So, the first network is 200.1.1.0. And we need to add the increment, which is 8, to get the subnets. So, the first subnet is 200.1.1.0. The second subnet is 200.1.1.8. We are adding to the last octet because that’s where the bits have been borrowed from. The next one is 200.1.1.16 and so on.

Now, if you look at this IP address – 200.1.1.10 – it belongs somewhere in between this, between 200.1.1.8 and 200.1.1.16, and it belongs to this network. So, this subnet will range from 200.1.1.8 to 200.1.1.15, one IP address loess than the next subnet. So, the answer is 200.1.1.10/29 belongs 200.1.1.8/29 subnet.

Let’s add one more task. Identify the network and broadcast address of 200.1.1.10/29.

Now, we know that the subnet to which this IP address belongs is 200.1.1.8/29. We also know that the first address is the network address and the last address is the broadcast address. So, the network address is 200.1.1.8. And the broadcast address is 200.1.1.15.

Time for some exercise. The first exercise is to divide 11.0.0.0/8 in a way that each network has 1010 hosts. And the second exercise is to identify with subnet does 222.1.2.11/30 belong to.

14. Supernetting

Now let’s talk about supernetting.

We’ve talked about subnetting. Subnetting is the process of taking a larger network and breaking it down into smaller networks.

Supernetting is the opposite of that. It allows you to represent multiple smaller networks as a single larger network. The best way to understand supernetting is with an example.

So, let’s look at an example. The task is to identify the supernett to which these smaller subnets belong to. So, we’ve got four subnetted networks – 10.4.0.0/16, 10.5.0.0/16, 10.6.0.0/16, and 10.7.0.0/16. We need to identify a single supernet that can represent these four smaller networks.

Step one is to convert the subnetted networks into binary format. So, we start with 10.4.0.0 and convert it into binary. And we do the same thing for 10.5.0.0, 10.6.0.0, and 10.7.0.0. So, that’s step one.

Step two is to determine the common bits in the binary representation. So, if we look at the binary representation, we can see that the first 14 bits of every binary representation are the same. The difference is from the 15th bit. The 15th bit is different for different networks. So the first 14 bits are same for all the four networks. And that is our supernet. So, if we were to convert that back to decimal, we would get the supernetted address, which 10.4.0.0. So that’s the supernet address.

Now we need to find the mask for this address. And to find the mask we need to set the common bits two ones and the others to zeros. So, out of the 32 bits for the subject mask, the first 14 bits are going to be set as ones because they are common for all the four networks and the remaining bits are going to be set as zeros. And that gives us the mask for the supernet.

So the last step, step four, is to use the new mask to determine the supernet. So we have 14 ones and the remaining zeros. So, the supernet is 10.4.0.0/14.

So, this supernet here represents the four smaller subnets. Now, you might be wondering how is that possible? How can this network represent the four smaller networks? So let’s take a look at that.

To derive the subnets from the supernet, you start with the first supernet address, which is 10.4.0.0 and write it in binary format. So, here we have 10. This is four, zero and zero. And we’re going to use the original mask that has been provided to us. Now of the original mask, the first 14 bits are used by the supernet, but we still have the 15th and the 16th bit which we can play with because the original mask is its last 16. So, if we set the 15th and the 16th bit to the lowest possible value, which is both zeros, we get 10.4.0.0. The next possible value is where we replace this zero here with a one. So 0 1 on the 15th and the 16th bit. And if we convert this back to decimal, we will get 10.5.0.0/16.

For the next increment, we set the 15th bit to 1 and the 16th bit to 0. And when we convert back to decimal, we get 10.6.0.0/16. And when we set both the bits to one, we get the last subnet, which is 10.7.0.0/16.

Now let’s look at one more example. So, we need to identify the supernet that represents these four networks: 192.168.0.0/24, 192.168.1.0/24, .2.0/24, .3.0/24. We’ll go through the four steps again.

So, step one is to convert the subnet in networks into binary format. So here’s the binary representation of all the four subnet ID networks.

Step two is to determine the common bits. So, if you look at the binary representation, we can see that the first 22 bits are common for all the four networks. The difference begins on the 23rd bit. So, if we convert the first 22 bits back to decimal, we get the supernet, which is 192.168.0.0.

Now we need to determine the mask for the supernet address. So for that we’ll move on to step number three. On step number three, we’re going to set the common bits to ones and the others to zeros. So, of the 32 bits that are used for the subnet mask, the first 22 bits will be set as ones and the others will be set as zeros. And that gives us the mask for the supernet address.

So step four is to use the new mask to determine the supernet. So, the supernet address is 192.168.0.0/22 because we have 22 common bits for the subnetted addresses. So the supernet is 192.168.0.0/22.

Now the question is how do we derive the subnets from the supernet address? Let’s take a look at that.

So to derive the subnets from the supernet, we start with the supernet address which is 192.168.0.0 and we use the mask that belongs to the subnet which is /24, of which the first 22 bits are used by the supernet. That means we still have two bits to play with, the 23rd and the 24th bit. The lowest possible value is when you use zeros for both the bits. So when you convert this back to decimal, you would get 192.168.0.0/24.

To get the next subnet, we’re going to increment this bit by one. So the 23rd bit is 0 and the 24th bit is 1. And if we convert back to decimal, we get 192.168.1.0/24.

Similarly, if we increment by one bit, we get 192.168.2.0/24.

And the last increment is when we replace both the bits by ones and we get 192.168.3.0/24. So that’s about supernetting.

As you may have noticed, some of the steps are just like what you would do when you’re creating a subnet.

Now, the question is why do we need to use supernetting? And the answer for that is supernetting helps with route summarization. Think about a router that has hundreds of routes pointing to different destinations. Instead of maintaining multiple routes, if it is possible to summarize the routes, we can reduce the size of the routing table. So that’s the main purpose of the supernet. It reduces the size of the routing tables and the routing updates that a router needs to share with its neighbours.

So, here is an example. This is a very simplified version of a routing table. Let’s just imagine that this is the routing table of a router. So we have different destinations and the next hop IP addresses. So, we have four destination networks. 192.168.0.0/24. To reach this network, the packet needs to be forwarded to 10.1.1.1. Similarly, to reach 192.168.1.0, the packet needs to be forwarded to the same next hop IP address 10.1.1.1. And it’s the same story for 192.168.2.0 and 3.0.

Now the router can save these four routes as it is in the routing table, or it can summarize it like this. As we can clearly see, it reduces the size of the routing table. Imagine this at a larger scale. Imagine this for routers that belong to large service providers. They may have hundreds of routes pointing to different destinations, and if they can summarize their routes, their routing tables are going to look much more clean and tidy.

So that’s the purpose of the supernetted address. It allows the router to summarize multiple smaller networks into a single larger network, so it reduces the size of the routing table and also the size of the routing updates that the router may have to share with its neighbours.

For the exam, remember the four steps that we perform to derive the superset address. So you may see a question on the exam that has multiple subnetted addresses and you are required to identify the supernet that represents the smaller subnetted addresses.

15. IPv6

Now let’s talk about an interesting topic – IPv6.

IPv6, or Internet Protocol version six, is intended to be the successor of IPv4. The challenge with IPv4 is that we do not have enough public IP addresses to assign to all the devices. With so many devices being added to the Internet, we have a shortfall of public IP addresses that can be assigned to devices. So, we need a protocol that has a larger IP address space, and that’s why we have IPv6.

IPv6 addresses are 128 bits and length. So it’s a much larger address space compared to IPv4, which only has 32 bits. 128 bits means that the total number of possible addresses is 2128. Because every binary bit has two possibilities – zero or one – the total number of possible addresses is 2128. Not that all the addresses can be used, but that’s the total number of possibilities that exist.

Now let’s talk about the types of communication in IPv6. IPv4 had three types of communication – unicast, multicast and broadcast. Now IPv6 introduces a new type of communication called anycast.

We know what is unicast. With unicast, a single source sends a packet to a single destination. We know what’s multicast – a single source sends a packet to many destinations.

With anycast, it’s a bit different. A single source will send the packet to the closest destination of multiple possible destinations. So, with IPv6 you have anycast. So, communication sent to an anycast address is similar to multicast. However, it reaches the nearest node in the group.

And another interesting thing about IPv6 is that broadcast communication has been removed from IPv6.

IPv6 has an interesting feature called Stateless Address Auto Configuration (SLAAC), and with this feature an IPv6 device can generate a unique address that can be used to communicate over the network. So, if a device is not provided with an address, it can automatically, on the fly, generate a unique address that it can use to talk over the network.

Another important thing to bear in mind is that IPv6 is not compatible with IPv4, and this is a challenge for network administrators. There are some mechanisms to deal with this, like dual stack and tunnelling, which are used to transition from IPv4 to IPv6. At the JNCIA level, we do not need to get into the details of these transitioning mechanisms, but it’s good to know the names of these mechanisms that are popularly used to transition from IPv4 to IPv6.

Now let’s look at the address format for IPv6. We just understood that IPv6 addresses are 128 bits in length. It is written in hexadecimal format as eight groups separated by colons. Here is an example of an IPv6 address. As you can see, there are eight groups in every group. We have four hexadecimal characters, so that’s a total of 32 hexadecimal characters. Every hexadecimal character can be represented by four binary bits. So, 32 times four results in an address that is 128 bits long.

Here’s another example of an IPv6 address. And as you can see, it looks a bit different than the first one, but it is a perfectly valid IPv6 address. To understand, how you can write an address like this, let’s talk about the rules for writing IPv6 addresses.

And there are two rules that we need to know about. Rule number one is that leading zeros in a group can be discarded. So, consider this IPv6 address. As you can see here, we have a few groups that have leading zeros. So, we have this group which has one leading zero. In this group, we have three leading zeros. We have one here. We again have three leading zeros and here we have three leading zeros as well. So, the rule says that leading zeros in a group can be discarded. So we have leading zeros in the second, third, fourth, sixth and seventh group, which can be discarded. So, this address can be rewritten like this. And as you can see, what we’ve done here is we have dropped all the leading zeros. So this zero is dropped. These three zeros have been dropped. This one has been dropped. These three have been dropped. And these three have been dropped as well. And the address now looks much shorter.

Now let’s talk about the second rule. The second rule says that any group of two or more zeros can be replaced with two colons. But there’s a condition. You can only do it once. And here is an example. Here we can see that we’ve got three groups of zeros, and on this side we’ve got two groups of zeros. Before we apply rule two, we are first going to apply rule one, which says leading zeros can be dropped or discarded. And when we do that, this is what it looks like. Here, we have dropped three leading zeros in each of these groups, which you can see over here. And we’ve done the same thing over here. We’ve dropped the leading zeros.

Now we can apply rule two. Rule two says that any group of two or more zeros can be replaced with two colons, and here we have two groups of two or more zeros. So, this IPv6 address can be written in two possible ways. We can replace this group of two or more zeros with a colon and leave the other one untouched. Or we can replace this group of two or more zeros with two colons and leave the other one untouched. So, both of these are valid representations of the original IPv6 address.

Now the question is why the two colons cannot be used more than once. And to understand this, let’s consider the same example that we’re looking at right now. Now, imagine this for a minute. If we were to replace both groups of zeros with the two colons, this is what it would end up looking like. Now, the problem is if we were to get back the original address, we would not know where the three zeros would go and where the two zeros would go. We could do it this way, which is the correct representation, but we could also do it this way. And we would not be sure which of these two is actually correct. So, as we can see, if we use the two colons more than once, we would not be able to derive the correct IPv6 address.

Now let’s talk about the different types of IPv6 addresses, and there’s a few of them. The first one is unspecified; you have loopback address, link local, unique local, global unicast, and multicast address.

Let’s talk about the first one unspecified address. This is used when a computer boots up and it has no address assigned. If the computer is on a DHCP-enabled network, this address is used before it gets an address via DHCP.

If you’re not familiar with DHCP, DHCP is a protocol that is used on the network so that any device that connects to the network is automatically assigned an IP address instead of the administrator statically configuring an address on the device. You can configure DHCP at the router level or at the server level, so any device that joins the network can request an address on the network and be assigned one.

The address we’re talking about, the unspecified address is used by a computer when it boots up and it has no address. And this address is used before it gets an address via DHCP. This address is denoted by ::/128, which is essentially all zeros. We have a similar address in IPv4 as well. In IPv4 it is same as 0.0.0.0.

The unspecified address should not be manually configured on your device. And even if you try to do that and forward a packet, the router will drop the packet.

The next address is the loopback address, and this is denoted by ::1/128, which is essentially all zeros, and the last character is one. So, if you were to apply the two rules that we spoke about, you would be left with ::1/128. It is same as 127.0.0.1 in IPv4. And loopback address is used by a host to communicate with itself because it is its own address. An example of this is when an application on the host wants to communicate with another application on the same host.

The next address is link local address and this is assigned by the computer to itself from the range FE80::/10. So, you have the first four hexadecimal characters set as FE80, and all other characters are set to zero. This address is unique on the subnet and this helps the host with automatic address configuration when no static address is assigned and no DHCP server is present. So if the device has not been configured with an IPv6 address and if it is unable to get an IP address from the DHCP server, it will then generate an address from that range FE80::/10 so it can talk to other devices on the network.

We have something similar in IPv4 as well, and it’s called APIPA, or automatic private IP address, and in IPv4 it uses the range. 169.254.0.0/16.

The link local address is used for communicating over the LAN, which is why we call it as a link local address. It’s just for local communication or over the same network. It cannot be used to route packets over to other LANs.

The next address type is unique local address. These are unique and local addresses used for communicating inside the LAN. And this is similar to private IP address range in IPv4, which is also known as RFC 1918. So, in IPv4 the private IP address range is 10.0.0.0/8. We also have 172.16.0.0/16 and 192.168.0.0/24. The unique local address range in IPv6 is similar to private IP addresses in IPv4. And since these are private IP addresses, you cannot use them to route packet on the public internet. And the range for this is FC00::/7. So if you’re an administrator and if you want to assign a private IPv6 address to your computer or your device, that is the range you would pick an address from.

The next address type is global unicast address. And as you would imagine, these are public addresses that can be routed over the Internet. And the range for these addresses is 2000::/3 to 3FFF::/3.

The last IPv6 address type is multicast address and the range for this is FF00::/8. We have a similar address type in IPv4 as well. And the range for that is 224.0.0.0/4. And as you know, multicast is used for one-to-many communication. So, the multicast address range is not to be used as the source address, it is used as the destination address when you want to send a packet to multiple destinations at the same time.

So those are the IPv6 addresses. Now let’s talk a little bit about IPv6 subnetting. So here’s how the 128 bits of an IPv6 address look like. The first 48 bits are called as routing prefix. The next 16 bits represent the subnet, and the last 64 bits are known as the interface ID. So, IPv6 subnet is similar to IPv4 that we looked at earlier. But it’s on a larger scale because we are looking at a much larger address space.

So, the first 48 bits represent the network address, which is also known as the routing prefix. The routing prefix is assigned by your Internet service provider. The next 16 bits represent the subnet. They are known as the subnet bits, and the last 64 bits represent the host bits, also known as the interface ID.

So, if you think about it, for every routing prefix, there are 16 subnet bits which you can use to break down your subnet. So, the total number of possible subnets for every routing prefix would be 216 because there are 16 bits, each bit has two possible values – zero and one – so, the total number of possible subnets for every routing prefix would be 216. And for every subnet there are 64 host bits. So the total number of possible hosts per subnet is 264.

So, that’s a high level introduction of IPv6 for the exam. It is important to remember the address format of an IPv6 address and the two rules that we spoke about. So, you might be given a long form IPv6 address and you may have to apply the two rules to derive the short form IPv6 address. Also, it is important to remember the different IPv6 address types that we spoke about.

Leave a Reply

How It Works

img
Step 1. Choose Exam
on ExamLabs
Download IT Exams Questions & Answers
img
Step 2. Open Exam with
Avanset Exam Simulator
Press here to download VCE Exam Simulator that simulates real exam environment
img
Step 3. Study
& Pass
IT Exams Anywhere, Anytime!