If you're given:
Number of needed subnets: 2
Network Address: 195.223.50.0
I can answer the following:
Address Class: C
Default Subnet Mask: 255.255.255.0
Custom Subnet Mask: 255.255.255.192
Total number of subnets: 2^2 = 4
Total number of host addresses: 2^6 (8-2 = 6)
Number of usable addresses: 2^6 -2
Number of bits borrowed: 2
BUT…. if I'm asked….
What is the 3rd subnet range?
What is the subnet number for the 2nd subnet?
What is the subnet broadcast address for the 1st subnet?
What are the assignable addresses for the 3rd subnet?
How would I answer these… All I remember from the procedure is to look at the last number in the Custom subnet mask (192) and do 256 – 192 to get 64 and then use 64 to increment something. But I'm not sure what each question is asking. Please help, and explain step by step for each question.
Also, what would be different if I was faced with the Address Class of B in this situation?
Best Answer
TOOGAM has an excellent answer for this one.
However, I'll throw in my two cents, this is how I used to simplify it to wrap my mind around subnetting:
Look at IP addresses in binary. Each segment of an IP address is made up of 8 bits, or an octet, which means you have a working range of 0-255 because that's the range of numbers 8 bits can represent. Here are a couple of examples:
and
You know that 192.168.1.0 is a class C address, right? In CIDR notation that means it's a /24 network and the mask is 255.255.255.0. What does this mean? Let's look at the binary again - the netmask in binary looks like this:
All the 1s are the bits of the actual address that are used to identify the network, while all the 0s are used to identify a specific host on the network. The /24 means that 24 bits are used to identify the network, go ahead and count them.
Note that every network has a network name (which is the FIRST address of the network, this is also your subnet number), and a broadcast address (which is the LAST address of the network). These two addresses are reserved, you cannot use them for hosts.
So let's say we want to split 192.168.1.0 into three subnets. We can't! Why? Let's work it out. If we borrow one bit, we can only have two subnets because one bit can only represent numbers 0-1.
Here's what I mean - if you want to borrow one bit, then the subnet mask becomes
which, in binary, is
So now you have a /25 network. You're using 25 bits to represent your networks, and the remaining 7 bits to identify your hosts. (Note: When doing subnet calculations, it helps to stop thinking about the dots in the IP address and just deal with the binary. You'll see what I mean later.)
This only gives you two subnets,
and
The remaining 7 bits are reserved for identifying your hosts, so you can't use those. You have to borrow two bits instead, which can represent number 0-3. Like it or not, if you want three subnets, you have to split the network into four subnets at minimum.
So now you have a /26 network with these subnets:
To get the third network, all you have to do is look at your borrowed bits and make a 2, or "10" in binary. Why 2? Because we are counting from 0, not 1. In sequence, you have "0, 1, 2, 3", so the third network is "2".
You just slap this "10" into the borrowed bits and you can get the third network. For example, let's say I had an odd network like
and I needed to split it into three subnets and find the third. In other words, I would need to make it into a /25 network because I need two borrowed bits at least. So now I have
It's super confusing if you look at the decimal IP addresses, isn't it? This is what I meant earlier when I said to work in binary and ignore the dots in the IP address when doing subnet calculations.
To get the broadcast address, simply fill the "host" part of your address with 1s. For example, the broadcast address of 192.168.1.128/26 is
Likewise, to get the usable range, just start by putting a 1 in the last place of the network name to get the first usable address, then fill the "host" part with 1s and put a 0 in the last place of the network name to get the last usable address.
Of course, eventually you should learn how to do it like TOOGAM explained, but this might be helpful if you need to visualise the subnets.