Wednesday, January 30, 2019

Classful vs CIDR vs FLSM vs VLSM




Classful

Classful addressing is how the early Internet was formed. IP assignments were given on the Classful 
Boundaries:

Class A     First Octect: 0-127     Subnet Mask: 255.0.0.0
Class B     First Octect: 128-191   Subnet Mask: 255.255.0.0
Class C     First Octect: 192-223   Subnet Mask: 255.255.255.0
Class D     First Octect 224-239    Multicast
Class E     First Octect 240-255    Reserved / Unused

The idea was, if you were a company that needed 200 IP addresses, a class C assignment would have been provided. If you were a company that needed 50,000 IP addresses, a class B would have been provided. And if you were one of the few companies that justified requiring over 65k~ IP addresses, you would be given a Class A.

Obviously, this lead to a lot of wasted IP addresses. If, for instance, you only needed 300 IP addresses, a Class C wouldn't cut it, so you would end up with a Class B and nearly 60,000 IP addresses would be wasted.

Classful addressing "evolved" into what we know of as Classless Inter-Domain Routing, or CIDR
CIDR

With Classless Inter-Domain Routing, IP assignments were not limited to their classes. In effect, the entire unicast range (First octect 0-223) can be broken up into any size network.

Instead of requiring subnet masks to be 255.0.0.0 or 255.255.0.0 or 255.255.255.0 in the IP assignment from IANA/RIRs, they could be anything -- and for simplicity slash notation was adopted.

·         If you need 300 IPs? You get a /23.
·         If you need 500 IPs? You also get a /23.
·         If you need 1000 IPs? You get a /22.
·         If you need 70,000 IPs? You get a /15
·         If you need 250,000 IPs? You get a /14 (instead of a /8 that you would have gotten in the Classful world)

FLSM

Fixed Length Subnet Mask refers to a strategy where every one of your networks within your infrastructure was the same size.

Whether you got a classful assignment or a classless assignment from your RIR, you can deploy the IP addresses in a Fixed Length manner. For example:

You are assigned by your RIR this /24: 200.2.2.0/24

You have one Router, with the following requirements of IP addresses and designation of addresses within your assignment:
·         Fa0/0 - Needs 10 IP addresses - Assigned: 200.2.2.0/26
·         Fa0/1 - Needs 20 IP addresses - Assigned: 200.2.2.64/26
·         Fa0/2 - Needs 40 IP addresses - Assigned: 200.2.2.128/26
·         Fa0/3 - Needs 15 IP addresses - Assigned: 200.2.2.192/26

Because Fa0/2 needed 40 IP addresses, the minimum size for all your networks is a /26, and these four router interfaces have used up all 256 addresses of your assigned IP space, even though you only needed 85 IP addresses).

Obviously this is a huge waste. So the question that follows is why was this ever a thing? The reason: To save bits on the wire.

The early early routing protocols, aka RIP, saved bits on the wire by not included the subnet mask... the mask for alladvertised networks was assumed to be the same mask assigned to the receiving interface.
Try it, fire up to routers in GNS3 (or maybe even packet tracer). Configure four /26's on one and four /27's on the other. Configure the link between the routers as a /26 and /27 respectively, but actual interfaces within the same /27 (aka, so they can still ping despite the non-matching subnet mask). Fire up RIP on all networks/interfaces and watch what happens. You'll see the router's perceive each other's advertisements as their own subnet mask.

The point being... (and this is often often confused in the industry)... FLSM is not the same thing as Classful assignments. FLSM is simply using one subnet-mask on all your router interfaces, on all your routers in your deployment

Whether the addresses you received from IANA/RIR came Classful or Classless is irrelevant to FLSM.
VLSM
As we can see in the example above, FLSM leads to many wasted addresses. The evolution of FLSM is what brought us to VLSM, or Variable Length Subnet Mask. Hopefully at this point you can deduce what VLSM is (as compared to FLSM):
FLSM is a subnet deployment strategy that requires all subnet-masks to be the same size. VLSM is a subnet deployment strategy that allows all subnet-masks to be variable sizes.
The same example above:
You are assigned by your RIR this /24: 200.2.2.0/24
You have one Router, with the following requirements of IP addresses and designation of addresses within your assignment:
·         Fa0/1 - Needs 20 IP addresses - Assigned: 200.2.2.0/27
·         Fa0/3 - Needs 15 IP addresses - Assigned: 200.2.2.32/27
·         Fa0/2 - Needs 40 IP addresses - Assigned: 200.2.2.64/26
·         Fa0/0 - Needs 10 IP addresses - Assigned: 200.2.2.128/28
Assigning the minimum IPs blocks to each network you've only assigned out .0-.139, leaving you a remaining 116 IP addresses for expansion. Not perfect, but definitely much better than FLSM.

TLDR:
·         Classful addressing is an IP Assignment policy mandating IANA/RIR give out address blocks on bit boundaries (/8, /16, /24)
·         Classless or CIDR is an IP assignment policy allowing IANA/RIR to give out address blocks of any size, as required
.
·         FLSM mandates that every network within your deployment be the same size -- required for archaic routing protocols like RIP
·         VLSM allows any network within your deployment to be any size


No comments:

Post a Comment

Which Python course is best for beginners?

Level Up Your Python Prowess: Newbie Ninjas: Don't fret, little grasshoppers! Courses like "Learn Python 3" on Codecade...