Count Down Protocol: Asynchronous Consistent Protocol ... - CiteSeerX

3 downloads 0 Views 470KB Size Report
a stricter ownership determination algorithm, called dead zone is introduced. Moreover, we propose the method to get rid of a critical case for P2P multi-player ...
Count Down Protocol: Asynchronous Consistent Protocol in P2P Virtual Ball Game Yoshihiro Kawano*

Tatsuhiro Yonekura**

Intec NetCore, Inc. 1-3-3, Shinsuna, Koto-ku Tokyo, 136-0075, Japan +81-3-5665-5069

Ibaraki University 4-12-1, Naka-Narusawa Hitachi-shi, 316-8511, Japan +81-294-38-5142

[email protected]

[email protected] avatar’s information cannot be simultaneously displayed because of latency. Consequently, shared objects cannot be controlled jointly by all the users because of the temporal difference between the local and the remote avatars in terms of their status in reference to each other [1]. To deal with this limitation, some reports have been made about P2P protocol for the DVE of multiplayer game [3] and the field game [4]. In [3], less consideration was made about dealing with the shared object. And in [4] the synchronizer always has to synchronize the ownership of the object. The algorithm, however, has to have exclusive control in order to synchronize the state of the shared object so that the throughput is rather sacrificed.

ABSTRACT This paper studies a way to improve consistency of states in a ball game typed DVE with lag, in P2P architecture. We also study how to control shared objects in real-time in a server-less network architecture. Specifically, a priority field called Allocated Topographical Zone (AtoZ) is used for P2P typed DVE. In a critical case (i.e. inconsistent phenomena), a stricter ownership determination algorithm, called dead zone is introduced. Moreover, we propose the method to get rid of a critical case for P2P multi-player virtual ball game. By using proposed method, a robust and effective scheme is achieved for a virtual ball game. As an example of the application, a real-time networked multi-player air-hockey is implemented for evaluation of validity of proposed method.

Thus, this paper studies a way to improve consistency for all states, including those of the avatars and shared objects in a DVE in which the shared field is equally accessible to and controllable by each peer, without sacrificing throughput. Especially, we have considered about distributed protocol for multi-player virtual ball game [6]. In previous work [7], in order to reduce the occurrence of critical case (inconsistent phenomena), the method that tune the threshold for concession of the ownership was considered. However, the occurrence of the critical case was not avoided. Therefore, we propose the method to get rid of a critical case for P2P multi-player virtual ball game. Concretely, each peer calculates minimum reachable frames to the object each other to realize our priority issue that is avoidance of the critical cases. By using proposed method, a robust and effective scheme is achieved for a virtual ball game.

Keywords DVE (Distributed Virtual Environment), P2P (peer-to-peer), AtoZ (Allocated Topographical Zone), Count Down Protocol (CDP), Critical Case

1. INTRODUCTION Recently, the market for real-time interactive application via the Internet has expanded widely. Then, the network games have been established as one of fields for online communications. Accordingly, the problem of network latency has been remarkable in real-time interactive applications such as the action game and the real-time sports game [1]. In general, a client-server type of architecture may be employed in such games, namely a Distributed Virtual Environment (DVE) [1].

2. P2P FIELD TYPE DVE MODEL 2.1 Disadvantage of Client-Server Type DVE

Although this type of DVE that offers the advantage of consistent states of objects in a virtual space, its drawbacks are well known; e.g., server overload and reduction of system throughputs [2]. On the other hand, various peer-to-peer (P2P hereafter) architectures are available for designing DVEs. P2P-type DVE can decentralize computing load of a server and decrease latency of turnarounds since each peer communicates directly with all of the other nodes. However, synchronization between nodes is not easy because such a network has no server for synchronization management. This issue is the so-called consistencythroughput trade-offs [2].

The small-scale client-server type of DVE is constructed to probe validity of the P2P type of DVE, and then we have examined about turnaround time. Concretely, the number of frames from each client's requirement to the server's responses (i.e. two-way network communication) is examined. Here, it is assumed that the server and each client update the state of DVE in every 25 [ms], each client draws only the data from the server. This experiment has nine cases, the three combinations of number of players and three types of latency (Table 1). In Table 1, turnaround time depends on the latency in case of a few numbers of clients. That is, turnaround time is increased by network latency, because all data are transmitted via the server.

That is, while the information about a local avatar (virtual player in the DVE) can be quickly available at a local host in a P2P network, a remote

This paper focuses on relatively small-scale DVE, and employs P2P type DVE for real-time interaction. Therefore, this paper aims to satisfy the consistency of the shared object without synchronizing between peers in real-time P2P type DVE.

* The author is also a student of the Graduate school of Science and Engineering, Ibaraki University, Hitachi-shi, 316-8511, Japan.

Permission to make digital or hard copies of all or part of this work Permission digital or all or part this work that for for personaltoormake classroom usehard is copies grantedof without feeof provided personal classroom is granted for without that copies are copies areornot made oruse distributed profitfeeorprovided commercial advantage not that made or distributed for profit advantage and page. that and copies bear this notice andorthecommercial full citation on the first copies this notice and the fullto citation the first To copy To copybear otherwise, or republish, post ononservers or page. to redistribute or republish, to post on servers or atofee. redistribute to lists, tootherwise, lists, requires prior specific permission and/or requires prior specific permission and/or a fee. Netgames'06, October 30–31, 2006, Singapore. Conference’04, Month 1–2, 2004, City, State, Country. Copyright 2006 ACM 1-59593-589-4. $5.00. Copyright 2004 ACM 1-58113-000-0/00/0004…$5.00.

Table 1. Turnaround time in client-sever type DVE (Unit: frame) 0 ms latency 28 ms latency 57 ms latency

1

2 players 2.000 3.355 5.327

4 players 2.029 3.380 5.485

6 players 2.826 3.256 5.549

2.2 P2P Field Type DVE Model From the above requirement, in order to construct a DVE ball game, in which the objects shared by the players have the physical attributes of location, orientation and velocity, a significant issue is that of how the ownership (decision of which peer owns the key to control an object) and the attributes for all avatars and objects should be kept consistent among peers. Thus, we consider distributed processing protocols called Allocated Topographical Zone (AtoZ) [5] and achieve those criteria in Section 3.1 below. Then, the concrete algorithm of computing the above protocol has been already proposed by our previous work [5]. In Section 3.2, we introduce a critical case in which conflicts of ownership occur. And, in Section 4, we propose the method to get rid of a critical case for P2P multi-player virtual ball game. Finally in Section 5, we examine the performance of the proposed method experimentally by prototyping a networked “Multi-player Air Hockey” game implemented with P2P architecture.

3. P2P FIELD TYPE DVE 3.1 AtoZ Most importantly, we first confirm the conditions of distributed DVE processing. A player, or peer, can manipulate exclusively the avatar dedicated to that peer (no other player can manipulate that avatar). Each of the shared objects can always be continuously under the control of any avatar that is manipulated by a player. In other words, only one avatar exclusively owns each of the shared objects at any one time. The decisionmaking regarding ownership is constantly computed, and the ownership is dynamically transferred from one avatar to another. Under such conditions, we proposed the priority field called AtoZ to decide the ownership of the shared objects [5]. AtoZ is formulated as follows. AtoZ ( p i ) = { x | x ∈ Z , Access ( x , p i ) = min ( Access ( x , p j ))} j∈ N

(1)

Here pi denotes the i’th avatar (i = 1,2,…,N). In the formula above, AtoZ(pi) is the AtoZ of avatar pi, x and Z denote a spatial point and the whole space in the DVE, and Access(x, pi) denotes the estimated elapsed time for avatar pi to reach x. Thus, the AtoZ(pi) indicates the set of points that avatar pi can reach faster than any other avatar. The diagram of AtoZ is shown in Figure 1. T=ti+1 T=ti AtoZ of A AtoZ of A AtoZ of B B

A

A

B AtoZ of B

O

O

AtoZ of C AtoZ of D C

D

C

AtoZ of D

AtoZ of C Figure 1: Overview of AtoZ.

D

3.2 Critical Case and Phantom Case We have mentioned, so far, the algorithm of the decision-making rule of ownership and that of a scheme for reducing the temporal gap caused by latency. In the AtoZ protocol, however, we still have an ambiguity in regard to unpredictable events during latency. Even if we use AtoZ, we may still have a chance to lose the consistency of the common AtoZs or the consistency of the ownership when a certain competition happens between the avatars during latency. As a result the above, when the several avatars simultaneously access a shared object, contradiction of event occurs between the two peers because this misunderstanding means both avatars may own the same object. The reversal phenomenon of the interference order that may appear to the players is referred to as a critical case. The

2

occurrence of critical case causes the failure of causality between peers about the object. Therefore, the critical case must be avoided absolutely. Even if the local avatar touches the object, local avatar can not access the object when the local peer delegates the ownership of the object. This phenomenon is called phantom case. If the phantom cases occur in all peers, all avatars can not access the object. That is, deadlock of the game occurs. The occurrence of the phantom case does not break causality about the object between peers. However, throughput of the game may sacrifice because of the deadlock. Therefore, phantom cases must reduce as many as possible.

3.3 Dead Zone The critical cases and the phantom cases take place when the several avatars are gathering into the area close to the border between them. This is because which avatar should have object's ownership is not obvious. Hence, the area near the border of the AtoZs where the existence probabilities of the two avatars are comparable is called the dead zone. More concretely, in the dead zone, ownership of the object is ambiguous because of the loss of information caused by latency. Thus, the decisionmaking rule for ownership in the dead zone must be stricter. Considering this, the area of dead zone is defined as follows. DZ ( p i , p j ) = { x | x ∈ Z ,

| Access ( x , p i ) − Access ( x , p j ) | ∆t

< ([ d / ∆ t ] + 1)}

(2)

Where DZ(pi, pj) denotes the dead zone between the avatar pi and pj, d[ms] and ∆t[ms] denotes the transmission lag and update interval respectively. The symbol [] is the Gaussian symbol indicating the maximum integer less than or equal to the number inside. Then, ([d/∆t]+1) calculates the number of elapsed frames from sending the data to receiving the data.

4. COUNT DOWN PROTOCOL From the above reason, this paper focuses on the avoidance of the critical cases, and aims to reduce the phantom cases. When shared object resides in AtoZ, ownership of the object is obvious. Then, neither critical case nor phantom case occurs. That is, these cases occur when each avatar and object are gathering to the dead zone. Therefore, we propose a following protocol for ownership determination in the dead zone.

4.1 Overview Count Down Protocol (CDP) is used as the ownership determination protocol when shared object resides in the dead zone. CDP is applied to avoid ownership concession in AtoZ, and to reduce throughput of ownership determination to minimum (criteria 2). The basic idea of the protocol is that a peer resigns the ownership during the other one peer controls the shared object. Concretely, each peer calculates number of frames that local avatar can reach to the object (countdown value; CD value). The detail of the protocol is as follows. < Count Down Protocol > Step 1. Each peer calculates CD value of local avatar, and sends the CD value to all other peers. CD value is calculated based on position and maximum speed of local avatar, and position and velocity of the shared object. Step 2. Each peer receives CD value from other peers, and subtracts latency frames (corrected CD value). If the corrected CD value is less than 0, go to Step 3-1. If all corrected CD value is more than 0, go to Step 3-2. And, current CD value is subtracted by 1, when CD value could not receive from the remote peers, because of influence of packet loss or jitter. Step 3-1. Local peer resigns ownership since remote avatar has possibility for reaching to the object. Step 3-2. All other avatars have no possibility that it reach to the object. Therefore, if the CD value of local avatar is 1 and smaller than

The 5th Workshop on Network & System Support for Games 2006 — NETGAMES 2006

all other avatars, then local peer gets ownership. Here, if the CD value of local avatar is the same as that of remote avatar, the ownership is determined by priority between peers.

< Priority method >

The overview of CDP is shown in Figure 2. The instantaneous one-way network latency between peer A and B is p frames.

Step 1. Each peer checks the ownership flag (indicates whether to have the ownership or not), and then if no peer obtains the ownership during constant time, the deadlock is detected. Each peer selects neighborhood avatars by corrected CD value.

In Figure 2, the latest CD value of avatar B (avatar A) held at peer A (peer B) are of the moment: ti-p. Thus, the corrected CD values of both avatars held at time ti at both peers are represented as follows.

Step 2. If each avatar decides that local avatar is one of neighborhood avatars, and the priority of local avatar is the highest in neighborhood avatars, go to Step 3-1, otherwise go to Step 3-2.

(Corrected CD value held at peer A)

AA (t i ), ‫ޓ‬B A (t i − p ) − p

(3)

(Corrected CD value held at peer B)

AB (ti − p ) − p, ‫ޓ‬BB (ti )

(4)

Here, each equation represents the corrected CD value of each avatar; their suffixes represent the peer in which they are held. In the CDP above, every peer periodically sends its own CD value to all other peers. This is because CD value is necessary for each peer immediately to decide the ownership when shared object entered in the dead zone. By using CDP, occurrence of critical cases is avoided. This reason is obvious from following two points. 1. Each peer can get the ownership only when local avatar’s CD value is 1. 2. Each peer can detect the possibility of the ownership obtainment of remote peer from corrected CD value. From the above, occurrence of critical cases is avoided, because each peer can detect the ownership obtainment of remote peer in advance. However, each peer may have corrected CD value of 0 and less when each avatar is gathering. That is, the following formula is satisfied in case of Figure 2. B A ( t i − p ) − p ≤ 0 ‫ ޓ‬and ‫ ޓ‬A B ( t i − p ) − p ≤ 0

(5)

From the formula above, phantom cases may occur at peer A and B, and this causes the deadlock of the game (i.e., no avatar can control the object). Therefore, detection of the deadlock and the repression function of phantom cases are necessary. The priority in Step 3-2 is decided by total of network latencies between local peer and all other peers. This purpose is rapid escape from deadlock, and smooth transmission. (Local avatar)

(Remote avatar) B BA(ti-p)-p

B

BB(ti)

p O

O A

AA(ti)

Step 3-1. The peer reserves ownership of the object. Here, the peer waits the highest one-way network latency in neighborhood avatars until obtainment of ownership. This is because remote peer may obtain ownership before detection of the deadlock. Step 3-2. Local peer resigns ownership, and local peer waits the highest two-way network latency in neighborhood avatars. Step 4. If a peer has obtained the ownership, waiting time is set to 0. By using priority method above as an additional function of CDP, the critical cases are avoided, and the phantom cases are reduced to minimum. In this method, the game can escape from the deadlock absolutely, because ownership of the object is determined immediately after detection of the deadlock. The waiting time is decided by the latency including jitter.

5. EXPERIMENT In this section the behavior of the CDP is examined using prototype of a network doubles air-hockey. In this experiment, validity of the CDP is compared with Tuning Method in previous work [7].

5.1 Task Specification As a prototype system, a virtual doubles air-hockey game is implemented (Figure 3). On this game screen, the left side window display the actual game field and the right side window displays how the AtoZs look like at a given moment of play. The parameter set of the game field and the computational environment are as follows. (i) Game field: * Dimensions of table: 289 cm in depth, 148 cm in width, Dynamic friction: 3.00×10-5, Radius: 4.1 cm (puck), 8.5 cm (mallet), and Maximum speed: 300 cm/sec (puck), 100 cm/sec (mallet) (ii) System environment: * Transmission of clock for synchronization: TCP/IP, Transmission of game information: UDP/IP unicast, and Update interval: 25 ms.

(Local avatar) (Remote avatar) peer B peer A Figure 2: Overview of Count Down Protocol.

In feature of CDP, local peer estimates the corrected CD value of remote avatar in the minimum value, because each peer estimates maximum reachable range of remote avatar while the latency frames. That is, if the local peer decides that local avatar is one of neighborhood avatars, then remote peer does so similarly. Therefore, if each peer decides that local avatar is one of neighborhood avatars, they are able to decide the ownership by the priority between peers. This ownership determination method is called priority method.

P(ti+x)

1

4.2 Priority Method In order to reduce occurrence of the phantom cases, rapid detection of the deadlock and control of the object by an avatar are necessary. Therefore, the avatar that obtains the ownership should be neighborhood of the shared object (criteria 2). Then, we propose the priority method about the ownership determination for the neighborhood avatars (is selected by CD value and latency frames) of the object.

2

P(ti)

A AB(ti-p)-p

3 M(ti)

Figure 3: The game screen of the virtual air-hockey

Figure 4: The mallet automation algorithm.

5.2 Mallet Automation Algorithm The mallet automation algorithm for simulation experiment is adopted to reject an uncertain element such as player's operation (Figure 4). 1. Calculates the distance between own mallet and the puck. The distance is exchanged into x which is the minimum reachable frames. 2. Predicts puck position after x frames. 3. Mallet dashes to the puck position after x frames in the maximum speed. In Figure 4, M(ti), P(ti) and P(ti+x) are own mallet’s position at time ti, puck’s position at time ti, predicted puck’s position at time ti+x respectively.

5.3 Specification of Experiment The purpose of the experiment is to evaluate the proposed protocol for multiple players. Concretely, i) Consistency of the ownership. ii) Critical

The 5th Workshop on Network & System Support for Games 2006 — NETGAMES 2006

3

Figure 5 shows the state of the ownership for each protocol. If the number of the frames of competition is increased, critical case is likely to take place. On the other hand, if the number of the frames of concession is increased, phantom case is likely to take place. Figure 6 and 7 show the occurrence probability of critical case and phantom case in the dead zone. In Figure 5, in case of Tuning Method, the higher latency causes the more competition cases. Therefore, even if that suffer influence of network latency, the number of concession was not increased so much. In Tuning Method, threshold for concession parameter is tuned by received data. Thus, the competition of the ownership is prevented. However, being influenced by the network latency, the transmission lags occur, and then each peer can not detect the competition immediately. Therefore, the competition occurs frequently, because the threshold is not increased. On the other hand, in the case of CDP, the state of competition scarcely occurs. This is because each peer decides the next state, considering the worst case (occurrence of the critical case) in dead zone. However, 90% of all is concession. In CDP, for avoidance of the critical case, the peer can obtain the ownership just before the avatar controls the shared object. And, in the situation that each avatar closes, such as this simulation, the danger of the occurrence of the critical case increases. Therefore, in dead zone, concession, which avoids the critical cases, is the prevailing. From above, the game likely to be deadlock and it is necessary to use priority method. By using priority method, competition does not increase and concession does not decrease. According to Figure 6 and 7, the higher latency caused more critical cases in case of Tuning Method. Conversely, phantom case was not increased so much. Therefore, Tuning Method could not avoid the critical cases absolutely. In case of CDP, in spite of increase of the network latency, critical case was avoided completely. From this, the validity of the CDP was proved under the condition that the critical case is the most likely to occur. However, without priority method, the higher network latency causes the more phantom case, and then it has possibility that the deadlock occurs. With priority method, the occurrence of the phantom case could be restrained to twice Tuning Method even if network latency increases. In Figure 5, concession does not decrease obviously although using priority method. However, escape from the deadlock by a peer obtains the ownership, and then the occurrence of phantom case is reduced. That is, this difference of the occurrence probability of the phantom case is the minimum risk for avoidance of the critical case. From above, it was confirmed that CDP is the protocol, which avoids the critical case even if the network latency increases. Moreover, with the priority method, the occurrence of the phantom case was reduced to minimum.

4

Competition

Concession

57 ms

28 ms

0 ms

57 ms

28 ms

0 ms

57 ms

Count Down Protocol (without priority method)

Count Down Protocol

Consitency

Figure 5: The ownership consistency for each protocol. 0.14

Phantom cases in dead zone [%]

5.4 Discussions

Tuning Mehotd

Critical cases in dead zone [%]

We have examined doubles air-hockey game by using mallet automation algorithm. This experiment had nine patterns, the combination of three protocols (Tuning Method, CDP without priority method, and CDP) and three types of latency. And, each pattern of the experiment got the data for 100,000 frames respectively (the data of each peer is 25,000 frames). Here, Tuning Method refers to [6]. The results are shown in Figure 5 to 7.

0 ms

As a premise, supposing that network distances between the co-players are near, and that between the two opponents-players is far, the conditions of latency between the opponents-players are set as follows. 1: 0 ms. 2: average 28.0 ms, standard deviation 4.0ms, simulating the Intranet. 3: average 57.0 ms, standard deviation 8.1ms, simulating the transcontinental Internet.

100 90 80 70 60 50 40 30 20 10 0 28 ms

Ownership consistency [%]

case’s occurrence. iii) Phantom case’s occurrence. Here, i) will be estimated by probability of the state of ownership in each protocols. In criterion ii), iii), we examine occurrence probability of critical cases and phantom cases in the dead zone about each protocols. In this experiment, the simulated network latency is set by NIST Net [8] in the environment.

0.12 0.1 0.08 0.06 0.04 0.02 0 -0.02 0

28 Latency [ms]

57

80 70 60 50 40 30 20 10 0 0

Tuning Method Count Down Protocol (without priority method) Count Down Protocol

Figure 6: The percentage of critical cases in dead zone.

28 Latency [ms]

57

Tuning Method Count Down Protocol (without priority method) Count Down Protocol

Figure 7: The percentage of phantom cases in dead zone.

6. CONCLUSIONS This paper proposed the method to get rid of a critical case for P2P multiplayer virtual ball game. That is, the protocol called Count Down Protocol to determine the ownership in the dead zone. Concretely, each peer calculates minimum reachable frames to the object each other to realize our priority issue that is avoidance of the critical cases. As a result, avoidance of the critical cases has been confirmed. Therefore, consistency of the ownership of the shared objects as our priority issue was achieved. Our future works include study on the applicable situation of AtoZ, survey of the problem for the practical use on the Internet.

7. REFERENCES [1] H. Takemura, Journal of the Virtual Reality Society of Japan, vol.4, no.1, pp.59-63, (1999). (in Japanese).

[2] S.K. Singhal, M.J. Zyda, Networked Virtual Environments: Design and Implementation, Addison-Wesley, Massachusetts, (1999).

[3] E. Cronin, B. Filstrup, and Sugih Jamin. Cheat-proofing dead

reckoned multiplayer games. In Proc. of 2nd International Conference on Application and Development of Computer Games, (2003.1).

[4] J.M. Linebarger, G.D. Kessler, "Concurrency Control Mechanisms for Closely Coupled Collaboration in Multithreaded Peer-to-Peer Virtual Environments", PRESENCE, Vol. 13, No. 3, pp.296-314, (2004.6).

[5] T.