Thursday, October 11, 2007

Classfull / Classless Routing

There are three main classes of IP addresses. You know about A, B, and C already, right? If not, you are lost already; this is not the post for you. You need to gain an understanding of IP addresses before you venture further. It is painfully boring, but it is information you will use on a daily basis in the networking world. Just Google or Wiki "IP addressing and subnetting".


Your Cisco router is classfull by default. This means that it will obey the conventions of the IP classes when routing. If you have configured RIP as your routing protocol and enabled the network 172.16.0.0 for broadcasts, then your router will assume that the interface with an address on 172.16.0.0 will be able to route all 172.16.0.0 traffic.


Here is the problem: Let's say that Fastethernet 0/0 on your router is at 172.16.1.1 with a 255.255.255.0 address. This means that it is attached to a network that includes 172.16.1.1 through 172.16.1.255, right?


Now, your router is also attached to a 10.10.10.0 network, which attaches to a remote router with an interface in the 172.16.99.0 network (/24 or 255.255.255.0 subnet mask, as well.) Therefore, the remote router (which shares RIP updates with your router) can get to 172.16.99.1 through 172.16.99.255 and your local router knows this; you can see it in the routing table.


The point of using RIP is so that your router and the remote router talk to each other and share this information, right? So, if your local router receives a packet destined for 172.16.99.100 it should look in its routing table and see that the most specific match is to use the 10.10.10.0 network and route the packet to the remote router, which has a directly connected interface in the 172.16.99.0 network. However, if you have left the router defaulted to "classfull", this will not happen.


If your router is operating as classfull, it will take a packet destined for 172.16.99.100 and only look at the "172.16" portion. That is bacause those are the only octets relevant in a class B address. If it is only looking at the first two octets when it makes its routing decision, the router will choose the directly connected interface with "172.16" every time--even though that interface does not have access to 172.16.99.100. Stupid router.


If you want to make your router a free spirit, throw out the conventions of classfull routing, break all the rules, and find its way to 172.16.99.100, you need to enter the following command:


Router(config)#ip classless


Your router will no longer have any class, just like you. More importantly, your router will look for a more specific match in its routing table, taking into account the subnets that it knows about through RIP.

IGRP Facts

Interior Gateway Routing Protocol (IGRP) is an improvement on RIP, but just barely. I have never seen it in use in the field, nor have I ever read someone claiming that IGRP is the best protocol for a specific purpose. Basically, it is an option on Cisco routers so you need to know about it if you are studying for certification, but you will probably never need this information in real life.


Real world routing protocol advice: if you have a small, simple network use RIP to dynamically share routing information among routers. If you have a large, complex network and/or security is a concern, use EIGRP. The other protocols (IGRP, OSPF, and IS-IS) are just about worthless in comparison to RIP and EIGRP. The only caveat to this is if you are connecting your network to a non-Cisco powered network. In that case, your routing protocol will be dictated by the capabilities of the neighbor router, and OSPF may be your best choice here. Let's hope that never happens to you.


IGRP Facts


I just want to share a few quick facts about IGRP that you may not know which will help when you sit for a Cisco certification:


-The components of the IGRP routing metric are bandwidth, delay, reliability, load, and MTU.


-IGRP differs from rip because IGRP is more suitable for large networks, it uses a more flexible metric for route selection, and it can select multiple non-equal paths to a destination.


-When you configure IGRP for un-equal cost load-balancing, you must observe several rules. First, The maximum paths you can set is 6. Second, The next-hop must be closer to your destination than the local router, according to the local router's best path. Third, the alternate path metrics must be within a specified variance of the best local metric.

Quit Buggin Me

There is a command that I so rarely need that I sometimes forget its syntax when I do need it.



Have you ever been on a router where someone left debugging on? Perhaps it was you, or it was the last dial-in support jerk who did what he had to do and left the debug on because...why would he care if debugging is on, he's out of it.



Anyhow, debugging is on and scrolling crap accross your screen so fast you can't remember where you were in the command you are typing out. Remember this gem:


router#no debug all


Do yourself, and the next guy, a favor: remember to enter that command when you resolve the issue you had debuggin on for, huh?