Next: BarnettSmartVTMF, Up: Classes [Contents][Index]
This part of LibTMCG provides an implementation of reliable broadcast, which is actually based on an optimized variant of Bracha’s double-echo broadcast protocol. It works without further authentication mechanisms (e.g. digital signatures) and thus guarantees the desired properties (i.e. validity, consistency, and totality10) of reliable broadcast only, if the number of faulty or even malicious players t is strictly less than one third of all parties n, i.e. t < n/3. Please note that without further assumptions this condition is rather optimal for asynchronous communication and thus has crucial impact for liveness of the high-level protocols using it.
We describe only those classes, methods, and members that might be of interest for an application programmer.
This class implements the protocol RBC by Cachin, Kursawe, Petzold, and Shoup [CKPS01] for a reliable broadcast in the asynchronous communication model, where t < n/3 holds. Additionally, a FIFO-ordered delivery mechanism based on sequence numbers has been implemented.
This is the total number of parties n involved in this protocol.
This is the number of possible faulty parties t.
This is an uniqe index of the party running this instance.
const size_t
n_in, const size_t
t_in, const size_t
j_in, aiounicast*
aiou_in, const size_t
aio_default_scheduler_in =aiounicast::aio_scheduler_roundrobin
, const time_t
aio_default_timeout_in =aiounicast::aio_timeout_very_long
)The constructor initializes an instance for a reliable
broadcast channel of n parties. This total number
of parties is given in the first argument n_in. The
number of possible faulty or even malicious parties t
(given in the second argument t_in) must not exceed
n/3. Otherwise a warning is printed to std::cerr
and the liveness of the protocol RBC is not guaranteed. Thus,
it is recommended to set t_in to the asynchronous maximum
(n-1)/3. The third argument j_in is an index of
the party running this instance. Finally, the constructor needs
as fourth argument aiou_in a reference to already established
point-to-point channels (see Communication Interfaces), which
should exclusively11 used
for this broadcast channels. The default values for timeout
(in seconds) and the deliver scheduler can be modified
carefully with respect to the usage scenario.
const std::string&
ID_in)Broadcast channels are parameterized by a tag called ID, that uniquely identifies each channel. This method sets the tag to ID_in, which should be equal for all parties on the same channel.
This method unset the current channel tag and returns to the previous value. This is commonly used to return from a channel of a subprotcol to the channel of the calling protocol.
mpz_srcptr
m, const bool
simulate_faulty_behaviour =false
)This method broadcasts the integer m to all parties.
mpz_ptr
m, size_t&
i_out, size_t
scheduler =aiounicast::aio_scheduler_default
, time_t
timeout =aiounicast::aio_timeout_default
)This method delivers a broadcasted integer m from any party using deliver scheduler scheduler. The index of the sender is returned in i_out. In presence of the fourth argument it waits for at most timeout seconds. Otherwise, the default timeout given to the constructor is applied.
The method returns false
, if delivering fails. Only
in some critical cases error messages are written to std::cerr
.
mpz_ptr
m, const size_t
i_in, size_t
scheduler =aiounicast::aio_scheduler_default
, time_t
timeout =aiounicast::aio_timeout_default
)This method delivers a broadcasted integer m from a specified party with index i_in using deliver scheduler scheduler. In presence of the fourth argument it waits at most for timeout seconds. Otherwise, the default timeout given to the constructor is applied.
The method returns false
, if delivering fails. Only
in some critical cases error messages are written to std::cerr
.
time_t
timeout =aiounicast::aio_timeout_default
, const std::string
tag =""
)This method continues the execution of RBC protocol such that the requests of other waiting parties are satisfied. In presence of the first argument it waits approximately for (t + 1) \cdot{} timeout seconds while trying to synchronize all parties based on their corresponding local Unix Epoch time. Otherwise, the default timeout given to the constructor is applied. Each synchronization point is required to be unique. Thus, a string called tag with a description of the synchronization point can be supplied as second argument of this method.
The method returns false
, if synchronization is failed.
This destructor releases all occupied resources.
Totality ensures that all correct parties either deliver a message or don’t. In the literature consistency and totality properties are often combined into a single condition called agreement.
These channels should be authenticated such that network attacks or errors can be detetcted.
Next: BarnettSmartVTMF, Up: Classes [Contents][Index]