E ciency and Simplicity in Self-Stabilizing ... - Semantic Scholar

4 downloads 0 Views 139KB Size Report
Villain Vil97] proposed two optimal token circulation algorithms for chains. Both algorithms require 22. 3(n?2) states. This surprising result seems to contra-.
Eciency and Simplicity in Self-Stabilizing Distributed Depth-First Token Circulation Algorithms Franck Petit

PhD Dissertation: Extended Abstract January 1998

The self-stabilizing distributed depth-rst token circulation algorithms have many applications in distributed systems. The solution to this problem can be used to solve the mutual exclusion, spanning tree construction, synchronization, and many others. In this thesis, we propose several depth-rst token circulation algorithms for trees and arbitrary networks. The algorithms do not use the processor identities, except the root. We used either the state model [Dij74] or the message-passing model. In the state model, each processor can read its own state and the states of its neighbors. In this model, a conguration (referred to as states from now onwards) of the distributed system is expressed as a n-tuple of the processor states, where n is the number of processors in the network. The minimal number of states that each processor is required to have to circulate a token has been extensively studied for the linear chain or ring networks. In his pioneering paper, Dijkstra [Dij74] proposed a mutual exclusion algorithm requiring 3 states for rings. In the same paper, Dijkstra also proposed another mutual exclusion algorithm which needs 22  4( ?2) states for chains. Ghosh [Gho93] proposed an alternative solution to Dijkstra's 4-state algorithm on a chain. Tchuente [Tch81] showed that with Dijkstra's assumptions, the two algorithms proposed by Dijkstra are optimal in the number of states. So, it seemed to be impossible to design a deterministic token passing algorithm requiring less states than that used in Dijkstra's algorithms. However, Flatebo and Datta in [FD94] and Ghosh in [Gho91] proposed algorithms requiring 2 states only. But their solutions work only on special networks which are much more restrictive than a simple ring or a chain.  LaRIA TR No98-05. Université de Picardie Jules Verne 5, rue du Moulin Neuf - 80000 n

n

n

AMIENS.

In this thesis, we introduce a new concept, called the reading radius, as another parameter to compare dierent algorithms in the state model. We dene the reading radius of a processor i as the maximum distance (in terms of hops) of any processor j from i such that i can read the state of j . Using the reading radius, we made some interesting observations. We found that the algorithms in [FD94] and [Gho91] written for special networks (not rings or chains) can be considered as algorithms for rings or chains if the reading radius is assumed to be greater than one. In [FD94], the authors propose an algorithm for rings such that the reading radius is 1 for every processor, except for the root.  The root's reading radius is 2 . The algorithm [Gho91] is for the chains of even length such that the reading radius is equal to 2. We propose [PV97a] a self-stabilizing depth-rst token circulation algorithm for an arbitrary rooted network. The reading radius in our algorithm is 2. The algorithm uses 2  Q =1 ( +1) states, where  is the degree of processorQi. The number of states used in our algorithm is very near the lower bound 2  =1  shown by Tchuente [Tch81]. We present two other self-stabilizing algorithms based on the work of Flatebo and Datta [FD94]: a concurrent broadcasting algorithm for tree networks and a depth-rst token circulation for arbitrary networks. Both algorithms require 2 states only, i.e. 2 states or 1 bit per processor. We propose [DJPV98] a self-stabilizing depth-rst token circulation algorithm Q ( ?1) over arbitrary networks requiring only 2  (1 + 1)  3  =2( +1) states. This algorithm requires a reading radius of 1 for every processor. We design [Pet97] a self-stabilizing depth-rst token circulation algorithm on Q ( ?1) trees which needs 2  (1 + 1)  3  =2( + 1) states, i.e., about half of the lower bound achieved by Tchuente. This is certainly a surprising result. The key idea behind this dramatic improvement of space is due to [Vil97] where he proposed a new specication for token. Villain [Vil97] proposed two optimal token circulation algorithms for chains. Both algorithms require 22  3( ?2) states. This surprising result seems to contradict the result of Tchuente, but actually it does not. Villain relaxed the denition of token (or privilege) of Dijkstra [Dij74]. Dijkstra dened the token as the ability for a processor to change its current state . Villain dened the token as the ability for a processor to change a particular state . In the token passing system of Dijkstra, the processor moves are totally ordered, i.e., the concurrency among the processors is not allowed. The token passing algorithms of Villain allow the concurrent moves. The token passing algorithms of Dijkstra can be extended to the tree structure. Two successive token rounds have to be distinguished. Also, the depth-rst Our Results.

n

n

n i

i

i

n

n i

i

n

n

n i

n

n

2

i

n i

i

token circulation over arbitrary or tree networks requires at least a pointer to be maintained by each processor to record the outgoing link followed by the token last time. Thus, each processor p needs to use  states to maintain its pointer. Q This leads to Tchuente's lower bound 2  =1  . Using Villain's denition of token, the traces of the last token round can be cleaned before starting the next round. The cleaning task runs concurrently with the token passing even when the system is stabilized. We show [PV97c] that the lower bound of the number of states to circulate a token in the depth-rst search order on trees is Q (1 + 1)  =2( + 2). This lower bound also holds for non-self-stabilizing token passing algorithms on trees. As our token passing algorithm on trees uses exactly the above number of states, it is optimal. Thus, we show that there is no extra cost (in terms of states) to design a self-stabilizing token passing algorithm on treesthe cost is simply dependent on the degree of the tree. The summary of the discussion so far is shown in Figure 1. i

n i

reading

i

n i

n

i

i

Ring [FD94]

Topology Tree

Chain [Gho91]

Q[JB95]

Arbitrary

( + 1) 3  radius > 1 [PV97a] 2  Q ( + 1) reading [Dij74] [Dij74, Gho93] [Pet97] [DJPV98] 3 2 4 ? ( + 1)  2  ( + 1) Q Q ? radius = 1 [Vil97] ( + 1) ( + 2) 3  2 3 ? 2

2

n

n

n

n

2

n

2

(n 2)

1

n i=2

(n 2)

i

n i=1

i

n i=1

i

(n 1)

1

n i=2

i

Figure 1: Summary of the Cost of the Token Passing Algorithms. The algorithm in [PV97d] is an adaptation of the algorithm in [JB95] in the message passing model. This was the rst self-stabilizing depth-rst token circulation in the message-passing model. The algorithm in [PV97b] is an improvment of [PV97d] and also is written in the message passing model. In this work, we used our previous result of [PV97a] which was designed in the state model with the reading radius of 2. This result [PV97b] has been applied in two other protocols [FV97, BFPV98]. Dolev, Israeli, and Moran [DIM97] showed that it is not possible to compute the message complexity before stabilization for many applications. The depthrst token circulation is one of those problems. However, an interesting issue is the additional cost in terms of the number of messages used after stabilization. The message complexity of both of our algorithms [PV97d, PV97b] is O(m), m is the 3

number of links in the network. If  is bounded, this message complexity matches with that of the classical non-self-stabilizing algorithms, i.e., O(m). Hence, our algorithms are asymptotically optimal. Next, we want to address a few technical issues. Why do we choose to adapt two algorithms [JB95, PV97a], which are written in the state model and have a reading radius of 2, in the message passing system? All other depth-rst token passing algorithms, in either the state model or the link register model, use a level variable. We wanted to avoid using that extra variable. Note that in order to adapt such algoritms in the message passing systems, the level variable value has to be sent to the neighbors to stabilize the system (to break the cycles). This will make the message size dependent on the network size. This led us to adapt [JB95] and [PV97a]. The two variables used are the pointer and a token round color (3 possible values in [PV97d] and 2 in [PV97a]). The color value needs to be sent only to the neighbors. The message size of our algorithms is 5 bitsindependent of the network size.

References [BFPV98] M Bui, O Flauzac, F Petit, and V Villain. Distributed FTSS routing. In AI'98, Applied Informatics Proceedings, 1998. to appear. [Dij74] EW Dijkstra. Self stabilizing systems in spite of distributed control. Communications of the Association of the Computing Machinery, 17:643644, 1974. [DIM97] S Dolev, A Israeli, and S Moran. Resource bounds for self-stabilizing message-driven protocols. SIAM Journal on Computing, 26:273290, 1997. [DJPV98] AK Datta, C Johnen, F Petit, and V Villain. Self-stabilizing depthrst token circulation in arbitrary rooted networks. In SIROCCO'98, 5th International Colloquium On Structural Information and Communication Complexity Proceedings, 1998. to appear.

[FD94] [FV97]

M Flatebo and AK Datta. Two-state self-stabilizing algorithms for token rings. IEEE Transactions on Software Engineering, 20:500504, 1994. O Fauzac and V Villain. An implementable dynamic automatic selfstabilizing protocol. In I-SPAN'97, Third International Symposium 4

on Parallel Architectures, Algorithms and Networks Proceedings, pages

9197. IEEE Computer Society Press, 1997. [Gho91] S Ghosh. Binary self-stabilization in distributed systems. Information Processing Letters, 40:153159, 1991. [Gho93] S Ghosh. An alternative solution to a problem on self-stabilization. ACM Transactions on Programming Languages and Systems, 15:735 742, 1993. [JB95] C Johnen and J Beauquier. Space-ecient distributed self-stabilizing depth-rst token circulation. In Proceedings of the Second Workshop on Self-Stabilizing Systems, pages 4.14.15, 1995. [Pet97] F Petit. Highly space-ecient self-stabilizing depth-rst token circulation for trees. In OPODIS'97, International Conference On Principles Of Distributed Systems Proceedings, pages 221235, 1997. [PV97a] F Petit and V Villain. Color optimal self-stabilizing depth-rst token circulation. In I-SPAN'97, Third International Symposium on Parallel Architectures, Algorithms and Networks Proceedings, pages 317323. IEEE Computer Society Press, 1997. [PV97b] F Petit and V Villain. Color optimal self-stabilizing depth-rst token circulation protocol for asynchronous message-passing systems. In PDCS-97 10th International Conference on Parallel and Distributed Computing Systems Proceedings, pages 227233. International Society

for Computers and Their Applications, 1997. [PV97c] F Petit and V Villain. Optimality and self-stabilisation over tree networks. Technical Report RR 97-23, LaRIA, University of Picardie Jules Verne, 1997. [PV97d] F Petit and V Villain. A space-ecient and self-stabilizing depthrst token circulation protocol for asynchronous message-passing systems. In Euro-par'97 Parallel Processing, Proceedings LNCS:1300, pages 476479. Springer-Verlag, 1997. [Tch81] M Tchuente. Sur l'auto-stabilisation dans un réseau d'ordinateurs. RAIRO Informatique Theoretique, 15:4766, 1981. [Vil97] V Villain. A new lower bound for self-stabilizing mutual exclusion algorithms. Technical Report RR97-17, LaRIA, University of Picardie Jules Verne, 1997. 5