akwizgran created page: BSP

akwizgran
2015-03-18 11:31:07 +00:00
parent b526dc18aa
commit 3f6b0f5373

@@ -1 +1,23 @@
BSP is an application layer data synchronisation protocol for delay-tolerant networks. It can operate over any transport that can deliver a stream of bytes from a sender to a recipient on a best-effort basis. BSP does not ensure the confidentiality, authenticity or integrity of the transported data; this is the responsibility of a transport layer security protocol such as [BTP](BTP). BSP is an application layer data synchronisation protocol for delay-tolerant networks. It can operate over any transport that can deliver a stream of bytes from a sender to a recipient on a best-effort basis. BSP does not ensure the confidentiality, authenticity or integrity of the transported streams; that is the responsibility of a transport layer security protocol such as [BTP](BTP).
BSP synchronises data between two devices referred to as the local and remote peers. The data to be synchronised consists of messages posted to channels. A message is simply a sequence of bytes, and a channel is simply a set of messages.
A channel may belong to an application running on the local peer. The application decides which of the messages stored on the local peer should be synchronised to the remote peer, which is called the channel's sharing policy. The application also decides which of the messages synchronised from the remote peer should be stored on the local peer, which is called the channel's storage policy. If a channel does not belong to any application then messages posted to that channel are not stored or shared.
### Crypto primitives
BSP uses a cryptographic hash function, H(m). The output of H(m) is hash_len bytes.
### Channel identifiers
Each channel has a unique identifier hash_len bytes long. This identifier is supplied by the application and is not interpreted by BSP. To prevent collisions, the identifier must be generated at random, or must be the cryptographic hash of some application data structure describing the channel. If a hash is used, the application data structure must include a unique application identifier at least hash_len bytes long that is generated at random. This prevents collisions between applications with similar data structures.
### Message format
Each message consists of one or more blocks. Each block is block_len bytes long, except the last, which may be shorter. The blocks form the leaves of a binary hash tree, and the root hash of the tree uniquely identifies the message.
A message header is prepended to each node of the tree before hashing. The message header consists of the channel identifier, a timestamp indicating when the message was posted, the depth of the hash tree, and the message type.
The timestamp is a 64-bit big-endian integer representing seconds since the Unix epoch. The depth of the hash tree is an 8-bit integer. The message type is a single byte that is not interpreted by BSP; the application may use it to respond appropriately to partially synchronised messages. The total length of the message header is hash_len + 10 bytes.
Prepending the message header to each node before hashing ensures that all blocks with a given message identifer have consistent message headers; this simplifies the validation of blocks received from the remote peer.