290 likes | 455 Views
Interval Routing. Presented by: Marc Segal. Motivation(1). In a computer network a routing method is required so that nodes can communicate with each other. Normally, an O(N) routing table is used. This method does not scale well for large networks: Routing is inefficient
E N D
Interval Routing Presented by: Marc Segal
Motivation(1) • In a computer network a routing method is required so that nodes can communicate with each other. • Normally, an O(N) routing table is used. • This method does not scale well for large networks: • Routing is inefficient • Storage space cost for nodes
Motivation(2) • One possible solution is prefix-routing: • Node identities are words over an alphabet Σ • Routing is done using the entry in the routing table that has the longest common prefix with the destination address • In this presentation we present an alternative method that requires O(d) size tables, where d is the degree of the node
Model • A network is an N-node connected graph G(V,E), N=|V| • Edges may have a non-negative cost value associated with them. • The edges incident at a node are called its links. • A node communicates with its neighbours via its links. • Links are bidirectional.
Interval Labeling Scheme • Nodes and links are labeled with labels from a linearly ordered set {i0,i1,…,iN-1} • The label of node v is marked α(v) • For simplicity, we label nodes 0,1,…,N-1 • An Interval Labeling scheme (ILS) is a scheme in which: • All nodes get different labels • At every node each link receives a distinct label • Link labels are stored in a sorted cyclic table at each node
The routing routine • Routing is performed to the first link αssuch that the interval [αs, αs+1) contains the destination node. SEND(i,j,m) { if i==j process m else { i=first link αs such that αs≤j<αs+1; SEND(i,j,m) } }
Interval Routing – An example 0 SEND(0,5,m) SEND(0,3,m) 4 2 0 0 4 2 SEND(4,5,m) SEND(2,3,m) 1 1 4 2 1 SEND(1,3,m) SEND(1,5,m) But… 3 6 1 1 3 6 This ILS is invalid! 5 5
Valid ILS • An ILS is valid if all messages sent from any source node reach their destination. • Theorem: For every network G there exists a valid ILS. • We show a DFS based algorithm for finding a valid ILS.
The DFS scheme • Start with an arbitrary node, label it 0 • Proceed in DFS order, labeling nodes with consecutive numbers. • Label links with the label of the node they connect to • If a node that admits no forward is reached, and i is the largest node number assigned until now, backtrack and label the link over which we backtrack (i+1) mod N. • If backtracking to node u from node v that has a frond at node 0 and i=N-1, label the backtrack link by α(u) (instead of 0).
The DFS scheme - example 0 1 5 6 0 1 0 0 6 2 2 5 6 0 1 2 4 6 3 4 4 2 6 2 4 3 5
DFS Scheme - correctness • Since the graph is connected DFS will find a spanning tree • A node labeled u whose maximum descendent is i has : i+1 u All nodes in the interval [v,w-1) will be under this subtree All nodes in the interval [w,i) will be under this subtree v w-1 v w
Optimum schemes • The DFS labeling scheme is valid but is not necessarily optimal. • For example, • A labeling scheme is called optimal if all paths between the nodes in the scheme are the shortest possible paths.
Optimum Schemes(2) • The DFS scheme is optimal for Trees and for complete graphs. • For rings the following scheme is optimal: • Orient the ring in one direction an label the nodes consecutively from 0 to N-1 • For each node i • Label the right link by • label the left link by 2 1 0 0 3 3 1 1 2 2 3 0
Optimum Schemes(3) • A k-labeled ILS is an ILS where: • Each link may receive up to k distinct labels • At every node all the link labels must be distinct • Proposition: For any graph with N nodes there exists an (N-1)-labeled ILS that is optimum • For every node i, for every node j label the first link on the shortest path from i to j by j. • This is actually the traditional routing table
Neighbourly schemes • An ILS is a neighbourly scheme if it is valid and all messages for a neighbour are delivered directly in one hop. • Lemma: The only nodes in a DFS scheme that do not necessarily deliver messages to neighbours in one hop are those nodes k that have fronds to nodes i with i<k • Proof: Let j,k be negihbours i Case 1: (j,k) is a frond j Case 2:j is k’s father k Case 2a:If k has no fronds from k to i, i<j i b j k Case 2b:If k has a frond from k to i, i<j
Neighbourly schemes(2) • Theorem: There exists a two-labeled neighbourly scheme for any arbitrary graph. • Start with a DFS scheme • We only need to concern ourselves with the case in lemma 1 • For such a link (k,j) double-label it with the label j • We must make sure that messages to to any node t in [j,k+1) are routed correctly. • Since j≤t<k, the message is sent to j and does not return to k
Orderly DFS schemes • A DFS scheme is orderly if whenever there is a ‘backward’ frond from node k to node i and x>k, either x must belong to the subtree of the DFS tree with k as a root or x does not belong to the subtree with i as a root. • Lemma: in an orderly DFS scheme, if there is a backward frond from node k to node i and the backtrack link at k is labeled b, the backtrack link at i is also labeled b. i b k
i i j j b i b j k k Orderly DFS schemes(2) • Theorem: There exists a neighbourly ILS for every graph that has an orderly DFS scheme. • Relabel the orderly DFS scheme: for each node k that has backward fronds the smallest of which is i and whose father is j: • The modified scheme is neighbourly : By the lemma, we only have to consider node k. Messages to j are now delivered in one hop. But so are messages to i since
Orderly DFS schemes(3) • The modified scheme is valid: • The only intervals that were changed are [j,k) and [b,i) • Messages for nodes in [j,k) were routed through i and then made their way down to j. Now they are routed directly to j. • Messages for nodes in [b,i) were routed throuh j and made their way up the tree to i. Now they are routed directly to i • Corollary: There exists a neighbourly scheme for any Hamiltonian graph
Scheme indices • The index of a node in an ILS is the number of hops it takes a message sent by the node to itself to return to its sender • The index of an ILS is the maximum of indices of all the nodes • Proposition: a DFS scheme is of index 2 • A message from a node i to itself can be routed only to a frond or to the node’s father. In either case, the message returns immediately.
Insertion & connection of schemes • Definition: An ILS is sequential if each node i has a link labeled (i+1)mod N • Proposition: A valid ILS remains valid after cyclically shifting the labels of all nodes and links by a constant • Because • Proposition: There exists an algorithm for updating a valid ILS after unit-link insertion of a node for every network G with a valid sequential ILS
Insertion of nodes • If node x is to be inserted to node i, cyclically shift every node and link label until node i becomes node N-1. Label the new node by N. Label the link (N-1,N) by N and link (N,N-1) by 0. 5 0 7 6 3 6 1 5 4 5 7 6 0 6 0 1 0 4 5 6 0 0 2 3 2 5 2 6 6 5 0 0 4 2 1 6 3 3 4 2 4 4 6 2 1 4 4 3 5
Insertion of nodes (2) • Routing within the old network is unchanged except for node N-1 • Because the scheme is sequential node N-1 has a link to 0. If β is the maximum link label at node N-1 before the addition of the new node, the only interval that is affected at node N-1 is [N-1,N). • If β is the maximum link label at node i, then all messages to N will be routed through this link. But so will all messages to N-1. So the messages to N will follow the same route as messages to N-1. From N-1 they will reach N in one hop. • Corollary: A DFS scheme remains valid after a unit-link insertion of a node. α β N-1 N
Insertion of nodes(3) • The previous algorithm does not work if the new node is connected through multiple links. • Definition: A zero-biased ILS is an ILS in which every node has a zero link with the possible exception of the zero node. • Unlike sequentiality, the zero-biasedness is not preserved under arbitrary cyclic shifts. • Proposition: There exists an algorithm for updating a zero-biased ILS after multiple links insertion of a node if that node has a link to node N-1. • Label the new node N and connect all links, labeling linke (i,N) by N and linke (N,i) by i • The zero link guarantees that the only messages routed to N are messages intended for N • Messages to the new node N will either get routed throug N-1 or directly through one of the new fronds
Connecting two networks • Theorem: There exists an algorithm for constructing a valid ILS for the unit-link connection of two arbitrary sequential ILS. • Cyclically shift G1 so that the node that connects to the second graph is labeled N-1. • Cyclically shift G2 so that the node that connects to G1 is labeled 0 and then add N to all node and link labels • Relabel all links with value N in G2 to 0, except at node N • Label the link between G1 and G2 (N-1,N) by N and link (N,N-1) by 0.
Leader election using an ILS • We can utilisze the information embedded in the ILS it is possible to solve the leader election problem • The approach : nodes send a probing message via the maximum link • Lemma: In a ring network with a valid ILS of index 2 if every node sends a probing message via the maximum link, either the maximum node or one of its neighbours must eventually receive two probing messages • If any other node is connected by maximum links to both its neighbours the scheme is not valid • If all nodes’ maximum links are in the same direction the scheme is not of index 2
Leader election using an ILS - a ring • Theorem: There is an algorithm for locating the maximum node in a ring network of N nodes with a valid ILS of index 2 that uses at most 2N+1 messages • Every node sends a probing message containing its identification number to one of its neighbours and a regular awake message to the other neighbour. • The node that receives two probing messages compares the identification number of the three nodes and decides if it is the leader or one of its neighbours • Since every node sends 2 messages and there may be one extra message to inform the leader the bound is 2N+1
Leader election using ILS – general graph • Theorem: There is a distributed algorithm for locating the maximum node in a general network of N nodes given a valid ILS of index 2. This is achieved in at most 2E+N exchanges of message. • Let every woken node send a probing message through its maximum link and a regular awake message on all other links. • The node then awaits messages from all its neighbours. • Every node computes the maximum in its 1-neighbourhood and sends the computed result to the neighbour via the maximum link • The node that receives its own identification back again as a processed maximum declares itself the leader • There can be at most one such node because the ILS is valid • There is at least one such node because the ILS is of index 2
References • “Interval Routing”, J. Van Leeuwen and R.B. Tan, The computer Journal Vo. 30 No.4 , p. 298-307, 1987 • “Linear Interval Routing”, Erwin M.Bakker, Jan Van Leeuwen and Richard B. Tan