Content-type: text/html Manpage of TBA

TBA

Section: (T)TCB (1)
Updated: 13 November 2002
Index Return to Main Contents

 

NAME

propose, decide - Trusted Block Agreement Service

 

SYNOPSIS

#include "tcb/ttcb.h"

void propose(descriptor_t *descriptor, elist_t elist, TCBtimestamp tstart, decision_t decision, value_t value, propose_out_t *out);

void decide(descriptor_t *descriptor, tag_t tag, decide_out_t *out);

 

DESCRIPTION

The trusted block agreement service (TBA) gives a value obtained from the agreement of values proposed by a group of entities (e.g., processes). The values are blocks with a limited size, and for this reason the service is not intended to do all agreement operations in a system, but only to perform critical steps in protocols. An entity calls propose to propose a value and tries to get the result by calling decide (`tries' because the result may not be available yet).

We say "a TBA" to mean an execution of the TBA service. "A TBA" usually involves several entities calling TTCB_propose and TTCB_decide.

The parameters of the two calls have the following meanings.

descriptor contains the state of the connection with the TTCB (see openTCBconnection).

The TTCB knows that proposals pertain to the same TBA when (elist, tstart, decision) are the same.

elist is an array with the eid's of the entities involved in the TBA (terminated with END_ELIST).

tstart is a timestamp that indicates the instant when the TTCB ceases to accept proposals for the TBA, which means, in some sense, the latest instant when the TBA starts to run inside the TTCB. The necessity of this timestamp is to prevent malicious entities from postponing TBAs indefinitely simply by not proposing their values. If all values are available before tstart, the TBA is, in some sense, initiated sooner, when the last value arrives to the TTCB.

decision is the function used to calculate the result from a list of proposals. The TTCB currently provides the following decision functions:

TTCB_TBA_RMULTICAST Returns the value proposed by the first entity in elist , therefore the service works basically as a reliable multicast.

TTCB_TBA_MAJORITY Returns the most proposed value.

TTCB_TBA_AND Returns the bitwise AND of the proposed values.

TTCB_TBA_OR Returns the bitwise OR of the proposed values.

TTCB_TBA_XOR Returns the bitwise exclusive OR of the proposed values.

value is the value proposed.

out contains the data which is returned by the function call. TTCB_propose returns an error code and a tag that is used later to identify the TBA when the entity calls TTCB_decide. TTCB_decide returns: (1) an error code; (2) the value decided; (3) a mask proposed-ok with one bit set for each entity that proposed the value that was decided; and (4) a mask proposed-any with one bit set per entity that proposed any value. Items (2), (3) and (4) are returned only if the TBA terminated. The call to TTCB_decide is usually made inside a loop which terminates when the result becomes available. If an entity calls TTCB_propose after tstart it gets an error but also the tag of that TBA so that it can use the tag to call TTCB_decide. Results are stored in the TTCB for some and later discarded.

 

ERRORS

TTCB_propose can return the following errors:

OK No error (0).

EID_NOT_IN_ELIST The eid of the entity that proposed is not in elist.

TSTART_EXPIRED The local TTCB received the proposal after tstart.

MAX_NUM_AGREEMENTS_RUNNING or NO_RESOURCES_PROPOSE No more resources for running TBAs.

VALUE_ALREADY_PROPOSED The entity already proposed a value for this TBA. Only the first is accepted.

INVALID_DECISION The decision function selected does not exist.

TTCB_propose can return the following errors:

INVALID_TAG The tag does not correspond to an existing TBA.

DID_NOT_PROPOSE The entity which value was choosen did not propose. This error can occur only with decision functions that choose a specific value (TTCB_TBA_RMULTICAST).

AGREEMENT_EXPIRED The results of the agreement were discarded.

 

SEE ALSO

openTCBconnection (1), closeTCBConnection (1), getRandom (1), getTCBTimetsamp (1).


 

Index

NAME
SYNOPSIS
DESCRIPTION
ERRORS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 23:05:26 GMT, August 06, 2003