Repository navigation
MTU Path discovery - #3633
MTU Path discovery#3633Wunka wants to merge 60 commits into
Conversation
|
So, a problem we have: |
At the end of the data it probably doesn't matter. Both techniques have performance impacts, and as long as the algorithm guarantees that only a small fraction of the throughput is probes, it shouldn't matter. |
IntegratedQuantum
left a comment
There was a problem hiding this comment.
Haven't reviewed the actual MTU discovery code yet, I'll check it another day
| try windowsError(c.WSAGetLastError()); | ||
| return error.UNKNOWN; | ||
| } | ||
| const setting: c_int = 1; |
There was a problem hiding this comment.
Instead of numbers, coud you maybe use c.TRUE?
| lossyChannel: Channel, // TODO: Actually allow it to be lossy | ||
| secureChannel: SecureChannel, | ||
| slowChannel: Channel, | ||
| slowChannel: ProbeChannel, |
There was a problem hiding this comment.
As mentioned in the call, the slow channel is independent, and instead you should just add a separate check at the callsite of slowChannel.sendNextPacketAndGetSize
Then you also don't need to introduce this wrapper channel, instead you can just add another helping function to the MtuHandler struct (which is where this functionality belongs anyways).
There was a problem hiding this comment.
Oh. I was not yet done with doing everything from the call. That's why this is still there
There was a problem hiding this comment.
Ah, I just saw it on the PR board and thought it was ready
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
| searching: struct { | ||
| firstProbe: bool = true, | ||
| probedSize: u16 = undefined, | ||
| probeSequenceIndex: ?SequenceIndex = null, |
There was a problem hiding this comment.
Do we really need this? The RFC mentions it should be used to protect against off-path data. We should maybe explicitly handle this threat for the whole protocol. Either way a sequence number that starts at 0 and is inspectible from any client that joins is not providing any protection anyways. Maybe make a new issue for this.
Here I'd suggest to just send the probe size in the confirmation, that's enough to identify it, and makes the whole thing a little simpler.
There was a problem hiding this comment.
This was actually originally to go around the need to have a SequenceIndex.
There was a problem hiding this comment.
Huh? This answer makes no sense. You use a SequenceIndex to go around the need for a SequenceIndex???
There was a problem hiding this comment.
... okay maybe was wrongly explained. If I remember correctly I added that because on the receiving side it would especially try to read for a sequence Index. Before giving the rest of the date the the correct channel. So that's the reason I even added the sequenceIndex
There was a problem hiding this comment.
As far as I can see it only does that for lossy/secure/slow, I don't see anywhere where it reads this from the buffer.
And in the Confirmation packet you can jsut send the length instead of the sequence index.
|
Has conflicts now, due to the currentFrame refactor #3733 |
|
|
||
| self.searching.probeCount = 0; | ||
| self.searching.nextProbeTime = 0; // next probe can be send | ||
| conn.mtuHandler.mtuEstimate = @intCast(probeLen); |
There was a problem hiding this comment.
I'd suggest to still check the length against the length of the probe sent, otherwise this may cause the value to reset to a lower one.
| return self.probingState.receiveConfirmationAndGetTimestamp(conn, sequenceIndex); | ||
| fn receiveConfirmationAndGetTimestamp(self: *MtuHandler, sequenceIndex: SequenceIndex) ?SendBuffer.ReceiveConfirmationResult { | ||
| self.lossCounter = 0; | ||
| self.maxLossSize = 0; |
There was a problem hiding this comment.
These can only be reset if the received probe length actually was >= the maxLossSize
There was a problem hiding this comment.
I would expect it to be bigger, but yes. that if is good.
IntegratedQuantum
left a comment
There was a problem hiding this comment.
you forgot about https://github.com/PixelGuys/Cubyz/pull/3633/changes#r4372262506
also now that a few things have changed, I think it would make sense to make another test over the wire this weekend.
| try windowsError(c.WSAGetLastError()); | ||
| return error.UNKNOWN; | ||
| } | ||
| const setting: c_int = c.true; |
There was a problem hiding this comment.
Where does true come from? Windows API uses TRUE
There was a problem hiding this comment.
It was given to me by zls. I wanted to try out if it works, that's why I triggered the CI. Seems to. interesting. But to stay consistent. I changed it to TRUE for windows
There was a problem hiding this comment.
But macos does expect you to use true here, or is that also something that came from autocomplete?
There was a problem hiding this comment.
autocomplete. And works on macos, linux and windows
There was a problem hiding this comment.
maybe someting translate-c just adds?
There was a problem hiding this comment.
I'd suggest to just hardcode 1 here then.
There was a problem hiding this comment.
What about @intFromBool(true); or do you not like this?
There was a problem hiding this comment.
either way. I changed to = 1
There was a problem hiding this comment.
I think we should be explicit, when the API wants a number we should use a number, or the corresponding macro for that number.
Closes #819
This has still one big problem:
Changes:
probingState. This + theconnectionStateabout represent the State machine in RFC 8899. The only state missing is the Error state.ProbeChannel. That means it will query on the connectionsprobingStateif it should send a probe and if yes it queries which size it should have and gives theprobingStatetheSequenzIndexof the probe. With this we can then identify when a confirmation is for the probemtuMin. Here we can maybe in the future make better heuristics. But I don't think networking is such a bottleneck that we need that.