Classless routing
workfrom925
Member Posts: 196
in CCNA & CCENT
I'm trying to understand better about classless routing.
In classful routing, we have class A, B and C IP addresses with their pre-determined subnet masks. That's easy for me to understand.
In classless routing, since we always have to give subnet mask with its IP address, can I use subnet mask 255.255.255.0 with a network that starts with 10.0.0.0 to have only 254 host IP? And can I use subnet mask 255.0.0.0 for a network that starts with 192.0.0.0 to have about 16 million host IP?
In classful routing, we have class A, B and C IP addresses with their pre-determined subnet masks. That's easy for me to understand.
In classless routing, since we always have to give subnet mask with its IP address, can I use subnet mask 255.255.255.0 with a network that starts with 10.0.0.0 to have only 254 host IP? And can I use subnet mask 255.0.0.0 for a network that starts with 192.0.0.0 to have about 16 million host IP?
Comments
-
d6bmg Member Posts: 242 ■■■□□□□□□□^^ Last part: yes, you are right.
Use the binary conversion and binary bit-wise AND operation to understand the subnetting better.[ ]CCDA; [ ] CCNA Security -
mdomino Member Posts: 81 ■■□□□□□□□□Yes. As long as your routing protocol supports classless routing then you can use any valid IP with any valid subnet.
I'll use class B as an example.Classful Class B 255 .255 .0 .0 11111111.11111111.00000000.00000000
In a classless system you are able to modify the last two octets (all binary 0's) as much as you need, following subnetting rules. You could even use VLSM and have multiple different subnet masks of each network. This would be the same for a Class A (last 3 octets) or a Class C network. -
workfrom925 Member Posts: 196Yes. As long as your routing protocol supports classless routing then you can use any valid IP with any valid subnet.
I'll use class B as an example.Classful Class B 255 .255 .0 .0 11111111.11111111.00000000.00000000
In a classless system you are able to modify the last two octets (all binary 0's) as much as you need, following subnetting rules. You could even use VLSM and have multiple different subnet masks of each network. This would be the same for a Class A (last 3 octets) or a Class C network.
Can I also manipulate the first two octets for a class B address?
For example, a class B network such as 128.0.0.0 allows 65,536 hosts in a classful network. In a classless IP design, can I use class A default subnet mask 255..0.0.0 with it to have 16 millions hosts? -
pamccabe Member Posts: 315 ■■■□□□□□□□workfrom925 wrote: »I'm trying to understand better about classless routing.
In classful routing, we have class A, B and C IP addresses with their pre-determined subnet masks. That's easy for me to understand.
In classless routing, since we always have to give subnet mask with its IP address, can I use subnet mask 255.255.255.0 with a network that starts with 10.0.0.0 to have only 254 host IP? And can I use subnet mask 255.0.0.0 for a network that starts with 192.0.0.0 to have about 16 million host IP?
It sounds like you are talking about classful and classless addressing, not routing. You have classful and classless addressing down it seems like. There is also classless and classful routing which is how routers forward packets. The routing protocols themselves can even be classless and classful. (ex. RIP and RIPv2) I guess it is just wise to keep that in mind lol -
Xyro Member Posts: 623workfrom925 wrote: »Can I also manipulate the first two octets for a class B address?In a classless IP design, can I use class A default subnet mask 255..0.0.0 with it to have 16 millions hosts?
-
dmcneil330 Users Awaiting Email Confirmation Posts: 33 ■■□□□□□□□□Only 1 subnet (?) with 16,777,214 hosts, I believe. I'm only a bit past half-way through with CCENT level though, so I could be incorrect.
Yes you are correct you would have 24 host bits. To find the number of hosts you use, 2^x - 2 = 2^24 - 2 = 16,777,214 hosts. You would technically have only one subnet. However, for obvious reasons this would be a very poor design. I believe the best practice is to limit to 200 hosts.
if you were given 128.0.0.0 then you could modify the last three octets. Remember, in subnetting you take away host bits to create subnetwork bits. So if you are given the address space 128.0.0.0 255.0.0.0 you can borrow from any Zero (host bit) in the network mask you want as long as you keep a consecutive string of 1s. (i.e. 11111111.11110000.00000000.00000000 is acceptable but 11111111.11010000.00000000.00000000 is not).CCNP: SWITCH[X] ROUTE[] TSHOOT[] -
Xyro Member Posts: 623Yes, that isn't something I would have expected to be viable. It seemed strange to me.
-
dmcneil330 Users Awaiting Email Confirmation Posts: 33 ■■□□□□□□□□Yeah the key is when you are given a network mask say 255.255.192.0.
It equals: 11111111.11111111.11000000.00000000
You can do whatever you want to the zeros in the netmask. You cannot convert the 1s to zeros as that would be going outside of your range of addresses. You can only add 1s in the netmask. So this could be subnetted as:
11111111.11111111.11110000.00000000 or 255.255.240.0 Here i've added 2 more network bits by stealing some host bits. So i would have a total of 4 subnets I could use with each subnet containing 4094 hosts.CCNP: SWITCH[X] ROUTE[] TSHOOT[]