In the context of communication, ordering refers to the order in which data are received by multiple recipients, relative to the order in which the data were sent by multiple senders. The three notable ordering options are source ordering, causal ordering and total ordering.
Source ordering or sender ordering denotes delivery of data from a single sender in the same order as it was sent.
Causal ordering denotes delivery of data that is causally related in the order corresponding to the causal relation. Causal ordering guarantees that information about causes is delivered before information about their effects.
Total ordering denotes delivery of data in the same order to all recipients.
The principle of providing ordering guarantees is roughly the same regardless of the particular guarantees provided. Recipients distinguish data reception and data delivery, reception being the arrival of the data at the recipient node and delivery being the arrival of the data at the recipient application. Between reception and delivery, the ordering guarantees can be enforced.
When a message carrying the data is received, it can be delivered only if there is no other message that would precede it with respect to the ordering guarantees. Message numbering can be used to make this decision.
A sequential numbering assigned locally by the sender is sufficient to enforce source ordering. The recipient can deliver a message when its number immediately succeeds the number of the last delivered message from the same sender.
A vector clock numbering assigned locally by the sender within the group of communicating nodes is sufficient to enforce causal ordering. The recipient can deliver a message when its number immediately succeeds the number of the last delivered message from the same group.
A sequential numbering assigned by a central authority within the group of communicating nodes is sufficient to enforce total ordering. Again, the recipient can deliver a message when its number immediately succeeds the number of the last delivered message from the same group.