Monday, January 31, 2011

VLSM & Summarization

Man, I thought I'd never be done talking about switches.  Now it's on to our next topic on the ICND2's objectives: implementing IP addressing schemes to meet network requirements in an enterprise branch office network.  In order to understand this post, I recommend you know how to perform basic classful subnetting, as it was covered in the ICND1.

VLSM, or Variable Length Subnet Masking is a way to preserve address space by splitting up a block of addresses into multiple smaller chunks.  Consider it as the ability to change your subnet mask wherever.  It lets you use custom subnet masks for each part of the network.  The easiest way to learn VLSM is to see it, and the best way is to do it.  Take a look at the following image, and forgive my depiction of serial links.

So, the rule with VLSM is to start with the largest subnets first.  That means the left network.  We need to provide at least 62 hosts, and waste as few addresses as possible.  Here's the way I remember my network masks.
Start with the base /24, provides 256 address.
A single /25 provides half that, 128,
/26 = 64
/27 = 32  Remember two of those addresses are used as the network and broadcast address, so that leaves us 62 usable host addresses, perfect!

So the left side of the network uses 192.168.0.0/26, providing the host addressed 192.168.0.1-62, since .0 and .63 will be used for the network and broadcast address.

Next we deal with subnet C, which needs 14 hosts with room for expansion.  So lets continue talking halves.
/27 = 32
/28 = 16
A /28 would work for the current setup, but if we want to leave room for expansion, we should use the /27.  This subnet's address will start right where our last one left out, so it uses 192.168.0.64/27 providing usable addresses of 192.168.0.65-94 (.64 and .95 are reserved).

The top part of the network needs at least 7 hosts, so do you think we will use a /28 or a /29?  A /29 provides 8 addresses, but only 6 of them are usable; we need a /28 mask.
192.168.0.96/28 providing usable addresses 192.168.0.97-110.

All done? No.  It's tricky, but remember the interfaces for the serial links need IP addresses too!  In the name of efficiency, all point-to-point subnets should use a /30, which provides just 2 usable addresses.
The links will use the following addresses:
192.168.0.112/30 (.113 & .114 will be used)
192.168.0.116/30 (.117 & .118 will be used)
192.168.0.120/30 (.121 & .122 will be used)

To recap, here's what our network ends up looking like with VLSM addressing:
I just want to mention that this looks really good when you're designing it, and it should mimic what is on the exam, but in the real world you'll hopefully be working for a company that's growing, and you definitely don't want to run out of addresses because you were trying to be so efficient.  If the subnetwork on the left suddenly gained another user, you'd have to redesign this whole scheme, so always leave room for growth!

Now that you know how VLSM works, take caution that you know it can only be used with a classful routing protocol, such as EIGRP, OSPF, RIPv2, etc.  It will NOT work with RIP or IGRP.

While I'm on the topics of routing protocols and IP addresses, I want to introduce the next big topic, Summarization.  Summarization is the processes of combining multiple routes into one in order to speed up route processing.  You see, the way routers work is they get a destination IP and they look down their routing table for a match.  The larger the routing table, the longer it will take to find a match.  By combining individual routes into larger groups, you make the routing table smaller, and subsequently, the router faster.

Imagine you have a whole bunch of routers connected to each other.  Connected to one of these routers are the following networks:
192.168.0.0/24
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
In order for every other router, they will need to have entries for each network in order to reach them.  What summarization does is combine those four routes into a
192.168.0.0/22

This works because all the other routers need to go to this router in order to get to those networks anyway, so they don't really need to have a separate route for each one.  What if you add another network to this router: 192.168.4.0/24.  The summary route will no longer work, as it does not encompass the new network. You have two choices, either expand the summary route to a /21, which will also absorb .5.0/24, .6.0/24, and 7.0/24, or just leave it as is.  If you leave it as is, routers will have the summary route and the additional route, and you will not waste the other 3 networks.  If you end up adding another network or two, then you can push the summary route back to a /21, and not waste so many addresses. 

Now, that's the efficient way to summarize.  You should also know the incorrect way, the automatic way.  By default, most routing protocols have auto summarization turned on by default.  This means they summarize networks back to their classful boundaries.  So instead of getting our summary route, you'd end up with 192.168.0.0/16.  Woahsummarization, which you'll need to do if you plan on using VLSM/discontiguous network schemes.

You can do that with the command
Router(config-router)#no auto

I'll show you the commands to create summary routes when I talk about EIGRP and OSPF routing protocols, but for now, just stick to the basics.  Try practicing some summary routes on your own; with VLSM and summarization, practice really does make perfect (or at least gets you closer).

Thanks for reading!

No comments:

Post a Comment