Thursday, June 30, 2011

Cisco IP Routing Notes Part 1

I started reading this book called Cisco IP Routing by Alex Zinn and it is one heck of a book. It is just filled with so much information about the internals of Cisco routers and routing. As always i take notes of my reading with techical stuff so here is part one. The book it kind of outdated all the examples were done with IOS 12.0(14) but cisco still has it on its recommend reading list. I hope a guru can stop by and point out some outdated information.


 
-Routers only check the source IP after receiving it from a interface when explicitly  configured to do so

Basic Routing Principles
Every router makes decisions on its own, based on the information it has in its routing table
You cant be sure that because one router has certain information in its routing table another router will have this same information
Routing is one way just because i have routing information in one direction dosent mean u will have information in the other direction

An update message of a classful protocol can carry routes of the following types.
  • Host routes
  • Subnet routes
  • Network routes
  • Default routes
To prevent this misunderstanding, routers connected to multiple major networks do not send subnet information about one major network into another. Instead, they send summary network routes. The receiving routers are supposed to install these routes in the routing tables with the default class address masks. A route from any major network with a nonzero host part of the address is considered a host route.The behavior when subnet routing information is not propagated from one major network to another is called automatic route summarization.

Classful Routing Operations
A router's behavior in a classful environment can be summarized as follows:
  • Classful routing protocols do not include subnet masks in routing updates.
  • Classful routing protocols hide subnet information from other major networks by announcing only summary network routes into them.
  • Classful routing protocols can announce host routes, which are used when hosts do not reside on the same segment as the rest of the subnet.
  • Each classful router can have the following types of routing information in its table:
    • Host routes Routes received with nonzero host address parts and implicitly assigned the network mask of 255.255.255.255 or static routes with explicitly configured masks.
    • Subnet routes Routes to subnets within the major network to which a router has an attachment. These routes are inserted into the routing table with subnet masks on the interface the update is received from used as route masks, unless it is a static route and was configured with different subnet mask.
    • Network summary routes Routes to other major networks. These routes are inserted into the routing table with the default classful address mask (without subnets) and represent other major networks if they are provided by routing protocols. This type of route can also be used to represent the rest of the local major network (the network default route). Such a route must be statically configured by the administrator.
    • Default routes Either a 0.0.0.0/0 route, which is marked as default by the router automatically, or other routes to any networks explicitly marked as default by the administrator or a routing protocol (see Chapter 4 for a detailed explanation).
  • While routing packets, routers pay attention to whether the destination major network is local (some of its subnets are directly connected).
  • If the destination major network is local, the router needs to have either a host route with a /32 mask or an explicit route to the subnet or a summary network route describing the rest of the local major network. If this condition is not met, the packet is dropped, and the default and supernet routes are not considered.
  • If the destination major network is not local, the routing table lookup algorithm is changed. The router looks for the best-matching route, paying attention to the length of the route masks; supernet routes may be taken. If no match was found, the router checks the default route. If there's no default route, the packet is dropped.
Following are some problems that can be seen in classful environments.
  • Variable-length subnet masks cannot be used, as routing updates do not contain route masks.
  • Automatic summarization to classful networks prevents use of noncontiguous addressing plans, such as private IP addresses for WAN links.
  • Use of default routes is limited, which can be a problem in very large networks because the only type of summarized route that can be distributed within one major network by routing protocols is the default. This occurs because if the routing protocol sends a network summary route for a local major network, this route is considered an update for zero subnet, not a network summary. So, every router must have either a full routing table or a network summary route representing the rest of the local major network configured manually.
Classless Routing Operations
The algorithm of the classless routing table lookup operation is really simple—look up the longest matching route in the routing table; if no matching route is available, use the default route. (If the default route is announced as 0.0.0.0/0, the last step is not needed, as this route matches all addresses.)

Routing Table Maintenance
 
Directly attached networks are major networks or subnets connected to a router's interfaces and known to the router from assigned IP addresses and corresponding subnet masks. These routes are always displayed with the C (connected) code in the output of the show ip route command.
Connected routes are calculated by applying the subnet masks to the IP addresses on the interfaces. These routes, one for each subnet assigned to the interface, are installed in and removed from the routing table whenever an IP-enabled interface goes up or down.

Directly connected routes reference only interfaces without next-hop addresses; that is, this term indicates the amount of next-hop information rather than the route source. Such routes can be identified by the is directly connected to phrase in the routing table .The only two sources that can supply directly connected routes are Connected, providing routes to directly attached networks, and Static.

Routing Table entries and encapsulation
If encapsulation is not specified on a serial link, for example, the default encapsulation of HDLC will be used. If PPP is used a directly connected route will be installed in the routing table  with a subnet mask of /32. This is because PPP install a route in the routing table to make sure the forwarding engine will chose the right link each time.

IP unnumbered
If the ip unnumbered command is used it will still install a route in the routing table. The route will be determined from the interface used following the ip unnumbered command.
interface Ethernet0
ip address 10.0.1.167 255.255.255.0
!
interface Serial0
ip unnumbered Ethernet0
encapsulation ppp

R1#show ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
...
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
C       10.0.1.0 is directly connected, Ethernet0
     30.0.0.0/32 is subnetted, 1 subnets
C       30.0.0.1 is directly connected, Serial0                        
R1#


Cisco IOS breaks the the data for a route down to two parts: the prefix descriptor, which contains information  such as covered address range, route source, and administrative distance and the path descriptor which contains the information needed to forward the packets: output interface, intermediate network address, and route metric.
The IOS stores information about interfaces in the interface descriptor block (IDB). IBDs are used for  both physcial and logical intefaces and store information such as encapsulation type, address of the interface input buffer pool, reference to the output queue structure, pointers to the functions of the interface drivers—software modules that communicate with the controllers—and so on.

No comments:

Post a Comment