Flylib.com

Books Software

 
 
 

Split Horizon

‚  < ‚  Free Open Study ‚  > ‚  

Split Horizon

Split horizon is a technique used to avoid routing loops . With split horizon, when a route is learned on an interface, that route is not advertised back out on the same interface. For ex-ample, in Figure 2-1, Router 1 receives an update about Network X with a metric of 1 from the neighboring Router 2. Router 1 will not advertise Network X back to Router 2 if split horizon is enabled. If split horizon is disabled, however, Router 1 will advertise Network X with a metric of 2 to Router 2. If Network X fails, Router 2 will think that Router 1 has a better way to get to X, so it will send the packet destined to Network X toward Router 1, creating a black hole.

Figure 2-1. An Example of Split Horizon

‚  < ‚  Free Open Study ‚  > ‚  
‚  < ‚  Free Open Study ‚  > ‚  

Split Horizon with Poison Reverse

Another technique used to avoid routing loops is split horizon with poison reverse. With this technique, routes learned on an interface are advertised back on the same interface, but they are poisoned, which means that they have a metric of 16 (unreachable). In Figure 2-1, Router 1 receives an update about Network X with a metric of 1 from neighboring Router 2. In the case of split horizon with poison reverse, Router 1 will advertise Network X back to Router 2, but with a metric of 16, which indicates infinity.

Split horizon with poison reverse is used only when a link failure occurs. It also can be used in a normal situation, but it is discouraged because it can potentially increase the size of the routing table.

‚  < ‚  Free Open Study ‚  > ‚  
‚  < ‚  Free Open Study ‚  > ‚  

RIP-1 Packet Format

The maximum datagram size in RIP is 512 octets. The first byte is used for commands such as rip update request and rip update response. The next byte is used for the Version field, which is set to 1 for RIP-1. The next 2 bytes must be 0. The 2-byte field after this is used for the address family identifier; the next 14 bytes are allocated for the network address, as shown in Figure 2-2. In the case of IP, only 4 bytes of those 14 are used for the IP address. The remaining 10 bytes are unused in RIP-1, although they are used in the RIP Version 2 (RIP-2) packet format. The next 4 bytes are used for the RIP metric, which can be up to 16. The portion from the address family identifier up to the Metric field can be repeated 25 times, to yield the maximum RIP packet size of 512 bytes.

Figure 2-2. RIP-1 Packet Format

‚  < ‚  Free Open Study ‚  > ‚  
‚  < ‚  Free Open Study ‚  > ‚  

RIP Behavior

RIP follows certain rules when it sends and receives updates. This section covers the rules for sending and receiving updates.

RIP Rules for Sending Updates

When RIP sends an update, it performs several checks. In Figure 2-3, two routers are running RIP together. Router 1 is connected to two majornets, 131.108.0.0/16 and 137.99.0.0/16.

Figure 2-3. Example of RIP Behavior

The majornet 131.108.0.0 is further divided into two subnets: 131.108.5.0/24 and 131.108.2.0/24, which is actually connected to Router 2.

Before Router 1 sends a RIP update to Router 2, it performs the check as shown in Figure 2-4.

Figure 2-4. Flowchart That Explains RIP Rules When Sending Updates

When RIP sends the update, it checks to see whether the advertised network or subnet is on the same major network as the interface that is sourcing the RIP packet. If the advertised network or subnet is on a different major network from the interface sourcing the RIP packet, the net-work is autosummarized. In other words, RIP sends only the majornet information in its routing update. For example, in Figure 2-3, when Router 1 sends the RIP update to Router 2, it auto-summarizes the subnet 137.99.88.0 into 137.99.0.0. If the advertised network or subnet is on the same major network as the router's interface sourcing the RIP packet, RIP determines whether the advertised subnet has the same mask as the interface that is sourcing the RIP update. If it has the same mask, RIP advertises that network; otherwise , RIP drops that network.

RIP Rules for Receiving Updates

When the receiving side gets an update from RIP, the update can contain either a subnet number, a host address, a network number, or all 0s (indicating the default route):

  • Subnet number (such as 131.108.1.0)

  • Host address (such as 131.108.1.1)

  • Network number (such as 131.108.0.0)

  • Default route (such as 0.0.0.0)

Figure 2-5 illustrates the checks performed by RIP on the receiving side.

Figure 2-5. Flowchart That Explains RIP Rules When Receiving Updates

When RIP receives the update, it determines whether the subnet received in the update belongs to the same major network as the receiving interface. If so, Router 2 applies the mask of the receiving interface. If the host bits are set in the host portion of the RIP update, the receiving router applies the host mask.

If that subnet belongs to a different major network, RIP checks whether any subnets of this major network already exist in the routing table and determines whether they are known from interfaces other than the one that received the update. Note that the network in this update should be a major network. If the answer is "yes," Router 2 ignores the update. If the answer is "no," Router 2 applies a classful mask.

If the update came across an unnumbered link, it might contain subnet information (bits in the subnet portion of the network address are set). Router 2 then applies a host mask. If the update carries subnet broadcast ‚ for example, 131.108.5.127/25 or Class D or E ‚ the RIP update must be ignored.

Example of Sending Updates

This section shows an example explaining RIP behavior when it sends an update. In Figure 2-6, two routers are running RIP. The link between Router 1 and Router 2 is in 131.108.0.0. The Ethernet interface on Router 1 is in 131.108.0.0 as well. Router 1 is also connected to another major network, which is 137.99.0.0.

Figure 2-6. An Example of RIP Behavior When Sending and Receiving Updates

In Figure 2-6, when Router 1 sends an update to Router 2, it performs these checks:

  1. Is 131.108.5.0/24 part of the same major network as 131.108.2.0/24, which is sourcing the update?

  2. Yes. Does 131.108.5.0/24 have the same subnet mask 131.108.2.0/24, which is sourcing the update?

  3. Yes. Router 1 advertises the network.

  4. Is 137.99.88.0/24 part of the same major network as 131.108.2.0/24, which is sourcing the update?

  5. No. Router 1 summarizes 137.99.88.0/24 at the major network boundary and advertises the route as 137.99.0.0.

This process results in Router 1 including 131.108.5.0 and 137.99.0.0 in its update to Router 2. You can see this in the output displayed using the debug ip rip command on Router 1, as demonstrated in Example 2-1.

Example 2-1 debug ip rip Command Output Reveals RIP Update Information Sent
Router1#

debug ip rip

RIP: sending v1 update to 255.255.255.255 via Serial0 (131.108.2.2)

      subnet 131.108.5.0, metric 1

      network 137.99.0.0, metric 1

Example of Receiving Updates

Example 2-2 provides output from the debug ip rip command to display the routing update received on Router 2 from Router 1.

Example 2-2 debug ip rip Command Output Reveals RIP Update Information Received
Router2#

debug ip rip

RIP: received v1 update from 131.108.2.2 on Serial0

      131.108.5.0 in 1 hops

      137.99.0.0 in 1 hops

Router 2 in Figure 2-6 performs the following checks to determine what mask to apply on a received network:

  1. Is the received major network 137.99.0.0 the same as 131.108.2.0, which is the address assigned to the interface that received the update?

  2. No. Do any subnets of this major network already exist in the routing table known from other interfaces?

  3. No. Router 2 applies the natural mask (/16) because 137.99.0.0 is a Class B address.

  4. Does subnet 131.108.5.0 belong to the same major network as subnet 131.108.2.0, which is the interface that received the update?

  5. Yes. Router 2 applies the mask /24, which is the mask of the interface that received the update.

This process results in the networks and masks in Router 2's routing table, displayed using the show ip route command (see Example 2-3).

Example 2-3 show ip route Command Output Reveals the Networks and Masks in Router 2's Routing Table
Router2#

show ip route

R       137.99.0.0/16 [120/1] via 131.108.2.2, 00:00:07, Serial0

      131.108.0.0/24 is subnetted, 3 subnets

R       131.108.5.0 [120/1] via 131.108.2.2, 00:00:08, Serial0

C       131.108.2.0 is directly connected, Serial0

C       131.108.3.0 is directly connected, Ethernet0
‚  < ‚  Free Open Study ‚  > ‚