raph Theory and Topology esign avid Tipper ssociate Professor raduate Telecommunications and Networking Program University of Pittsburgh tipper@tele.pitt.edu Slides http://www.sis.pitt.edu/~dtipper/0.html Top own Network esign pproach Top down network design project approach should follow three phases: onceptual Model Objectives, Requirements, onstraints Logical Model Technology, network graph, node location, link size, etc. (where algorithms are used to minimize cost) Physical Model Specific hardware/software implementations (e.g., wiring i diagram, repeater locations, etc.) ocus on lgorithms for Logical Model esign raph Theory Optimization Telcom 0
raphs Telecommunication and computer networks are naturally represented by graphs graph = (V, ) is a mathematical structure consisting of two sets V and lements of V are called vertices (or nodes) or example, switches, routers, crossconnects lements of are called edges ommunication links are edges (wired or wireless) ach edge has two endpoints v, v ) V V ={,,,,,,} = {(,),(,), (,), (,),., (,)} ( dge Vertex Telcom 0 Terminology Networking tends to use notation (N,L) instead of (V, ) for a graph where N is set of nodes and L is set of links graph is simple if it has no loops or parallel edges. Loop Link where both endpoints are the same node. lso called a self-loop. Parallel edges collection of two or more links having identical ends. lso called a multi-edge. ocus on simple graphs egree of a node (vertex): d i Number of links/edges out of a node (assuming same number of in and out links) djacent nodes/vertices: Two nodes are adjacent if there is a link that has them as endpoints node degree d i = number of neighbor nodes of node i Telcom 0
Terminology ont. xample network: simple graph egree of Node d =, egree of Node d = and are adjacent, and not Size of graph characterized by number of nodes N and number of links L xample network: N = 7, L = 0 an represent graph by djacency matrix which is N x N matrix where a ij = if link exist between nodes i and j a ij = 0 otherwise = - 0 0 0 0-0 0 0 0-0 0 0-0 0 0 0-0 0 0 0 0-0 0 0 - Telcom 0 5 Paths and ycles Path from node to node Z: n alternating sequence of nodes and links, representing a continuous traversal from vertex to vertex Z. Trail: a path with no repeated edges. ycle: a path starting and ending on the same node onnected graph: graph in which every pair of distinct nodes has a path between them. Weighted raph: graph (N,L) is weighted if there is a value w ij associated with each link l ij ɛ L or example, link speed, cost, etc. We often denote this graph (, W) or (N,L,W). Telcom 0 6
Terminology ont. xample: Path from to is given by (,),(,),(,) ycle at is given by (,), (,), (,) xample is a connected raph Telcom 0 7 raph Types omplete raph: every node is connected to every other node also called a ull Mesh N node network every node has degree (N-) Mesh raph ach node having degree or more and forming a connect graph in which every pair of distinct nodes has a path between them. Telcom 0 8
raph Types rid raph: Nodes have a regular grid pattern: Occurs in parallel computing, sensor networks, etc. Telcom 0 9 raph Types Tree: a connected, simple graph without cycles. ny tree with N nodes has N- links Trees often used in access networks Telcom 85 0 5
aynetworks P*8x50 RST OOO0 ON 6 PWR THR LM LINK RS LM N0 N PWR0PWR INS T LM P R entillion 00 S P* 8x50 O OO0 O N 6 aynetworks RST PWR THR LM LINK RS LM N0 N PWR0 PW R IM INS T LM P R entillion 00 S P* 8x50 O OO0 O N 6 aynetworks RST PWR THR LM LINK RS LM N0 N PWR0 PW R INS T LM P R S entillion 00 Typical ellular Network S S S7 HLR S S S6 U MS S IR S S5 VLR Tree Terminology S S7 S S S S6 S S5 Root: One node of a tree may be designated as a root (has no parent only children) ach node (besides root) has a single parent node which is the node closest to the root ach node has zero or more child nodes which are the adjacent nodes farthest from the root Leaf: a node without a child Telcom 0 raph Types tree is a STR if only node has degree > X Y P Q Z Telcom 85 6
raph Types HIN is a tree with no nodes of degree > X Y Z Trees are usually the cheapest network design However have poor reliability Telcom 85 P Q raph Types In graph theory, a tour refers to a possible solution of the traveling salesman problem (TSP). iven a set of Nodes N = {n,n, n N } a tour is a set of N links l L such that each node N has degree ee and the graph is connected in networking this is a ring topology Rings are used when reliability is important Telcom 85 7
raph nalysis asic graph theory analysis to study/compare network topologies Some Typical Metrics Maximum Node degree verage node degree Minimum node degree verage path length between a node pair verage shortest path length network wide Network iameter length of longest shortest path in the network Number of critical points in graph Link/node whose loss partitions graph K connectivity is k connected in removal of any combination of k- nodes doesn t partition the graph tc.. Telcom 0 5 Small World raphs/networks property of some networks is ``small world or scale free behavior Small number of hops to reach most people lustering into Neighborhoods Used to model social networks Scale-ree Networks istribution of node degree has a power law behavior ~ k -r r >, typically < r < where k = # links; Simple test for scale free is to plot a histogram of node degree test power law behavior Telcom 0 6 8
Telecom Italia ackbone Testing if Scale ree get frequency histogram TORINO MILNO RSI VINZ MILNO VRON VNZI LSSNRI PINZ SVON NOV OLON PIS IRNZ PRUI NON ROM L QUIL PSR ROM OI RI SSSRI NPOLI SLRNO POTNZ TRNTO LIRI TNZRO MSSIN PLRMO RIO. Not scale free! Telcom 0 7 Network Topologies Most networks a mix of trees, rings, mesh depending on network type, cost/traffic/reliability Need to know how to determine good topologies for Tree, Ring and Mesh Use graph theory derived algorithms for Tree and Rings Telcom 0 8 9
esign of Trees Many algorithms for design and types of trees Minimum Spanning Trees, Shortest Path Trees, etc. Spanning Trees and Subgraphs Subgraph of graph obtained by selecting number of links and nodes from or each link, the two nodes incident on that link must be selected ive graph (N,L), graph (N,L ) is a subgraph of iff N N and L L and l L, if l incident on e and w then e, w N spanning subgraph includes all the nodes of tree T is a spanning tree of if T is a spanning subgraph of Not usually unique typically many spanning trees Telcom 0 9 Spanning Tree xamples Network raph onsidered Spanning Tree Spanning Tree Telcom 0 0 0
inding the MST The Minimal Spanning Tree (MST) spanning tree of whose total weight is a minimum minimum cost spanning tree an have many MSTs all with same cost MSTs are used in for network designs when have just few nodes and cost is dominant factor (ccess networks) Two algorithms Kruskal and Prim Telcom 0 lgorithm Prim s lgorithm given a weighted graph (N,L,W) starts by selecting a node adding the least expensive link iterates until tree is built U = set of nodes in MST V = set of nodes that are NOT in MST but are adjacent to nodes in U. Place any node in U and update V. ind the link with smallest weight that connects a node in V to a node in U. dd that edge to the tree and update U & V.. Repeat & until all nodes are included U = N Telcom 0
lgorithm xample pply Prim algorithm to the graph below Telcom 0 Prim s lgorithm xample rbitrarily pick node to start with min cost link to a node in V is (,) Iteration ti U V 0,,,,,,,,,, Telcom 0
Prim s lgorithm xample Iteration U V 0,,,,,,,,,,,,,,, Telcom 0 5 Prim s lgorithm xample Iteration U V 0,,,,,,,,,,,,,,,,,,,, <= arbitrarily pick (,) link rather than (,) Telcom 0 6
Prim s lgorithm xample Iteration U V 0,,,,,,,,,,,,,,,,,,,,,,,,,,,, Telcom 0 7 Prim s lgorithm xample Iteration U V 0,,,,,,,,,,,,,,,,,,,,,,,,,,,, 5,,,,, Telcom 0 8
Prim s lgorithm xample Iteration U V 0,,,,,,,,,,,,,,,,,,,,,,,,,,,, 5,,,,, 6,,,,,, <= arbitrarily pick (,) link rather than (,) link MST is complete weight is Telcom 0 9 Kruskal s lgorithm Kruskal achieves the MST by starting with a graph and picking out edges based on cost. heck that the graph is connected. If it is not connected stop. Sort the edges of the graph in ascending order of weight.. Mark each node as a separate component.. xamine each of the sorted edges: if the edge connects two separate components, add it ; otherwise, discard and go to step Telcom 0 0 5
lgorithm xample pply Kruskal s algorithm to the graph below Pick one of the edges with minimum weight bi rbitrarily il pick k() (,) rather than () (,) Telcom 0 lgorithm xample Iteration pick (,) as it has minimum weight Telcom 0 6
7 lgorithm xample Iteration rbitrarily pick (,) out of possible choices (,), (,), (,),(,) Telcom 0 lgorithm xample Iteration rbitrarily pick (,) out of possible choices (,), (,),(,) Telcom 0
8 lgorithm xample Iteration 5 pick (,) as (,) is not a valid choice ( and are in same component) Telcom 0 5 lgorithm xample Iteration 6 pick (,) from possible choices (,), (,) MST is complete weight is p g Telcom 0 6
MST s rawbacks n MST for 0 nodes N0 N N6 N7 N9 N N5 N8 N N MSTs don t scale well when traffic is internal note graph above is beginning to have a leggy look, which means that some traffic is taking a circuitous route between its source and destination. Telcom 0 7 Shortest-Path Trees (SPT) Shortest Path iven a weighted graph (,W) and nodes n and n, the shortest path from n to n is a path P such that the sum of link weights along the path is a minimum. Shortest Path Tree e P w ( e) iven a weighted graph (,W) and a node n, a shortest path tree rooted at n is a tree T such that, for any other node n, the path from n to n in the tree T is a shortest path between the nodes. SPT vs. MST SPT cost more, but will have lower link utilization and lower delay, smaller average hop count Telcom 0 8 9
inding a Shortest Path Tree iven a connected graph and a node selected to be a root ijkstra s algorithm can be used to find a shortest path tree The algorithm is similar to Prim s in that one iteratively builds a tree Let N = set of Nodes S = source node U = set of nodes incorporated so far W() is the link cost, specifically w(i,j) is the cost from node i to node j, w(i,j) = if the two vertices are not directly connected d_min is the currently known minimum cost path from node s to node k Telcom 0 9 inding a Shortest Path Tree ijkstra s lgorithm. Initialization: Mark every node as unscanned and U = {s}, d_min(k) = w(s,k) for k s. Loop until you have scanned all the nodes.. ind the node x not in tree T with the minimum cost path from s, add x to T. Update the minimum cost paths d_min(k) = min{d_min(k), min(k), d_min(x) + w(x,k)} Terminate when all nodes added to T Requires N iterations Telcom 0 0 0
lgorithm xample pply ijkstra s algorithm to find a SPT rooted at Iteration T d_min() Path d_min() Path d_min() Path d_min() Path d_min() Path d_min() Path {} (,) - (,) (,) (,) - {,} (,) (,),(,) (,) (,) (,) (,),(,) Telcom 0 lgorithm xample Iteration T d_min() Path d_min() Path d_min() Path d_min() Path d_min() Path d_min() Path {} (,) - (,) (,) (,) - {,} (,) (,),(,) (,) (,) (,) (,),(,) {,,} (,) (,),(,) (,) (,) (,) (,),(,) {,,,} (,) (,),(,) (,) (,) (,) (,),(,) 5 {,,,,} (,) (,),(,) (,) (,) (,) (,),(,) 6 {,,,,,} (,) (,),(,) (,) (,) (,) (,),(,) 7{,,,,,,} (,) (,),(,) (,) (,) (,) (,),(,) SPT is a Star topology MST Telcom 0
Prim ijkstra Trees MSTs have high delay but are cheap SPTs have lower delay and utilization but more expensive Prim-ijkstra algorithm interpolates between MST and SPT (comprise) lgorithms : ) Prim s: min neighbors dist( node, neighbor) ) ijkstra s: min ( dist( root, neighbor) dist( neighbor, node)) neighbors ) Prim-ijkstra s: 0 min ( dist( root, neighbor) dist( neighbor, node)) neighbors Telcom 0 Rings tree maybe too unreliable to be a good network design as they are subject to single point of failure onsider the reliability of Tree vs. Ring Let p = probability of a link failure ive Node Tree ive Node Ring P(No ailure) = (-p) P(ailure) = (-p) = ( p + 6p p + p ) = p - 6p + p - p P(ailure) = - (-p) 5 5p(-p) P (ailure) = 0p (-p) + 0p (-p) + 5p (-p) + p 5 Telcom 0
Rings and Reliability omparing the reliability of Trees vs Rings p Tree Ring..9.085.0.09 9.8 x 0 -.00.00 9.98x 0-6.000.999 x 0-9.998x 0-8.0000.999 x 0-5 9.9998x 0-0.00000 x 0-6 x 0 - How can one find a good ring topology? Telcom 0 5 Traveling Salesman Problem (TSP) Number of tours is in a set of N nodes is inding a tour/ring is equivalent to the Traveling Salesman Problem (TSP) iven a set of nodes ( n, n,..., n N ) and a distance/cost function d : N N, the traveling salesman problem is to find the tour such that N d ( n, i n ) i is a minimum. i TSP is a tough problem (NP Hard) Solve using use heuristic algorithms. ( N )!/ Telcom 0 6
Nearest-neighbor lgorithm. Start at a node we call root and set current_node = root.. Loop until we have all the nodes in the tour. ind the node closest (i.e., min cost or distance ) to the current_node that is not in the tour. We call this best_node. reate an edge between current_node and best_node. Reset the current_node to the best_node.. inally create an edge between the last node and the root to complete the tour. Telcom 0 7 Nearest Neighbor xample xample: Start at node Table 6. xample Network Link osts Node Node 5 6 9 0 5 9 6 6 8 7 7 9 8 0 5 9 8 Telcom 0 8
Nearest Neighbor xample Telcom 0 9 Nearest Neighbor xample Telcom 0 50 5
Nearest Neighbor xample Telcom 0 5 Nearest Neighbor xample Telcom 0 5 6
Nearest Neighbor xample 5 Telcom 0 5 Nearest Neighbor xample 5 6 Telcom 0 5 7
Nearest Neighbor xample 7 5 6 Total ost = 50 Telcom 0 55 Observation: * ood (?): Nearest-neighbor lgorithm We are trying to produce a short tour, we will always move to the best possible next location. * ad (?): When we look at the figure produced, we can see the lines may cross frequently. Several improved version of nearest-neighbor in the literature - will look at optimization based approaches later Simple improvement is grow ring/tour r from both ends That is when finding best node to move to look at option from both ends of current partial tour Telcom 0 56 8
Nearest Neighbor xample: Start at node Table 6. xample Network Link osts Node Node 5 6 9 0 5 9 8 8 8 7 7 9 7 0 5 9 8 Telcom 0 57 Nearest Neighbor xample Telcom 0 58 9
Nearest Neighbor xample Telcom 0 59 Nearest Neighbor xample Telcom 0 60 0
Nearest Neighbor xample Telcom 0 6 Nearest Neighbor xample 5 Telcom 0 6
Nearest Neighbor xample 5 6 Telcom 0 6 Nearest Neighbor xample 5 7 6 Total ost = 8 Telcom 0 6
(Rings) o Not Scale iven uniform traffic any Ring of N nodes has hops N N if n is odd and if n is even. ( N ) omparison of average number of hops for MST and TSP: Number of nodes hops MST hops TSP 5.8.5 0.778.777 0.5858 5.6 50 8.559.755 00.979 5.5 Telcom 0 65 Improving Ring Topologies an reduce hop count by adopting a multi-ring topology. Topology is a set of interconnected rings xample, a TSP tour on 0 nodes. The average number of hops is 5.6. We want to reduce the average hop count but keep the -connectivity. N0 N N6 N N7 N5 N9 N N0 N N5 N9 N N6 N8 N7 N N8 N N Telcom 0 66
ivide and onquer Use a ivide and onquer approach ivide nodes into disjoint subset, construct ring for each subset, then join rings xample ivide the 0 nodes into compact clusters of 0 nodes each. all these clusters and. (We might divide the 0 nodes by ranges of their coordinates, for example, to create the clusters.) Use the nearest-neighbor algorithm to design TSP tours on each cluster. Select v and v to be the nodes such that t the distance is the minimum. Now select v -v and v -v to be the nodes such that the distance is the minimum. dd the edges (v,v), (v,v) to the design. Telcom 0 67 ivide and onquer rouping into groups of 0 nodes. Then running the nearest neighbor algorithm gives two rings as below. Note that the average hop count is reduced N0 N N6 N N7 N5 N9 N N0 N N5 N9 N N6 N8 N7 N N8 N N Telcom 0 68
ivide and onquer rouping into groups of 0 nodes. Then running the nearest neighbor algorithm gives two rings as below. Joining i the two rings at their closet points results in N0 N N6 N N7 N5 N9 N N0 N N5 N9 N N6 N8 N7 N N8 N N Telcom 0 69 Level N. merican Network Snapshoot of their backbone in mid 90 s Telcom 0 70 5
Typical Network esign Network Topology esign Need to know how to construct Trees Rings Mesh networks ccess lgorithms adopted from graph theory are used for eeder Network Trees and Rings Metro rea ackbone Metro rea ore ~Mesh Metro ~ Ring ccess ~ Tree entral Offices Metro rea Metro rea n TLOM 0 7 Summary asic raph theory terminology and techniques nalysis useful to compare/evaluate designs Trees and Rings are often used in access networks Trees MST (Prim, Kruskal algorithrms) SPT Prim-ikjistra Trees Rings etter reliability than trees Nearest neighbor, Improved nearest neighbor Multi-Ring Telcom 0 7 6