Sunteți pe pagina 1din 11

Outline

[Comer] - ch. 8, 14, 15, 16 & 20 [Stevens] - ch. 9, 10 Obs: important (*)

Introduction Routing Principle

Internetworking with TCP/IP (ETC003) Lecture 3: IP Routing

Routing Protocols Datagram Delivery Routing Table Graph Abstraction Least-Cost Algorithms Interior Routing Bellman-Ford Algorithm
Adrian Popescu, 2003, 2004

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

1/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

2/64

Distance Vector Routing Routing Information Protocols Dijkstras Algorithm Link State Routing Open Shortest Path First Protocols Other Interior Routing Protocols Comparison of Routing Philosophies Selection of Routing Protocols Exterior Routing Hierarchical Routing Exterior Routing Protocols
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 3/64

Introduction
Some denitions IP Routing
Moving packets across an internet from a source to a destination

Routers
Computer making the routing choice

Main functions
Forwarding: using a routing table to make a forwarding decision Routing: using route advertisements to aquire the knowledge to create the routing table that the forwarding protocol uses

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

4/64

Introduction (cont.)
Intra-Autonomous Routing Protocol
Used to congure & maintain routing tables within an Autonomous System AS (so-called intradomain routing) Intra-Routing protocols are also known as Interior Gateways Protocols (IGP)

Routing Principle
Every IP router maintains a routing table IP routers use a variety of different protocols to keep the routing tables updated as the conditions (topology, cost, etc.) change Routing mechanism
Search the routing table and decide the next hop, i.e., next router or host or default router that is directly reachable (via some physical connection) Accordingly, an interface (also called port) will be determined where the packet will be sent out of the router IMPORTANT OBSERVATIONS: Determination of the NEXT HOP IN THE ROUTING TABLE means the determination of the IP address of the next router, or host or default router However, NEXT HOP IN THE DATAGRAM is in the form of physical address and NOT IP address IP addresses (destination & source) NEVER change in an IP datagram, except (eventually) when crossing a rewall

Inter-Autonomous Routing Protocol


Used to forward packets to exterior ASs (so-called interdomain routing) Inter-Routing Protocols are also known as Exterior Gateway Protocols (EGPs)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

5/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

6/64

Routing Principle (cont.)


Routing policy
Rules that decide the best routes to be entered into the routing tables Based on least-cost algorithms Best routes are computed separated from the routing protocols

Routing Protocols
Main classes
Static routing Dynamic routing

Static routing Routers vs Hosts


Generally hosts do also take routing decisions (host-specic routes) However, difference Routers always forward IP datagrams Hosts generate or sink IP datagrams Routing table are contructed manually or from a le at boot time Not good performance in the case network conditions change (toplogy, loading, link costs, etc.) However, it has the advantages of simplicity and that it offers system administrators the best control over the network

Dynamic routing
Routing tables are created automatically Concept: adjacent routers exchange messages ("advertisements") with each other, by using routing protocols; the information exchanged refers to the network status; based on that, best routes are computed Advantageous because of the choice to select best routes based on a specic routing metric (e.g., link cost, bandwidth, number of hops, delay, etc.) Drawbacks: may create diverse problems, e.g., instability, loops, etc.
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 7/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

8/64

Routing Protocols (cont.)


Also, the protocols can be partitioned into
Interior routing Exterior routing

Routing Protocols (cont.)


Exterior Routing
There have been three generations network models, namely "Single network " model (Arpanet) "Hierarchical structure" model "Mesh toplogy" model (nowadays) Accordingly, different routing protocols for exterior routing Gateway-to-Gateway Protocol (GGP) Exterior Gateway Protocol (EGP) Border Gateway Protocol (BGP) Inter-Domain Routing Protocol (IDRP) ....

Interior Routing
Historically, several routing protocols have been used extensively for routing within an AS Routing Information Protocol (RIP) Open Shortest Path First (OSPF) Intermediate System to Intermediate System (IS-IS) Interior Gateway Routing Protocol (IGRP - Cisco) Enhanced Interior Gateway Routing Protocol (EIGRP - Cisco) Hello Protocol (HP) ....

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

9/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

10/64

Routing Protocols (cont.)


Comment
Routing protocols bear an uncanny resemblance to capitalist market economics, as in both systems: There is a large group of "nodes" (i.e., routers vs companies) The decision is driven by a cost-minimization algorithm Cost determination is done in similar ways (compute its cost, add a prot for its part in the transaction, and pass this cost along to customers) Reasonable efciency is achieved

Datagram Delivery
IP Routing Algorithm (for both hosts and routers): Route_IP_Datagram (Datagram DAT, Routing_Table RT, Subnet_Mask M) extract Destination IP address (D) from the Datagram DAT and compute the Network Prex (N) by bitwise-AND of D and Subnet Mask M if N matches any directly connected network address (own interfaces) deliver datagram to destination D over that network (this involves resolving D to a physical address, encapsulating the Datagram DAT and sending the frame) else if RT contains a host-specic route for D send DAT to the next-hop router specied in RT (obs: next-hop MUST lie on a directly connected network) else if RT contains a route for network N send DAT to the next-hop router specied in RT else if RT contains a default route for network N send DAT to the default router specied in RT else if no matches are found declare a routing error;

(An Internet Encyclopedia, http://www.freesoft.org/CIE/course/index.htm)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

11/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

12/64

Routing Table
The size of the routing table is very important
It is one of the main factors that determine the performance of the router

Graph Abstraction
Graph abstraction: used to formulate routing algorithms
Some denitions (graph theory) (W. Stallings): A graph G(V, E) consists of two sets of objects called vertices V (or nodes) and edges E (or links), with each edge dened as an unordered pair of vertices A digraph G(V, E) consists of a set of vertices V and a set of edges E, with each edge dened as an ordered pair of vertices; typically, parallel edges are allowed in digraphs, provided that two parallel edges point in opposite directions A weighted graph or weighted digraph is one in which a weight wij is associated with each edge (i, j); accordingly, a matrix A=(aij) can be dened for such a graph where the term aij=wij (if (i,j) belongs to E) or aij=0 (otherwise) A simple graph of N vertices is a tree (subclass of graphs) if it has (N-1) edges and also no cycles (unique simple paths only) A subgraph of a graph G is obtained be selecting a number of edges and vertices from G such as for each edge selected, the two vertices incident on the specic edge must be selected as well A subgraph T of a graph G is called a spanning tree of G if T is a tree and includes all of the vertices of G; in other words, a spanning tree T is formed from G by removing edges in such a way that all of the cycles of G are removed but the connectivity is preserved
13/64

Methods to reduce the table size


Dumb routing (& switches that learn best routes to all destinations) Hierarchical routing (reduces the number of entries in table) Next hop routing (reduces the size by forgetting all but the next hop) Using of default routes

Routing table update


Initialized by default when conguring a network interface, or Manually updated in a system bootstrap le or by route commands (e.g., route add default host_address), or by ICMP redirect (to update the table to a different route), or Automatically updated by routing daemon in connection with Dynamic Routing Protocols Routing tables can be viewed with commands like netstat -rn (for both host & router) or route -n (for router)
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

14/64

Graph Abstraction (cont.)


Problem: given a graph G, nd a spanning tree T for it
One of the most common solutions is known as Breadth-First Search (BFS) Dijkstras shortest path routing algorithm is based on the use of BFS Formal description of BFS algorithm: Consider the connected graph G as being the input to the BFS algorithm; G has vertices ordered V1, V2, ... VN; consider S as a temporary set of vertices and the spanning tree T as being the output of the algorithm; the algorithm will produce a spanning tree rooted in V1 as follows: 1. [Initialization]: set S to [V1] and set T to the graph consisting of V1 and no edges; designate V1 as the root of the tree 2. [Add edges]: process the vertices in S in order; for each vertex x in S, process each adjacent vertex y in G in order; add edge (x, y) and vertex y to T provided that this does not produce a cycle in T; if no edges are added in this step, then halt; T is a spanning tree 3. [Update S]: replace the contents of S with the children in T and S redered consistent with the original ordering; go to step 2. BFS algorithm nds the shortest-path distance d(s, v) from a given source vertex s to all other vertices v; d(s, v) represents so the minimum number of edges in any path from s to v.

Graph Abstraction (cont.)


Practically:
A network can be viewed as a digraph Nodes in the digraph represent routers and correspond to vertices; also, vertices can be also networks Lines in the digraph (connecting nodes) represent physical links between routers and correspond to pairs of parallel edges; further, there are two types of links, namely those that connect two routers and those that connect a router to a network Links have values representing the "cost" of sending packets across the link The "cost" may have different meanings: cost, bandwidth, delay etc. Sometimes, the link is represented by (x, y) where x is the link identier and y is the "cost"

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

15/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

16/64

Graph Abstraction (cont.)


Given the graph abstraction, the problem of nding the least-cost path from a source to a destination requires therefore identifying a series of links such as: The rst link in the path is connected to the source The last link in the path is connected to the destination For all i, the i and (i - 1) links in the path are connected to the same node For the least-cost path, the sum of the costs of the links on the path is the minimum over all possible paths between the source and the destination Note that if all link costs are the same, the least-cost path is also the shortest path (that is, the path crossing the smallest number of links between the source and the destination)

Least-Cost Algorithms
Virtually, some form of least-cost algorithm is used in all IP networks in making the routing decision Least-cost algorithm
Given a network of nodes, nd the path with least-cost for each pair of nodes, with reference to some parameter of interest, e.g., cost, throughput, number of links traversed, etc.

Most (least-cost) routing algorithms actually used are variations of one of two algorithms:
Dijkstras algorithm Bellman-Ford algorithm

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

17/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

18/64

Interior Routing
Classication Routing Algorithms for Interior Routing:
Descentralized Routing Algorithms Calculation of least-cost path done in an iterative, distributed manner No node has complete information about the costs of all network links A node never knows a complete path from source to destination Instead, each node begins with only the knowledge of the costs of own directly attached links Further, by means of an iterative process of calculation and exchange of information with neighboring nodes, a node gradually computes the least-cost path to a destination or set of destinations Algorithms: distance vector algorithm (Bellman-Ford algorithm) Global Routing Algorithms Compute the least-cost path between a source and a destination using complete, global knowledge about the network (i.e., connectivity & link costs) This requires that the algorithm somehow obtains this information before computing the route Implementation: centralized (one site) or distributed (multiple sites) Algorithms: link state algorithm (Dijkstras algorithm)
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 19/64

Interior Routing (cont.)


Most important routing protocols used for intradomain routing:
Routing Information Protocol (RIP) Uses Distance Vector (DV) algorithm (Bellman-Ford) to compute best routes Open Shortest Path First (OSPF) Uses Link State (LS) algorithm (Dijstras algorithm) to nd out best routes Intermediate System to Intermediate System (IS-IS) Standardized by ISO for the routing of CLNP Interior Gateway Routing Protocol (IGRP - Cisco) Proprietary protocol (Cisco) Enhanced Interior Gateway Routing Protocol (EIGRP - Cisco) Proprietary protocol (Cisco)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

20/64

Bellman-Ford Algorithm
Algorithm:
Find the shortest path from a given source node subject to the constraint that the paths contain at most one link; then nd the shortest paths with a constraint of paths of at most two links; and so on ...

Distance Vector Routing


Distance vector (DV) algorithm
Distributed algorithm that allows each router to build up a routing table (the vector) that contains the path "costs" (i.e., the "distance") to reach all the netids in the Internetwork DV algorithm is iterative, asynchronous & distributed DV is based on a vector of hop counts Functionally, there are three types of tables Connectivity or adjacent table Distance table Routing table

Steps:
Compute link costs from the source node to every directly connected node Compute and select the cheapest links to every node for a maximum of h links (h = 0; 1; 2; ...) Repeat the second step until none of the costs change

Formal description:
Dene: s = source vertex; c(i, j) = link cost from vertex i to vertex j {c(i, i) = 0; c(i, j) = innity, if the two vertices are not directly connected; c(i, j) 0, if the two vertices are directly connected}; h = maximum number of links in a path at the current stage of the algorithm; Ch(s, v) = cost of the least-cost path from vertex s to vertex v under the constraint of no more than h links 1. [Initialization]: Ch(s, v) = innity, for all v others than s; Ch(s, s) = 0, for all h 2. [Update]: for each successive h 0, and v other than s, compute Ch+1(s, v) = [Ch(s, x) + c(x, v)]min ; where x is some node between s and v 3.[Iteration]: repeat step 2 until none of the costs changes
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 21/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

22/64

Distance Vector Routing (cont.)


DV procedure:
Initially, each router has the following information, which is held in a table known as a connectivity or adjacency table: Netids of the networks that are attached to it (through gateways) and also their related local line numbers Identity of the lines, and also their cost, that form direct links to other routers This information is provided either by network management or by the exchange of conguration messages with the other routers when each router is rst brought into service Next, in order for each router to build up a complete routing table (containing the minimum distance/shortest path to reach all netids), at predened time intervals, each router rst adds the (known) "costs" of the links connecting the router to neighbors, to the current distance values in its own (distance) table A specic, third table is used for these purposes, the so-called distance table, that helps in constructing the nodes routing table Each nodes distance table has a row for each destination in the network and a column for each of its directly attached neighbors Further, a copy of the specic (updated) distance table is forwarded to all neighbors
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 23/64

Distance Vector Routing (cont.)


Thus, based on the information received, each router updates its own distance table table (with the reported distance) and, accordingly, its own routing table, in the case a reported distance is less than the current entry The procedure (receiving updated "costs" from neighbors, recomputation of distance & routing table entries, and updating neighbors of changed "costs" of the least-cost path to a specic destination) is repeated for a dened number of iterations until each router has determined the shortest paths to reach all netids, and therefore no more update messages are sent Obs: each router transmits the contents of its own distance table at regular time intervals (typically, every 30 seconds)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

24/64

Distance Vector Routing (cont.)


DV algorithm
Consider a node X that is interested in routing to destination Y via its directly attached neighbor Z; accordingly, node Xs distance table entry DX(Y, Z) is dened as being the sum of the "cost" c(X, Z) of the direct onehop link between X and Z, plus the neighbor Zs currently known minimum-cost path from itself (Z) to Y DX(Y, Z) = c(X, Z) + minw{DZ(Y, w)} The term minw{DZ(Y, w)} is taken over all of Zs directly attached neighbors w Node Xs routing table entry is dened as RX(Y, N), and this denes the next-hop from node X towards any node Y, and this next-hop (next router) is N Nodes X adjacency table entry is dened as c(X, A), which is the "cost" from node X to adjacent network A

Distance Vector Routing (cont.)


DV algorithm
At each node X: Initialization: for all adjacent nodes V: DX(*, V) = DX(V, V) = c(X, V) /* the * operator means "for all rows" in the distance table */ /* direct connected nodes/neighbors */ /* w over all Xs neighbors */

for all destinations Y send minwDX(Y, w) to each neighbor

Loop wait (until a link cost change to neighbor V is detected, or until an update from neighbor V is received) if (c(X, V) changes by d) /* note: d can be positive or negative */ for all destinations Y do: DX(Y, V) = DX(Y, V) + d /* change costs to all destinations via neighbor V by d */ else if (update is received from neighbor V with regard to destination Y) /* assume that shortest path from V to some Y has changed and that V has broadcasted a new value for its minwDV(Y, w) */ /* also, define the new received value as "new_min" */ for the single destination Y do: DX(Y, V) = c(X, V) + new_min if a new minwDX(Y, w) is computed for any destination Y send the new value minwDX(Y, w) to all neighbors Forever

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

25/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

26/64

Distance Vector Routing (cont.)


Problems related to DV routing
Main problem with DV routing: risk for slow convergence upon a change in topology, i.e., a real risk does exist for entering a "looping" state

Routing Information Protocols


Routing Information Protocol (RIP)
Earlier was very popular! Origins & name come from the Xerox Network Systems (XNS) architecture; was used in Arpanet & Cyclades ... Was included in the 1982 version of the Berkeley Software Distribution (BSD) version of UNIX supporting TCP/IP

Some concrete effects:


Bouncing effect: messages are bounched forth & back between some nodes until their TTL expires Counting to innity: looping states are created because of mutual misunderstanding between some specic nodes; can be stopped by a convention on the representation of "innity" as some very large distance

RIP today
Actually, there are two versions of RIP (for IPv4): RIPv1 (RFC 1058) & RIPv2 (RFC 1723) (RIPv2 is backward compatible with RIPv1); besides these, there is also RIPng (RFC 2080) (for IPv6)

Techniques used to minimize these effects:


Split horizon rule: states that it is never useful to send information about a route back in the direction from which it came (as the router sending the information is nearer to the destination than the other router); recovery is speeded up (errorenous routes are eliminated within the interval of the 180 sec timeout); obs: split horizon does not however protect against all forms of loops Triggered updates: based on using of specic timers to trigger the node updates; difculties in selecting a proper value for the timer; however good in increasing the responsiveness of the protocol but at the risk of increasing network loads

RIP uses the hop count as a cost metric, i.e., each link has a cost of 1
Maximum cost of a path is limited to 15, thus max 15 hops for RIP are allowed

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

27/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

28/64

Routing Information Protocols (cont.)


RIP is an Application Layer Process
running over UDP that is able to manipulate routing tables within the UNIX kernel; it sends and receives messages over a standard socket

Routing Information Protocols (cont.)


RIP messages
Are carried via UDP segments RIP messages contain A command (RIP request or RIP response) A version number (RIPv1 or RIPv2)

"Routed" process requests/responses UDP port #520 UDP

Routing daemon

"Routed" process requests/responses UDP port #520 UDP

Up to 25 instances of: address family IP address metric (hop count) RIP response messages are also known as advertisements Routers exchange advertisements approximately every 30 seconds, i.e., RIP response messages are sent out every 30 sec These advertisements contain the senders routing table entries for up to 25 destination networks within the AS

IP

Routing tables

Routing tables

IP

DLL

DLL

PHY

PHY

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

29/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

30/64

Routing Information Protocols (cont.)


Further, if a router does not hear from its neighbor at least once every 180 seconds (i.e., 3 minutes), then the neighbor is considered to be no longer reachable, i.e., either the neighbor has died or the link has gone down; the tables are then updated (i.e., set metric to 16, and then after 1 minute delete route) and this information is further broadcasted to neighbors by sending advertisements RIP request messages are used by a router to request info about its neighbors cost to a given destination Actually there are several versions of RIP RIPv1 RIPv2 RIPng

Routing Information Protocols (cont.)


RIPv1
Designed as an Interior Gateway Protocol (IGP) for exchanging routing information within AS (of relatively limited size) RIPv1 concerns IPv4 addresses (32 bits); there is no address "type" specication in the RIP packets, i.e., the routers have to analyze the complete address to understand what is being passed Address analysis: use of Subnet Mask to learn netid of destination IP The Subnet entries are not supposed to propagate outside the specic network (RFC1058) Support of host routes is optional By default, RIP uses the metric "hop count" (i.e., the number of links to destination) as a "cost"; this distance has a value between 1 and 15; the value of 16 denotes the innity RIP supports point-to-point links and broadcast networks (e.g., Ethernet) RIP packets are carried over UDP (port 520) and IP, for both emmision as well as for reception RIP packets are usually broadcasted every 30 seconds or even faster in the case of triggered updates If a route is not refreshed within 180 seconds, the distance is set to innity and the entry will later be removed from the routing table

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

31/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

32/64

Routing Information Protocols (cont.)


RIPv2
RIPv2 is a compatible upgrade and a transition strategy is dened RIPv2 represents an attemp to improve RIPv1 (by adding new facilities as for instance subnet routing on the subnet outside of the network and support for CIDR and authentication or multicast transmission) Main difference between RIPv1 and RIPv2 lies in the format of route entries; RIPv2 has a number of new elds, e.g., the route tag to ag "external routes" to be used in conjunction with EGP or BGP RIPv1 is not a secure protocol, whereas RIPv2 does include an authentication procedure RIPv2 denes an IP class D address (224.0.0.9) for periodic multicasts

Routing Information Protocols (cont.)


Conclusions RIP
RIP is a popular routing protocol because of simplicity and that it is well suited to small Internets (the number of which is pretty high today) RIP has however a number of drawbacks: Hop count may not be the best metric RIP is unsuitable for large congurations as destinations that require a metric higher than 15 becomes unreachable; on the other hand if large metrics are allowed then the convergence of the protocol upon initialization or with topology changes may become lengthy RIP does not know about subnets (or, it assumes same netmask on all interfaces) The overly simplistic metric may lead to suboptimal routing tables, resulting so in packets being sent over slow (i.e., "costly") links when better paths may be available Transient states with loops and temporary congestion maybe created in the network when diverse nodes are computing their routing tables No security, i.e., RIP routers do accept RIP updates from any machine, and this may enable a miscongured machine to easily disrupt an entire conguration RIP uses much bandwidth since it sends the whole routing table in updates
33/64

RIPng
RIP can be used for both IPv4 and IPv6 However, there is a new version (RIPng) that is very similar to RIP and is intended to be used for IPv6 Similarities RIP and RIPng: same algorithms; same timers; same logic Main differences RIP vs RIPng: use of IPv6 security instead of RIPv2 authentication entries; and packet formats are adapted to carry the longer IPv6 address
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

34/64

Dijktras Algorithm
Algorithm:
Find the shortest path from a given node to all other nodes by developing the paths in the order of increasing path lengths

Dijktras Algorithm (cont.)


Formal description:
Dene: s = source vertex; N = set of vertices in the network; T = set of vertices incorporated by the algorithm at the specic moment; c(i, j) = link cost from vertex i to vertex j {c(i, i) = 0; c(i, j) = innity, if the two vertices are not directly connected; c(i, j) 0, if the two vertices are directly connected}; C(s, v) = cost of the least-cost path from vertex s to vertex v that is currently known to the algorithm, and nally this represents the leastcost path in the graph from s to v 1. [Initialization]: T = {s}, i.e., the set of vertices consists of only source vertex; C(s, v) = c(s, v) for any (neighbor) v other than s, i.e., the initial path costs to neighboring vertices are simply the link costs 2. [Get next vertex]: nd the neighboring vertex x not belonging to T that has the least-cost path from vertex s and incorporate x into T ( i.e., C(s, x) = min c(s, j), where j does not belong to T); also incorporate in T the edge incident on vertex x that contributes the least-cost component to C(s, x) 3. [Update least-cost paths]: update phase according to C(s, v) = min[C(s, v), C(s, x) + c(x, v)] for all v; the result is that least-cost path from s to v is either the direct path or the path from s to x concatenated with the edge from x to v 4. [Iteration]: repeat phase 2 and 3 until all vertices have been added to T; then the value C(s, v) associated with each vertex v is the cost of the leastcost path from s to v

Steps:
Compute the link costs from the source node to every other neighboring nodes Select the node that has the lowest cost (cheapest path) to reach Compute the link costs from that node the every other node Compare costs from source node direct to all other nodes with the correspondent costs through the cheapest path Select the cheapest routes Repeat the last four steps until nal paths have been assigned to all nodes in the network

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

35/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

36/64

Dijktras Algorithm (cont.)


Practically:
Each router maintains a database reecting the topology, which is expressed as a directed graph Graph components are: Vertices (nodes), of types Router Network There are two types of network, namely transit and stub (non-transit) Edges, of types Graph edges that connect two router vertices; routers connected by a direct point-to-point link Graph edges that connect a router vertex to a network vertex; router directly connected to the network Further, a link cost is associated with the output side of each router interface and it is congurable by the system administrator

Link State Routing


Main idea
Instead of exchanging information about distances to destinations (like in the case of RIP), the nodes will now all maintain specic maps of the network that are updated after any change in the topology; these maps are further used to compute routes that are more accurate than in the case of distance vector protocols; the routes computed with OSPF seem to be as precise as if they had been computed centrally although the computation is still distributed

Link State protocol


Tells the status of links to neighbors

Link State routing protocols


Class of routing protocols that include, among others, OSPF (developed by IETF for use in the Internet and recommended as a replacement for RIP) and IS-IS (used for OSI NL)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

37/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

38/64

Link State Routing (cont.)


A more correct denition of the OSPF routing mechanism is Link-State Shortest-Path-First routing A Link-State (LS) algorithm is used by every router to determine the current (active) topology of the Internet and the cost associated with each link as well; this algorithm is implemented as a link-state protocol that uses ooding of link-state information; the result is that every router constructs a complete topological map (i.e., a directed graph) of the entire AS. A Shortest-Path-First (SPF) algorithm is used by every router to determine the shortest path from itself to all the other routers in the Internet; this computation uses the information provided by the LS algorithm; Dijkstras SPF algorithm is used by routers to determine a shortest-path tree to all networks with itself as a root node; nally, the routing table is obtained from the shortest-path tree.

Open Shortest Path First Protocols


As the size & speed of Internet have increased, the limitations of RIP have lowered its popularity Accordingly, OSPF is considered now the preferred interior routing protocol for Internet OSPF is recommended by IAB as a replacement for RIP Like RIP, OSPF is also used for intra-AS routing The term "Open" in OSPF indicates that the routing protocol specication is publicly available, as opposed for instance to Ciscos Enhanced Internal Gateway Routing Protocol (EIGRP) Most recent OSPF version (OSPF Version 2) is dened in RFC2328 (1998)

OSPF protocol
In an OSPF routing protocol, network topology and also all link costs are known to all routers, as every router broadcastes (to all other routers in the network) the identities and costs of own attached links; The result is that all nodes have nally an identical and complete view of the network (though in the beginning the nodes knew only the identity and costs to own directly attached neighbors); Based on this information, all routers run the link state algorithm (Dijkstras algorithm) and compute the least-cost paths
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 39/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

40/64

Open Shortest Path First Protocols (cont.)


OSPF algorithm
At each node s Initialization: N = {s} for all nodes v if v adjacent to s then C(s, v) = c(s, v) else C(s, v) = broadcast C(s, v) Loop find x not in N such as C(s, x) is a minimum add x to N update C(s, v) for all v adjacent to x and not in N: C(s, v) = min [C(s, v), C(s, x) + c(x, v)] /* new cost to v is either the old cost to v or known shortest path cost to x plus cost from x to v */ broadcast C(s, v) Until all nodes in N

Open Shortest Path First Protocols (cont.)


Routing procedure
When a router is initialized, it determines the link costs on each of its network interfaces; The router then advertises this set of link costs to all other routers in the Internet topology, not just to neighboring routers only; A ooding technique is used for these purposes and the link-state messages transmitted contain the routers identity and its associated connectivity information (to each of its immediate neighbors); From here on, the router will be monitoring its own link costs and, whenever a change is detected (e.g., increase/decrease of link "cost", a new link is created, an existing link is set down), the router again advertises its own set of new link costs to all other routers in the conguration. Further, based on the information given by the topology of the entire conguration (that the router is able to construct in its own database), the router computes the shortest path to each other node in the conguration; Based on this information, the router is further able to compute its own routing table, which gives information about the rst-hop to every destination; Obs: the router may also use other algorithms to determine the shortest paths but, practically, Dijkstras algorithm is used

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

41/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

42/64

Open Shortest Path First Protocols (cont.)


Routing tables
Link-state (LS) table, which contain information ("link state records") about the location of all netids (network topology); there are ve LS types (router, network, summary for IP network, summary for border router, external) and four types of LS records contents Derived set of shortest-path routing tables; these tables are used in slightly different ways depending upon the choice of routing method used, i.e., hop-by-hop or source routing Connectivity table providing information about the rst-hop

Open Shortest Path First Protocols (cont.)


Link Costs
Costs associated with each hop (in any direction) are referred to as routing metrics OSPF provides a exible routing metric scheme based on using ToS (IPv4) There are ve ToS categories: ToS 0 (normal): default routing metric that is assigned by routing administrators to satisfy any administrative policies ToS 2 (minimize monetary cost): used to assign monetary costs to network use ToS 4 (maximize reliability): to reect statistics like (measured) packet error rates ToS 8 (maximize throughput): to reect data rates (of the interface); typically, the metric is the duration of a bit in 10 nanosecond units ToS 16 (minimize delay): measure of the transit delay or delay through a particular hop; typically, it consists of propagation delay plus queueing delay at the router Accordingly, a router can construct up to ve distinct routing tables, one for each ToS, and generates so ve spanning trees for the conguration; IP datagrams are then routed based on the specic ToS; if there is no request on ToS (included in the IP header), then the default ToS 0 is used for routing
43/64

OSPF subprotocols
The OSPF protocol runs directly on top of IP and it is composed by three subprotocols: The Hello protocol: used to check that links are operational and also to elect the designated router and the backup on broadcast & non-broadcast networks The Exchange protocol: used for purposes of "initial synchronization" of routers databases; router partitioning of type master/slave The Flooding protocol: used to pass routing updates as well as to synchronize the "aging" of database records
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

44/64

Open Shortest Path First Protocols (cont.)


Areas
To manage the complexity of large Internets, OSPF incorporates the concept of area Any Internet can be congured to consist of a backbone and multiple areas: Area: a collection of contiguous networks and hosts, together with routers having interfaces to any one of the included networks Stub area: an area in which all external routes are summarized by a default route; can not be used for transit Backbone: collection of networks not contained in any area, together with attached routers, and those routers that belong to multiple areas Each area runs own OSPF link-state routing algorithm, maintaining so a topological database and corresponding graphs to reect the topology of just the specic area; each router in an area broadcastes the information about link-state to all other routers within same area; the internal details of an area are invisible to all other routers outside the specic area; in other words, intra-area routing involves only the routers belonging to the specic area; by this, the amount of OSPF trafc is considerably reduced Another OSPF area in the AS is congured to be the backbone area; the backbone itself has all properties of an area and uses the link-state routing algorithm to perform inter-area routing
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 45/64

Open Shortest Path First Protocols (cont.)


Hierarchical routing
At a top level, OSPF views the Internet as having a star conguration; the root or hub is the backbone, and each of the areas is attached to the backbone Four classes of OSPF routers are used Boundary routers: top level routers in an AS; exchanges routing information with routers belonging to other AS; it may, for instance, use Border Gateway Protocol (BGP) to perform inter-AS routing with other boundary routers Backbone routers (non-border routers): second level routers; perform routing at a backbone level; these are however not area border routers; perform inter-area routing Area border routers: these are routers that belong to both an area and to the backbone Internal routers: these are routers that serve non-backbone areas and perform only intra-area routing

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

46/64

Open Shortest Path First Protocols (cont.)


OSPF design
OSPF is a very complex protocol, much more complex than RIP, but also more efcient OSPF has been designed, among others, with special support for: Separating hosts and routers Broadcast networks, (e.g., Ethernet, FDDI) Non-broadcast networks (e.g., X.25, ATM) Splitting large networks into areas

Open Shortest Path First Protocols (cont.)


Advantages of OSPF
Security facilities: all exchanges among OSPF routers are authenticated; other facilities: hop-by-hop ACKs (ooding), CRC, etc. Multiple paths facilities: OSPF allows for the use of multiple paths to a specic destination when these paths have all same cost (load balancing) Facilities regarding using of different cost metrics for different ToS trafc: OSPF allows for the posibility that each link has different costs for different IP datagrams with different Type of Service (ToS); practically, OSPF considers different networks topologies for different classes of trafc and can so compute different routes for each type of trafc Integrated support for both unicast and multicast routing: there is a multicast version of OSPF, Multicast OSPF (MOSPF - RFC 1584); the existing OSPF link databases are used, new link-state advertisements are however used in addition to the existing ones Fast, loopless convergence: mainly because of the concept behind OSPF, namely information broadcasting by ooding together with a local computation of the routing tables Support for hierarchically structured OSPF AS within a single routing domain: most signicant advantage is related to the ability to hierarchically structure an AS Support for variable length subnet masks

OSPFng
OSPF for IPv6 is a translation of OSPF for IPv4, with minimal changes Changes are mainly to accommodate IPv6 address format as well as the change of semantics introduced by IPv6; there are also protocol changes and new database formats OSPF for IPv6 is still under development

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

47/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

48/64

Open Shortest Path First Protocols (cont.)


Work on OSPF continues!
Main classes of problems: Operation of large networks Use of OSPF database for new purposes Examples of practical problems: Database overow Increased network security Better trafc engineering (e.g., load sharing on multiple paths)

Other Interior Routing Protocols


RIP and OSPF are not the only protocols used in Internet
Apart from RIP and OSPF, most used routing protocols today are Dual IS-IS: represents the extension for IP of the "Intermediate System to Intermediate System (IS-IS)" protocol that was standardized by ISO for the routing of CLNP packets Interior Gateway Routing Protocol (IGRP): proprietary protocol (Cisco) Enhanced Interior Gateway Routing Protocol (EIGRP): also proprietary protocol developed by Cisco Some history: Gateway to Gateway Protocol (GGP): predecesor of RIP; used by early Arpanet; somewhat more complex than RIP Hello Protocol (HP): used for Internet protocols on PDP11 minicomputers; old concept based on using clocks and delays as well as on mixing of clock synchronization & route computation (not found anymore in todays routing) Important clarication: OSI architecture does NOT dene terms like "router" or "hosts" but terms like "end system" (for host) and "intermediate system" (for router); also, there are no terms like "routing" and "networks", but terms like "routeing" (used for routing) and "domain" (used for network); accordingly, the OSI routing protocol is "Intra-Domain Intermediate System to Intermediate System Routeing Protocol (IS-IS)"

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

49/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

50/64

Other Interior Routing Protocols (cont.)


OSI routing is hierarchical
It separates routing domains into areas composed of one or more LANs; all areas are then connected through a backbone (like in OSPF); an area contains so-called level-1 routers and a backbone contains level-2 routers (superior); further, as in OSPF, there are also routers that belong to both level-1 and level-2 (same role as an area-border router in OSPF)

Other Interior Routing Protocols (cont.)


IGRP
IGRP was developed by Cisco (released in 1988) in an attempt to improve RIP at a time when IETF was still developing OSPF IGRP is a proprietary protocol, patented by Cisco IGRP eliminates some of the RIP defects, and has improvements like using of composite metrics, using conservative protection against loops, using of multipath routing, and handling of default routes IGRP: routing protocol of type distance vector An important difference between IGRP and RIP is that the periodic multicasting at IGRP is done (by default) every 90 seconds (instead of 30 seconds for RIP) Composite metric: IGRP routing updates include (for each entry) a set of four metrics: delay (D); bandwidth (B); reliability (R); and load (L); further, a composite metric is used that combines all four parameters (D, B, R, and L) (sophisticated!); better performance and exibility however for IGRP! IGRP does incorporate the split horizon and triggered update techniques, but not "poisonous reverse"; other protective techniques are used instead, like "path holddown" (rst IGRP versions) and "route poisoning" (last IGRP versions)

Differences between OSI and OSPF:


The division of the network into areas is much more rigid than in OSPF, i.e., IS-IS areas are roughly equivalent to OSPFs stub areas Absence of any subnet identication in OSI A consequence is that OSI routers must explicitely keep track of the location of hosts within their area

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

51/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

52/64

Other Interior Routing Protocols (cont.)


EIGRP
IGRP is however not perfect, some of the main problems are related to loop detection (holddown & route-poisoning techniques are not the best solution), lack of support for variable-length subnets & supernets, and (still) synchronization effects The result was that Cisco developed EIGRP, in spite of OSPF appearance; the reason was that some of Ciscos engineers believe strongly in distance vector superiority over link state technique EIGRP incorporates a sophisticated extension of the distance vector protocol

Comparison of Routing Philosophies


Distance Vector (DV) routing vs Link-State (LS) routing
Algorithm Each router sends routing information to its neighbors (DV) <-> Each router sends routing information to all other routers (LS) Amount of info transmitted The information sent is an estimate of the path costs to all networks (i.e., complete routing table) (DV) <-> The information sent is the exact value of the link costs to adjacent networks (i.e., only link-state information) (LS) Trafc intensity Information is sent on a regular periodic basis (DV) <-> Information is sent when changes occur (LS) Amount of bandwidth used DV uses more bandwidth Determination of next hop information A router determines next hop information by using the distributed Bellman-Ford algorithm on the received estimated path costs (DV) <-> A router rst builds up a description of the topology of the Internet and then may use any routing algorithm (practically, Dijkstras algorithm) to determine next hop information (LS)

Other algorithm: Distributed Update ALgorithm (DUAL)


It aims at removing transient loops from both distance vector and link state routing algorithms; the drawback however is that it requires serious modications of the routing protocol (IGRP)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

53/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

54/64

Comparison of Routing Philosophies (cont.)


Speed of convergence LS may potentially suffer from oscillations <-> DV can converge slowly & count-to-innity problems Robustness LS is somewhat better protected than DV in the case a router fails

Selection of Routing Protocols


Very difcult question!
Think also that there are new protocol developments on way, like "hot potato routing", "ood and source route", and "ow-based routing (trafc matrix)" Most used protocols today: RIP; IGRP; EIGRP; IS-IS; and OSPF Each of these protocols have advantages & drawbacks, like: RIPv1 and IGRP are not capable of handling classless IP prexes RIPv2, EIGRP, IS-IS and OSPF are all capable of handling classless prexes RIP and OSPF have ng versions (for IPv6) EIGRP and IS-IS can support multiple address families and could so easily support IPv6 However, the main candidate today seems to be OSPF, and the main contender EIGRP IAB recommended OSPF as an interior gateway protocols for IP networks RIPv2 should however be used on small networks (max 16 hops) Finally, an important point is that EIGRP is a proprietary protocol (money & patent issues)!

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

55/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

56/64

Exterior Routing
In early 1980s the Internet was composed by Arpanet, the satellite extension Satnet as well as a set of LANs directly connected to them by "gateways", with routing protocol Gateway-to-Gateway Protocol (GGP) Main problems: Routing overhead increased with the number of routers Routing tables also increased with the number of networks Difculties with network maintainance and fault isolation Appearance of new types of routers Consequence: splitting of Internet into ASs AS: set of routers and networks under the same administration 1982 to 1984: development of Exterior Gateway Protocol (EGP) (RFC 827) EGP uses a topology of type backbone-centerred tree This is no longer the best solution today (large networks) Since 1995 it is Border Gateway Protocol version 4 (BGP4) that is used instead (RFC 1654/1994 and revised version RFC 1771/1995) There have been however three other BGP versions before (BGP1, BGP2 and BGP3) (RFC 1105, RFC 1163, and RFC 1267) A better solution seems however to be Classless Inter-Domain Routing Protocol (IDRP), introduced in 1992, and designated for use with IPv6
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 4 57/64

Exterior Routing (cont.)


Three generations network models so far
"Single network " model (1980s) "Hierarchical structure" model (1980 - 1995) "Mesh toplogy" model, need for policy routing (1995 - today)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

58/64

Hierarchical Routing
The general architecture of Internet routing has been structured as follows (mandated by EGP): Subnet router: operates entirely within a single network when subnetting is used Access gateway: used to connect an access network to an interior gateway Interior gateway: used to interconnect the networks within an AS (typically a regional or national network) Exterior gateway: used to connect an AS to the core backbone network The routing protocol used by the interior gateway within a single AS is known as Interior Gateway Protocol (IGP), for instance RIP and OSPF; the protocol used for exterior gateway is known as EGP Today the trend is to move away from this model

Exterior Routing Protocols


EGP
EGP has many of the characteristics of DV protocol The distances announced through EGP reect a combination of preferences and policies EGP was designed based on the concept of a simple hierarchical topology, where stub ASs should be connected to the backbone Today EGP is no longer responding to the requirements put by the actual Internet, with a complex meshed topology where the former unique backbone has been replaced by many competing commercial providers (ISPs) Some of the most serios limits of EGP are related to: Fragility when exterior gateway routers are misbehaving Limits related to (possible) conicting interests in choosing a routing policy to be agreed by more ISPs Lack of support for a meshed topology (as the Internet is looking like today) Inefciency because of the lack of a (robust) segmentation/reasembly procedure (required by IP) Because of these limits: a new protocol for exterior routing has been developed and also replaced EGP, namely BGP

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

59/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

60/64

Exterior Routing Protocols (cont.)


BGP
Path-Vector (PV) routing: key feature of BGP Problem: neither a DV protocol (e.g., RIP) nor a LS protocol (e.g., OSPF) are effective to be used as an exterior routing protocol The solution adopted by the Path-Vector (PV) routing is: No info about the distance or cost estimate is included All the ASs visited (on way to a specic destination AS) are listed in the routing info/path-vector (PV); the consequence is that the PV enables a router to perform policy routing, e.g., a router may decide to avoid a particular path in order to avoid transitting a specic AS, based on some info about the performance or QoS; example of metrics considered are link speed, capacity, tendency to become congested, etc.; also, the loop-protection algorithm is very simple

Exterior Routing Protocols (cont.)


BGP operates in terms of messages, which are sent over TCP connections Similarly to EGP, BGP has three functional procedures: Neighbor acquisition: needed when two neighboring routers in two different ASs agree to exchange routing info on a regular basis Neighbor reachability: used to maintain the "neighboring" relationship Network reachability: used to build up and maintain routing info (each router maintains a list of the ASs that can be reached as well as the preferred route for reaching a specic AS; these lists are consequently broadcasted) BGP4 does support "supernetting", i.e., route/path aggregation (at different levels: regional, national and continental)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

61/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

62/64

Exterior Routing Protocols (cont.)


BGP decision process is: Evaluate the paths learned from external routers Select the most appropriate path for each destination Advertise the paths to neighbors Conclusions: BGP has solved the problem of changing from a tree topology to a general mesh topology There are however several problems related to BGP: BGP requires a large amount of manual conguration Not very robust to conguration errors BGP4 supports only IPv4; a "multiprotocol" version of BGP is under development, to support several protocols in addition to IPv4 Complications because of the need for policy routing (due to commercialization of Internet); solutions under development: BGP tunnelling, Source Demand Routing, Inter-Domain Policy Routing (IDPR), and Multi-Protocol Label Switching (MPLS) Another big problem: routing aps

Exterior Routing Protocols (cont.)


IDRP
IDRP is an ISO standard, dened within the OSI model, which has been designated for use with IPv6 Similarly to BGP, IDRP is based on a Path Vector (PV) routing and represents a superset of BGPs functions Key differences BGP vs IDRP: BGP operates over TCP <--> IDRP operates over the protocol stack used in the conguration; IDRP uses own handshaking exchanges to guarantee message delivery BGP uses 16-bits AS numbers <--> IDRP uses variable-length identiers IDRP can deal with multiple Internet protocols and multiple Internet address schemes, i.e., an IDRP message can carry different network address formats BGP communicates a path by specifying the complete list of ASs that a path visits <--> IDRP is able to aggregate this info by using the concept of Routing Domain Confederations (RDC) (most important advantage of IDRP, which allows a set of connected ASs to be grouped together to form a Confederation; the result is that this creates a routing strategy that scales effectively with increasing size and complexity of the Internet)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

63/64

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 4

64/64

S-ar putea să vă placă și