A Routing and Broadcasting Scheme on Faulty Star Graphs

0 downloads 0 Views 146KB Size Report
with a backtracking technique to route messages on the star graph in the presence of faulty links. ... The algorithm routes messages along the optimal, i.e., the.
A Routing and Broadcasting Scheme on Faulty Star Graphs Nader Bagherzadeh and Nayla Nassif Department of Electrical and Computer Engineering University of California, Irvine Shahram Lati Department of Electrical and Computer Engineering University of Nevada

Abstract

In this paper we present a routing algorithm that uses the depth rst search approach combined with a backtracking technique to route messages on the star graph in the presence of faulty links. The algorithm is distributed and requires no global knowledge of faults. The only knowledge required at a node is the state of its incident links. The routed message carries information about the followed path and the visited nodes. The algorithm routes messages along the optimal, i.e., the shortest path if no faults are encountered or if the faults are such that an optimal path still exists. In the absence of an optimal path, the algorithm always nds a path between two nodes within a bounded number of hops if the two nodes are connected. Otherwise, it returns the message to the originating node. We provide a performance analysis for the case where an optimal path does not exist. We prove that for a maximum of n ? 2 faults on a graph with N = n! nodes, at most p 2i + 2 steps are added to the path, where i is O( n). Finally, we use the routing algorithm to present an ecient broadcast algorithm on the star graph in the presence of faults.

1 Introduction A new interconnection network topology called the star graph has been recently introduced in the literature [1, 2]. An extension to this network has also been introduced [7]. The star graph is vertex symmetric. It provides an interconnection network for a large number of processors using a low number of communication channels while providing a high level of redundancy that makes it highly fault-tolerant [1, 2, 3]. An optimal algorithm for routing messages between any two nodes of the star graph assuming that no faulty links or nodes exist in the graph was presented in [1]. Faulttolerance routing has been discussed for di erent interconnection networks [6, 8]. Fault-tolerance of the star graph was discussed in [3, 9]. Reference [2] compared properties of the hypercube and the star graphs. A depth rst search approach to provide fault-tolerant routing in the hypercube was presented in [5]. Reference [9] presented a routing scheme using a depth rst search approach on 1

faulty star graphs. The scheme had shortcomings: by keeping the information about the traversed path in a stack that is popped every time a message backtracks, the algorithm does not guarantee liveness and deadlock-free transmission. In fact, an example can be found where the message gets stuck by being continuously sent to the same node. Due to faulty conditions, the node cannot forward the message. Once it returns the message, it receives it later because its node reference has already been popped o the stack. In this paper, we use symmetry and fault-tolerance properties of the star graph to introduce a distributed algorithm for eciently routing messages between any two nodes of the star graph in the presence of faulty links. The algorithm is based on the greedy routing algorithm combined with the fault-tolerant depth rst search approach [1, 5]. The paper is organized as follows. Section 2 gives some background and notations. Section 3 introduces the routing algorithm, its correctness proof and performance analysis. Section 4 presents a broadcast scheme based on the routing algorithm. Section 5 concludes the paper and Section 6 contains an appendix for basic permutation properties.

2 Background and Notations The star interconnection network is modeled as an undirected graph where the vertices correspond to processor nodes and the edges correspond to communication channels. The graph is referred to as an n-Star graph denoted by Sn, where the degree of each node is n ? 1. Nodes are identi ed with the permutation of digits 1 through n. Digits are referred to as symbols. By de nition of the star graph, two nodes are connected by an edge if and only if their respective node labels di er by interchanging in a node label the rst symbol with any other symbol. For example, node 1234 is connected to nodes 2134, 3214 and 4231 in S4. Links are denoted by the position of the symbol they permute, e.g., the link corresponding to symbol 2 is link 2 and it connects nodes 1234 and 2134. The identity node is denoted by 123::n. Figure 1 shows the S4 graph. Since the star graph is vertex symmetric, nding a path between two nodes is equivalent to nding a path between a node and the identity 123::n. Such a path is simply the permutation that sorts the source node into the identity. The permutation, denoted by relperm, can be decomposed into a sequence of one or more disjoint cycles, each of which contains an ordered set of symbols. The decomposition is unique except for the cycles order. Cycles containing more than one symbol that need to be permuted are referred to as pcycles. Cycles containing one invariant symbol are referred to as icycles. For more information on permutations, the reader is referred to [4]. In our notations, pcycles are built by identifying displaced symbols in the node label, starting from the leftmost position in the label. The rst pcycle is referred to as pcycle1. Starting from left to right, unassigned symbols in the node label constitute the icycles and are appended to the pcycles. As an 2

example, relperm that sorts node 426513 in S6 into the identity 123456 is relperm = (451)(63)(2). The optimal path connecting two nodes in the star graph is of length d hops, where d is given by:

8 < d = c + s ? : 0 if 1 is rst in the source label 2 if 1 is not rst in the source label

c denotes the number of pcycles in relperm and s the total number of symbols in these cycles [1].

In our model, faults are assumed to be in one or more links. This is not restrictive since a fault in a node can be modeled by a fault in all the links leading to it. It is also assumed that a node has only the knowledge of the status of the links connected to it. Thus, no general knowledge of the overall state of the faults is available at any node.

3 Routing on a Star Graph with Faults 3.1 General Description of the Routing Algorithm In our description, (m; d; f=w; visited; linklist) denotes the complete message being transmitted, where m is the actual message, d is the destination node and f=w is a bit that is set for a forward transmission and reset otherwise. Visited is an array of ags, each corresponds to a node and gets set once the node receives a forward message. Linklist is the list of links being traversed by the message. A link is appended to the list once a forward message traverses the link and deleted once the message backtracks through it. A valid link is de ned as a non-faulty link that sends the message to a non-visited node. The following is a skeleton of the algorithm where, for brevity, the value of a selected symbol is denoted by x: 1. At each node that receives a message, compute relperm if the node is di erent from the identity. If the message is forward, mark the node visited and append the link just traversed to the linklist, otherwise, delete the link from the linklist. 2. Select the leftmost symbol in relperm. If link x is valid, then send the message forward along it and go to step 1, else go to the next step. 3. Starting from the rightmost position of the rightmost pcycle and proceeding to the left, select the rst symbol that belongs to a pcycle. 4. If link x is valid, then send the message forward along it and go to step 1, else select the next symbol. 5. If all symbols in all pcycles have been selected, starting from the rightmost position and proceeding to the left, select the rst icycle. 3

6. If link x is valid, then send the message forward along it and go to step 1, else select the next icycle. 7. If all icycles have been selected and the current node is not the destination, then the destination cannot be reached from the current node. Send a return message along the last link in linklist and go to step 1.

3.2 Routing Algorithm Figure 2 shows some de nitions needed for the algorithm formulation. Figure 3 shows the DepthSearch-Routing (DSR) algorithm formulation in pseudo-code. It represents the code executed by node u when receiving (m; d; f=w; visited; linklist) from node v . Table 1 shows an example of routing from node 426513 in S6 in the presence of six faults, where some faults forced backtracking, others did not add any extra hops.

3.3 Correctness of the Routing Algorithm In the following, s and d are any two nodes in a faulty star graph Sn.

Lemma 1 When DSR routes a message from s, the total number of messages is bounded. Proof: Once a node u receives a forward message sent from node v, u is marked visited for that message. Thus, u will not get the same message again while being sent forward. In the worst case, u forwards the message to at most n ? 2 neighboring nodes (excluding v), receives at most n ? 2 return messages and sends the message back to node v with the forward ag reset. Thus, in the worst case, u receives at most n ? 1 messages, one of which is forward.

Lemma 2 When DSR routes a message from s to d, the average of all messages over all visited nodes, other than s and d, is one forward and one return message in the worst case.

Proof: Taking into account that the n ? 2 incoming return messages in Lemma 1 are messages sent out by the n ? 2 visited neighbors of u, the average is one return message per visited node.

Since each node receives one forward message before it is marked visited, therefore the average number of messages seen by any visited node is one forward and one return message in the worst case where all visited nodes fail to forward the message.

Lemma 3 (Liveness property). When DSR routes a message from s to d, the message is either successfully delivered to d within a nite number of hops or returned to s.

4

Proof:

The message keeps information about visited nodes and traversed links. Thus, it will not get stuck in in nite loops and it can always be returned to s, if undeliverable to d. If, on the other hand, it can be delivered to d, it will be by Lemma 2 in no more than 2(n! ? 2)+2 = 2(n! ? 1) hops. The two added hops are one from s and one to d.

Theorem 1 Let s and d be in the same connected component of Sn, DSR routes a message from s to d after at most 2(n! ? 1) ? ho hops, where ho is the number of hops needed to route the message on an optimal path in the absence of faults. If s and d are not in the same connected component of Sn, a message from s to d is returned to s by DSR after at most 2(n! ? 2) hops.

Proof: Assume s and d are in the same connected component and the message is not delivered

to d. It must be returned to s by Lemma 3. Consider any path P from s to d. Let u be the node following s in P . Since the message is not returned to s until all valid neighbors have been sent forward messages, u must receive a forward message. Since the message is not delivered to d, there must be two consecutive nodes on P , v1 and v2, such that v1 receives a forward message but v2 does not. Since v1 cannot send a return message without rst sending a forward message to v2, this is a contradiction. Thus, the message will indeed be delivered to d. It requires one hop for each node on the shortest path between s and d, excluding s, and at most two hops for each node not on this path. Thus, the message takes at most 2(n! ? ho ? 1) + ho = 2(n! ? 1) ? ho hops. The case where s and d are in di erent connected components has been omitted due to space constraints. When proving that an undeliverable message is returned to the source, it is assumed that a link cannot become faulty in the short interval of time between forward and backward traversals by the same message. If network conditions do not guarantee this and if it is required that an undeliverable message be returned to the source within a nite interval of time, then some recovery mechanisms can be added to handle the case where the message is stuck at u and cannot backtrack to its neighbor v :  u can send the message to v by issuing a forward message using DSR.  Acknowledgement, timeout and retransmit can be added to the algorithm.

3.4 Performance of the Routing Algorithm Lemma 4 According to our convention, if symbol 1 is not in its correct position, then it can only be the rightmost symbol in pcycle1.

Theorem 2 If there are no faulty links in the star graph, DSR is optimal. Proof: Let indtosym(1) = a1. Once u receives a forward message, it attempts to send it along link a1. By Lemma 4, if a1 = 1, then u is the destination and no proof is necessary. We assume 5

that relperm contains at least one pcycle. Consequently, a1 6= 1 and link a1 exists. Since no link is faulty, the node connected to u by link a1 cannot have been visited and the message is sent along link a1. Two cases are possible: Case 1: First symbol in u is 1. Sending along link a1 swaps 1 with the symbol occupying the desired position of a1 . Thus, DSR moves 1 to a position not occupied by the correct symbol. Case 2: First symbol in u is a1. Sending along link a1 moves a1 to its correct position. Thus, DSR routes the message in both cases along the optimal path described in [1].

Theorem 3 DSR is optimal in the presence of faults if and only if the faults are such that, at each node that receives the routed message, there exists at least a non-faulty link ai , where ai is:  any symbol in any pcycle in relperm, if pcycle1 does not contain 1, or  any symbol in any pcycle in relperm excluding pcycle1 if it contains 1.

Proof: Optimal means that DSR routes the message along a path requiring no more hops than

it does in the absence of faults. By using Appendix Equations 3, 5, 6 and 7, we can manipulate pcycles such that the rst transposition to be performed involves the 1 and ai positions, where ai is the following:  any symbol in any pcycle in relperm, if pcycle1 does not contain 1, or  any symbol in any pcycle in relperm excluding pcycle1 if it contains 1. Such a transposition is optimal since it takes the message one step closer to destination without adding any extra transpositions. Now we look at how DSR nds this optimal path. If link a1 is invalid, DSR considers links belonging to the rightmost pcycle in relperm rst. Consequently, if relperm contains more than one pcycle, pcycle1 is considered last. Thus, if there exists at least one non-faulty link ai , then an optimal path exists and DSR nds it. This proves the necessary condition of the theorem. It can be easily seen that if no non-faulty ai link exists, extra hops are added to the path and the path is no longer optimal.

Theorem 4 If all links ai, as de ned in Theorem 3, are invalid and if the faults are such that

node u can still forward the message along some valid link aj , the extra added hops due to aj do not exceed four hops.

Proof: This is proved by considering all possible cases. Link a1 is invalid by assumption. Case 1: pcycle1 contains 1 and aj and link aj is valid.  pcycle1 = (a1aj 1).

This path is made of two hops on a 3-Star, which constitutes a cycle of six hops. The best routing algorithm sends the message along link aj thus requiring four hops instead of two on the same 3-Star. This is the path followed by DSR. 6

 pcycle1 = (a1a2::ajaj+1::ak?11). After sending along link aj , pcycle1 breaks into (aj +1::ak?11)(a2::aj a1). The added number of hops is two. If aj = ak?1, the penalty is two hops as well.

Case 2: pcycle1 contains 1 and the links corresponding to all symbols in pcycle1 are invalid. In this case, icycle aj has to be disturbed.

 pcycle1 = (a11). Considering pcycle1 the only pcycle in relperm|other cases follow from the same analysis|

we note that the message is one faulty link away from destination. Since the smallest cycle in a star graph is of length six, the best routing algorithm needs ve hops to reach the destination, thus adding four extra hops. Table 2 provides a trace of how DSR nds such a path.

 pcycle1 = (a1a2::1). Disturbing an icycle in this case adds one symbol to pcycle1, while 1 remains in the same position. Thus, the penalty is two hops.

Case 3: pcycle1 does not contain 1. Thus, 1 is rst in u. Disturbing icycle (aj ) swaps 1 and aj .

The penalty is one hop to disturb icycle (aj ), three hops due to the newly added pcycle (aj 1), minus two hops because 1 is no longer rst in u. The total is two hops regardless of the icycle.

Theorem 5 When routing on a star graph with f faults where f  n ? 2, the penalty is at most p 2i + 1  1 hops, where i = d 2n ? 5:75  0:5e. Proof:

Since f  n ? 2 = degree of the graph minus one, no node can be disconnected. First we consider the case where one node u along the path has all n ? 2 faulty links incident on it. If u receives the message from node v along the single non-faulty link it has, u returns the message to v thus causing two extra hops. By Theorem 4, v forwards the message with at most four extra hops. Since all faults have already been encountered, the total number of extra hops is six. We now consider the case where no node has all n ? 2 faulty links incident on it. For simplicity, assume that relperm contains one pcyle and that (1) is an icycle, e.g., (a1a2 ::am )(1). Taking any ai link for 1  i  m gets the message closer to destination. There must be at least m faults to be forced to disturb an icycle. Suppose we disturb icycle b1. We then reach a node with relperm = (b11)(a1a2::am ). The number of remaining faults is fR = f ? m. Here again, we must have another m faults to be forced to disturb another icycle. Suppose we disturb b2. We get relperm = (b2b1 1)(a1a2 ::am) and fR = f ? 2m. Here we must have m + 1 faults to be forced to disturb another icycle. We continue until we have exhausted all the faults. After the ith iteration, 7

relperm = (bi::b2b11)(a1a2::am) and fR = f ? i  m ? (1 + 2 + :: + (i ? 2)). The total penalty is 2i hops, i hops due to disturbing i icycles and i hops due to the added cycle to relperm. We note that the smaller m is, the larger i and the penalty are. The worst case corresponds to m = 2. A similar conclusion can be drawn when 1 is not an icycle. For the worst case where m = 2 and (1) is an icycle and after the ith iteration, relperm = (bi::b2b1 1)(a1a2 ) and fR = f ? 2i ? (1 + 2 + :: + (i ? 2)). Therefore, for f = n ? 2, fR = n ? 3 ? i2=2 ? i=2 p i = d 2n ? 5:75 ? 0:5e where i is the smallest integer that makes fR = 0. After the ith iteration, a similar analysis for the worst case with 1 belonging to pcycle1 leads to the following results: relperm = (bi::b2b1a1 1), fR = f ? 1 ? (1+2+ :: +(i ? 1)) and the total penalty is 2i +2. For f = n ? 2, fR = n ? 3 ? i2=2+ i=2 p and for fR = 0, i = d 2n ? 5:75+0:5e. Table 3 shows i and the corresponding penalty for f = n ? 2 and di erent values of n.

3.5 Non bias towards speci c links We are concerned with DSR not favoring some links, once there is deviation from the optimal path. DSR sequentially considers links corresponding to symbols in pcycles whose particular sequence depends only on the source permutation. Once an icycle has to be disturbed, DSR searches for a valid icycle by descending dimension order. Available icycles depend on node labels. If it is found that icycles do not vary from message to the other, and since the penalty in disturbing an icycle is constant regardless of the icycle, DSR can be modi ed to pick an icycle at random. Thus, DSR does not favor any link.

3.6 Message Overhead The fault-tolerance of DSR introduces some overhead in the message packet. The overhead is made of the following:

 f/w is one bit denoting forward versus return message direction,  visited array is an array of n! ags. Encoding techniques, e.g., hashing, can be investigated in the future to eciently encode the node label corresponding to each ag,

 linklist is a variable length array, bounded by 2(n! ? 2) elements from Theorem 1, each representing a link and requiring log n bits. Note that once a message backtracks, the link 8

just traversed is deleted from linklist. Thus, the upper limit is a limit on the number of hops whereas the limit on the size of linklist can be smaller. Note also that Theorem 5 nds a substantially smaller limit on the number of hops for at most n ? 2 faults.

4 Broadcast on a Star Graph with Faults A broadcast algorithm on a star graph with no faults was introduced in [1]. The algorithm uses a sequence  of length at most 3(n log n ? n=2). The sequence is obtained through a switching network. We restate the algorithm in a slightly modi ed way: upon receiving a broadcast message, each node compares notes with every neighbor connected to it by a channel in  . If the neighbor has not yet received the message, the message is sent to it along with a trimmed sequence  0. Consider the example of S4 and its broadcast sequence  = 234324232 [1]. When node s initiates a broadcast message, it sends it to the following nodes with the following modi ed  :  to node(2) with 0 = 34324232,  to node(3) with 0 = 4324232,  to node(4) with 0 = 324232, The algorithm continues until nodes receive the message with an empty  0. We modify this algorithm to handle the existence of faulty links in the star graph. Figures 4 and 5 show some de nitions and the algorithm formulation respectively. The code is executed by node u upon receiving a broadcast message (m;  0). The proposed broadcast algorithm uses at most (3n log n ? n=2) steps in the absence of faults. In the presence of faults, the performance of the broadcast algorithm follows directly that of DSR as described in Theorems 3, 4 and 5.

5 Conclusion We presented a distributed routing algorithm that routes messages eciently on a faulty star graph. We proved that the algorithm nds an optimal path if one exists given the fault distribution, otherwise, it delivers the message to the destination or returns it back to the source within a bounded number of hops, depending on whether a path exists to the destination or not. Finally, we used the routing algorithm to provide an ecient way of broadcasting messages in the faulty star graph.

9

6 Appendix Some basic permutation properties follow. The reader is referred to [4] for more details. A transposition is a permutation containing two elements. Any cycle can be written as a product of non-disjoint transpositions using the following results. In a product of transpositions, the last is to be permuted rst. (a1a2 a3::ak ) = (a1 ak )::(a1a3 )(a1a2 ) (1) (aiaj ) = (1ai)(1aj )(1ai) (2) (a1 a2::ak?1ak ) = (ak a1 a2 ::ak?1) (3) (a1a2 )(a2a1 ) = (a1)(a2) (4) where a1 through ak denote distinct symbols, ai and aj denote any symbols other than 1. Using Equations 2, 3 and 4, we can write Equation 1 in the following two ways for 1 not in the cycle and for ak = 1 respectively. The last Equation is true for disjoint cycles. (a1a2 ::ak?1ak ) = (1a1 )(1ak)(1ak?1)::(1a2)(1a1) (a1::ak?11) = (1a1 ::ak?1) = (1ak?1)::(1a1) (a1::ak )(am ::ap) = (am ::ap)(a1::ak )

(5) (6) (7)

References [1] S.B. Akers, D. Harel and B. Krishnamurthy, \The Star Graph: An Attractive Alternative to the n-Cube," Proc. Int'l Conf. on Parallel Processing, 393{400, 1987. [2] S.B. Akers and B. Krishnamurthy, \A Group Theoretic Model for Symmetric Interconnection Networks," Proc. Int'l Conf. on Parallel Processing, 216{223, 1986. [3] S.B. Akers and B. Krishnamurthy, \The Fault Tolerance of Star Graphs," Proc. Second Int'l Conf. on Supercomputing, 270{276, 1987. [4] M.A. Armstrong, Groups and Symmetry, Springer-Verlag, New York, 1988. [5] D.M. Blough and N. Bagherzadeh, \Near-Optimal Message Routing and Broadcasting in Faulty Hypercubes," Int'l Jour. of Parallel Programming, 19 (5): 405{423, 1990. [6] E. Horowitz and A. Zorat, \The Binary Trees as Interconnection Networks: Applications to Multiprocessing Systems and VLSI," IEEE Trans. on Computers, C-30 (4): 247{253, 1981. [7] S. Lati and N. Bagherzadeh, \Incomplete Star: An Incrementally Scalable Network Based on the Star Graph," to appear in IEEE Trans. on Parallel and Distributed Systems. [8] D.K. Pradhan, \Dynamically Restructurable Fault-Tolerant Processor Network Architectures," IEEE Trans. on Computers, C-34 (5): 434{447, 1985. [9] S. Sur and P.K. Srimani, \A Fault Tolerant Routing Algorithm in Star Graph Interconnection Networks," Proc. Int'l Conf. on Parallel Processing, 3: 267{270, 1991. 10

1234

4231

a

b

3214

2134

3241

2431

2314

3124

2341

3421

c

d

1324

4321

3412

2413

a

b 4312

1432

4213

1423

1342

4132

1243

4123

c

d 2143

3142

Figure 1: The 4-star graph as an interconnection network symbol index - symbols are indexed according to their position in relperm starting with 1 for the leftmost position and ending with n for the rightmost position, e.g., in relperm = (451)(63)(2), index of symbol 4 is 1, index of 5 is 2, etc.. lastinc is the largest index of all symbols that belong to pcycles in relperm, e.g., in relperm = (451)(63)(2), lastinc= 5. indtosym(i) - returns the symbol whose index is i in relperm, e.g., in our example, indtosym(3) = 1. symtoind(j ) - returns the index of symbol j in relperm, this is the inverse function of indtosym(). node(l) returns the node connected to the current node by link l. lnk(u; v ) returns the link connecting nodes u and v . last(s) returns the tail of list s. Figure 2: De nitions for the DSR routing algorithm 11

optimal node label relperm hops index link comment needed 426513 (451)(63)(2) 5 1 4 send, f=w = 1 526413 (51)(63)(2)(4) 4 1 5 send, f=w = 1 126453 (63)(1)(2)(4)(5) 3 1 6 faulty 2 3 faulty 6 5 faulty 5 4 faulty 4 2 faulty 3 1 no link 1 node cannot forward the message, send return message 5 send, f=w = 0 526413 (51)(63)(2)(4) 4 1 5 visited node 4 3 faulty 3 6 send, f=w = 1 326415 (3651)(2)(4) 3 1 3 send, f=w = 1 623415 (651)(2)(3)(4) 2 1 6 send, f=w = 1 523416 (51)(2)(3)(4)(6) 1 1 5 send, f=w = 1 123456 (1)(2)(3)(4)(5)(6) destination Table 1: Routing example from node 426513 in S6 in the presence of six faulty links

node label relperm a1::1::aj:: (a11)(aj )::

aj ::1::a1:: (aj a1 1):: 1::aj ::a1:: a1::aj ::1:: aj ::a1::1:: 1::a1::aj ::

(aj a1 )(1):: (a1aj 1):: (aj 1)(a1):: (1)(a1)(aj )::

link comment

a1 aj aj a1 aj a1 aj

faulty

send visited node send send send send destination

Table 2: Routing for Case 2, pcycle1 = (a11), where the dots denote undisturbed icycles 12

while u 123::n do compute relperm if (f=w = 1) then linklist linklist append lnk(u; v ) visited[u] 1 else linklist linklist delete last(linklist) /* move rst symbol in node label to its correct position or to a position not occupied by its correct symbol */ if (link indtosym(1) not faulty) and (visited[node(indtosym(1))] = 0) then send (m; d; 1; visited; linklist) to node(indtosym(1))

exit

/* nd a valid link starting from last symbol in last pcycle */ sendmsg (1,lastinc) /* nd a valid link corresponding to an icycle */ sendmsg (lastinc,n) /* no valid link, send return message */ if (linklist not empty) then send(m; d; 0; visited; linklist) to node(last(linklist)) exit /* undeliverable message is returned or is at the source */ procedure sendmsg(minindex,nextindex) found false if indtosym(nextindex) = 1 then nextindex nextindex ?1 while (not found) and (nextindex > minindex) if (link indtosym(nextindex) not faulty) and (visited[node(indtosym(nextindex))] = 0) then found true else nextindex nextindex ?1 if indtosym(nextindex) = 1 then nextindex nextindex ?1 if (found) then send (m; d; 1; visited; linklist) to node(indtosym(nextindex))

exit

Figure 3: DSR routing algorithm formulation 13

(1) is

n = 4 n = 5 n = 6 n = 7 n = 8 n = 9 n = 10

i

icycle

penalty

icycle

penalty

(1) is not

i

1 2 2 6

2 4 3 8

2 4 3 8

3 6 4 10

3 6 4 10

3 6 4 10

4 8 5 12

Table 3: Number of penalty hops for n ? 2 faults and di erent values of n

neighbor(u; l) - returns the node connected to u by link l. trim( 0; l) - trims the sequence  0 by removing the links starting from the leftmost one, up to and including the rst occurrence of link l, e.g., trim(234324232; 4) = 324232. Figure 4: De nitions for the broadcast algorithm

for l = 2 to n do if (l 2  0) and (neighbor(u; l) has not received m yet) then recursive send(m; trim( 0; l), neighbor(u; l)) procedure recursive send(m;  0; v ) send(m;  0) from u to v using DSR if (DSR fails) and ( 0 is non-empty) then /* node v is disconnected from the graph */ for l = 2 to n do if (l 2  0) and (l lnk(u; v )) and (neighbor(v; l) has not received m yet) then recursive send(m; trim( 0; l), neighbor(v; l)) Figure 5: Broadcast algorithm formulation 14