Internetworking With TCP/IP (ETC003)
Internetworking With TCP/IP (ETC003)
[Comer] - ch. 8, 14, 15, 16 & 20 [Stevens] - ch. 9, 10 Obs: important (*)
Routing Protocols Datagram Delivery Routing Table Graph Abstraction Least-Cost Algorithms Interior Routing Bellman-Ford Algorithm
Adrian Popescu, 2003, 2004
1/64
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
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
5/64
6/64
Routing Protocols
Main classes
Static routing Dynamic routing
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
8/64
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) ....
9/64
10/64
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;
11/64
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
14/64
15/64
16/64
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
17/64
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
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 ...
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
22/64
24/64
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
25/64
26/64
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)
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
27/64
28/64
Routing daemon
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
29/64
30/64
31/64
32/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
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
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
35/64
36/64
37/64
38/64
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
40/64
41/64
42/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
44/64
46/64
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
47/64
48/64
49/64
50/64
51/64
52/64
53/64
54/64
55/64
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
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
59/64
60/64
61/64
62/64
63/64
64/64