Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There have been a few issues accumulating that requires a protocol update to implement. Planned changes:
u64
tou32
Stream ID
Rationale
There has been no reason to have two ports like actual TCP/IP. The only purpose of this field is to uniquely identify multiplexed channel. Using a single
u32
allows 65536 times more concurrent channels with the same frame overhead.Potential Considerations
The stream ID probably has to be generated by the client, since the client initiates the channel.
With two ports, each side maintains a connection hash table based on the port number, so duplicate ports never affects the other side. However, now one side is responsible for generating the stream ID, the server needs to be able to deal with ill-implemented clients generating duplicate stream IDs.
Proposed solution: once a duplicate
Syn
is detected, it isRst
ed and both the original (established) channel and this new channel are aborted.Bind
Rationale
This would allow the client to ask the server to bind to a port, which makes it possible to implement #24 and SOCKS5
BIND
.Potential Considerations
The server now needs to be able to initiate channels for incoming connections, so the code for establishing new channels needs to become symmetrical, at least more so.
32-bit rwnd
Rationale
In this implementation, the default
rwnd
has been2<<9
which is far lower than2<<63
. Usingu32
will allowpenguin
to work on platforms with noAtomicU64
.Potential Considerations
None right now.