Interior Gateway routing Protocols (IGP)

brrrclergymanΔίκτυα και Επικοινωνίες

18 Ιουλ 2012 (πριν από 5 χρόνια και 1 μήνα)

295 εμφανίσεις

Interior Gateway routing Protocols (IGP)
Within an Autonomous System (AS), most IGP routing algorithms can be classified as conforming to one
of the following algorithms:
• Distance Vector – The distance vector routing approach determines the direction and distance
(vector) to any address prefix in the network
• Link State – The link state recreates the exact topology of the entire, or at least the partition of the
network in which the router is located
There is no single best routing algorithm for all networks. Each routing protocol provides the information
differently.Distance Vector Routing Protocols
In a distance vector-based routing algorithm, each router passes periodic copies of its routing table to each
of its neighbor routers. These periodic updates between routers communicate topology changes.
Each router receives a routing table from each of its direct neighbor. For example in the bottom Figure on
the opposite page, Router RB receives information from Router RA. Router RB adds its distance vector
metric, which in RIP is the number of hops to each of each of its other neighbors, changing the distance
vector and stores it in its routing table. Router RB then passes its routing table to its other neighbor, Router
RC. This step-by-step process occurs in all directions between direct-neighbor routers, as illustrated by the
arrows between the routers in the Figure on the opposite page.
Using this process, the algorithm accumulates network distances so it can maintain a database of network
topology information. A characteristic of distance vector algorithms is that the algorithm does not allow a
router to know the exact topology of the network.Distance Vector Routing Protocols
Discovering Routes to Destination Networks
In the Figure on the opposite page, we assume that the interface to each directly connected network has a
distance of 0.
In distance vector routing protocols, the algorithm of discovering routes to destination networks is as
follows. A router discovers the best path to a non-directly connected destination network based on the
accumulated metrics from each neighbor. Neighboring routers provide information for routes not directly
connected.
In the example shown on the opposite page, networks 172.21.10.0 and 172.21.11.0 are directly connected
to router RA. The distance to each of these networks is 0 (from our above assumption). Networks
172.21.12.0 and 172.21.13.0 are not directly connected to Router RA. Each of these networks, as illustrated
in RA routing table, has an accumulated distance vector to show how far away the network is in the given
direction. Network 172.21.12.0 is 1 hop away from RA in the direction of the Serial interface S0. Network
172.21.13.0 is 2 hops away from RA in the direction of Serial interface S0. Distance Vector Routing Protocols
Selecting Best Route
In a network, multiple routes to a destination may exist. The primary objective of the routing protocol
algorithm is to determine the best route among multiple routes. When the algorithm determines the best
route, it enters this best route to the destination network into the routing table if it (the destination network)
did not already exist in the table. If it is already in the routing table, the routing algorithm may update the
entry (in case it is different from what is already in the table).
Each distance vector routing protocol uses a different routing algorithm to determine the best route. The
algorithm generates a number called the metric value for each route through the network. Typically, the
smaller the metric, the better the path. RIP uses the number of hops.
Note that in the example shown on the opposite page, the direct path from Router RA to Router RB is
considered to be a better path than the path from RA to RB via RC. This is despite the fact that the path via
RC has more bandwidth (T1 compared to 56 Kbps). Distance Vector Routing Protocols
Routing Loops (1)
When a failure occurs (or a configuration change takes place), there is an inevitable interval of time
between the failure occurring (or configuration change) and the routers finding out about it. During this
time interval, some routers will still believe that the destination is reachable and will therefore send any
traffic to that destination in the direction of where the destination used to be. This traffic will end up into a
black hole and will be discarded. Although some routing protocols are very efficient at detecting and
avoiding this condition, it can never be eliminated completely because the routing updates take a finite
amount of time to propagate to all the routers. This is the reason that typically the routers that are furthest
away (topologically speaking) will take the longer to find out about the failure (or configuration change),
while the routers that are nearby may know about the failure (or configuration change) sooner. The
example illustrated in the Figure on the opposite page will explain how the distance vector routing protocol,
namely RIP, detects a failure condition.
We assume that Router RC interface E0 to network 172.21.13.0 fails. Before the failure, all the routers will
have consistent knowledge and correct routing tables. As shown in the Figure on the opposite page, RC is
directly connected to network 172.21.13.0 with a distance of 0. RA route to network 172.21.13.0 is via RB
with a hop count of 2.Distance Vector Routing Protocols
Routing Loops (2)
When interface E0 on Router RC fails, RC detects the failure and stops sending packets out over this
interface.
As the Figure on the opposite page illustrates, RB and RC have not yet received notification of the failure:
• Router RB still believes that it can reach network 172.21.13.0 in 1 hop via its serial interface S0,
as its routing table is indicating.
• Router RA still believes that it can reach network 172.21.13.0 in 2 hops via its serial interface S0,
as its routing table is indicating.Distance Vector Routing Protocols
Routing Loops (3)
When Router RC receives a new periodic update from Router RB, it realizes that it has a viable route to
network 172.21.13.0 via RB (better that its down interface E0). Note that RB has not yet received
notification of the failure. RC updates the entry for network 172.21.13.0 in its routing table to indicate that
it can reach network 172.21.13.0 in 2 hops via its serial interface S0. The reason that RC updates the entry
in the table with 2 hops is that the update it receives from RB indicates that RB can reach network
172.21.13.0 in 1 hop. RC adds to this an additional hop to reach RB, accounting for the 2 hops.Distance Vector Routing Protocols
Routing Loops (4)
When router RB receives a new periodic update from Router RC, it finds out that RC can reach network
172.21.13.0 in 2 hops. RB recomputes its distance to network 172.21.13.0 and figures out that it can reach
network 172.21.13.0 in 3 hops (=1 hop to reach RC and 2 hops for RC to reach 172.21.13.0). RB changes
its routing table entry for 172.21.13.0 from 1 to 3.
Now when Router RA receives the update from Router RB, it finds out that RB can reach network
172.21.13.0 in 3 hops. RA recomputes its distance to network 172.21.13.0 and figures out that it can reach
network 172.21.13.0 in 4 hops (=1 hop to reach RB and 3 hops for RB to reach 172.21.13.0). RA changes
its routing table entry for 172.21.13.0 from 2 to 5.
Because RA, RB, and RC each believes that the best path to networks 172.21.13.0 is through each other,
packets destined to network 172.21.13.7 will continue to bounce among these 3 routers.Distance Vector Routing Protocols
Routing Loops (5)
Counting to Infinity
The invalid updates for network 172.21.13.0 continue to loop among RA, RB, and RC. Until a mechanism
can stop the looping, the routers keep updating each other with new increasing hop count to reach network
172.21.13.0.
This condition is referred to as count-to-infinity.Distance Vector Routing Protocols
Routing Loops (6)
Defining a Maximum
Distance vector routing protocols define some maximum value to be infinity. In RIP a maximum allowed
value for the hop count is considered to be infinity. This value is 15 hops.
Using this mechanism, the routing protocol permits the routing loop until the hop count exceeds the
maximum allowed value of 15. As shown in the Figure on the opposite page, each router routing table has
in its entry for network 172.21.13.0 the value of 16 as the hop count. At this point the network 172.21.13.0
is considered unreachable and any packet destined for 172.21.13.0 will be discarded.Distance Vector Routing Protocols
Solutions to Routing Loops (1)
Split Horizon
The Split Horizon technique may be used to eliminate routing loops and speed up the convergence of the
routing protocol when failure occurs or a configuration change takes place. The routing protocol converges
when the routing tables in all the routers are consistent.
The Split Horizon mechanism prohibits sending a route update about a destination network over the same
interface from which the original route update (about that destination network) has arrived. In the example
of the Figure shown on the opposite page:
• Before the failure of network 172.21.14.0, Router RB was receiving the periodic route updates
about network 172.21.13.0 from Router RC over its serial interface S0. Therefore Router RC will
not send periodic route updates about network 172.21.13.0 over its serial interface S0.
• Before the failure of network 172.21.13.0, Router RC was receiving the periodic route updates
about network 172.21.13.0 from Router RB over its serial interface S0. Therefore Router RA will
not send periodic route updates about network 172.21.13.0 to Router RB over its serial interface
S0.
Router RC will discard the packets destined for network 172.21.13.0.Distance Vector Routing Protocols
Solutions to Routing Loops (2)
Route Poisoning
The Route Poisoning technique attempts to eliminate routing loops that may be caused by inconsistent
routing updates due to a failure or a configuration change. With this technique a router when detecting that
a destination route has gone down, sets a table entry for that destination route that keeps the network
consistent while the other routers in the networks gradually converge on the topology change. This
technique is often used with the Hold-down Timers scheme that we will describe shortly.
The Route Poisoning technique is illustrated by the example shown in the Figure on the opposite page. In
this example when Router RC detects that the destination network 172.21.13.0 has gone down, it poisons
its link to network 172.21.13.0 by setting the entry for that network in its routing table to infinity. By
poisoning its link to network 172.21.13.0, Router RC in effect declares that network 172.21.13.0 is
unreachable and will consequently discard routing updates for this network coming from neighboring
routers that might claim to have a viable alternate path. So when Router RB sends a routing update
claiming that it can reach network 172.21.13.0, Router RC will discard this update. Note that until Router
RB receives the Route Poisoning update from Router RC, it might forward packets destined to network
172.21.13.0 to Router RC where they will be discarded.Distance Vector Routing Protocols
Solutions to Routing Loops (3)
Poison Reverse
When Router RB Receives a Poison Reverse indication about destination network 172.21.13.0 from Router
RC, Router RB sends a Poison Reverse update to RC indicating that network 172.21.13.0 is possibly down.
Note that this is an exception to the Split Horizon rule that prohibits sending a route update about a
destination network over the same interface from which the original route update has arrived.
The Poison Reverse scheme is used to ensure that all the routers have received the update about the
poisoned reverse route.Distance Vector Routing Protocols
Solutions to Routing Loops (4)
Hold-Down Timers
Hold-down timers are used to prevent routing updates from inappropriately reinstating a route to a
destination network that may not be valid anymore. Hold-down timers work as follows:
• When a router receives a route poisoning indication for a destination network, the router marks the
network entry in its routing table as possibly down and starts a hold-down timer for that network.
In the example shown in the Figure on the opposite page upon receiving a poison reverse
indication for network 172.21.13.0 from Router RC, Router RB marks the entry for network
172.21.10.13 in its routing table as possibly down, and starts a hold-down timer. Similarly when
router RA receives an indication from Router RB that network 172.21.13.0 is possibly down, it
marks the entry for network 172.21.13.0 as possibly down and starts a hold-down timer.
• The following takes place when a new routing update arrives from a neighboring router with a
better hop count than the one originally recorded for the network that is in the possibly down state.
The router updates the network entry in its routing table according to the new hop count and stops
the hold-down timer.
• When a new routing update arrives from a neighboring router with the same or larger hop count
than the one originally recorded for the network that is in the possibly down state, the router
ignores the update. The hold-down timer is kept running. This will permit more time for the
knowledge of the route change to propagate through the entire network.
• When the router is running a hold-down timer for a certain destination network, it keeps the entry
for that network in its routing table in the possibly down state.
• The hold-down timer interval is typically set to be just greater than the period of time necessary to
update the entire network with a routing change.
.Distance Vector Routing Protocols
Solutions to Routing Loops (5)
Hold-Down Timers
When detecting a failure condition or a configuration change, a router does not wait for its regularly
scheduled routing update that occurs every 30 seconds to notify its neighboring routers. The router
immediately sends a routing update to its neighboring routers notifying them of the change in its routing
table. This update will in turn trigger other updates from the neighboring routers notifying their adjacent
neighbors of the change. This wave of updates will propagate through the network notifying all the routers
of the change.
Usually triggered updates would be sufficient to propagate the change to all the routers. However, there are
situations when this may not happen:
• RIP routing updates are carried in UDP datagrams that may be lost or corrupted.
• Since the triggered updates are not synchronized, different routers will issue the triggered updates
at different instances of time. Therefore it is possible that a router shortly after receiving the
triggered update, will receive another routing update from a different neighbor that has not yet
received the triggered update reinserting the route that is not valid back into its routing table.
Typically using triggered updates with hold-down timers reduce the chances that these synchronization
problems will happen.Distance Vector Routing Protocols
Characteristics of the RIP Protocol
This page is left blank intentionally.Link State Routing Protocols
Examples of link state routing protocols are:
• OSPF – Open Shortest Path First
• IS-IS – Intermediate System-to-Intermediate System
We will focus on OSPF in the discussion below.
Link State indicates that a router executing OSPF will be concerned with tracking the operational state of
each of its network interfaces. A change in the operational state of an interface is what triggers the router to
send a routing update. This is in stark contrast to RIP, which is a timer-based protocol that sends routing
updates every 30 seconds, whether or not changes in the network have occurred.
OSPF, after creating the initial routing environment, will typically wait until there is a change in the state of
the routing environment before it sends out a routing update. This will vastly reduce the number of routing
updates in the network. In addition to the vast reduction in the number of routing updates sent, OSPF also
sends much smaller routing updates. A routing update will contain only the changes in the routing
environment, not the entire routing table as in the case of RIP. The combination of fewer routing updates
and smaller size of the routing updates adds up to substantial bandwidth saving in the network.
The tradeoff for lower bandwidth consumption than RIP is higher CPU utilization and memory usage. The
main CPU usage is to execute the routing algorithm (the Dijkstra algorithm) that is used to build the routing
environment. The memory usage is to keep track of more information than what RIP does.
Shortest Path First means that every router looks at the network from its own point of view. In effect, a
router in OSPF takes “a world according to me” view of the network. After each router finishes initializing,
it looks at the network and tries to figure out the best path to each destination in the network, The routing
algorithm is used to find the shortest or best path to a destination. A path is a series of steps needed to get
from one point to another in the network. OSPF does not use the number of hops between source and
destination to determine the best path. It uses a path cost variable that is configurable on an interface-by-
interface basis.OSPF Example
When a router uses the routing algorithm, it computes all the different ways to get to each destination in the
network. The collection of all these paths is known as the Topological Database, or Link-State database.
This structure keeps track of each possible path to each destination. Looking at the Figure on the opposite
page, we can see that there are a variety of loops within the network that will allow for redundant paths
between a pair of routers. If we were to look at the world according to Router 11, we would compute all the
various paths to each destination. It is important to note that the Topological Database is a data structure
that is maintained by OSPF, which allows OSPF to converge, must faster than RIP after a change. In OSPF,
because we maintain this Topological Database when a failure occurs a router simply checks its
Topological Database for the next best path to the particular destination and implements this path in its
routing table.
Once the Topological Database is created and stored, the router needs to look at the database and determine
which path is the best path to each destination. By using the additive value of path costs for each segment
of a path the router can compare one path to another and choose the path with the lowest overall cost. It is
important to note that when computing the cost to get to a destination, the cost that is added for each
segment of the path is the outbound cost from each router. In OSPF, every router interface will have a cost
associated with it. Typically, this cost is a configurable parameter on the router. When we apply the above
procedure to the example shown in the Figure, we get the Shortest Path Tree as shown for Router 11. This
Shortest Path Tree simply shows the one best path to each destination in the network with the associated
total path cost. It is from this Shortest Path Tree that the routing table can be built as shown.
In order to scale up to very large networks, OSPF uses the concept of hierarchical routing that allows
dividing the network into areas. An area is a logical collection of networks that are grouped together and
connected by a set of routers. All routers that belong to the same area exchange complete state information
among them and maintain identical topological databases. An area information is then distributed across the
OSPF domain to all the other areas.
OSPF allows the use of VLSM (Variable Length Subnet Masking). The use of VLSM permits a network
administrator to save valuable address space. It also provides the network administrator the capability to
summarize the routing tables in a very efficient matter.OSPF Example (cnt’d)OSPF Example (cnt’d)
Routing Table for Router R11OSPF Costs
In OSPF each router interface is assigned a path cost, which is an arbitrary number that can take a value
from 1 to 65,535. The best path to a destination is always the path with the lowest total cost, where the total
cost is the sum of all the pieces that make up the path. This path cost value can be based on any criteria that
the network administrator chooses, such as bandwidth, delay, reliability, The most common of these
methods is to base the cost of a path on the bandwidth of the underlying network. The OSPF specification
recommends that the path cost be set according to the following formula:
Path cost = 100,000,000 / bandwidth of the underlying network.
The table on the opposite page shows the calculated path for some commonly network speeds.