Like this document? Why not share!

# Routing primer

## on Nov 11, 2012

• 281 views

Introduction into routing principles, methods and protocols

Introduction into routing principles, methods and protocols

### Views

Total Views
281
Views on SlideShare
281
Embed Views
0

Likes
0
7
0

No embeds

### Report content

• Comment goes here.
Are you sure you want to

## Routing primerDocument Transcript

• Routing Architecture Module 2 Routing Fundamentals Basic Problems Principles, Classification OperationAuthor: Rolf Augstein raugstein@rolfaugstein.com January 2006 Feel free to use this publication for private, non-commercial purposes. Objectives 1. Basic understanding of routing graphs 2. Describe the process of routing through a given network 3. Identify problems with Distance-Vector and Link-State protocols 4. Understand the solution for different routing problems 5. Outline different routing classifications 6. Describe the process of route summarization 7. Understand the relationship IP addressing scheme - routing functionalityRolf Augstein © 2006 All rights reserved Page 1
• Key terms: • Aggregate Route • Classless Inter-Domain Routing (CIDR) • Classless Routing • Convergence • Count-to-Infinity • Distance Vector (DV) • Exterior Routing Protocol EGP) • Flapping Route • Floating Static • Fixed Length Subnet Mask (FLSM) • Interior Routing Protocol (IGP) • Link State (LS) • Metric • Poison Reverse • Preference Value • Prefix Routing • Route Summarization • Routing Hierarchy • Routing Loops • Smart Router • Split Horizon • Variable Length Subnet Mask (VLSM)Rolf Augstein © 2006 All rights reserved Page 2
• Routing Principles Routing in general is a method of finding the best way through a given network of roads or rail-tracks, for example. The term “best way” depends on individual parameters. It could mean the fastest, cheapest, or most comfortable one. Mathematical algorithms like “Dijkstra”, are used to find out the “best” way through a given network. The discipline dealing with this kind of problems is called the graph theory. Graph Graphs are used to show all possible ways from a source to a destination. Not all combinations of ways are possible in the typical graph below. Example: • It is not possible to go directly from node C to node B • You can go from node B to node F, but not same way back Theory of graphs 8 H D 3 3 3 E 13 C 11 F 1 7 4 6 5 3 2 2 B G A - Where are the possible paths ? From A to H: - What´s the cost for each path ? Find the best way - What´s the best path ?Rolf Augstein © 2006 All rights reserved Page 3
• Further, there are different metric values through certain paths between two nodes. The metric value from node A to node C is 6. The opposite direction, node C to node A has a metric value of 5 only. Different elements are used to draw relations between certain nodes. Elements of Graphs Examples: 3 Serial Links, Shared Medium, etc. - both directions, equal cost 5 Special Links (Satellite) - one direction 10 3 ADSL - both directions, unequal costRolf Augstein © 2006 All rights reserved Page 4
• Important Terms A graph consists of vertices (nodes) and edges. Two vertices are adjacent, if they are connected by an edge. Example: This is a graph with 6 vertices (nodes) and 7 edges. A graph is called a complete graph, if each edge is connected to each of the others in the graph. Below are the first 5 complete graphs. In data networking, this kind of graph is often called a “fully meshed network”. The number of edges in a complete graph is increasing dramatically with each new node. The formula to calculate the number of edges (possible ways) in a fully meshed network is: n * ( n-1) 2 One more important term is directed graph. A digraph (directed graph) is a graph where edges are directed. This means that there are only certain possible ways through the graph. The arrows mark the direction from which the graph is determined. In this example, we have a complete graph but there is no direct path from C to B.Rolf Augstein © 2006 All rights reserved Page 5
• Basic Routing Topologies Because of the size of modern data networks, it is not possible to connect each node with all other nodes. So, fully meshed networks are normally not subject of a network design. Figures Partially meshed Fully meshed Partially meshed, Hub-and-Spoke Fully meshed networks can be found in parts of Wide Area Networks like ATM, Frame Relay or X.25. On the other hand a meshed network is more reliable because of the redundancy. But the routing becomes very complex. In IP data networks each node is represented by an IP Router or a Switch with Layer 3 capabilities. From this point of view, the graphs draw the network topology from the IP layer. In most cases the design is based on partially meshed networks. This means not all nodes are connected to each other. The design is more based on geographic issues or available bandwidth etc. The Hub-and-Spoke architecture is often used where smaller locations like SOHO or ROBO are connected to a centralized node.Rolf Augstein © 2006 All rights reserved Page 6
• Metric Criteria for finding the best way ? ? Path length Reliability Metric Cost factor .... Bandwidth The value metric is used in all routing procedures or protocols. In most cases the metric represents nothing more than an abstract value. Depending on the routing procedures, the metric has different meanings. Sometimes the metric counts the number of hops between two nodes. In other cases the metric is calculated out of the available bandwidths on the path, the delay, the MTU, the load, or the communication cost. Note The smaller the calculated metric, the better the way is. This is true for all dynamic and static routing procedures. Different routing protocols use different metric calculations. For this reason there is no compatibility between the metric values of dynamic routing protocols. To overcome this problem, it is possible to use route redistribution. This is covered later in this module.Rolf Augstein © 2006 All rights reserved Page 7
• Each routing protocol uses a default method to calculate the metric between the nodes. For the network administrator it is possible to influence and manipulate the metric calculation and the way these information are passed between neighbours. It is possible to alter the entire routing behaviour in a given network disregard of real physical structure and cabling. Note Therefore the administrator must clearly understand all aspects of the routing protocol and it’s behaviour. Do not change metric values in a complex network structure just to “find out”. You can the force the entire data flow through a network to take different paths for special settings. Example: Asymmetric Routing Packets to the destination use a different path than the packets back from the destination. This is called asymmetric routing. With manipulation of the routing metrics, a router becomes an altered directed graph, a new logical topology of the data network.Rolf Augstein © 2006 All rights reserved Page 8
• Destination Routing vs. Source Routing Routing: Destination vs. Source Destination Routing Source Routing Routing decision based on Routing decision based on IP Network to go the Source of the IP packet Examples: RIP, OSPF Examples: Policy Routing Arriving IP Packet Destination IP Source IP Data Whenever a data packet arrives at the router, the destination IP address is checked against the routing table. If the destination network address is not defined in the routing table, the packet will be dropped. When working with static routing or dynamic routing protocols, this is the default procedure for the IP router in most cases. Routing protocols like RIP, OSPF etc. are based on destination routing. It is also possible to use the source part of an IP data packet to make a routing decision. For this to make work, an administrator must define special route maps. Example: A route map defines to forward all data packets from the network 10.12.5.0/24 to the Ethernet interface 3, and all data packets from 10.12.6.0/24 to the next hop gateway 10.10.45.1.Rolf Augstein © 2006 All rights reserved Page 11
• The example shows no use of any destination IP addresses to make the routing decision. Routing decisions are not longer based on best paths with low metric. Routing becomes a matter of local policies. Note This is also called policy based routing. An administrative policy rules how routing decisions have to be made. When using this kind of routing, all rules for routing data traffic are defined statically in route maps. When the network becomes bigger, it can be very difficult to avoid “loosing routes somewhere in the network”. It is possible to combine destination routing with source routing within a routing node. Source routing is often used in conjunction with Quality of Service (QoS).Rolf Augstein © 2006 All rights reserved Page 12
• Interior Routing vs. Exterior Routing Interior vs. Exterior Routing Protocols IGP AS 56 EGP AS 53 IGP In larger networks it is necessary to use special routing protocols to handle the huge amount of routing information. Interior Gateway Protocols These protocols are used within an administrative area called Autonomous System (AS). Within an AS an administrator can decide with routing policy to use. Two or more Autonomous Systems can be linked together with the help of border routers. Typical routing protocols are: RIP Version 1/ 2 Routing Information Protocol OSPF Open Shortest Path First IS – IS Intermediate State – Intermediate State Cisco IGRP Interior Gateway Routing Protocol Cisco EIGRP Enhanced EIGRPRolf Augstein © 2006 All rights reserved Page 13
• Note Autonomous Systems are identified by a 16 Bit number. This number is administrated from the Internet Assigned Numbers Authority (IANA). Two Internet RFCs discuss autonomous systems: RFC 1930 (Guidelines for creation, selection, and registration of an Autonomous System, March 1996) and RFC 0975 (Autonomous confederations, February 1986) According to RFC 1930 , "Without exception, an AS must have only one routing policy. Here routing policy refers to how the rest of the Internet makes routing decisions based on information from your AS." Exterior Gateway Protocols With an Exterior Gateway Protocol capsulated routing information within one Autonomous System is send to a second AS. The EGP connects Autonomous Systems by delivering dynamic procedures to propagate routing changes in a controlled manner. Typical routing protocols are: EGP Exterior Gateway Protocol (Old, barely used) BGP Border Gateway Protocol BGP design and configuration can be very complex. It is mostly used in some internet areas where carriers and internet providers are working together.Rolf Augstein © 2006 All rights reserved Page 14
• Routing Operation Finding the Way Routing Tables 1 Net Gateway 1a 1 Direct 2 Direct a 3 2b 4 2b 2a 2 2b Net Gateway 1 2a b 2 Direct 3 Direct 4 3c 3b 3 Net Gateway 3c 1 3b 2 3b 3 Direct c 4 Direct 4c 4 The basic idea behind routing protocols is, to send local routing information to adjacent routing nodes. All connected interfaces with a configured IP address, cause an entry in the local routing table. The routing table consists of information to reachable destination networks. Local networks are marked as “direct connected” or “local”. With routing update packets send in a given time interval, neighbor routers using the same routing protocol learn possible ways to IP networks. In the next step, all learned routes from adjacent routing nodes are sent again in the next update cycle.Rolf Augstein © 2006 All rights reserved Page 15
• If a routing node learns routes via OSPF routing, these routes are not updated by a different routing protocol like RIP. To make these protocols to interact, route redistribution is necessary. Next Hop 1 1a a I can reach network 3 and 2a 2 4 through my “Next Hop”, 2b router 2b b 3b 3 3c Next Hop: c 4c 4 Interface IP Address of the directly connected neighbor router All reachable IP destination networks are learned in the routing table. But the router has only a limited number of information sources. Example: Router “a” has only one information source, which is the adjacent router “b”. There is no information, telling router “a” that there is a third router “c”. But router “a” can reach the network “4” through router “b” as well. This information source is called the “next-hop gateway”. So after some time, a router learns all reachable networks, but is not aware of all other routers in the network. This is sometimes referred to as “routers have a flat view of the network”. Routers must have a valid route to the next-hop gateway. So always use the directly connected interface of the next-hop gateway as IP address.Rolf Augstein © 2006 All rights reserved Page 16
• Process Topology Changes Link Up-Down router% Line protocol down...... or Keepalive Timer router% Line protocol up...... Entries in Routing Table .......... C 194.123.123.16 is directly connected, Ethernet0 R network 123.123.0.0 via Ethernet 0 R network 34.23.0.0 via Ethernet 0 All routes associated with interface Ethernet 0 are C 193.141.147.0 is directly connected, BRI0 not valid any longer .......... How does a routing node realize changes in the network topology? Usually, topology changes cause error states on the connected router interface. The line protocol goes down or the interface hardware fails. To control the functionality of the interfaces, the Operating System generates control packets which are sent through the interface. If the interface signals a problem, the operation state changes and all corresponding routes are effected in the routing table.Rolf Augstein © 2006 All rights reserved Page 20
• Routing Timer Update Time between Updates network unreachable .... Invalid network possibly down ..... Time after the entry is marked as “invalid” Flushing Route is erased from network 13.2.3.0 Routing table To avoid flapping interfaces and flapping routes the entire state change process uses a delay mechanism. Note The term “flapping” is often used to describe a failure condition, where i.e. an interface changes the state between up and down very often in small time intervals. This can cause a lot of problems and effect the entire network routing. An invalid timer controls when a route is marked as possibly unreachable or down. This timer is set 2 – 3 times higher than the update timer. At least two missed updates are necessary to cause a change in routing. An additionally flushing timer determines when a routing entry marked as possibly down is erased out of the routing table.Rolf Augstein © 2006 All rights reserved Page 21
• Using multiple Paths Load Balancing Route A Route B Packets are “balanced” through multiple ways More Bandwidth Advantage: Higher Availability When the routing process has two or more paths with equal metric to a destination network, it is possible to send the data packets along these routes. The data load is balanced. Some routing protocols can perform unequal cost load balancing with up to 5 different routes.Rolf Augstein © 2006 All rights reserved Page 22
• Control Packet Lifetime Time-to-Live IP-Version 4 Header TTL 23 TTL 23 TTL 22 TTL 22 Decreasing Time-To-Live Counter when passing through router In the header of the IP packet, the field TTL takes care of data packets not travelling in the network for ever. Whenever a routing node forwards an IP packet, the TTL counter is decreased by one. A packet with TTL set to 0 is discarded by the router.Rolf Augstein © 2006 All rights reserved Page 24
• Routing Problems Each routing protocol has advantages and also disadvantages. There is no perfect routing protocol. An administrator must deal with the pros and the cons trying to find the best solution for his needs. Convergence Convergence Problem New Route to 194.200.1.0 194.200.1.0 194.200.1.0 194.200.1.0 194.200.1.0 194.200.1.0 300 secs 240 secs 180 secs 120 secs Next Update in 60 secs Worse case scenario A major problem with DV routing is the convergence problem. New information like changes in routing take quite some time to get to all members of the routing process. The negative effect is increasing when networks become bigger and the changes occur much more often.Rolf Augstein © 2006 All rights reserved Page 25
• Count to Infinity Count to Infinity ? Don´t worry ! I have a route to 194.200.1.0 No Route to 194.200.1.0 194.200.1.0 194.200.1.0 194.200.1.0 194.200.1.0 Worse case scenario Slow convergence causes additional problems. Routers update routing information to neighbours, even if they are the source of this information. This phenomenon is called count-to-infinity, because it leads to a ping-pong effect until the maximum value for the metric is reached. So how can one overcome this kind of effects?Rolf Augstein © 2006 All rights reserved Page 26
• Triggered Updates Solution: Triggered Updates interface down Network unreachable Metric <max. Value> Neighbor receives Update with max. Metric Overcome Convergence Problem ! Any other Changes are transmitted immediately The flow of negative information must be accelerated. Whenever a change in routing occurs, these changes are transmitted immediately to all adjacencies. If an entire network is unreachable, the update packets contain the metric value set to the maximum. Poison Reverse This technical term is used to indicate, that a packet with a higher metric or the maximum metric is set and sent along the reverse path trough the network to overcome problems like routing loops or count-to-infinity. Poison reverse is a triggered update to speed up the convergence of the routing protocol.Rolf Augstein © 2006 All rights reserved Page 27
• Interface Hold-down Update from neighbor Network 154.34 .23.0 d own Route Table er Tim Flush network 154.34.23.0 via E0 >entering hold-down for network 154.34.23.0 • Accept no further Information for Network 154.34.23.0 for a certain amount of time • Avoidance of Routing-Loops A router should not rely on information arriving on an interface that was sent out earlier over that interface. When a route is flushed out of the routing table, new update packets for a particular route from any neighbour are not accepted for some time. A router should realize which routes were propagated through the interfaces and should not accept some routes backward. Again these kinds of problems occur mainly on DV routing protocols on networks with high convergence.Rolf Augstein © 2006 All rights reserved Page 28
• Loops Routing Loops Mrs. Easy Company Intranet with 198.210.25.0 different Administrators De fau … lt R ou ute to te to … o ult R 200.200.45.0 Def a 195.22.5.0 Default Route to … Mr. Brainbox Mr. Theory Another problem coming up sometimes is a loop in the routing information table. A routing loop can be caused by a lack of communication between different routing administrators, for example. This is a very tricky problem. It looks ridicules – but it is configured very quickly. Another source for routing loops is the way DV-protocols like RIP are working as seen in previous chapter. The solution to avoid loops is the Split Horizon.Rolf Augstein © 2006 All rights reserved Page 29
• Split Horizon Split-horizon is a common solution to avoid routing loops. A cause for the route loop is that the router propagates routing information learned from a neighbour to that neighbour back. The idea of the split-horizon is not to send the routing information over the interface that has received this routing information. Split Horizon Hub and Spoke Is not propagated by RIP Propagated by RIP Dynamic Routing with RIP Can not access network 173.25.0.0 ! Network 173.25.0.0 Problem: Point-to-Multipoint Interfaces The Split Horizon problem comes up in switched wide area networks. In a switched network, one physical interface is configured with several instances of logical interfaces. The logical interfaces deal with the different IP networks. The routing process deals with the physical interface. So information learned from the way in on this physical interface is not sent out over the same physical interface. This is to avoid routing loops. So something that was designed to solve a problem now causes another problem. Administrators must be aware of the split horizon effect in point-to-multipoint interfaces to avoid routing misconfiguration.Rolf Augstein © 2006 All rights reserved Page 30
• Routing Interoperability Many administrators use more than one routing protocol in their network to manage various needs. This chapter covers how different routing protocols can configured to interact with each other. The Routing Order The Routing Preference OSPF Static Priority ? RIP OSPF 2 Static 1 RIP 3 Choice: Which routing method should be used ? Different routing protocols can be configured and activated in parallel on a router. But there is no interaction between each other. This means RIP gets all routing information for the network and a second routing protocol like OSPF calculates the best path through the some network as well. Question: So what routing paths are preferred by a data packet ? Each routing protocol including static routing methods do have an assigned priority value by default. This value is called the preference.Rolf Augstein © 2006 All rights reserved Page 31
• Note: Cisco uses the same mechanism for routing interaction. This priority value is called Administrative Distance. Working with Preference 100.0.0.0 Entries in Routing-Table Network By Metric Preference Route to 100.0.0.0 OSPF 3 5 Route to 100.0.0.0 Static 1 8 Route to 100.0.0.0 RIP 3 10 Route with best preference value If there are several routes to a destination network, the first value checked is the preference value. This means the routing procedure with the highest priority is checked first. A lower preference value means more trust for the routing source. Again, within a routing procedure like OSPF, RIP, or Static, the metric value is used to define the best path. For customization purposes the preferences can be manually configured. If an administrator wants to trust a RIP derivate route more than an OSPF route, the default preference must be changed. Different manufacturers have different specifications on the preferences/ administrative distance of the routing protocols.Rolf Augstein © 2006 All rights reserved Page 32
• The following table shows the default preferences of the routers of Quidway series produced by Huawei. In the table, a value of “0" denotes the direct route, and a value of "255" denotes any route from an untrustworthy source. Table: Default Preference Values for Quidway Series Routing Protocol Preference DIRECT 0 OSPF 10 STATIC 60 RIP 100 Internal BGP 130 OSPF AS External 150 External BGP 170 UNKNOWN 255 Except the direct route, preferences of all dynamic routing protocols can be configured manually according to the users requirement.Rolf Augstein © 2006 All rights reserved Page 33
• Floating Static Floating Static Route 100.0.0.0 Use preference values to make static routes “interactive” ISDN Link, Serial Link, Backup 128 KB Entries in Routing-Table Network By Metric Preference Via Route to 100.0.0.0 RIP 3 10 Serial Link Route to 100.0.0.0 Static 1 20 ISDN If serial links goes down, ISDN backup is triggered by static route With the help of the preference one can make a static route more “dynamic”. By default, a static route has higher priority than all other dynamic routing procedures. One can change the behaviour, so as long as a dynamic route is present in the routing table, these routes are preferred. When for some reason the dynamic route disappears, the defined static route takes precedence. Floating static routes are often used as part of routing concepts with ISDN backup links.Rolf Augstein © 2006 All rights reserved Page 34
• Route Redistribution Route Redistribution Routing with OSPF Routing with RIP Metric 117 ? Metric 2 Metric 139 Metric 5 not compatible As mentioned earlier, each routing procedure uses proprietary metric calculations. To make them working together and exchange routing information, Route Redistribution can be used. With Route Redistribution, basically each routing procedure can be transferred in each other. There are a lot of considerations to make, when using redistribution. This entire technique is covered in detail in a later chapter. Administrators should have deeper understanding of the single routing procedures before using redistribution between them.Rolf Augstein © 2006 All rights reserved Page 35
• Redistribution Policy Define rules for redistribution Convert OSPF Routes to RIP: Starting Metric 4 Convert RIP Routes to OSPF: Starting Metric 9 The basic principle with route redistribution consists in the choice for special routing nodes in the network, where redistribution should be established. Example: A set of definitions rule the way, a RIP route is converted and transferred in an OSPF route and vice versa. OSPF Metric 230 is converted to RIP Metric 4 RIP Metric 3 is converted to OSPF Metric 9 All metric conversions must be set with care, so the entire routing information context makes sense. Also, the choice of the position of the router in the network redistributing routes is relevant.Rolf Augstein © 2006 All rights reserved Page 36
• A good IP address plan implemented in a well-designed network has the following characteristics: • Scalability Allows for large increases in the number of supported sites • Predictability Exhibits predictable behavior and performance • Flexibility Minimizes the impact of routers, additions, changes, or removalsRolf Augstein © 2006 All rights reserved Page 38
• Summarize Routes Route Summarization Prefix Host Subnetting - Gain more routable networks - Search common network bits for summarization Prefix Host Summarization The process of divide a network in smaller sub-networks is done by shifting the network bits to the right. (see TCP/IP fundamentals). When dealing with large networks, it is important to minimize the amount of routing information. Less routing information means less routing update traffic and less RAM (memory) needed in the router. So the process of summarize many sub-networks to one network is called Route Summarization. This is done by shifting the network bits to the left.Rolf Augstein © 2006 All rights reserved Page 40
• IP Address Management Route Summarization Route Aggregation 132.17.25.0 132.1 7.0.0 /16 132.17.26.0 Only 1 update necessary 132.17.27.0 132.17.28.0 132.17.29.0 IP subnetworks are auto-summarized based on Class A, B, C addresses By default, most routers perform auto summarization for class A, B, or C networks. Instead of propagating up to 254 subnets of the network 132.17.0.0 (132.17.1.0 to 132.17.254.0) the summarized route 132.17.0.0/16 is used. This means an enormous improvement for the amount of routing traffic sent to the neighbour router. Note: Sometimes the term Route Aggregation is used. An aggregate route includes different sub-networks by using appropriate subnet masks.Rolf Augstein © 2006 All rights reserved Page 41