23
Kotebe University College Department of Computer Science & Technology Network & System Administration (CoSc3063) 2. Network Management 2.4. Routing: concepts, protocols and configurations 2.4.1. Static routing and how routers do routing 2.4.2. Dynamic Routing 2.4.2.1. Distance vector – (RIPv1 & Ripv2) Routing is generally divided in to two categories: static routing and dynamic routing. In static routing, the routing path is determined and configured by the administrator i.e, statically. Once the administrators configure it, packets ALWAYS follow the path determined by the administrator regardless of current network conditions. In dynamic routing, the path that the packets follow is not determined by the administrator rather it is configured by the administrator so that routers speak each other (using routing protocols) about the current network condition and let them select dynamically the path to be traversed. RIP, OSPF and EIGRP are common examples of dynamic routing protocols. From previous labs you must have noticed that using a static routing method tends to be a bit cumbersome in larger implementations. Using one of the dynamic routing protocols feels like an easier solution in these scenarios. In this post I will briefly explain the general concepts behind dynamic routing protocols. Then, we can jump to implementation fundamentals. One way of classifying dynamic routing protocols is based on where they are used. This criterion allows us to distinguish between two major solutions: 1. Interior Gateway Protocols (IGP) 2. Exterior Gateway Protocols (EGP) Common Interior Gateway Protocols are: Routing Information Protocol (RIP), Open Shortest Path First (OSPF), Enhanced Interior Gateway Protocol (EIGRP, Cisco proprietary protocol), 1

befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Embed Size (px)

Citation preview

Page 1: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Kotebe University CollegeDepartment of Computer Science & TechnologyNetwork & System Administration (CoSc3063)

2. Network Management2.4. Routing: concepts, protocols and configurations2.4.1. Static routing and how routers do routing2.4.2. Dynamic Routing2.4.2.1. Distance vector – (RIPv1 & Ripv2)

Routing is generally divided in to two categories: static routing and dynamic routing. In static routing, the routing path is determined and configured by the administrator i.e, statically. Once the administrators configure it, packets ALWAYS follow the path determined by the administrator regardless of current network conditions. In dynamic routing, the path that the packets follow is not determined by the administrator rather it is configured by the administrator so that routers speak each other (using routing protocols) about the current network condition and let them select dynamically the path to be traversed. RIP, OSPF and EIGRP are common examples of dynamic routing protocols.

From previous labs you must have noticed that using a static routing method tends to be a bit cumbersome in larger implementations. Using one of the dynamic routing protocols feels like an easier solution in these scenarios.

In this post I will briefly explain the general concepts behind dynamic routing protocols. Then, we can jump to implementation fundamentals.

One way of classifying dynamic routing protocols is based on where they are used. This criterion allows us to distinguish between two major solutions:1. Interior Gateway Protocols (IGP) 2. Exterior Gateway Protocols (EGP)Common Interior Gateway Protocols are:

Routing Information Protocol (RIP), Open Shortest Path First (OSPF), Enhanced Interior Gateway Protocol (EIGRP, Cisco proprietary protocol), Intermediate System to Intermediate System (IS-IS).

Exterior Gateway Protocols (currently there is only one in use) Border Gateway Protocol (BGP)

IGPs are designed to work in private networks. EGPs are used to provide paths in the public network (Internet).

We can also classify routing protocols based on the algorithm they use to distribute and maintain information (routing table). There are three major algorithms supported by Cisco routers:1. Distance Vector – example of protocol: RIP.2. Link-State – example of protocols: OSPF, IS-IS.3. Advanced Distance Vector – protocols: EIGRP (also BGP is partly distance vector protocol).

1

Page 2: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Understanding the algorithms helps us determine the proper solution for a given design. There is no one best routing protocol out there, but there could be the best one in a specific design.

In this post I am going to focus in on the first algorithm listed above, which is RIP

Distance Vector Algorithm CharacteristicsThis method is sometimes referred to as ‘routing by rumor’. The main characteristics of this approach are:

Routers do not know the topology of the network. They only know which is the outbound interface and the next-hop router’s IP address (vector) as well as the metric value which describes how far the destination is (distance).

Routers advertise their full routing table periodically. This method of route distribution creates two problems: routing loops and counting to infinity. Special techniques were created to solve these issues (details later in the post).

Routers perform automatic summarization if they are connected to different classful (A, B, C) networks.

No VLSM support. All network masks must be identical if the subnets of a major class are used in the network (RIPv1). RIPv2 is classless (VLSM supported using ‘no auto-summary’ command).

Routers are slow to converge. It takes a lot of time to invalidate lost routes and pick the new path if one is available as well as to synchronize their routing information.

Routers use simple metric. The metric number tells a router how many routers the packet has to traverse in order to reach the destination. In modern networks bandwidth of the path is much more important than how many hops will be used.

The above characteristics do not encourage us to use this kind of solution in our modern networks. But knowing the DV rules help us appreciate protocols such as OSPF or EIGRP which are more likely to be used in our designs.

Let’s see how things work when DV algorithm is used. As an example, I will use RIP protocol hoping to explain the principles of operation and how the two design issues have been solved (routing loop and counting to infinity).

Distance Vector Principles of OperationConsider this simple topology. Without getting into configuration (syntax) details let’s have a quick discussion on how information is distributed using DV algorithm. Initially, the routers recognize only connected subnets. They are populated in the routing table as soon as IP addresses and network masks are configured and they are activated (no shutdown). See pic 1.

Let’s assume that we have enabled RIPv2 protocol in the topology presented above (pic. 1). This version of RIP allows the routers to announce both the subnet IP addresses and the network masks (we’ll put it into practice later on)

The RIP process must be activated in the ‘config’ mode. Then we need to instruct it which interfaces should be activated in the RIP domain. This is configured in the ‘config-router’ mode (‘network’ statement). The routers begin to ‘chat’ and advertise their routing tables every 30 seconds.

2

Page 3: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Pic. 1 - Connected Subnets.

Pretend that R1’s timer of sending the advertisement has just kicked in (pic. 2). R1 is advertising its routing table out of the RIP-enabled interfaces (in my example all interfaces of all routers are in the RIP domain). This way, R2 learns about 10.1.1.0/24 subnet. So from R2’s perspective, R1 router becomes the gateway towards 10.1.1.0/24.

Now, a word about the metric being advertised.

Metric used in DV reflects how many routers the packet has to traverse to reach the destination network/subnet (so called 'hop-count'). R1’s routing table’s entries (subnets: 10.1.1.0/24 and 10.1.12.0/24) show the metric of ‘0’ hops (pic. 1) since they are directly connected to F0/0 and F0/1 interfaces respectively (they are local to R1). While advertising them to the neighbors (pic. 2), R1 adds 1 hop (itself) to the existing metric found in the routing table. See pic 2

NOTICE!Bear in mind, that algorithm prompts the router to send the full routing table. Current implementation changes that behavior (split-horizon) but more on this later.

R2 accepts the advertisement about 10.1.1.0/24. It puts this information in the RIP’s database and then it creates the entry in the routing table (purple color). Pay a close attention to what has just happened (pic. 2). The update arrives on R2’s F0/0 interface (RIP-enabled), sourced by the IP address of 10.1.12.1. This way, R2 considers its F0/0 the egress (outbound) interface towards the subnet advertised by R1. The IP address of the sender (10.1.12.1) becomes the next-hop IP address towards the subnet 10.1.1.0/24.

Next, let’s imagine R2’s timer has expired and it is sending its routing table out F0/0 and F0/1. Please take a closer look at the picture 3 which shows this process in the graphical form. Just like previously R1 router has done, R2 is sending its routing table adding itself as an additional hop added to the existing metric (existing metric +1).

3

Page 4: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Pic. 2 – R1’s RIP advertisements.

Now, R1 and R3 accept the advertisement from R2 and register the information sent in their RIP databases (the interfaces process the update as they RIP-enabled). Appropriate entries in the routing tables also show the egress interfaces and the metric expressed in the number of ‘hops’ (how many

4

Page 5: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

routers the packet will have to traverse to reach the destination subnet). Also, the IP address of the gateway (the sender IP address) is registered. Again, take a look at pic.3 which shows the new entries (in purple).

Now is the time for R3 to send its own advertisement. Using the same logic you should be able to tell what is going to happen. Take a look at pic. 4 to see what are going to be advertised and what is going to be learned.

The advertisement sent out R3’s F0/0 interface is useless in our topology because there is no other router listening to it. In my next post, I will show you how to prevent a router from doing it. Advertisement sent out F0/1 interface contains information about R3’s directly connected subnet 10.1.3.0/24. Since the existing metric in R3’s routing table for this subnet is ‘0’ (directly connected to F0/0), R3 will add itself as the hop and advertise it with the metric of ‘1’ (existing metric + 1). R2 is going to learn it on its F0/1 interface which becomes the outbound interface to reach the subnet 10.1.3.0/24. It is the interface to reach the advertising router’s IP address 10.1.23.3 after all.

Pic. 4 – R3’s RIP Advertisement.

Picture 4 shows this process.

This whole process of advertising the routing table out of all RIP-enabled interfaces occurs every 30 seconds but in fact, there is a jitter time introduced so this may vary between 25-30 seconds. When R2 advertising timer expires, it will pass the information contained in its routing table on to R1. By doing this, R1 learns about all subnets R2 can reach, including 10.1.3.0/24 now (pic. 5).

5

Page 6: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Pic. 5 – R2’s RIP Advertisement.

The process of spreading the information explained using this method is referred to as the ‘routing by rumor’. The state in which all routers have stable information about all networks/subnets that can be reached is called the ‘convergence’. Do not confuse it with ‘convergent networks’ which allow all sorts of packet transmissions (voice, video, and data).

Take a look at picture 6. It shows that all routers can reach all the subnets available in the RIP domain. Convergence has been accomplished since their routing tables are synchronized and up-to-date.

Pic. 6 – Convergence Achieved.

6

Page 7: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

The method of distributing information presented is prone to introduce two problems: Routing Loops Counting to Infinity

Of course, they have been resolved by using different techniques which I am going to explain later on.

Let’s take a look at the downside of using distance vector algorithm.

Routing LoopsIn picture 7, R1’s F0/0 interface is down. As soon as the IOS (Internetworking Operating System) detects this fact, the entry in the routing table about 10.1.1.0/24 is immediately flushed (removed from the routing table completely).

Pic. 7 – R1’s F0/0 Interface goes down.

As per the DV algorithm R1 would still wait till its advertisement timer expires. So instead of sending this ‘update’ immediately after it has lost the subnet, it will wait till its timer says: ‘now you can advertise your routing table’. This behavior might create a loop between R1 and R2 as far as the 10.1.1.0/24 subnet is concerned. Consider this situation depicted below.

R2 is advertising its full routing table out of all RIP-enabled interfaces. In this announcement, there is 10.1.1.0/24 subnet. The metric being advertised is: ‘2’ (the existing metric on R2 + 1). By now, you already know that the advertising router is going to add itself as the hop to the metric of the subnet/network it advertises.

Here is the issue. R1 is receiving 10.1.1.0/24 with the metric of 2 hops, the egress interface (the one the advertisement came on) is F0/1, and the next-hop-address is 10.1.12.2. Look at the pic. 8 and tell what would you do if you were R1? Obviously, you would reject this information because by looking at the topology diagram, you already know that 10.1.1.0/24 is inaccessible (down) now, and the only way to reach it is through R1, right?

But the problem is, that routers using DV algorithm do NOT know the topology like explained in the characteristics section. In fact, R1 IS going to accept the information and treat R2 as the gateway towards 10.1.1.0/24!!!

7

Page 8: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Pic 8 – R2’s advertising Timer Expires.

Wow! As ridiculous as it sounds, it is exactly what would happen according to the rules set by the designers of this algorithm. So R1’s routing table is going to look like shown in the picture 8. Take a look at it now again!

We have a loop between R1 and R2 regarding 10.1.1.0/24. If R2 receives the packets destined to 10.1.1.0/24 subnet, according to its knowledge (current routing table), it is going to send it out F0/0 interface towards R1. This one in turn, will use its F0/1 interface for the destination 10.1.1.0/24, sending it back to R2. The packets will be looped until their TTL values are decremented reaching the value of TTL=0. Then, a router must drop the packet.

Counting To InfinityA routing loop is not going to be the only problem here. R1 is going to accept advertisements from R2 regarding 10.1.1.0/24 with the number of hops equal '2’. When R1 advertises its own routing table, it is going to add itself (as the hop) to the metric that already exists in the routing table. Look what is going to happen (pic. 9)

Initially, R2 is going to ignore the information about 10.1.1.0/24 from R1 containing the metric of ‘3’ hops since it has much better entry in the routing table (lower metric). However, it was R1 that initially sent the metric of ‘1’ hop. Now, the same R1 router keeps sending the metric of ‘3’ hops. The previous metric of ‘1’ is no longer refreshed. Since it uses the aging timer of 180 seconds (how long the information is valid), it finally accepts the entry with the metric of ‘3’ hops instead.

Then R2 begins to advertise the metric of 4 regarding 10.1.1.0/24 subnet out F0/0 and F0/1. You can predict what is going to happen. Remember, that entries must be refreshed every 30 seconds. If they are not refreshed, the ‘Invalidation Timer’ (180 seconds), allows accepting the entry with worse metric than previously. Take a look at the sequence of events in the picture 10.

It would last forever despite of the fact that 10.1.1.0/24 is not reachable at all!

8

Page 9: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Pic. 9 – R1’s RIP Advertisement.

Pic. 10 – Larger and Larger Metric Propagation.

The Distance Vector algorithm uses a few techniques to prevent these two problems from happening. Here they are:

Triggered Update (aka flash update) Route Poisoning Maximum Metric (RIP considers 16 hops as inaccessible) Poison Reverse Hold-Down Timer Split-Horizon

These methods deserve a few words of explanation.

9

Page 10: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Triggered UpdateIOS uses this method to send the update immediately rather than wait for the advertisement timer to expire. However, there is no guarantee that some router in the chain is not going to send its own information before it receives this update. This might still lead to a situation where the two problems occur. So this method, as the only solution here, is not enough to make it work. Other methods must be used as well in order to avoid routing loops and counting to infinity.Route PoisoningUpon losing subnet/network reachability, a router is sending a triggered update. This update is going to include the maximum metric value (RIP=16 hops) which is considered as ‘subnet/network inaccessible’ (cannot be reached).Maximum Metric (RIP=16)If a RIP router receives an update about a network/subnet with the metric of 16 hops it is considered as inaccessible. This way, the advertising router is excluded from the list of gateways for the subnet/network advertised with the maximum metric.Poison ReverseOnce a router receives the advertisement including the maximum metric, if it does not have an alternate path towards the subnet/network lost, it is going to send the same subnet/network prefix with the maximum metric (RIP=16) informing the other routers about it. This will also be sent back to the sender of this information it does not have an alternate path (this might be seen as violation of split-horizon, but remember the metric is the maximum value). Poisoning the path back to the advertising router is the way of informing it that the receiver of this information has no alternate path available either.Hold-Down TimerUpon receiving information from a neighbor that a subnet/network is inaccessible, the receiving router is going to enable a hold-down timer for 180 seconds. During this time, the receiving router keeps sending packet to the destination being inaccessible for some time rather than withdrawing the entry from its routing table. Why?In the past, the routers did not have that much power and the media were unreliable. Interfaces were prone to flaps more often than in today’s reliable networks. An ‘interface flap’ is the condition when it goes down and up subsequently in a very short space of time (1-2 seconds perhaps). Under such circumstances, a router would advertise network as inaccessible and then as accessible again. Since it takes some CPU power to withdraw the entry and put it back in, the designers preferred to wait a bit longer to be absolutely sure (180 seconds by default) that the entry was supposed to be removed from the routing table. In case of an interface flapping, not only would the packets still be delivered but the CPU would not waste its ‘precious’ cycles on removing and putting the entry back in the routing table. Split-HorizonThis method prevents the loops from occurring in the scenario we have talked about. This technique prevents a router from sending information it learned back out the interface it was received on. Consider our first example. R2 sent information about 10.1.1.0/24 before R1 had had a chance to send the maximum metric towards R2 (subnet down). Split-Horizon prevents R2 from sending information about 10.1.1.0/24 it learned on its F0/0 interface back out the same interface. As a result of that, R1 is never going to receive information it sent towards R2 (10.1.1.0/24) and believeR2 could be the gateway to 10.1.1.0/24. Thus, there is no loopMore recently, a number of loop-free distance vector protocols have been developed — notable examples are EIGRP. These avoid loop formation in all cases, but suffer from increased complexity, and their deployment has been slowed down by the success of link-state routing protocols such as OSPF. OSPF will be covered later on.

10

Page 11: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

The following optional note makes the above discussion more clear. It is highly recommended that students read it carefully in order to have the full picture of Distance vector routing.

Distance Vector Routing Protocols in detail (Optional Part)Most routing protocols fall into one of two classes: distance vector or link state. The basics of distance vector routing protocols are examined here; the coming section covers link state routing protocols.

The name distance vector is derived from the fact that routes are advertised as vectors of (distance, direction), where distance is defined in terms of a metric and direction is defined in terms of the next-hop router. For example, "Destination A is a distance of 5 hops away, in the direction of next-hop router X." As that statement implies, each router learns routes from its neighboring routers' perspectives and then advertises the routes from its own perspective. Because each router depends on its neighbors for information, which the neighbors in turn may have learned from their neighbors, and so on, distance vector routing is sometimes facetiously referred to as "routing by rumor."

The two common distance vector routing protocols include the following: Routing Information Protocol (RIP) for IP (version 1 and version 2) EIGRP

Common CharacteristicsA typical distance vector routing protocol uses a routing algorithm in which routers periodically send routing updates to all neighbors by broadcasting their entire route tables. The preceding statement contains a lot of information. Carefully read and understand it. Following sections consider it in more detail.

Periodic UpdatesPeriodic updates means that at the end of a certain time period, updates will be transmitted. At issue here is the fact that if updates are sent too frequently, congestion may occur; if updates are sent too infrequently, convergence time may be unacceptably high.

NeighborsIn the context of routers, neighbors always mean routers sharing a common data link. A distance vector routing protocol sends its updates to neighboring routers and depends on them to pass the update information along to their neighbors. For this reason, distance vector routing is said to use hop-by-hop updates.

Broadcast UpdatesWhen a router first becomes active on a network, how does it find other routers and how does it announce its own presence? Several methods are available. The simplest is to send the updates to the broadcast address (in the case of IP, 255.255.255.255). Neighboring routers speaking the same routing protocol will hear the broadcasts and take appropriate action. Hosts and other devices uninterested in the routing updates will simply drop the packets. Do you think this is fair?

Full Routing Table UpdatesMost distance vector routing protocols take the very simple approach of telling their neighbors everything they know by broadcasting their entire route table, with some exceptions that are covered in following sections. Neighbors receiving these updates glean the information they need and discard everything else.

11

Page 12: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Routing by Rumor

Figure 4.3 shows a distance vector algorithm in action. In this example, the metric is hop count. At time t0, routers A through D have just become active. Looking at the route tables across the top row, at t0 the only information any of the four routers has is its own directly connected networks. The tables identify these networks and indicate that they are directly connected by having no next-hop router and by having a hop count of 0. Each of the four routers will broadcast this information on all links.

Figure 4.3 Distance vector protocols converge hop-by-hop.

At time t1, the first updates have been received and processed by the routers. Look at router A's table at t1. Router B's update to router A said that router B can reach networks 10.1.2.0 and 10.1.3.0, both 0 hops away. If the networks are 0 hops from B, they must be 1 hop from A. Router A incremented the hop count by 1 and then examined its route table. It already knew about 10.1.2.0, and the hop count (0) was less than the hop count B advertised, (1), so A disregarded that information.

Network 10.1.3.0 was new information, however, so A entered this in the route table. The source address of the update packet was router B's interface (10.1.2.2) so that information is entered along with the calculated hop count.

Notice that the other routers performed similar operations at the same time t1. Router C, for instance, disregarded the information about 10.1.3.0 from B and 10.1.4.0 from C but entered information about

12

Page 13: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

10.1.2.0, reachable via B's interface address 10.1.3.1, and 10.1.5.0, reachable via C's interface 10.1.4.2. Both networks were calculated as 1 hop away.

At time t2, the update period has again expired and another set of updates has been broadcast. Router B sent its latest table; router A again incremented B's advertised hop counts by 1 and compared. The information about 10.1.2.0 is again discarded for the same reason as before. 10.1.3.0 is already known, and the hop count hasn't changed, so that information is also discarded. 10.1.4.0 is new information and is entered into the route table.

The network is converged at time t3. Every router knows about every network, the address of the next-hop router for every network, and the distance in hops to every network.

Distance vector algorithms provide road signs to networks. They provide the direction and the distance, but no details about what lies along the route (they don’t have full network topology knowledge). They are vulnerable to accidental or intentional misdirection. Following are some of the difficulties and refinements associated with distance vector algorithms.

Route Invalidation Timers

Now that the internetwork in Figure 4.3 is fully converged, how will it handle re-convergence when some part of the topology changes? If network 10.1.5.0 goes down, the answer is simple enough—router D, in its next scheduled update, flags the network as unreachable and passes the information along.

But what if, instead of 10.1.5.0 going down, router D fails? Routers A, B, and C still have entries in their route tables about 10.1.5.0; the information is no longer valid, but there's no router to inform them of this fact. They will unknowingly forward packets to an unreachable destination—a black hole has opened in the internetwork.

This problem is handled by setting a route invalidation timer for each entry in the route table. For example, when router C first hears about 10.1.5.0 and enters the information into its route table, C sets a timer for that route. At every regularly scheduled update from router D, C discards the update's already-known information about 10.1.5.0 as described in "Routing by Rumor." But as C does so, it resets the timer on that route.

If router D goes down, C will no longer hear updates about 10.1.5.0. The timer will expire; C will flag the route as unreachable and will pass the information along in the next update.

Typical periods for route timeouts range from three to six update periods. A router would not want to invalidate a route after a single update has been missed, because this event may be the result of a corrupted or lost packet or some sort of network delay. At the same time, if the period is too long, re-convergence will be excessively slow.

Split Horizon

According to the distance vector algorithm as it has been described so far, at every update period each router broadcasts its entire route table to every neighbor. But is this really necessary? Every network known by router A in Figure 4.3, with a hop count higher than 0, has been learned from router B.

13

Page 14: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Common sense suggests that for router A to broadcast the networks it has learned from router B back to router B is a waste of resources. Obviously, B already knows about those networks.

A route pointing back to the router from which packets were received is called a reverse route. Split horizon is a technique for preventing reverse routes between two routers.

Besides not wasting resources, there is a more important reason for not sending reachability information back to the router from which the information was learned. The most important function of a dynamic routing protocol (unlike static routing protocols) is to detect and compensate for topology changes—if the best path to a network becomes unreachable, the protocol must look for a next-best path.

Look yet again at the converged internetwork of Figure 4.3 and suppose that network 10.1.5.0 goes down. Router D will detect the failure, flag the network as unreachable, and pass the information along to router C at the next update interval. However, before D's update timer triggers an update, something unexpected happens. C's update arrives, claiming that it can reach 10.1.5.0, one hop away! Remember the road sign analogy? Router D has no way of knowing that C is not advertising a legitimate next-best path. It will increment the hop count and make an entry into its route table indicating that 10.1.5.0 is reachable via router C's interface 10.1.4.1, just 2 hops away.

Now a packet (not routing information) with a destination address of 10.1.5.3 arrives at router C. C consults its route table and forwards the packet to D. D consults its route table and forwards the packet to C, C forwards it back to D, ad infinitum. A routing loop has occurred.

Implementing split horizon prevents the possibility of such a routing loop. There are two categories of split horizon: simple split horizon and split horizon with poisoned reverse.

The routers in Figure 4.4 implement simple split horizon. Router C sends an update to router D for networks 10.1.1.0, 10.1.2.0, and 10.1.3.0. Networks 10.1.4.0 and 10.1.5.0 are not included because they were learned from router D. Likewise; updates to router B include 10.1.4.0 and 10.1.5.0 with no mention of 10.1.1.0, 10.1.2.0, and 10.1.3.0.

Figure 4.4 Simple split horizon does not advertise routes back to the neighbors from whom the routes were learned.

14

Page 15: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Simple split horizon works by suppressing information. Split horizon with poisoned reverse is a modification that provides more positive information.

In the scenario of Figure 4.4, router C would in fact advertise 10.1.4.0 and 10.1.5.0 to router D, but the network would be marked as unreachable. Figure 4.5 shows what the route tables from C to B and D would look like. Notice that a route is marked as unreachable by setting the metric to infinity; in other words, the network is an infinite distance away. Coverage of a routing protocol's concept of infinity continues in the next section.

Figure 4.5 Split horizon with poisoned reverse advertises reverse routes but with an unreachable (infinite) metric.

Split horizon with poisoned reverse is considered safer and stronger than simple split horizon—a sort of "bad news is better than no news at all" approach. For example, suppose that router B in Figure 4.5 receives corrupted information causing it to believe that subnet 10.1.1.0 is reachable via router C. Simple split horizon would do nothing to correct this misperception, whereas a poisoned reverse update from router C would immediately stop the potential loop. For this reason, most modern distance vector implementations use split horizon with poisoned reverse. The trade-off is that routing update packets are larger, which may worsen any congestion problems on a link.Counting to Infinity

Split horizon will break loops between neighbors, but it will not stop loops in a network such as the one in Figure 4.6. Again, 10.1.5.0 has failed. Router D sends the appropriate updates to its neighbors router C (the dashed arrows) and router B (the solid arrows). Router B marks the route via D as unreachable, but router A is advertising a next-best path to 10.1.5.0, which is 3 hops away. B posts that route in its route table.

15

Page 16: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

Figure 4.6 Split horizon will not prevent routing loops here.

B now informs D that it has an alternative route to 10.1.5.0. D posts this information and updates C, saying that it has a 4-hop route to the network. C tells A that 10.1.5.0 is 5 hops away. A tells B that the network is now 6 hops away.

"Ah," router B thinks, "router A's path to 10.1.5.0 has increased in length. Nonetheless, it's the only route I've got, so I'll use it!"

B changes the hop count to 7, updates D, and around it goes again. This situation is the counting-to-infinity problem because the hop count to 10.1.5.0 will continue to increase to infinity. All routers are implementing split horizon, but it doesn't help.

The way to alleviate the effects of counting to infinity is to define maximum hop count

This method is also how routers advertise a network as unreachable. Whether it is a poisoned reverse route, a network that has failed, or a network beyond the maximum network diameter of 15 hops, a router will recognize any 16-hop route as unreachable.

Setting a maximum hop count of 15 helps solve the counting-to-infinity problem, but convergence will still be very slow. Given an update period of 30 seconds, a network could take up to 7.5 minutes to re-converge and is susceptible to routing errors during this time. The two methods for speeding up re-convergence are triggered updates and hold-down timers.

Triggered UpdatesTriggered updates, also known as flash updates, are very simple: If a metric changes for better or for worse, a router will immediately send out an update without waiting for its update timer to expire. Re-convergence will occur far more quickly than if every router had to wait for regularly scheduled updates, and the problem of counting to infinity is greatly reduced, although not completely eliminated. Regular updates may still occur along with triggered updates. Thus a router might receive bad information about a route from a not-yet-re-converged router after having received correct information from a triggered update. Such a situation shows that confusion and routing errors may still occur while an internetwork is re-converging, but triggered updates will help to level things out more quickly.

16

Page 17: befetrin.files.wordpress.com  · Web viewThe basics of distance vector routing protocols are ... Router C sends an update to router D for ... or a network beyond the maximum network

A further refinement is to include in the update only the networks that actually triggered it, rather than the entire route table. This technique reduces the processing time and the impact on network bandwidth.Hold-down TimersTriggered updates add responsiveness to a re-converging internetwork. Hold-down timers introduce a certain amount of disbelief to reduce the acceptance of bad routing information.If the distance to a destination increases (for example, the hop count increases from 2 to 4), the router sets a hold-down timer for that route. Until the timer expires, the router will not accept any new updates for the route.

Obviously, a trade-off is involved here. The likelihood of bad routing information getting into a table is reduced but at the expense of the re-convergence time. Like other timers, hold-down timers must be set with care. If the hold-down period is too short, it will be ineffective, and if it is too long, normal routing will be adversely affected.

17