Skip to content

Instantly share code, notes, and snippets.

@davalapar
Last active July 26, 2018 20:15
Show Gist options
  • Save davalapar/ba7a808953e9ce77de162b5c11aeafa6 to your computer and use it in GitHub Desktop.
Save davalapar/ba7a808953e9ce77de162b5c11aeafa6 to your computer and use it in GitHub Desktop.
Latency.md

https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

Dijkstra's algo can be used for path-finding in a p2p network, which comes handy when relaying information as a unicast (between 2 peers) or multicast (between 3 peers). Instead of relying on the very unreliable geographical data (lat/long) their devices can provide, their network latency values can used instead.

Requirements:

  1. Clients should determine the latency of their direct peers periodically.
  2. Clients should be able to relay the messages in a forward and backward manner
  3. Client should be able to group the messages
  4. Encoding of messages

Considerations:

  1. Network overhead: Every size(x) if a message sent linearly grows by the number of hops (y) required to reach the receiver.
  2. Message switching requirements: https://www.techopedia.com/definition/20681/message-switching
  3. Round-trip delay time: https://en.wikipedia.org/wiki/Latency_(engineering)#Packet-switched_networks

Sample use case:

  1. Verifying a query / resource
  2. Establishing a WebRTC connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment