Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to TCP from UDP #909

Closed
JayArrowz opened this issue Aug 30, 2019 · 5 comments
Closed

Convert to TCP from UDP #909

JayArrowz opened this issue Aug 30, 2019 · 5 comments
Assignees
Labels
Enhancement 👷 New feature or request

Comments

@JayArrowz
Copy link
Collaborator

JayArrowz commented Aug 30, 2019

Feature Request

Is your feature request related to a problem? Please describe.
Currently in the system the Transaction object can hold many entries. However if the Transaction object and other proto objects designed to send over UDP become greater than 1472 bytes the UDP packet will fragment over the IP layer.

See Ref: https://support.citrix.com/article/CTX115434

Currently our system does not support fragmentation

Describe the solution you'd like
Use the Replaying Decoder in Netty to support UDP fragmentation.

Describe alternatives you've considered

  • Limit the entries is a alternative
  • Or we could manually chunk the packet every 1470 bytes.
@JayArrowz JayArrowz added Bug 🐛 Something isn't working Enhancement 👷 New feature or request labels Aug 30, 2019
@JayArrowz JayArrowz added the Help Wanted 🙋 use when seeking help label Aug 30, 2019
@JayArrowz
Copy link
Collaborator Author

Edit: Did some more research on this, in fact packet fragmentation is bad. The MTU the IPv4 protocol can support is 576 - UDP datagram header bytes after this Mr Fragmentation starts.

https://en.wikipedia.org/wiki/Maximum_transmission_unit
"The Internet Protocol requires that hosts must be able to process IP datagrams of at least 576 bytes (for IPv4) or 1280 bytes (for IPv6). However, this does not preclude link layers with an MTU smaller than this minimum MTU from conveying IP data. For example, according to IPv6's specification, if a particular link layer cannot deliver an IP datagram of 1280 bytes in a single frame, then the link layer must provide its own fragmentation and reassembly mechanism, separate from the IP fragmentation mechanism, to ensure that a 1280-byte IP datagram can be delivered, intact, to the IP layer.
"

Mr Fragmentation causes the packet to split up, if 1 fragment is not caught the whole datagram is lost. This is why it is better to chunk/fragment the packet inside our own application so we have control over failure and re-requesting.

@nshCore nshCore assigned JayArrowz and unassigned nshCore and CAT-OPS Sep 13, 2019
@nshCore
Copy link
Contributor

nshCore commented Sep 13, 2019

@atlassanjay why don't you for now put a method in the pipeline flush handler that counts the bytes if it is over the size limit chunk the message,

on the other end you can read a field saying "is_chunked" which buffers the packet until all chunks are received.

depending on time to implement you could put placeholders in and throw an exception if too big.

@nshCore
Copy link
Contributor

nshCore commented Nov 15, 2019

freezing this for now as we are not experiencing UDP packet fragmentation but something to be considered

@nshCore nshCore added this to the poa-testnet milestone Nov 18, 2019
@Xela101
Copy link

Xela101 commented Dec 13, 2019

I think this will be more difficult then just using a ReplayingDecoder(Unless it supports the following), that would work for TCP but a UDP packet fragment can arrive unordered, might get dropped from an invalid checksum and won't get retried unless a custom header is built over the packet that has ordering and retry logic.

@JayArrowz
Copy link
Collaborator Author

JayArrowz commented Dec 16, 2019

Yeah i think a custom fragmenting & retry system would be needed on the application layer instead of allowing the IP layer to fragment the packets. By having this in the application we have control over fragmentation and retries.

@nshCore nshCore modified the milestones: poa-testnet, pbft-testnet Jan 27, 2020
@sudhirtibrewal sudhirtibrewal removed this from the pbft-testnet milestone Feb 25, 2020
@sudhirtibrewal sudhirtibrewal added this to the Full Consensus Sprint 1 milestone Apr 7, 2020
@sudhirtibrewal sudhirtibrewal changed the title UDP Packet Fragmentation Convert to TCP from UDP Apr 7, 2020
@sudhirtibrewal sudhirtibrewal removed the Bug 🐛 Something isn't working label Apr 22, 2020
@sudhirtibrewal sudhirtibrewal removed the Help Wanted 🙋 use when seeking help label May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 👷 New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants