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

Fix conjunction in tcp_output_really_helper, adjust to specification #40

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

dinosaure
Copy link
Contributor

Not sure if this is the right patch, but we (/cc @reynir) spent the day looking at Sequences and Acknowledge numbers to realize that at one point, the unikernel's Sequence was decrementing. The comment above specifies that this should be the case if we receive FIN, which is not our case. I think that, due to the associativity of the || and && operators, the result of the condition becomes true and µTCP decrements the Sequence when it shouldn't. So we've just added parenthesis (by feelings).

With this fix, we can do a test with iperf3 of our unikernel (which claims a speed of 2Mbytes/s... but that's another problem).

@hannesm
Copy link
Contributor

hannesm commented Mar 13, 2025

Thanks a lot, I'll review this next week.

@hannesm
Copy link
Contributor

hannesm commented Mar 17, 2025

From the specification:

    let snd_nxt' = if FIN /\ (cb.snd_nxt + LENGTH data_to_send = last_sndq_data_seq+1 /\
                      cb.snd_una  <> cb.iss \/ Num(cb.snd_nxt - cb.iss) = 2) then
		     cb.snd_nxt - 1
                   else
		     cb.snd_nxt in

So, there's a parenthesis -- but it is right after the FIN && -- would the suggestion below work for you as well?

Adjust the code to the specification.
@hannesm hannesm changed the title Not sure, but it seems to work Fix conjunction in tcp_output_really_helper, adjust to specification Mar 17, 2025
@hannesm hannesm merged commit 369e4fb into robur-coop:main Mar 17, 2025
1 check passed
@hannesm
Copy link
Contributor

hannesm commented Mar 17, 2025

Thanks a lot for your investigations and the proposed fix!

@dinosaure dinosaure deleted the fix-utcp branch March 17, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants