Datagram's are fun

Hello, I see from the spec that implementing streams over datagram transports is on the roadmap. As this is fascinating, there are two other important uses of, UDP specifically, for p2p networks to leverage that I’d like to make the case for inclusion.

I’m able to compare the UDP and TCP headers and ‘copy over’ the missing fields into the user data portion of UDP, then implement the TCP timing mechanisms in order to archive a TCP like transport over datagram transports. Is that what you’re looking for?

Other datagram uses for p2p networks can all benefit from having an acknowledge receipt mechanism. Readily identify ably they are datagram reply, dirtect stream, indirect(like publishing to the DHT). Otherwise, for UDP mostly, retry is advisable.

One case where datagrams are useful is when “I have X” or even “Here is X”. Gnutella uses this to advertise search matches. The other case is “Please take X”, this would be useful for DHT inserts. These should be achievable with Single Packet Authorization.

To summaries when talking about p2p and datagrams there are 7 things to keep in mind.

  1. stream masquerading
  2. datagram ack
  3. stream ack, this includes using autorelay IMHO
  4. p2p network ack
  5. advertising or presenting an item
  6. distributing an item
  7. SPA