Saturday, 3 September 2011

Routing Basics


Routing is the process of moving the packets across networks from source to destination. The routing function is accomplished by routers. There are two types of routing: static routing and dynamic routing. In static routing the network administrator is responsible for the configuration of the “path”. This kind of routing can be very efficient in small networks where the topology doesn’t change or grow. In large scale networks dynamic routing is a must. With dynamic routing, routers are exchanging their routes with the other interconnected routers through different protocols. Of course, this is not accomplished auto-magically and network administrators have to configure the parameters of the protocol, establish routing and filtering policies, verify that the routers exchange information correctly and eventually troubleshoot in case of failure. This may seem like a very big task and you may ask why not use static routing. Well, imagine you have 300 routes in your network and they can change very often due to topology changes and link failures. You could manually change the static routes but this will take a lot of time and this results in a large amount of downtime. With dynamic routing, routers are able to automatically exchange the information needed to adjust the routing table according to the changes in your network topology in just a couple of seconds.
Static routing
The first step in understanding routing in your preparation for Cisco’s CCNA exam is to know what static routing and how it works.
Static routing is usually a good solution in small networks. If your topology doesn’t change and the possibility for a link failure is very small, you would probably go for static routing.
There are two types of static routes: directly connected routes and the so called static routes.
Directly connected routes are automatically generated after you assign an IP address to an interface. Let’s say you assign the IP address 192.168.1.0/24 to the FastEthernet0/0 interface. If you check the routing table after you assign this IP address, you will see that an entry for the network 192.168.1.0/24 is automatically inserted in it.
Router(config-if)#ip address 192.168.1.0 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#ctrl-Z
Router#show ip route
Codes: I – IGRP derived, R – RIP derived, O – OSPF derived,
C – connected, S – static, E – EGP derived, B – BGP derived,
* – candidate default route, IA – OSPF inter area route,
i – IS-IS derived, ia – IS-IS, U – per-user static route,
o – on-demand routing, M – mobile, P – periodic downloaded static route,
D – EIGRP, EX – EIGRP external, E1 – OSPF external type 1 route,
E2 – OSPF external type 2 route, N1 – OSPF NSSA external type 1 route,
N2 – OSPF NSSA external type 2 route
Gateway of last resort is not set
192.168.0.0/24 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, FastEthernet0/0
Static routes can also be configured with the ip route command. The syntax is ip route prefix mask { ip-address | interface-type interface-number [ip-address]} [distance] [name] [permanent] [tag tag]. The syntax is beyond CCNA requirements, so we will use only ip route prefix mask { ip-address | exit-interface }. For example, you have a network 192.168.10.0/24 which is available through the router with the IP address 192.168.1.2. To add the static route you must enter the following command in global configuration mode: ip route 192.168.10.0 255.255.255.0 192.168.1.2. Static routes are prefixed with the letter S in the show ip route output. If you have to specify an exit interface, you just replace the IP address of the next-hop router with the name of the interface.
Router(config)#ip route 192.168.10.0 255.255.255.0 192.168.1.2
Router(config)#ip route 172.16.1.0 255.255.255.0 192.168.1.2
Router(config)#ip route 10.0.0.0 255.255.255.0 serial 0/0/0
Router(config)#ctrl-Z
Router#show ip route
Codes: I – IGRP derived, R – RIP derived, O – OSPF derived,
C – connected, S – static, E – EGP derived, B – BGP derived,
* – candidate default route, IA – OSPF inter area route,
i – IS-IS derived, ia – IS-IS, U – per-user static route,
o – on-demand routing, M – mobile, P – periodic downloaded static route,
D – EIGRP, EX – EIGRP external, E1 – OSPF external type 1 route,
E2 – OSPF external type 2 route, N1 – OSPF NSSA external type 1 route,
N2 – OSPF NSSA external type 2 route
Gateway of last resort is not set
192.168.0.0/24 is subnetted, 1 subnets
S       192.168.10.0 [1/0] via 192.168.1.2
C       192.168.1.0 is directly connected, FastEthernet0/0
S    172.16.1.0/24 [1/0] via 192.168.1.2
S    10.0.0.0/24 is directly connected, Serial0/0/0
Most of the times, you will have to specify a default static route. A default route is used when the destination address does not match any of the current routes in the routing table. It doesn’t matter if you use static or dynamic routing or both. Usually the default route is set to the address of the router of your upstream provider. To set a default static route use the following command: ip route 0.0.0.0 0.0.0.0 [ip-address | exit-interface]. The IP address 0.0.0.0 with netmask 0.0.0.0 stands for all networks, or more exactly or other networks that are not present in the routing table.
Dynamic routing
Understanding dynamic routing is a critical requirement for the CCNA exam. You will find many questions about dynamic routing using different protocols in your exam. We will begin by explaining the key concepts and introduce you to different routing protocols. We suggest you to go through the whole series of routing articles because this is considered a very important topic in the preparation Cisco’s CCNA exam.
Routers are able to learn about the networks of other routers. This routing technique is called dynamic routing.
In large networks it’s almost impossible to use only static routing. The topology of these networks is changing too often, sometimes due to the extension of the network and sometimes due to link failures. To statically configure the routers every time a route changes is just impossible. Modern networks needed a routing technology able to scale to this kind of large networks. The first dynamic routing protocol ever released was RIPv1 back in 1982. However, as the networks evolved, RIP wasn’t able to scale as much as needed, so RIPv2 got his way into the networks. Of course, the time decided that modern networks needed something more scalable and we now have a larger choice of protocols: Open Shortest Path First (OSPF), Intermediate System-to-Intermediate System (IS-IS), Interior Gateway Routing Protocol (IGRP) and Enhanced IGRP (EIGRP), the last two being developed by Cisco. All these protocols are used as Interior Routing Protocols (IGPs), meaning that they are used for routing inside your network and will not be used for interconnecting with other networks. The today’s standard for interconnecting with other networks is the Border Gateway Protocol (BGP), or more exactly BGP4.
When using dynamic routing protocols, routers are able to fast recalculate the routes to a destination network. This process usually takes only a couple of seconds. Some protocols are able to make the changes faster while others are a little bit slower, depending on the algorithm they are using. The routers are exchanging some protocol specific messages. Depending on the protocol, these messages can be exchanged only when changes to the network occur or they can be exchanged on a regular basis.
Interior Gateway Protocols (IGPs) can be classified as two types:
-    Distance vector routing protocols
-    Link-state routing protocols
Distance Vector routing protocols are advertising routes as vectors of distance and direction. The distance is represented by a metric (for example, hop count), and the direction is the next-hop router or the exit-interface. These protocols are not suitable for big networks because the algorithm used, Bellman-Ford algorithm, does not allow the routers to know the exact topology of the network and the fact that they are sending periodic updates which can cause a degradation of the network in large scale networks. Examples of distance vector routing protocols are RIP and EIGRP.
Unlike distance vector routing protocols, Link-state routing protocols are maintaining a “map” of the whole topology by gathering information from all the routers in your network. They also do not send periodic updates, instead routers are exchanging information only when a change in the topology occurs. Networks which are using link-state routing protocols are also able to converge faster.
Routing protocols can be divided in two more classes. There are Classful Routing Protocols and Classless Routing Protocols.
With Classful Routing Protocols, routers do not send the subnet mask information. The assumed mask for any network is the default for their allocated class (class A, B or C). In other words, a Classful Routing Protocol is not supporting Variable Length Subnet Masks (VLSM). Examples of such protocols are RIPv1 and IGRP. This turned out to be a waste of IP space, and Classless Routing Protocols appeared.
Classless Routing Protocols include the subnet mask in their routing updates messages. This offers a big advantage in today’s networks, as networks can be divided in subnetworks, allowing to save the IPv4 addressing space. RIPv2, EIGRP, OSPF, IS-IS and BGP are all Classless Routing Protocols.

0 comments: