Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Networks Group Universität Paderborn Computer Networks Chapter 6: Routing Holger Karl.

Similar presentations


Presentation on theme: "Computer Networks Group Universität Paderborn Computer Networks Chapter 6: Routing Holger Karl."— Presentation transcript:

1 Computer Networks Group Universität Paderborn Computer Networks Chapter 6: Routing Holger Karl

2 WS 05/06, v 1.1Computer Networks - Routing2 Goals of this chapter  Building larger networks by simply interconnecting LANs is limited, it does not scale  To build larger networks, the following questions have to be explicitly solved:  What are good paths that a packet should take to get from a source node to a destination node?  How to represent these paths by routing tables and how to construct them efficiently?  How to use routing tables (once constructed) efficiently?  How to organize larger networks with respect to an addressing structure that allows efficient & compact routing tables?  In addition, we will look at how the Internet’s routing structure looks like as a case study

3 WS 05/06, v 1.1Computer Networks - Routing3 Overview  From spanning trees to routing tables  Computing routing tables  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing

4 WS 05/06, v 1.1Computer Networks - Routing4 Goal: Build LARGE networks  The “internetworking” mechanisms described in previous chapter can help packets to reach their destination  Hubs: broadcast; switch: send to directly connected network  Bridge: Flooding causes problems; spanning tree solves some of them  Can we directly extend these mechanisms to large networks (millions or more nodes)?  Flooding clearly not a good idea  Need some structure to decide where a packet should go  A single spanning tree is not good, can introduce considerable detours

5 WS 05/06, v 1.1Computer Networks - Routing5 Desirable: Shortest paths!  Instead of a single spanning tree for an entire network, provide shortest paths  Given a source and destination node for a packet, what is the shortest way to deliver the packet?  What does “shortest” mean?  Fewest hops?  Smallest delivery time?  Lowest cost?  Choice to make: to which neighbor to forward a packet?

6 WS 05/06, v 1.1Computer Networks - Routing6 Destination Forwarding table of W Routing tables expressing costs  Routing table: For a given node and all its direct neighbors, express cost to send to any destination  Construct from routing table: Forwarding table  For a given node and any destination, express to which neighbor a packet should be passed on to minimize cost  Trivial to construct from routing table, but smaller and quicker to search MPZ U234 V323 X432 Y443 Destination Neighbor Routing table of W MPZ U (2)V (2)X (2)

7 WS 05/06, v 1.1Computer Networks - Routing7 Properties for routing algorithms  Routing algorithm = an algorithm to compute routing tables  Properties/classifications  Correct, simple  Centralized/distributed  Robustness  Can compensate quickly for failing links  Non-adaptive/adaptive to current situation of a network  Also called: static/dynamic routing  Stable – will converge to an equilibrium over time  Optimality (in throughput, delay, … or some other metric)  Fairness

8 WS 05/06, v 1.1Computer Networks - Routing8 Overview  From spanning trees to routing tables  Computing routing tables  Link-state routing algorithms  Distance-vector routing algorithms  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing

9 WS 05/06, v 1.1Computer Networks - Routing9 Computing routing tables – A centralized view  Given a graph G=(V,E) and a cost function c : E! Real  Compute, for each node v 2 V, the routing table to each destination u 2 V  Such that for each pair (v,u), the path (v, s 1, …, s n, u) with the minimal smallest cost can be derived easily from the routing table  By simply choosing the neighbor with the smallest entry  Cost of a path is the sum of the costs of its edges  “All pairs-shortest path problem”  Approach: Compute shortest paths from a given node to all possible destination nodes; do that for all nodes in the network  “Shortest path tree”  NOT a minimum spanning tree computation

10 WS 05/06, v 1.1Computer Networks - Routing10 Centralized shortest path – Dijkstra  Given graph G=(V,E), cost c : E! real, source node A  Algorithm can be applied to any source node, of course  Compute shortest paths to all destinations (and their cost)  Dijkstra’s algorithm  Label each node with distance to source node A (or 1, if not known)  Label each node as either tentative or permanent  Only nodes labeled permanent have final distance estimates  Label each node with its predecessor in the path towards the source  Or mark as “unknown”  Initially, all labels are (1, tentative, unknown)

11 WS 05/06, v 1.1Computer Networks - Routing11 Centralized shortest path – Dijkstra  Initial action: Make node A permanent  Whenever a node X is changed from tentative to permanent with label (c X, permanent, W):  For all neighbors Y of X with label (1, tentative, - ): Replace label of Y by (c X + c(X,Y), tentative, X)  First time a path is found for node Y  For all neighbors Y of X with label (c Y, tentative, U): If c X + c(X,Y) < c Y, replace label by (c X + c(X,Y), tentative, X)  A better path to Y has been found, via X instead of via U  Once relabeling step is complete, search (in entire graph) tentative node with smallest cost – and make it permanent  This is the closest node to A which is still uncertain, for any other node a still cheaper path might be found  Proceed until all nodes are labeled as “permanent”

12 WS 05/06, v 1.1Computer Networks - Routing12 Centralized routing – Dijkstra – Example

13 WS 05/06, v 1.1Computer Networks - Routing13 Centralized vs. distributed algorithms – Link-state routing  Dijkstra’s algorithm nice and well  But how to obtain centralized view of the entire network to be able to apply Dijkstra’s algorithm?  Assumption: only direct neighbors know the (current) cost of a link or know whether a link has failed/been restored/upgraded/…  Solution: Have each node distribute this information – state of all its links – in the entire network  Then, all nodes know entire network topology & can apply Dijkstra’s algorithm  Distribution itself can happen via flooding ! Link-state routing  Intuition: Little information (about direct neighbors) is spread over large distances (to the entire network)

14 WS 05/06, v 1.1Computer Networks - Routing14 Overview  From spanning trees to routing tables  Computing routing tables  Link-state routing algorithms  Distance-vector routing algorithms  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing

15 WS 05/06, v 1.1Computer Networks - Routing15 Alternative approach: Distance-vector routing  Alternative idea to link state routing: Distribute lot’s of information over short distances  Distribute everything a node currently knows (or believes) about the entire network topology, but only to direct neighbors  This information is represented by the routing table (containing outgoing link and cost)  If reduced to cost only, also called a distance vector  Invented by Bellman & Ford (1957)  After receiving a routing table from a neighbor, compare whether it contains “good news”, i.e., a shorter route than the one currently known  Assumption: each router knows cost to each of its direct neighbors  In practice: It suffices to exchange distance vectors

16 WS 05/06, v 1.1Computer Networks - Routing16 Distance-vector routing – Formally  Suppose that node X  Has distance vector (x 1, … x n ) for each of the n possible destinations in the network  Receives distance vector (y 1, …, y n ) from its neighbor Y  Has cost c XY to reach neighbor Y  Then: Node X compares, for every destination i, x i < y i + c XY i.e., is it cheaper to go first to Y and then to i rather than to go to node i directly?  If yes, replace outgoing link for node i by y, update cost to y i + c XY  Algorithms keeps iterating

17 WS 05/06, v 1.1Computer Networks - Routing17 Distance-vector routing – Example This is the (current version of) routing table! 8 10 12 6

18 WS 05/06, v 1.1Computer Networks - Routing18 Overview  From spanning trees to routing tables  Computing routing tables  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing

19 WS 05/06, v 1.1Computer Networks - Routing19 Solution for LARGE networks?  What happens to routings when networks grow?  Routing tables become longer and longer, requiring more memory  Searching through routing/forwarding tables takes more and more time, reducing throughput of a router/increasing delay  Run-time of routing algorithms becomes larger  But: does a given node really care about details of the route “far away”?  Suppose you send a packet to an Australian university – do you care which route it takes from one campus router to the next?  It suffices to get the packet towards Australia  For local packets, a router better should care! ! Hierarchical routing

20 WS 05/06, v 1.1Computer Networks - Routing20 Hierarchical routing – Regions  Group nodes/routers into regions  Routers know  How to reach each node/router in their own region  How to reach each other region Perspective of one router

21 WS 05/06, v 1.1Computer Networks - Routing21 Routing within and between regions  A router perceives all routers in a “foreign” region as the same node, does not distinguish routing tables  Packet destined to own region: routed as normal  Packet destined to other region: get it to the region, don’t worry about details of routing there  Once a packet enters its destination region, router knows about the details how to reach the destination node  Necessary: Router must be able to easily infer the target region from packet’s destination!  Requires adequate addressing structure for a quick address ! region mapping  Treated a few slides later

22 WS 05/06, v 1.1Computer Networks - Routing22 Price of hierarchy  Hierarchical routing good for algorithm runtime, memory required for routing tables, next-hop lookup times, …  What is the price to pay?  Routes become non-optimal  Since no longer all the details of the network are represented, routing algorithms might miss optimization potential  Can this overhead be bounded? Is it acceptable in practice?

23 WS 05/06, v 1.1Computer Networks - Routing23 Only regions? Or multiple levels of hierarchy?  If network becomes REALLY big, these two levels of hierarchy might again not suffice  Group regions into clusters, clusters into domains, domains into conglomerates, … (or whatever terminology pleases you)  Obvious question:  How many levels of hierarchy?  How many entities should be grouped together to form the next- level conglomerate structure?  Good rule of thumb: For n nodes, use ln n levels of hierarchy  Requires e ln n entries in each routing table  Then: Good balance between routing overhead and smaller routing table sizes

24 WS 05/06, v 1.1Computer Networks - Routing24 Gateways between networks  Gateways are those nodes that connect to peer conglomerates  Such conglomerates are fairly independent of each other  Different routing protocols can be used – an interior gateway protocol in each conglomerate  Between gateways, yet another protocol is conceivable – an exterior gateway protocol – operating only on the “gateway graph”  Because of autonomy, the name autonomous system is used Gateways

25 WS 05/06, v 1.1Computer Networks - Routing25 Broadcast & multicast  Broadcast routing: Make sure every node receives a copy of a given packet  Unrestricted flooding is one (not particularly good) implementation option  Better: Construct minimum spanning tree, copy each packet going in on a given edge to all other tree edges  Related: Construction of minimal connected dominating set  Multicast routing: Ensure that each node of an explicitly given subset of all nodes receives a copy of a given packet  Algorithmically: Steiner tree problem, NP complete  Several approximations, e.g., Takahashi & Matsuyama  Various network constructions, tree-based or mesh-based approaches

26 WS 05/06, v 1.1Computer Networks - Routing26 Overview  From spanning trees to routing tables  Computing routing tables  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing

27 WS 05/06, v 1.1Computer Networks - Routing27 Addressing – Failure of simple addresses  Think back to the MAC/LLC layer: Each device has a globally unique MAC address  Why is there then a need to talk about some other addressing scheme?  How did spanning tree algorithm for bridges work?  Each bridge had to store a separate entry for each device to which is was routing packets  Lot’s of memory, CPU overhead (for searching) ! Clearly, this does not scale to large networks

28 WS 05/06, v 1.1Computer Networks - Routing28 Addressing and hierarchical routing  “Flat” addresses – addresses that express no structure – do not work well together with hierarchical routing  Necessary: Addresses that express/respect the hierarchical routing structure  Essentially, something like: Group-ID n :Group-ID n-1 :…:Group-ID 1 :Device-ID  Hierarchical addresses – addresses are relative to higher groups

29 WS 05/06, v 1.1Computer Networks - Routing29 “Closeness”  A note of caution: Closeness <> proximity  Proximity: Nearby physical location  Closeness: Structurally, logically within a short distance (e.g., in number of hops)  Closeness is not a standard nomenclature In proximity, but not logically close Not in proximity, but logically close

30 WS 05/06, v 1.1Computer Networks - Routing30 Overview  From spanning trees to routing tables  Computing routing tables  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing  IP addressing  Growing pains: Subnetting, classless addressing  Inter- and intra-domain routing in IP

31 WS 05/06, v 1.1Computer Networks - Routing31 Addressing case study: Internet IP addresses  IP addresses (traditionally) distinguish only two levels of hierarchies  Network interfaces/hosts  Note: “hosts” is somewhat incorrect since their interfaces are actually addressed; still common terminology  Networks  Different sizes of networks conjectured, defined as three classes ! Classful addressing  Network classes: Big – medium – small (class A, B, and C)  Routers have to know about all other networks (or at least about a router that knows about all of them as a default solution to send a packet)  An IP address is 32 bits, split into a network part (with three possible lengths) and an interface/host part  Usually written as dotted decimal, four decimals between 0 and 255

32 WS 05/06, v 1.1Computer Networks - Routing32 Classful IP addressing  In addition to three network classes A, B, and C, there is class D for multicast; class E as “reserved” Encodes network class of this address 128 NWs; 16 M hosts 16K NWs; 64K hosts 2M NWs; 256 hosts

33 WS 05/06, v 1.1Computer Networks - Routing33 Some reserved IP addresses  Some IP addresses are set aside for special uses  Not all of the network/host combinations are available

34 WS 05/06, v 1.1Computer Networks - Routing34 Forwarding using IP addresses/IP routing tables  A router is in charge of its “own” network, has to known how to handle packets for all destinations within  Upon a packet arrival, check if packet is destined for own network  If no: Look at “network” bits of the destination address, look up corresponding outgoing link, forward packet to that router  If no outgoing link known, use a “default”, fallback peer router  If yes: Look at “host” bits of the destination address, look up corresponding outgoing link, forward packet to that host  Basically, fairly straightforward, two-level hierarchical forwarding and routing

35 WS 05/06, v 1.1Computer Networks - Routing35 An IPv4 packet header

36 WS 05/06, v 1.1Computer Networks - Routing36 Overview  From spanning trees to routing tables  Computing routing tables  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing  IP addressing  Growing pains: Subnetting, classless addressing  Inter- and intra-domain routing in IP

37 WS 05/06, v 1.1Computer Networks - Routing37 Growing pains…  How does IP hold up when networks grow?  Two main problems ensue  Class A and B networks can contain MANY hosts, too many for a router to easily deal with ! subnetting  Network classes waste a lot of addresses  Example: Organization with 2000 hosts requires a class B address, wasting 64K-2K ¼ 62.000 host addresses! ! Classless addressing

38 WS 05/06, v 1.1Computer Networks - Routing38 Subnetting  Suppose an organization has a class B address but is organized into several LANs  Example: university with different departments  Main router does not really want to bother with all the nodes in the individual departments but wants to look only at whole networks  Obvious case for hierarchical routing and addressing – how to put hierarchies into existing IP addresses?

39 WS 05/06, v 1.1Computer Networks - Routing39 Subnetting – Hierarchies in addresses  Manipulating the class bits to introduce more hierarchy levels is not practical  Idea: have more hierarchy levels implicitly  Introduce a subnet, represented by “borrowing” bits from the host part of the IP address  Local router has to know where to apply this split – needs a subnet mask  Represented as u.x.y.u/#bits or as bit pattern needed to mask out the host bits Original host part

40 WS 05/06, v 1.1Computer Networks - Routing40 Forwarding with subnetting in place  Forwarding when packet is not destined to “own” network: as above; send to router in charge  Subnetting not visible outside the network!  Packet is destined to own network:  Router checks list of subnets belonging to the current network  Either another router/outgoing link is known ! send packet there  Or this router itself is in charge of the packet’s subnetwork ! send packet directly to the host in charge  Or nothing is known ! Send to default router  In effect: subnetting has introduced another hierarchy level between networks and hosts as in the traditional internet addressing

41 WS 05/06, v 1.1Computer Networks - Routing41 Classless Interdomain Routing (CIDR)  To solve second problem (running out of addresses because large chunks of addresses are allocated in big networks), essentially a similar idea is used  Just like in subnetting, break out bits from the host part to form networks of a more suitable size  But: Make these networks visible to other routers!  No extension in the IP packets needed  But more information in the routing tables has to be stored  Lookup and forwarding algorithms become more complicated

42 WS 05/06, v 1.1Computer Networks - Routing42 Overview  From spanning trees to routing tables  Computing routing tables  Hierarchical routing  Addressing  Case study: IP routing, forwarding, & addressing  IP addressing  Growing pains: Subnetting, classless addressing  Inter- and intra-domain routing in IP

43 WS 05/06, v 1.1Computer Networks - Routing43 Autonomous systems in the IP world  Large organizations can own multiple networks that are under a single administrative control  Forming an autonomous system or a routing domain  Autonomous system form yet another level of aggregating routing information  Gives raise to inter- and intra-domain routing  Inter-domain routing is hard  One organization might not be interested in carrying a competitor’s traffic, …  Routing metrics of different domains cannot be compared; only reachability can be expressed  Scale – currently, inter-domain routers have to know about 140.000 networks

44 WS 05/06, v 1.1Computer Networks - Routing44 Structure of autonomous systems in the IP  Resulting structure  Stub AS: Only a single connection to other AS; only carries local traffic  Multihomed AS: Has connections to multiple other ASs but refuses to carry non-local traffic for anybody else  Transit AS: Multiple connections, does carry both local and transit traffic – typical example of an Internet service provider (ISP) Backbone service provider 2 Backbone service provider 1 Consumer ISP 1 Consumer ISP 2 Large company Small company 1 Small company 2 Peering point

45 WS 05/06, v 1.1Computer Networks - Routing45 Intra-domain routing: OSPF  Internet’s most prevalent intra-domain (=interior gateway) routing protocol: Open Shortest Path First  Main properties  Open, variety of routing distances, dynamic algorithm  Routing based on traffic type (e.g., real-time traffic uses different paths) – different metrics for a link for different traffic  Load balancing: also put some packets on the 2 nd, 3rd best path  Hierarchical routing, “areas” as additional level, some security in place, support tunneled routers  Essential operation: Compute shortest paths on graph abstraction of an autonomous system  Link state algorithm  Link state information reliably flooded, sequence numbers, triggered or periodically, with time to live

46 WS 05/06, v 1.1Computer Networks - Routing46 Inter-domain routing: BGPv4  Routing between domains: Border Gateway Protocols (BGP)  Routing complicated by politics, e.g., only route packets for paying customers, do not route transit traffic, …  Legal constraints, e.g.: Traffic originating and ending in Canada must not leave Canada while in transit!  BGP’s perspective: only autonomous systems and their connections  Only talk about reachability, “optimal” is a vain hope  Operation: Distance vector protocol  But not only keep track of cost via a given neighbor, but store entire paths to destination ASs  More robust, solves problems like count to infinity  Infernally complicated protocol…

47 WS 05/06, v 1.1Computer Networks - Routing47 Example: Routing table sizes for Internet AS http://www.mcvax.org/~jhma/routing/bgp-hist.html

48 WS 05/06, v 1.1Computer Networks - Routing48 Bridging addressing gap: ARP  What happens once a packet arrives at its destination network / LAN?  How to turn an IP address (which is all that is known about the destination) into a MAC address that corresponds to the MAC address?  Simple solution: Yell!  Broadcast on the LAN, asking which node has IP address x  Node answers with its MAC address  Router can then address packet to that MAC address  Address Resolution Protocol (ARP)

49 WS 05/06, v 1.1Computer Networks - Routing49 Some internetworking issues  Other things to watch out for  Fragmentation  Connection-oriented vs. connection-less networks  Tunneling  Dynamic Host Configuration Protocol (DHCP)  IP version 6  Multicasting  Network Address Translation  Virtual Circuits  Routing for Quality of Service support  QoS concepts: Integrated and Differentiated Services  ATM / Label switching / MPLS  Routing in ad hoc networks, peer-to-peer networks  …  … but are not covered here due to lack of time

50 WS 05/06, v 1.1Computer Networks - Routing50 Conclusion  Routing in large networks not only requires adequate routing algorithms for general graphs  Also an appropriate, hierarchical network structure is required  Network structure has to be reflected in the addressing structure  Flat addresses would result in prohibitive overhead  Different metrics and goals have to be fulfilled, in particular in inter-domain routing where optimality is only a single aspect

51 WS 05/06, v 1.1Computer Networks - Routing51 Some IP design principles – A historical side remark  RFC 1958, based on papers from mid-80s:  Make sure it works – before writing the standard  Keep it simple  Make clear choices  Exploit modularity  Expect heterogeneity  Avoid static options and parameters  Look for a good design; it need not be perfect (80-20 rule)  Be strict when sending and tolerant when receiving  Think about scalability  Consider performance and cost


Download ppt "Computer Networks Group Universität Paderborn Computer Networks Chapter 6: Routing Holger Karl."

Similar presentations


Ads by Google