-
Notifications
You must be signed in to change notification settings - Fork 1
Description
UDP is sufficient If the communication is simply sending a PullRequest to a random peer. However, this library's PullResponse payload size is unpredictable and will likely exceed the safe from packet fragmentation UDP size of 508 bytes(The minimum size of IPv4 datagram every device has to be able to receive(i.e. MTU) is 576 byte. And IP header(with fully option field) is 60 byte, UDP header is 8 byte. so I guess safety maximum UDP packet size from packet fragmentation is 508(576 - 60 - 8) byte).
The current implementation cuts packets at the application level and sends them over UDP to avoid packet fragmentation.
I realized there is no clear reason to use UDP When I asked myself Why use UDP and not TCP?.
All communication in the library will use TCP instead of UDP.