CIDR Notation, Subnetting and Mathematics

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
2^8
8 bits in the octet.
Ah thanks, now that makes sense. I can't seem to find anything to do with that in my exam and in my support request. Good to know, so that I can use for future reference and maybe help someone else out who is also struggling in this.
 
R

[)roi(]

Guest
@Sinbad where does the 256 come from for subtracting purposes?
IP Address octet is 8 bits; 2 to the power of 8 is 256

2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
...
2^8 = 256

Side note:
  • the sum of the 7 lower bits is the value of the 8th bit minus 1 I.e. 256 - 1 = 255
  • the sum of the 4 lower bits is the value of the 5th bit minus 1 I.e. 16 - 1 = 15
 
Last edited by a moderator:

Düber

Well-Known Member
Joined
Jul 20, 2020
Messages
1,542
Thanks to this thread and its clear explanations a lot things have been made clear to me, and why some of what I have tried has not worked. This is the kind of stuff most of the tutorials assume you already know.

If I may be indulged.

Presumably it is the differing broadcast address that does not allow subnets to communicate natively?
If so, are there any ranges where the broadcast address is common to both and does it allow communication without adding a routing table entry?

If I have two or more subnets on a single cable, theoretically messages not meant for one would reach a dead end or a device or machine that does not know what to do with them, but on a practical level am I slowing both networks down with all these extra packets? In other words should each subnet run on its own cable?
 

dabean

Well-Known Member
Joined
Jul 17, 2020
Messages
582
Presumably it is the differing broadcast address that does not allow subnets to communicate natively?
Yes

If so, are there any ranges where the broadcast address is common to both and does it allow communication without adding a routing table entry?
No (mathematically).

If I have two or more subnets on a single cable, theoretically messages not meant for one would reach a dead end or a device or machine that does not know what to do with them, but on a practical level am I slowing both networks down with all these extra packets? In other words should each subnet run on its own cable?
You can't really have two subnets on the same cable since each device needs one for itself. Traffic between subnets will use the same cable, and broadcasts won't be sent over that.

The broadcast is only used to get the MAC address of the destination. The bulk of the traffic will be point to point after that.
AddressResolutionProtocol
 

Sinbad

Well-Known Member
Joined
Jun 23, 2020
Messages
1,736
Thanks to this thread and its clear explanations a lot things have been made clear to me, and why some of what I have tried has not worked. This is the kind of stuff most of the tutorials assume you already know.

If I may be indulged.

Presumably it is the differing broadcast address that does not allow subnets to communicate natively?
If so, are there any ranges where the broadcast address is common to both and does it allow communication without adding a routing table entry?

If I have two or more subnets on a single cable, theoretically messages not meant for one would reach a dead end or a device or machine that does not know what to do with them, but on a practical level am I slowing both networks down with all these extra packets? In other words should each subnet run on its own cable?
You can indeed have multiple subnets on a single cable. Devices would only pick up broadcasts for the subnet they are configured for, and will not try to communicate directly with devices outside their subnet
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Thanks to this thread and its clear explanations a lot things have been made clear to me, and why some of what I have tried has not worked. This is the kind of stuff most of the tutorials assume you already know.

If I may be indulged.

Presumably it is the differing broadcast address that does not allow subnets to communicate natively?
If so, are there any ranges where the broadcast address is common to both and does it allow communication without adding a routing table entry?

If I have two or more subnets on a single cable, theoretically messages not meant for one would reach a dead end or a device or machine that does not know what to do with them, but on a practical level am I slowing both networks down with all these extra packets? In other words should each subnet run on its own cable?
You're welcome, that's why I started this thread for the purpose of learning and sharing what we know. It helps others who want to write their networking exam.
 

dabean

Well-Known Member
Joined
Jul 17, 2020
Messages
582
You can indeed have multiple subnets on a single cable. Devices would only pick up broadcasts for the subnet they are configured for, and will not try to communicate directly with devices outside their subnet
Yes, I think I misunderstood the question.

You can also have multiple addresses per network card (OS dependant, but I can't think of one that can't) if you need to communicate with something on a different subnet without using a router.

ip.png
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Ok one more thing. I decided to find a random website with subnetting quizzes and I"m stuck, yours truly. I mean really stuck with using an IP of 61.31.188.106

Please explain to me how this works.

Source: https://www.nybi.org/subnet-2l.php

I need to find the 1st, last, broadcast address and subnet mask. That much I understand. I do know how to calculate the CIDR notation.

PS. I don't want to know how many hosts I have (we've already covered that earlier in the thread). I need to know how I am going to be able to find the first, last, broadcast address and subnet mask on any random IP address.

PS1. Table attached. That much I know but where do I get that number from? From the valid subnet bits after subtraction (256-240)?

Untitled.jpg

If I am reading this correctly, I should be going from 10.0.0.0 to 10.255.255.240 as above?
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Ok one more thing. I decided to find a random website with subnetting quizzes and I"m stuck, yours truly. I mean really stuck with using an IP of 61.31.188.106

Please explain to me how this works.

Source: https://www.nybi.org/subnet-2l.php

I need to find the 1st, last, broadcast address and subnet mask. That much I understand. I do know how to calculate the CIDR notation.

PS. I don't want to know how many hosts I have (we've already covered that earlier in the thread). I need to know how I am going to be able to find the first, last, broadcast address and subnet mask on any random IP address.

PS1. Table attached. That much I know but where do I get that number from? From the valid subnet bits after subtraction (256-240)?

View attachment 5470

If I am reading this correctly, I should be going from 10.0.0.0 to 10.255.255.240 as above?
Never mind, I got this figured out.

I even managed to remember the Class A, Class B and Class C subnets that go with the CIDR notations from /8 to /30.

I think I am ready to do this exam.
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Ok this is one I'm having a little trouble grasping.

Q. What are the network address, broadcast address, and the subnet mask for a host with the IP Address below?

IP Address: 137.142.187.151 /23

For some funny reason, I got this one wrong. I got about at least 10 different ones done right and this one kind of stumped me.

If I assume the following is correct, the subnet falls under Class B. Therefore it makes it 255.255.254.0, that much I know is correct. It's the first and broadcast IP addresses that I"m having a little issue with.

Please tell me that I have to split this into 2 x 256 subnets, making it go from 137.142.186.0 to 137.142.187.255 (after calculating the number of hosts in total, making it 512) because it is no use using a table to find the first, last IP and broadcast address if I get the number 512 (510 available hosts).

I believe the same principal applies to class A addresses but with 3 x 256 subnets split up?
 

Sinbad

Well-Known Member
Joined
Jun 23, 2020
Messages
1,736
Something to remember. Cidr = classless.
So it's not actually correct to talk about classes of networks in this context.
Under classful addressing, all your class a networks have an 8 bit subnet, all your class bs 16, and class cs 24.
 

Sinbad

Well-Known Member
Joined
Jun 23, 2020
Messages
1,736
Ok this is one I'm having a little trouble grasping.



For some funny reason, I got this one wrong. I got about at least 10 different ones done right and this one kind of stumped me.

If I assume the following is correct, the subnet falls under Class B. Therefore it makes it 255.255.254.0, that much I know is correct. It's the first and broadcast IP addresses that I"m having a little issue with.

Please tell me that I have to split this into 2 x 256 subnets, making it go from 137.142.186.0 to 137.142.187.255 (after calculating the number of hosts in total, making it 512) because it is no use using a table to find the first, last IP and broadcast address if I get the number 512 (510 available hosts).

I believe the same principal applies to class A addresses but with 3 x 256 subnets split up?
A /23 has 9 bits of address and 23 bits of subnet.
So subnet mask is 255.255.254.0
Network address is 137.142.186.0 to 187.255 as you said.
You are not splitting it into anything.
It's one subnet. That's what the subnet mask means.
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
@[)roid(]
A /23 has 9 bits of address and 23 bits of subnet.
So subnet mask is 255.255.254.0
Network address is 137.142.186.0 to 187.255 as you said.
You are not splitting it into anything.
It's one subnet. That's what the subnet mask means.
Then explain to me how this works from 137.142.186.0 to 137.142.187.255 (the numbers being different in the 3rd octet)
 

Sinbad

Well-Known Member
Joined
Jun 23, 2020
Messages
1,736
Because to get 510 addresses you need to use 1 bit from the third octet, which is why it's a /23. You need 9 bits to represent numbers from 256 to 511.
 
Top