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

[M2] Improve acknowledgements. #19

Open
6 tasks
evanlinjin opened this issue Jul 4, 2019 · 0 comments
Open
6 tasks

[M2] Improve acknowledgements. #19

evanlinjin opened this issue Jul 4, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@evanlinjin
Copy link

evanlinjin commented Jul 4, 2019

Depends on #36

Feature description

ACK frames serve as both: a method to ensure reliable delivery (just in case the remote client shuts down), and a way of basic flow control.

The way it is currently implemented can be improved to allow greater performance.

Is your feature request related to a problem? Please describe.

In the current state of the system, a (*dmsg.Transport).Write() operation awaits to receive an ACK frame from the remote Client. This is both time consuming and resource-intensive (as we have to use ioutil.AckWaiter to align sequences of both ends of the transport).

Describe the solution you'd like

  • dmsg.Transport should have fields that keep track of the local and remote window sizes (the buffer size left in bytes).
  • REQUEST and ACCEPT frames should contain window sizes. And each edge keeps track of the remote edge's window size and stops sending when it is maxed out (when this happens, the Write operation should block).
  • Write operations no longer needs to wait for an ACK frame from remote.
  • ACK frames are sent on every Read operation and contain the number of bytes read. The remote then increases the tracked window size by that amount.

Describe alternatives you've considered

We can also make the dmsg.Server be responsible for sending the ACK frames after the FWD is forwarded. However, this doesn't give us the ability to do flow control, and it is not as performant as the aforementioned solution.

Possible implementation

  • Add window size fields to dmsg.Transport
  • Add window sizes to REQUEST and ACCEPT frames.
  • Remove awaiting for ACK after Write() operation.
  • Send ACK after every Read() operation, which includes number of bytes read.
  • Add logic to handle ACK frames, that adds to remaining window size.
  • Write operation should block until remote window size frees up.
@evanlinjin evanlinjin added the enhancement New feature or request label Jul 4, 2019
@evanlinjin evanlinjin added this to To do in Skywire Mainnet via automation Jul 4, 2019
@evanlinjin evanlinjin changed the title Improve acknowledgements. [M2] Improve acknowledgements. Aug 26, 2019
@evanlinjin evanlinjin removed this from To do in Skywire Mainnet Aug 26, 2019
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

1 participant