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

Client: multiplex connection data streams #1720

Merged
merged 26 commits into from Nov 11, 2022

Conversation

octol
Copy link
Contributor

@octol octol commented Oct 28, 2022

Description

Closes: #1939
Part of: #1960

Transmission lanes

Introduces the concept of TransmissionLanes in client-core.

pub enum TransmissionLane {
    General,
    Reply,
    Retransmission,
    Control,
    ConnectionId(ConnectionId),
}

The idea is that the OutQueueControl will multiplex sphinx packets according to these categories. Large data transfers will not block other connections, and smaller messages will be given priority.

Tagging messages

The SOCKS5 client will tag sent messages accordingly, and is relatively straightforward as it owns the whole pipeline from incoming TCP connection to transmitting sphinx packets to the gateway via the gateway-client.

The network-requester however, will need to modify ClientRequest to append a connection_id to ClientRequest::Send, as well as add another message type, ClientRequest::CloseConnection(..).

Connection handling in the OutQueueControl

Because there might be a not insignificant delay between accepting TCP connections and transmitting the sphinx packets, depending on load, the OutQueueControl needs to be able to discard packets destined for a stale and closed connection.

Message priority in OutQueueControl

Initially a very rudimentary heuristic is used to prioritize packets in the OutQueueControl, where small packets will be sent first.

Testing

Confirmed in keybase that:

  1. sending a large video in keybase at the same time as
  2. doing a ping with curl --socks5-hostname localhost:1080 https://nymtech.net/.wellknown/connect/healthcheck.json
    does not affect each other (too much)

TODO

  • Multiplex outgoing connections in nym-socks5-client
  • Multiplex outgoing connections originating from nym-network-requester
  • We need a way to signal that closed or stale connections should be removed from the out queue controller
  • Better packet prioritization. Let small packets through.

Checklist:

  • added a changelog entry to CHANGELOG.md

@octol octol changed the title SOCKS5: multiplex outgoing connections in out queue controller SOCKS5: multiplex connections Nov 2, 2022
@octol octol marked this pull request as ready for review November 7, 2022 13:55
@octol octol force-pushed the jon/feat/multiplex-connections-out-queue-controller branch from daf03e9 to 50a009d Compare November 10, 2022 00:01
@octol octol changed the title SOCKS5: multiplex connections Client: multiplex connections Nov 10, 2022
@octol octol changed the title Client: multiplex connections Client: multiplex connection data streams Nov 11, 2022
@octol octol force-pushed the jon/feat/multiplex-connections-out-queue-controller branch from f805a10 to dade30c Compare November 11, 2022 09:27
@octol octol merged commit d912844 into develop Nov 11, 2022
@octol octol deleted the jon/feat/multiplex-connections-out-queue-controller branch November 11, 2022 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client and SOCKS5 connection multiplexing
2 participants