Skip to content

Use TCP instead of UDP #3

@dbadoy

Description

@dbadoy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions