Sunday, June 26, 2011

Routing



Routing is a relay system by which packets are forwarded from one device to another. Each device in the network as well as the network itself has a logical address so it can be identified and reached individually or as part of a larger group of devices. For a router to act as an effective relay device, it must be able to understand the logical topology of the network and to communicate with its neighboring devices.

The router understands several different logical addressing schemes and regularly exchanges topology information with other devices in the network. The mechanism of learning and maintaining awareness of the network topology is considered to be the routing function while the movement of traffic through the router is a separate function and is considered to be the switching function. Routing devices must perform both a routing and a switching function to be an effective relay device.

A router receiving a packet from a host, the router will need to make a routing decision based on the protocol in use; the existence of the destination network address in its routing table; and the interface that is connected to the destination network. After the decision has been made the router will switch the packet to the appropriate interface on the router to forward it out. If the destination logical network does not exist in the routing table, routing devices will discard the packet and to generate an Internet Control Message Protocol (ICMP) message to notify the sender of the event.

Routing Tables

A routing table is a database repository that holds the router's routing information that represents each possible logical destination network that is known to the router. The entries for major networks are listed in ascending order and, most commonly, within each major network the subnetworks are listed in descending order. If the routing table entry points to an IP address, the router will perform a recursive lookup on that next-hop address until the router finds an interface to use. The router will switch the packet to the outbound interfaces buffer. The router will then determine the Layer 2 address that maps to the Layer 3 address. The packet will then be encapsulated in a Layer 2 frame appropriate for the type of encapsulation used by the outbound interface. The outbound interface will then place the packet on the medium and forward it to the next hop. The packet will continue this process until it reaches its destination.

There are two ways in which a routing table can be populated: a route can be entered manually, this is called static routing, or a router can dynamically learning a route. Once a router learns a route, it is added to its route table.

Static Routing

A statically defined route is a route is manually entered into the router. The purpose of this is to add routes to a router's routing table. Thus, static routing consists of individual configuration commands that define a route to a router. A router can forward packets only to subnets in its routing table. The router always knows about directly connected routes. By adding static routes, a router can be told how to forward packets to subnets that are not attached to it.

A static route can be entered into the router in global configuration mode with the following command:

ip route destination_ip_address subnet_mask { ip-address | interface } [ distance ]

In the ip route command, the destination_ip_address and subnet_mask is the IP address and subnet mask for the destination host. The ip-address parameter is the IP address of the next hop that can be used to reach the destination and interface is the router interface to use. The optional distance parameter specifies the administrative distance.

The advantages to using static routes in an internetwork are the administrator has total control of what is in the routers routing table and there is no network overhead for a routing protocol. The disadvantage of using only static routes is they do not scale well.

Dynamic Routing

Dynamic routing is a process in which a routing protocol will find the best path in a network and maintain that route. Once a route fails, the routing protocol will automatically find an alternate route to the destination. Routing protocols are easier to use than static routes. However, a routing protocol will consume more CPU cycles and network bandwidth than a static route.

Routing Protocols


There are two types of dynamic routing protocols: Interior Gateway Protocols (IGP) and External Gateway Protocols (EGP). IGPs are used to exchange routing information within an autonomous system (AS), which is a collection of routing domains under the same administrative control the same routing domain. An EGP, on the other hand, is used to exchange routing information between different ASs.

IGPs can be broken into two classes: distance-vector and link-state, and can also be broken into two categories: classful routing protocols and classless routing protocols.


Distance-Vector Routing

Distance-vector routing is consists of two parts: distance and vector. Distance is the measure of how far it is to reach the destination and vector is the direction the packet must travel to reach that destination. The latter is determined by the next hop of the path. Distance-vector routing protocols will learn routes from its neighbors. This is called routing by rumor. Examples of distance-vector routing protocols are: Routing Information Protocol (RIP), Interior Gateway Routing Protocol (IGRP), and Enhanced Interior Gateway Routing Protocol (EIGRP).

Link-State Routing

Link-state routing differs from distance-vector routing in that each router knows the exact topology of the network. This reduces the number of bad routing decisions that can be made because every router in the process has an identical view of the network. Each router in the network will report on its state, the directly connected links, and the state of each link. The router will then propagate this information to all routers in the network. Each router that receives this information will take a snapshot of the information. This ensures all routers in the process have the same view of the network, allowing each router to make its own routing decisions based upon the same information.

In addition, link-state routing protocols generate routing updates only when there is a change in the network topology. When a link, i.e., a point on a route, changes state, a link-state advertisement (LSA) concerning that link is created by the device that detected the change and propagated to all neighboring devices using a multicast address. Each routing device takes a copy of the LSA, updates its topological database and forwards the LSA to all neighboring devices. An LSA is generated for each link on a router. Each LSA will include an identifier for the link, the state of the link, and a metric for the link. With the use of LSAs, linkstate protocols reduces routing bandwidth usage.

Examples of link-state routing protocols are: Open Shortest Path First (OSPF) and Integrated Intermediate System to Intermediate System (IS-IS). Another protocol, Enhanced Interior Gateway Routing Protocol (EIGRP) is considered a hybrid protocol because it contains traits of both distance-vector and link-state routing protocols. Most link-state routing protocols require a hierarchical design, especially to support proper address summarization. The hierarchical approach, such as creating multiple logical areas for OSPF, reduces the need to flood an LSA to all devices in the routing domain. The use of areas restricts the flooding to the logical boundary of the area rather than to all devices in the OSPF domain. In other words, a change in one area should only cause routing table recalculation in that area, not in the entire domain.

0 comments:

Post a Comment

 
Custom Search

Copyright 2011 All Rights Reserved | SISCOMPC Designed by Bloggers Template | CSS done by Link Building