# DTN Protocols

### Forwarding Based

Where each message may only be under the custody of a single node.

* Upon forwarding the message, the receiving node also takes on the responsibility of custody. 
* This means there will exist only one copy of the message within the network at any period of time.

#### Direct Transmission

* Direct transmission is the simplest single-copy forwarding protocol possible.
* Once the source has generated a message, it will retain custody and carry it until it encounters the destination.
* Once a connection with the destination is established, the message is forwarded directly
  * This uses minimal resources
  * Has unbounded amounts of latency
  * Probability of a message being delivered is only as likely as the probability of the node encountering the destination node

#### First Contact

* First contact is a single-copy based forwarding protocol - it randomly chooses a node out of all possible nodes and forwards as many messages as possible to that node.
* If no connections are available, the first encountered node will be used.
* Once the message(s) are sent, the messages on the original node are deleted, relinquishing custody to the new node.
* This protocol routes messages throughout the network via a random walk pattern.
  * This can lead to packets being routed to dead ends.
  * Packets can make negative progress or getting stuck in a loop.

### Replication Based

Replication-based protocols disseminate messages throughout the network via replication of the messages.

* When one node encounters another, it will forward the message while retaining the local copy it has.
  * The existence of multiple copies increases the probability of message delivery and reduces latency.
  * The more nodes carrying the message, the more chance one node encounters the destination.
* However this also means there are many redundant messages on the network - therefore more resources are needed.

#### Epidemic

* Utilising  the flooding concept, Epidemic aims to achieve message delivery by flooding the network with message copies.
* When any two nodes meet, they compare messages.
  * They then exchange messages they do not have in common
  * This is repeated allowing the messages to spread similar to an epidemic.
* This method achieves minimal latency & high delivery probabilities however suffers from limited resources.

#### MaxProp

* Like epidemic, maxprop floods the network, however each message has a priority.
  * Messages stored in a **ordered-queue** in the **message buffer**.
  * Messages with a higher probability of being delivered have a higher priory of being forwarded first.
* To determine the probability, it looks at **history of encounters**, maintaining a vector with **tracks the likelihood of the node encountering any other node in the network**.
  * When two nodes meet, they exchange messages and vectors, updating their own local copy.
  * These vectors are then used to compute the shortest path for each message, messages are then ordered within the buffer by destination cost.
* MaxProp uses overhead messages to acknowledge when a message has reached it destination
  * Once this ACK signal is received, all local copies of redundant messages are dropped.

#### PROPHET

Probabilistic Routing Protocol using History of Encounters and Transitivity (PRoPHET) 

* PROPHET maintains a vector that keeps track of a history of the encountered nodes.
* It uses this vector to calculate the probability of a message copy reaching its destination by being forwarded to a particular node.
  * When a source node forwards a message copy, it selects a subset of nodes that it can possibly send to.
  * The algorithm then **ranks these nodes** based on the calculated probabilities, with the copy being forwarded to the highest ranked nodes first.
* This is effective however the routing tables **rapidly grow** as a result of the amount of information on the nodes required to calculate the probability predictions.

